Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_pcb.h
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
* IP transport protocols. | * IP transport protocols. | ||||
* | * | ||||
* Pointers to local and foreign host table entries, local and foreign socket | * Pointers to local and foreign host table entries, local and foreign socket | ||||
* numbers, and pointers up (to a socket structure) and down (to a | * numbers, and pointers up (to a socket structure) and down (to a | ||||
* protocol-specific control block) are stored here. | * protocol-specific control block) are stored here. | ||||
*/ | */ | ||||
CK_LIST_HEAD(inpcbhead, inpcb); | CK_LIST_HEAD(inpcbhead, inpcb); | ||||
CK_LIST_HEAD(inpcbporthead, inpcbport); | CK_LIST_HEAD(inpcbporthead, inpcbport); | ||||
CK_LIST_HEAD(inpcblbgrouphead, inpcblbgroup); | |||||
typedef uint64_t inp_gen_t; | typedef uint64_t inp_gen_t; | ||||
/* | /* | ||||
* PCB with AF_INET6 null bind'ed laddr can receive AF_INET input packet. | * PCB with AF_INET6 null bind'ed laddr can receive AF_INET input packet. | ||||
* So, AF_INET6 null laddr is also used as AF_INET null laddr, by utilizing | * So, AF_INET6 null laddr is also used as AF_INET null laddr, by utilizing | ||||
* the following structure. | * the following structure. | ||||
*/ | */ | ||||
struct in_addr_4in6 { | struct in_addr_4in6 { | ||||
▲ Show 20 Lines • Show All 480 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Load balance groups used for the SO_REUSEPORT_LB socket option. Each group | * Load balance groups used for the SO_REUSEPORT_LB socket option. Each group | ||||
* (or unique address:port combination) can be re-used at most | * (or unique address:port combination) can be re-used at most | ||||
* INPCBLBGROUP_SIZMAX (256) times. The inpcbs are stored in il_inp which | * INPCBLBGROUP_SIZMAX (256) times. The inpcbs are stored in il_inp which | ||||
* is dynamically resized as processes bind/unbind to that specific group. | * is dynamically resized as processes bind/unbind to that specific group. | ||||
*/ | */ | ||||
struct inpcblbgroup { | struct inpcblbgroup { | ||||
LIST_ENTRY(inpcblbgroup) il_list; | CK_LIST_ENTRY(inpcblbgroup) il_list; | ||||
struct epoch_context il_epoch_ctx; | |||||
uint16_t il_lport; /* (c) */ | uint16_t il_lport; /* (c) */ | ||||
u_char il_vflag; /* (c) */ | u_char il_vflag; /* (c) */ | ||||
u_char il_pad; | u_char il_pad; | ||||
uint32_t il_pad2; | uint32_t il_pad2; | ||||
union in_dependaddr il_dependladdr; /* (c) */ | union in_dependaddr il_dependladdr; /* (c) */ | ||||
#define il_laddr il_dependladdr.id46_addr.ia46_addr4 | #define il_laddr il_dependladdr.id46_addr.ia46_addr4 | ||||
#define il6_laddr il_dependladdr.id6_addr | #define il6_laddr il_dependladdr.id6_addr | ||||
uint32_t il_inpsiz; /* max count in il_inp[] (h) */ | uint32_t il_inpsiz; /* max count in il_inp[] (h) */ | ||||
uint32_t il_inpcnt; /* cur count in il_inp[] (h) */ | uint32_t il_inpcnt; /* cur count in il_inp[] (h) */ | ||||
struct inpcb *il_inp[]; /* (h) */ | struct inpcb *il_inp[]; /* (h) */ | ||||
}; | }; | ||||
LIST_HEAD(inpcblbgrouphead, inpcblbgroup); | |||||
#define INP_LOCK_INIT(inp, d, t) \ | #define INP_LOCK_INIT(inp, d, t) \ | ||||
rw_init_flags(&(inp)->inp_lock, (t), RW_RECURSE | RW_DUPOK) | rw_init_flags(&(inp)->inp_lock, (t), RW_RECURSE | RW_DUPOK) | ||||
#define INP_LOCK_DESTROY(inp) rw_destroy(&(inp)->inp_lock) | #define INP_LOCK_DESTROY(inp) rw_destroy(&(inp)->inp_lock) | ||||
#define INP_RLOCK(inp) rw_rlock(&(inp)->inp_lock) | #define INP_RLOCK(inp) rw_rlock(&(inp)->inp_lock) | ||||
#define INP_WLOCK(inp) rw_wlock(&(inp)->inp_lock) | #define INP_WLOCK(inp) rw_wlock(&(inp)->inp_lock) | ||||
#define INP_TRY_RLOCK(inp) rw_try_rlock(&(inp)->inp_lock) | #define INP_TRY_RLOCK(inp) rw_try_rlock(&(inp)->inp_lock) | ||||
#define INP_TRY_WLOCK(inp) rw_try_wlock(&(inp)->inp_lock) | #define INP_TRY_WLOCK(inp) rw_try_wlock(&(inp)->inp_lock) | ||||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |