diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/socket.c | 18 | ||||
| -rw-r--r-- | src/core/socket.h | 4 |
2 files changed, 22 insertions, 0 deletions
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) { diff --git a/src/core/socket.h b/src/core/socket.h index 8fab08d6..3eb943f4 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -26,7 +26,9 @@ extern bool nni_sock_raw(nni_sock *); extern void *nni_sock_proto_data(nni_sock *); extern void nni_sock_add_stat(nni_sock *, nni_stat_item *); +extern struct nni_proto_sock_ops *nni_sock_proto_ops(nni_sock *); extern struct nni_proto_pipe_ops *nni_sock_proto_pipe_ops(nni_sock *); +extern struct nni_proto_ctx_ops *nni_ctx_proto_ops(nni_ctx *); extern int nni_sock_setopt( nni_sock *, const char *, const void *, size_t, nni_opt_type); @@ -77,6 +79,8 @@ extern int nni_ctx_open(nni_ctx **, nni_sock *); // NNG_ECLOSED unless the final argument is true.) extern int nni_ctx_find(nni_ctx **, uint32_t, bool); +extern void *nni_ctx_proto_data(nni_ctx *); + // nni_ctx_rele is called to release a hold on the context. These holds // are acquired by either nni_ctx_open or nni_ctx_find. If the context // is being closed (nni_ctx_close was called), and this is the last reference, |
