From 34016444534120f2fa5a049675815843d041bc16 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 11 Aug 2023 15:12:21 +1000 Subject: epoll: Generalize epoll_ref to cover things other than sockets The epoll_ref type includes fields for the IP protocol of a socket, and the socket fd. However, we already have a few things in the epoll which aren't protocol sockets, and we may have more in future. Rename these fields to an abstract "fd type" and file descriptor for more generality. Similarly, rather than using existing IP protocol numbers for the type, introduce our own number space. For now these just correspond to the supported protocols, but we'll expand on that in future. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tcp_conn.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tcp_conn.h') diff --git a/tcp_conn.h b/tcp_conn.h index 9e2b1bf..0b36940 100644 --- a/tcp_conn.h +++ b/tcp_conn.h @@ -62,7 +62,7 @@ struct tcp_tap_conn { unsigned int ws_to_tap :TCP_WS_BITS; - int sock :SOCKET_REF_BITS; + int sock :FD_REF_BITS; uint8_t events; #define CLOSED 0 @@ -80,7 +80,7 @@ struct tcp_tap_conn { (SOCK_ACCEPTED | TAP_SYN_RCVD | ESTABLISHED) - int timer :SOCKET_REF_BITS; + int timer :FD_REF_BITS; uint8_t flags; #define STALLED BIT(0) -- cgit v1.2.3