summaryrefslogtreecommitdiff
path: root/lib9p/include
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-09 03:19:22 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-13 13:00:58 -0600
commit2eb287e707ed7efb8b77cb0fc9a90d7e24d06bc3 (patch)
tree03dd68b85cb6faf245b2422cc111dc6894bffe95 /lib9p/include
parent2a9d1f54758988ce23fbd1e9da4f0ad28c0edcbf (diff)
lib9p: srv: Implement p9p version negotiation
I've spent enough time thinking about how I would implement this that I should just get it out of my head and into the code.
Diffstat (limited to 'lib9p/include')
-rw-r--r--lib9p/include/lib9p/srv.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib9p/include/lib9p/srv.h b/lib9p/include/lib9p/srv.h
index 7109179..bb5efb9 100644
--- a/lib9p/include/lib9p/srv.h
+++ b/lib9p/include/lib9p/srv.h
@@ -145,11 +145,22 @@ LO_INTERFACE(lib9p_srv_dio);
CR_RPC_DECLARE(_lib9p_srv_reqch, struct lib9p_srv_ctx *, bool);
+#if CONFIG_9P_ENABLE_9P2000_p9p
+#define net_stream_conn_unix_LO_IFACE \
+ LO_NEST(net_stream_conn) \
+ /** Returns 0 on success, -errno on error. */ \
+ LO_FUNC(int, send_unix_fd, int fd)
+LO_INTERFACE(net_stream_conn_unix);
+#endif
+
struct lib9p_srv {
/* Things you provide */
void /*TODO*/ (*auth )(struct lib9p_srv_ctx *, struct lib9p_s treename); /* optional */
lo_interface lib9p_srv_file (*rootdir)(struct lib9p_srv_ctx *, struct lib9p_s treename);
void (*msglog )(struct lib9p_srv_ctx *, enum lib9p_msg_type, void *hostmsg); /* optional */
+#if CONFIG_9P_ENABLE_9P2000_p9p
+ lo_interface net_stream_conn_unix (*type_assert_unix)(lo_interface net_stream_conn); /* optional */
+#endif
/* For internal use */
BEGIN_PRIVATE(LIB9P_SRV_H);