Lines Matching +full:eth +full:- +full:ck
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
6 * Copyright (c) 2010-2011 Juniper Networks, Inc.
56 #include <sys/ck.h>
64 * protocol-specific control block) are stored here.
88 * NOTE: ipv6 addrs should be 64-bit aligned, per RFC 2553. in_conninfo has
90 * NOTE 2: tcp_syncache.c uses first 5 32-bit words, which identify fport,
135 * IPv6 sockets. In the case of TCP and UDP, further per-connection state is
138 * a per-inpcb rwlock, inp_lock.
146 * (c) - Constant after initialization
147 * (e) - Protected by the SMR section
148 * (i) - Protected by the inpcb lock
149 * (p) - Protected by the pcbinfo lock for the inpcb
150 * (h) - Protected by the pcbhash lock for the inpcb
151 * (s) - Protected by another subsystem's locks
152 * (x) - Undefined locking
159 * netinet/netinet6-layer code should not assume that the inp_socket pointer
161 * close(2)-related races.
178 #define inp_zero_size (sizeof(struct inpcb) - \
204 /* Protocol-dependent part; options. */
245 #define inp_vnet inp_pcbinfo->ipi_vnet
256 * alert -- only define if struct xsocket is in scope.
261 * (s) - used by userland utilities in src
262 * (p) - used by utilities in ports
263 * (3) - is known to be used by third party software not in ports
264 * (n) - no known usage
317 * Per-VNET pcb database for each high-level protocol (UDP, TCP, ...) in both
321 * are CK-lists. Locking is required to insert a pcb into database. Two
341 * Generation count -- incremented each time a connection is allocated
390 * Global allocation storage for each high-level protocol (UDP, TCP, ...).
391 * Each corresponding per-VNET inpcbinfo points into this one.
410 rw_init_flags(&inp->inp_lock, lname, RW_RECURSE | RW_DUPOK); \
428 * (or unique address:port combination) can be re-used at most
449 #define INP_LOCK_DESTROY(inp) rw_destroy(&(inp)->inp_lock)
450 #define INP_RLOCK(inp) rw_rlock(&(inp)->inp_lock)
451 #define INP_WLOCK(inp) rw_wlock(&(inp)->inp_lock)
452 #define INP_TRY_RLOCK(inp) rw_try_rlock(&(inp)->inp_lock)
453 #define INP_TRY_WLOCK(inp) rw_try_wlock(&(inp)->inp_lock)
454 #define INP_RUNLOCK(inp) rw_runlock(&(inp)->inp_lock)
455 #define INP_WUNLOCK(inp) rw_wunlock(&(inp)->inp_lock)
456 #define INP_UNLOCK(inp) rw_unlock(&(inp)->inp_lock)
457 #define INP_TRY_UPGRADE(inp) rw_try_upgrade(&(inp)->inp_lock)
458 #define INP_DOWNGRADE(inp) rw_downgrade(&(inp)->inp_lock)
459 #define INP_WLOCKED(inp) rw_wowned(&(inp)->inp_lock)
460 #define INP_LOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_LOCKED)
461 #define INP_RLOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_RLOCKED)
462 #define INP_WLOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_WLOCKED)
463 #define INP_UNLOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_UNLOCKED)
492 #define INP_INFO_WLOCK(ipi) mtx_lock(&(ipi)->ipi_lock)
493 #define INP_INFO_WLOCKED(ipi) mtx_owned(&(ipi)->ipi_lock)
494 #define INP_INFO_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_lock)
495 #define INP_INFO_LOCK_ASSERT(ipi) MPASS(SMR_ENTERED((ipi)->ipi_smr) || \
496 mtx_owned(&(ipi)->ipi_lock))
497 #define INP_INFO_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_lock, MA_OWNED)
499 mtx_assert(&(ipi)->ipi_lock, MA_NOTOWNED)
501 #define INP_HASH_WLOCK(ipi) mtx_lock(&(ipi)->ipi_hash_lock)
502 #define INP_HASH_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_hash_lock)
503 #define INP_HASH_LOCK_ASSERT(ipi) MPASS(SMR_ENTERED((ipi)->ipi_smr) || \
504 mtx_owned(&(ipi)->ipi_hash_lock))
505 #define INP_HASH_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_hash_lock, \
516 ((addr)->s_addr == INADDR_ANY ? V_in_pcbhashseed : \
517 jenkins_hash32((&(addr)->s_addr), 1, V_in_pcbhashseed))
521 jenkins_hash32((addr)->__u6_addr.__u6_addr32, \
522 nitems((addr)->__u6_addr.__u6_addr32), V_in_pcbhashseed))
540 * Flags for inp_vflags -- historically version flags only
567 #define IN6P_HOPOPTS 0x00040000 /* receive hop-by-hop options */
574 #define INP_ONESBCAST 0x02000000 /* send all-ones broadcast */
609 #define INP_2PCP_SET 0x00020000 /* If the Eth PCP should be set explicitly */
610 #define INP_2PCP_BIT0 0x00040000 /* Eth PCP Bit 0 */
611 #define INP_2PCP_BIT1 0x00080000 /* Eth PCP Bit 1 */
612 #define INP_2PCP_BIT2 0x00100000 /* Eth PCP Bit 2 */
622 INPLOOKUP_RLOCKPCB = 0x00000002, /* Return inpcb read-locked. */
623 INPLOOKUP_WLOCKPCB = 0x00000004, /* Return inpcb write-locked. */
630 #define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb)
632 #define INP_SOCKAF(so) so->so_proto->pr_domain->dom_family
699 #define INP_ALL_LIST -1