From b3fc8a44119d7ab90366a1b92a5e1327ebcb8145 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 3 Nov 2024 00:51:15 -0700 Subject: Replace NNG_OPT_SUB_SUBSCRIBE/UNSUBSCRIBE with functions. The main purpose is to eliminate the NNI_TYPE_OPAQUE options, by putting these into their own first class, protocol-specific, functions. --- src/core/socket.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index b01938e5..1e0b0404 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -824,6 +824,18 @@ nni_sock_proto_pipe_ops(nni_sock *sock) return (&sock->s_pipe_ops); } +struct nni_proto_sock_ops * +nni_sock_proto_ops(nni_sock *sock) +{ + return (&sock->s_sock_ops); +} + +struct nni_proto_ctx_ops * +nni_ctx_proto_ops(nni_ctx *ctx) +{ + return (&ctx->c_ops); +} + void * nni_sock_proto_data(nni_sock *sock) { @@ -1142,6 +1154,12 @@ nni_ctx_find(nni_ctx **cp, uint32_t id, bool closing) return (rv); } +void * +nni_ctx_proto_data(nni_ctx *ctx) +{ + return (ctx->c_data); +} + static void nni_ctx_destroy(nni_ctx *ctx) { -- cgit v1.2.3-70-g09d2