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