Changeset 183 for trunk/src/emx/include/netinet/in.h
- Timestamp:
- May 19, 2003, 4:41:00 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/netinet/in.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv and em 1994,1996 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1982, 1986, 1990 Regents of the University of California. … … 66 67 #define IPPROTO_UDP 17 /* user datagram protocol */ 67 68 #define IPPROTO_IDP 22 /* xns idp */ 69 #ifndef TCPV40HDRS 68 70 #define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ 69 71 #define IPPROTO_EON 80 /* ISO cnlp */ 72 #define IPPROTO_ENCAP 98 /* encapsulation header */ 73 #endif 70 74 71 75 #define IPPROTO_RAW 255 /* raw IP packet */ … … 80 84 * for servers, not necessarily privileged. 81 85 */ 86 #ifdef TCPV40HDRS 82 87 #define IPPORT_RESERVED 1024 83 88 #define IPPORT_USERRESERVED 5000 89 #else 90 /* Changing the ephemeral port #s as per Internet Assigned Numbers Authority's 91 * update as found in JUL '97. [Ref: http://www.isi.edu/div7/iana/descript/html] */ 92 #define IPPORT_RESERVED 49152 /* Old 1024. Changed as per IANA draft */ 93 #define IPPORT_USERRESERVED 65535 /* Old 5000. Changed as per IANA draft */ 94 #endif 95 96 #ifdef TCPV40HDRS 97 /* 98 * Link numbers 99 */ 100 #define IMPLINK_IP 155 101 #define IMPLINK_LOWEXPER 156 102 #define IMPLINK_HIGHEXPER 158 103 #endif 84 104 85 105 /* … … 113 133 114 134 #define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) 135 #ifdef TCPV40HDRS 136 #define IN_CLASSD_NET 0xffffffff 137 #define IN_CLASSD_HOST 0 138 #else 115 139 #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ 140 #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ 141 #endif 116 142 #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ 117 #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */118 143 #define IN_MULTICAST(i) IN_CLASSD(i) 119 144 145 #ifdef TCPV40HDRS 120 146 #define IN_EXPERIMENTAL(i) (((long)(i) & 0xe0000000) == 0xe0000000) 147 #else 148 #define IN_EXPERIMENTAL(i) (((long)(i) & 0xf0000000) == 0xe0000000) 149 #endif 121 150 #define IN_BADCLASS(i) (((long)(i) & 0xf0000000) == 0xf0000000) 122 151 123 152 #define INADDR_ANY (u_long)0x00000000 153 #ifndef TCPV40HDRS 124 154 #define INADDR_LOOPBACK (u_long)0x7f000001 155 #endif 125 156 #define INADDR_BROADCAST (u_long)0xffffffff /* must be masked */ 126 #ifndef KERNEL127 #define INADDR_NONE 0xffffffff /* -1 return */128 #endif129 157 130 158 #define INADDR_UNSPEC_GROUP (u_long)0xe0000000 /* 224.0.0.0 */ … … 132 160 #define INADDR_MAX_LOCAL_GROUP (u_long)0xe00000ff /* 224.0.0.255 */ 133 161 162 #ifndef KERNEL 163 #define INADDR_NONE 0xffffffff /* -1 return */ 164 #endif 165 134 166 #define IN_LOOPBACKNET 127 /* official! */ 135 167 136 /* 137 * Define a macro to stuff the loopback address into an Internet address 138 */ 139 #define IN_SET_LOOPBACK_ADDR(a) { \ 140 (a)->sin_addr.s_addr = htonl(INADDR_LOOPBACK); \ 141 (a)->sin_family = AF_INET; } 168 142 169 /* 143 170 * Socket address, internet style. 4.3BSD 144 171 */ 172 #ifdef TCPV40HDRS 145 173 struct sockaddr_in { 146 174 short sin_family; … … 149 177 char sin_zero[8]; 150 178 }; 179 #else 180 #pragma pack(1) 181 struct sockaddr_in { 182 u_char sin_len; 183 u_char sin_family; 184 u_short sin_port; 185 struct in_addr sin_addr; 186 char sin_zero[8]; 187 }; 188 #pragma pack() 189 #endif 151 190 152 191 /* … … 157 196 * (this gets put into the header proper). 158 197 */ 198 #ifndef TCPV40HDRS 199 #pragma pack(1) 200 #endif 159 201 struct ip_opts { 160 202 struct in_addr ip_dst; /* first hop, 0 w/o src rt */ 161 203 char ip_opts[40]; /* actually variable in size */ 162 204 }; 205 #ifndef TCPV40HDRS 206 #pragma pack() 207 #endif 163 208 164 209 /* … … 167 212 */ 168 213 #define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ 169 170 214 #define IP_MULTICAST_IF 2 /* u_char; set/get IP mcast i/f */ 171 215 #define IP_MULTICAST_TTL 3 /* u_char; set/get IP mcast ttl */ … … 173 217 #define IP_ADD_MEMBERSHIP 5 /* ip_mreq; add IP group membership */ 174 218 #define IP_DROP_MEMBERSHIP 6 /* ip_mreq; drop IP group membership */ 175 176 #ifndef __EMX__ /* not supported so far */ 177 #define IP_HDRINCL 2 /* int; header is included with data */ 178 #define IP_TOS 3 /* int; IP type of service and preced */ 179 #define IP_TTL 4 /* int; IP time to live */ 180 #define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ 181 #define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ 182 #define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ 183 #define IP_RETOPTS 8 /* ip_opts; set/get IP options */ 184 #endif 185 219 #ifndef TCPV40HDRS 220 #define IP_HDRINCL 7 /* int; header is included with data */ 221 #define IP_TOS 8 /* int; IP type of service and preced. */ 222 #define IP_TTL 9 /* int; IP time to live */ 223 #define IP_RECVOPTS 10 /* bool; receive all IP opts w/dgram */ 224 #define IP_RECVRETOPTS 11 /* bool; receive IP opts for response */ 225 #define IP_RECVDSTADDR 12 /* bool; receive IP dst addr w/dgram */ 226 #define IP_RETOPTS 13 /* ip_opts; set/get IP options */ 227 #define IP_RECVTRRI 14 /* bool; receive token ring routing inf */ 228 #endif 229 230 /* 231 * Defaults and limits for options 232 */ 186 233 #define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ 187 234 #define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ 188 235 #define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */ 236 #ifndef TCPV40HDRS 237 #define MAX_IN_MULTI 16*IP_MAX_MEMBERSHIPS /* 320 max per os2 */ 238 extern u_short CntInMulti; 239 #endif 189 240 190 241 /* 191 242 * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. 192 243 */ 244 #ifndef TCPV40HDRS 245 #pragma pack(1) 246 #endif 193 247 struct ip_mreq { 194 248 struct in_addr imr_multiaddr; /* IP multicast address of group */ 195 249 struct in_addr imr_interface; /* local IP address of interface */ 196 250 }; 197 198 /* prototypes for functions in inet(3) */ 199 extern u_long inet_addr(__const__ char*); 200 extern struct in_addr inet_makeaddr(u_long, u_long); 201 extern u_long inet_network(__const__ char*); 202 extern char *inet_ntoa(struct in_addr); 203 extern u_long inet_netof(struct in_addr); 204 extern u_long inet_lnaof(struct in_addr); 251 #ifndef TCPV40HDRS 252 #pragma pack() 253 #endif 254 255 #ifdef TCPV40HDRS 256 /* for functions */ 257 #include <arpa/inet.h> 258 259 #else 260 261 /* 262 * Definitions for inet sysctl operations. 263 * 264 * Third level is protocol number. 265 * Fourth level is desired variable within that protocol. 266 */ 267 #define IPPROTO_MAXID (IPPROTO_IDP + 1) /* don't list to IPPROTO_MAX */ 268 269 #define CTL_IPPROTO_NAMES { \ 270 { "ip", CTLTYPE_NODE }, \ 271 { "icmp", CTLTYPE_NODE }, \ 272 { "igmp", CTLTYPE_NODE }, \ 273 { "ggp", CTLTYPE_NODE }, \ 274 { 0, 0 }, \ 275 { 0, 0 }, \ 276 { "tcp", CTLTYPE_NODE }, \ 277 { 0, 0 }, \ 278 { "egp", CTLTYPE_NODE }, \ 279 { 0, 0 }, \ 280 { 0, 0 }, \ 281 { 0, 0 }, \ 282 { "pup", CTLTYPE_NODE }, \ 283 { 0, 0 }, \ 284 { 0, 0 }, \ 285 { 0, 0 }, \ 286 { 0, 0 }, \ 287 { "udp", CTLTYPE_NODE }, \ 288 { 0, 0 }, \ 289 { 0, 0 }, \ 290 { 0, 0 }, \ 291 { 0, 0 }, \ 292 { "idp", CTLTYPE_NODE }, \ 293 } 294 #endif /*TCPV40HDRS (else) */ 205 295 206 296 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.