Changeset 183
- Timestamp:
- May 19, 2003, 4:41:00 AM (22 years ago)
- Location:
- trunk/src/emx/include
- Files:
-
- 2 added
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/arpa/ftp.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* 1 /* Modified for gcc by bird 2003 2 * 2 3 * Copyright (c) 1983, 1989 Regents of the University of California. 3 4 * All rights reserved. … … 36 37 #ifndef _FTP_H_ 37 38 #define _FTP_H_ 39 #define _ARPA_FTP_H_ 38 40 39 41 /* Definitions for FTP; see RFC-765. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/arpa/inet.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv and em 1994 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1983 Regents of the University of California. … … 44 45 45 46 /* External definitions for functions in inet(3) */ 46 extern u_long inet_addr(__const__ char*); 47 extern u_long inet_lnaof(struct in_addr); 48 extern struct in_addr inet_makeaddr(u_long, u_long); 49 extern u_long inet_netof(struct in_addr); 50 extern u_long inet_network(__const__ char*); 51 extern char* inet_ntoa(struct in_addr); 47 48 #ifndef TCPV40HDRS 49 #include <sys/param.h> 50 #include <sys/types.h> 51 #include <sys/cdefs.h> 52 int _System inet_aton (const char *, struct in_addr *); 53 char * _System inet_neta (u_long, char *, size_t); 54 char * _System inet_net_ntop (int, const void *, int, char *, size_t); 55 int _System inet_net_pton (int, const char *, void *, size_t); 56 int _System inet_pton (int af, const char *src, void *dst); 57 const char * _System inet_ntop (int af, const void *src, char *dst, size_t s); 58 u_int _System inet_nsap_addr (const char *, u_char *, int maxlen); 59 char * _System inet_nsap_ntoa (int, const u_char *, char *ascii); 60 #endif 61 62 extern u_long _System inet_addr(__const__ char*); 63 extern u_long _System inet_lnaof(struct in_addr); 64 extern struct in_addr _System inet_makeaddr(u_long, u_long); 65 extern u_long _System inet_netof(struct in_addr); 66 extern u_long _System inet_network(__const__ char*); 67 extern char* _System inet_ntoa(struct in_addr); 52 68 53 69 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/arpa/nameser.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1994,1996 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1983, 1989 Regents of the University of California. … … 45 46 #include <sys/param.h> /* htons() etc. */ 46 47 #include <machine/endian.h> /* BYTE ORDER etc. */ 48 #ifndef TCPV40HDRS 49 #include <types.h> 50 #include <sys/cdefs.h> 51 #endif 47 52 48 53 /* … … 50 55 */ 51 56 #define PACKETSZ 512 /* maximum packet size */ 57 #ifdef TCPV40HDRS 52 58 #define MAXDNAME 256 /* maximum domain name */ 59 #else 60 #define MAXDNAME 1025 /* maximum presentation domain name */ 61 #endif 53 62 #define MAXCDNAME 255 /* maximum compressed domain name */ 54 63 #define MAXLABEL 63 /* maximum length of domain label */ … … 57 66 /* number of bytes of fixed size data in resource record */ 58 67 #define RRFIXEDSZ 10 68 #ifndef TCPV40HDRS 69 #define HFIXEDSZ 12 /* #/bytes of fixed data in header */ 70 #define RRFIXEDSZ 10 /* #/bytes of fixed data in r record */ 71 #define INT32SZ 4 /* for systems without 32-bit ints */ 72 #define INT16SZ 2 /* for systems without 16-bit ints */ 73 #define INADDRSZ 4 /* IPv4 T_A */ 74 #define IN6ADDRSZ 16 /* IPv6 T_AAAA */ 75 #endif 59 76 60 77 /* … … 68 85 #define QUERY 0x0 /* standard query */ 69 86 #define IQUERY 0x1 /* inverse query */ 87 #ifdef TCPV40HDRS 88 #define CQUERYM 2 /* completion query (multiple) */ 89 #define CQUERYU 3 /* completion query (unique) */ 90 #endif 70 91 #define STATUS 0x2 /* nameserver status query */ 71 92 /*#define xxx 0x3 0x3 reserved */ 72 93 /* non standard */ 94 #ifdef TCPV40HDRS 73 95 /* IBM has changed these codes in TCP/IP for OS/2 */ 74 96 #define UPDATEA 100 /* add resource record */ … … 77 99 #define ZONEINIT 103 /* initial zone transfer */ 78 100 #define ZONEREF 104 /* incremental zone referesh */ 101 #else 102 #define NS_NOTIFY_OP 0x4 /* notify secondary of SOA change */ 103 #endif 79 104 80 105 /* … … 88 113 #define REFUSED 5 /* query refused */ 89 114 /* non standard */ 115 #ifdef TCPV40HDRS 90 116 #define NOCHANGE 100 /* update failed to change db */ 117 #endif 91 118 92 119 /* … … 108 135 #define T_MINFO 14 /* mailbox information */ 109 136 #define T_MX 15 /* mail routing information */ 137 #ifndef TCPV40HDRS 110 138 #define T_TXT 16 /* text strings */ 139 #define T_RP 17 /* responsible person */ 140 #define T_AFSDB 18 /* AFS cell database */ 141 #define T_X25 19 /* X_25 calling address */ 142 #define T_ISDN 20 /* ISDN calling address */ 143 #define T_RT 21 /* router */ 144 #define T_NSAP 22 /* NSAP address */ 145 #define T_NSAP_PTR 23 /* reverse NSAP lookup (deprecated) */ 146 #define T_SIG 24 /* security signature */ 147 #define T_KEY 25 /* security key */ 148 #define T_PX 26 /* X.400 mail mapping */ 149 #define T_GPOS 27 /* geographical position (withdrawn) */ 150 #define T_AAAA 28 /* IP6 Address */ 151 #define T_LOC 29 /* Location Information */ 152 #define T_NXT 30 /* Next Valid Name in Zone */ 153 #define T_EID 31 /* Endpoint identifier */ 154 #define T_NIMLOC 32 /* Nimrod locator */ 155 #define T_SRV 33 /* Server selection */ 156 #define T_ATMA 34 /* ATM Address */ 157 #define T_NAPTR 35 /* Naming Authority PoinTeR */ 158 #endif 111 159 /* non standard */ 112 160 #define T_UINFO 100 /* user (finger) information */ 113 161 #define T_UID 101 /* user ID */ 114 162 #define T_GID 102 /* group ID */ 163 #ifndef TCPV40HDRS 115 164 #define T_UNSPEC 103 /* Unspecified format (binary data) */ 165 #endif 116 166 /* Query type values which do not appear in resource records */ 167 #ifndef TCPV40HDRS 168 #define T_IXFR 251 /* incremental zone transfer */ 169 #endif 117 170 #define T_AXFR 252 /* transfer zone of authority */ 118 171 #define T_MAILB 253 /* transfer mailbox records */ … … 125 178 #define C_IN 1 /* the arpa internet */ 126 179 #define C_CHAOS 3 /* for chaos net at MIT */ 180 #ifndef TCPV40HDRS 127 181 #define C_HS 4 /* for Hesiod name server at MIT */ 182 #endif 128 183 /* Query class values which do not appear in resource records */ 129 184 #define C_ANY 255 /* wildcard match */ 130 185 186 /* 187 * Flags field of the KEY RR rdata 188 */ 189 #define KEYFLAG_TYPEMASK 0xC000 /* Mask for "type" bits */ 190 #define KEYFLAG_TYPE_AUTH_CONF 0x0000 /* Key usable for both */ 191 #define KEYFLAG_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */ 192 #define KEYFLAG_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */ 193 #define KEYFLAG_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */ 194 /* The type bits can also be interpreted independently, as single bits: */ 195 #define KEYFLAG_NO_AUTH 0x8000 /* Key not usable for authentication */ 196 #define KEYFLAG_NO_CONF 0x4000 /* Key not usable for confidentiality */ 197 198 #define KEYFLAG_EXPERIMENTAL 0x2000 /* Security is *mandatory* if bit=0 */ 199 #define KEYFLAG_RESERVED3 0x1000 /* reserved - must be zero */ 200 #define KEYFLAG_RESERVED4 0x0800 /* reserved - must be zero */ 201 #define KEYFLAG_USERACCOUNT 0x0400 /* key is assoc. with a user acct */ 202 #define KEYFLAG_ENTITY 0x0200 /* key is assoc. with entity eg host */ 203 #define KEYFLAG_ZONEKEY 0x0100 /* key is zone key for the zone named */ 204 #define KEYFLAG_IPSEC 0x0080 /* key is for IPSEC use (host or user)*/ 205 #define KEYFLAG_EMAIL 0x0040 /* key is for email (MIME security) */ 206 #define KEYFLAG_RESERVED10 0x0020 /* reserved - must be zero */ 207 #define KEYFLAG_RESERVED11 0x0010 /* reserved - must be zero */ 208 #define KEYFLAG_SIGNATORYMASK 0x000F /* key can sign DNS RR's of same name */ 209 210 #define KEYFLAG_RESERVED_BITMASK ( KEYFLAG_RESERVED3 | \ 211 KEYFLAG_RESERVED4 | \ 212 KEYFLAG_RESERVED10| KEYFLAG_RESERVED11) 213 214 /* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */ 215 #define ALGORITHM_MD5RSA 1 /* MD5 with RSA */ 216 #define ALGORITHM_EXPIRE_ONLY 253 /* No alg, no security */ 217 #define ALGORITHM_PRIVATE_OID 254 /* Key begins with OID indicating alg */ 218 219 /* Signatures */ 220 /* Size of a mod or exp in bits */ 221 #define MIN_MD5RSA_KEY_PART_BITS 512 222 #define MAX_MD5RSA_KEY_PART_BITS 2552 223 /* Total of binary mod and exp, bytes */ 224 #define MAX_MD5RSA_KEY_BYTES ((MAX_MD5RSA_KEY_PART_BITS+7/8)*2+3) 225 /* Max length of text sig block */ 226 #define MAX_KEY_BASE64 (((MAX_MD5RSA_KEY_BYTES+2)/3)*4) 227 228 #ifndef TCPV40HDRS 131 229 /* 132 230 * Status return codes for T_UNSPEC conversion routines … … 137 235 #define CONV_BADCKSUM -3 138 236 #define CONV_BADBUFLEN -4 237 #endif 139 238 140 239 /* 141 240 * Structure for query header, the order of the fields is machine and 142 * compiler dependent, in our case, the bits within a byte are assignd 143 * least significant first, while the order of transmition is most 241 * compiler dependent, in our case, the bits within a byte are assignd 242 * least significant first, while the order of transmition is most 144 243 * significant first. This requires a somewhat confusing rearrangement. 145 244 */ 245 #ifndef TCPV40HDRS 246 #pragma pack(1) 247 #endif 146 248 typedef struct { 147 249 u_short id; /* query identification number */ … … 155 257 /* fields in fourth byte */ 156 258 u_char ra:1; /* recursion available */ 259 #ifdef TCPV40HDRS 157 260 u_char pr:1; /* primary server required (non standard) */ 158 261 u_char unused:2; /* unused bits */ 262 #else 263 u_char unused :1; /* unused bits (MBZ as of 4.9.3a3) */ 264 u_char ad: 1; /* authentic data from named */ 265 u_char cd: 1; /* checking disabled by resolver */ 266 #endif 159 267 u_char rcode:4; /* response code */ 160 268 #endif … … 168 276 /* fields in fourth byte */ 169 277 u_char rcode:4; /* response code */ 278 #ifdef TCPV40HDRS 170 279 u_char unused:2; /* unused bits */ 171 280 u_char pr:1; /* primary server required (non standard) */ 281 #else 282 u_char cd: 1; /* checking disabled by resolver */ 283 u_char ad: 1; /* authentic data from named */ 284 u_char unused :1; /* unused bits (MBZ as of 4.9.3a3) */ 285 #endif 172 286 u_char ra:1; /* recursion available */ 173 287 #endif … … 178 292 u_short arcount; /* number of resource entries */ 179 293 } HEADER; 294 #ifndef TCPV40HDRS 295 #pragma pack() 296 #endif 180 297 181 298 /* … … 184 301 #define INDIR_MASK 0xc0 185 302 303 #ifdef TCPV40HDRS 186 304 /* 187 305 * Structure for passing resource records around. … … 197 315 }; 198 316 #pragma pack() 199 200 /* 201 * Inline versions of get/put short/long. 202 * Pointer is advanced; we assume that both arguments 203 * are lvalues and will already be in registers. 204 * cp MUST be u_char *. 317 #endif 318 319 #ifndef TCPV40HDRS 320 /* 321 * Inline versions of get/put short/long. Pointer is advanced. 322 * 323 * These macros demonstrate the property of C whereby it can be 324 * portable or it can be elegant but rarely both. 205 325 */ 206 326 #define GETSHORT(s, cp) { \ 207 (s) = *(cp)++ << 8; \ 208 (s) |= *(cp)++; \ 327 register u_char *t_cp = (u_char *)(cp); \ 328 (s) = ((u_int16_t)t_cp[0] << 8) \ 329 | ((u_int16_t)t_cp[1]) \ 330 ; \ 331 (cp) += INT16SZ; \ 209 332 } 210 333 211 334 #define GETLONG(l, cp) { \ 212 (l) = *(cp)++ << 8; \ 213 (l) |= *(cp)++; (l) <<= 8; \ 214 (l) |= *(cp)++; (l) <<= 8; \ 215 (l) |= *(cp)++; \ 216 } 217 335 register u_char *t_cp = (u_char *)(cp); \ 336 (l) = ((u_int32_t)t_cp[0] << 24) \ 337 | ((u_int32_t)t_cp[1] << 16) \ 338 | ((u_int32_t)t_cp[2] << 8) \ 339 | ((u_int32_t)t_cp[3]) \ 340 ; \ 341 (cp) += INT32SZ; \ 342 } 218 343 219 344 #define PUTSHORT(s, cp) { \ 220 *(cp)++ = (s) >> 8; \221 *(cp)++ = (s); \222 } 223 224 /* 225 * Warning: PUTLONG destroys its first argument. 226 */ 345 register u_int16_t t_s = (u_int16_t)(s); \ 346 register u_char *t_cp = (u_char *)(cp); \ 347 *t_cp++ = t_s >> 8; \ 348 *t_cp = t_s; \ 349 (cp) += INT16SZ; \ 350 } 351 227 352 #define PUTLONG(l, cp) { \ 228 (cp)[3] = l; \ 229 (cp)[2] = (l >>= 8); \ 230 (cp)[1] = (l >>= 8); \ 231 (cp)[0] = l >> 8; \ 232 (cp) += sizeof(u_long); \ 233 } 353 register u_int32_t t_l = (u_int32_t)(l); \ 354 register u_char *t_cp = (u_char *)(cp); \ 355 *t_cp++ = t_l >> 24; \ 356 *t_cp++ = t_l >> 16; \ 357 *t_cp++ = t_l >> 8; \ 358 *t_cp = t_l; \ 359 (cp) += INT32SZ; \ 360 } 361 #endif /*!TCPV40HDRS*/ 234 362 235 363 /* function prototypes */ 236 u_short 237 u_long _ getlong(u_char*);238 void putshort(u_short, u_char *); 239 void putlong(u_long, u_char *);240 int dn_expand(__const__ u_char*, __const__ u_char*, __const__ u_char*, 241 242 int dn_comp(__const__ u_char*, u_char*, int, u_char**, u_char**);243 int dn_find(u_char*, u_char*, u_char**, u_char**);244 int dn_skipname(__const__ u_char*, __const__ u_char*);245 int res_init(void);246 int res_mkquery(int, __const__ char*, int, int, __const__ char*,247 int, __const__ struct rrec*, char*, int);248 int res_send(__const__ char*, int,char*, int);249 int res_query(char*, int, int, u_char*, int);250 int res_search(char*, int, int, u_char*, int);251 int res_querydomain(char*, char*, int, int, u_char*, int); 364 u_short _System _getshort(u_char*); 365 u_long _System _getlong(u_char*); 366 #ifdef TCPV40HDRS /* newer have this in resolver */ 367 void _System putshort(u_short, u_char *); 368 void _System putlong(u_long, u_char *); 369 int _System dn_expand(__const__ u_char*, __const__ u_char*, __const__ u_char*, u_char*, int); 370 int _System dn_comp(__const__ u_char*, u_char*, int, u_char**, u_char**); 371 int _System dn_find(u_char*, u_char*, u_char**, u_char**); 372 int _System dn_skipname(__const__ u_char*, __const__ u_char*); 373 int _System res_init(void); 374 int _System res_mkquery(int, __const__ char*, int, int, __const__ char*, int, __const__ struct rrec*, char*, int); 375 int _System res_send(__const__ char*, int, char*, int); 376 int _System res_query(char*, int, int, u_char*, int); 377 int _System res_search(char*, int, int, u_char*, int); 378 int _System res_querydomain(char*, char*, int, int, u_char*, int); 379 #endif 252 380 253 381 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/arpa/telnet.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* 1 /* Modified for gcc by bird 2003 2 * 2 3 * Copyright (c) 1983 Regents of the University of California. 3 4 * All rights reserved. … … 36 37 #ifndef _TELNET_H_ 37 38 #define _TELNET_H_ 39 #define _ARPA_TELNET_H_ 38 40 39 41 /* … … 75 77 #define TELCMD_FIRST xEOF 76 78 #define TELCMD_LAST IAC 77 #define TELCMD_OK(x) (( x) <= TELCMD_LAST &&(x) >= TELCMD_FIRST)79 #define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && (unsigned int)(x) >= TELCMD_FIRST) 78 80 #define TELCMD(x) telcmds[(x)-TELCMD_FIRST] 79 81 … … 115 117 #define TELOPT_LINEMODE 34 /* Linemode option */ 116 118 #define TELOPT_XDISPLOC 35 /* X Display Location */ 117 #define TELOPT_ ENVIRON 36 /*Environment variables */119 #define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */ 118 120 #define TELOPT_AUTHENTICATION 37/* Authenticate */ 119 121 #define TELOPT_ENCRYPT 38 /* Encryption option */ 122 #define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */ 120 123 #define TELOPT_EXOPL 255 /* extended-options-list */ 121 124 122 125 123 #define NTELOPTS (1+TELOPT_ ENCRYPT)126 #define NTELOPTS (1+TELOPT_NEW_ENVIRON) 124 127 #ifdef TELOPTS 125 128 char *telopts[NTELOPTS+1] = { … … 132 135 "TACACS UID", "OUTPUT MARKING", "TTYLOC", 133 136 "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW", 134 "LINEMODE", "XDISPLOC", " ENVIRON", "AUTHENTICATION",135 "ENCRYPT", 137 "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION", 138 "ENCRYPT", "NEW-ENVIRON", 136 139 0, 137 140 }; 138 141 #define TELOPT_FIRST TELOPT_BINARY 139 #define TELOPT_LAST TELOPT_ ENCRYPT140 #define TELOPT_OK(x) (( x) <= TELOPT_LAST && (x) >= TELOPT_FIRST)142 #define TELOPT_LAST TELOPT_NEW_ENVIRON 143 #define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST) 141 144 #define TELOPT(x) telopts[(x)-TELOPT_FIRST] 142 145 #endif … … 148 151 #define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */ 149 152 #define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */ 153 154 #define LFLOW_OFF 0 /* Disable remote flow control */ 155 #define LFLOW_ON 1 /* Enable remote flow control */ 156 #define LFLOW_RESTART_ANY 2 /* Restart output on any char */ 157 #define LFLOW_RESTART_XON 3 /* Restart output only on XON */ 150 158 151 159 /* … … 209 217 #endif 210 218 211 #define SLC_NAME_OK(x) (( x) >= 0 && (x) <NSLC)219 #define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC) 212 220 #define SLC_NAME(x) slc_names[x] 213 221 … … 226 234 #define SLC_FLUSHOUT 0x20 227 235 228 #define ENV_VALUE 0 229 #define ENV_VAR 1 230 #define ENV_ESC 2 236 #define OLD_ENV_VALUE 0 237 #define OLD_ENV_VAR 1 238 #define NEW_ENV_VAR 0 239 #define NEW_ENV_VALUE 1 240 #define ENV_ESC 2 241 #define ENV_USERVAR 3 231 242 232 243 /* … … 265 276 #endif 266 277 267 #define AUTHTYPE_NAME_OK(x) ((x) >= 0 &&(x) < AUTHTYPE_CNT)278 #define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT) 268 279 #define AUTHTYPE_NAME(x) authtype_names[x] 269 280 … … 302 313 303 314 304 #define ENCRYPT_NAME_OK(x) (( x) >= 0 &&(x) < ENCRYPT_CNT)315 #define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT) 305 316 #define ENCRYPT_NAME(x) encrypt_names[x] 306 317 307 #define ENCTYPE_NAME_OK(x) (( x) >= 0 &&(x) < ENCTYPE_CNT)318 #define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT) 308 319 #define ENCTYPE_NAME(x) enctype_names[x] 309 320 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/net/if.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modifed for emx by hv 1994,1996 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1982, 1986, 1989 Regents of the University of California. … … 43 44 #endif 44 45 46 /* XXX fast fix for SNMP, going away soon */ 47 #include <sys/time.h> 48 49 50 #ifdef TCPV40HDRS 45 51 /* 46 52 * Structures defining a network interface, providing a packet … … 67 73 * interfaces. These routines live in the files if.c and route.c 68 74 */ 69 /* XXX fast fix for SNMP, going away soon */70 #include <sys/time.h>71 72 #ifdef TCPIPV473 #pragma pack(1)74 #else75 #pragma pack(4)76 #endif77 78 75 79 76 /* … … 82 79 * (Would like to call this struct ``if'', but C isn't PL/1.) 83 80 */ 84 /*forward*/ struct mbuf; 85 /*forward*/ struct ifaddr; 81 #pragma pack(1) 82 struct mbuf; 83 struct ifaddr; 86 84 struct ifnet { 87 85 char *if_name; /* name, e.g. ``en'' or ``lo'' */ … … 95 93 struct mbuf *ifq_head; 96 94 struct mbuf *ifq_tail; 97 #ifndef TCPIPV498 int ifq_len;99 int ifq_maxlen;100 int ifq_drops;101 #else102 95 short ifq_len; 103 96 short ifq_maxlen; 104 97 u_short ifq_drops; 105 #endif106 98 } if_snd; /* output queue */ 107 99 /* procedure handles */ … … 112 104 int (*if_watchdog)(void); /* timer routine */ 113 105 /* generic interface statistics */ 114 #ifndef TCPIPV4115 int if_ipackets; /* packets received on interface */116 int if_ierrors; /* input errors on interface */117 int if_opackets; /* packets sent on interface */118 int if_oerrors; /* output errors on interface */119 int if_collisions; /* collisions on csma interfaces */120 #else121 106 u_short if_ipackets; /* packets received on interface */ 122 107 u_short if_ierrors; /* input errors on interface */ … … 124 109 u_short if_oerrors; /* output errors on interface */ 125 110 u_short if_collisions; /* collisions on csma interfaces */ 126 #endif127 111 /* end statistics */ 128 112 struct ifnet *if_next; 129 113 114 #ifdef __OS2__ 130 115 /* the following structures are special for OS/2 TCP/IP only */ 131 116 u_char if_adapternum; /* adapter number */ … … 134 119 u_long if_speed; 135 120 136 #define IF_RTTSCALE 1000 137 u_short if_rtt; /* Est interface rtt in ms */ 138 u_short if_rttvar; /* Est interface rttvar in ms */ 139 u_short if_rttmin; /* Fixed interface rttmin in ms */ 140 u_short if_sendpipe; /* Send socket buffer/window size */ 141 u_short if_recvpipe; /* Recv socket buffer/window size */ 142 u_short if_ssthresh; /* Gateway buffer limit (slow strt) */ 143 #ifdef TCPIPV4 144 u_long if_eflags; /* Extended flags */ 145 struct ifqueue if_traceq; /* packet trace queue */ 146 u_short if_segsize; /* segment size for interface */ 147 u_short if_use576; /* use 576 or 1460 as def. mss if */ 148 /* going through a router */ 149 u_short if_rfc1469; /* using broadcast or functional */ 150 /* addr for IP Multicast */ 151 #define IFF_RFC1469_BC 1 /* use broadcast */ 152 #define IFF_RFC1469_FA 2 /* use functional address */ 153 #define IFF_RFC1469_MA 3 /* use multicast address */ 154 #endif 155 }; 156 157 #ifndef TCPIPV4 158 struct ifmib { 159 int ifNumber; /* number of network interfaces */ 160 struct iftable { 161 int ifIndex; /* index of this interface */ 162 char ifDescr[45]; /* description */ 163 int ifType; /* type of the interface */ 164 int ifMtu; /* MTU of the interface */ 165 char ifPhysAddr[6]; /* MTU of the interface */ 166 int ifOperStatus; 167 u_long ifSpeed; 168 u_long ifLastChange; 169 u_long ifInOctets; 170 u_long ifOutOctets; 171 u_long ifOutDiscards; 172 u_long ifInDiscards; 173 u_long ifInErrors; 174 u_long ifOutErrors; 175 u_long ifInUnknownProtos; 176 u_long ifInUcastPkts; 177 u_long ifOutUcastPkts; 178 u_long ifInNUcastPkts; 179 u_long ifOutNUcastPkts; 180 } iftable[20]; 181 }; 182 #else /* TCP/IP V4 */ 121 /* Interface TCP estimates/controls. Serves the same */ 122 /* purpose as the per-route values in BSD-Reno, but I didn't */ 123 /* have to touch any of the route manipulation code. */ 124 u_short if_rtt; /* Est interface rtt in ms */ 125 u_short if_rttvar; /* Est interface rttvar in ms */ 126 u_short if_rttmin; /* Fixed interface rttmin in ms */ 127 u_short if_sendpipe; /* Send socket buffer/window size */ 128 u_short if_recvpipe; /* Recv socket buffer/window size */ 129 u_short if_ssthresh; /* Gateway buffer limit (slow strt) */ 130 u_long if_eflags; /* Extended Flags */ 131 struct ifqueue if_traceq; /* packet trace queue */ 132 u_short if_segsize; /* segment size for interface*/ 133 u_short if_use576; /* use 576 or 1460 as def. mss if going thru a router */ 134 /* Token Ring IP multicast flag */ 135 u_short if_rfc1469; /* using broadcast or functional address */ 136 /* for IP Mulitcast */ 137 #define IF_RTTSCALE 1000 138 #endif /* __OS2__ */ 139 }; 140 #pragma pack() 141 #endif /*TCPV40HDRS*/ 183 142 184 143 #ifndef IFMIB_ENTRIES … … 186 145 #endif 187 146 147 #ifdef TCPV40HDRS 148 #pragma pack(1) 188 149 struct ifmib { 189 150 short ifNumber; /* number of network interfaces */ … … 210 171 } iftable[IFMIB_ENTRIES]; 211 172 }; 212 #endif /* TCP/IP V4 */ 213 #pragma pack() 173 #pragma pack() 174 175 #else /*TCPV40HDRS*/ 176 177 #pragma pack(1) /* force on doubleword boundary */ 178 struct iftable { 179 short iftIndex; /* index of this interface */ 180 char iftDescr[45]; /* description */ 181 short iftType; /* type of the interface */ 182 short iftMtu; /* MTU of the interface */ 183 char iftPhysAddr[6]; /* MTU of the interface */ 184 short iftOperStatus; 185 u_long iftSpeed; 186 u_long iftLastChange; 187 u_long iftInOctets; 188 u_long iftOutOctets; 189 u_long iftOutDiscards; 190 u_long iftInDiscards; 191 u_long iftInErrors; 192 u_long iftOutErrors; 193 u_long iftInUnknownProtos; 194 u_long iftInUcastPkts; 195 u_long iftOutUcastPkts; 196 u_long iftInNUcastPkts; 197 u_long iftOutNUcastPkts; 198 }; 199 struct ifmib { 200 short ifNumber; 201 struct iftable iftable[IFMIB_ENTRIES]; 202 }; 203 #pragma pack() /* reset to default packing */ 204 205 #define IFC_ALLRTSBCAST 0x0001 206 #define IFC_802_3 0x0002 207 #define IFC_FDDI 0x0004 208 #define IFC_NOREDIR 0x0010 209 210 #define OPERSTATUS_UP 0x1 211 #define OPERSTATUS_DOWN 0x2 212 #define OPERSTATUS_TESTING 0x3 213 #endif /*TCPV40HDRS*/ 214 214 215 215 #define IFF_UP 0x1 /* interface is up */ … … 219 219 #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ 220 220 #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ 221 #ifndef TCPV40HDRS 222 #define IFF_LINK2 IFF_NOTRAILERS /* was trailers, not used */ 223 #endif 221 224 #define IFF_RUNNING 0x40 /* resources allocated */ 222 225 #define IFF_NOARP 0x80 /* no address resolution protocol */ 223 /* next two not supported now, but reserved: */224 226 #define IFF_PROMISC 0x100 /* receive all packets */ 225 227 #define IFF_ALLMULTI 0x200 /* receive all multicast packets */ 226 #define IFF_OACTIVE 0x400 /* transmission in progress */ 227 #define IFF_SIMPLEX 0x800 /* can't hear own transmissions */ 228 #define IFF_DEFMTU 0x400 /* default mtu of 1500 */ 229 #define IFF_MULTICAST 0x800 /* supports multicast */ 230 /* 231 * The IFF_MULTICAST flag indicates that the network can support the 232 * transmission and reception of higher-level (e.g., IP) multicast packets. 233 * It is independent of hardware support for multicasting; for example, 234 * point-to-point links or pure broadcast networks may well support 235 * higher-level multicasts. 236 */ 228 237 #define IFF_BRIDGE 0x1000 /* support token ring routine field */ 229 #define IFF_SNAP 0x2000 /* support extended S NAP header */238 #define IFF_SNAP 0x2000 /* support extended SAP header */ 230 239 #define IFF_ETHER 0x4000 /* ethernet interface */ 231 240 #define IFF_LOOPBRD 0x8000 /* ethernet interface */ 241 #ifndef TCPV40HDRS 242 #define IFF_SIMPLEX 0x10000 /* can't hear own transmissions */ 243 #define IFF_OACTIVE 0x20000 /* transmission in progress */ 244 #define IFF_802_3 0x40000 /* */ 245 #define IFF_CANONICAL 0x80000 /* */ 246 #define IFF_RUNNINGBLK 0x100000 /* threads waited for intf running */ 247 #endif 248 249 #define IFF_RFC1469_BC 1 /* using broadcast */ 250 #define IFF_RFC1469_FA 2 /* using functional address */ 251 #define IFF_RFC1469_MA 3 /* using mulitcast address */ 232 252 233 253 /*hv: flags set internally only */ 234 #ifdef BSD_TCPCOMPAT 254 #ifdef TCPV40HDRS 255 #define IFF_CANTCHANGE (IFF_BROADCAST | IFF_POINTOPOINT | IFF_RUNNING) 256 #else 235 257 #define IFF_CANTCHANGE \ 236 258 (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE| \ 237 IFF_SIMPLEX|IFF_MULTICAST) 238 #else 239 #define IFF_CANTCHANGE (IFF_BROADCAST | IFF_POINTOPOINT | IFF_RUNNING) 240 #endif 241 242 #ifdef TCPIPV4 259 IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI) 260 #endif 261 243 262 /* packet tracing extension */ 244 263 #define IFFE_PKTTRACE 0x00000001 /* trace datalink where possible */ 245 264 #define IFFE_IPTRACE 0x00000002 /* trace ONLY IP packets */ 246 265 266 #ifndef TCPV40HDRS 267 #pragma pack(1) 268 #endif 247 269 struct pkt_trace_hdr { 248 270 u_short pt_htype; /* header type */ 249 #define HT_IP 0x01 /* IP */250 #define HT_ETHER 0x06 /* Ethernet */251 #define HT_ISO88023 0x07 /* CSMA CD */252 #define HT_ISO88025 0x09 /* Token Ring */253 #define HT_SLIP 0x1c /* Serial Line IP */254 #define HT_PPP 0x18 /* PPP IP */255 271 u_short pt_len; /* in: pt_buf len, out: packet len */ 256 272 caddr_t pt_data; /* packet ATTN: This is a _Seg16 addr! */ 257 273 u_long pt_tstamp; /* time stamp in milliseconds */ 258 274 }; 259 260 #endif /* TCP/IP V4 */ 261 275 #ifndef TCPV40HDRS 276 #pragma pack() 277 #endif 278 #define HT_IP 0x01 /* IP */ 279 #define HT_ETHER 0x06 /* Ethernet */ 280 #define HT_ISO88023 0x07 /* CSMA CD */ 281 #define HT_ISO88025 0x09 /* Token Ring */ 282 #define HT_SLIP 0x1c /* Serial Line IP */ 283 #define HT_PPP 0x18 /* PPP IP */ 284 285 #ifndef TCPV40HDRS 286 /* genric interface information */ 287 #pragma pack(1) 288 struct if_data { 289 u_char ifi_type; /* ethernet, tokenring, etc */ 290 u_char ifi_addrlen; /* media address length */ 291 u_char ifi_hdrlen; /* media header length */ 292 u_long ifi_mtu; /* maximum transmission unit */ 293 u_long ifi_metric; /* routing metric (external only) */ 294 u_long ifi_baudrate; /* linespeed */ 295 /* volatile statistics */ 296 u_long ifi_collisions; /* collisions on csma interfaces */ 297 u_long ifi_ibytes; /* total number of octets received */ 298 u_long ifi_obytes; /* total number of octets sent */ 299 u_long ifi_oqdrops; /* dropped on output, this interface */ 300 u_long ifi_iqdrops; /* dropped on input, this interface */ 301 u_long ifi_ierrors; /* input errors on interface */ 302 u_long ifi_oerrors; /* output errors on interface */ 303 u_long ifi_noproto; /* destined for unsupported protocol */ 304 u_long ifi_ipackets; /* packets received on interface */ 305 u_long ifi_opackets; /* packets sent on interface */ 306 u_long ifi_imcasts; /* packets received via multicast */ 307 u_long ifi_omcasts; /* packets sent via multicast */ 308 short ifi_OperStatus; /* SNMP Oper Status */ 309 struct timeval ifi_lastchange;/* last updated */ 310 u_char ifi_descr[45]; /* description of the interface */ 311 }; 312 #pragma pack() 313 314 /* 315 * Message format for use in obtaining information about interfaces 316 * from getkerninfo and the routing socket 317 */ 318 #pragma pack(1) 319 struct if_msghdr { 320 u_short ifm_msglen; /* to skip over non-understood messages */ 321 u_char ifm_version; /* future binary compatability */ 322 u_char ifm_type; /* message type */ 323 int ifm_addrs; /* like rtm_addrs */ 324 int ifm_flags; /* value of if_flags */ 325 u_short ifm_index; /* index for associated ifp */ 326 struct if_data ifm_data;/* statistics and other data about if */ 327 }; 328 #pragma pack() 329 330 /* 331 * Message format for use in obtaining information about interface addresses 332 * from getkerninfo and the routing socket 333 */ 334 #pragma pack(1) 335 struct ifa_msghdr { 336 u_short ifam_msglen; /* to skip over non-understood messages */ 337 u_char ifam_version; /* future binary compatability */ 338 u_char ifam_type; /* message type */ 339 int ifam_addrs; /* like rtm_addrs */ 340 int ifam_flags; /* value of ifa_flags */ 341 u_short ifam_index; /* index for associated ifp */ 342 int ifam_metric; /* value of ifa_metric */ 343 }; 344 #pragma pack() 345 #endif /*!TCPV40HDRS*/ 346 347 #ifdef TCPV40HDRS 262 348 /* 263 349 * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1) … … 284 370 (ifq)->ifq_len++;\ 285 371 } 286 #define IF_DEQUEUE(ifq, m) {\ 287 (m)=(ifq)->ifq_head;\ 288 if (m) {\ 289 if (((ifq)->ifq_head=(m)->m_act)==0)\ 290 (ifq)->ifq_tail=0;\ 291 (m)->m_act=0;\ 292 (ifq)->ifq_len--;\ 293 }\ 294 } 372 /* 373 * Packets destined for level-1 protocol input routines 374 * have a pointer to the receiving interface prepended to the data. 375 * IF_DEQUEUEIF extracts and returns this pointer when dequeueing the packet. 376 * IF_ADJ should be used otherwise to adjust for its presence. 377 */ 295 378 #define IF_ADJ(m) {\ 296 379 (m)->m_off+=sizeof(struct ifnet*);\ … … 313 396 }\ 314 397 } 398 #define IF_DEQUEUE(ifq, m) {\ 399 (m)=(ifq)->ifq_head;\ 400 if (m) {\ 401 if (((ifq)->ifq_head=(m)->m_act)==0)\ 402 (ifq)->ifq_tail=0;\ 403 (m)->m_act=0;\ 404 (ifq)->ifq_len--;\ 405 }\ 406 } 315 407 316 408 #define IFQ_MAXLEN 50 … … 334 426 struct ifaddr *ifa_next; /* next address for interface */ 335 427 }; 428 #endif /*TCPV40HDRS*/ 336 429 337 430 /* … … 341 434 * remainder may be interface specific. 342 435 */ 436 #ifndef TCPV40HDRS 437 #pragma pack(1) 438 #endif 343 439 struct ifreq { 344 440 #define IFNAMSIZ 16 … … 358 454 #define ifr_metric ifr_ifru.ifru_metric /* metric */ 359 455 #define ifr_data ifr_ifru.ifru_data /* for use by interface */ 360 }; 456 #ifndef TCPV40HDRS 457 #define ifr_eflags ifr_ifru.ifru_data /* Extended flags */ 458 #endif 459 }; 460 #ifndef TCPV40HDRS 461 #pragma pack() 462 #endif 463 464 #ifndef TCPV40HDRS 465 #pragma pack(1) 466 struct ifaliasreq { 467 char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ 468 struct sockaddr ifra_addr; 469 struct sockaddr ifra_broadaddr; 470 struct sockaddr ifra_mask; 471 }; 472 #pragma pack() 473 #endif 361 474 362 475 /* … … 366 479 * must know all networks accessible). 367 480 */ 481 #ifndef TCPV40HDRS 482 #pragma pack(1) /* paranoia I believe */ 483 #endif 368 484 struct ifconf { 369 485 int ifc_len; /* size of associated buffer */ … … 375 491 #define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */ 376 492 }; 493 #ifndef TCPV40HDRS 494 #pragma pack() 495 #endif 377 496 378 497 #include <net/if_arp.h> … … 382 501 #endif 383 502 503 #ifndef TCPV40HDRS 504 #include <netinet/in.h> 505 506 #pragma pack(1) 507 struct in_aliasreq { 508 char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ 509 struct sockaddr_in ifra_addr; 510 struct sockaddr_in ifra_broadaddr; 511 #define ifra_dstaddr ifra_broadaddr 512 struct sockaddr_in ifra_mask; 513 }; 514 #pragma pack() 515 516 #pragma pack(1) 517 struct addrreq { /* get multicast addresses */ 518 char ifr_name[IFNAMSIZ]; 519 struct sockaddr ifr_addrs; 520 u_long maddr[MAX_IN_MULTI]; 521 }; 522 #pragma pack() 523 524 #pragma pack(1) 525 struct statatreq { 526 u_long addr; 527 short interface; 528 u_long mask; 529 u_long broadcast; 530 }; 531 #pragma pack() 532 533 /* PPP statistics table. Moved here from previous ifstat.h */ 534 struct ifstat { 535 u_long iftLastChange; 536 u_long iftInOctets; 537 u_long iftOutOctets; 538 u_long iftOutDiscards; 539 u_long iftInDiscards; 540 u_long iftInErrors; 541 u_long iftOutErrors; 542 u_long iftInUnknownProtos; 543 u_long iftInUcastPkts; 544 u_long iftOutUcastPkts; 545 u_long iftInNUcastPkts; 546 u_long iftOutNUcastPkts; 547 }; 548 #endif /*!TCPV40HDRS*/ 549 384 550 #endif /* _NET_IF_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/net/if_arp.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1994,1996 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1986 Regents of the University of California. … … 49 50 * specified. Field names used correspond to RFC 826. 50 51 */ 52 #ifndef TCPV40HDR 53 #pragma pack(1) 54 #endif 51 55 struct arphdr { 52 56 u_short ar_hrd; /* format of hardware address */ 53 57 #define ARPHRD_ETHER 1 /* ethernet hardware address */ 54 58 #define ARPHRD_802 6 /* 802 net hardware address */ 59 #ifndef TCPV40HDRS 60 #define ARPHRD_FRELAY 15 /* frame relay hardware format */ 61 #endif 55 62 u_short ar_pro; /* format of protocol address */ 56 63 u_char ar_hln; /* length of hardware address */ … … 59 66 #define ARPOP_REQUEST 1 /* request to resolve address */ 60 67 #define ARPOP_REPLY 2 /* response to previous request */ 68 #ifndef TCPV40HDRS 69 #define ARPOP_REVREQUEST 3 /* request protocol address given hardware */ 70 #define ARPOP_REVREPLY 4 /* response giving protocol address */ 71 #define ARPOP_INVREQUEST 8 /* request to identify peer */ 72 #define ARPOP_INVREPLY 9 /* response identifying peer */ 73 #endif 74 #if 0 /* not OS/2 */ 61 75 #define REVARP_REQUEST 3 /* reverse ARP request (not IBM) */ 62 76 #define REVARP_REPLY 4 /* reverse ARP reply (not IBM) */ 77 #endif 63 78 /* 64 79 * The remaining fields are variable in size, … … 70 85 /* u_char ar_tpa[]; * target protocol address */ 71 86 }; 87 #ifndef TCPV40HDRS 88 #pragma pack() 89 #endif 72 90 73 91 /* 74 92 * ARP ioctl request 75 93 */ 94 #ifndef TCPV40HDRS 95 #pragma pack(4) 96 #endif 76 97 struct arpreq { 77 98 struct sockaddr arp_pa; /* protocol address */ … … 79 100 int arp_flags; /* flags */ 80 101 }; 102 #ifndef TCPV40HDRS 103 #pragma pack() 104 #endif 105 106 #ifndef TCPV40HDRS 107 /* 108 * Token ring ARP ioctl request 109 */ 110 #pragma pack(4) 111 struct arpreq_tr { 112 struct sockaddr arp_pa; /* protocol address */ 113 struct sockaddr arp_ha; /* hardware address */ 114 long arp_flags; /* flags */ 115 u_short arp_rcf; /* token ring routing control field */ 116 u_short arp_rseg[8]; /* token ring routing segments */ 117 }; 118 #endif /*!TCPV40HDRS*/ 119 120 81 121 /* arp_flags and at_flags field values */ 82 122 #define ATF_INUSE 0x01 /* entry in use */ … … 85 125 #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ 86 126 #define ATF_USETRAILERS 0x10 /* has requested trailers */ 127 #ifndef TCPV40HDRS 128 #define ATF_802_3 0x20 /* sender's ether if set to 802.3 */ 129 #endif 87 130 88 131 #endif /* !_NET_IF_ARP_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/net/route.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 * 2 * Modified for gcc/os2 by bird 2003 3 * 3 4 * Copyright (c) 1980, 1986 Regents of the University of California. 4 5 * All rights reserved. … … 47 48 /* 48 49 * Kernel resident routing tables. 49 * 50 * 50 51 * The routing tables are initialized when interface addresses 51 52 * are set by making entries for all directly connected interfaces. … … 62 63 }; 63 64 65 66 #ifndef TCPV40HDRS 67 /* 68 * These numbers are used by reliable protocols for determining 69 * retransmission behavior and are included in the routing structure. 70 */ 71 struct rt_metrics { 72 u_long rmx_locks; /* Kernel must leave these values alone */ 73 u_long rmx_mtu; /* MTU for this path */ 74 u_long rmx_hopcount; /* max hops expected */ 75 u_long rmx_expire; /* lifetime for route, e.g. redirect */ 76 u_long rmx_recvpipe; /* inbound delay-bandwith product */ 77 u_long rmx_sendpipe; /* outbound delay-bandwith product */ 78 u_long rmx_ssthresh; /* outbound gateway buffer limit */ 79 u_long rmx_rtt; /* estimated round trip time */ 80 u_long rmx_rttvar; /* estimated rtt variance */ 81 u_long rmx_pksent; /* packets sent using this route */ 82 u_long rmx_filler[4]; /* will be used for T/TCP later */ 83 }; 84 64 85 /* 65 86 * rmx_rtt and rmx_rttvar are stored as microseconds; … … 69 90 #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ 70 91 #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) 92 #endif /* !TCPV40HDRS */ 93 71 94 72 95 /* … … 80 103 * Following structure necessary for 4.3 compatibility; 81 104 */ 82 struct rtentry { 105 #pragma pack(1) 106 #ifdef TCPV40HDRS 107 struct rtentry 108 #else 109 struct ortentry 110 #endif 111 { 83 112 u_long rt_hash; /* to speed lookups */ 84 113 struct sockaddr rt_dst; /* key */ … … 90 119 long metric1,metric2,metric3,metric4; /*IBM special */ 91 120 }; 92 93 #define RTF_UP 0x1 /* route useable */ 121 #pragma pack() 122 123 /* IBM: hv: I think this is the internal structure of the RT table of the 124 * router daemon. Don't think it belongs here, but the toolkit has it as well 125 */ 126 #define RTENTRY_COUNT 512 127 #pragma pack(1) 128 struct rtentries { 129 short hostcount; 130 short netcount; 131 #ifdef TCPV40HDRS 132 struct rtentry rttable[RTENTRY_COUNT]; 133 #else 134 struct ortentry rttable[RTENTRY_COUNT]; 135 #endif 136 }; 137 #pragma pack() 138 139 140 #define RTF_UP 0x1 /* route usable */ 94 141 #define RTF_GATEWAY 0x2 /* destination is a gateway */ 95 142 #define RTF_HOST 0x4 /* host entry (net otherwise) */ … … 104 151 #define RTF_STATIC 0x800 /* route manually added */ 105 152 #define RTF_BLACKHOLE 0x1000 /* discard packets during updates */ 153 #ifndef TCPV40HDRS 154 #define RTF_LLTEMP 0x2000 /* manually added temporary arp entry */ 155 #endif 106 156 #define RTF_PROTO2 0x4000 /* protocol specific routing flag */ 107 157 #define RTF_PROTO1 0x8000 /* protocol specific routing flag */ 158 #ifndef TCPV40HDRS 159 #define RTF_PRCLONING 0x10000 /* protocol requires cloning */ 160 #define RTF_WASCLONED 0x20000 /* route generated through cloning */ 161 #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ 162 #define RTF_CHAINDELETE 0x80000 /* chain is being deleted (internal) */ 163 #define RTF_PINNED 0x100000 /* future use */ 164 #define RTF_TUNNEL 0x200000 /* tunnelling bit */ 165 #define RTF_CRYPT 0x400000 /* encrypting tunnel */ 166 #define RTF_AUTH 0x800000 /* authenticating tunnel */ 167 #endif 108 168 109 169 … … 118 178 short rts_wildcard; /* lookups satisfied by a wildcard */ 119 179 }; 180 #ifndef TCPV40HDRS 120 181 /* 121 182 * Structures for routing messages. 122 183 */ 123 # ifndef __EMX__184 #pragma pack(1) 124 185 struct rt_msghdr { 125 u_short rtm_msglen; /* to skip over non-understood messages */ 126 u_char rtm_version; /* future binary compatability */ 127 u_char rtm_type; /* message type */ 128 u_short rtm_index; /* index for associated ifp */ 129 pid_t rtm_pid; /* identify sender */ 130 int rtm_addrs; /* bitmask identifying sockaddrs in msg */ 131 int rtm_seq; /* for sender to identify action */ 132 int rtm_errno; /* why failed */ 133 int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ 134 int rtm_use; /* from rtentry */ 135 u_long rtm_inits; /* which metrics we are initializing */ 136 struct rt_metrics rtm_rmx; /* metrics themselves */ 186 #define IFNAMSIZ 16 187 u_short rtm_msglen; /* to skip over non-understood messages */ 188 u_char rtm_version; /* future binary compatibility */ 189 u_char rtm_type; /* message type */ 190 u_short rtm_index; /* index for associated ifp */ 191 short rtm_unit; /* new field for subnet routing */ 192 int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ 193 int rtm_addrs; /* bitmask identifying sockaddrs in msg */ 194 pid_t rtm_pid; /* identify sender */ 195 int rtm_seq; /* for sender to identify action */ 196 int rtm_errno; /* why failed */ 197 int rtm_use; /* from rtentry */ 198 u_long rtm_inits; /* which metrics we are initializing */ 199 u_long rtm_netmask; /* new field for subnet routing */ 200 char rtm_name[IFNAMSIZ]; /* new field for subnet routing */ 201 struct rt_metrics rtm_rmx; /* metrics themselves */ 202 }; 203 #pragma pack() 204 205 #define RTM_VERSION 4 /* Up the ante and ignore older versions */ 206 207 #define RTM_ADD 0x1 /* Add Route */ 208 #define RTM_DELETE 0x2 /* Delete Route */ 209 #define RTM_CHANGE 0x3 /* Change Metrics or flags */ 210 #define RTM_GET 0x4 /* Report Metrics */ 211 #define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */ 212 #define RTM_REDIRECT 0x6 /* Told to use different route */ 213 #define RTM_MISS 0x7 /* Lookup failed on this address */ 214 #define RTM_LOCK 0x8 /* fix specified metrics */ 215 #define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ 216 #define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ 217 #define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ 218 #define RTM_NEWADDR 0xc /* address being added to iface */ 219 #define RTM_DELADDR 0xd /* address being removed from iface */ 220 #define RTM_IFINFO 0xe /* iface going up/down etc. */ 221 222 #define RTV_MTU 0x1 /* init or lock _mtu */ 223 #define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ 224 #define RTV_EXPIRE 0x4 /* init or lock _hopcount */ 225 #define RTV_RPIPE 0x8 /* init or lock _recvpipe */ 226 #define RTV_SPIPE 0x10 /* init or lock _sendpipe */ 227 #define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ 228 #define RTV_RTT 0x40 /* init or lock _rtt */ 229 #define RTV_RTTVAR 0x80 /* init or lock _rttvar */ 230 231 /* 232 * Bitmask values for rtm_addr. 233 */ 234 #define RTA_DST 0x1 /* destination sockaddr present */ 235 #define RTA_GATEWAY 0x2 /* gateway sockaddr present */ 236 #define RTA_NETMASK 0x4 /* netmask sockaddr present */ 237 #define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ 238 #define RTA_IFP 0x10 /* interface name sockaddr present */ 239 #define RTA_IFA 0x20 /* interface addr sockaddr present */ 240 #define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ 241 #define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ 242 243 /* 244 * Index offsets for sockaddr array for alternate internal encoding. 245 */ 246 #define RTAX_DST 0 /* destination sockaddr present */ 247 #define RTAX_GATEWAY 1 /* gateway sockaddr present */ 248 #define RTAX_NETMASK 2 /* netmask sockaddr present */ 249 #define RTAX_GENMASK 3 /* cloning mask sockaddr present */ 250 #define RTAX_IFP 4 /* interface name sockaddr present */ 251 #define RTAX_IFA 5 /* interface addr sockaddr present */ 252 #define RTAX_AUTHOR 6 /* sockaddr for author of redirect */ 253 #define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ 254 #define RTAX_MAX 8 /* size of array to allocate */ 255 256 struct rt_addrinfo { 257 int rti_addrs; 258 struct sockaddr *rti_info[RTAX_MAX]; 137 259 }; 138 260 139 261 struct route_cb { 140 int ip_count; 141 int ns_count; 142 int iso_count; 143 int any_count; 144 }; 145 #define RTM_VERSION 2 /* Up the ante and ignore older versions */ 146 147 #define RTM_ADD 0x1 /* Add Route */ 148 #define RTM_DELETE 0x2 /* Delete Route */ 149 #define RTM_CHANGE 0x3 /* Change Metrics or flags */ 150 #define RTM_GET 0x4 /* Report Metrics */ 151 #define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */ 152 #define RTM_REDIRECT 0x6 /* Told to use different route */ 153 #define RTM_MISS 0x7 /* Lookup failed on this address */ 154 #define RTM_LOCK 0x8 /* fix specified metrics */ 155 #define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ 156 #define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ 157 #define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ 158 159 #define RTV_MTU 0x1 /* init or lock _mtu */ 160 #define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ 161 #define RTV_EXPIRE 0x4 /* init or lock _hopcount */ 162 #define RTV_RPIPE 0x8 /* init or lock _recvpipe */ 163 #define RTV_SPIPE 0x10 /* init or lock _sendpipe */ 164 #define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ 165 #define RTV_RTT 0x40 /* init or lock _rtt */ 166 #define RTV_RTTVAR 0x80 /* init or lock _rttvar */ 167 168 #define RTA_DST 0x1 /* destination sockaddr present */ 169 #define RTA_GATEWAY 0x2 /* gateway sockaddr present */ 170 #define RTA_NETMASK 0x4 /* netmask sockaddr present */ 171 #define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ 172 #define RTA_IFP 0x10 /* interface name sockaddr present */ 173 #define RTA_IFA 0x20 /* interface addr sockaddr present */ 174 #define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ 175 #endif 176 177 /* IBM: hv: I think this is the internal structure of the RT table of the 178 * router daemon. Don't think it belongs here, but the toolkit has it as well 179 */ 180 #define RTENTRY_COUNT 512 181 struct rtentries { 182 short hostcount; 183 short netcount; 184 struct rtentry rttable[RTENTRY_COUNT]; 185 }; 262 int ip_count; 263 int ns_count; 264 int iso_count; 265 int any_count; 266 }; 267 #endif /* !TCPV40HDRS */ 186 268 187 269 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netdb.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /*- Modified for emx by hv and em 1994-1997 2 *- Modified for gcc by bird 2003 2 3 * 3 4 * Copyright (c) 1980, 1983, 1988 Regents of the University of California. … … 33 34 * 34 35 * from: @(#)netdb.h 5.15 (Berkeley) 4/3/91 35 * netdb.h,v 1. 1 2003/04/16 15:53:07bird Exp36 * netdb.h,v 1.2 2003/05/19 02:41:00 bird Exp 36 37 */ 37 38 38 39 #ifndef _NETDB_H_ 39 40 #define _NETDB_H_ 41 #ifdef TCPV40HDRS 42 #define __NETDB_32H 43 #endif 40 44 41 45 #if defined (__cplusplus) 42 46 extern "C" { 43 47 #endif 48 49 /* toolkit compatibility - start */ 50 #include <sys/param.h> 51 #include <sys/cdefs.h> 52 /* toolkit compatibility - end */ 44 53 45 54 #ifndef _EMX_TCPIP … … 54 63 #endif 55 64 56 extern int h_errno; 57 58 #define _PATH_HEQUIV "/tcpip/etc/hosts.equiv" 59 #define _PATH_HOSTS "/tcpip/etc/hosts" 60 #define _PATH_NETWORKS "/tcpip/etc/networks" 61 #define _PATH_PROTOCOLS "/tcpip/etc/protocols" 62 #define _PATH_SERVICES "/tcpip/etc/services" 65 66 #define _PATH_HEQUIV "/mptn/etc/hosts.equiv" 67 #define _PATH_HOSTS "/mptn/etc/hosts" 68 #define _PATH_NETWORKS "/mptn/etc/networks" 69 #define _PATH_PROTOCOLS "/mptn/etc/protocols" 70 #define _PATH_SERVICES "/mptn/etc/services" 71 72 #ifdef TCPV40HDRS 73 #define h_errno (tcp_h_errno()) /* __MT__ safe */ 74 #else 75 #define h_errno (*tcp_h_errno1()) /* __MT__ safe */ 76 #endif 63 77 64 78 /* … … 104 118 * (left in extern int h_errno). 105 119 */ 106 #if 0 107 #define h_errno (tcp_h_errno()) /* thread safe */ 120 #ifndef TCPV40HDRS 121 #define NETDB_INTERNAL -1 /* see errno */ 122 #define NETDB_SUCCESS 0 /* no problem */ 108 123 #endif 109 124 #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ … … 113 128 #define NO_ADDRESS NO_DATA /* no address, look for MX record */ 114 129 115 int gethostname (char *, int); 116 void endhostent (void); 117 void endnetent (void); 118 void endprotoent (void); 119 void endservent (void); 120 struct hostent *gethostbyaddr (__const__ char *, int, int); 121 struct hostent *gethostbyname (__const__ char *); 122 struct hostent *gethostent (void); 123 struct netent *getnetbyaddr (u_long, int); 124 struct netent *getnetbyname (__const__ char *); 125 struct netent *getnetent (void); 126 struct protoent *getprotobyname (__const__ char *); 127 struct protoent *getprotobynumber (int); 128 struct protoent *getprotoent (void); 129 struct servent *getservbyname (__const__ char *, __const__ char *); 130 struct servent *getservbyport (int, __const__ char *); 131 struct servent *getservent (void); 132 void herror (__const__ char *); 133 void sethostent (int); 134 void setnetent (int); 135 void setprotoent (int); 136 void setservent (int); 137 138 #ifdef NETDB_IBM_ADDENDUM 130 131 #ifdef TCPV40HDRS 132 #include <stdio.h> 133 #include <string.h> 134 #include <netinet\in.h> 139 135 140 136 /* IBM addendum structures and functions */ … … 144 140 #define _MAXLINELEN 1024 145 141 146 /* this is the internally used data structure to which pointers of 142 /* this is the internally used data structure to which pointers of 147 143 * struct hostent ponit to, after gethostbyname_r/gethostbyaddr_r were 148 144 * called. ATTENTION EMX: The component _opaque_ is a pointer to a data … … 159 155 int stayopen; /* AIX addon */ 160 156 u_long host_addresses[_MAXADDRS]; /* Actual Addresses. */ 161 }; 157 }; 162 158 163 159 struct servent_data { … … 167 163 int _serv_stayopen; 168 164 }; 169 170 int gethostbyname_r(char*, struct hostent*, struct hostent_data*); 171 int gethostbyaddr_r(char*, int, int, struct hostent*, struct hostent_data*); 172 int getservbyname_r(char*, char*, struct servent*, struct servent_data*); 173 struct hostent *_gethtbyname(char*); 174 struct hostent *_gethtbyaddr(char*, int, int); 175 int tcp_h_errno(void); /* thread safe h_errno */ 176 177 #endif /* NETDB_IBM_ADDENDUM */ 165 #endif 166 167 168 /* BSD */ 169 int _System gethostname( char *, int ); 170 struct hostent * _System gethostbyname( __const__ char * ); 171 struct hostent * _System gethostbyaddr( __const__ char *, int, int ); 172 struct netent * _System getnetbyname( __const__ char * ); 173 struct netent * _System getnetbyaddr( unsigned long, int ); 174 struct servent * _System getservbyname( __const__ char *, char * ); 175 struct servent * _System getservbyport( int, __const__ char * ); 176 struct servent * _System getservent( void ); 177 struct protoent * _System getprotobyname( __const__ char * ); 178 struct protoent * _System getprotobynumber( int ); 179 void _System sethostent( int ); 180 struct hostent * _System gethostent( void ); 181 void _System endhostent(void); 182 void _System setnetent( int ); 183 struct netent * _System getnetent( void ); 184 void _System endnetent(void); 185 void _System setprotoent( int ); 186 struct protoent * _System getprotoent( void ); 187 void _System endprotoent(void); 188 void _System setservent( int ); 189 struct servent * _System getservent( void ); 190 void _System endservent(void); 191 #ifndef TCPV40HDRS 192 struct hostent * _System gethostbyname2( __const__ char *, int ); 193 #endif 194 195 196 /* OS2 Additions */ 197 #ifdef TCPV40HDRS 198 int _System tcp_h_errno(void); 199 struct hostent * _System Rgethostbyname(char *); /* Socks additions */ 200 #else 201 const char * _System hstrerror(int); 202 /* void _System sethostfile(const char *); */ 203 int * _System tcp_h_errno1(void); 204 #endif 205 206 /* EMX/BSD additions. */ 207 void herror (__const__ char *); 208 209 /* EMX/BSD stuff which isn't implemeneted */ 210 #ifndef TCPV40HDRS 211 struct hostent_data; 212 struct servent_data; 213 #endif 214 int gethostbyname_r(char*, struct hostent*, struct hostent_data*); 215 int gethostbyaddr_r(char*, int, int, struct hostent*, struct hostent_data*); 216 int getservbyname_r(char*, char*, struct servent*, struct servent_data*); 217 struct hostent * _gethtbyname(char*); 218 struct hostent * _gethtbyaddr(char*, int, int); 219 178 220 179 221 #ifdef __RSXNT__ … … 187 229 188 230 #endif /* !_NETDB_H_ */ 231 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/icmp_var.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* 1 /* Modified for gcc/os2 by bird 2003 2 * 2 3 * Copyright (c) 1982, 1986, 1993 3 4 * The Regents of the University of California. All rights reserved. … … 49 50 */ 50 51 struct icmpstat { 52 #if 0 /* OS2 is slightly different */ 51 53 /* statistics related to icmp packets generated */ 52 54 u_long icps_error; /* # of calls to icmp_error */ … … 61 63 u_long icps_reflect; /* number of responses */ 62 64 u_long icps_inhist[ICMP_MAXTYPE + 1]; 65 #else /* OS2: short not longs */ 66 u_short icps_error; /* # of calls to icmp_error */ 67 u_short icps_oldshort; /* no error 'cuz old ip too short */ 68 u_short icps_oldicmp; /* no error 'cuz old was icmp */ 69 u_short icps_outhist[ICMP_MAXTYPE + 1]; 70 /* statistics related to input messages processed */ 71 u_short icps_badcode; /* icmp_code out of range */ 72 u_short icps_tooshort; /* packet < ICMP_MINLEN */ 73 u_short icps_checksum; /* bad checksum */ 74 u_short icps_badlen; /* calculated bound mismatch */ 75 u_short icps_reflect; /* number of responses */ 76 u_short icps_inhist[ICMP_MAXTYPE + 1]; 77 #endif 63 78 #if 0 /* not on OS/2 */ 64 79 u_long icps_bmcastecho; /* b/mcast echo requests dropped */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/if_ether.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1994,1996 2 * Modified for gcc by bird 2003 2 3 * 3 4 * Copyright (c) 1982, 1986 Regents of the University of California. … … 39 40 #define _NETINET_IF_ETHER_H_ 40 41 41 /* 42 * Ethernet address - 6 octets 43 * this is only used by the ethers(3) functions. 44 */ 45 struct ether_addr { 46 u_char ether_addr_octet[6]; 47 }; 42 #ifdef TCPV40HDRS 48 43 49 44 /* … … 57 52 58 53 #define ETHERTYPE_PUP 0x0200 /* PUP protocol */ 59 /* the IBM header corrects the following to 0x608 for OS/2 but I believe 60 * this is just a dirty hack 61 */ 54 #define ETHERTYPE_IP 0x0800 /* IP protocol */ 55 #ifdef OS2 /* hv thinks this is just a dirty hack, but we must include it. */ 56 #define ETHERTYPE_ARP 0x0608 /* address resolution protocol */ 57 #else 62 58 #define ETHERTYPE_ARP 0x0806 /* address resolution protocol */ 63 #define ETHERTYPE_IP 0x0800 /* IP protocol */ 64 #define ETHERTYPE_REVARP 0x8035 /* reverse addr resolution protocol */ 59 #endif 65 60 66 61 /* … … 79 74 * 80 75 * See RFC 826 for protocol description. Structure below is adapted 81 * to resolving internet addresses. Field names used correspond to 76 * to resolving internet addresses. Field names used correspond to 82 77 * RFC 826. 83 78 */ … … 113 108 * Internet to ethernet address resolution table. 114 109 */ 115 #ifdef TCPIPV4116 110 #pragma pack(1) 117 #else118 #pragma pack(4)119 #endif120 111 struct arptab { 121 112 struct in_addr at_iaddr; /* internet address */ … … 127 118 u_short at_rcf; /* token ring routing control field */ 128 119 u_short at_rseg[8]; /* token ring routing segments */ 120 #ifdef OS2 129 121 u_long at_millisec; /* TOD millsecons of last update */ 130 #ifdef TCPIPV4131 122 short at_interface; /* interface index */ 132 #else133 int at_interface; /* interface index */134 123 #endif 135 124 }; 136 125 #pragma pack() 137 126 127 128 #else /*TCPV40HDRS*/ 129 130 131 #pragma pack(1) 132 struct sockaddr_inarp { 133 u_char sin_len; 134 u_char sin_family; 135 u_short sin_port; 136 struct in_addr sin_addr; 137 struct in_addr sin_srcaddr; 138 u_short sin_tos; 139 u_short sin_other; 140 #define SIN_PROXY 1 141 }; 142 struct oarptab { 143 struct in_addr at_iaddr; /* internet address */ 144 u_char at_enaddr[6]; /* ethernet address */ 145 u_char at_timer; /* minutes since last reference */ 146 u_char at_flags; /* flags */ 147 void * at_hold; 148 u_short at_rcf; /* token ring routing control field */ 149 u_short at_rseg[8]; /* token ring routing segments */ 150 u_long at_millisec; /* TOD milliseconds of last update */ 151 u_short at_interface; /* interface index */ 152 }; 153 #pragma pack() 154 155 /* 156 * IP and ethernet specific routing flags 157 */ 158 #define RTF_USETRAILERS RTF_PROTO1 /* use trailers */ 159 #define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */ 160 161 162 #endif /*TCPV40HDRS (else) */ 163 138 164 #endif /* !_NETINET_IF_ETHER_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/igmp.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1996 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1988 Stephen Deering. … … 47 48 * IGMP packet format. 48 49 */ 50 #ifndef TCPV40HDRS 51 #pragma pack(1) 52 #endif 49 53 struct igmp { 50 54 u_char igmp_type; /* version & type of IGMP message */ … … 53 57 struct in_addr igmp_group; /* group address being reported */ 54 58 }; /* (zero for queries) */ 59 #ifndef TCPV40HDRS 60 #pragma pack() 61 #endif 55 62 56 63 #define IGMP_MINLEN 8 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/igmp_var.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* 1 /* Modified for gcc/os2 by bird 2003 2 * 2 3 * Copyright (c) 1988 Stephen Deering. 3 4 * Copyright (c) 1992, 1993 -
Property cvs2svn:cvs-rev
changed from
-
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
-
trunk/src/emx/include/netinet/ip.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1994,1996 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1982, 1986 Regents of the University of California. … … 39 40 #define _NETINET_IP_H_ 40 41 41 #ifdef __EMX__42 42 #include <machine/endian.h> 43 #endif /* __EMX__ */44 43 45 44 /* … … 56 55 * against negative integers quite easily, and fail in subtle ways. 57 56 */ 57 #pragma pack(1) 58 58 struct ip { 59 59 #if BYTE_ORDER == LITTLE_ENDIAN … … 71 71 #define IP_DF 0x4000 /* dont fragment flag */ 72 72 #define IP_MF 0x2000 /* more fragments flag */ 73 #ifndef TCPV40HDRS 74 #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ 75 #endif 73 76 u_char ip_ttl; /* time to live */ 74 77 u_char ip_p; /* protocol */ … … 76 79 struct in_addr ip_src,ip_dst; /* source and dest address */ 77 80 }; 78 81 #pragma pack() 82 83 #ifdef TCPV40HDRS 79 84 #define IP_MAXPACKET 32767 /* OS2 maximum packet size */ 85 #else 86 #define IP_MAXPACKET 65535 /* maximum packet size */ 87 #endif 80 88 81 89 /* … … 96 104 #define IPTOS_PREC_IMMEDIATE 0x40 97 105 #define IPTOS_PREC_PRIORITY 0x20 106 #ifdef TCPV40HDRS 98 107 #define IPTOS_PREC_ROUTINE 0x10 108 #else 109 #define IPTOS_PREC_ROUTINE 0x00 110 #endif 99 111 100 112 /* 101 113 * Definitions for options. 102 114 */ 115 #ifndef TCPV40HDRS 116 #define IPOPT_COPY 0x80 117 #endif 103 118 #define IPOPT_COPIED(o) ((o)&0x80) 104 119 #define IPOPT_CLASS(o) ((o)&0x60) … … 119 134 #define IPOPT_SATID 136 /* satnet id */ 120 135 #define IPOPT_SSRR 137 /* strict source route */ 136 #ifndef TCPV40HDRS 137 #define IPOPT_RALERT 148 /* router alert */ 138 #endif 121 139 122 140 /* … … 131 149 * Time stamp option structure. 132 150 */ 151 #pragma pack(1) 133 152 struct ip_timestamp { 134 153 u_char ipt_code; /* IPOPT_TS */ … … 151 170 } ipt_timestamp; 152 171 }; 172 #pragma pack() 153 173 154 174 /* flag bits for ipt_flg */ 155 175 #define IPOPT_TS_TSONLY 0 /* timestamps only */ 156 176 #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ 177 #ifdef TCPV40HDRS 178 #define IPOPT_TS_PRESPEC 2 /* specified modules only */ 179 #else 157 180 #define IPOPT_TS_PRESPEC 3 /* specified modules only */ 181 #endif 182 158 183 159 184 /* bits for security (not byte swapped) */ … … 170 195 */ 171 196 #define MAXTTL 255 /* maximum time to live (seconds) */ 197 /* This is being defined as TCP_TTL, UDP_TTL etc in tcp_time.h 198 #define IPDEFTTL 64 199 */ 172 200 #define IPFRAGTTL 60 /* time to live for frags, slowhz */ 173 201 #define IPTTLDEC 1 /* subtracted when forwarding */ … … 175 203 #define IP_MSS 576 /* default maximum segment size */ 176 204 177 /* hv: this is a new data structure in TCPIPV4; consult IBM's doc for 178 * details (provided they tell anything about it at all) 179 */ 180 #ifdef TCPIPV4 205 #ifdef TCPV40HDRS 181 206 struct ipstat { 182 207 long ips_total; … … 204 229 long ips_ipInUnknownProtos; 205 230 }; 206 #endif 231 #endif /* TCPV40HDRS */ 232 207 233 208 234 #endif /* !_NETINET_IP_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/ip_icmp.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1994 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1982, 1986 Regents of the University of California. … … 47 48 * Structure of an icmp header. 48 49 */ 50 #pragma pack(1) 49 51 struct icmp { 50 52 u_char icmp_type; /* type of message, see below */ … … 59 61 } ih_idseq; 60 62 int ih_void; 63 #ifndef TCPV40HDRS 64 65 /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ 66 struct ih_pmtu { 67 n_short ipm_void; 68 n_short ipm_nextmtu; 69 } ih_pmtu; 70 #endif 61 71 } icmp_hun; 62 72 #define icmp_pptr icmp_hun.ih_pptr … … 65 75 #define icmp_seq icmp_hun.ih_idseq.icd_seq 66 76 #define icmp_void icmp_hun.ih_void 77 #ifndef TCPV40HDRS 78 #define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void 79 #define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu 80 #endif 67 81 union { 68 82 struct id_ts { … … 85 99 #define icmp_data icmp_dun.id_data 86 100 }; 101 #pragma pack() 87 102 88 103 /* … … 112 127 #define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ 113 128 #define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ 129 #ifndef TCPV40HDRS 130 #define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */ 131 #define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */ 132 #define ICMP_UNREACH_ISOLATED 8 /* src host isolated */ 133 #define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */ 134 #define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */ 135 #define ICMP_UNREACH_TOSNET 11 /* bad tos for net */ 136 #define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */ 137 #endif 114 138 #define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ 115 139 #define ICMP_REDIRECT 5 /* shorter route, codes: */ … … 119 143 #define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ 120 144 #define ICMP_ECHO 8 /* echo service */ 145 #ifndef TCPV40HDRS 146 #define ICMP_ROUTERADVERT 9 /* router advertisement */ 147 #define ICMP_ROUTERSOLICIT 10 /* router solicitation */ 148 #endif 121 149 #define ICMP_TIMXCEED 11 /* time exceeded, code: */ 122 150 #define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */ 123 151 #define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */ 124 152 #define ICMP_PARAMPROB 12 /* ip header bad */ 153 #ifndef TCPV40HDRS 154 #define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */ 155 #endif 125 156 #define ICMP_TSTAMP 13 /* timestamp request */ 126 157 #define ICMP_TSTAMPREPLY 14 /* timestamp reply */ … … 132 163 #define ICMP_MAXTYPE 18 133 164 165 #ifdef TCPV40HDRS 134 166 #define ICMP_INFOTYPE(type) \ 135 167 ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ … … 137 169 (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ 138 170 (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) 139 140 /* hv: this is a new TCPIPV4 data structure. Consult IBM's doc on that. */ 141 #ifdef TCPIPV4 171 #else 172 #define ICMP_INFOTYPE(type) \ 173 ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ 174 (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \ 175 (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ 176 (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ 177 (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) 178 #endif 179 180 #ifdef TCPV40HDRS 181 #pragma pack(1) 142 182 struct icmpstat { 183 /* statistics related to icmp packets generated */ 143 184 short icps_error; 144 185 short icps_oldshort; 145 186 short icps_oldicmp; 146 187 short icps_outhist[ICMP_MAXTYPE + 1]; 188 /* statistics related to input messages processed */ 147 189 short icps_badcode; 148 190 short icps_tooshort; … … 177 219 u_long icps_OutAddrMaskReps; 178 220 }; 221 #pragma pack() 179 222 #endif 180 223 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/ip_mroute.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 59 59 * Multicast Routing set/getsockopt commands. 60 60 */ 61 #if 1 /* not on OS/2 - but let's include it anyway. */ 61 62 #define MRT_INIT 100 /* initialize forwarder */ 62 63 #define MRT_DONE 101 /* shut down forwarder */ 63 64 #define MRT_ADD_VIF 102 /* create virtual interface */ 64 65 #define MRT_DEL_VIF 103 /* delete virtual interface */ 65 #if 0 /* different on OS/2 */66 66 #define MRT_ADD_MFC 104 /* insert forwarding cache entry */ 67 67 #define MRT_DEL_MFC 105 /* delete forwarding cache entry */ 68 68 #define MRT_VERSION 106 /* get kernel version number */ 69 69 #define MRT_ASSERT 107 /* enable PIM assert processing */ 70 #if 0 70 71 #define GET_TIME(t) microtime(&t) 71 #else /* OS2: */ 72 #endif 73 #endif 74 75 76 #if 1 /* OS2 only? It's aliases of the above defs it seems... */ 77 /* 78 * DVMRP-specific setsockopt commands. 79 */ 80 #define DVMRP_INIT 100 81 #define DVMRP_DONE 101 82 #define DVMRP_ADD_VIF 102 83 #define DVMRP_DEL_VIF 103 72 84 #define DVMRP_ADD_LGRP 104 73 85 #define DVMRP_DEL_LGRP 105 … … 105 117 u_char vifc_flags; /* VIFF_ flags defined below */ 106 118 u_char vifc_threshold; /* min ttl required to forward on vif */ 119 #if 0 /* not on OS/2 */ 107 120 u_int vifc_rate_limit; /* max rate */ 121 #endif 108 122 struct in_addr vifc_lcl_addr; /* local interface address */ 109 123 struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/ip_var.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 90 90 #pragma pack() 91 91 92 #if 0 /* different/not on OS/2 */ 92 93 93 /* 94 94 * Structure stored in mbuf in inpcb.ip_options … … 97 97 * is in m_len. 98 98 */ 99 #define MAX_IPOPTLEN 40 100 #if 0 /* different/not on OS/2 */ 99 101 struct ipoption { 100 102 struct in_addr ipopt_dst; /* first-hop dst if source routed */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/tcp.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1996 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1982, 1986 Regents of the University of California. … … 46 47 * Per RFC 793, September, 1981. 47 48 */ 49 #pragma pack(1) 48 50 struct tcphdr { 49 51 u_short th_sport; /* source port */ … … 51 53 tcp_seq th_seq; /* sequence number */ 52 54 tcp_seq th_ack; /* acknowledgement number */ 55 #ifdef TCPV40HDRS 56 #if BYTE_ORDER == LITTLE_ENDIAN 57 u_int th_x2:4, /* (unused) */ 58 th_off:4, /* data offset */ 59 th_flags:8, 60 th_win:16; 61 #endif 62 #if BYTE_ORDER == BIG_ENDIAN 63 u_int th_win:16, 64 th_flags:8, 65 th_off:4, /* data offset */ 66 th_x2:4; /* (unused) */ 67 #endif 68 #define TH_FIN 0x01 69 #define TH_SYN 0x02 70 #define TH_RST 0x04 71 #define TH_PUSH 0x08 72 #define TH_ACK 0x10 73 #define TH_URG 0x20 74 #else 53 75 #if BYTE_ORDER == LITTLE_ENDIAN 54 76 u_char th_x2:4, /* (unused) */ … … 67 89 #define TH_URG 0x20 68 90 u_short th_win; /* window */ 91 #endif 69 92 u_short th_sum; /* checksum */ 70 93 u_short th_urp; /* urgent pointer */ 71 94 }; 95 #pragma pack() 72 96 73 97 #define TCPOPT_EOL 0 74 98 #define TCPOPT_NOP 1 75 99 #define TCPOPT_MAXSEG 2 100 #ifndef TCPV40HDRS 101 #define TCPOLEN_MAXSEG 4 102 #define TCPOPT_WINDOW 3 103 #define TCPOLEN_WINDOW 3 104 #define TCPOPT_SACK_PERMITTED 4 /* Experimental */ 105 #define TCPOLEN_SACK_PERMITTED 2 106 #define TCPOPT_SACK 5 /* Experimental */ 107 #define TCPOPT_TIMESTAMP 8 108 #define TCPOLEN_TIMESTAMP 10 109 #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ 110 111 #define TCPOPT_CC 11 /* CC options: RFC-1644 */ 112 #define TCPOPT_CCNEW 12 113 #define TCPOPT_CCECHO 13 114 #define TCPOLEN_CC 6 115 #define TCPOLEN_CC_APPA (TCPOLEN_CC+2) 116 #define TCPOPT_CC_HDR(ccopt) \ 117 (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC) 118 #define TTCP_CLIENT_SND_WND 4096 /* dflt send window of ttcp client */ 119 #define TCPOPT_TSTAMP_HDR \ 120 (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) 121 #endif /*!TCPV40HDRS*/ 76 122 77 123 /* … … 81 127 * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). 82 128 */ 129 #ifdef TCPV40HDRS 130 #ifdef lint 131 #define TCP_MSS 536 132 #else 133 #ifndef IP_MSS 134 #define IP_MSS 576 135 #endif 136 #define TCP_MSS MIN(512, IP_MSS - 40) 137 #endif 138 #else /* TCPV40HDRS*/ 83 139 #define TCP_MSS 512 140 #endif 84 141 85 142 #define TCP_MAXWIN 65535 /* largest value for window */ 143 144 #ifndef TCPV40HDRS 145 #define TCP_MAX_WINSHIFT 14 /* maximum window shift */ 146 #endif 86 147 87 148 /* … … 90 151 #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ 91 152 #define TCP_MAXSEG 0x02 /* set maximum segment size */ 153 #ifndef TCPV40HDRS 154 #define TCP_MSL 0x03 /* MSL HACK */ 155 #define TCP_TIMESTMP 0x04 /* RFC 1323 (RTTM TimeStamp) */ 156 #define TCP_WINSCALE 0x05 /* RFC 1323 (Window Scale) */ 157 #define TCP_CC 0x06 /* RFC 1644 (Connection Count) */ 158 #ifdef VEGAS 159 #define TCP_TAHOE 3 160 #define TCP_RENO 4 161 #define TCP_VEGAS 5 162 #define TCP_VEGAS_SPIKE_ON 6 163 #define TCP_VEGAS_EXP_INC_OFF 7 164 #define TCP_VEGAS_CONG_DETECT_OFF 8 165 #define TCP_VEGAS_24 9 166 #define TCP_VEGAS_CONG_DETECT_PRED_ON 10 167 #endif 168 #endif /*!TCPV40HDS*/ 92 169 93 /* hv: this is a new data structure in TCPIPV4. */ 94 #ifdef TCPIPV4 170 #ifdef TCPV40HDRS 95 171 #include <netinet/tcp_var.h> 96 172 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/tcp_var.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1996 2 * 2 * 3 3 * Copyright (c) 1982, 1986 Regents of the University of California. 4 4 * All rights reserved. … … 44 44 * but that's inconvenient at the moment. 45 45 */ 46 #ifdef TCPIPCV447 46 struct tcpstat { 48 47 u_long tcps_connattempt; /* connections initiated */ … … 72 71 u_long tcps_sndwinup; /* window update-only packets sent */ 73 72 u_long tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */ 73 u_long tcps_sndrst; /* RST packets sent, MIB II ... */ 74 74 75 75 u_long tcps_rcvtotal; /* total packets received */ … … 94 94 u_long tcps_rcvackbyte; /* bytes acked by rcvd acks */ 95 95 u_long tcps_rcvwinupd; /* rcvd window update packets */ 96 #ifndef TCPV40HDRS 97 u_long tcps_pawsdrop; /* segments dropped due to PAWS */ 98 u_long tcps_predack; /* times hdr predict ok for acks */ 99 u_long tcps_preddat; /* times hdr predict ok for data pkts*/ 100 u_long tcps_pcbcachemiss; 101 u_long tcps_persistdrop; /* timeout in persist state */ 102 u_long tcps_badsyn; /* bogus SYN, e.g. premature ACK */ 103 104 /* the fillowing 7 are for mtudisco and ttcp */ 105 106 u_long tcps_mturesent; /* resends due to MTU discovery */ 107 u_long tcps_cachedrtt; /* times cached RTT in route updated */ 108 u_long tcps_cachedrttvar; /* times cached rttvar updated */ 109 u_long tcps_cachedssthresh; /* times cached ssthresh updated */ 110 u_long tcps_usedrtt; /* times RTT initialized from route */ 111 u_long tcps_usedrttvar; /* times RTTVAR initialized from rt */ 112 u_long tcps_usedssthresh; /* times ssthresh initialized from rt*/ 113 #endif 96 114 }; 97 #endif 115 116 #ifndef TCPV40HDRS 117 /* 118 * Names for TCP sysctl objects 119 */ 120 #define TCPCTL_MSSDFLT 1 /* MSS default */ 121 #define TCPCTL_STATS 2 /* statistics (read-only) */ 122 #define TCPCTL_RTTDFLT 3 /* default RTT estimate */ 123 #define TCPCTL_MSL 4 /* No Of Keepalive probes */ 124 #define TCPCTL_INETCFG 6 /* Generic TCP Inetcfg switching */ 125 #define TCPCTL_LINGERTIME 7 /* Linger On close timer */ 126 #define TCPCTL_KEEPCNT 8 /* No Of Keepalive probes */ 127 #define TCPCTL_TCPSWIN 9 /* TCP Send Window Size */ 128 #define TCPCTL_TCPRWIN 10 /* TCP Recieve Window Size */ 129 #define TCPCTL_TTL 11 /* TTL for TCP packets */ 130 #define TCPCTL_MTU 12 /* Path MTU Discovery ON/OFF flg */ 131 #define TCPCTL_WINSCALE 13 /* Winow Scale (Fat Pipe) ON/OFF flg */ 132 #define TCPCTL_TIMESTMP 14 /* TCP TimeStamp ON/OFF flg */ 133 #define TCPCTL_CC 15 /* Cc, CCnew & Echo ON/OFF flg */ 134 #define TCPCTL_REALSLOW 16 /* Real Slow Timer for Time Wait Q */ 135 #define TCPCTL_REUSETW 17 /* Reuse TW inetcfg */ 136 #define TCPCTL_SYNCOOKIE 18 /* Syncookie inetcfg */ 137 #define TCPCTL_PERFHTTP 19 /* Fast Path HTTP */ 138 139 140 /*Inetcfg ioctl constants */ 141 #define ICFG_SETKEEPALIVE 20 /* sysctl code:Set the KeepAlive timer */ 142 #define ICFG_GETKEEPALIVE 21 /* sysctl code:Get the KeepAlive timer defaults */ 143 144 #define TCPCTL_NAMES { \ 145 { 0, 0 }, \ 146 { "mssdflt", CTLTYPE_INT }, \ 147 { "stats", CTLTYPE_STRUCT }, \ 148 { "rttdflt", CTLTYPE_INT }, \ 149 { "inetcfg", CTLTYPE_INETCFG },\ 150 } 151 #endif /* !TCPV40HDRS */ 98 152 99 153 #endif /* !_NETINET_TCP_VAR_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/udp.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1996 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1982, 1986 Regents of the University of California. … … 39 40 #define _NETINET_UDP_H_ 40 41 42 #ifdef TCPV40HDRS 43 #include <netinet/udp_var.h> 44 #else 41 45 /* 42 46 * Udp protocol header. 43 47 * Per RFC 768, September, 1981. 44 48 */ 49 #pragma pack(1) 45 50 struct udphdr { 46 51 u_short uh_sport; /* source port */ … … 49 54 u_short uh_sum; /* udp checksum */ 50 55 }; 51 52 /* hv: this is a new structure of TCPIPV4. Consult IBM's docs on that */ 53 #ifdef TCPIPV4 54 #include <netinet/udp_var.h> 55 struct udpstat { 56 u_long udps_hdrops; 57 u_long udps_badsum; 58 u_long udps_badlen; 59 u_long udps_udpInDatagrams; 60 u_long udps_udpNoPorts; 61 u_long udps_udpOutDatagrams; 62 }; 56 #pragma pack() 63 57 #endif 64 58 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netinet/udp_var.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv 1996 2 * 2 * Modified for gcc/os2 by bird 2003 3 * 3 4 * Copyright (c) 1982, 1986, 1989 Regents of the University of California. 4 5 * All rights reserved. … … 39 40 #define _NETINET_UDP_VAR_H_ 40 41 41 #ifdef TCPIPV4 42 struct udpstat { 43 /* input statistics: */ 44 #ifndef __EMX__ 45 u_long udps_ipackets; /* total input packets */ 46 #endif 47 u_long udps_hdrops; /* packet shorter than header */ 48 u_long udps_badsum; /* checksum error */ 49 u_long udps_badlen; /* data length larger than packet */ 50 #ifndef __EMX__ 51 u_long udps_noport; /* no socket on port */ 52 u_long udps_noportbcast; /* of above, arrived as broadcast */ 53 u_long udps_fullsock; /* not delivered, input socket full */ 54 u_long udpps_pcbcachemiss; /* input packets missing pcb cache */ 55 /* output statistics: */ 56 u_long udps_opackets; /* total output packets */ 57 #else /* __EMX__ */ 42 #ifdef TCPV40HDRS 43 struct udpstat { 44 u_long udps_hdrops; 45 u_long udps_badsum; 46 u_long udps_badlen; 58 47 u_long udps_udpInDatagrams; 59 48 u_long udps_udpNoPorts; 60 49 u_long udps_udpOutDatagrams; 61 #endif /* __EMX__ */62 50 }; 63 #endif /* TCPIPV4 */64 51 65 #define UDP_TTL 30 /* default time to live for UDP packets */ 52 #else 53 54 /* 55 * UDP kernel structures and variables. 56 */ 57 #pragma pack(1) 58 struct udpiphdr { 59 struct ipovly ui_i; /* overlaid ip structure */ 60 struct udphdr ui_u; /* udp header */ 61 }; 62 #pragma pack() 63 #define ui_next ui_i.ih_next 64 #define ui_prev ui_i.ih_prev 65 #define ui_x1 ui_i.ih_x1 66 #define ui_pr ui_i.ih_pr 67 #define ui_len ui_i.ih_len 68 #define ui_src ui_i.ih_src 69 #define ui_dst ui_i.ih_dst 70 #define ui_sport ui_u.uh_sport 71 #define ui_dport ui_u.uh_dport 72 #define ui_ulen ui_u.uh_ulen 73 #define ui_sum ui_u.uh_sum 74 75 struct udpstat { 76 /* input statistics: */ 77 u_long udps_ipackets; /* total input packets */ 78 u_long udps_hdrops; /* packet shorter than header */ 79 u_long udps_badsum; /* checksum error */ 80 u_long udps_badlen; /* data length larger than packet */ 81 u_long udps_noport; /* no socket on port */ 82 u_long udps_noportbcast; /* of above, arrived as broadcast */ 83 u_long udps_fullsock; /* not delivered, input socket full */ 84 u_long udpps_pcbcachemiss; /* input packets missing pcb cache */ 85 /* output statistics: */ 86 u_long udps_opackets; /* total output packets */ 87 }; 88 89 /* 90 * Names for UDP sysctl objects 91 */ 92 #define UDPCTL_CHECKSUM 1 /* checksum UDP packets */ 93 #define UDPCTL_STATS 2 /* statistics (read-only) */ 94 #define UDPCTL_INETCFG 31 /* sysctl code-Generic UDP Inetcfg switching */ 95 #define UDPCTL_TTL 32 /* sysctl code-TTL for UDP packets */ 96 #define UDPCTL_UDPSWIN 33 /* sysctl code-UDP really MAX datagram Size */ 97 #define UDPCTL_UDPRWIN 34 /* sysctl code-UDP recieve window size */ 98 99 #define UDPCTL_NAMES { \ 100 { 0, 0 }, \ 101 { "stats", CTLTYPE_STRUCT }, \ 102 { "inetcfg",CTLTYPE_INETCFG},\ 103 } 104 105 #endif /* TCPV40HDRS */ 66 106 67 107 #endif /* !_NETINET_UDP_VAR_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/netnb/nb.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 12 12 13 13 #define NBPROTO_NB 1 14 #define NB_FAMILY AF_NETBIOS14 #define NB_FAMILY 18 /* temporary hack? */ 15 15 #define NB_ADDRSIZE sizeof(struct sockaddr_nb) 16 16 #define NB_UNIQUE 0 … … 20 20 #define NB_NETIDLEN 8 21 21 #define NB_HOSTLEN 12 22 #define NB_PORTLEN 422 #define NB_PORTLEN (NB_NAMELEN - NB_HOSTLEN) 23 23 /* 1234567890123456 */ 24 24 #define NB_BCAST_NAME "* " … … 26 26 #define NB_NULL_NAME "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" 27 27 28 #define NBPORT_RESERVED IPPORT_RESERVED 29 #define NBPORT_USERRESERVED IPPORT_USERRESERVED 28 /* must match IOPORT_* constants in netinet/in.h! */ 29 #ifdef TCPV40HDRS 30 #define NBPORT_RESERVED "1024" 31 #define NBPORT_USERRESERVED "5000" 32 #else 33 #define NBPORT_RESERVED "49152" 34 #define NBPORT_USERRESERVED "65535" 35 #endif 30 36 31 37 /* address format for netbios */ 38 #pragma pack(1) 32 39 struct sockaddr_nb { 40 #ifdef TCPV40HDRS 33 41 short snb_family; /* protocol family */ 42 #else 43 u_char snb_len; 44 u_char snb_family; /* netbios protocol family */ 45 #endif 34 46 short snb_type; /* unique/multicast */ 35 47 char snb_netid[NB_NETIDLEN]; /* netid */ 36 48 char snb_name[NB_NAMELEN]; /* name */ 37 49 }; 50 #pragma pack() 38 51 39 52 #endif /* !_NETNB_NB_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/resolv.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for EMX by hv 1994,1996 2 * Modified for gcc by bird 2003 2 3 * 3 4 * Copyright (c) 1983, 1987, 1989 The Regents of the University of California. … … 33 34 * 34 35 * from: @(#)resolv.h 5.15 (Berkeley) 4/3/91 35 * resolv.h,v 1. 1 2003/04/16 15:53:07bird Exp36 * resolv.h,v 1.2 2003/05/19 02:41:00 bird Exp 36 37 */ 37 38 … … 39 40 #define _RESOLV_H_ 40 41 42 41 43 #if defined (__cplusplus) 42 44 extern "C" { 43 45 #endif 44 46 45 #pragma pack(4) 47 /* toolkit includes a bunch of headers */ 48 #ifndef TCPV40HDRS 49 #include <sys/param.h> 50 #include <types.h> 51 #include <sys/cdefs.h> 52 #include <stdio.h> 53 54 55 /* 56 * Revision information. This is the release date in YYYYMMDD format. 57 * It can change every day so the right thing to do with it is use it 58 * in preprocessor commands such as "#if (__RES > 19931104)". Do not 59 * compare for equality; rather, use it to determine whether your resolver 60 * is new enough to contain a certain feature. 61 */ 62 63 #define __RES 19960801 46 64 47 65 /* … … 52 70 53 71 #ifndef _PATH_RESCONF 54 #define _PATH_RESCONF "/tcpip/etc/resolv.conf" 55 #endif 72 #define _PATH_RESCONF "/mptn/etc/resolv.conf" 73 #endif 74 #endif /* TCPV40HDRS */ 56 75 57 76 /* … … 60 79 #define MAXNS 3 /* max # name servers we'll track */ 61 80 #define MAXDFLSRCH 3 /* # default domain levels to try */ 81 #define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ 82 #define RES_TIMEOUT 4 /* min. seconds between retries */ 83 #ifdef TCPV40HDRS 84 #define MAXDNSRCH 3 /* max # domains in search path */ 85 #else 62 86 #define MAXDNSRCH 6 /* max # domains in search path */ 63 #define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ 64 #define MAXDNSLUS 4 /* max # of host lookup types */ 65 66 #define RES_TIMEOUT 5 /* min. seconds between retries */ 87 #define MAXRESOLVSORT 10 /* number of net to sort on */ 88 #define RES_MAXNDOTS 15 /* should reflect bit field size */ 89 #endif 90 91 92 #ifdef TCPV40HDRS 67 93 68 94 #pragma pack(4) … … 77 103 char defdname[MAXDNAME]; /* default domain */ 78 104 char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ 79 /* char lookups[MAXDNSLUS];*/ /* not in OS/2 */80 105 }; 81 #pragma pack(1) 106 #pragma pack() 107 108 #else 109 110 #pragma pack(4) 111 struct __res_state { 112 int retrans; /* retransmition time interval */ 113 int retry; /* number of times to retransmit */ 114 u_long options; /* option flags - see below. */ 115 int nscount; /* number of name servers */ 116 struct sockaddr_in 117 nsaddr_list[MAXNS]; /* address of name server */ 118 #define nsaddr nsaddr_list[0] /* for backward compatibility */ 119 u_short id; /* current message id */ 120 char defdname[256]; /* default domain (deprecated) */ 121 char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ 122 u_long pfcode; /* RES_PRF_ flags - see below. */ 123 unsigned ndots:4; /* threshold for initial abs. query */ 124 unsigned nsort:4; /* number of elements in sort_list[] */ 125 char unused[3]; 126 struct { 127 struct in_addr addr; 128 u_int32_t mask; 129 } sort_list[MAXRESOLVSORT]; 130 char pad[72]; /* on an i386 this means 512b total */ 131 }; 132 #pragma pack() 133 134 #endif 82 135 83 136 /* … … 94 147 #define RES_STAYOPEN 0x0100 /* Keep TCP socket open */ 95 148 #define RES_DNSRCH 0x0200 /* search up local domain tree */ 149 #ifndef TCPV40HDRS 150 #define RES_INSECURE1 0x00000400 /* type 1 security disabled */ 151 #define RES_INSECURE2 0x00000800 /* type 2 security disabled */ 152 #define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */ 153 #define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */ 154 #endif 96 155 97 156 #define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH) 98 157 158 159 160 #ifdef TCPV40HDRS 161 99 162 extern struct state _res; 100 163 164 #else 165 166 /* 167 * Resolver "pfcode" values. Used by dig. 168 */ 169 #define RES_PRF_STATS 0x00000001 170 /* 0x00000002 */ 171 #define RES_PRF_CLASS 0x00000004 172 #define RES_PRF_CMD 0x00000008 173 #define RES_PRF_QUES 0x00000010 174 #define RES_PRF_ANS 0x00000020 175 #define RES_PRF_AUTH 0x00000040 176 #define RES_PRF_ADD 0x00000080 177 #define RES_PRF_HEAD1 0x00000100 178 #define RES_PRF_HEAD2 0x00000200 179 #define RES_PRF_TTLID 0x00000400 180 #define RES_PRF_HEADX 0x00000800 181 #define RES_PRF_QUERY 0x00001000 182 #define RES_PRF_REPLY 0x00002000 183 #define RES_PRF_INIT 0x00004000 184 /* 0x00008000 */ 185 186 /* hooks are still experimental as of 4.9.2 */ 187 typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error } 188 res_sendhookact; 189 190 typedef res_sendhookact (* _System res_send_qhook)(struct sockaddr_in * const *ns, 191 const u_char **query, 192 int *querylen, 193 u_char *ans, 194 int anssiz, 195 int *resplen); 196 197 typedef res_sendhookact (* _System res_send_rhook)(const struct sockaddr_in *ns, 198 const u_char *query, 199 int querylen, 200 u_char *ans, 201 int anssiz, 202 int *resplen); 203 204 #pragma pack(4) 205 struct res_sym { 206 int number; /* Identifying number, like T_MX */ 207 char * name; /* Its symbolic name, like "MX" */ 208 char * humanname; /* Its fun name, like "mail exchanger" */ 209 }; 210 #pragma pack() 211 212 extern struct __res_state _ress[2]; 213 extern const struct res_sym __p_class_syms[]; 214 extern const struct res_sym __p_type_syms[]; 215 #define _res (_ress[0]) 216 101 217 /* Private routines shared between libc/net, named, nslookup and others. */ 102 int dn_skipname (__const__ u_char *, __const__ u_char *); 103 void putlong (u_long, u_char *); 104 void putshort (u_short, u_char *); 105 106 /* public routines */ 107 int dn_comp(__const__ u_char *, u_char *, int, u_char **, u_char **); 108 int dn_expand(__const__ u_char *, __const__ u_char *, __const__ u_char *, 109 u_char *, int); 110 int res_init(void); 111 int res_mkquery(int, __const__ char *, int, int, __const__ char *, int, 112 __const__ struct rrec *, char *, int); 113 int res_send(__const__ char *, int, char *, int); 218 #define res_hnok __res_hnok 219 #define res_ownok __res_ownok 220 #define res_mailok __res_mailok 221 #define res_dnok __res_dnok 222 #define sym_ston __sym_ston 223 #define sym_ntos __sym_ntos 224 #define sym_ntop __sym_ntop 225 #define b64_ntop __b64_ntop 226 #define b64_pton __b64_pton 227 #define loc_ntoa __loc_ntoa 228 #define loc_aton __loc_aton 229 #define dn_skipname __dn_skipname 230 #define fp_resstat __fp_resstat 231 #define fp_query __fp_query 232 #define fp_nquery __fp_nquery 233 #define hostalias __hostalias 234 #define putlong __putlong 235 #define putshort __putshort 236 #define p_class __p_class 237 #define p_time __p_time 238 #define p_type __p_type 239 #define p_query __p_query 240 #define p_cdnname __p_cdnname 241 #define p_cdname __p_cdname 242 #define p_fqnname __p_fqnname 243 #define p_fqname __p_fqname 244 #define p_rr __p_rr 245 #define p_option __p_option 246 #define p_secstodate __p_secstodate 247 #define dn_count_labels __dn_count_labels 248 #define dn_comp __dn_comp 249 #define dn_expand __dn_expand 250 #define res_init __res_init 251 #define res_randomid __res_randomid 252 #define res_query __res_query 253 #define res_search __res_search 254 #define res_querydomain __res_querydomain 255 #define res_mkquery __res_mkquery 256 #define res_send __res_send 257 #define res_isourserver __res_isourserver 258 #define res_nameinquery __res_nameinquery 259 #define res_queriesmatch __res_queriesmatch 260 #define res_close __res_close 261 262 int _System res_hnok(const char *); 263 int _System res_ownok(const char *); 264 int _System res_mailok(const char *); 265 int _System res_dnok(const char *); 266 int _System sym_ston(const struct res_sym *, char *, int *); 267 const char * _System sym_ntos(const struct res_sym *, int, int *); 268 const char * _System sym_ntop(const struct res_sym *, int, int *); 269 int _System b64_ntop(u_char const *, size_t, char *, size_t); 270 int _System b64_pton(char const *, u_char *, size_t); 271 int _System loc_aton(const char *, u_char *); 272 const char * _System loc_ntoa(const u_char *, char *); 273 int _System dn_skipname(const u_char *, const u_char *); 274 void _System fp_resstat(struct __res_state *, int); 275 void _System fp_query(const u_char *, int); 276 void _System fp_nquery(const u_char *, int, int); 277 const char * _System hostalias(const char *); 278 void _System putlong(u_int32_t, u_char *); 279 void _System putshort(u_int16_t, u_char *); 280 const char * _System p_class(int); 281 const char * _System p_time(u_int32_t); 282 const char * _System p_type(int); 283 void _System p_query(const u_char *); 284 const u_char * _System p_cdnname(const u_char *, const u_char *, int, int); 285 const u_char * _System p_cdname(const u_char *, const u_char *, int); 286 const u_char * _System p_fqnname(const u_char *cp, const u_char *msg, 287 int, char *, int); 288 const u_char * _System p_fqname(const u_char *, const u_char *, int); 289 const u_char * _System p_rr(const u_char *, const u_char *, int); 290 const char * _System p_option(u_long option); 291 char * _System p_secstodate(u_long); 292 int _System dn_count_labels(char *); 293 int _System dn_comp(const char *, u_char *, int, 294 u_char **, u_char **); 295 int _System dn_expand(const u_char *, const u_char *, const u_char *, 296 char *, int); 297 int _System res_init(void); 298 u_int _System res_randomid(void); 299 int _System res_query(const char *, int, int, u_char *, int); 300 int _System res_search(const char *, int, int, u_char *, int); 301 int _System res_querydomain(const char *, const char *, int, int, u_char *, int); 302 int _System res_mkquery(int, const char *, int, int, const u_char *, int, 303 const u_char *, u_char *, int); 304 int _System res_send(const u_char *, int, u_char *, int); 305 int _System res_isourserver(const struct sockaddr_in *); 306 int _System res_nameinquery(const char *, int, int, 307 const u_char *, const u_char *); 308 int _System res_queriesmatch(const u_char *, const u_char *, 309 const u_char *, const u_char *); 310 void _System res_close(void); 311 int _System dn_find(u_char *exp_dn, u_char *msg, 312 u_char **dnptrs, u_char **lastdnptr); 313 #endif /* !TCPV40HDRS */ 314 114 315 115 316 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/socks.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 51 51 52 52 -----------------------------------------------------------------*/ 53 #ifndef _SOCKS_H_ 54 #define _SOCKS_H_ 53 55 #include <netinet\in.h> 54 56 … … 80 82 } Socks_t; 81 83 84 82 85 typedef struct socksdata { 83 86 /* the following feilds are for socks */ … … 95 98 struct sockaddr_in me; 96 99 } SD; 97 100 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/cdefs.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* 1 /*- modified for gcc/os2 by bird 2003 2 * 2 3 * Copyright (c) 1991, 1993 3 4 * The Regents of the University of California. All rights reserved. … … 34 35 * SUCH DAMAGE. 35 36 * 36 * @(#)cdefs.h 8.7 (Berkeley) 1/21/94 37 */ 38 39 #ifndef _CDEFS_H_ 40 #define _CDEFS_H_ 37 * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 38 * $FreeBSD: src/sys/sys/cdefs.h,v 1.68 2002/10/21 20:50:30 mike Exp $ 39 */ 40 41 #ifndef _SYS_CDEFS_H_ 42 #define _SYS_CDEFS_H_ 43 #define _CDEFS_H_ /* compatability */ 41 44 42 45 #if defined(__cplusplus) 43 46 #define __BEGIN_DECLS extern "C" { 44 #define __END_DECLS } ;47 #define __END_DECLS } 45 48 #else 46 49 #define __BEGIN_DECLS … … 51 54 * The __CONCAT macro is used to concatenate parts of symbol names, e.g. 52 55 * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. 53 * The __CONCAT macro is a bit tricky -- make sure you don't put spaces 54 * in between its arguments. __CONCAT can also concatenate double-quoted 55 * strings produced by the __STRING macro, but this only works with ANSI C. 56 * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI 57 * mode -- there must be no spaces between its arguments, and for nested 58 * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also 59 * concatenate double-quoted strings produced by the __STRING macro, but 60 * this only works with ANSI C. 61 * 62 * __XSTRING is like __STRING, but it expands any macros in its argument 63 * first. It is only available with ANSI C. 56 64 */ 57 65 #if defined(__STDC__) || defined(__cplusplus) 58 66 #define __P(protos) protos /* full-blown ANSI C */ 59 #define __CONCAT(x,y) x ## y 60 #define __STRING(x) #x 67 #define __CONCAT1(x,y) x ## y 68 #define __CONCAT(x,y) __CONCAT1(x,y) 69 #define __STRING(x) #x /* stringify without expanding x */ 70 #define __XSTRING(x) __STRING(x) /* expand x, then stringify */ 61 71 62 72 #define __const const /* define reserved names to standard */ … … 94 104 #define signed 95 105 #define volatile 96 #endif 106 #endif /* !NO_ANSI_KEYWORDS */ 97 107 #endif /* !__GNUC__ */ 98 108 #endif /* !(__STDC__ || __cplusplus) */ 99 109 100 110 /* 101 * GCC1 and some versions of GCC2 declare dead (non-returning) and 102 * pure (no side effects) functions using "volatile" and "const"; 103 * unfortunately, these then cause warnings under "-ansi -pedantic". 104 * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of 105 * these work for GNU C++ (modulo a slight glitch in the C++ grammar 106 * in the distribution version of 2.5.5). 107 */ 108 #if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 109 #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ 110 #if defined(__GNUC__) && !defined(__STRICT_ANSI__) 111 #define __dead __volatile 112 #define __pure __const 113 #endif 114 #endif 115 116 /* Delete pseudo-keywords wherever they are not available or needed. */ 117 #ifndef __dead 118 #define __dead 119 #define __pure 120 #endif 121 122 #endif /* !_CDEFS_H_ */ 111 * Compiler-dependent macros to help declare dead (non-returning) and 112 * pure (no side effects) functions, and unused variables. They are 113 * null except for versions of gcc that are known to support the features 114 * properly (old versions of gcc-2 supported the dead and pure features 115 * in a different (wrong) way). If we do not provide an implementation 116 * for a given compiler, let the compile fail if it is told to use 117 * a feature that we cannot live without. 118 */ 119 #ifdef lint 120 #define __dead2 121 #define __pure2 122 #define __unused 123 #define __packed 124 #define __aligned(x) 125 #define __section(x) 126 #else 127 #if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5 128 #define __dead2 129 #define __pure2 130 #define __unused 131 #endif 132 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 133 #define __dead2 __attribute__((__noreturn__)) 134 #define __pure2 __attribute__((__const__)) 135 #define __unused 136 /* XXX Find out what to do for __packed, __aligned and __section */ 137 #endif 138 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ == 3 139 #define __dead2 __attribute__((__noreturn__)) 140 #define __pure2 __attribute__((__const__)) 141 #define __unused __attribute__((__unused__)) 142 #define __packed __attribute__((__packed__)) 143 #define __aligned(x) __attribute__((__aligned__(x))) 144 #define __section(x) __attribute__((__section__(x))) 145 #endif 146 #endif 147 148 /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ 149 #if !(__GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3) 150 #define __func__ NULL 151 #endif 152 153 #if __GNUC__ >= 2 && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 154 #define __LONG_LONG_SUPPORTED 155 #endif 156 157 /* 158 * GCC 2.95 provides `__restrict' as an extension to C90 to support the 159 * C99-specific `restrict' type qualifier. We happen to use `__restrict' as 160 * a way to define the `restrict' type qualifier without disturbing older 161 * software that is unaware of C99 keywords. 162 */ 163 #if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) 164 #if __STDC_VERSION__ < 199901 165 #define __restrict 166 #else 167 #define __restrict restrict 168 #endif 169 #endif 170 171 /* 172 * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> 173 * require it. 174 */ 175 #define __offsetof(type, field) ((size_t)(&((type *)0)->field)) 176 177 /* 178 * Compiler-dependent macros to declare that functions take printf-like 179 * or scanf-like arguments. They are null except for versions of gcc 180 * that are known to support the features properly (old versions of gcc-2 181 * didn't permit keeping the keywords out of the application namespace). 182 */ 183 #if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 7 184 #define __printflike(fmtarg, firstvararg) 185 #define __scanflike(fmtarg, firstvararg) 186 #else 187 #define __printflike(fmtarg, firstvararg) \ 188 __attribute__((__format__ (__printf__, fmtarg, firstvararg))) 189 #define __scanflike(fmtarg, firstvararg) \ 190 __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) 191 #endif 192 193 /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ 194 #if __FreeBSD_cc_version >= 300001 && __FreeBSD_cc_version < 500003 195 #define __printf0like(fmtarg, firstvararg) \ 196 __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) 197 #else 198 #define __printf0like(fmtarg, firstvararg) 199 #endif 200 201 #if 0 /* def __GNUC__ - ELF specific, so skip everything */ 202 #define __strong_reference(sym,aliassym) \ 203 extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))); 204 #ifdef __STDC__ 205 #define __weak_reference(sym,alias) \ 206 __asm__(".weak " #alias); \ 207 __asm__(".equ " #alias ", " #sym) 208 #define __warn_references(sym,msg) \ 209 __asm__(".section .gnu.warning." #sym); \ 210 __asm__(".asciz \"" msg "\""); \ 211 __asm__(".previous") 212 #else 213 #define __weak_reference(sym,alias) \ 214 __asm__(".weak alias"); \ 215 __asm__(".equ alias, sym") 216 #define __warn_references(sym,msg) \ 217 __asm__(".section .gnu.warning.sym"); \ 218 __asm__(".asciz \"msg\""); \ 219 __asm__(".previous") 220 #endif /* __STDC__ */ 221 #endif /* __GNUC__ */ 222 223 #if 0 /*def __GNUC__ - ELF specific. */ 224 #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") 225 #else 226 /* 227 * This doesn't work in header files. But it may be better than nothing. 228 * The alternative is: #define __IDSTRING(name,string) [nothing] 229 */ 230 #define __IDSTRING(name,string) static const char name[] __unused = string 231 #endif 232 233 /* 234 * Embed the rcs id of a source file in the resulting library. Note that in 235 * more recent ELF binutils, we use .ident allowing the ID to be stripped. 236 * Usage: 237 * __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.68 2002/10/21 20:50:30 mike Exp $"); 238 */ 239 #ifndef __FBSDID 240 #if !defined(lint) && !defined(STRIP_FBSDID) 241 #define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s) 242 #else 243 #define __FBSDID(s) struct __hack 244 #endif 245 #endif 246 247 #ifndef __RCSID 248 #ifndef NO__RCSID 249 #define __RCSID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s) 250 #else 251 #define __RCSID(s) 252 #endif 253 #endif 254 255 #ifndef __RCSID_SOURCE 256 #ifndef NO__RCSID_SOURCE 257 #define __RCSID_SOURCE(s) __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s) 258 #else 259 #define __RCSID_SOURCE(s) 260 #endif 261 #endif 262 263 #ifndef __SCCSID 264 #ifndef NO__SCCSID 265 #define __SCCSID(s) __IDSTRING(__CONCAT(__sccsid_,__LINE__),s) 266 #else 267 #define __SCCSID(s) 268 #endif 269 #endif 270 271 #ifndef __COPYRIGHT 272 #ifndef NO__COPYRIGHT 273 #define __COPYRIGHT(s) __IDSTRING(__CONCAT(__copyright_,__LINE__),s) 274 #else 275 #define __COPYRIGHT(s) 276 #endif 277 #endif 278 279 #ifndef __DECONST 280 #define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) 281 #endif 282 283 #ifndef __DEVOLATILE 284 #define __DEVOLATILE(type, var) ((type)(uintptr_t)(volatile void *)(var)) 285 #endif 286 287 #ifndef __DEQUALIFY 288 #define __DEQUALIFY(type, var) ((type)(uintptr_t)(const volatile void *)(var)) 289 #endif 290 291 /*- 292 * The following definitions are an extension of the behavior originally 293 * implemented in <sys/_posix.h>, but with a different level of granularity. 294 * POSIX.1 requires that the macros we test be defined before any standard 295 * header file is included. 296 * 297 * Here's a quick run-down of the versions: 298 * defined(_POSIX_SOURCE) 1003.1-1988 299 * _POSIX_C_SOURCE == 1 1003.1-1990 300 * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option 301 * _POSIX_C_SOURCE == 199309 1003.1b-1993 302 * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, 303 * and the omnibus ISO/IEC 9945-1: 1996 304 * _POSIX_C_SOURCE == 200112 1003.1-2001 305 * 306 * In addition, the X/Open Portability Guide, which is now the Single UNIX 307 * Specification, defines a feature-test macro which indicates the version of 308 * that specification, and which subsumes _POSIX_C_SOURCE. 309 * 310 * Our macros begin with two underscores to avoid namespace screwage. 311 */ 312 313 /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ 314 #if _POSIX_C_SOURCE == 1 315 #undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ 316 #define _POSIX_C_SOURCE 199009 317 #endif 318 319 /* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ 320 #if _POSIX_C_SOURCE == 2 321 #undef _POSIX_C_SOURCE 322 #define _POSIX_C_SOURCE 199209 323 #endif 324 325 /* Deal with various X/Open Portability Guides and Single UNIX Spec. */ 326 #ifdef _XOPEN_SOURCE 327 #if _XOPEN_SOURCE - 0 >= 600 328 #define __XSI_VISIBLE 600 329 #undef _POSIX_C_SOURCE 330 #define _POSIX_C_SOURCE 200112 331 #elif _XOPEN_SOURCE - 0 >= 500 332 #define __XSI_VISIBLE 500 333 #undef _POSIX_C_SOURCE 334 #define _POSIX_C_SOURCE 199506 335 #endif 336 #endif 337 338 /* 339 * Deal with all versions of POSIX. The ordering relative to the tests above is 340 * important. 341 */ 342 #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) 343 #define _POSIX_C_SOURCE 198808 344 #endif 345 #ifdef _POSIX_C_SOURCE 346 #if _POSIX_C_SOURCE >= 200112 347 #define __POSIX_VISIBLE 200112 348 #define __ISO_C_VISIBLE 1999 349 #elif _POSIX_C_SOURCE >= 199506 350 #define __POSIX_VISIBLE 199506 351 #define __ISO_C_VISIBLE 1990 352 #elif _POSIX_C_SOURCE >= 199309 353 #define __POSIX_VISIBLE 199309 354 #define __ISO_C_VISIBLE 1990 355 #elif _POSIX_C_SOURCE >= 199209 356 #define __POSIX_VISIBLE 199209 357 #define __ISO_C_VISIBLE 1990 358 #elif _POSIX_C_SOURCE >= 199009 359 #define __POSIX_VISIBLE 199009 360 #define __ISO_C_VISIBLE 1990 361 #else 362 #define __POSIX_VISIBLE 198808 363 #define __ISO_C_VISIBLE 0 364 #endif /* _POSIX_C_SOURCE */ 365 #else 366 /*- 367 * Deal with _ANSI_SOURCE: 368 * If it is defined, and no other compilation environment is explicitly 369 * requested, then define our internal feature-test macros to zero. This 370 * makes no difference to the preprocessor (undefined symbols in preprocessing 371 * expressions are defined to have value zero), but makes it more convenient for 372 * a test program to print out the values. 373 * 374 * If a program mistakenly defines _ANSI_SOURCE and some other macro such as 375 * _POSIX_C_SOURCE, we will assume that it wants the broader compilation 376 * environment (and in fact we will never get here). 377 */ 378 #if defined(_ANSI_SOURCE) /* Hide almost everything. */ 379 #define __POSIX_VISIBLE 0 380 #define __XSI_VISIBLE 0 381 #define __BSD_VISIBLE 0 382 #define __ISO_C_VISIBLE 1990 383 #elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ 384 #define __POSIX_VISIBLE 0 385 #define __XSI_VISIBLE 0 386 #define __BSD_VISIBLE 0 387 #define __ISO_C_VISIBLE 1999 388 #else /* Default environment: show everything. */ 389 #define __POSIX_VISIBLE 200112 390 #define __XSI_VISIBLE 600 391 #define __BSD_VISIBLE 1 392 #define __ISO_C_VISIBLE 1999 393 #endif 394 #endif 395 396 /* toolkit pollution */ 397 #define __TCPPROTO(args) __P(args) 398 399 #endif /* !_SYS_CDEFS_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/ioctl.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 8 8 #endif 9 9 10 #i f defined (_EMX_TCPIP)11 #include <sys/so _ioctl.h>12 # endif10 #include <sys/ioccom.h> 11 #include <sys/sockio.h> 12 #include <sys/filio.h> 13 13 14 14 #if !defined (TCGETA) … … 26 26 #define _TCSADRAIN 10 /* Used internally for tcsetattr() */ 27 27 #define _TCSAFLUSH 11 /* Used internally for tcsetattr() */ 28 29 #if !defined (FIONREAD)30 #define FIONREAD 1631 #endif32 28 33 29 #if !defined (FGETHTYPE) … … 47 43 #endif 48 44 49 int ioctl (int, int, ...);50 51 int _ioctl (int, int, ...);52 53 45 #if defined (__cplusplus) 54 46 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/param.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* sys/param.h (emx+gcc) */ 1 /** @file sys/param.h 2 * BSD like sys\param.h file. 3 * 4 * TCPV40HDRS does include this file, but as we don't need to be 5 * 100% compatible we don't care. 6 */ 2 7 3 8 #ifndef _SYS_PARAM_H 4 9 #define _SYS_PARAM_H 10 #define _SYS_PARAM_H_ /* toolkit */ 5 11 6 12 #if defined (__cplusplus) … … 8 14 #endif 9 15 10 #if !defined (PAGE_SIZE) 11 #define PAGE_SIZE 0x1000 16 17 #if !defined (NULL) 18 #if defined (__cplusplus) 19 #define NULL 0 20 #else 21 #define NULL ((void*)0) 22 #endif 12 23 #endif 13 24 14 #if !defined (HZ) 25 26 /** @group BSD version defines. 27 * OS2: The toolkit headers define these. Resent FreeBSD release does too. 28 * Warning! Be aware that config scripts and programs may check for these and 29 * assume they're running on BSD. We might have to take out these 30 * defines. 31 * @{ 32 */ 33 /** System version - year and month */ 34 #ifdef TCPV40HDRS 35 #define BSD 43 36 #else 37 #define BSD 199506 38 #endif 39 #ifndef TCPV40HDRS 40 /** Indicate BSD4.3 features present. */ 41 #define BSD4_3 1 42 /** Indicate BSD4.4 features present. */ 43 #define BSD4_4 1 44 #endif 45 /** @} */ 46 47 48 #ifndef LOCORE 49 #include <types.h> 50 #endif 51 #include <sys/syslimits.h> 52 #include <sys/signal.h> 53 #include <machine/param.h> 54 #include <machine/limits.h> 55 56 57 /** @group System Parameters (BSD flavored) 58 * 59 * @{ */ 60 #ifndef MAXCOMLEN 61 /** Max command name remembered. */ 62 #define MAXCOMLEN 19 63 #endif 64 65 #ifndef MAXINTERP 66 /** Max interpreter file name length (ELF?). 67 * OS2: Have no meaning. */ 68 #define MAXINTERP 12 69 #endif 70 71 #ifndef MAXLOGNAME 72 /** Max login name length including terminating NULL. */ 73 #define MAXLOGNAME LOGIN_NAME_MAX 74 #endif 75 76 #ifndef MAXUPRC 77 /** Maximum simultaneous processes. */ 78 #define MAXUPRC CHILD_MAX 79 #endif 80 81 #ifndef NCARGS 82 /** Max argument size for an exec function. 83 * OS2: Assuming at least 4KB of environment gives us 0xf000 at the very best. 84 * However we set it to 32KB which should be a safe max. */ 85 #define NCARGS ARG_MAX 86 #endif 87 #ifndef NGROUPS 88 /** Max supplemental group id's. 89 * OS2: doesn't make much sens just set it high. */ 90 #define NGROUPS NGROUPS_MAX 91 #endif 92 93 #ifndef NOFILE 94 /** Max number of open files per process. 95 * OS2: Using DosSetMaxFH the theoretical maximum should be 0xfff0 I believe. 96 */ 97 #define NOFILE OPEN_MAX 98 #endif 99 100 #ifndef NOGROUP 101 /** Marker for empty group set member. 102 * OS2: no meaning currently. */ 103 #define NOGROUP 0xffff 104 #endif 105 106 #ifndef MAXHOSTNAMELEN 107 /** Max number of bytes in a hostname. */ 108 #define MAXHOSTNAMELEN 256 109 #endif 110 111 #ifndef SPECNAMELEN 112 /** Max number of bytes in a devicename. 113 * OS2: no real meaning. */ 114 #define SPECNAMELEN 16 115 #endif 116 117 #ifndef MAXNAMLEN 118 /** Max number of chars in a file name. 119 * BSD name for posix NAME_MAX. */ 120 #define MAXNAMLEN NAME_MAX 121 #endif 122 123 #ifndef MAXPATHLEN 124 /** Max number of chars in a path name. 125 * BSD name for posix PATH_MAX. 126 * @remark Very strict BSD kernel/user code may expect it to be a number which 127 * is the power of two an. The OS/2 number is not a power of 2. */ 128 #define MAXPATHLEN PATH_MAX 129 #endif 130 /** @} */ 131 132 133 /** @group EMX defines 134 * @{ 135 */ 136 #ifndef HZ 137 /** Frequencey of something but have no clue of what... 138 * Freebsd isn't defining this, linux is but only for the kernel sources. 139 * Considered EMX specific. */ 15 140 #define HZ 100 16 141 #endif 142 /** @} */ 17 143 18 #if !defined (MAXNAMLEN) 19 #define MAXNAMLEN 260 144 145 /** @group Bitmap Access 146 * The bitmaps in question is arrays if integer. 147 * @{ */ 148 /** number of bytes in an int */ 149 #define NBPW sizeof(int) 150 /** Set a bit in the bitmap */ 151 #define setbit(Bitmap,iBit) ( (Bitmap)[(i)/NBBY] |= 1 << ((i) % NBBY) ) 152 /** Clear a bit in the bitmap */ 153 #define clrbit(Bitmap,iBit) ( (Bitmap)[(i)/NBBY] &= ~(1 << ((i) % NBBY)) ) 154 /** Test if a bit in a bitmap is set. */ 155 #define isset(Bitmap,iBit) ( (Bitmap)[(i)/NBBY] & (1 << ((i) % NBBY)) ) 156 /** Test if a bit in a bitmap is clear. */ 157 #define isclr(Bitmap,iBit) (((Bitmap)[(i)/NBBY] & 1 << ((i) % NBBY)) == 0 ) 158 /** @} */ 159 160 161 /* Handle flags of some kind... Toolkit defines it here. 162 * Freebsd headers indicates that these are KERNEL flags, but 163 * there is a chance one or two tcpip ioctls are using them. */ 164 #ifndef _POSIX_SOURCE 165 #define FREAD 1 166 #define FWRITE 2 20 167 #endif 21 168 22 #if !defined (MAXPATHLEN) 23 #define MAXPATHLEN 260 24 #endif 25 26 /* Don't try to do this inline for now */ 27 169 #if 0 /* we don't need it, endian takes care of this */ 170 /* Basic byte order conversion (non-inline). 171 * Note that freebsd only does this when KERNEL is defined. */ 28 172 #if !defined (htonl) 29 173 #define htonl(X) _swapl(X) … … 32 176 #define ntohs(X) _swaps(X) 33 177 #endif 34 35 178 unsigned short _swaps (unsigned short _x); 36 179 unsigned long _swapl (unsigned long _x); 180 #endif 181 37 182 38 183 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/select.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 3 3 #ifndef _SYS_SELECT_H 4 4 #define _SYS_SELECT_H 5 #define _SYS_SELECT_H_ 5 6 6 7 #if defined (__cplusplus) … … 8 9 #endif 9 10 11 #include <sys/cdefs.h> 12 13 /** Define sigset_t here for pselect(). */ 14 #if !defined (_SIGSET_T) 15 #define _SIGSET_T 16 typedef unsigned long sigset_t; 17 #endif 18 19 /** Define the number of file handles in the select buffer. 20 * @remark we might wanna bump this one up a bit... */ 10 21 #if !defined (FD_SETSIZE) 11 #define FD_SETSIZE 22 #define FD_SETSIZE 256 12 23 #elif FD_SETSIZE < 256 13 24 #error FD_SETSIZE must be at least 256 14 25 #endif 15 26 27 /** BSD thingy to figure out the size of a bitmap array. */ 28 #ifndef _howmany 29 #define _howmany(a,b) (((a) + ((b) - 1)) / (b)) 30 #endif 31 #if defined(TCPV40HDRS) && !defined(howmany) 32 #define howmany(a,b) (((a) + ((b) - 1)) / (b)) 33 #endif 34 16 35 #if !defined (_FD_SET_T) 17 36 #define _FD_SET_T 37 /** The base type for the select file descriptor bitmap. */ 38 typedef unsigned long __fd_mask; 39 /** Number of bits in a byte. */ 40 #define NBBY 8 41 /** Number of bits in a byte. */ 42 #define _NFDBITS (sizeof(__fd_mask) * 8) /* bits per mask */ 43 /** Select set. */ 44 typedef struct fd_set 45 { 46 __fd_mask __fds_bits[_howmany(FD_SETSIZE, _NFDBITS)]; 47 } fd_set; 18 48 19 typedef struct _fd_set 20 { 21 unsigned long fds_bits[(FD_SETSIZE+31) / 32]; 22 } fd_set; 49 #if defined(__BSD_VISIBLE) || defined(TCPV40HDRS) 50 typedef __fd_mask fd_mask; 51 #define fds_bits __fds_bits 52 #define NFDBITS _NFDBITS 53 #endif 23 54 24 55 #endif 25 56 26 #define FD_SET(n,s) ((s)->fds_bits[(n)/32] |= (1L << ((n) & 0x1f))) 27 #define FD_CLR(n,s) ((s)->fds_bits[(n)/32] &= ~(1L << ((n) & 0x1f))) 28 #define FD_ISSET(n,s) ((s)->fds_bits[(n)/32] & (1L << ((n) & 0x1f))) 29 #define FD_ZERO(s) (void)memset (s, 0, sizeof (*(s))) 57 #ifndef FD_SET 58 /** Set a bit in the select file descriptor bitmap. */ 59 #define FD_SET(n,s) ((s)->__fds_bits[(n)/_NFDBITS] |= (1L << ((n) & (_NFDBITS - 1)))) 60 /** Clear a bit in the select file descriptor bitmap. */ 61 #define FD_CLR(n,s) ((s)->__fds_bits[(n)/_NFDBITS] &= ~(1L << ((n) & (_NFDBITS - 1)))) 62 /** Test if a bit in the select file descriptor bitmap is set. */ 63 #define FD_ISSET(n,s) ((s)->__fds_bits[(n)/_NFDBITS] & (1L << ((n) & (_NFDBITS - 1)))) 64 /** Initialize the select file descriptor bitmap clearing all bits. */ 65 #define FD_ZERO(s) (void)memset(s, 0, sizeof(*(s))) 66 #if __BSD_VISIBLE 67 /** Copy a select file descriptor bitmap. */ 68 #define FD_COPY(src,trg) (void)(*(trg) = *(src)) 69 #endif 70 #endif /* !FD_SET */ 30 71 31 72 struct timeval; 73 int select (int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *); 74 int _select (int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *); 75 void *memset (void *, int, size_t); /* Used by FD_ZERO */ 76 #ifdef _LIBC_TODO 77 /** A slightly different select call which have better time precision and signal support. */ 78 #warning int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *); 79 #endif 32 80 33 int select (int, struct _fd_set *, struct _fd_set *, struct _fd_set *, 34 struct timeval *); 81 #ifdef TCPV40HDRS 82 /** This is the TCPIP v4.0 bsd styled select. 83 * Normally it's mapped to select(), but since we don't want any such 84 * confusion we don't. 85 * @remark The normal select() doesn't have socket capabilities int the sys style libc. 86 */ 87 int _System bsdselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *); 88 #define os2_select tcpip40_os2_select 89 #endif 90 /** This is the TCPIP OS/2 styled select. */ 91 int _System os2_select(int *, int, int, int, long); 35 92 36 int _select (int, struct _fd_set *, struct _fd_set *, struct _fd_set *, 37 struct timeval *); 38 39 void *memset (void *, int, size_t); /* Used by FD_ZERO */ 93 /* toolkit BSD pollution: */ 94 #ifndef TCPV40HDRS 95 /* 96 * Used to maintain information about processes that wish to be 97 * notified when I/O becomes possible. 98 */ 99 #pragma pack(1) 100 struct selinfo { 101 pid_t si_pid; /* process to be notified */ 102 short si_flags; /* see below */ 103 }; 104 #pragma pack() 105 #define SI_COLL 0x0001 /* collision occurred */ 106 #endif /* !TCPV40HDRS */ 40 107 41 108 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/so_ioctl.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* so_ioctl.h derived from BSD's ioctl.h by hv and em 1994,1996 2 * 3 * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. All advertising materials mentioning features or use of this software 15 * must display the following acknowledgement: 16 * This product includes software developed by the University of 17 * California, Berkeley and its contributors. 18 * 4. Neither the name of the University nor the names of its contributors 19 * may be used to endorse or promote products derived from this software 20 * without specific prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * from: @(#)ioctl.h 7.19 (Berkeley) 6/26/91 35 */ 1 /* backward compatibility */ 2 #warning sys/so_ioctl.h is outdated, use sys/ioctl.h or sys/sockio.h. 3 #include <sys/sockio.h> 36 4 37 #if !defined (_SYS_SO_IOCTL_H)38 #define _SYS_SO_IOCTL_H39 40 #define _IOC(a,b) ((a<<8)|b)41 #define _IOW(a,b,c) _IOC(a,b)42 #define _IOR(a,b,c) _IOC(a,b)43 #define _IOWR(a,b,c) _IOC(a,b)44 45 #define _TCPIP_FIONREAD _IOC('f', 127)46 #define FIONBIO _IOC('f', 126)47 #define FIOASYNC _IOC('f', 125)48 #define FIOTCPCKSUM _IOC('f', 128)49 #define FIONSTATUS _IOC('f', 120)50 #define FIONURG _IOC('f', 121)51 #define FIOBSTATUS _IOC('f', 122)52 53 /* socket i/o controls */54 #define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */55 #define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */56 #define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */57 #define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */58 #define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */59 #define SIOCSPGRP _IOW('s', 8, int) /* set process group */60 #define SIOCGPGRP _IOR('s', 9, int) /* get process group */61 #define SIOCSHOSTID _IOW('s', 10, int) /* set hostid */62 63 /*hv Netbios IOCtls excluded here - no docs about them */64 65 #define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */66 #define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */67 68 /* hv SIOMETRIC*RT excluded here - no docs about them (routing, nonportable) */69 /* hv SIOCREG* excluded here - no docs about them (routing, nonportable) */70 71 #define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */72 #define SIOCGIFADDR _IOWR('i',13, struct ifreg) /* get ifnet addres */73 #define OSIOCGIFADDR SIOCGIFADDR74 #define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */75 #define SIOCGIFDSTADDR _IOWR('i',15, struct ifreq) /* get p-p address */76 #define OSIOCGIFDSTADDR SIOCGIFDSTADDR77 #define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */78 #define SIOCGIFFLAGS _IOWR('i',17, struct ifreq) /* get ifnet flags */79 #define SIOCGIFBRDADDR _IOWR('i',18, struct ifreq) /* get broadcast addr */80 #define OSIOCGIFBRDADDR SIOCGIFBRDADDR81 #define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */82 #define SIOCGIFCONF _IOWR('i',20, struct ifreq) /* get ifnet list */83 #define OSIOCGIFCONF SIOCGIFCONF84 #define SIOCGIFNETMASK _IOWR('i',21, struct ifreq) /* get net addr mask */85 #define OSIOCGIFNETMASK SIOCGIFNETMASK86 #define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */87 #define SIOCGIFMETRIC _IOWR('i',23, struct ifreq) /* get if metric */88 #define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set if metric */89 90 #define SIOCSARP _IOW('i', 30, struct arpreq) /* set arp entry */91 #define SIOCGARP _IOWR('i',31, struct arpreq) /* get arp entry */92 #define OSIOCGARP SIOCGARP93 #define SIOCDARP _IOW('i', 32, struct arpreq) /* delete arp entry */94 95 /*hv: several SIOC* excluded - no docs, nonportable */96 97 #define SIOCADDMULTI _IOW('i', 51, struct ifreq) /* add m'cast addr */98 #define SIOCDELMULTI _IOW('i', 52, struct ifreq) /* del m'cast addr */99 #define SIOCMULTISBC _IOC('i', 61) /* use broadcast for MC */100 #define SIOCMULTISFA _IOC('i', 62) /* use functional addr for MC */101 102 /* various more ioctls (netstat, slstat, iptrace) excluded, no docs */103 104 #endif /* !defined (_SYS_SO_IOCTL_H) */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/socket.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Modified for emx by hv and em 1994-1997 2 * Modified for gcc/os2 by bird 2003 2 3 * 3 4 * Copyright (c) 1982,1985,1986,1988 Regents of the University of California. … … 39 40 #define _SYS_SOCKET_H_ 40 41 41 #if !defined (_SYS_TYPES_H) 42 #warning <sys/socket.h> requires <sys/types.h> 42 #include <machine/ansi.h> 43 #define _NO_NAMESPACE_POLLUTION 44 #include <machine/param.h> 45 #undef _NO_NAMESPACE_POLLUTION 46 47 48 /* toolkit stuff */ 43 49 #include <sys/types.h> 44 #endif45 46 50 #include <sys/uio.h> 51 #include <sys/cdefs.h> 47 52 48 53 #if defined (__cplusplus) … … 82 87 #define SO_RCV_SHUTDOWN 0x0400 /* set if shut down called for rcv */ 83 88 #define SO_SND_SHUTDOWN 0x0800 /* set if shutdown called for send */ 89 #ifndef TCPV40HDRS 90 #define SO_REUSEPORT 0x1000 /* allow local address & port reuse */ 91 #define SO_TTCP 0x2000 /* allow t/tcp on socket */ 92 #endif 84 93 85 94 /* … … 90 99 #define SO_SNDLOWAT 0x1003 /* send low-water mark */ 91 100 #define SO_RCVLOWAT 0x1004 /* receive low-water mark */ 101 #ifndef TCPV40HDRS 92 102 #define SO_SNDTIMEO 0x1005 /* send timeout */ 93 103 #define SO_RCVTIMEO 0x1006 /* receive timeout */ 104 #endif 94 105 #define SO_ERROR 0x1007 /* get error status and clear */ 95 106 #define SO_TYPE 0x1008 /* get socket type */ … … 119 130 #define AF_UNSPEC 0 /* unspecified */ 120 131 #define AF_UNIX 1 /* local to host (pipes, portals) */ 132 #ifndef TCPV40HDRS 133 #define AF_LOCAL AF_UNIX 134 #endif 135 #define AF_OS2 AF_UNIX 121 136 #define AF_INET 2 /* internetwork: UDP, TCP, etc. */ 122 137 #define AF_IMPLINK 3 /* arpanet imp addresses */ … … 124 139 #define AF_CHAOS 5 /* mit CHAOS protocols */ 125 140 #define AF_NS 6 /* XEROX NS protocols */ 141 #ifdef TCPV40HDRS 126 142 #define AF_NBS 7 /* IBM: nbs protocols */ 127 143 /* (hv: I think IBM is outdated here */ 144 #endif 128 145 #define AF_ISO 7 /* ISO protocols */ 129 146 #define AF_OSI AF_ISO … … 140 157 #define AF_NETBIOS AF_NB 141 158 142 #define AF_OS2 AF_UNIX 143 159 #ifdef TCPV40HDRS 144 160 #define AF_MAX 18 161 #else 162 #define AF_LINK 18 /* Link layer interface */ 163 #define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ 164 #define AF_COIP 20 /* connection-oriented IP, aka ST II */ 165 #define AF_CNT 21 /* Computer Network Technology */ 166 #define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ 167 #define AF_IPX 23 /* Novell Internet Protocol */ 168 #define AF_SIP 24 /* Simple Internet Protocol */ 169 #define AF_INET6 24 170 #define pseudo_AF_PIP 25 /* Help Identify PIP packets */ 171 #define AF_ROUTE 39 /* Internal Routing Protocol */ 172 #define AF_FWIP 40 /* firewall support */ 173 #define AF_IPSEC 41 /* IPSEC and encryption techniques */ 174 #define AF_DES 42 /* DES */ 175 #define AF_MD5 43 176 #define AF_CDMF 44 177 178 #define AF_MAX 45 179 #endif 180 145 181 146 182 /* … … 150 186 */ 151 187 struct sockaddr { 188 #ifdef TCPV40HDRS 152 189 u_short sa_family; /* address family */ 153 190 char sa_data[14]; /* up to 14 bytes of direct address */ 191 #else 192 u_char sa_len; /* total length */ 193 u_char sa_family; /* address family */ 194 char sa_data[14]; /* actually longer; address value */ 195 #endif 154 196 }; 155 197 … … 168 210 #define PF_UNSPEC AF_UNSPEC 169 211 #define PF_UNIX AF_UNIX 212 #ifndef TCPV40HDRS 213 #define PF_LOCAL AF_LOCAL 214 #endif 215 #define PF_OS2 AF_UNIX 170 216 #define PF_INET AF_INET 171 217 #define PF_IMPLINK AF_IMPLINK … … 173 219 #define PF_CHAOS AF_CHAOS 174 220 #define PF_NS AF_NS 221 #ifdef TCPV40HDRS 175 222 #define PF_NBS AF_NBS 223 #endif 176 224 #define PF_ISO AF_ISO 177 #define PF_OSI AF_ ISO225 #define PF_OSI AF_OSI 178 226 #define PF_ECMA AF_ECMA 179 227 #define PF_DATAKIT AF_DATAKIT … … 185 233 #define PF_HYLINK AF_HYLINK 186 234 #define PF_APPLETALK AF_APPLETALK 235 #define PF_NETBIOS AF_NB 187 236 #define PF_NB AF_NB 188 #define PF_NETBIOS AF_NB 189 #define PF_OS2 AF_UNIX 237 #ifndef TCPV40HDRS 238 #define PF_ROUTE AF_ROUTE 239 #define PF_LINK AF_LINK 240 #define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ 241 #define PF_COIP AF_COIP 242 #define PF_CNT AF_CNT 243 #define PF_SIP AF_SIP 244 #define PF_INET6 AF_INET6 245 #define PF_IPX AF_IPX /* same format as AF_NS */ 246 #define PF_RTIP pseudo_AF_FTIP /* same format as AF_INET */ 247 #define PF_PIP pseudo_AF_PIP 248 #endif /* !TCPV40HDRS */ 249 190 250 #define PF_MAX AF_MAX 191 251 252 253 #ifndef TCPV40HDRS 254 /* 255 * Definitions for network related sysctl, CTL_NET. 256 * 257 * Second level is protocol family. 258 * Third level is protocol number. 259 * 260 * Further levels are defined by the individual families below. 261 */ 262 #define NET_MAXID AF_MAX 263 264 #define CTL_NET_NAMES { \ 265 { 0, 0 }, \ 266 { "local", CTLTYPE_NODE }, \ 267 { "inet", CTLTYPE_NODE }, \ 268 { "implink", CTLTYPE_NODE }, \ 269 { "pup", CTLTYPE_NODE }, \ 270 { "chaos", CTLTYPE_NODE }, \ 271 { "xerox_ns", CTLTYPE_NODE }, \ 272 { "iso", CTLTYPE_NODE }, \ 273 { "emca", CTLTYPE_NODE }, \ 274 { "datakit", CTLTYPE_NODE }, \ 275 { "ccitt", CTLTYPE_NODE }, \ 276 { "ibm_sna", CTLTYPE_NODE }, \ 277 { "decnet", CTLTYPE_NODE }, \ 278 { "dec_dli", CTLTYPE_NODE }, \ 279 { "lat", CTLTYPE_NODE }, \ 280 { "hylink", CTLTYPE_NODE }, \ 281 { "appletalk", CTLTYPE_NODE }, \ 282 { "netbios", CTLTYPE_NODE }, \ 283 { "route", CTLTYPE_NODE }, \ 284 { "link_layer", CTLTYPE_NODE }, \ 285 { "xtp", CTLTYPE_NODE }, \ 286 { "coip", CTLTYPE_NODE }, \ 287 { "cnt", CTLTYPE_NODE }, \ 288 { "rtip", CTLTYPE_NODE }, \ 289 { "ipx", CTLTYPE_NODE }, \ 290 { "sip", CTLTYPE_NODE }, \ 291 { "pip", CTLTYPE_NODE }, \ 292 } 293 294 /* 295 * PF_ROUTE - Routing table 296 * 297 * Three additional levels are defined: 298 * Fourth: address family, 0 is wildcard 299 * Fifth: type of info, defined below 300 * Sixth: flag(s) to mask with for NET_RT_FLAGS 301 */ 302 #define NET_RT_DUMP 1 /* dump; may limit to a.f. */ 303 #define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */ 304 #define NET_RT_IFLIST 3 /* survey interface list */ 305 #define NET_RT_MAXID 4 306 307 #define CTL_NET_RT_NAMES { \ 308 { 0, 0 }, \ 309 { "dump", CTLTYPE_STRUCT }, \ 310 { "flags", CTLTYPE_STRUCT }, \ 311 { "iflist", CTLTYPE_STRUCT }, \ 312 } 313 314 #endif /* !TCPV40HDRS */ 315 316 192 317 /* 193 318 * Maximum queue length specifiable by listen. 194 319 */ 320 #ifdef TCPV40HDRS 195 321 #define SOMAXCONN 5 322 #else 323 #define SOMAXCONN 1024 324 #endif 196 325 197 326 /* … … 201 330 struct msghdr { 202 331 caddr_t msg_name; /* optional address */ 332 #ifdef TCPV40HDRS 203 333 int msg_namelen; /* size of address */ 204 334 struct iovec *msg_iov; /* scatter/gather array */ … … 206 336 caddr_t msg_accrights; /* access rights sent/received */ 207 337 int msg_accrightslen; 338 #else 339 u_int msg_namelen; /* size of address */ 340 struct iovec *msg_iov; /* scatter/gather array */ 341 u_int msg_iovlen; /* # elements in msg_iov */ 342 caddr_t msg_control; /* ancillary data, see below */ 343 u_int msg_controllen; /* ancillary data buffer len */ 344 long msg_flags; /* flags on received message */ 345 #endif 208 346 }; 209 347 … … 211 349 #define MSG_PEEK 0x2 /* peek at incoming message */ 212 350 #define MSG_DONTROUTE 0x4 /* send without using routing tables */ 213 #define MSG_EOR 0x8 /* data completes record */ 214 #define MSG_TRUNC 0x10 /* data discarded before delivery */ 215 #define MSG_CTRUNC 0x20 /* control data lost before delivery */ 216 #define MSG_WAITALL 0x40 /* wait for full request or error */ 217 351 #define MSG_FULLREAD 0x8 /* send without using routing tables */ 352 #ifndef TCPV40HDRS 353 #define MSG_EOR 0x10 /* data completes record */ 354 #define MSG_TRUNC 0x20 /* data discarded before delivery */ 355 #define MSG_CTRUNC 0x40 /* control data lost before delivery */ 356 #define MSG_WAITALL 0x80 /* wait for full request or error */ 357 #define MSG_DONTWAIT 0x100 /* this message should be nonblocking */ 358 #ifdef TTCP 359 #define MSG_EOF 0x200 360 #endif 361 #define MSG_MAPIO 0x400 /* mem mapped io */ 362 #define MSG_CLOSE 0x800 /* close connection after succesful send_file */ 363 #endif 364 365 #ifdef TCPV40HDRS 218 366 #define MSG_MAXIOVLEN 16 367 #endif 219 368 220 369 /* … … 246 395 #define SCM_RIGHTS 0x01 /* access rights (array of int) */ 247 396 248 extern int accept (int, struct sockaddr *, int *); 249 extern int bind (int, __const__ struct sockaddr *, int); 250 extern int connect (int, __const__ struct sockaddr *, int); 251 extern int gethostid (void); 252 extern int getpeername (int, struct sockaddr *, int *); 253 extern int getsockname (int, struct sockaddr *, int *); 254 extern int getsockopt (int, int, int, void *, int *); 255 extern int listen (int, int); 256 extern int recv (int, void *, int, int); 257 extern int recvfrom (int, void *, int, int, struct sockaddr *, int *); 258 extern int recvmsg (int, struct msghdr *, int); 259 extern int send (int, __const__ void *, int, int); 260 extern int sendto (int, __const__ void *, int, int, __const__ struct sockaddr *, int); 261 extern int sendmsg (int, __const__ struct msghdr *, int); 262 extern int setsockopt (int, int, int, __const__ void *, int); 263 extern int shutdown (int, int); 264 extern int socket (int, int, int); 265 extern int socketpair (int, int, int, int *); 266 267 extern int _impsockhandle (int, int); 268 269 /* special IBM prototypes 270 * hv: warning: usage of these routines may interfere with EMX operation 271 * usage is not recommended. 272 */ 273 extern void psock_errno(__const__ char*); 274 extern int soabort(int); 275 extern int soclose(int); 276 extern int sock_init(void); 277 extern int sock_errno(void); 278 extern int so_cancel(int); 279 extern int getinetversion(char*); 280 281 /* hv: these are new TCPIPV4 data structures. Consult IBM doc on that */ 282 #ifdef TCPIPV4 397 #ifndef TCPV40HDRS 398 /* 399 * 4.3 compat sockaddr, move to compat file later 400 */ 401 struct osockaddr { 402 u_short sa_family; /* address family */ 403 char sa_data[14]; /* up to 14 bytes of direct address */ 404 }; 405 406 /* 407 * 4.3-compat message header (move to compat file later). 408 */ 409 struct omsghdr { 410 caddr_t msg_name; /* optional address */ 411 int msg_namelen; /* size of address */ 412 struct iovec *msg_iov; /* scatter/gather array */ 413 int msg_iovlen; /* # elements in msg_iov */ 414 caddr_t msg_accrights; /* access rights sent/received */ 415 int msg_accrightslen; 416 }; 417 418 /* 419 * send_file parameter structure 420 */ 421 struct sf_parms { 422 void *header_data; /* ptr to header data */ 423 size_t header_length; /* size of header data */ 424 int file_handle; /* file handle to send from */ 425 size_t file_size; /* size of file */ 426 int file_offset; /* byte offset in file to send from */ 427 size_t file_bytes; /* bytes of file to be sent */ 428 void *trailer_data; /* ptr to trailer data */ 429 size_t trailer_length; /* size of trailer data */ 430 size_t bytes_sent; /* bytes sent in this send_file call */ 431 }; 432 #endif 433 434 int _System accept (int, struct sockaddr *, int *); 435 int _System bind (int, __const__ struct sockaddr *, int); 436 int _System connect (int, __const__ struct sockaddr *, int); 437 int _System gethostid (void); 438 int _System getpeername (int, struct sockaddr *, int *); 439 int _System getsockname (int, struct sockaddr *, int *); 440 int _System getsockopt (int, int, int, void *, int *); 441 int _System listen (int, int); 442 int _System recv (int, void *, int, int); 443 int _System recvfrom (int, void *, int, int, struct sockaddr *, int *); 444 int _System recvmsg (int, struct msghdr *, int); 445 int _System send (int, __const__ void *, int, int); 446 int _System sendto (int, __const__ void *, int, int, __const__ struct sockaddr *, int); 447 int _System sendmsg (int, __const__ struct msghdr *, int); 448 int _System setsockopt (int, int, int, __const__ void *, int); 449 int _System shutdown (int, int); 450 int _System socket (int, int, int); 451 int _System socketpair (int, int, int, int *); 452 453 /* EMX addition */ 454 int _impsockhandle (int, int); 455 456 #ifndef TCPV40HDRS 457 int _System accept_and_recv (long, long*, struct sockaddr *, long*, struct sockaddr*, long*, caddr_t, size_t); 458 #endif 459 460 /* OS/2 additions */ 461 void _System addsockettolist(int); 462 int _System removesocketfromlist(int); 463 #include <sys/ioccom.h> 464 #ifdef TCPV40HDRS 465 #include <sys/select.h> 466 #endif 467 int _System sock_init( void ); 468 int _System sock_errno( void ); 469 void _System psock_errno( char * ); 470 int _System soclose( int ); 471 int _System so_cancel(int); 472 int _System Raccept(int, struct sockaddr *, int *); 473 #ifdef TCPV40HDRS 474 struct sockaddr_in; 475 int _System Rbind(int, struct sockaddr_in *, int, struct sockaddr_in *); 476 #else 477 int _System Rbind(int, struct sockaddr *, int, struct sockaddr *); 478 #endif 479 int _System Rconnect(int, const struct sockaddr *, int); 480 int _System Rgetsockname(int, struct sockaddr *, int *); 481 int _System Rlisten(int, int); 482 #ifndef TCPV40HDRS 483 ssize_t _System send_file(int *, struct sf_parms *, int ); 484 char * _System sock_strerror(int); 485 int _System getinetversion(char *); 486 #endif 487 488 489 /* more OS/2 stuff. */ 490 #ifndef MAXSOCKETS 491 #define MAXSOCKETS 2048 492 #endif 493 283 494 #define MT_FREE 0 284 495 #define MT_DATA 1 … … 305 516 }; 306 517 307 #define MAXSOCKETS 2048308 518 309 519 struct sostats { 310 520 short count; 311 short socketdata[9*MAXSOCKETS]; 312 }; 313 #endif 521 #ifdef TCPV40HDRS 522 short socketdata[9*MAXSOCKETS]; 523 #else 524 short socketdata[13*MAXSOCKETS]; 525 #endif 526 }; 314 527 315 528 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/sockio.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* Copyright (c)1996 by Holger Veit 2 * May be freely used with EMX 1 /*- Modified for gcc/os2 by bird 2003 2 * 3 * Copyright (c) 1982, 1986, 1990, 1993, 1994 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. All advertising materials mentioning features or use of this software 15 * must display the following acknowledgement: 16 * This product includes software developed by the University of 17 * California, Berkeley and its contributors. 18 * 4. Neither the name of the University nor the names of its contributors 19 * may be used to endorse or promote products derived from this software 20 * without specific prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)sockio.h 8.1 (Berkeley) 3/28/94 35 * $FreeBSD: src/sys/sys/sockio.h,v 1.14.2.6 2002/02/07 15:12:37 ambrisko Exp $ 3 36 */ 4 37 5 /* BSD uses this to declare some more ioctls */ 6 7 #ifndef _SYS_SOCKIO_H_ 8 #define _SYS_SOCKIO_H_ 9 10 #include <sys/so_ioctl.h> 38 #ifndef _SYS_SOCKIO_H_ 39 #define _SYS_SOCKIO_H_ 40 41 #include <sys/ioccom.h> 42 #include "ioccom.h" 43 44 /* Socket ioctl's. */ 45 #ifdef TCPV40HDRS 46 #define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */ 47 #define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */ 48 #define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */ 49 #define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */ 50 #endif /* TCPV40HDRS */ 51 #define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */ 52 #define SIOCSPGRP _IOW('s', 8, int) /* set process group */ 53 #define SIOCGPGRP _IOR('s', 9, int) /* get process group */ 54 55 #define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */ 56 #define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */ 57 #if 0 /* not on OS/2 */ 58 #define SIOCGETVIFCNT _IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */ 59 #define SIOCGETSGCNT _IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */ 60 #endif 61 62 #define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */ 63 #define OSIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */ 64 #ifdef TCPV40HDRS 65 #define SIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */ 66 #else 67 #define SIOCGIFADDR _IOWR('i', 33, struct ifreq) /* get ifnet address */ 68 #endif /* TCPV40HDRS */ 69 #define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */ 70 #define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */ 71 #ifdef TCPV40HDRS 72 #define SIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */ 73 #else 74 #define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq) /* get p-p address */ 75 #endif /* TCPV40HDRS */ 76 #define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */ 77 #define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq) /* get ifnet flags */ 78 #define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq) /* get broadcast addr */ 79 #ifdef TCPV40HDRS 80 #define SIOCGIFBRDADDR _IOWR('i', 18, struct ifreq) /* get broadcast addr */ 81 #else 82 #define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq) /* get broadcast addr */ 83 #endif /* TCPV40HDRS */ 84 #define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */ 85 #define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */ 86 #ifdef TCPV40HDRS 87 #define SIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */ 88 #else 89 #define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */ 90 #endif /* TCPV40HDRS */ 91 #define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */ 92 #ifdef TCPV40HDRS 93 #define SIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */ 94 #else 95 #define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */ 96 #endif /* TCPV40HDRS */ 97 #define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */ 98 #define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */ 99 #define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */ 100 101 #if 1 /* different on OS/2 */ 102 #define SIOCDIFADDR _IOW('i', 64, struct ifreq) /* delete IF addr */ 103 #define SIOCAIFADDR _IOW('i', 63, struct ifaliasreq)/* add/chg IF alias */ 104 #else /*!OS2:*/ 105 #define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */ 106 #define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */ 107 #endif 108 109 #if 0 /* not on OS/2 */ 110 #define SIOCALIFADDR _IOW('i', 27, struct if_laddrreq) /* add IF addr */ 111 #define SIOCGLIFADDR _IOWR('i', 28, struct if_laddrreq) /* get IF addr */ 112 #define SIOCDLIFADDR _IOW('i', 29, struct if_laddrreq) /* delete IF addr */ 113 #define SIOCSIFCAP _IOW('i', 30, struct ifreq) /* set IF features */ 114 #define SIOCGIFCAP _IOWR('i', 31, struct ifreq) /* get IF features */ 115 #endif /*!OS2*/ 116 117 #if 1 /* different on OS/2 */ 118 #define SIOCADDMULTI _IOW('i', 51, struct ifreq) /* add m'cast addr */ 119 #define SIOCDELMULTI _IOW('i', 52, struct ifreq) /* del m'cast addr */ 120 #else /* !OS2: */ 121 #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */ 122 #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */ 123 #endif 124 125 #if 1 /* different on OS/2 */ 126 #define SIOCGIFMTU _IOR('i', 57, struct ifreq) /* get IF mtu */ 127 #define SIOCSIFMTU _IOW('i', 45, struct ifreq) /* set IF mtu */ 128 #else 129 #define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */ 130 #define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */ 131 #endif 132 #if 0 /* not on OS/2 */ 133 #define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */ 134 #define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */ 135 #define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq) /* set net media */ 136 #define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq) /* get net media */ 137 138 #define SIOCSIFPHYADDR _IOW('i', 70, struct ifaliasreq) /* set gif addres */ 139 #define SIOCGIFPSRCADDR _IOWR('i', 71, struct ifreq) /* get gif psrc addr */ 140 #define SIOCGIFPDSTADDR _IOWR('i', 72, struct ifreq) /* get gif pdst addr */ 141 #define SIOCDIFPHYADDR _IOW('i', 73, struct ifreq) /* delete gif addrs */ 142 #define SIOCSLIFPHYADDR _IOW('i', 74, struct if_laddrreq) /* set gif addrs */ 143 #define SIOCGLIFPHYADDR _IOWR('i', 75, struct if_laddrreq) /* get gif addrs */ 144 145 #define SIOCSIFGENERIC _IOW('i', 57, struct ifreq) /* generic IF set op */ 146 #define SIOCGIFGENERIC _IOWR('i', 58, struct ifreq) /* generic IF get op */ 147 148 #define SIOCGIFSTATUS _IOWR('i', 59, struct ifstat) /* get IF status */ 149 #define SIOCSIFLLADDR _IOW('i', 60, struct ifreq) /* set linklevel addr */ 150 151 #define SIOCGPRIVATE_0 _IOWR('i', 80, struct ifreq) /* Linux Private + 0 */ 152 #define SIOCGPRIVATE_1 _IOWR('i', 81, struct ifreq) /* Linux Private + 1 */ 153 154 #define SIOCIFCREATE _IOWR('i', 122, struct ifreq) /* create clone if */ 155 #define SIOCIFDESTROY _IOW('i', 121, struct ifreq) /* destroy clone if */ 156 #define SIOCIFGCLONERS _IOWR('i', 120, struct if_clonereq) /* get cloners */ 157 #endif /*!OS2*/ 158 159 /* OS2 specific ioctls */ 160 #define SIOCSHOSTID _IOW('s', 10, long) 161 #define SIOCGNBNAME _IOR('s', 11, long) /* AFNB code. Not clear now */ 162 #define SIOCSNBNAME _IOW('s', 12, long) /* AFNB */ 163 #define SIOCGNCBFN _IOR('s', 13, long) /* AFNB */ 164 #ifndef TCPV40HDRS 165 #define SIOCSSYN _IOW('s', 14, long) /* SYN Attack */ 166 #endif /* !TCPV40HDRS */ 167 #define SIOCSIFBRD _IOW('i', 27, int) /* SINGLE-rt bcst. using old # for bkw cmpt */ 168 #ifdef TCPV40HDRS 169 #define SIOCSIFALLRTB ioc('i', 63) /* added to configure all-route broadcst */ 170 #else 171 #define SIOCSIFALLRTB _IOW('i', 65, struct ifreq) /* added to configure all-route broadcst */ 172 #endif /* TCPV40HDRS */ 173 174 #define SIOCSARP _IOW('i', 30, struct arpreq)/* set ARP entry */ 175 #define SIOCGARP _IOR('i', 31, struct arpreq) 176 #define SIOCDARP _IOW('i', 32, struct arpreq) 177 178 #define SIOCSIF802_3 _IOW('i', 40, struct ifreq) 179 #define SIOCSIFNO802_3 _IOW('i', 41, struct ifreq) 180 #define SIOCSIFNOREDIR _IOW('i', 42, struct ifreq) 181 #define SIOCSIFYESREDIR _IOW('i', 43, struct ifreq) 182 183 #define SIOCSIFFDDI _IOW('i', 46, struct ifreq) 184 #define SIOCSIFNOFDDI _IOW('i', 47, struct ifreq) 185 #define SIOCSRDBRD _IOW('i', 48, struct ifreq) 186 187 #define SIOCGARP_TR _IOR('i', 50, struct arpreq_tr) 188 #define SIOCSARP_TR _IOW('i', 49, struct arpreq_tr) 189 190 #if defined(SLBOOTP) || defined(INCL_TCPIP_ALLIOCTLS) 191 /** Used to retreive unit number on serial interface. */ 192 #define SIOCGUNIT _IOR('i', 70, struct ifreq) 193 #endif 194 195 /** To check if the interface is Valid or not */ 196 #define SIOCGIFVALID _IOR('i', 75, struct ifreq) 197 /** Ioctl to return bound/shld bind ifs */ 198 struct bndreq { short bindings; short bound; }; 199 #define SIOCGIFBOUND _IOR('i', 76, struct bndreq) 200 201 /** Get multicast gp. info for an interface ret list of m-cast addrs for an if */ 202 #define SIOCGMCAST _IOR('i', 81, struct addrreq) 203 #define SIOCMULTISBC _IOW('i', 61, struct ifreq) /* use broadcast to send IP multicast*/ 204 #define SIOCMULTISFA _IOW('i', 62, struct ifreq) /* use functional addr to send IP multicast*/ 205 206 #ifndef TCPV40HDRS 207 /** block until intf change to running state */ 208 #define SIOCSIFRUNNINGBLK _IOW('i', 77, struct ifreq) 209 #endif 210 211 /* Interface Tracing Support */ 212 #define SIOCGIFEFLAGS _IOR('i', 150, struct ifreq) 213 #define SIOCSIFEFLAGS _IOW('i', 151, struct ifreq) 214 #define SIOCGIFTRACE _IOR('i', 152, struct ifreq) 215 #define SIOCSIFTRACE _IOW('i', 153, struct ifreq) 216 217 /* SLIP STATS */ 218 #define SIOCSSTAT _IOW('i', 154, struct ifreq) 219 #define SIOCGSTAT _IOR('i', 155, struct ifreq) 220 221 #ifndef TCPV40HDRS 222 #define SIOCSMSL _IOW('t', 1, long) /* set the msl in seconds */ 223 #define SIOCGMSL _IOR('t', 2, long) /* get the msl in seconds */ 224 #endif 225 226 /* NETSTAT stuff */ 227 #define SIOSTATMBUF _IOR('n', 40, struct mbstat) 228 #define SIOSTATTCP _IOR('n', 41, struct tcpstat) 229 #define SIOSTATUDP _IOR('n', 42, struct udpstat) 230 #define SIOSTATIP _IOR('n', 43, struct ipstat) 231 #define SIOSTATSO _IOR('n', 44, char /*struct sockaddr*/) 232 #ifndef TCPV40HDRS 233 #define SIOSTATTCPZ _IOR('n', 241, struct tcpstat) 234 #define SIOSTATUDPZ _IOR('n', 242, struct udpstat) 235 #define SIOSTATIPZ _IOR('n', 243, struct ipstat) 236 #endif 237 238 #define SIOSTATRT _IOR('n', 45, char /*struct rtentries*/) 239 #define SIOFLUSHRT _IOW('n', 46, long) /* Backward compatibility */ 240 #define SIOSTATICMP _IOR('n', 47, struct icmpstat) 241 #ifndef TCPV40HDRS 242 #define SIOSTATICMPZ _IOR('n', 247, struct icmpstat) 243 #endif 244 #define SIOSTATIF _IOR('n', 48, char /*struct ifmib*/) 245 #define SIOSTATAT _IOR('n', 49, char /*struct statatreq*/) 246 #define SIOSTATARP _IOR('n', 50, char /*struct oarptab*/) 247 #define SIOSTATIF42 _IOR('n', 51, char /*struct ifmib*/) 248 #define SIOSTATCNTRT _IOR('n', 52, int) 249 #define SIOSTATCNTAT _IOR('n', 53, int) 250 251 #ifndef TCPV40HDRS 252 #define SIOSTATIGMP _IOR('n', 54, struct igmpstat) /* SNMP stuff */ 253 #define SIOFLUSHRTIFP _IOW('n', 55, long) /* delete routes on an interface */ 254 #define SIOSTATIGMPZ _IOR('n', 254, struct igmpstat) /* SNMP stuff */ 255 256 /** adding this ioctl() to be able to send arp request using an ioctl() */ 257 #define SIOCARP _IOR('i', 156, int) 258 #endif /* !TCPV40HDRS */ 259 260 #if defined(TCPV40HDRS) || defined(INCL_TCPIP_ALLIOCTLS) 261 #define SIOMETRIC1RT ioc('r', 12) 262 #define SIOMETRIC2RT ioc('r', 13) 263 #define SIOMETRIC3RT ioc('r', 14) 264 #define SIOMETRIC4RT ioc('r', 15) 265 #define SIOCREGADDNET ioc('r', 12) 266 #define SIOCREGDELNET ioc('r', 13) 267 #define SIOCREGROUTES ioc('r', 14) 268 #define SIOCFLUSHROUTES ioc('r', 15) 269 #define SIOCSIFSETSIG ioc('i', 25) 270 #define SIOCSIFCLRSIG ioc('i', 26) 271 #define SIOCGIFLOAD ioc('i', 27) 272 #define SIOCSIFFILTERSRC ioc('i', 28) 273 #define SIOCGIFFILTERSRC ioc('i',29) 274 #define SIOCSIFSNMPSIG ioc('i', 33) 275 #define SIOCSIFSNMPCLR ioc('i', 34) 276 #define SIOCSIFSNMPCRC ioc('i', 35) 277 #define SIOCSIFPRIORITY ioc('i', 36) 278 #define SIOCGIFPRIORITY ioc('i', 37) 279 #define SIOCSIFFILTERDST ioc('i', 38) 280 #define SIOCGIFFILTERDST ioc('i',39) 281 #define SIOCSIFSPIPE ioc('i',71) /* used to set pipe size on interface */ 282 /* this is used as tcp send buffer size */ 283 #define SIOCSIFRPIPE ioc('i',72) /* used to set pipe size on interface */ 284 /* this is used as tcp recv buffer size */ 285 #define SIOCSIFTCPSEG ioc('i',73) /* set the TCP segment size on interface*/ 286 #define SIOCSIFUSE576 ioc('i',74) /* enable/disable the automatic change of mss to 576 */ 287 /* if going through a router */ 288 #endif /* TCPV40HDRS || ALL */ 11 289 12 290 #endif /* !_SYS_SOCKIO_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/syslimits.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 57 57 #ifndef NGROUPS_MAX 58 58 /** Max supplemental group id's. 59 * OS2: doesn't make much sens just set it high. */60 #define NGROUPS_MAX 25659 * OS2: doesn't make much sense. Redefined in limits.h btw. */ 60 #define NGROUPS_MAX 0 61 61 #endif 62 62 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/time.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* sys/time.h (emx+gcc) */ 1 /* - modified for gcc/os2 by bird 2003 2 * 3 * Copyright (c) 1982, 1986, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. All advertising materials mentioning features or use of this software 15 * must display the following acknowledgement: 16 * This product includes software developed by the University of 17 * California, Berkeley and its contributors. 18 * 4. Neither the name of the University nor the names of its contributors 19 * may be used to endorse or promote products derived from this software 20 * without specific prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)time.h 8.5 (Berkeley) 5/4/95 35 */ 2 36 3 #ifndef _SYS_TIME_H 4 #define _SYS_TIME_H 37 #ifndef _SYS_TIME_H_ 38 #define _SYS_TIME_H_ 5 39 6 40 #include <time.h> 41 #include <sys/types.h> 7 42 8 43 #if defined (__cplusplus) … … 12 47 #if !defined (_TIMEVAL) 13 48 #define _TIMEVAL 49 /** gettimeofday return structure */ 14 50 struct timeval 15 51 { 52 /** seconds */ 16 53 long tv_sec; 54 /** and microseconds */ 17 55 long tv_usec; 18 56 }; … … 21 59 #if !defined (_TIMEZONE) 22 60 #define _TIMEZONE 61 /** Timezone information */ 23 62 struct timezone 24 63 { 64 /** minutes west of Greenwich */ 25 65 int tz_minuteswest; 66 /** type of dst correction. */ 26 67 int tz_dsttime; 27 68 }; 28 69 #endif 29 70 30 int utimes (__const__ char *, __const__ struct timeval *); 31 int gettimeofday (struct timeval *, struct timezone *); 32 int settimeofday (__const__ struct timeval *, __const__ struct timezone *); 71 #if !defined(TCPV40HDRS) && !defined(DST_NONE) 72 #define DST_NONE 0 /* not on dst */ 73 #define DST_USA 1 /* USA style dst. */ 74 #define DST_AUST 2 /* Australian style dst. */ 75 #define DST_WET 3 /* Western European dst. */ 76 #define DST_MET 4 /* Middle European dst. */ 77 #define DST_EET 5 /* Eastern European dst. */ 78 #define DST_CAN 6 /* Canada. */ 79 #endif /* !TCPV40HDRS */ 80 81 #ifndef TCPV40HDRS 82 #pragma pack(4) 83 /** POSIX.4 version of timeval. */ 84 struct timespec { 85 time_t ts_sec; /* seconds */ 86 long ts_nsec; /* and nanoseconds */ 87 }; 88 #pragma pack() 89 #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ 90 (ts)->ts_sec = (tv)->tv_sec; \ 91 (ts)->ts_nsec = (tv)->tv_usec * 1000; \ 92 } 93 #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ 94 (tv)->tv_sec = (ts)->ts_sec; \ 95 (tv)->tv_usec = (ts)->ts_nsec / 1000; \ 96 } 97 98 /* Operations on timevals. */ 99 #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) 100 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 101 #ifndef timercmp 102 #define timercmp(tvp, uvp, cmp) \ 103 (((tvp)->tv_sec == (uvp)->tv_sec) ? \ 104 ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ 105 ((tvp)->tv_sec cmp (uvp)->tv_sec)) 106 #endif 107 #ifndef timeradd 108 #define timeradd(tvp, uvp, vvp) \ 109 do { \ 110 (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ 111 (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ 112 if ((vvp)->tv_usec >= 1000000) { \ 113 (vvp)->tv_sec++; \ 114 (vvp)->tv_usec -= 1000000; \ 115 } \ 116 } while (0) 117 #endif 118 #ifdef timersub 119 #define timersub(tvp, uvp, vvp) \ 120 do { \ 121 (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ 122 (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ 123 if ((vvp)->tv_usec < 0) { \ 124 (vvp)->tv_sec--; \ 125 (vvp)->tv_usec += 1000000; \ 126 } \ 127 } while (0) 128 #endif 129 130 /* 131 * Getkerninfo clock information structure 132 */ 133 struct clockinfo { 134 int hz; /* clock frequency */ 135 int tick; /* micro-seconds per hz tick */ 136 int stathz; /* statistics clock frequency */ 137 int profhz; /* profiling clock frequency */ 138 }; 139 140 /* 141 * Names of the interval timers, and structure 142 * defining a timer setting. 143 */ 144 #define ITIMER_REAL 0 145 #define ITIMER_VIRTUAL 1 146 #define ITIMER_PROF 2 147 #endif /* !TCPV40HDRS */ 148 149 #pragma pack(4) 150 struct itimerval { 151 struct timeval it_interval; /* timer interval */ 152 struct timeval it_value; /* current value */ 153 }; 154 #pragma pack() 33 155 34 156 35 int _utimes (__const__ char *, __const__ struct timeval *); 36 int _gettimeofday (struct timeval *, struct timezone *); 37 int _settimeofday (__const__ struct timeval *, __const__ struct timezone *); 157 #if defined(TCPV40HDRS) || !defined(_POSIX_SOURCE) 158 int _System utimes (__const__ char *, __const__ struct timeval *); 159 int _System gettimeofday (struct timeval *, struct timezone *); 160 int _System settimeofday (__const__ struct timeval *, __const__ struct timezone *); 161 #ifndef TCPV40HDRS 162 #include <sys/cdefs.h> 163 int _System adjtime(const struct timeval *, struct timeval *); 164 int _System getitimer(int, struct itimerval *); 165 int _System setitimer(int, const struct itimerval *, struct itimerval *); 166 #endif 167 #endif /* TCPV40HDRS */ 168 38 169 39 170 #if defined (__cplusplus) … … 41 172 #endif 42 173 43 #endif /* not _SYS_TIME_H */174 #endif /* not _SYS_TIME_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/types.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r182 r183 4 4 #define _SYS_TYPES_H 5 5 6 /* freebsd/toolkit compatibility */ 7 #include <sys/cdefs.h> 8 #include <sys/inttypes.h> /* includes machine/ansi.h */ 9 #include <machine/types.h> 10 6 11 #if !defined (_SIZE_T) 7 12 #define _SIZE_T 8 13 typedef unsigned long size_t; 14 #undef _BSD_SIZE_T_ 9 15 #endif 10 16 … … 12 18 #define _SSIZE_T 13 19 typedef int ssize_t; 20 #undef _BSD_SSIZE_T_ 14 21 #endif 15 22 … … 17 24 #define _TIME_T 18 25 typedef unsigned long time_t; 26 #undef _BSD_TIME_T_ 19 27 #endif 20 28 … … 22 30 #define _INO_T 23 31 typedef int ino_t; 32 #undef _BSD_INO_T_ 24 33 #endif 25 34 … … 27 36 #define _DEV_T 28 37 typedef int dev_t; 38 #undef _BSD_DEV_T_ 29 39 #endif 30 40 … … 32 42 #define _OFF_T 33 43 typedef long off_t; 44 #undef _BSD_OFF_T_ 34 45 #endif 35 46 … … 37 48 #define _MODE_T 38 49 typedef int mode_t; 50 #undef _BSD_MODE_T_ 39 51 #endif 40 52 … … 42 54 #define _NLINK_T 43 55 typedef int nlink_t; 56 #undef _BSD_NLINK_T_ 44 57 #endif 45 58 … … 47 60 #define _UID_T 48 61 typedef int uid_t; 62 #undef _BSD_UID_T_ 49 63 #endif 50 64 … … 52 66 #define _PID_T 53 67 typedef int pid_t; 68 #undef _BSD_PID_T_ 54 69 #endif 55 70 … … 57 72 #define _GID_T 58 73 typedef int gid_t; 74 #undef _BSD_GID_T_ 59 75 #endif 60 76 … … 62 78 63 79 #if !defined (FD_SETSIZE) 64 #define FD_SETSIZE 256 65 #else 66 #if FD_SETSIZE < 256 67 #error FD_SETSIZE must be at least 256 80 #define FD_SETSIZE 256 81 #elif FD_SETSIZE < 256 82 #error FD_SETSIZE must be at least 256 68 83 #endif 84 85 #ifndef _howmany 86 #define _howmany(a,b) (((a) + ((b) - 1)) / (b)) 87 #endif 88 #if defined(TCPV40HDRS) && !defined(howmany) 89 #define howmany(a,b) (((a) + ((b) - 1)) / (b)) 69 90 #endif 70 91 71 92 #if !defined (_FD_SET_T) 72 93 #define _FD_SET_T 94 /** The base type for the select file descriptor bitmap. */ 95 typedef unsigned long __fd_mask; 96 /** Number of bits in a byte. */ 97 #define NBBY 8 98 /** Number of bits in a byte. */ 99 #define _NFDBITS (sizeof(__fd_mask) * 8) /* bits per mask */ 100 /** Select set. */ 101 typedef struct fd_set 102 { 103 __fd_mask __fds_bits[_howmany(FD_SETSIZE, _NFDBITS)]; 104 } fd_set; 73 105 74 typedef struct _fd_set 75 { 76 unsigned long fds_bits[(FD_SETSIZE+31) / 32]; 77 } fd_set; 106 #if defined(__BSD_VISIBLE) || defined(TCPV40HDRS) 107 typedef __fd_mask fd_mask; 108 #define fds_bits __fds_bits 109 #define NFDBITS _NFDBITS 110 #endif 78 111 79 112 #endif 80 113 81 #define FD_SET(n,s) ((s)->fds_bits[(n)/32] |= (1L << ((n) & 0x1f))) 82 #define FD_CLR(n,s) ((s)->fds_bits[(n)/32] &= ~(1L << ((n) & 0x1f))) 83 #define FD_ISSET(n,s) ((s)->fds_bits[(n)/32] & (1L << ((n) & 0x1f))) 84 #define FD_ZERO(s) (void)memset (s, 0, sizeof (*(s))) 114 #ifndef FD_SET 115 /** Set a bit in the select file descriptor bitmap. */ 116 #define FD_SET(n,s) ((s)->__fds_bits[(n)/_NFDBITS] |= (1L << ((n) & (_NFDBITS - 1)))) 117 /** Clear a bit in the select file descriptor bitmap. */ 118 #define FD_CLR(n,s) ((s)->__fds_bits[(n)/_NFDBITS] &= ~(1L << ((n) & (_NFDBITS - 1)))) 119 /** Test if a bit in the select file descriptor bitmap is set. */ 120 #define FD_ISSET(n,s) ((s)->__fds_bits[(n)/_NFDBITS] & (1L << ((n) & (_NFDBITS - 1)))) 121 /** Initialize the select file descriptor bitmap clearing all bits. */ 122 #define FD_ZERO(s) (void)memset(s, 0, sizeof(*(s))) 123 #if __BSD_VISIBLE 124 /** Copy a select file descriptor bitmap. */ 125 #define FD_COPY(src,trg) (void)(*(trg) = *(src)) 126 #endif 127 #endif /* !FD_SET */ 85 128 86 #endif 129 #endif /* !_POSIX_SOURCE */ 87 130 88 131 #if !defined (_POSIX_SOURCE) … … 94 137 typedef char *caddr_t; 95 138 139 /* toolkit pollution */ 140 #ifdef __32BIT__ 141 typedef int long_int; /* 32-bit compilers */ 142 #else 143 typedef long int long_int; /* 16-bit compilers */ 96 144 #endif 97 145 146 #endif /* not _POSIX_SOURCE */ 147 148 typedef __uint8_t u_int8_t; 149 typedef __uint16_t u_int16_t; 150 typedef __uint32_t u_int32_t; 151 typedef __uint64_t u_int64_t; 152 98 153 #endif /* not _SYS_TYPES_H */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/uio.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 3 3 #ifndef _SYS_UIO_H 4 4 #define _SYS_UIO_H 5 #define _SYS_UIO_H_ /*toolkit pollution*/ 5 6 6 7 #if defined (__cplusplus) … … 11 12 { 12 13 caddr_t iov_base; 14 #if defined(__32BIT__) && !defined(TCPV40HDRS) 15 size_t iov_len; 16 #else 13 17 int iov_len; 18 #endif 14 19 }; 15 20 21 16 22 /* needed for sys\socket.h TCPIPV4 now */ 17 #ifdef TCP IPV423 #ifdef TCPV40HDRS 18 24 struct uio { 19 25 struct iovec *uio_iov; … … 23 29 unsigned int uio_resid; 24 30 }; 25 enum uio_rw { UIO_READ, UIO_WRITE }; 31 #ifndef FREAD 26 32 #define FREAD 1 27 33 #define FWRITE 2 28 34 #endif 35 #endif 29 36 30 int readv (int, __const__ struct iovec *, int); 31 int writev (int, __const__ struct iovec *, int); 37 enum uio_rw { UIO_READ, UIO_WRITE }; 32 38 33 int _readv (int, __const__ struct iovec *, int); 34 int _writev (int, __const__ struct iovec *, int); 39 #ifndef TCPV40HDRS 40 /* Segment flag values. */ 41 enum uio_seg { 42 UIO_USERSPACE, /* from user data space */ 43 UIO_SYSSPACE, /* from system space */ 44 UIO_USERISPACE /* from user I space */ 45 }; 46 #endif 47 48 int _System readv (int, __const__ struct iovec *, int); 49 int _System writev (int, __const__ struct iovec *, int); 35 50 36 51 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/un.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 1 /* Copyright (c)1996 by Holger Veit 2 * May be freely used with EMX 2 * May be freely used with EMX 3 * Modified 2003 by bird 3 4 */ 4 5 … … 6 7 #define _SYS_UN_H_ 7 8 9 /** Definitions for UNIX IPC domain. */ 8 10 struct sockaddr_un { 11 #ifdef TCPV40HDRS 9 12 u_short sun_family; /* socket family: AF_UNIX */ 13 #else 14 u_char sun_len; /* sockaddr len including null */ 15 u_char sun_family; /* AF_UNIX */ 16 #endif 10 17 char sun_path[108]; /* path name (not used) */ 11 18 }; 12 19 20 #ifndef TCPV40HDRS 21 /* actual length of an initialized sockaddr_un */ 22 #define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) 23 #endif 24 13 25 #endif /* !_SYS_UN_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/unistd.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r182 r183 3 3 #ifndef _UNISTD_H 4 4 #define _UNISTD_H 5 #define _UNISTD_H_ /* toolkit compatibility */ 5 6 6 7 #if defined (__cplusplus) … … 221 222 #endif 222 223 224 /* Toolkit compatibility */ 225 #include <sys/cdefs.h> 226 #include <sys/types.h> 227 int _System soclose (int); 228 229 #ifndef _POSIX_SOURCE 230 int _System gethostid (void); 231 int _System gethostname (char *, int); 232 int _System iruserok (unsigned long, int, const char *, const char *); 233 int _System rcmd (char **, int, const char *, const char *, const char *, int *); 234 int _System rresvport (int *); 235 int _System ruserok (const char *, int, const char *, const char *); 236 #include <sys/select.h> 237 #endif /* !_POSIX_SOURCE */ 238 223 239 224 240 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.