Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_pcb.h
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | |||||
* socket has been freed), or there may be close(2)-related races. | * socket has been freed), or there may be close(2)-related races. | ||||
* | * | ||||
* The inp_vflag field is overloaded, and would otherwise ideally be (c). | * The inp_vflag field is overloaded, and would otherwise ideally be (c). | ||||
* | * | ||||
* TODO: Currently only the TCP stack is leveraging the global pcbinfo lock | * TODO: Currently only the TCP stack is leveraging the global pcbinfo lock | ||||
* read-lock usage during modification, this model can be applied to other | * read-lock usage during modification, this model can be applied to other | ||||
* protocols (especially SCTP). | * protocols (especially SCTP). | ||||
*/ | */ | ||||
struct m_snd_tag; | |||||
struct inpcb { | struct inpcb { | ||||
LIST_ENTRY(inpcb) inp_hash; /* (h/i) hash list */ | LIST_ENTRY(inpcb) inp_hash; /* (h/i) hash list */ | ||||
LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */ | LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */ | ||||
LIST_ENTRY(inpcb) inp_list; /* (p/l) list for all PCBs for proto */ | LIST_ENTRY(inpcb) inp_list; /* (p/l) list for all PCBs for proto */ | ||||
/* (p[w]) for list iteration */ | /* (p[w]) for list iteration */ | ||||
/* (p[r]/l) for addition/removal */ | /* (p[r]/l) for addition/removal */ | ||||
void *inp_ppcb; /* (i) pointer to per-protocol pcb */ | void *inp_ppcb; /* (i) pointer to per-protocol pcb */ | ||||
struct inpcbinfo *inp_pcbinfo; /* (c) PCB list info */ | struct inpcbinfo *inp_pcbinfo; /* (c) PCB list info */ | ||||
struct inpcbgroup *inp_pcbgroup; /* (g/i) PCB group list */ | struct inpcbgroup *inp_pcbgroup; /* (g/i) PCB group list */ | ||||
LIST_ENTRY(inpcb) inp_pcbgroup_wild; /* (g/i/h) group wildcard entry */ | LIST_ENTRY(inpcb) inp_pcbgroup_wild; /* (g/i/h) group wildcard entry */ | ||||
struct socket *inp_socket; /* (i) back pointer to socket */ | struct socket *inp_socket; /* (i) back pointer to socket */ | ||||
struct ucred *inp_cred; /* (c) cache of socket cred */ | struct ucred *inp_cred; /* (c) cache of socket cred */ | ||||
u_int32_t inp_flow; /* (i) IPv6 flow information */ | u_int32_t inp_flow; /* (i) IPv6 flow information */ | ||||
int inp_flags; /* (i) generic IP/datagram flags */ | int inp_flags; /* (i) generic IP/datagram flags */ | ||||
int inp_flags2; /* (i) generic IP/datagram flags #2*/ | int inp_flags2; /* (i) generic IP/datagram flags #2*/ | ||||
u_char inp_vflag; /* (i) IP version flag (v4/v6) */ | u_char inp_vflag; /* (i) IP version flag (v4/v6) */ | ||||
u_char inp_ip_ttl; /* (i) time to live proto */ | u_char inp_ip_ttl; /* (i) time to live proto */ | ||||
u_char inp_ip_p; /* (c) protocol proto */ | u_char inp_ip_p; /* (c) protocol proto */ | ||||
u_char inp_ip_minttl; /* (i) minimum TTL or drop */ | u_char inp_ip_minttl; /* (i) minimum TTL or drop */ | ||||
uint32_t inp_flowid; /* (x) flow id / queue id */ | uint32_t inp_flowid; /* (x) flow id / queue id */ | ||||
u_int inp_refcount; /* (i) refcount */ | u_int inp_refcount; /* (i) refcount */ | ||||
void *inp_pspare[5]; /* (x) packet pacing / general use */ | struct m_snd_tag *inp_snd_tag; /* (i) send tag for outgoing mbufs */ | ||||
void *inp_pspare[4]; /* (x) general use */ | |||||
uint32_t inp_flowtype; /* (x) M_HASHTYPE value */ | uint32_t inp_flowtype; /* (x) M_HASHTYPE value */ | ||||
uint32_t inp_rss_listen_bucket; /* (x) overridden RSS listen bucket */ | uint32_t inp_rss_listen_bucket; /* (x) overridden RSS listen bucket */ | ||||
u_int inp_ispare[4]; /* (x) packet pacing / user cookie / | u_int inp_ispare[4]; /* (x) user cookie / general use */ | ||||
* general use */ | |||||
/* Local and foreign ports, local and foreign addr. */ | /* Local and foreign ports, local and foreign addr. */ | ||||
struct in_conninfo inp_inc; /* (i) list for PCB's local port */ | struct in_conninfo inp_inc; /* (i) list for PCB's local port */ | ||||
/* MAC and IPSEC policy information. */ | /* MAC and IPSEC policy information. */ | ||||
struct label *inp_label; /* (i) MAC label */ | struct label *inp_label; /* (i) MAC label */ | ||||
struct inpcbpolicy *inp_sp; /* (s) for IPSEC */ | struct inpcbpolicy *inp_sp; /* (s) for IPSEC */ | ||||
▲ Show 20 Lines • Show All 393 Lines • ▼ Show 20 Lines | |||||
#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 */ | ||||
#define INP_FREED 0x00000010 /* inp itself is not valid */ | #define INP_FREED 0x00000010 /* inp itself is not valid */ | ||||
#define INP_REUSEADDR 0x00000020 /* SO_REUSEADDR option is set */ | #define INP_REUSEADDR 0x00000020 /* SO_REUSEADDR option is set */ | ||||
#define INP_BINDMULTI 0x00000040 /* IP_BINDMULTI option is set */ | #define INP_BINDMULTI 0x00000040 /* IP_BINDMULTI option is set */ | ||||
#define INP_RSS_BUCKET_SET 0x00000080 /* IP_RSS_LISTEN_BUCKET is set */ | #define INP_RSS_BUCKET_SET 0x00000080 /* IP_RSS_LISTEN_BUCKET is set */ | ||||
#define INP_RECVFLOWID 0x00000100 /* populate recv datagram with flow info */ | #define INP_RECVFLOWID 0x00000100 /* populate recv datagram with flow info */ | ||||
#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 */ | |||||
/* | /* | ||||
* Flags passed to in_pcblookup*() functions. | * Flags passed to in_pcblookup*() functions. | ||||
*/ | */ | ||||
#define INPLOOKUP_WILDCARD 0x00000001 /* Allow wildcard sockets. */ | #define INPLOOKUP_WILDCARD 0x00000001 /* Allow wildcard sockets. */ | ||||
#define INPLOOKUP_RLOCKPCB 0x00000002 /* Return inpcb read-locked. */ | #define INPLOOKUP_RLOCKPCB 0x00000002 /* Return inpcb read-locked. */ | ||||
#define INPLOOKUP_WLOCKPCB 0x00000004 /* Return inpcb write-locked. */ | #define INPLOOKUP_WLOCKPCB 0x00000004 /* Return inpcb write-locked. */ | ||||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | |||||
int in_pcbrele_wlocked(struct inpcb *); | int in_pcbrele_wlocked(struct inpcb *); | ||||
void in_losing(struct inpcb *); | void in_losing(struct inpcb *); | ||||
void in_pcbsetsolabel(struct socket *so); | void in_pcbsetsolabel(struct socket *so); | ||||
int in_getpeeraddr(struct socket *so, struct sockaddr **nam); | int in_getpeeraddr(struct socket *so, struct sockaddr **nam); | ||||
int in_getsockaddr(struct socket *so, struct sockaddr **nam); | int in_getsockaddr(struct socket *so, struct sockaddr **nam); | ||||
struct sockaddr * | struct sockaddr * | ||||
in_sockaddr(in_port_t port, struct in_addr *addr); | in_sockaddr(in_port_t port, struct in_addr *addr); | ||||
void in_pcbsosetlabel(struct socket *so); | void in_pcbsosetlabel(struct socket *so); | ||||
#ifdef RATELIMIT | |||||
int in_pcbattach_txrtlmt(struct inpcb *, struct ifnet *, uint32_t, uint32_t, uint32_t); | |||||
void in_pcbdetach_txrtlmt(struct inpcb *); | |||||
int in_pcbmodify_txrtlmt(struct inpcb *, uint32_t); | |||||
int in_pcbquery_txrtlmt(struct inpcb *, uint32_t *); | |||||
void in_pcboutput_txrtlmt(struct inpcb *, struct ifnet *, struct mbuf *); | |||||
void in_pcboutput_eagain(struct inpcb *); | |||||
#endif | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* !_NETINET_IN_PCB_H_ */ | #endif /* !_NETINET_IN_PCB_H_ */ |