Ignore:
Timestamp:
May 19, 2003, 4:41:00 AM (23 years ago)
Author:
bird
Message:

#434: Initial tcpip header merges.

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 to 1.2
    r182 r183  
    1 /*
     1/* Modified for gcc by bird 2003
     2 *
    23 * Copyright (c) 1983, 1989 Regents of the University of California.
    34 * All rights reserved.
     
    3637#ifndef _FTP_H_
    3738#define _FTP_H_
     39
    3840
    3941/* Definitions for FTP; see RFC-765. */
  • trunk/src/emx/include/arpa/inet.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv and em 1994
     2
    23 *
    34 * Copyright (c) 1983 Regents of the University of California.
     
    4445
    4546/* 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>
     52int             _System inet_aton (const char *, struct in_addr *);
     53char *          _System inet_neta (u_long, char *, size_t);
     54char *          _System inet_net_ntop (int, const void *, int, char *, size_t);
     55int             _System inet_net_pton (int, const char *, void *, size_t);
     56int             _System inet_pton (int af, const char *src, void *dst);
     57const char *    _System inet_ntop (int af, const void *src, char *dst, size_t s);
     58u_int           _System inet_nsap_addr (const char *, u_char *, int maxlen);
     59char *          _System inet_nsap_ntoa (int, const u_char *, char *ascii);
     60#endif
     61
     62extern u_long   _System inet_addr(__const__ char*);
     63extern u_long   _System inet_lnaof(struct in_addr);
     64extern struct in_addr _System inet_makeaddr(u_long, u_long);
     65extern u_long   _System inet_netof(struct in_addr);
     66extern u_long   _System inet_network(__const__ char*);
     67extern char*    _System inet_ntoa(struct in_addr);
    5268
    5369#if defined (__cplusplus)
  • trunk/src/emx/include/arpa/nameser.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv 1994,1996
     2
    23 *
    34 * Copyright (c) 1983, 1989 Regents of the University of California.
     
    4546#include <sys/param.h>          /* htons() etc. */
    4647#include <machine/endian.h>     /* BYTE ORDER etc. */
     48
     49
     50
     51
    4752
    4853/*
     
    5055 */
    5156#define PACKETSZ        512             /* maximum packet size */
     57
    5258#define MAXDNAME        256             /* maximum domain name */
     59
     60
     61
    5362#define MAXCDNAME       255             /* maximum compressed domain name */
    5463#define MAXLABEL        63              /* maximum length of domain label */
     
    5766        /* number of bytes of fixed size data in resource record */
    5867#define RRFIXEDSZ       10
     68
     69
     70
     71
     72
     73
     74
     75
    5976
    6077/*
     
    6885#define QUERY           0x0             /* standard query */
    6986#define IQUERY          0x1             /* inverse query */
     87
     88
     89
     90
    7091#define STATUS          0x2             /* nameserver status query */
    7192/*#define xxx           0x3                0x3 reserved */
    7293        /* non standard */
     94
    7395/* IBM has changed these codes in TCP/IP for OS/2 */
    7496#define UPDATEA         100             /* add resource record */
     
    7799#define ZONEINIT        103             /* initial zone transfer */
    78100#define ZONEREF         104             /* incremental zone referesh */
     101
     102
     103
    79104
    80105/*
     
    88113#define REFUSED         5               /* query refused */
    89114        /* non standard */
     115
    90116#define NOCHANGE        100             /* update failed to change db */
     117
    91118
    92119/*
     
    108135#define T_MINFO         14              /* mailbox information */
    109136#define T_MX            15              /* mail routing information */
     137
    110138#define T_TXT           16              /* text strings */
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
    111159        /* non standard */
    112160#define T_UINFO         100             /* user (finger) information */
    113161#define T_UID           101             /* user ID */
    114162#define T_GID           102             /* group ID */
     163
    115164#define T_UNSPEC        103             /* Unspecified format (binary data) */
     165
    116166        /* Query type values which do not appear in resource records */
     167
     168
     169
    117170#define T_AXFR          252             /* transfer zone of authority */
    118171#define T_MAILB         253             /* transfer mailbox records */
     
    125178#define C_IN            1               /* the arpa internet */
    126179#define C_CHAOS         3               /* for chaos net at MIT */
     180
    127181#define C_HS            4               /* for Hesiod name server at MIT */
     182
    128183        /* Query class values which do not appear in resource records */
    129184#define C_ANY           255             /* wildcard match */
    130185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
    131229/*
    132230 * Status return codes for T_UNSPEC conversion routines
     
    137235#define CONV_BADCKSUM -3
    138236#define CONV_BADBUFLEN -4
     237
    139238
    140239/*
    141240 * 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
    144243 * significant first.  This requires a somewhat confusing rearrangement.
    145244 */
     245
     246
     247
    146248typedef struct {
    147249        u_short id;             /* query identification number */
     
    155257                        /* fields in fourth byte */
    156258        u_char  ra:1;           /* recursion available */
     259
    157260        u_char  pr:1;           /* primary server required (non standard) */
    158261        u_char  unused:2;       /* unused bits */
     262
     263
     264
     265
     266
    159267        u_char  rcode:4;        /* response code */
    160268#endif
     
    168276                        /* fields in fourth byte */
    169277        u_char  rcode:4;        /* response code */
     278
    170279        u_char  unused:2;       /* unused bits */
    171280        u_char  pr:1;           /* primary server required (non standard) */
     281
     282
     283
     284
     285
    172286        u_char  ra:1;           /* recursion available */
    173287#endif
     
    178292        u_short arcount;        /* number of resource entries */
    179293} HEADER;
     294
     295
     296
    180297
    181298/*
     
    184301#define INDIR_MASK      0xc0
    185302
     303
    186304/*
    187305 * Structure for passing resource records around.
     
    197315};
    198316#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.
    205325 */
    206326#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; \
    209332}
    210333
    211334#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}
    218343
    219344#define PUTSHORT(s, cp) { \
    220         *(cp)++ = (s) >> 8; \
    221         *(cp)++ = (s); \
    222 }
    223 
    224 /*
    225  * Warning: PUTLONG destroys its first argument.
    226  */
     345; \
     346); \
     347        *t_cp++ = t_s >> 8; \
     348        *t_cp   = t_s; \
     349        (cp) += INT16SZ; \
     350}
     351
    227352#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*/
    234362
    235363/* function prototypes */
    236 u_short _getshort(u_char*);
    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                   u_char*, int);
    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);
     364u_short_getshort(u_char*);
     365u_long  _getlong(u_char*);
     366#ifdef TCPV40HDRS /* newer have this in resolver */
     367void    , u_char *);
     368void    _System putlong(u_long, u_char *);
     369 u_char*, int);
     370int     dn_comp(__const__ u_char*, u_char*, int, u_char**, u_char**);
     371int     dn_find(u_char*, u_char*, u_char**, u_char**);
     372int     dn_skipname(__const__ u_char*, __const__ u_char*);
     373int     res_init(void);
     374int     
     375, char*, int);
     376int     char*, int);
     377int     (char*, int, int, u_char*, int);
     378int     char*, int, int, u_char*, int);
     379#endif
    252380
    253381#if defined (__cplusplus)
  • trunk/src/emx/include/arpa/telnet.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    1 /*
     1/* Modified for gcc by bird 2003
     2 *
    23 * Copyright (c) 1983 Regents of the University of California.
    34 * All rights reserved.
     
    3637#ifndef _TELNET_H_
    3738#define _TELNET_H_
     39
    3840
    3941/*
     
    7577#define TELCMD_FIRST    xEOF
    7678#define TELCMD_LAST     IAC
    77 #define TELCMD_OK(x)    ((x) <= TELCMD_LAST && (x) >= TELCMD_FIRST)
     79#define TELCMD_OK(x)    (((x) >= TELCMD_FIRST)
    7880#define TELCMD(x)       telcmds[(x)-TELCMD_FIRST]
    7981
     
    115117#define TELOPT_LINEMODE 34      /* Linemode option */
    116118#define TELOPT_XDISPLOC 35      /* X Display Location */
    117 #define TELOPT_ENVIRON  36      /* Environment variables */
     119#define TELOPT_ Environment variables */
    118120#define TELOPT_AUTHENTICATION 37/* Authenticate */
    119121#define TELOPT_ENCRYPT  38      /* Encryption option */
     122
    120123#define TELOPT_EXOPL    255     /* extended-options-list */
    121124
    122125
    123 #define NTELOPTS        (1+TELOPT_ENCRYPT)
     126#define NTELOPTS        (1+TELOPT_)
    124127#ifdef TELOPTS
    125128char *telopts[NTELOPTS+1] = {
     
    132135        "TACACS UID", "OUTPUT MARKING", "TTYLOC",
    133136        "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
    134         "LINEMODE", "XDISPLOC", "ENVIRON", "AUTHENTICATION",
    135         "ENCRYPT",
     137        "LINEMODE", "XDISPLOC", "ENVIRON", "AUTHENTICATION",
     138        "ENCRYPT",
    136139        0,
    137140};
    138141#define TELOPT_FIRST    TELOPT_BINARY
    139 #define TELOPT_LAST     TELOPT_ENCRYPT
    140 #define TELOPT_OK(x)    ((x) <= TELOPT_LAST && (x) >= TELOPT_FIRST)
     142#define TELOPT_LAST     TELOPT_
     143#define TELOPT_OK(x)    ((ST)
    141144#define TELOPT(x)       telopts[(x)-TELOPT_FIRST]
    142145#endif
     
    148151#define TELQUAL_REPLY   2       /* AUTHENTICATION: client version of IS */
    149152#define TELQUAL_NAME    3       /* AUTHENTICATION: client version of IS */
     153
     154
     155
     156
     157
    150158
    151159/*
     
    209217#endif
    210218
    211 #define SLC_NAME_OK(x)  ((x) >= 0 && (x) < NSLC)
     219#define SLC_NAME_OK(x)  (( NSLC)
    212220#define SLC_NAME(x)     slc_names[x]
    213221
     
    226234#define SLC_FLUSHOUT    0x20
    227235
    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
    231242
    232243/*
     
    265276#endif
    266277
    267 #define AUTHTYPE_NAME_OK(x)     ((x) >= 0 && (x) < AUTHTYPE_CNT)
     278#define(x) < AUTHTYPE_CNT)
    268279#define AUTHTYPE_NAME(x)        authtype_names[x]
    269280
     
    302313
    303314
    304 #define ENCRYPT_NAME_OK(x)      ((x) >= 0 && (x) < ENCRYPT_CNT)
     315#define ENCRYPT_NAME_OK(x)      (((x) < ENCRYPT_CNT)
    305316#define ENCRYPT_NAME(x)         encrypt_names[x]
    306317
    307 #define ENCTYPE_NAME_OK(x)      ((x) >= 0 && (x) < ENCTYPE_CNT)
     318#define ENCTYPE_NAME_OK(x)      (((x) < ENCTYPE_CNT)
    308319#define ENCTYPE_NAME(x)         enctype_names[x]
    309320
Note: See TracChangeset for help on using the changeset viewer.