xref: /titanic_41/usr/src/uts/common/sys/xti_inet.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1996-1998 Sun Microsystems, Inc.	*/
23*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate /*
26*7c478bd9Sstevel@tonic-gate  * This is a private header file. Applications should not directly include
27*7c478bd9Sstevel@tonic-gate  * this file. Instead they should include <xti_inet.h>
28*7c478bd9Sstevel@tonic-gate  */
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #ifndef _SYS_XTI_INET_H
31*7c478bd9Sstevel@tonic-gate #define	_SYS_XTI_INET_H
32*7c478bd9Sstevel@tonic-gate 
33*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
34*7c478bd9Sstevel@tonic-gate 
35*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
38*7c478bd9Sstevel@tonic-gate extern "C" {
39*7c478bd9Sstevel@tonic-gate #endif
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate /*
42*7c478bd9Sstevel@tonic-gate  * This is a private header file. Applications should not directly include
43*7c478bd9Sstevel@tonic-gate  * this file. Instead they should include <xti_inet.h>
44*7c478bd9Sstevel@tonic-gate  */
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate #if !defined(_XPG5)
47*7c478bd9Sstevel@tonic-gate 
48*7c478bd9Sstevel@tonic-gate /*
49*7c478bd9Sstevel@tonic-gate  * INTERNET SPECIFIC ENVIRONMENT
50*7c478bd9Sstevel@tonic-gate  *
51*7c478bd9Sstevel@tonic-gate  * Note:
52*7c478bd9Sstevel@tonic-gate  * Unfortunately, XTI specification test assertions require exposing in
53*7c478bd9Sstevel@tonic-gate  * headers options that are not implemented. They also require exposing
54*7c478bd9Sstevel@tonic-gate  * Internet and OSI related options as part of inclusion of <xti.h>
55*7c478bd9Sstevel@tonic-gate  *
56*7c478bd9Sstevel@tonic-gate  * Also XTI specification intrudes on <netinet/in.h> TCP_ and IP_ namespaces
57*7c478bd9Sstevel@tonic-gate  * and sometimes redefines the semantics or types of some options with a
58*7c478bd9Sstevel@tonic-gate  * different history in that namespace. The name and binary value are exposed
59*7c478bd9Sstevel@tonic-gate  * but option semantics may be different from what is in XTI spec and we defer
60*7c478bd9Sstevel@tonic-gate  * to the <netinet/in.h> precedent.
61*7c478bd9Sstevel@tonic-gate  *
62*7c478bd9Sstevel@tonic-gate  * New applications should not use these constants. These are meant
63*7c478bd9Sstevel@tonic-gate  * for compatibility with older applications.
64*7c478bd9Sstevel@tonic-gate  */
65*7c478bd9Sstevel@tonic-gate 
66*7c478bd9Sstevel@tonic-gate /*
67*7c478bd9Sstevel@tonic-gate  * TCP level
68*7c478bd9Sstevel@tonic-gate  */
69*7c478bd9Sstevel@tonic-gate #define	INET_TCP	6 /* must be same as IPPROTO_TCP in <netinet/in.h> */
70*7c478bd9Sstevel@tonic-gate 
71*7c478bd9Sstevel@tonic-gate /*
72*7c478bd9Sstevel@tonic-gate  * TCP level options
73*7c478bd9Sstevel@tonic-gate  */
74*7c478bd9Sstevel@tonic-gate #ifndef TCP_NODELAY
75*7c478bd9Sstevel@tonic-gate #define	TCP_NODELAY	0x1	/* must be same as <netinet/tcp.h> */
76*7c478bd9Sstevel@tonic-gate #endif
77*7c478bd9Sstevel@tonic-gate 
78*7c478bd9Sstevel@tonic-gate #ifndef TCP_MAXSEG
79*7c478bd9Sstevel@tonic-gate #define	TCP_MAXSEG	0x2	/* must be same as <netinet/tcp.h> */
80*7c478bd9Sstevel@tonic-gate #endif
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate #ifndef TCP_KEEPALIVE
83*7c478bd9Sstevel@tonic-gate #define	TCP_KEEPALIVE	0x8	/* must be same as <netinet/tcp.h> */
84*7c478bd9Sstevel@tonic-gate #endif
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG5) */
87*7c478bd9Sstevel@tonic-gate 
88*7c478bd9Sstevel@tonic-gate /*
89*7c478bd9Sstevel@tonic-gate  * New applications must not use the constants defined above. Instead
90*7c478bd9Sstevel@tonic-gate  * they must use the constants with the T_ prefix defined below. The
91*7c478bd9Sstevel@tonic-gate  * constants without the T_ prefix are meant for compatibility with
92*7c478bd9Sstevel@tonic-gate  * older applications.
93*7c478bd9Sstevel@tonic-gate  */
94*7c478bd9Sstevel@tonic-gate 
95*7c478bd9Sstevel@tonic-gate /*
96*7c478bd9Sstevel@tonic-gate  * TCP level
97*7c478bd9Sstevel@tonic-gate  */
98*7c478bd9Sstevel@tonic-gate #define	T_INET_TCP	6
99*7c478bd9Sstevel@tonic-gate 
100*7c478bd9Sstevel@tonic-gate #define	T_TCP_NODELAY	0x1	/* Don't delay packets to coalesce */
101*7c478bd9Sstevel@tonic-gate #define	T_TCP_MAXSEG	0x2	/* Get maximum segment size */
102*7c478bd9Sstevel@tonic-gate #define	T_TCP_KEEPALIVE	0x8	/* check, if connections are alive */
103*7c478bd9Sstevel@tonic-gate 
104*7c478bd9Sstevel@tonic-gate /*
105*7c478bd9Sstevel@tonic-gate  * Structure used with TCP_KEEPALIVE option.
106*7c478bd9Sstevel@tonic-gate  */
107*7c478bd9Sstevel@tonic-gate struct t_kpalive {
108*7c478bd9Sstevel@tonic-gate 	t_scalar_t	kp_onoff;	/* option on/off */
109*7c478bd9Sstevel@tonic-gate 	t_scalar_t	kp_timeout;	/* timeout in minutes */
110*7c478bd9Sstevel@tonic-gate };
111*7c478bd9Sstevel@tonic-gate 
112*7c478bd9Sstevel@tonic-gate 
113*7c478bd9Sstevel@tonic-gate #if !defined(_XPG5)
114*7c478bd9Sstevel@tonic-gate 
115*7c478bd9Sstevel@tonic-gate /*
116*7c478bd9Sstevel@tonic-gate  * New applications must not use the constants defined below. Instead they
117*7c478bd9Sstevel@tonic-gate  * must use the corresponding T_prefix constants. The constants without the
118*7c478bd9Sstevel@tonic-gate  * T_ prefix are supported for legacy applications.
119*7c478bd9Sstevel@tonic-gate  */
120*7c478bd9Sstevel@tonic-gate 
121*7c478bd9Sstevel@tonic-gate #define	T_GARBAGE		0x02 /* send garbage byte */
122*7c478bd9Sstevel@tonic-gate 
123*7c478bd9Sstevel@tonic-gate /*
124*7c478bd9Sstevel@tonic-gate  * UDP level
125*7c478bd9Sstevel@tonic-gate  */
126*7c478bd9Sstevel@tonic-gate #define	INET_UDP	17 /* must be same as IPPROTO_UDP in <netinet/in.h> */
127*7c478bd9Sstevel@tonic-gate 
128*7c478bd9Sstevel@tonic-gate 
129*7c478bd9Sstevel@tonic-gate /*
130*7c478bd9Sstevel@tonic-gate  * UDP level Options
131*7c478bd9Sstevel@tonic-gate  */
132*7c478bd9Sstevel@tonic-gate 
133*7c478bd9Sstevel@tonic-gate #ifndef UDP_CHECKSUM
134*7c478bd9Sstevel@tonic-gate #define	UDP_CHECKSUM	0x0600	/* must be same as in <netinet/udp.h> */
135*7c478bd9Sstevel@tonic-gate #endif
136*7c478bd9Sstevel@tonic-gate 
137*7c478bd9Sstevel@tonic-gate /*
138*7c478bd9Sstevel@tonic-gate  * IP level
139*7c478bd9Sstevel@tonic-gate  */
140*7c478bd9Sstevel@tonic-gate #define	INET_IP	0	/* must be same as IPPROTO_IP in <netinet/in.h> */
141*7c478bd9Sstevel@tonic-gate 
142*7c478bd9Sstevel@tonic-gate /*
143*7c478bd9Sstevel@tonic-gate  * IP level Options
144*7c478bd9Sstevel@tonic-gate  */
145*7c478bd9Sstevel@tonic-gate 
146*7c478bd9Sstevel@tonic-gate #ifndef IP_OPTIONS
147*7c478bd9Sstevel@tonic-gate #define	IP_OPTIONS	0x1	/* must be same as <netinet/in.h> */
148*7c478bd9Sstevel@tonic-gate #endif
149*7c478bd9Sstevel@tonic-gate 
150*7c478bd9Sstevel@tonic-gate #ifndef IP_TOS
151*7c478bd9Sstevel@tonic-gate #define	IP_TOS		0x3	/* must be same as <netinet/in.h> */
152*7c478bd9Sstevel@tonic-gate #endif
153*7c478bd9Sstevel@tonic-gate 
154*7c478bd9Sstevel@tonic-gate #ifndef IP_TTL
155*7c478bd9Sstevel@tonic-gate #define	IP_TTL		0x4	/* must be same as <netinet/in.h> */
156*7c478bd9Sstevel@tonic-gate #endif
157*7c478bd9Sstevel@tonic-gate 
158*7c478bd9Sstevel@tonic-gate /*
159*7c478bd9Sstevel@tonic-gate  * following also added to <netinet/in.h> and be in sync to keep namespace
160*7c478bd9Sstevel@tonic-gate  * sane
161*7c478bd9Sstevel@tonic-gate  */
162*7c478bd9Sstevel@tonic-gate 
163*7c478bd9Sstevel@tonic-gate #ifndef IP_REUSEADDR
164*7c478bd9Sstevel@tonic-gate #define	IP_REUSEADDR	0x104	/* allow local address reuse */
165*7c478bd9Sstevel@tonic-gate #endif
166*7c478bd9Sstevel@tonic-gate 
167*7c478bd9Sstevel@tonic-gate #ifndef IP_DONTROUTE
168*7c478bd9Sstevel@tonic-gate #define	IP_DONTROUTE	0x105	/* just use interface addresses */
169*7c478bd9Sstevel@tonic-gate #endif
170*7c478bd9Sstevel@tonic-gate 
171*7c478bd9Sstevel@tonic-gate #ifndef IP_BROADCAST
172*7c478bd9Sstevel@tonic-gate #define	IP_BROADCAST	0x106	/* permit sending of broadcast msgs */
173*7c478bd9Sstevel@tonic-gate #endif
174*7c478bd9Sstevel@tonic-gate 
175*7c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG5) */
176*7c478bd9Sstevel@tonic-gate 
177*7c478bd9Sstevel@tonic-gate /*
178*7c478bd9Sstevel@tonic-gate  * New applications should use the T_ prefix constants below
179*7c478bd9Sstevel@tonic-gate  */
180*7c478bd9Sstevel@tonic-gate 
181*7c478bd9Sstevel@tonic-gate /*
182*7c478bd9Sstevel@tonic-gate  * UDP level
183*7c478bd9Sstevel@tonic-gate  */
184*7c478bd9Sstevel@tonic-gate #define	T_INET_UDP	17
185*7c478bd9Sstevel@tonic-gate 
186*7c478bd9Sstevel@tonic-gate /*
187*7c478bd9Sstevel@tonic-gate  * UDP level Options
188*7c478bd9Sstevel@tonic-gate  */
189*7c478bd9Sstevel@tonic-gate #define	T_UDP_CHECKSUM	0x0600	/* Checksum computation */
190*7c478bd9Sstevel@tonic-gate 
191*7c478bd9Sstevel@tonic-gate /*
192*7c478bd9Sstevel@tonic-gate  * IP level
193*7c478bd9Sstevel@tonic-gate  */
194*7c478bd9Sstevel@tonic-gate #define	T_INET_IP	0
195*7c478bd9Sstevel@tonic-gate 
196*7c478bd9Sstevel@tonic-gate /*
197*7c478bd9Sstevel@tonic-gate  * IP level Options
198*7c478bd9Sstevel@tonic-gate  */
199*7c478bd9Sstevel@tonic-gate #define	T_IP_TTL	0x4	/* IP per packet time to live */
200*7c478bd9Sstevel@tonic-gate #define	T_IP_REUSEADDR	0x104	/* allow local address reuse */
201*7c478bd9Sstevel@tonic-gate #define	T_IP_DONTROUTE	0x105	/* just use interface addresses */
202*7c478bd9Sstevel@tonic-gate #define	T_IP_BROADCAST	0x106	/* permit sending of broadcast msgs */
203*7c478bd9Sstevel@tonic-gate #define	T_IP_OPTIONS	0x107	/* IP per-packet options */
204*7c478bd9Sstevel@tonic-gate #define	T_IP_TOS	0x108	/* IP per packet type of service */
205*7c478bd9Sstevel@tonic-gate 
206*7c478bd9Sstevel@tonic-gate /*
207*7c478bd9Sstevel@tonic-gate  * IP_TOS precedence level
208*7c478bd9Sstevel@tonic-gate  */
209*7c478bd9Sstevel@tonic-gate #define	T_ROUTINE			0
210*7c478bd9Sstevel@tonic-gate #define	T_PRIORITY			1
211*7c478bd9Sstevel@tonic-gate #define	T_IMMEDIATE			2
212*7c478bd9Sstevel@tonic-gate #define	T_FLASH				3
213*7c478bd9Sstevel@tonic-gate #define	T_OVERRIDEFLASH			4
214*7c478bd9Sstevel@tonic-gate #define	T_CRITIC_ECP			5
215*7c478bd9Sstevel@tonic-gate #define	T_INETCONTROL			6
216*7c478bd9Sstevel@tonic-gate #define	T_NETCONTROL			7
217*7c478bd9Sstevel@tonic-gate 
218*7c478bd9Sstevel@tonic-gate 
219*7c478bd9Sstevel@tonic-gate /*
220*7c478bd9Sstevel@tonic-gate  * IP_TOS type of service
221*7c478bd9Sstevel@tonic-gate  */
222*7c478bd9Sstevel@tonic-gate #define	T_NOTOS		0
223*7c478bd9Sstevel@tonic-gate #define	T_LDELAY	(1<<4)
224*7c478bd9Sstevel@tonic-gate #define	T_HITHRPT	(1<<3)
225*7c478bd9Sstevel@tonic-gate #define	T_HIREL		(1<<2)
226*7c478bd9Sstevel@tonic-gate #define	T_LOCOST	(1<<1)
227*7c478bd9Sstevel@tonic-gate 
228*7c478bd9Sstevel@tonic-gate #define	SET_TOS(prec, tos)	((0x7 & (prec)) << 5 | (0x1e & (tos)))
229*7c478bd9Sstevel@tonic-gate 
230*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
231*7c478bd9Sstevel@tonic-gate }
232*7c478bd9Sstevel@tonic-gate #endif
233*7c478bd9Sstevel@tonic-gate 
234*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_XTI_INET_H */
235