usr/src/uts/common/inet/ipclassifier.h
author meem <Peter.Memishian@Sun.COM>
Tue, 06 Jan 2009 20:16:25 -0500
changeset 8485 633e5b5eb268
parent 8477 eb9540d8095f
child 8778 b4169d2ab299
permissions -rw-r--r--
PSARC/2007/272 Project Clearview: IPMP Rearchitecture PSARC/2008/773 IPQoS if_groupname Selector Removal PSARC/2009/001 Move in.mpathd into /lib/inet 6783149 Clearview IPMP Rearchitecture 4472956 libipmp should provide administrative interfaces 4494577 ipmp is opaque - there's no way to get current status 4509788 IPMP's usage of interface flags is not backward compatible 4509869 IPMP's address move mechanism needs to be transparent to applications 4531232 "in.rdiscd: sendto: Bad file number" seen during IPMP DR 4533876 new instances of interfaces under ipmp are generated with each dr/op 4699003 in.mpathd should squawk if interfaces in a group have the same hwaddr 4704937 SUNW_ip_rcm.so is sloppy with strings 4713308 IPMP shouldn't failover unconfigured logical interfaces 4785694 non-homogeneous IPMP group does not do failback 4850407 if_mpadm and IPMP DR failure 5015757 ip can panic with ASSERT(attach_ill == ipif->ipif_ill) failure 5086201 in.ndpd's phyint_reach_random() spews "SIOCSLIFLNKINFO Invalid argument" 6184000 routes cannot be created on failed interfaces 6246564 if_mpadm -r <ifname> doesn't bring up IPv6 link-local data address 6359058 SIOCLIFFAILBACK repeatedly fails with EAGAIN; in.mpathd fills logs 6359536 enabling STANDBY on an interface with no test address acts oddly 6378487 in.dhcpd doesn't work well in an IPMP setup 6462335 cannot offline to IPMP interfaces that have no probe targets 6516992 in.routed spews "Address already in use" during IPMP address move 6518460 ip_rcm`update_pif() must remain calm when logical interfaces disappear 6549957 failed IP interfaces at boot may go unreported 6591186 rpcbind can't deal with indirect calls if all addresses are deprecated 6667143 NCE_F_UNSOL_ADV broken 6698480 IGMP version not retained during IPMP failover 6726235 IPMP group failure can sometimes lead to an extra failover 6726645 in.routed skips DEPRECATED addresses even when no others exist 6738310 ip_ndp_recover() checks IPIF_CONDEMNED on the wrong ipif flags field 6739454 system panics at sdpib`sdp_rts_announce 6739531 IPv6 DAD doesn't work well with IPMP 6740719 in.mpathd may fail to switch to router target mode 6743260 ipif_resolver_up() can fail and leave ARP bringup pending 6746613 ip's DL_NOTE_SDU_SIZE logic mishandles ill_max_frag < ill_max_mtu 6748145 in.ndpd's IPv6 link-local hardware address mappings can go stale 6753560 ilg_delete_all() can race with ill_delete_tail() when ilg_ill changes 6755987 stillborn IFF_POINTOPOINT in.mpathd logic should be hauled out 6775126 SUBDIRS ipsecutils element does not in order be 6775811 NCEs can get stuck in ND_INCOMPLETE if ARP fails when IPMP is in-use 6777496 receive-side ILL_HCKSUM_CAPABLE checks look at the wrong ill 6781488 IPSQ timer restart logic can deadlock under stress 6781883 ip_ndp_find_solicitation() can be passed adverts, and has API issues 6784852 RPCIB, SDP, and RDS all break when vanity naming is used 6786048 IPv6 ND probes create IREs with incorrect source addresses 6786091 I_PLINK handling in IP must not request reentry via ipsq_try_enter() 6786711 IPQoS if_groupname selector needs to go 6787091 assertion failure in ipcl_conn_cleanup() due to non-NULL conn_ilg 6789235 INADDR_ANY ILMs can trigger an assertion failure in IPMP environments 6789502 ipif_resolver_up() calls after ipif_ndp_up() clobber ipif_addr_ready 6789718 ip6.tun0 cannot be plumbed in a non-global-zone post-6745288 6789732 libdlpi may get stuck in i_dlpi_strgetmsg() 6789870 ipif6_dup_recovery() may operate on a freed ipif, corrupting memory 6789874 ipnet_nicevent_cb() may call taskq_dispatch() on a bogus taskq 6790310 in.mpathd may core with "phyint_inst_timer: invalid state 4"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     1
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     2
 * CDDL HEADER START
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     3
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
1503
9c3595b79c0d 6376992 IP Classifier hash function for UDP is broken, causing poor UDP performance when using many ports
ericheng
parents: 1216
diff changeset
     5
 * Common Development and Distribution License (the "License").
9c3595b79c0d 6376992 IP Classifier hash function for UDP is broken, causing poor UDP performance when using many ports
ericheng
parents: 1216
diff changeset
     6
 * You may not use this file except in compliance with the License.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     7
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    11
 * and limitations under the License.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    12
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    18
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    19
 * CDDL HEADER END
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    20
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    21
/*
8477
eb9540d8095f 6789770 NULL pointer dereference panic in ip_helper_share_conn()
Rao Shoaib <Rao.Shoaib@Sun.COM>
parents: 8444
diff changeset
    22
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    23
 * Use is subject to license terms.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    24
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    25
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    26
#ifndef	_INET_IPCLASSIFIER_H
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    27
#define	_INET_IPCLASSIFIER_H
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    28
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    29
#ifdef	__cplusplus
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    30
extern "C" {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    31
#endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    32
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    33
#include <inet/common.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    34
#include <inet/ip.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    35
#include <inet/mi.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    36
#include <inet/tcp.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    37
#include <inet/ip6.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    38
#include <netinet/in.h>		/* for IPPROTO_* constants */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    39
#include <sys/sdt.h>
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
    40
#include <sys/socket_proto.h>
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
    41
#include <sys/sunddi.h>
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
    42
#include <sys/sunldi.h>
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    43
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    44
typedef void (*edesc_spf)(void *, mblk_t *, void *, int);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    45
typedef void (*edesc_rpf)(void *, mblk_t *, void *);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    46
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    47
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    48
 * ==============================
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    49
 * =	The CONNECTION		=
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    50
 * ==============================
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    51
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    52
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    53
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    54
 * The connection structure contains the common information/flags/ref needed.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    55
 * Implementation will keep the connection struct, the layers (with their
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    56
 * respective data for event i.e. tcp_t if event was tcp_input) all in one
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    57
 * contiguous memory location.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    58
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    59
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    60
/* Conn Flags */
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    61
/* Unused			0x00020000 */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    62
/* Unused			0x00040000 */
741
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
    63
#define	IPCL_FULLY_BOUND	0x00080000	/* Bound to correct squeue */
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
    64
#define	IPCL_CHECK_POLICY	0x00100000	/* Needs policy checking */
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
    65
#define	IPCL_SOCKET		0x00200000	/* Sockfs connection */
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
    66
#define	IPCL_ACCEPTOR		0x00400000	/* Sockfs priv acceptor */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    67
#define	IPCL_CL_LISTENER	0x00800000	/* Cluster listener */
741
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
    68
#define	IPCL_EAGER		0x01000000	/* Incoming connection */
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    69
/* Unused			0x02000000 */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    70
#define	IPCL_TCP6		0x04000000	/* AF_INET6 TCP */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    71
#define	IPCL_TCP4		0x08000000	/* IPv4 packet format TCP */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    72
/* Unused			0x10000000 */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    73
/* Unused			0x20000000 */
741
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
    74
#define	IPCL_CONNECTED		0x40000000	/* Conn in connected table */
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
    75
#define	IPCL_BOUND		0x80000000	/* Conn in bind table */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    76
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    77
/* Flags identifying the type of conn */
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    78
#define	IPCL_TCPCONN		0x00000001	/* From tcp_conn_cache */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    79
#define	IPCL_SCTPCONN		0x00000002	/* From sctp_conn_cache */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    80
#define	IPCL_IPCCONN		0x00000004	/* From ip_conn_cache */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    81
#define	IPCL_UDPCONN		0x00000008	/* From udp_conn_cache */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    82
#define	IPCL_RAWIPCONN		0x00000010	/* From rawip_conn_cache */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    83
#define	IPCL_RTSCONN		0x00000020	/* From rts_conn_cache */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    84
#define	IPCL_ISV6		0x00000040	/* AF_INET6 */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    85
#define	IPCL_IPTUN		0x00000080	/* Has "tun" plumbed above it */
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
    86
#define	IPCL_NONSTR		0x00001000	/* A non-STREAMS socket */
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
    87
#define	IPCL_IN_SQUEUE		0x10000000	/* Waiting squeue to finish */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    88
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    89
/* Conn Masks */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    90
#define	IPCL_TCP		(IPCL_TCP4|IPCL_TCP6)
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    91
#define	IPCL_REMOVED		0x00000100
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    92
#define	IPCL_REUSED		0x00000200
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    93
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    94
/* The packet format is IPv4; could be an AF_INET or AF_INET6 socket */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    95
#define	IPCL_IS_TCP4(connp)						\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    96
	(((connp)->conn_flags & IPCL_TCP4))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    97
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
    98
/* Connected AF_INET with no IPsec policy */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    99
#define	IPCL_IS_TCP4_CONNECTED_NO_POLICY(connp)				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   100
	(((connp)->conn_flags &						\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   101
		(IPCL_TCP4|IPCL_CONNECTED|IPCL_CHECK_POLICY|IPCL_TCP6))	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   102
		== (IPCL_TCP4|IPCL_CONNECTED))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   103
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   104
#define	IPCL_IS_CONNECTED(connp)					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   105
	((connp)->conn_flags & IPCL_CONNECTED)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   106
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   107
#define	IPCL_IS_BOUND(connp)						\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   108
	((connp)->conn_flags & IPCL_BOUND)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   109
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   110
/* AF_INET TCP that is bound */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   111
#define	IPCL_IS_TCP4_BOUND(connp)					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   112
	(((connp)->conn_flags &						\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   113
		(IPCL_TCP4|IPCL_BOUND|IPCL_TCP6)) ==			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   114
		(IPCL_TCP4|IPCL_BOUND))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   115
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   116
#define	IPCL_IS_FULLY_BOUND(connp)					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   117
	((connp)->conn_flags & IPCL_FULLY_BOUND)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   118
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   119
/*
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   120
 * Can't use conn_protocol since we need to tell difference
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   121
 * between a real TCP socket and a SOCK_RAW, IPPROTO_TCP.
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   122
 */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   123
#define	IPCL_IS_TCP(connp)						\
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   124
	((connp)->conn_flags & IPCL_TCPCONN)
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   125
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   126
#define	IPCL_IS_SCTP(connp)						\
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   127
	((connp)->conn_flags & IPCL_SCTPCONN)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   128
741
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
   129
#define	IPCL_IS_UDP(connp)						\
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   130
	((connp)->conn_flags & IPCL_UDPCONN)
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   131
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   132
#define	IPCL_IS_RAWIP(connp)						\
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   133
	((connp)->conn_flags & IPCL_RAWIPCONN)
741
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
   134
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   135
#define	IPCL_IS_RTS(connp)						\
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   136
	((connp)->conn_flags & IPCL_RTSCONN)
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   137
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   138
/* FIXME: Isn't it sufficient to check IPCL_IPTUN? */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   139
#define	IPCL_IS_IPTUN(connp)						\
3055
e5701846929e PSARC 2005/516 IPsec Tunnel Reform
danmcd
parents: 2263
diff changeset
   140
	(((connp)->conn_ulp == IPPROTO_ENCAP ||				\
e5701846929e PSARC 2005/516 IPsec Tunnel Reform
danmcd
parents: 2263
diff changeset
   141
	(connp)->conn_ulp == IPPROTO_IPV6) &&				\
e5701846929e PSARC 2005/516 IPsec Tunnel Reform
danmcd
parents: 2263
diff changeset
   142
	((connp)->conn_flags & IPCL_IPTUN))
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   143
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   144
#define	IPCL_IS_NONSTR(connp)	((connp)->conn_flags & IPCL_NONSTR)
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   145
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   146
typedef struct connf_s connf_t;
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   147
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   148
typedef struct
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   149
{
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   150
	int	ctb_depth;
5023
e0c678e511a7 6203568 accumulating number of threads behind rw_lock in ire_walk_ill_tables IRB_REFRELE
carlsonj
parents: 4972
diff changeset
   151
#define	CONN_STACK_DEPTH	15
e0c678e511a7 6203568 accumulating number of threads behind rw_lock in ire_walk_ill_tables IRB_REFRELE
carlsonj
parents: 4972
diff changeset
   152
	pc_t	ctb_stack[CONN_STACK_DEPTH];
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   153
} conn_trace_t;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   154
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   155
typedef struct ip_helper_minor_info_s {
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   156
	dev_t	ip_minfo_dev;		/* Device */
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   157
	vmem_t	*ip_minfo_arena;	/* Arena */
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   158
} ip_helper_minfo_t;
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   159
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   160
/*
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   161
 * ip helper stream info
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   162
 */
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   163
typedef struct ip_helper_stream_info_s {
8444
af8f67c55009 6787918 system panics if ip_create_helper_stream() is interrupted
Rao Shoaib <Rao.Shoaib@Sun.COM>
parents: 8348
diff changeset
   164
	ldi_handle_t		iphs_handle;
af8f67c55009 6787918 system panics if ip_create_helper_stream() is interrupted
Rao Shoaib <Rao.Shoaib@Sun.COM>
parents: 8348
diff changeset
   165
	queue_t 		*iphs_rq;
af8f67c55009 6787918 system panics if ip_create_helper_stream() is interrupted
Rao Shoaib <Rao.Shoaib@Sun.COM>
parents: 8348
diff changeset
   166
	queue_t 		*iphs_wq;
af8f67c55009 6787918 system panics if ip_create_helper_stream() is interrupted
Rao Shoaib <Rao.Shoaib@Sun.COM>
parents: 8348
diff changeset
   167
	ip_helper_minfo_t	*iphs_minfo;
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   168
} ip_helper_stream_info_t;
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   169
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   170
/*
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   171
 * The initial fields in the conn_t are setup by the kmem_cache constructor,
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   172
 * and are preserved when it is freed. Fields after that are bzero'ed when
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   173
 * the conn_t is freed.
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   174
 */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   175
struct conn_s {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   176
	kmutex_t	conn_lock;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   177
	uint32_t	conn_ref;		/* Reference counter */
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   178
	uint32_t	conn_flags;		/* Conn Flags */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   179
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   180
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   181
	union {
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   182
		tcp_t		*cp_tcp;	/* Pointer to the tcp struct */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   183
		struct udp_s	*cp_udp;	/* Pointer to the udp struct */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   184
		struct icmp_s	*cp_icmp;	/* Pointer to rawip struct */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   185
		struct rts_s	*cp_rts;	/* Pointer to rts struct */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   186
		void		*cp_priv;
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   187
	} conn_proto_priv;
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   188
#define	conn_tcp	conn_proto_priv.cp_tcp
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   189
#define	conn_udp	conn_proto_priv.cp_udp
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   190
#define	conn_icmp	conn_proto_priv.cp_icmp
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   191
#define	conn_rts	conn_proto_priv.cp_rts
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   192
#define	conn_priv	conn_proto_priv.cp_priv
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   193
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   194
	kcondvar_t	conn_cv;
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   195
	uint8_t		conn_ulp;		/* protocol type */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   196
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   197
	edesc_rpf	conn_recv;		/* Pointer to recv routine */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   198
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   199
	/* Fields after this are bzero'ed when the conn_t is freed. */
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   200
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   201
	squeue_t	*conn_sqp;		/* Squeue for processing */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   202
	uint_t		conn_state_flags;	/* IP state flags */
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   203
#define	conn_start_clr	conn_state_flags
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   204
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   205
	ire_t		*conn_ire_cache; 	/* outbound ire cache */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   206
	unsigned int
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   207
		conn_on_sqp : 1,		/* Conn is being processed */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   208
		conn_dontroute : 1,		/* SO_DONTROUTE state */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   209
		conn_loopback : 1,		/* SO_LOOPBACK state */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   210
		conn_broadcast : 1,		/* SO_BROADCAST state */
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   211
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   212
		conn_reuseaddr : 1,		/* SO_REUSEADDR state */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   213
		conn_multicast_loop : 1,	/* IP_MULTICAST_LOOP */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   214
		conn_multi_router : 1,		/* Wants all multicast pkts */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   215
		conn_draining : 1,		/* ip_wsrv running */
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   216
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   217
		conn_did_putbq : 1,		/* ip_wput did a putbq */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   218
		conn_unspec_src : 1,		/* IP_UNSPEC_SRC */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   219
		conn_policy_cached : 1,		/* Is policy cached/latched ? */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   220
		conn_in_enforce_policy : 1,	/* Enforce Policy on inbound */
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   221
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   222
		conn_out_enforce_policy : 1,	/* Enforce Policy on outbound */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   223
		conn_af_isv6 : 1,		/* ip address family ver 6 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   224
		conn_pkt_isv6 : 1,		/* ip packet format ver 6 */
3318
fcaac7018af6 PSARC 2006/466 IP_PKTINFO Socket Option
rshoaib
parents: 3115
diff changeset
   225
		conn_ip_recvpktinfo : 1,	/* IPV*_RECVPKTINFO option */
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   226
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   227
		conn_ipv6_recvhoplimit : 1,	/* IPV6_RECVHOPLIMIT option */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   228
		conn_ipv6_recvhopopts : 1,	/* IPV6_RECVHOPOPTS option */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   229
		conn_ipv6_recvdstopts : 1,	/* IPV6_RECVDSTOPTS option */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   230
		conn_ipv6_recvrthdr : 1,	/* IPV6_RECVRTHDR option */
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   231
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   232
		conn_ipv6_recvrtdstopts : 1,	/* IPV6_RECVRTHDRDSTOPTS */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   233
		conn_ipv6_v6only : 1,		/* IPV6_V6ONLY */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   234
		conn_ipv6_recvtclass : 1,	/* IPV6_RECVTCLASS */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   235
		conn_ipv6_recvpathmtu : 1,	/* IPV6_RECVPATHMTU */
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   236
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   237
		conn_pathmtu_valid : 1,		/* The cached mtu is valid. */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   238
		conn_ipv6_dontfrag : 1,		/* IPV6_DONTFRAG */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   239
		conn_fully_bound : 1,		/* Fully bound connection */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   240
		conn_recvif : 1,		/* IP_RECVIF option */
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   241
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   242
		conn_recvslla : 1,		/* IP_RECVSLLA option */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   243
		conn_mdt_ok : 1,		/* MDT is permitted */
1095
2c2c46925493 PSARC 2005/603 IP_NEXTHOP socket option
priyanka
parents: 741
diff changeset
   244
		conn_nexthop_set : 1,
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 5815
diff changeset
   245
		conn_allzones : 1;		/* SO_ALLZONES */
3115
4198a5aabed4 PSARC/2006/190 Large Send Offload (LSO)
yl150051
parents: 3104
diff changeset
   246
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 5815
diff changeset
   247
	unsigned int
3115
4198a5aabed4 PSARC/2006/190 Large Send Offload (LSO)
yl150051
parents: 3104
diff changeset
   248
		conn_lso_ok : 1;		/* LSO is usable */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   249
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 5815
diff changeset
   250
	squeue_t	*conn_initial_sqp;	/* Squeue at open time */
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 5815
diff changeset
   251
	squeue_t	*conn_final_sqp;	/* Squeue after connect */
5381
6bff17151099 PSARC/2007/565 IP_XMIT_IF removal and IP_BOUND_IF rationalization
meem
parents: 5240
diff changeset
   252
	ill_t		*conn_dhcpinit_ill;	/* IP_DHCPINIT_IF */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   253
	ipsec_latch_t	*conn_latch;		/* latched state */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   254
	ill_t		*conn_outgoing_ill;	/* IP{,V6}_BOUND_IF */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   255
	edesc_spf	conn_send;		/* Pointer to send routine */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   256
	queue_t		*conn_rq;		/* Read queue */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   257
	queue_t		*conn_wq;		/* Write queue */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   258
	dev_t		conn_dev;		/* Minor number */
5815
837c8cd4d6b6 6507173 Sockets should allocate minor numbers from higher order arena
gt145670
parents: 5455
diff changeset
   259
	vmem_t		*conn_minor_arena;	/* Minor arena */
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   260
	ip_helper_stream_info_t *conn_helper_info;
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   261
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   262
	cred_t		*conn_cred;		/* Credentials */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   263
	connf_t		*conn_g_fanout;		/* Global Hash bucket head */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   264
	struct conn_s	*conn_g_next;		/* Global Hash chain next */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   265
	struct conn_s	*conn_g_prev;		/* Global Hash chain prev */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   266
	struct ipsec_policy_head_s *conn_policy; /* Configured policy */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   267
	in6_addr_t	conn_bound_source_v6;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   268
#define	conn_bound_source	V4_PART_OF_V6(conn_bound_source_v6)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   269
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   270
	connf_t		*conn_fanout;		/* Hash bucket we're part of */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   271
	struct conn_s	*conn_next;		/* Hash chain next */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   272
	struct conn_s	*conn_prev;		/* Hash chain prev */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   273
	struct {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   274
		in6_addr_t connua_laddr;	/* Local address */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   275
		in6_addr_t connua_faddr;	/* Remote address */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   276
	} connua_v6addr;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   277
#define	conn_src	V4_PART_OF_V6(connua_v6addr.connua_laddr)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   278
#define	conn_rem	V4_PART_OF_V6(connua_v6addr.connua_faddr)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   279
#define	conn_srcv6	connua_v6addr.connua_laddr
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   280
#define	conn_remv6	connua_v6addr.connua_faddr
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   281
	union {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   282
		/* Used for classifier match performance */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   283
		uint32_t		conn_ports2;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   284
		struct {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   285
			in_port_t	tcpu_fport;	/* Remote port */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   286
			in_port_t	tcpu_lport;	/* Local port */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   287
		} tcpu_ports;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   288
	} u_port;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   289
#define	conn_fport	u_port.tcpu_ports.tcpu_fport
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   290
#define	conn_lport	u_port.tcpu_ports.tcpu_lport
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   291
#define	conn_ports	u_port.conn_ports2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   292
#define	conn_upq	conn_rq
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   293
	uint8_t		conn_unused_byte;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   294
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   295
	uint_t		conn_proto;		/* SO_PROTOTYPE state */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   296
	ill_t		*conn_incoming_ill;	/* IP{,V6}_BOUND_IF */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   297
	ill_t		*conn_oper_pending_ill; /* pending shared ioctl */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   298
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   299
	ilg_t	*conn_ilg;		/* Group memberships */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   300
	int	conn_ilg_allocated;	/* Number allocated */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   301
	int	conn_ilg_inuse;		/* Number currently used */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   302
	int	conn_ilg_walker_cnt;	/* No of ilg walkers */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   303
	/* XXXX get rid of this, once ilg_delete_all is fixed */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   304
	kcondvar_t	conn_refcv;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   305
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   306
	struct ipif_s	*conn_multicast_ipif;	/* IP_MULTICAST_IF */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   307
	ill_t		*conn_multicast_ill;	/* IPV6_MULTICAST_IF */
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 5815
diff changeset
   308
	struct	conn_s	*conn_drain_next;	/* Next conn in drain list */
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 5815
diff changeset
   309
	struct	conn_s	*conn_drain_prev;	/* Prev conn in drain list */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   310
	idl_t		*conn_idl;		/* Ptr to the drain list head */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   311
	mblk_t		*conn_ipsec_opt_mp;	/* ipsec option mblk */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   312
	uint32_t	conn_src_preferences;	/* prefs for src addr select */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   313
	/* mtuinfo from IPV6_PACKET_TOO_BIG conditional on conn_pathmtu_valid */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   314
	struct ip6_mtuinfo mtuinfo;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   315
	zoneid_t	conn_zoneid;		/* zone connection is in */
1095
2c2c46925493 PSARC 2005/603 IP_NEXTHOP socket option
priyanka
parents: 741
diff changeset
   316
	in6_addr_t	conn_nexthop_v6;	/* nexthop IP address */
5455
82e85f4134e1 PSARC/2007/639 IP_BROADCAST_TTL socket option
meem
parents: 5381
diff changeset
   317
	uchar_t		conn_broadcast_ttl; 	/* IP_BROADCAST_TTL */
1095
2c2c46925493 PSARC 2005/603 IP_NEXTHOP socket option
priyanka
parents: 741
diff changeset
   318
#define	conn_nexthop_v4	V4_PART_OF_V6(conn_nexthop_v6)
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   319
	cred_t		*conn_peercred;		/* Peer credentials, if any */
8485
633e5b5eb268 PSARC/2007/272 Project Clearview: IPMP Rearchitecture
meem <Peter.Memishian@Sun.COM>
parents: 8477
diff changeset
   320
	int		conn_rtaware; 		/* RT_AWARE sockopt value */
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   321
	kcondvar_t	conn_sq_cv;		/* For non-STREAMS socket IO */
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   322
	kthread_t	*conn_sq_caller;	/* Caller of squeue sync ops */
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   323
	sock_upcalls_t	*conn_upcalls;		/* Upcalls to sockfs */
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   324
	sock_upper_handle_t conn_upper_handle;	/* Upper handle: sonode * */
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   325
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   326
	unsigned int
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   327
		conn_ulp_labeled : 1,		/* ULP label is synced */
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   328
		conn_mlp_type : 2,		/* mlp_type_t; tsol/tndb.h */
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   329
		conn_anon_mlp : 1,		/* user wants anon MLP */
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   330
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   331
		conn_anon_port : 1,		/* user bound anonymously */
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   332
		conn_mac_exempt : 1,		/* unlabeled with loose MAC */
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   333
		conn_spare : 26;
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   334
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   335
	boolean_t	conn_flow_cntrld;
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   336
	netstack_t	*conn_netstack;	/* Corresponds to a netstack_hold */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   337
#ifdef CONN_DEBUG
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   338
#define	CONN_TRACE_MAX	10
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   339
	int		conn_trace_last;	/* ndx of last used tracebuf */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   340
	conn_trace_t	conn_trace_buf[CONN_TRACE_MAX];
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   341
#endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   342
};
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   343
1676
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   344
#define	CONN_CRED(connp) ((connp)->conn_peercred == NULL ? \
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   345
	(connp)->conn_cred : (connp)->conn_peercred)
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   346
#define	BEST_CRED(mp, connp) ((DB_CRED(mp) != NULL &&	\
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   347
	crgetlabel(DB_CRED(mp)) != NULL) ? DB_CRED(mp) : CONN_CRED(connp))
37f4a3e2bd99 PSARC/2002/762 Layered Trusted Solaris
jpk
parents: 1503
diff changeset
   348
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   349
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   350
 * connf_t - connection fanout data.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   351
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   352
 * The hash tables and their linkage (conn_t.{hashnextp, hashprevp} are
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   353
 * protected by the per-bucket lock. Each conn_t inserted in the list
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   354
 * points back at the connf_t that heads the bucket.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   355
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   356
struct connf_s {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   357
	struct conn_s	*connf_head;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   358
	kmutex_t	connf_lock;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   359
};
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   360
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   361
#define	CONN_INC_REF(connp)	{				\
3104
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   362
	mutex_enter(&(connp)->conn_lock);			\
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   363
	DTRACE_PROBE1(conn__inc__ref, conn_t *, connp);		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   364
	ASSERT(conn_trace_ref(connp));				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   365
	(connp)->conn_ref++;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   366
	ASSERT((connp)->conn_ref != 0);				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   367
	mutex_exit(&(connp)->conn_lock);			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   368
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   369
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   370
#define	CONN_INC_REF_LOCKED(connp)	{			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   371
	DTRACE_PROBE1(conn__inc__ref, conn_t *, connp);		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   372
	ASSERT(MUTEX_HELD(&(connp)->conn_lock));	 	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   373
	ASSERT(conn_trace_ref(connp));				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   374
	(connp)->conn_ref++;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   375
	ASSERT((connp)->conn_ref != 0);				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   376
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   377
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   378
#define	CONN_DEC_REF(connp)	{					\
3104
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   379
	mutex_enter(&(connp)->conn_lock);				\
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   380
	DTRACE_PROBE1(conn__dec__ref, conn_t *, connp);			\
3104
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   381
	/*								\
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   382
	 * The squeue framework always does a CONN_DEC_REF after return	\
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   383
	 * from TCP. Hence the refcnt must be at least 2 if conn_on_sqp	\
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   384
	 * is B_TRUE and conn_ref is being decremented. This is to	\
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   385
	 * account for the mblk being currently processed.		\
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   386
	 */								\
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   387
	if ((connp)->conn_ref <= 0 ||					\
fba3fdffbc25 6265494 assertion failed: sqp != NULL, file: ../../common/inet/squeue.c, line: 715
jprakash
parents: 3055
diff changeset
   388
	    ((connp)->conn_ref == 1 && (connp)->conn_on_sqp))		\
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   389
		cmn_err(CE_PANIC, "CONN_DEC_REF: connp(%p) has ref "	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   390
			"= %d\n", (void *)(connp), (connp)->conn_ref);	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   391
	ASSERT(conn_untrace_ref(connp));				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   392
	(connp)->conn_ref--;						\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   393
	if ((connp)->conn_ref == 0) {					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   394
		/* Refcnt can't increase again, safe to drop lock */	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   395
		mutex_exit(&(connp)->conn_lock);			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   396
		ipcl_conn_destroy(connp);				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   397
	} else {							\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   398
		cv_broadcast(&(connp)->conn_cv);			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   399
		mutex_exit(&(connp)->conn_lock);			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   400
	}								\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   401
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   402
2263
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   403
/*
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   404
 * For use with subsystems within ip which use ALL_ZONES as a wildcard
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   405
 */
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   406
#define	IPCL_ZONEID(connp)						\
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   407
	((connp)->conn_allzones ? ALL_ZONES : (connp)->conn_zoneid)
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   408
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   409
/*
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   410
 * For matching between a conn_t and a zoneid.
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   411
 */
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   412
#define	IPCL_ZONE_MATCH(connp, zoneid) 					\
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   413
	(((connp)->conn_allzones) ||					\
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   414
	    ((zoneid) == ALL_ZONES) ||					\
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   415
	    (connp)->conn_zoneid == (zoneid))
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   416
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   417
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   418
#define	_IPCL_V4_MATCH(v6addr, v4addr)	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   419
	(V4_PART_OF_V6((v6addr)) == (v4addr) && IN6_IS_ADDR_V4MAPPED(&(v6addr)))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   420
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   421
#define	_IPCL_V4_MATCH_ANY(addr)	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   422
	(IN6_IS_ADDR_V4MAPPED_ANY(&(addr)) || IN6_IS_ADDR_UNSPECIFIED(&(addr)))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   423
2263
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   424
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   425
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   426
 * IPCL_PROTO_MATCH() only matches conns with the specified zoneid, while
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   427
 * IPCL_PROTO_MATCH_V6() can match other conns in the multicast case, see
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   428
 * ip_fanout_proto().
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   429
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   430
#define	IPCL_PROTO_MATCH(connp, protocol, ipha, ill,			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   431
    fanout_flags, zoneid)						\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   432
	((((connp)->conn_src == INADDR_ANY) ||				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   433
	(((connp)->conn_src == ((ipha)->ipha_dst)) &&			\
2263
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   434
	    (((connp)->conn_rem == INADDR_ANY) ||			\
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   435
	((connp)->conn_rem == ((ipha)->ipha_src))))) &&			\
2263
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   436
	IPCL_ZONE_MATCH(connp, zoneid) &&				\
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   437
	(conn_wantpacket((connp), (ill), (ipha), (fanout_flags), 	\
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   438
	    (zoneid)) || ((protocol) == IPPROTO_PIM) ||			\
fd48046384d0 PSARC 2006/073 PF_ROUTE: Include interface name with RTM_NEWADDR/RTM_DELADDR
sommerfe
parents: 1676
diff changeset
   439
	    ((protocol) == IPPROTO_RSVP)))
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   440
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   441
#define	IPCL_PROTO_MATCH_V6(connp, protocol, ip6h, ill,			   \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   442
    fanout_flags, zoneid)						   \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   443
	((IN6_IS_ADDR_UNSPECIFIED(&(connp)->conn_srcv6) ||		   \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   444
	(IN6_ARE_ADDR_EQUAL(&(connp)->conn_srcv6, &((ip6h)->ip6_dst)) &&   \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   445
	(IN6_IS_ADDR_UNSPECIFIED(&(connp)->conn_remv6) ||		   \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   446
	IN6_ARE_ADDR_EQUAL(&(connp)->conn_remv6, &((ip6h)->ip6_src))))) && \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   447
	(conn_wantpacket_v6((connp), (ill), (ip6h),			   \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   448
	(fanout_flags), (zoneid)) || ((protocol) == IPPROTO_RSVP)))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   449
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   450
#define	IPCL_CONN_HASH(src, ports, ipst)				\
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   451
	((unsigned)(ntohl((src)) ^ ((ports) >> 24) ^ ((ports) >> 16) ^	\
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   452
	((ports) >> 8) ^ (ports)) % (ipst)->ips_ipcl_conn_fanout_size)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   453
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   454
#define	IPCL_CONN_HASH_V6(src, ports, ipst)				\
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   455
	IPCL_CONN_HASH(V4_PART_OF_V6((src)), (ports), (ipst))
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   456
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   457
#define	IPCL_CONN_MATCH(connp, proto, src, dst, ports)			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   458
	((connp)->conn_ulp == (proto) &&				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   459
		(connp)->conn_ports == (ports) &&      			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   460
		_IPCL_V4_MATCH((connp)->conn_remv6, (src)) &&		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   461
		_IPCL_V4_MATCH((connp)->conn_srcv6, (dst)) &&		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   462
		!(connp)->conn_ipv6_v6only)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   463
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   464
#define	IPCL_CONN_MATCH_V6(connp, proto, src, dst, ports)		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   465
	((connp)->conn_ulp == (proto) &&				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   466
		(connp)->conn_ports == (ports) &&      			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   467
		IN6_ARE_ADDR_EQUAL(&(connp)->conn_remv6, &(src)) &&	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   468
		IN6_ARE_ADDR_EQUAL(&(connp)->conn_srcv6, &(dst)))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   469
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   470
#define	IPCL_CONN_INIT(connp, protocol, src, rem, ports) {		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   471
	(connp)->conn_ulp = protocol;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   472
	IN6_IPADDR_TO_V4MAPPED(src, &(connp)->conn_srcv6);		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   473
	IN6_IPADDR_TO_V4MAPPED(rem, &(connp)->conn_remv6);		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   474
	(connp)->conn_ports = ports;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   475
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   476
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   477
#define	IPCL_CONN_INIT_V6(connp, protocol, src, rem, ports) {		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   478
	(connp)->conn_ulp = protocol;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   479
	(connp)->conn_srcv6 = src;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   480
	(connp)->conn_remv6 = rem;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   481
	(connp)->conn_ports = ports;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   482
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   483
1503
9c3595b79c0d 6376992 IP Classifier hash function for UDP is broken, causing poor UDP performance when using many ports
ericheng
parents: 1216
diff changeset
   484
#define	IPCL_PORT_HASH(port, size) \
9c3595b79c0d 6376992 IP Classifier hash function for UDP is broken, causing poor UDP performance when using many ports
ericheng
parents: 1216
diff changeset
   485
	((((port) >> 8) ^ (port)) & ((size) - 1))
9c3595b79c0d 6376992 IP Classifier hash function for UDP is broken, causing poor UDP performance when using many ports
ericheng
parents: 1216
diff changeset
   486
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   487
#define	IPCL_BIND_HASH(lport, ipst)					\
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   488
	((unsigned)(((lport) >> 8) ^ (lport)) % \
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   489
	    (ipst)->ips_ipcl_bind_fanout_size)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   490
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   491
#define	IPCL_BIND_MATCH(connp, proto, laddr, lport)			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   492
	((connp)->conn_ulp == (proto) &&				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   493
		(connp)->conn_lport == (lport) &&			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   494
		(_IPCL_V4_MATCH_ANY((connp)->conn_srcv6) ||		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   495
		_IPCL_V4_MATCH((connp)->conn_srcv6, (laddr))) &&	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   496
		!(connp)->conn_ipv6_v6only)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   497
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   498
#define	IPCL_BIND_MATCH_V6(connp, proto, laddr, lport)			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   499
	((connp)->conn_ulp == (proto) &&				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   500
		(connp)->conn_lport == (lport) &&			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   501
		(IN6_ARE_ADDR_EQUAL(&(connp)->conn_srcv6, &(laddr)) ||	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   502
		IN6_IS_ADDR_UNSPECIFIED(&(connp)->conn_srcv6)))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   503
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   504
#define	IPCL_UDP_MATCH(connp, lport, laddr, fport, faddr)		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   505
	(((connp)->conn_lport == (lport)) &&				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   506
	((_IPCL_V4_MATCH_ANY((connp)->conn_srcv6) ||			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   507
	(_IPCL_V4_MATCH((connp)->conn_srcv6, (laddr)) &&		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   508
	(_IPCL_V4_MATCH_ANY((connp)->conn_remv6) ||			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   509
	(_IPCL_V4_MATCH((connp)->conn_remv6, (faddr)) &&		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   510
	(connp)->conn_fport == (fport)))))) &&				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   511
	!(connp)->conn_ipv6_v6only)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   512
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   513
#define	IPCL_UDP_MATCH_V6(connp, lport, laddr, fport, faddr)	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   514
	(((connp)->conn_lport == (lport)) &&			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   515
	(IN6_IS_ADDR_UNSPECIFIED(&(connp)->conn_srcv6) ||	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   516
	(IN6_ARE_ADDR_EQUAL(&(connp)->conn_srcv6, &(laddr)) &&	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   517
	(IN6_IS_ADDR_UNSPECIFIED(&(connp)->conn_remv6) ||	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   518
	(IN6_ARE_ADDR_EQUAL(&(connp)->conn_remv6, &(faddr)) &&	\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   519
	(connp)->conn_fport == (fport))))))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   520
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   521
#define	IPCL_TCP_EAGER_INIT(connp, protocol, src, rem, ports) {		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   522
	(connp)->conn_flags |= (IPCL_TCP4|IPCL_EAGER);			\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   523
	IN6_IPADDR_TO_V4MAPPED(src, &(connp)->conn_srcv6);		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   524
	IN6_IPADDR_TO_V4MAPPED(rem, &(connp)->conn_remv6);		\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   525
	(connp)->conn_ports = ports;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   526
	(connp)->conn_send = ip_output;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   527
	(connp)->conn_sqp = IP_SQUEUE_GET(lbolt);			\
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 5815
diff changeset
   528
	(connp)->conn_initial_sqp = (connp)->conn_sqp;			\
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   529
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   530
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   531
#define	IPCL_TCP_EAGER_INIT_V6(connp, protocol, src, rem, ports) {	\
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   532
	(connp)->conn_flags |= (IPCL_TCP6|IPCL_EAGER|IPCL_ISV6);	\
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   533
	(connp)->conn_srcv6 = src;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   534
	(connp)->conn_remv6 = rem;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   535
	(connp)->conn_ports = ports;					\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   536
	(connp)->conn_send = ip_output_v6;				\
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   537
	(connp)->conn_sqp = IP_SQUEUE_GET(lbolt);			\
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 5815
diff changeset
   538
	(connp)->conn_initial_sqp = (connp)->conn_sqp;			\
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   539
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   540
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   541
#define	IPCL_UDP_HASH(lport, ipst)	\
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   542
	IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_udp_fanout_size)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   543
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   544
#define	CONN_G_HASH_SIZE	1024
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   545
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   546
/* Raw socket hash function. */
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   547
#define	IPCL_RAW_HASH(lport, ipst)	\
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   548
	IPCL_PORT_HASH(lport, (ipst)->ips_ipcl_raw_fanout_size)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   549
409
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   550
/*
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   551
 * This is similar to IPCL_BIND_MATCH except that the local port check
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   552
 * is changed to a wildcard port check.
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   553
 */
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   554
#define	IPCL_RAW_MATCH(connp, proto, laddr)			\
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   555
	((connp)->conn_ulp == (proto) &&			\
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   556
	(connp)->conn_lport == 0 &&				\
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   557
	(_IPCL_V4_MATCH_ANY((connp)->conn_srcv6) ||		\
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   558
	_IPCL_V4_MATCH((connp)->conn_srcv6, (laddr))))
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   559
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   560
#define	IPCL_RAW_MATCH_V6(connp, proto, laddr)			\
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   561
	((connp)->conn_ulp == (proto) &&			\
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   562
	(connp)->conn_lport == 0 &&				\
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   563
	(IN6_IS_ADDR_UNSPECIFIED(&(connp)->conn_srcv6) ||	\
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   564
	IN6_ARE_ADDR_EQUAL(&(connp)->conn_srcv6, &(laddr))))
22012dc8ea5b 6294727 SCTP raw socket bind() failed for ports which are mutliples of 256
kcpoon
parents: 0
diff changeset
   565
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   566
/* Function prototypes */
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   567
extern void ipcl_g_init(void);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   568
extern void ipcl_init(ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   569
extern void ipcl_g_destroy(void);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   570
extern void ipcl_destroy(ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   571
extern conn_t *ipcl_conn_create(uint32_t, int, netstack_t *);
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   572
extern void ipcl_conn_destroy(conn_t *);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   573
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   574
void ipcl_hash_insert_wildcard(connf_t *, conn_t *);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   575
void ipcl_hash_remove(conn_t *);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   576
void ipcl_hash_remove_locked(conn_t *connp, connf_t *connfp);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   577
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   578
extern int	ipcl_bind_insert(conn_t *, uint8_t, ipaddr_t, uint16_t);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   579
extern int	ipcl_bind_insert_v6(conn_t *, uint8_t, const in6_addr_t *,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   580
		    uint16_t);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   581
extern int	ipcl_conn_insert(conn_t *, uint8_t, ipaddr_t, ipaddr_t,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   582
		    uint32_t);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   583
extern int	ipcl_conn_insert_v6(conn_t *, uint8_t, const in6_addr_t *,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   584
		    const in6_addr_t *, uint32_t, uint_t);
741
40027a3621ac PSARC 2005/082 Yosemite: UDP Performance Enhancement
masputra
parents: 409
diff changeset
   585
extern conn_t	*ipcl_get_next_conn(connf_t *, conn_t *, uint32_t);
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   586
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   587
void ipcl_proto_insert(conn_t *, uint8_t);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   588
void ipcl_proto_insert_v6(conn_t *, uint8_t);
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   589
conn_t *ipcl_classify_v4(mblk_t *, uint8_t, uint_t, zoneid_t, ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   590
conn_t *ipcl_classify_v6(mblk_t *, uint8_t, uint_t, zoneid_t, ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   591
conn_t *ipcl_classify(mblk_t *, zoneid_t, ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   592
conn_t *ipcl_classify_raw(mblk_t *, uint8_t, zoneid_t, uint32_t, ipha_t *,
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   593
	    ip_stack_t *);
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   594
void	ipcl_globalhash_insert(conn_t *);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   595
void	ipcl_globalhash_remove(conn_t *);
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   596
void	ipcl_walk(pfv_t, void *, ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   597
conn_t	*ipcl_tcp_lookup_reversed_ipv4(ipha_t *, tcph_t *, int, ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   598
conn_t	*ipcl_tcp_lookup_reversed_ipv6(ip6_t *, tcpha_t *, int, uint_t,
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   599
	    ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   600
conn_t	*ipcl_lookup_listener_v4(uint16_t, ipaddr_t, zoneid_t, ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   601
conn_t	*ipcl_lookup_listener_v6(uint16_t, in6_addr_t *, uint_t, zoneid_t,
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   602
	    ip_stack_t *);
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   603
int	conn_trace_ref(conn_t *);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   604
int	conn_untrace_ref(conn_t *);
5240
e7599510dd03 6595449 IP streams plumbing simpification
nordmark
parents: 5023
diff changeset
   605
void	ipcl_conn_cleanup(conn_t *);
3448
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   606
conn_t *ipcl_conn_tcp_lookup_reversed_ipv4(conn_t *, ipha_t *, tcph_t *,
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   607
	    ip_stack_t *);
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   608
conn_t *ipcl_conn_tcp_lookup_reversed_ipv6(conn_t *, ip6_t *, tcph_t *,
aaf16568054b PSARC 2006/366 IP Instances
dh155122
parents: 3318
diff changeset
   609
	    ip_stack_t *);
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   610
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   611
extern int ip_create_helper_stream(conn_t *connp, ldi_ident_t li);
8477
eb9540d8095f 6789770 NULL pointer dereference panic in ip_helper_share_conn()
Rao Shoaib <Rao.Shoaib@Sun.COM>
parents: 8444
diff changeset
   612
extern void ip_free_helper_stream(conn_t *connp);
8348
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   613
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   614
extern int ip_get_options(conn_t *, int, int, void *, t_uscalar_t *, cred_t *);
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   615
extern int ip_set_options(conn_t *, int, int, const void *, t_uscalar_t,
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   616
    cred_t *);
4137e18bfaf0 PSARC 2007/587 Volo -- Low Latency Socket Framework
Yu Xiangning<Eric.Yu@Sun.COM>
parents: 8275
diff changeset
   617
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   618
#ifdef	__cplusplus
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   619
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   620
#endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   621
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   622
#endif	/* _INET_IPCLASSIFIER_H */