FreeBSD kernel IPv4 code
|
#include <sys/queue.h>
#include <sys/epoch.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
#include <sys/_rwlock.h>
#include <net/route.h>
#include <sys/lock.h>
#include <sys/proc.h>
#include <sys/rwlock.h>
#include <sys/smr.h>
#include <sys/sysctl.h>
#include <net/vnet.h>
#include <vm/uma.h>
#include <sys/ck.h>
Go to the source code of this file.
Data Structures | |
struct | in_addr_4in6 |
union | in_dependaddr |
struct | in_endpoints |
struct | in_conninfo |
struct | inpcb |
struct | inpcbinfo |
struct | inpcbstorage |
struct | inpcblbgroup |
struct | inpcb_iterator |
Macros | |
#define | ie_faddr ie_dependfaddr.id46_addr.ia46_addr4 |
#define | ie_laddr ie_dependladdr.id46_addr.ia46_addr4 |
#define | ie6_faddr ie_dependfaddr.id6_addr |
#define | ie6_laddr ie_dependladdr.id6_addr |
#define | INC_ISIPV6 0x01 |
#define | INC_IPV6MINMTU 0x02 |
#define | inc_fport inc_ie.ie_fport |
#define | inc_lport inc_ie.ie_lport |
#define | inc_faddr inc_ie.ie_faddr |
#define | inc_laddr inc_ie.ie_laddr |
#define | inc6_faddr inc_ie.ie6_faddr |
#define | inc6_laddr inc_ie.ie6_laddr |
#define | inc6_zoneid inc_ie.ie6_zoneid |
#define | inp_start_zero inp_hpts |
#define | inp_zero_size |
#define | inp_fport inp_inc.inc_fport |
#define | inp_lport inp_inc.inc_lport |
#define | inp_faddr inp_inc.inc_faddr |
#define | inp_laddr inp_inc.inc_laddr |
#define | in6p_faddr inp_inc.inc6_faddr |
#define | in6p_laddr inp_inc.inc6_laddr |
#define | in6p_zoneid inp_inc.inc6_zoneid |
#define | inp_vnet inp_pcbinfo->ipi_vnet |
#define | INPCBSTORAGE_DEFINE(prot, lname, zname, iname, hname) |
#define | il_laddr il_dependladdr.id46_addr.ia46_addr4 |
#define | il6_laddr il_dependladdr.id6_addr |
#define | INP_LOCK_DESTROY(inp) rw_destroy(&(inp)->inp_lock) |
#define | INP_RLOCK(inp) rw_rlock(&(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_WLOCK(inp) rw_try_wlock(&(inp)->inp_lock) |
#define | INP_RUNLOCK(inp) rw_runlock(&(inp)->inp_lock) |
#define | INP_WUNLOCK(inp) rw_wunlock(&(inp)->inp_lock) |
#define | INP_UNLOCK(inp) rw_unlock(&(inp)->inp_lock) |
#define | INP_TRY_UPGRADE(inp) rw_try_upgrade(&(inp)->inp_lock) |
#define | INP_DOWNGRADE(inp) rw_downgrade(&(inp)->inp_lock) |
#define | INP_WLOCKED(inp) rw_wowned(&(inp)->inp_lock) |
#define | INP_LOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_LOCKED) |
#define | INP_RLOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_RLOCKED) |
#define | INP_WLOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_WLOCKED) |
#define | INP_UNLOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_UNLOCKED) |
#define | inp_lock_assert(inp) do {} while (0) |
#define | inp_unlock_assert(inp) do {} while (0) |
#define | INP_INFO_WLOCK(ipi) mtx_lock(&(ipi)->ipi_lock) |
#define | INP_INFO_WLOCKED(ipi) mtx_owned(&(ipi)->ipi_lock) |
#define | INP_INFO_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_lock) |
#define | INP_INFO_LOCK_ASSERT(ipi) |
#define | INP_INFO_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_lock, MA_OWNED) |
#define | INP_INFO_WUNLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_lock, MA_NOTOWNED) |
#define | INP_HASH_WLOCK(ipi) mtx_lock(&(ipi)->ipi_hash_lock) |
#define | INP_HASH_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_hash_lock) |
#define | INP_HASH_LOCK_ASSERT(ipi) |
#define | INP_HASH_WLOCK_ASSERT(ipi) |
#define | IN_ADDR_JHASH32(addr) |
#define | IN6_ADDR_JHASH32(addr) |
#define | INP_PCBHASH(faddr, lport, fport, mask) ((IN_ADDR_JHASH32(faddr) ^ ntohs((lport) ^ (fport))) & (mask)) |
#define | INP6_PCBHASH(faddr, lport, fport, mask) ((IN6_ADDR_JHASH32(faddr) ^ ntohs((lport) ^ (fport))) & (mask)) |
#define | INP_PCBHASH_WILD(lport, mask) ((V_in_pcbhashseed ^ ntohs(lport)) & (mask)) |
#define | INP_PCBLBGROUP_PKTHASH(faddr, lport, fport) (IN_ADDR_JHASH32(faddr) ^ ntohs((lport) ^ (fport))) |
#define | INP6_PCBLBGROUP_PKTHASH(faddr, lport, fport) (IN6_ADDR_JHASH32(faddr) ^ ntohs((lport) ^ (fport))) |
#define | INP_PCBPORTHASH(lport, mask) (ntohs((lport)) & (mask)) |
#define | INP_IPV4 0x1 |
#define | INP_IPV6 0x2 |
#define | INP_IPV6PROTO 0x4 /* opened under IPv6 protocol */ |
#define | INP_RECVOPTS 0x00000001 /* receive incoming IP options */ |
#define | INP_RECVRETOPTS 0x00000002 /* receive IP options for reply */ |
#define | INP_RECVDSTADDR 0x00000004 /* receive IP dst address */ |
#define | INP_HDRINCL 0x00000008 /* user supplies entire IP header */ |
#define | INP_HIGHPORT 0x00000010 /* user wants "high" port binding */ |
#define | INP_LOWPORT 0x00000020 /* user wants "low" port binding */ |
#define | INP_ANONPORT 0x00000040 /* port chosen for user */ |
#define | INP_RECVIF 0x00000080 /* receive incoming interface */ |
#define | INP_MTUDISC 0x00000100 /* user can do MTU discovery */ |
#define | INP_RECVTTL 0x00000400 /* receive incoming IP TTL */ |
#define | INP_DONTFRAG 0x00000800 /* don't fragment packet */ |
#define | INP_BINDANY 0x00001000 /* allow bind to any address */ |
#define | INP_INHASHLIST 0x00002000 /* in_pcbinshash() has been called */ |
#define | INP_RECVTOS 0x00004000 /* receive incoming IP TOS */ |
#define | IN6P_IPV6_V6ONLY 0x00008000 /* restrict AF_INET6 socket for v6 */ |
#define | IN6P_PKTINFO 0x00010000 /* receive IP6 dst and I/F */ |
#define | IN6P_HOPLIMIT 0x00020000 /* receive hoplimit */ |
#define | IN6P_HOPOPTS 0x00040000 /* receive hop-by-hop options */ |
#define | IN6P_DSTOPTS 0x00080000 /* receive dst options after rthdr */ |
#define | IN6P_RTHDR 0x00100000 /* receive routing header */ |
#define | IN6P_RTHDRDSTOPTS 0x00200000 /* receive dstoptions before rthdr */ |
#define | IN6P_TCLASS 0x00400000 /* receive traffic class value */ |
#define | IN6P_AUTOFLOWLABEL 0x00800000 /* attach flowlabel automatically */ |
#define | INP_TIMEWAIT 0x01000000 /* in TIMEWAIT, ppcb is tcptw */ |
#define | INP_ONESBCAST 0x02000000 /* send all-ones broadcast */ |
#define | INP_DROPPED 0x04000000 /* protocol drop flag */ |
#define | INP_SOCKREF 0x08000000 /* strong socket reference */ |
#define | INP_RESERVED_0 0x10000000 /* reserved field */ |
#define | INP_RESERVED_1 0x20000000 /* reserved field */ |
#define | IN6P_RFC2292 0x40000000 /* used RFC2292 API on the socket */ |
#define | IN6P_MTU 0x80000000 /* receive path MTU */ |
#define | INP_CONTROLOPTS |
#define | INP_MBUF_L_ACKS 0x00000001 /* We need large mbufs for ack compression */ |
#define | INP_MBUF_ACKCMP 0x00000002 /* TCP mbuf ack compression ok */ |
#define | INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */ |
#define | INP_REUSEADDR 0x00000020 /* SO_REUSEADDR 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_RECVFLOWID 0x00000100 /* populate recv datagram with flow info */ |
#define | INP_RECVRSSBUCKETID 0x00000200 /* populate recv datagram with bucket id */ |
#define | INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ |
#define | INP_ORIGDSTADDR 0x00000800 /* receive IP dst address/port */ |
#define | INP_CANNOT_DO_ECN 0x00001000 /* The stack does not do ECN */ |
#define | INP_REUSEPORT_LB 0x00002000 /* SO_REUSEPORT_LB option is set */ |
#define | INP_SUPPORTS_MBUFQ 0x00004000 /* Supports the mbuf queue method of LRO */ |
#define | INP_MBUF_QUEUE_READY 0x00008000 /* The transport is pacing, inputs can be queued */ |
#define | INP_DONT_SACK_QUEUE 0x00010000 /* If a sack arrives do not wake me */ |
#define | INP_2PCP_SET 0x00020000 /* If the Eth PCP should be set explicitly */ |
#define | INP_2PCP_BIT0 0x00040000 /* Eth PCP Bit 0 */ |
#define | INP_2PCP_BIT1 0x00080000 /* Eth PCP Bit 1 */ |
#define | INP_2PCP_BIT2 0x00100000 /* Eth PCP Bit 2 */ |
#define | INP_2PCP_BASE INP_2PCP_BIT0 |
#define | INP_2PCP_MASK (INP_2PCP_BIT0 | INP_2PCP_BIT1 | INP_2PCP_BIT2) |
#define | INP_2PCP_SHIFT 18 /* shift PCP field in/out of inp_flags2 */ |
#define | INPLOOKUP_MASK |
#define | INPLOOKUP_LOCKMASK (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB) |
#define | sotoinpcb(so) ((struct inpcb *)(so)->so_pcb) |
#define | INP_SOCKAF(so) so->so_proto->pr_domain->dom_family |
#define | INP_CHECK_SOCKAF(so, af) (INP_SOCKAF(so) == af) |
#define | V_ipport_reservedhigh VNET(ipport_reservedhigh) |
#define | V_ipport_reservedlow VNET(ipport_reservedlow) |
#define | V_ipport_lowfirstauto VNET(ipport_lowfirstauto) |
#define | V_ipport_lowlastauto VNET(ipport_lowlastauto) |
#define | V_ipport_firstauto VNET(ipport_firstauto) |
#define | V_ipport_lastauto VNET(ipport_lastauto) |
#define | V_ipport_hifirstauto VNET(ipport_hifirstauto) |
#define | V_ipport_hilastauto VNET(ipport_hilastauto) |
#define | V_ipport_randomized VNET(ipport_randomized) |
#define | V_ipport_randomcps VNET(ipport_randomcps) |
#define | V_ipport_randomtime VNET(ipport_randomtime) |
#define | V_ipport_stoprandom VNET(ipport_stoprandom) |
#define | V_ipport_tcpallocs VNET(ipport_tcpallocs) |
#define | INP_ALL_LIST -1 |
#define | INP_ITERATOR(_ipi, _lock, _match, _ctx) |
#define | INP_ALL_ITERATOR(_ipi, _lock) |
Typedefs | |
typedef uint64_t | inp_gen_t |
typedef bool | inp_match_t(const struct inpcb *, void *) |
Enumerations | |
enum | inp_lookup_t { INPLOOKUP_WILDCARD = 0x00000001 , INPLOOKUP_RLOCKPCB = 0x00000002 , INPLOOKUP_WLOCKPCB = 0x00000004 } |
Functions | |
CK_LIST_HEAD (inpcbhead, inpcb) | |
CK_LIST_HEAD (inpcbporthead, inpcbport) | |
CK_LIST_HEAD (inpcblbgrouphead, inpcblbgroup) | |
void | inp_wlock (struct inpcb *) |
void | inp_wunlock (struct inpcb *) |
void | inp_rlock (struct inpcb *) |
void | inp_runlock (struct inpcb *) |
void | inp_apply_all (void(*func)(struct inpcb *, void *), void *arg) |
int | inp_ip_tos_get (const struct inpcb *inp) |
void | inp_ip_tos_set (struct inpcb *inp, int val) |
struct socket * | inp_inpcbtosocket (struct inpcb *inp) |
struct tcpcb * | inp_inpcbtotcpcb (struct inpcb *inp) |
void | inp_4tuple_get (struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp) |
int | inp_so_options (const struct inpcb *inp) |
VNET_DECLARE (int, ipport_reservedhigh) | |
VNET_DECLARE (int, ipport_reservedlow) | |
VNET_DECLARE (int, ipport_lowfirstauto) | |
VNET_DECLARE (int, ipport_lowlastauto) | |
VNET_DECLARE (int, ipport_firstauto) | |
VNET_DECLARE (int, ipport_lastauto) | |
VNET_DECLARE (int, ipport_hifirstauto) | |
VNET_DECLARE (int, ipport_hilastauto) | |
VNET_DECLARE (int, ipport_randomized) | |
VNET_DECLARE (int, ipport_randomcps) | |
VNET_DECLARE (int, ipport_randomtime) | |
VNET_DECLARE (int, ipport_stoprandom) | |
VNET_DECLARE (int, ipport_tcpallocs) | |
void | in_pcbinfo_init (struct inpcbinfo *, struct inpcbstorage *, u_int, u_int) |
void | in_pcbinfo_destroy (struct inpcbinfo *) |
void | in_pcbstorage_init (void *) |
void | in_pcbstorage_destroy (void *) |
int | in_pcbbind_check_bindmulti (const struct inpcb *ni, const struct inpcb *oi) |
void | in_pcbpurgeif0 (struct inpcbinfo *, struct ifnet *) |
int | in_pcballoc (struct socket *, struct inpcbinfo *) |
int | in_pcbbind (struct inpcb *, struct sockaddr *, struct ucred *) |
int | in_pcbbind_setup (struct inpcb *, struct sockaddr *, in_addr_t *, u_short *, struct ucred *) |
int | in_pcbconnect (struct inpcb *, struct sockaddr *, struct ucred *, bool) |
int | in_pcbconnect_setup (struct inpcb *, struct sockaddr *, in_addr_t *, u_short *, in_addr_t *, u_short *, struct inpcb **, struct ucred *) |
void | in_pcbdetach (struct inpcb *) |
void | in_pcbdisconnect (struct inpcb *) |
void | in_pcbdrop (struct inpcb *) |
void | in_pcbfree (struct inpcb *) |
int | in_pcbinshash (struct inpcb *) |
int | in_pcbladdr (struct inpcb *, struct in_addr *, struct in_addr *, struct ucred *) |
int | in_pcblbgroup_numa (struct inpcb *, int arg) |
struct inpcb * | in_pcblookup (struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *) |
struct inpcb * | in_pcblookup_mbuf (struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *, struct mbuf *) |
void | in_pcbnotifyall (struct inpcbinfo *pcbinfo, struct in_addr, int, struct inpcb *(*)(struct inpcb *, int)) |
void | in_pcbref (struct inpcb *) |
void | in_pcbrehash (struct inpcb *) |
bool | in_pcbrele_rlocked (struct inpcb *) |
bool | in_pcbrele_wlocked (struct inpcb *) |
struct inpcb * | inp_next (struct inpcb_iterator *) |
void | in_losing (struct inpcb *) |
void | in_pcbsetsolabel (struct socket *so) |
int | in_getpeeraddr (struct socket *so, struct sockaddr **nam) |
int | in_getsockaddr (struct socket *so, struct sockaddr **nam) |
struct sockaddr * | in_sockaddr (in_port_t port, struct in_addr *addr) |
void | in_pcbsosetlabel (struct socket *so) |
#define IN6_ADDR_JHASH32 | ( | addr | ) |
#define IN6P_AUTOFLOWLABEL 0x00800000 /* attach flowlabel automatically */ |
#define IN6P_DSTOPTS 0x00080000 /* receive dst options after rthdr */ |
#define in6p_faddr inp_inc.inc6_faddr |
#define IN6P_HOPOPTS 0x00040000 /* receive hop-by-hop options */ |
#define IN6P_IPV6_V6ONLY 0x00008000 /* restrict AF_INET6 socket for v6 */ |
#define in6p_laddr inp_inc.inc6_laddr |
#define IN6P_PKTINFO 0x00010000 /* receive IP6 dst and I/F */ |
#define IN6P_RFC2292 0x40000000 /* used RFC2292 API on the socket */ |
#define IN6P_RTHDRDSTOPTS 0x00200000 /* receive dstoptions before rthdr */ |
#define IN6P_TCLASS 0x00400000 /* receive traffic class value */ |
#define in6p_zoneid inp_inc.inc6_zoneid |
#define IN_ADDR_JHASH32 | ( | addr | ) |
#define inc6_faddr inc_ie.ie6_faddr |
#define inc6_laddr inc_ie.ie6_laddr |
#define inc_faddr inc_ie.ie_faddr |
#define inc_laddr inc_ie.ie_laddr |
#define INP6_PCBHASH | ( | faddr, | |
lport, | |||
fport, | |||
mask | |||
) | ((IN6_ADDR_JHASH32(faddr) ^ ntohs((lport) ^ (fport))) & (mask)) |
#define INP6_PCBLBGROUP_PKTHASH | ( | faddr, | |
lport, | |||
fport | |||
) | (IN6_ADDR_JHASH32(faddr) ^ ntohs((lport) ^ (fport))) |
#define INP_2PCP_BASE INP_2PCP_BIT0 |
#define INP_2PCP_MASK (INP_2PCP_BIT0 | INP_2PCP_BIT1 | INP_2PCP_BIT2) |
#define INP_2PCP_SET 0x00020000 /* If the Eth PCP should be set explicitly */ |
#define INP_2PCP_SHIFT 18 /* shift PCP field in/out of inp_flags2 */ |
#define INP_ALL_ITERATOR | ( | _ipi, | |
_lock | |||
) |
#define INP_BINDANY 0x00001000 /* allow bind to any address */ |
#define INP_BINDMULTI 0x00000040 /* IP_BINDMULTI option is set */ |
#define INP_CANNOT_DO_ECN 0x00001000 /* The stack does not do ECN */ |
#define INP_CHECK_SOCKAF | ( | so, | |
af | |||
) | (INP_SOCKAF(so) == af) |
#define INP_CONTROLOPTS |
#define INP_DONT_SACK_QUEUE 0x00010000 /* If a sack arrives do not wake me */ |
#define INP_DONTFRAG 0x00000800 /* don't fragment packet */ |
#define INP_DOWNGRADE | ( | inp | ) | rw_downgrade(&(inp)->inp_lock) |
#define inp_faddr inp_inc.inc_faddr |
#define inp_fport inp_inc.inc_fport |
#define INP_HASH_LOCK_ASSERT | ( | ipi | ) |
#define INP_HASH_WLOCK | ( | ipi | ) | mtx_lock(&(ipi)->ipi_hash_lock) |
#define INP_HASH_WLOCK_ASSERT | ( | ipi | ) |
#define INP_HASH_WUNLOCK | ( | ipi | ) | mtx_unlock(&(ipi)->ipi_hash_lock) |
#define INP_HDRINCL 0x00000008 /* user supplies entire IP header */ |
#define INP_HIGHPORT 0x00000010 /* user wants "high" port binding */ |
#define INP_INFO_LOCK_ASSERT | ( | ipi | ) |
#define INP_INFO_WLOCK_ASSERT | ( | ipi | ) | mtx_assert(&(ipi)->ipi_lock, MA_OWNED) |
#define INP_INFO_WLOCKED | ( | ipi | ) | mtx_owned(&(ipi)->ipi_lock) |
#define INP_INFO_WUNLOCK | ( | ipi | ) | mtx_unlock(&(ipi)->ipi_lock) |
#define INP_INFO_WUNLOCK_ASSERT | ( | ipi | ) | mtx_assert(&(ipi)->ipi_lock, MA_NOTOWNED) |
#define INP_INHASHLIST 0x00002000 /* in_pcbinshash() has been called */ |
#define INP_ITERATOR | ( | _ipi, | |
_lock, | |||
_match, | |||
_ctx | |||
) |
#define inp_laddr inp_inc.inc_laddr |
#define INP_LOCK_ASSERT | ( | inp | ) | rw_assert(&(inp)->inp_lock, RA_LOCKED) |
#define INP_LOCK_DESTROY | ( | inp | ) | rw_destroy(&(inp)->inp_lock) |
#define INP_LOWPORT 0x00000020 /* user wants "low" port binding */ |
#define inp_lport inp_inc.inc_lport |
#define INP_MBUF_ACKCMP 0x00000002 /* TCP mbuf ack compression ok */ |
#define INP_MBUF_L_ACKS 0x00000001 /* We need large mbufs for ack compression */ |
#define INP_MBUF_QUEUE_READY 0x00008000 /* The transport is pacing, inputs can be queued */ |
#define INP_MTUDISC 0x00000100 /* user can do MTU discovery */ |
#define INP_ONESBCAST 0x02000000 /* send all-ones broadcast */ |
#define INP_ORIGDSTADDR 0x00000800 /* receive IP dst address/port */ |
#define INP_PCBHASH | ( | faddr, | |
lport, | |||
fport, | |||
mask | |||
) | ((IN_ADDR_JHASH32(faddr) ^ ntohs((lport) ^ (fport))) & (mask)) |
#define INP_PCBHASH_WILD | ( | lport, | |
mask | |||
) | ((V_in_pcbhashseed ^ ntohs(lport)) & (mask)) |
#define INP_PCBLBGROUP_PKTHASH | ( | faddr, | |
lport, | |||
fport | |||
) | (IN_ADDR_JHASH32(faddr) ^ ntohs((lport) ^ (fport))) |
#define INP_PCBPORTHASH | ( | lport, | |
mask | |||
) | (ntohs((lport)) & (mask)) |
#define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ |
#define INP_RECVDSTADDR 0x00000004 /* receive IP dst address */ |
#define INP_RECVFLOWID 0x00000100 /* populate recv datagram with flow info */ |
#define INP_RECVIF 0x00000080 /* receive incoming interface */ |
#define INP_RECVOPTS 0x00000001 /* receive incoming IP options */ |
#define INP_RECVRETOPTS 0x00000002 /* receive IP options for reply */ |
#define INP_RECVTOS 0x00004000 /* receive incoming IP TOS */ |
#define INP_RECVTTL 0x00000400 /* receive incoming IP TTL */ |
#define INP_REUSEADDR 0x00000020 /* SO_REUSEADDR option is set */ |
#define INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */ |
#define INP_REUSEPORT_LB 0x00002000 /* SO_REUSEPORT_LB option is set */ |
#define INP_RLOCK_ASSERT | ( | inp | ) | rw_assert(&(inp)->inp_lock, RA_RLOCKED) |
#define INP_RSS_BUCKET_SET 0x00000080 /* IP_RSS_LISTEN_BUCKET is set */ |
#define INP_SOCKAF | ( | so | ) | so->so_proto->pr_domain->dom_family |
#define INP_SOCKREF 0x08000000 /* strong socket reference */ |
#define INP_SUPPORTS_MBUFQ 0x00004000 /* Supports the mbuf queue method of LRO */ |
#define INP_TIMEWAIT 0x01000000 /* in TIMEWAIT, ppcb is tcptw */ |
#define INP_TRY_RLOCK | ( | inp | ) | rw_try_rlock(&(inp)->inp_lock) |
#define INP_TRY_UPGRADE | ( | inp | ) | rw_try_upgrade(&(inp)->inp_lock) |
#define INP_TRY_WLOCK | ( | inp | ) | rw_try_wlock(&(inp)->inp_lock) |
#define INP_UNLOCK_ASSERT | ( | inp | ) | rw_assert(&(inp)->inp_lock, RA_UNLOCKED) |
#define INP_WLOCK_ASSERT | ( | inp | ) | rw_assert(&(inp)->inp_lock, RA_WLOCKED) |
#define inp_zero_size |
#define INPCBSTORAGE_DEFINE | ( | prot, | |
lname, | |||
zname, | |||
iname, | |||
hname | |||
) |
#define INPLOOKUP_LOCKMASK (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB) |
#define INPLOOKUP_MASK |
enum inp_lookup_t |
CK_LIST_HEAD | ( | inpcbhead | , |
inpcb | |||
) |
CK_LIST_HEAD | ( | inpcblbgrouphead | , |
inpcblbgroup | |||
) |
CK_LIST_HEAD | ( | inpcbporthead | , |
inpcbport | |||
) |
int in_getpeeraddr | ( | struct socket * | so, |
struct sockaddr ** | nam | ||
) |
int in_getsockaddr | ( | struct socket * | so, |
struct sockaddr ** | nam | ||
) |
void in_losing | ( | struct inpcb * | inp | ) |
Definition at line 2577 of file in_pcb.c.
References inpcb::inp_route.
Referenced by bbr_timeout_rxt(), rack_timeout_rxt(), and tcp_timer_rexmt().
int in_pcballoc | ( | struct socket * | so, |
struct inpcbinfo * | pcbinfo | ||
) |
Definition at line 603 of file in_pcb.c.
References hpts_random_cpu(), IN6P_AUTOFLOWLABEL, IN6P_IPV6_V6ONLY, in_conninfo::inc_fibnum, inpcb::inp_cred, inpcb::inp_flags, inpcb::inp_gencnt, inpcb::inp_hpts_cpu, inpcb::inp_inc, INP_INFO_WLOCK, INP_INFO_WUNLOCK, INP_IPV6PROTO, inpcb::inp_numa_domain, inpcb::inp_pcbinfo, inpcb::inp_refcount, inpcb::inp_route, INP_SOCKAF, inpcb::inp_socket, inpcb::inp_vflag, INP_WLOCK, inp_zero_size, inpcbinfo::ipi_count, inpcbinfo::ipi_gencnt, inpcbinfo::ipi_listhead, and inpcbinfo::ipi_zone.
Referenced by div_attach(), and tcp_usr_attach().
int in_pcbbind | ( | struct inpcb * | , |
struct sockaddr * | , | ||
struct ucred * | |||
) |
Definition at line 904 of file in_pcb.c.
References INP_BINDMULTI, inpcb::inp_cred, and inpcb::inp_flags2.
int in_pcbbind_setup | ( | struct inpcb * | , |
struct sockaddr * | , | ||
in_addr_t * | , | ||
u_short * | , | ||
struct ucred * | |||
) |
int in_pcbconnect | ( | struct inpcb * | , |
struct sockaddr * | , | ||
struct ucred * | , | ||
bool | |||
) |
int in_pcbconnect_setup | ( | struct inpcb * | , |
struct sockaddr * | , | ||
in_addr_t * | , | ||
u_short * | , | ||
in_addr_t * | , | ||
u_short * | , | ||
struct inpcb ** | , | ||
struct ucred * | |||
) |
void in_pcbdetach | ( | struct inpcb * | inp | ) |
Definition at line 1524 of file in_pcb.c.
References inpcb::inp_snd_tag, and inpcb::inp_socket.
Referenced by div_detach(), tcp_usr_attach(), and tcp_usr_detach().
void in_pcbdisconnect | ( | struct inpcb * | ) |
void in_pcbdrop | ( | struct inpcb * | inp | ) |
Definition at line 1928 of file in_pcb.c.
References in_pcbremlbgrouphash(), INP_DROPPED, inpcb::inp_flags, INP_HASH_WLOCK, INP_HASH_WUNLOCK, INP_INHASHLIST, inpcb::inp_pcbinfo, inpcb::inp_phd, inpcb::inp_ppcb, inpcb::inp_refcount, inpcb::inp_socket, INP_WLOCK_ASSERT, inpcbinfo::ipi_portzone, and inpcbport::phd_pcblist.
Referenced by tcp_close(), tcp_twclose(), and tcp_twstart().
void in_pcbfree | ( | struct inpcb * | inp | ) |
Definition at line 1818 of file in_pcb.c.
References inpcb::in6p_moptions, inpcb::in6p_outputopts, in_pcbrele_wlocked(), in_pcbremlbgrouphash(), inpcb::inp_flags, INP_FREED, inp_freemoptions(), inpcb::inp_gencnt, INP_HASH_WLOCK, INP_HASH_WUNLOCK, INP_INFO_WLOCK, INP_INFO_WUNLOCK, INP_INHASHLIST, INP_IPV6PROTO, inpcb::inp_moptions, inpcb::inp_options, inpcb::inp_pcbinfo, inpcb::inp_phd, inpcb::inp_route, inpcb::inp_socket, inpcb::inp_sp, inpcb::inp_vflag, INP_WLOCK_ASSERT, INP_WUNLOCK, inpcbinfo::ipi_count, inpcbinfo::ipi_gencnt, inpcbinfo::ipi_portzone, and inpcbport::phd_pcblist.
Referenced by div_detach(), tcp_twclose(), tcp_usr_attach(), and tcp_usr_detach().
void in_pcbinfo_destroy | ( | struct inpcbinfo * | pcbinfo | ) |
Definition at line 552 of file in_pcb.c.
References inpcbinfo::ipi_count, inpcbinfo::ipi_hash_lock, inpcbinfo::ipi_hashbase, inpcbinfo::ipi_hashmask, inpcbinfo::ipi_lbgrouphashbase, inpcbinfo::ipi_lbgrouphashmask, inpcbinfo::ipi_lock, inpcbinfo::ipi_porthashbase, and inpcbinfo::ipi_porthashmask.
Referenced by div_destroy().
void in_pcbinfo_init | ( | struct inpcbinfo * | pcbinfo, |
struct inpcbstorage * | pcbstor, | ||
u_int | hash_nelements, | ||
u_int | porthash_nelements | ||
) |
Definition at line 524 of file in_pcb.c.
References inpcbinfo::ipi_count, inpcbinfo::ipi_hash_lock, inpcbinfo::ipi_hashbase, inpcbinfo::ipi_hashmask, inpcbinfo::ipi_lbgrouphashbase, inpcbinfo::ipi_lbgrouphashmask, inpcbinfo::ipi_listhead, inpcbinfo::ipi_lock, inpcbinfo::ipi_porthashbase, inpcbinfo::ipi_porthashmask, inpcbinfo::ipi_portzone, inpcbinfo::ipi_smr, inpcbinfo::ipi_vnet, inpcbinfo::ipi_zone, inpcbstorage::ips_hashlock_name, inpcbstorage::ips_infolock_name, inpcbstorage::ips_portzone, and inpcbstorage::ips_zone.
Referenced by div_init(), rip_init(), tcp_vnet_init(), and udp_init().
int in_pcbinshash | ( | struct inpcb * | inp | ) |
Definition at line 2469 of file in_pcb.c.
References in_pcbinslbgrouphash(), INP6_PCBHASH, inpcb::inp_flags, INP_HASH_WLOCK_ASSERT, INP_INHASHLIST, INP_IPV6, INP_PCBHASH, inpcb::inp_pcbinfo, INP_PCBPORTHASH, inpcb::inp_phd, inp_so_options(), inpcb::inp_vflag, INP_WLOCK_ASSERT, inpcbinfo::ipi_hashbase, inpcbinfo::ipi_hashmask, inpcbinfo::ipi_porthashbase, inpcbinfo::ipi_porthashmask, inpcbinfo::ipi_portzone, inpcbport::phd_pcblist, and inpcbport::phd_port.
int in_pcblbgroup_numa | ( | struct inpcb * | inp, |
int | arg | ||
) |
Definition at line 467 of file in_pcb.c.
References inpcblbgroup::il_inp, inpcblbgroup::il_inpcnt, inpcblbgroup::il_numa_domain, in_pcbinslbgrouphash(), in_pcbremlbgrouphash(), INP_HASH_WLOCK, INP_HASH_WUNLOCK, inpcb::inp_pcbinfo, INP_PCBPORTHASH, INP_WLOCK_ASSERT, inpcbinfo::ipi_lbgrouphashbase, inpcbinfo::ipi_lbgrouphashmask, TCP_REUSPORT_LB_NUMA_CURDOM, and TCP_REUSPORT_LB_NUMA_NODOM.
Referenced by tcp_default_ctloutput().
struct inpcb * in_pcblookup | ( | struct inpcbinfo * | , |
struct in_addr | , | ||
u_int | , | ||
struct in_addr | , | ||
u_int | , | ||
int | , | ||
struct ifnet * | |||
) |
Referenced by siftr_findinpcb(), sysctl_drop(), tcp_input_with_port(), and toe_4tuple_check().
void in_pcbnotifyall | ( | struct inpcbinfo * | pcbinfo, |
struct in_addr | , | ||
int | , | ||
struct inpcb * | *)(struct inpcb *, int | ||
) |
void in_pcbpurgeif0 | ( | struct inpcbinfo * | , |
struct ifnet * | |||
) |
void in_pcbref | ( | struct inpcb * | inp | ) |
Definition at line 1762 of file in_pcb.c.
References inpcb::inp_refcount.
Referenced by inp_hpts_insert(), inp_join_group(), tcp_log_tcpcbfini(), tcp_newtcpcb(), tcp_tw_2msl_scan(), and tcp_twstart().
void in_pcbrehash | ( | struct inpcb * | inp | ) |
Definition at line 2546 of file in_pcb.c.
References INP6_PCBHASH, inpcb::inp_flags, INP_HASH_WLOCK_ASSERT, INP_INHASHLIST, INP_IPV6, INP_PCBHASH, inpcb::inp_pcbinfo, inpcb::inp_vflag, INP_WLOCK_ASSERT, inpcbinfo::ipi_hashbase, and inpcbinfo::ipi_hashmask.
bool in_pcbrele_rlocked | ( | struct inpcb * | inp | ) |
Definition at line 1775 of file in_pcb.c.
References inpcb::inp_flags, INP_FREED, inpcb::inp_in_hpts, inpcb::inp_pcbinfo, inpcb::inp_refcount, INP_RLOCK_ASSERT, INP_RUNLOCK, inpcb::inp_socket, and inpcbinfo::ipi_zone.
Referenced by in_pcbrele().
bool in_pcbrele_wlocked | ( | struct inpcb * | inp | ) |
Definition at line 1792 of file in_pcb.c.
References inpcb::inp_flags, INP_FREED, inpcb::inp_in_hpts, inpcb::inp_pcbinfo, inpcb::inp_refcount, inpcb::inp_socket, INP_WLOCK_ASSERT, INP_WUNLOCK, and inpcbinfo::ipi_zone.
Referenced by in_pcbfree(), in_pcbrele(), inp_hpts_release(), inp_join_group(), tcp_hptsi(), tcp_log_dumpbucketlogs(), tcp_log_expire(), tcp_newtcpcb(), tcp_tw_2msl_scan(), and tcp_tw_2msl_stop().
void in_pcbsetsolabel | ( | struct socket * | so | ) |
void in_pcbsosetlabel | ( | struct socket * | so | ) |
Definition at line 2589 of file in_pcb.c.
References INP_WLOCK, INP_WUNLOCK, and sotoinpcb.
void in_pcbstorage_destroy | ( | void * | arg | ) |
Definition at line 590 of file in_pcb.c.
References inpcbstorage::ips_portzone, and inpcbstorage::ips_zone.
void in_pcbstorage_init | ( | void * | arg | ) |
Definition at line 573 of file in_pcb.c.
References inpcb_dtor(), inpcb_fini(), inpcbstorage::ips_pcbinit, inpcbstorage::ips_portzone, inpcbstorage::ips_portzone_name, inpcbstorage::ips_zone, and inpcbstorage::ips_zone_name.
void inp_4tuple_get | ( | struct inpcb * | inp, |
uint32_t * | laddr, | ||
uint16_t * | lp, | ||
uint32_t * | faddr, | ||
uint16_t * | fp | ||
) |
Definition at line 2743 of file in_pcb.c.
References INP_LOCK_ASSERT.
void inp_apply_all | ( | void(*)(struct inpcb *, void *) | func, |
void * | arg | ||
) |
Definition at line 2702 of file in_pcb.c.
References INP_ALL_ITERATOR, inp_next(), INPLOOKUP_WLOCKPCB, and V_tcbinfo.
Referenced by register_toedev().
struct socket * inp_inpcbtosocket | ( | struct inpcb * | inp | ) |
Definition at line 2713 of file in_pcb.c.
References inpcb::inp_socket, and INP_WLOCK_ASSERT.
Definition at line 2721 of file in_pcb.c.
References inpcb::inp_ppcb, and INP_WLOCK_ASSERT.
int inp_ip_tos_get | ( | const struct inpcb * | inp | ) |
Definition at line 2729 of file in_pcb.c.
References inpcb::inp_ip_tos.
void inp_ip_tos_set | ( | struct inpcb * | inp, |
int | val | ||
) |
Definition at line 2736 of file in_pcb.c.
References inpcb::inp_ip_tos.
struct inpcb * inp_next | ( | struct inpcb_iterator * | ii | ) |
Definition at line 1655 of file in_pcb.c.
References inpcb_iterator::ctx, inpcb_iterator::hash, II_LIST_FIRST, II_LIST_NEXT, II_LOCK_ASSERT, in_pcbrele(), inpcb_iterator::inp, inpcb::inp_flags, INP_FREED, inp_lock(), inpcb::inp_refcount, inp_smr_lock(), inp_trylock(), inp_unlock(), inpcb_iterator::ipi, inpcbinfo::ipi_smr, inpcb_iterator::lock, inpcb_iterator::match, and next.
Referenced by deregister_tcp_functions(), div_pcblist(), divert_packet(), inp_apply_all(), rip_pcblist(), sysctl_setsockopt(), tcp_drain(), tcp_pcblist(), and udp_pcblist().
void inp_rlock | ( | struct inpcb * | inp | ) |
void inp_runlock | ( | struct inpcb * | inp | ) |
Definition at line 2679 of file in_pcb.c.
References INP_RUNLOCK.
int inp_so_options | ( | const struct inpcb * | inp | ) |
void inp_wlock | ( | struct inpcb * | inp | ) |
void inp_wunlock | ( | struct inpcb * | inp | ) |
Definition at line 2665 of file in_pcb.c.
References INP_WUNLOCK.
VNET_DECLARE | ( | int | , |
ipport_firstauto | |||
) |
VNET_DECLARE | ( | int | , |
ipport_hifirstauto | |||
) |
VNET_DECLARE | ( | int | , |
ipport_hilastauto | |||
) |
VNET_DECLARE | ( | int | , |
ipport_lastauto | |||
) |
VNET_DECLARE | ( | int | , |
ipport_lowfirstauto | |||
) |
VNET_DECLARE | ( | int | , |
ipport_lowlastauto | |||
) |
VNET_DECLARE | ( | int | , |
ipport_randomcps | |||
) |
VNET_DECLARE | ( | int | , |
ipport_randomized | |||
) |
VNET_DECLARE | ( | int | , |
ipport_randomtime | |||
) |
VNET_DECLARE | ( | int | , |
ipport_reservedhigh | |||
) |
VNET_DECLARE | ( | int | , |
ipport_reservedlow | |||
) |
VNET_DECLARE | ( | int | , |
ipport_stoprandom | |||
) |
VNET_DECLARE | ( | int | , |
ipport_tcpallocs | |||
) |