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
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]
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 #include <sys/types.h>
40 * This is a private header file. Applications should not directly include
41 * this file. Instead they should include <xti_inet.h>
47 * INTERNET SPECIFIC ENVIRONMENT
50 * Unfortunately, XTI specification test assertions require exposing in
51 * headers options that are not implemented. They also require exposing
52 * Internet and OSI related options as part of inclusion of <xti.h>
54 * Also XTI specification intrudes on <netinet/in.h> TCP_ and IP_ namespaces
55 * and sometimes redefines the semantics or types of some options with a
56 * different history in that namespace. The name and binary value are exposed
57 * but option semantics may be different from what is in XTI spec and we defer
58 * to the <netinet/in.h> precedent.
60 * New applications should not use these constants. These are meant
61 * for compatibility with older applications.
67 #define INET_TCP 6 /* must be same as IPPROTO_TCP in <netinet/in.h> */
73 #define TCP_NODELAY 0x1 /* must be same as <netinet/tcp.h> */
77 #define TCP_MAXSEG 0x2 /* must be same as <netinet/tcp.h> */
81 #define TCP_KEEPALIVE 0x8 /* must be same as <netinet/tcp.h> */
84 #endif /* !defined(_XPG5) */
87 * New applications must not use the constants defined above. Instead
88 * they must use the constants with the T_ prefix defined below. The
89 * constants without the T_ prefix are meant for compatibility with
98 #define T_TCP_NODELAY 0x1 /* Don't delay packets to coalesce */
99 #define T_TCP_MAXSEG 0x2 /* Get maximum segment size */
100 #define T_TCP_KEEPALIVE 0x8 /* check, if connections are alive */
103 * Structure used with TCP_KEEPALIVE option.
106 t_scalar_t kp_onoff
; /* option on/off */
107 t_scalar_t kp_timeout
; /* timeout in minutes */
114 * New applications must not use the constants defined below. Instead they
115 * must use the corresponding T_prefix constants. The constants without the
116 * T_ prefix are supported for legacy applications.
119 #define T_GARBAGE 0x02 /* send garbage byte */
124 #define INET_UDP 17 /* must be same as IPPROTO_UDP in <netinet/in.h> */
132 #define UDP_CHECKSUM 0x0600 /* must be same as in <netinet/udp.h> */
138 #define INET_IP 0 /* must be same as IPPROTO_IP in <netinet/in.h> */
145 #define IP_OPTIONS 0x1 /* must be same as <netinet/in.h> */
149 #define IP_TOS 0x3 /* must be same as <netinet/in.h> */
153 #define IP_TTL 0x4 /* must be same as <netinet/in.h> */
157 * following also added to <netinet/in.h> and be in sync to keep namespace
162 #define IP_REUSEADDR 0x104 /* allow local address reuse */
166 #define IP_DONTROUTE 0x105 /* just use interface addresses */
170 #define IP_BROADCAST 0x106 /* permit sending of broadcast msgs */
173 #endif /* !defined(_XPG5) */
176 * New applications should use the T_ prefix constants below
182 #define T_INET_UDP 17
187 #define T_UDP_CHECKSUM 0x0600 /* Checksum computation */
197 #define T_IP_TTL 0x4 /* IP per packet time to live */
198 #define T_IP_REUSEADDR 0x104 /* allow local address reuse */
199 #define T_IP_DONTROUTE 0x105 /* just use interface addresses */
200 #define T_IP_BROADCAST 0x106 /* permit sending of broadcast msgs */
201 #define T_IP_OPTIONS 0x107 /* IP per-packet options */
202 #define T_IP_TOS 0x108 /* IP per packet type of service */
205 * IP_TOS precedence level
209 #define T_IMMEDIATE 2
211 #define T_OVERRIDEFLASH 4
212 #define T_CRITIC_ECP 5
213 #define T_INETCONTROL 6
214 #define T_NETCONTROL 7
218 * IP_TOS type of service
221 #define T_LDELAY (1<<4)
222 #define T_HITHRPT (1<<3)
223 #define T_HIREL (1<<2)
224 #define T_LOCOST (1<<1)
226 #define SET_TOS(prec, tos) ((0x7 & (prec)) << 5 | (0x1e & (tos)))
232 #endif /* _SYS_XTI_INET_H */