diff options
author | Keith Packard <keithp@keithp.com> | 2013-01-08 16:47:05 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-10-31 13:07:46 -0700 |
commit | adf920aa25c1709998c7c9276927061bd58e2dfc (patch) | |
tree | 56170ded539860b1b9c7c33bc509f1b5dbdcaf60 /Xtransint.h | |
parent | 9e8d99c2e27f2c8acbbfb5b760649aa1bfad665e (diff) | |
download | xorg-lib-libxtrans-adf920aa25c1709998c7c9276927061bd58e2dfc.tar.gz |
Add APIs to send file descriptors through the network
Exposes new TRANS(SendFd)/TRANS(RecvFd) APIs.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xtransint.h')
-rw-r--r-- | Xtransint.h | 24 |
1 files changed, 24 insertions, 0 deletions
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 */ ); |