From 2eb287e707ed7efb8b77cb0fc9a90d7e24d06bc3 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 9 Apr 2025 03:19:22 -0600 Subject: 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. --- lib9p/include/lib9p/srv.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib9p/include') 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); -- cgit v1.2.3-2-g168b