aboutsummaryrefslogtreecommitdiff
path: root/src/core/protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/protocol.h')
-rw-r--r--src/core/protocol.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/protocol.h b/src/core/protocol.h
index 9416b2bf..0c0d93ce 100644
--- a/src/core/protocol.h
+++ b/src/core/protocol.h
@@ -47,6 +47,12 @@ struct nni_proto_pipe_ops {
void (*pipe_stop)(void *);
};
+struct nni_proto_sock_option {
+ const char *pso_name;
+ int (*pso_getopt)(void *, void *, size_t *);
+ int (*pso_setopt)(void *, const void *, size_t);
+};
+
struct nni_proto_sock_ops {
// sock_init creates the protocol instance, which will be stored on
// the socket. This is run without the sock lock held, and allocates
@@ -68,10 +74,6 @@ struct nni_proto_sock_ops {
// it can signal the socket worker threads to exit.
void (*sock_close)(void *);
- // Option manipulation. These may be NULL.
- int (*sock_setopt)(void *, int, const void *, size_t);
- int (*sock_getopt)(void *, int, void *, size_t *);
-
// Receive filter. This may be NULL, but if it isn't, then
// messages coming into the system are routed here just before being
// delivered to the application. To drop the message, the prtocol
@@ -81,6 +83,9 @@ struct nni_proto_sock_ops {
// Send filter. This may be NULL, but if it isn't, then messages
// here are filtered just after they come from the application.
nni_msg *(*sock_sfilter)(void *, nni_msg *);
+
+ // Options. Must not be NULL. Final entry should have NULL name.
+ nni_proto_sock_option *sock_options;
};
typedef struct nni_proto_id {