From adf920aa25c1709998c7c9276927061bd58e2dfc Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 8 Jan 2013 16:47:05 -0800 Subject: Add APIs to send file descriptors through the network Exposes new TRANS(SendFd)/TRANS(RecvFd) APIs. Signed-off-by: Keith Packard --- Xtransint.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'Xtransint.h') diff --git a/Xtransint.h b/Xtransint.h index 3bce8dc..dd886db 100644 --- a/Xtransint.h +++ b/Xtransint.h @@ -72,6 +72,8 @@ from The Open Group. # define XTRANSDEBUG 1 #endif +#define XTRANS_SEND_FDS 1 + #ifdef WIN32 # define _WILLWINSOCK_ #endif @@ -123,6 +125,16 @@ from The Open Group. #define X_TCP_PORT 6000 #endif +#if XTRANS_SEND_FDS + +struct _XtransConnFd { + struct _XtransConnFd *next; + int fd; + int do_close; +}; + +#endif + struct _XtransConnInfo { struct _Xtransport *transptr; int index; @@ -135,6 +147,8 @@ struct _XtransConnInfo { int addrlen; char *peeraddr; int peeraddrlen; + struct _XtransConnFd *recv_fds; + struct _XtransConnFd *send_fds; }; #define XTRANS_OPEN_COTS_CLIENT 1 @@ -275,6 +289,16 @@ typedef struct _Xtransport { int /* size */ ); + int (*SendFd)( + XtransConnInfo, /* connection */ + int, /* fd */ + int /* do_close */ + ); + + int (*RecvFd)( + XtransConnInfo /* connection */ + ); + int (*Disconnect)( XtransConnInfo /* connection */ ); -- cgit v1.2.1