diff options
Diffstat (limited to 'vcl-ldpreload/src/libvcl-ldpreload/vcom_socket.h')
-rw-r--r-- | vcl-ldpreload/src/libvcl-ldpreload/vcom_socket.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vcl-ldpreload/src/libvcl-ldpreload/vcom_socket.h b/vcl-ldpreload/src/libvcl-ldpreload/vcom_socket.h index e966895..56539d1 100644 --- a/vcl-ldpreload/src/libvcl-ldpreload/vcom_socket.h +++ b/vcl-ldpreload/src/libvcl-ldpreload/vcom_socket.h @@ -127,6 +127,15 @@ typedef struct } vcom_epitem_t; +typedef union vcom_epitem_key +{ + struct { + i32 fd; + i32 epfd; + }; + i64 key; +} __EPOLL_PACKED vcom_epitem_key_t; + static inline char * vcom_socket_type_str (vcom_socket_type_t t) { @@ -243,6 +252,15 @@ vepitem_init (vcom_epitem_t * vepitem) } static inline void +vepitemkey_init (vcom_epitem_key_t * epfdfd) +{ + memset (epfdfd, 0, sizeof (*epfdfd)); + + epfdfd->epfd = INVALID_EPFD; + epfdfd->fd = INVALID_FD; +} + +static inline void vsocket_set (vcom_socket_t * vsock, i32 fd, i32 sid, vcom_socket_type_t type) { @@ -287,6 +305,14 @@ vepitem_set (vcom_epitem_t * vepitem, /* vcom epitem attributes set here */ } +static inline void +vepitemkey_set (vcom_epitem_key_t * epfdfd, + i32 epfd, i32 fd) +{ + epfdfd->epfd = epfd; + epfdfd->fd = fd; +} + static inline int vsocket_is_vppcom_bound (vcom_socket_t * vsock) { |