Changeset 183 for trunk/src/emx/include/arpa
- Timestamp:
- May 19, 2003, 4:41:00 AM (22 years ago)
- Location:
- trunk/src/emx/include/arpa
- Files:
-
- 4 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
Note:
See TracChangeset
for help on using the changeset viewer.