#include <netinet/in_pcb.h>
netinet/in_pcb.h
structin_addr_4in6
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
the following structure.
| u_int32_t[3] | ia46_pad32 | |
| struct in_addr | ia46_addr4 |
struct_inpcb_list_entry
| u_int32_t | le_next | |
| u_int32_t | le_prev |
macro_INPCB_PTR
#define _INPCB_PTR(x) u_int32_t
macro_INPCB_LIST_ENTRY
#define _INPCB_LIST_ENTRY(x) struct _inpcb_list_entry
structinpcb
| struct _inpcb_list_entry | inp_hash | hash list | ||||||||||||||||||||||||||||||
| struct in_addr | reserved1 | reserved | ||||||||||||||||||||||||||||||
| struct in_addr | reserved2 | reserved | ||||||||||||||||||||||||||||||
| u_short | inp_fport | foreign port | ||||||||||||||||||||||||||||||
| u_short | inp_lport | local port | ||||||||||||||||||||||||||||||
| struct _inpcb_list_entry | inp_list | list for all peer PCBs | ||||||||||||||||||||||||||||||
| u_int32_t | inp_ppcb | per-protocol pcb | ||||||||||||||||||||||||||||||
| u_int32_t | inp_pcbinfo | PCB list info | ||||||||||||||||||||||||||||||
| u_int32_t | inp_socket | back pointer to socket | ||||||||||||||||||||||||||||||
| u_char | nat_owner | Used to NAT TCP/UDP traffic | ||||||||||||||||||||||||||||||
| u_int32_t | nat_cookie | Cookie stored and returned to NAT | ||||||||||||||||||||||||||||||
| struct _inpcb_list_entry | inp_portlist | this PCB's local port list | ||||||||||||||||||||||||||||||
| u_int32_t | inp_phd | head of this list | ||||||||||||||||||||||||||||||
| inp_gen_t | inp_gencnt | generation count of this instance | ||||||||||||||||||||||||||||||
| int | inp_flags | generic IP/datagram flags | ||||||||||||||||||||||||||||||
| u_int32_t | inp_flow | |||||||||||||||||||||||||||||||
| u_char | inp_vflag | |||||||||||||||||||||||||||||||
| u_char | inp_ip_ttl | time to live proto | ||||||||||||||||||||||||||||||
| u_char | inp_ip_p | protocol proto | ||||||||||||||||||||||||||||||
| unnamed union at netinet/in_pcb.h:154:2 | inp_dependfaddr | protocol dependent part | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| unnamed union at netinet/in_pcb.h:159:2 | inp_dependladdr | |||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| unnamed union at netinet/in_pcb.h:164:2 | inp_dependroute | |||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| unnamed struct at netinet/in_pcb.h:169:2 | inp_depend4 | |||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| unnamed struct at netinet/in_pcb.h:178:2 | inp_depend6 | |||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| int | hash_element | Array index of pcb's hash list | ||||||||||||||||||||||||||||||
| u_int32_t | inp_saved_ppcb | pointer while cached | ||||||||||||||||||||||||||||||
| u_int32_t | inp_sp | |||||||||||||||||||||||||||||||
| u_int32_t[3] | reserved | reserved | ||||||||||||||||||||||||||||||
structxinpcb
| u_int32_t | xi_len | length of this structure |
| struct inpcb | xi_inp | |
| struct xsocket | xi_socket | |
| u_quad_t | xi_alignment_hack |
structinpcb64_list_entry
| u_int64_t | le_next | |
| u_int64_t | le_prev |
structxinpcb64
| u_int64_t | xi_len | length of this structure | ||||||||||||
| u_int64_t | xi_inpp | |||||||||||||
| u_short | inp_fport | foreign port | ||||||||||||
| u_short | inp_lport | local port | ||||||||||||
| struct inpcb64_list_entry | inp_list | list for all PCBs | ||||||||||||
| u_int64_t | inp_ppcb | ptr to per-protocol PCB | ||||||||||||
| u_int64_t | inp_pcbinfo | PCB list info | ||||||||||||
| struct inpcb64_list_entry | inp_portlist | this PCB's local port list | ||||||||||||
| u_int64_t | inp_phd | head of this list | ||||||||||||
| inp_gen_t | inp_gencnt | current generation count | ||||||||||||
| int | inp_flags | generic IP/datagram flags | ||||||||||||
| u_int32_t | inp_flow | |||||||||||||
| u_char | inp_vflag | |||||||||||||
| u_char | inp_ip_ttl | time to live | ||||||||||||
| u_char | inp_ip_p | protocol | ||||||||||||
| unnamed union at netinet/in_pcb.h:231:2 | inp_dependfaddr | |||||||||||||
| ||||||||||||||
| unnamed union at netinet/in_pcb.h:235:2 | inp_dependladdr | |||||||||||||
| ||||||||||||||
| unnamed struct at netinet/in_pcb.h:239:2 | inp_depend4 | |||||||||||||
| ||||||||||||||
| unnamed struct at netinet/in_pcb.h:242:2 | inp_depend6 | |||||||||||||
| ||||||||||||||
| struct xsocket64 | xi_socket | |||||||||||||
| u_quad_t | xi_alignment_hack | |||||||||||||
structxinpgen
| u_int32_t | xig_len | length of this structure |
| u_int | xig_count | number of PCBs at this time |
| inp_gen_t | xig_gen | generation count at this time |
| so_gen_t | xig_sogen | current socket generation count |
macroINP_IPV6
#define INP_IPV6 0x2
macroINP_V4MAPPEDV6
#define INP_V4MAPPEDV6 0x4
macroinp_faddr
#define inp_faddr inp_dependfaddr.inp46_foreign.ia46_addr4
macroinp_laddr
#define inp_laddr inp_dependladdr.inp46_local.ia46_addr4
macroin6p_faddr
#define in6p_faddr inp_dependfaddr.inp6_foreign
macroin6p_laddr
#define in6p_laddr inp_dependladdr.inp6_local