Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_pcb.h
Context not available. | |||||
struct in_addr ia46_addr4; | struct in_addr ia46_addr4; | ||||
}; | }; | ||||
union in_dependaddr { | |||||
struct in_addr_4in6 id46_addr; | |||||
struct in6_addr id6_addr; | |||||
}; | |||||
/* | /* | ||||
* NOTE: ipv6 addrs should be 64-bit aligned, per RFC 2553. in_conninfo has | * NOTE: ipv6 addrs should be 64-bit aligned, per RFC 2553. in_conninfo has | ||||
* some extra padding to accomplish this. | * some extra padding to accomplish this. | ||||
Context not available. | |||||
u_int16_t ie_fport; /* foreign port */ | u_int16_t ie_fport; /* foreign port */ | ||||
u_int16_t ie_lport; /* local port */ | u_int16_t ie_lport; /* local port */ | ||||
/* protocol dependent part, local and foreign addr */ | /* protocol dependent part, local and foreign addr */ | ||||
union { | union in_dependaddr ie_dependfaddr; /* foreign host table entry */ | ||||
/* foreign host table entry */ | union in_dependaddr ie_dependladdr; /* local host table entry */ | ||||
struct in_addr_4in6 ie46_foreign; | #define ie_faddr ie_dependfaddr.id46_addr.ia46_addr4 | ||||
struct in6_addr ie6_foreign; | #define ie_laddr ie_dependladdr.id46_addr.ia46_addr4 | ||||
} ie_dependfaddr; | #define ie6_faddr ie_dependfaddr.id6_addr | ||||
union { | #define ie6_laddr ie_dependladdr.id6_addr | ||||
/* local host table entry */ | |||||
struct in_addr_4in6 ie46_local; | |||||
struct in6_addr ie6_local; | |||||
} ie_dependladdr; | |||||
u_int32_t ie6_zoneid; /* scope zone id */ | u_int32_t ie6_zoneid; /* scope zone id */ | ||||
}; | }; | ||||
#define ie_faddr ie_dependfaddr.ie46_foreign.ia46_addr4 | |||||
#define ie_laddr ie_dependladdr.ie46_local.ia46_addr4 | |||||
#define ie6_faddr ie_dependfaddr.ie6_foreign | |||||
#define ie6_laddr ie_dependladdr.ie6_local | |||||
/* | /* | ||||
* XXX The defines for inc_* are hacks and should be changed to direct | * XXX The defines for inc_* are hacks and should be changed to direct | ||||
Context not available. | |||||
u_short phd_port; | u_short phd_port; | ||||
}; | }; | ||||
struct inpcblbgroup { | |||||
LIST_ENTRY(inpcblbgroup) il_list; | |||||
uint16_t il_lport; | |||||
u_char il_vflag; | |||||
u_char il_pad; | |||||
uint32_t il_pad2; | |||||
union in_dependaddr il_dependladdr; | |||||
#define il_laddr il_dependladdr.id46_addr.ia46_addr4 | |||||
#define il6_laddr il_dependladdr.id6_addr | |||||
uint32_t il_inpsiz; /* size of il_inp[] */ | |||||
uint32_t il_inpcnt; /* # of elem in il_inp[] */ | |||||
struct inpcb *il_inp[]; | |||||
}; | |||||
LIST_HEAD(inpcblbgrouphead, inpcblbgroup); | |||||
/*- | /*- | ||||
* Global data structure for each high-level protocol (UDP, TCP, ...) in both | * Global data structure for each high-level protocol (UDP, TCP, ...) in both | ||||
* IPv4 and IPv6. Holds inpcb lists and information for managing them. | * IPv4 and IPv6. Holds inpcb lists and information for managing them. | ||||
Context not available. | |||||
struct inpcbhead *ipi_wildbase; /* (p) */ | struct inpcbhead *ipi_wildbase; /* (p) */ | ||||
u_long ipi_wildmask; /* (p) */ | u_long ipi_wildmask; /* (p) */ | ||||
/* | |||||
* Load balanced group used by the SO_REUSEPORT_LB option, | |||||
* hashed by local address and local port. | |||||
*/ | |||||
struct inpcblbgrouphead *ipi_lbgrouphashbase; | |||||
u_long ipi_lbgrouphashmask; | |||||
/* | /* | ||||
* Pointer to network stack instance | * Pointer to network stack instance | ||||
*/ | */ | ||||
Context not available. | |||||
inp_inpcbtotcpcb(struct inpcb *inp); | inp_inpcbtotcpcb(struct inpcb *inp); | ||||
void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, | void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, | ||||
uint32_t *faddr, uint16_t *fp); | uint32_t *faddr, uint16_t *fp); | ||||
short inp_so_options(const struct inpcb *inp); | int inp_so_options(const struct inpcb *inp); | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
rwatson: What are the locking properties of il_inpsiz, il_inpcnt, and il_inp? | |||||
Done Inline ActionsIt might be useful for this comment to mention something about il_inp[] behaviour? rwatson: It might be useful for this comment to mention something about il_inp[] behaviour? | |||||
Context not available. | |||||
(((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask)) | (((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask)) | ||||
#define INP_PCBPORTHASH(lport, mask) \ | #define INP_PCBPORTHASH(lport, mask) \ | ||||
(ntohs((lport)) & (mask)) | (ntohs((lport)) & (mask)) | ||||
#define INP_PCBLBGROUP_PORTHASH(lport, mask) \ | |||||
(ntohs((lport)) & (mask)) | |||||
#define INP_PCBLBGROUP_PKTHASH(faddr, lport, fport) \ | |||||
((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) | |||||
#define INP6_PCBHASHKEY(faddr) ((faddr)->s6_addr32[3]) | #define INP6_PCBHASHKEY(faddr) ((faddr)->s6_addr32[3]) | ||||
/* | /* | ||||
Context not available. | |||||
/* | /* | ||||
* Flags for inp_flags2. | * Flags for inp_flags2. | ||||
*/ | */ | ||||
#define INP_LLE_VALID 0x00000001 /* cached lle is valid */ | #define INP_LLE_VALID 0x00000001 /* cached lle is valid */ | ||||
#define INP_RT_VALID 0x00000002 /* cached rtentry is valid */ | #define INP_RT_VALID 0x00000002 /* cached rtentry is valid */ | ||||
#define INP_PCBGROUPWILD 0x00000004 /* in pcbgroup wildcard list */ | #define INP_PCBGROUPWILD 0x00000004 /* in pcbgroup wildcard list */ | ||||
#define INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */ | #define INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */ | ||||
Context not available. | |||||
#define INP_RECVRSSBUCKETID 0x00000200 /* populate recv datagram with bucket id */ | #define INP_RECVRSSBUCKETID 0x00000200 /* populate recv datagram with bucket id */ | ||||
#define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ | #define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ | ||||
#define INP_ORIGDSTADDR 0x00000800 /* receive IP dst address/port */ | #define INP_ORIGDSTADDR 0x00000800 /* receive IP dst address/port */ | ||||
#define INP_REUSEPORT_LB 0x00001000 /* SO_REUSEPORT_LB option is set */ | |||||
/* | /* | ||||
* Flags passed to in_pcblookup*() functions. | * Flags passed to in_pcblookup*() functions. | ||||
Done Inline ActionsI have no personal objection to this design choice, which is consistent with other hashes here, but someday we should think about something better for all of these hashes! rwatson: I have no personal objection to this design choice, which is consistent with other hashes here… | |||||
Context not available. | |||||
struct inpcb * | struct inpcb * | ||||
in_pcblookup(struct inpcbinfo *, struct in_addr, u_int, | in_pcblookup(struct inpcbinfo *, struct in_addr, u_int, | ||||
struct in_addr, u_int, int, struct ifnet *); | struct in_addr, u_int, int, struct ifnet *); | ||||
struct inpcb * | |||||
in_pcblookup_lbgroup_last(const struct inpcb *inp); | |||||
struct inpcb * | struct inpcb * | ||||
in_pcblookup_mbuf(struct inpcbinfo *, struct in_addr, u_int, | in_pcblookup_mbuf(struct inpcbinfo *, struct in_addr, u_int, | ||||
struct in_addr, u_int, int, struct ifnet *, struct mbuf *); | struct in_addr, u_int, int, struct ifnet *, struct mbuf *); | ||||
Context not available. |
What are the locking properties of il_inpsiz, il_inpcnt, and il_inp?