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); \
426 #define INP_LOCK_DESTROY(inp) rw_destroy(&(inp)->inp_lock)
427 #define INP_RLOCK(inp) rw_rlock(&(inp)->inp_lock)
428 #define INP_WLOCK(inp) rw_wlock(&(inp)->inp_lock)
429 #define INP_TRY_RLOCK(inp) rw_try_rlock(&(inp)->inp_lock)
430 #define INP_TRY_WLOCK(inp) rw_try_wlock(&(inp)->inp_lock)
431 #define INP_RUNLOCK(inp) rw_runlock(&(inp)->inp_lock)
432 #define INP_WUNLOCK(inp) rw_wunlock(&(inp)->inp_lock)
433 #define INP_UNLOCK(inp) rw_unlock(&(inp)->inp_lock)
434 #define INP_TRY_UPGRADE(inp) rw_try_upgrade(&(inp)->inp_lock)
435 #define INP_DOWNGRADE(inp) rw_downgrade(&(inp)->inp_lock)
436 #define INP_WLOCKED(inp) rw_wowned(&(inp)->inp_lock)
437 #define INP_LOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_LOCKED)
438 #define INP_RLOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_RLOCKED)
439 #define INP_WLOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_WLOCKED)
440 #define INP_UNLOCK_ASSERT(inp) rw_assert(&(inp)->inp_lock, RA_UNLOCKED)
469 #define INP_INFO_WLOCK(ipi) mtx_lock(&(ipi)->ipi_lock)
470 #define INP_INFO_WLOCKED(ipi) mtx_owned(&(ipi)->ipi_lock)
471 #define INP_INFO_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_lock)
472 #define INP_INFO_LOCK_ASSERT(ipi) MPASS(SMR_ENTERED((ipi)->ipi_smr) || \
473 mtx_owned(&(ipi)->ipi_lock))
474 #define INP_INFO_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_lock, MA_OWNED)
476 mtx_assert(&(ipi)->ipi_lock, MA_NOTOWNED)
478 #define INP_HASH_WLOCK(ipi) mtx_lock(&(ipi)->ipi_hash_lock)
479 #define INP_HASH_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_hash_lock)
480 #define INP_HASH_LOCK_ASSERT(ipi) MPASS(SMR_ENTERED((ipi)->ipi_smr) || \
481 mtx_owned(&(ipi)->ipi_hash_lock))
482 #define INP_HASH_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_hash_lock, \
493 ((addr)->s_addr == INADDR_ANY ? V_in_pcbhashseed : \
494 jenkins_hash32((&(addr)->s_addr), 1, V_in_pcbhashseed))
498 jenkins_hash32((addr)->__u6_addr.__u6_addr32, \
499 nitems((addr)->__u6_addr.__u6_addr32), V_in_pcbhashseed))
517 * Flags for inp_vflags -- historically version flags only
544 #define IN6P_HOPOPTS 0x00040000 /* receive hop-by-hop options */
551 #define INP_ONESBCAST 0x02000000 /* send all-ones broadcast */
586 #define INP_2PCP_SET 0x00020000 /* If the Eth PCP should be set explicitly */
587 #define INP_2PCP_BIT0 0x00040000 /* Eth PCP Bit 0 */
588 #define INP_2PCP_BIT1 0x00080000 /* Eth PCP Bit 1 */
589 #define INP_2PCP_BIT2 0x00100000 /* Eth PCP Bit 2 */
599 INPLOOKUP_RLOCKPCB = 0x00000002, /* Return inpcb read-locked. */
600 INPLOOKUP_WLOCKPCB = 0x00000004, /* Return inpcb write-locked. */
608 #define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb)
610 #define INP_SOCKAF(so) so->so_proto->pr_domain->dom_family
678 #define INP_ALL_LIST -1