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

#434: Initial tcpip header merges.

Location:
trunk/src/emx/include/netinet
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/netinet/icmp_var.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    1 /*
     1/* Modified for gcc/os2 by bird 2003
     2 *
    23 * Copyright (c) 1982, 1986, 1993
    34 *      The Regents of the University of California.  All rights reserved.
     
    4950 */
    5051struct  icmpstat {
     52#if 0 /* OS2 is slightly different */
    5153/* statistics related to icmp packets generated */
    5254        u_long  icps_error;             /* # of calls to icmp_error */
     
    6163        u_long  icps_reflect;           /* number of responses */
    6264        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
    6378#if 0 /* not on OS/2 */
    6479        u_long  icps_bmcastecho;        /* b/mcast echo requests dropped */
  • trunk/src/emx/include/netinet/if_ether.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv 1994,1996
     2 * Modified for gcc by bird 2003
    23 *
    34 * Copyright (c) 1982, 1986 Regents of the University of California.
     
    3940#define _NETINET_IF_ETHER_H_
    4041
    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
    4843
    4944/*
     
    5752
    5853#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
    6258#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
    6560
    6661/*
     
    7974 *
    8075 * 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
    8277 * RFC 826.
    8378 */
     
    113108 * Internet to ethernet address resolution table.
    114109 */
    115 #ifdef TCPIPV4
    116110#pragma pack(1)
    117 #else
    118 #pragma pack(4)
    119 #endif
    120111struct  arptab {
    121112        struct  in_addr at_iaddr;       /* internet address */
     
    127118        u_short at_rcf;                 /* token ring routing control field */
    128119        u_short at_rseg[8];             /* token ring routing segments */
     120#ifdef OS2
    129121        u_long at_millisec;             /* TOD millsecons of last update */
    130 #ifdef TCPIPV4
    131122        short at_interface;             /* interface index */
    132 #else
    133         int at_interface;               /* interface index */
    134123#endif
    135124};
    136125#pragma pack()
    137126
     127
     128#else /*TCPV40HDRS*/
     129
     130
     131#pragma pack(1)
     132struct 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};
     142struct 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
    138164#endif /* !_NETINET_IF_ETHER_H_ */
  • trunk/src/emx/include/netinet/igmp.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv 1996
     2 * Modified for gcc/os2 by bird 2003
    23 *
    34 * Copyright (c) 1988 Stephen Deering.
     
    4748 * IGMP packet format.
    4849 */
     50#ifndef TCPV40HDRS
     51#pragma pack(1)
     52#endif
    4953struct igmp {
    5054        u_char          igmp_type;      /* version & type of IGMP message  */
     
    5357        struct in_addr  igmp_group;     /* group address being reported    */
    5458};                                      /*  (zero for queries)             */
     59#ifndef TCPV40HDRS
     60#pragma pack()
     61#endif
    5562
    5663#define IGMP_MINLEN                  8
  • trunk/src/emx/include/netinet/igmp_var.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    1 /*
     1/* Modified for gcc/os2 by bird 2003
     2 *
    23 * Copyright (c) 1988 Stephen Deering.
    34 * Copyright (c) 1992, 1993
  • trunk/src/emx/include/netinet/in.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv and em 1994,1996
     2 * Modified for gcc/os2 by bird 2003
    23 *
    34 * Copyright (c) 1982, 1986, 1990 Regents of the University of California.
     
    6667#define IPPROTO_UDP             17              /* user datagram protocol */
    6768#define IPPROTO_IDP             22              /* xns idp */
     69#ifndef TCPV40HDRS
    6870#define IPPROTO_TP              29              /* tp-4 w/ class negotiation */
    6971#define IPPROTO_EON             80              /* ISO cnlp */
     72#define IPPROTO_ENCAP           98              /* encapsulation header */
     73#endif
    7074
    7175#define IPPROTO_RAW             255             /* raw IP packet */
     
    8084 * for servers, not necessarily privileged.
    8185 */
     86#ifdef TCPV40HDRS
    8287#define IPPORT_RESERVED         1024
    8388#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
    84104
    85105/*
     
    113133
    114134#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
    115139#define IN_CLASSD_NET           0xf0000000      /* These ones aren't really */
     140#define IN_CLASSD_HOST          0x0fffffff      /* routing needn't know. */
     141#endif
    116142#define IN_CLASSD_NSHIFT        28              /* net and host fields, but */
    117 #define IN_CLASSD_HOST          0x0fffffff      /* routing needn't know. */
    118143#define IN_MULTICAST(i)         IN_CLASSD(i)
    119144
     145#ifdef TCPV40HDRS
    120146#define IN_EXPERIMENTAL(i)      (((long)(i) & 0xe0000000) == 0xe0000000)
     147#else
     148#define IN_EXPERIMENTAL(i)      (((long)(i) & 0xf0000000) == 0xe0000000)
     149#endif
    121150#define IN_BADCLASS(i)          (((long)(i) & 0xf0000000) == 0xf0000000)
    122151
    123152#define INADDR_ANY              (u_long)0x00000000
     153#ifndef TCPV40HDRS
    124154#define INADDR_LOOPBACK         (u_long)0x7f000001
     155#endif
    125156#define INADDR_BROADCAST        (u_long)0xffffffff      /* must be masked */
    126 #ifndef KERNEL
    127 #define INADDR_NONE             0xffffffff              /* -1 return */
    128 #endif
    129157
    130158#define INADDR_UNSPEC_GROUP     (u_long)0xe0000000      /* 224.0.0.0 */
     
    132160#define INADDR_MAX_LOCAL_GROUP  (u_long)0xe00000ff      /* 224.0.0.255 */
    133161
     162#ifndef KERNEL
     163#define INADDR_NONE             0xffffffff              /* -1 return */
     164#endif
     165
    134166#define IN_LOOPBACKNET          127                     /* official! */
    135167
    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
    142169/*
    143170 * Socket address, internet style. 4.3BSD
    144171 */
     172#ifdef TCPV40HDRS
    145173struct sockaddr_in {
    146174        short   sin_family;
     
    149177        char    sin_zero[8];
    150178};
     179#else
     180#pragma pack(1)
     181struct 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
    151190
    152191/*
     
    157196 * (this gets put into the header proper).
    158197 */
     198#ifndef TCPV40HDRS
     199#pragma pack(1)
     200#endif
    159201struct ip_opts {
    160202        struct  in_addr ip_dst;         /* first hop, 0 w/o src rt */
    161203        char    ip_opts[40];            /* actually variable in size */
    162204};
     205#ifndef TCPV40HDRS
     206#pragma pack()
     207#endif
    163208
    164209/*
     
    167212 */
    168213#define IP_OPTIONS              1       /* buf/ip_opts; set/get IP options */
    169 
    170214#define IP_MULTICAST_IF         2       /* u_char; set/get IP mcast i/f */
    171215#define IP_MULTICAST_TTL        3       /* u_char; set/get IP mcast ttl */
     
    173217#define IP_ADD_MEMBERSHIP       5       /* ip_mreq; add IP group membership */
    174218#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 */
    186233#define IP_DEFAULT_MULTICAST_TTL   1    /* normally limit m'casts to 1 hop  */
    187234#define IP_DEFAULT_MULTICAST_LOOP  1    /* normally hear sends if a member  */
    188235#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 */
     238extern u_short CntInMulti;
     239#endif
    189240
    190241/*
    191242 * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
    192243 */
     244#ifndef TCPV40HDRS
     245#pragma pack(1)
     246#endif
    193247struct ip_mreq {
    194248        struct  in_addr imr_multiaddr;  /* IP multicast address of group */
    195249        struct  in_addr imr_interface;  /* local IP address of interface */
    196250};
    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) */
    205295
    206296#if defined (__cplusplus)
  • trunk/src/emx/include/netinet/ip.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv 1994,1996
     2 * Modified for gcc/os2 by bird 2003
    23 *
    34 * Copyright (c) 1982, 1986 Regents of the University of California.
     
    3940#define _NETINET_IP_H_
    4041
    41 #ifdef __EMX__
    4242#include <machine/endian.h>
    43 #endif /* __EMX__ */
    4443
    4544/*
     
    5655 * against negative integers quite easily, and fail in subtle ways.
    5756 */
     57#pragma pack(1)
    5858struct ip {
    5959#if BYTE_ORDER == LITTLE_ENDIAN
     
    7171#define IP_DF 0x4000                    /* dont fragment flag */
    7272#define IP_MF 0x2000                    /* more fragments flag */
     73#ifndef TCPV40HDRS
     74#define IP_OFFMASK 0x1fff               /* mask for fragmenting bits */
     75#endif
    7376        u_char  ip_ttl;                 /* time to live */
    7477        u_char  ip_p;                   /* protocol */
     
    7679        struct  in_addr ip_src,ip_dst;  /* source and dest address */
    7780};
    78 
     81#pragma pack()
     82
     83#ifdef TCPV40HDRS
    7984#define IP_MAXPACKET    32767           /* OS2 maximum packet size */
     85#else
     86#define IP_MAXPACKET    65535           /* maximum packet size */
     87#endif
    8088
    8189/*
     
    96104#define IPTOS_PREC_IMMEDIATE            0x40
    97105#define IPTOS_PREC_PRIORITY             0x20
     106#ifdef TCPV40HDRS
    98107#define IPTOS_PREC_ROUTINE              0x10
     108#else
     109#define IPTOS_PREC_ROUTINE              0x00
     110#endif
    99111
    100112/*
    101113 * Definitions for options.
    102114 */
     115#ifndef TCPV40HDRS
     116#define IPOPT_COPY              0x80
     117#endif
    103118#define IPOPT_COPIED(o)         ((o)&0x80)
    104119#define IPOPT_CLASS(o)          ((o)&0x60)
     
    119134#define IPOPT_SATID             136             /* satnet id */
    120135#define IPOPT_SSRR              137             /* strict source route */
     136#ifndef TCPV40HDRS
     137#define IPOPT_RALERT            148             /* router alert */
     138#endif
    121139
    122140/*
     
    131149 * Time stamp option structure.
    132150 */
     151#pragma pack(1)
    133152struct  ip_timestamp {
    134153        u_char  ipt_code;               /* IPOPT_TS */
     
    151170        } ipt_timestamp;
    152171};
     172#pragma pack()
    153173
    154174/* flag bits for ipt_flg */
    155175#define IPOPT_TS_TSONLY         0               /* timestamps only */
    156176#define IPOPT_TS_TSANDADDR      1               /* timestamps and addresses */
     177#ifdef TCPV40HDRS
     178#define IPOPT_TS_PRESPEC        2               /* specified modules only */
     179#else
    157180#define IPOPT_TS_PRESPEC        3               /* specified modules only */
     181#endif
     182
    158183
    159184/* bits for security (not byte swapped) */
     
    170195 */
    171196#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*/
    172200#define IPFRAGTTL       60              /* time to live for frags, slowhz */
    173201#define IPTTLDEC        1               /* subtracted when forwarding */
     
    175203#define IP_MSS          576             /* default maximum segment size */
    176204
    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
    181206struct  ipstat {
    182207        long    ips_total;
     
    204229        long    ips_ipInUnknownProtos;
    205230};
    206 #endif
     231#endif /* TCPV40HDRS */
     232
    207233
    208234#endif /* !_NETINET_IP_H_ */
  • trunk/src/emx/include/netinet/ip_icmp.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv 1994
     2 * Modified for gcc/os2 by bird 2003
    23 *
    34 * Copyright (c) 1982, 1986 Regents of the University of California.
     
    4748 * Structure of an icmp header.
    4849 */
     50#pragma pack(1)
    4951struct icmp {
    5052        u_char  icmp_type;              /* type of message, see below */
     
    5961                } ih_idseq;
    6062                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
    6171        } icmp_hun;
    6272#define icmp_pptr       icmp_hun.ih_pptr
     
    6575#define icmp_seq        icmp_hun.ih_idseq.icd_seq
    6676#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
    6781        union {
    6882                struct id_ts {
     
    8599#define icmp_data       icmp_dun.id_data
    86100};
     101#pragma pack()
    87102
    88103/*
     
    112127#define         ICMP_UNREACH_NEEDFRAG   4               /* IP_DF caused drop */
    113128#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
    114138#define ICMP_SOURCEQUENCH       4               /* packet lost, slow down */
    115139#define ICMP_REDIRECT           5               /* shorter route, codes: */
     
    119143#define         ICMP_REDIRECT_TOSHOST   3               /* for tos and host */
    120144#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
    121149#define ICMP_TIMXCEED           11              /* time exceeded, code: */
    122150#define         ICMP_TIMXCEED_INTRANS   0               /* ttl==0 in transit */
    123151#define         ICMP_TIMXCEED_REASS     1               /* ttl==0 in reass */
    124152#define ICMP_PARAMPROB          12              /* ip header bad */
     153#ifndef TCPV40HDRS
     154#define         ICMP_PARAMPROB_OPTABSENT 1              /* req. opt. absent */
     155#endif
    125156#define ICMP_TSTAMP             13              /* timestamp request */
    126157#define ICMP_TSTAMPREPLY        14              /* timestamp reply */
     
    132163#define ICMP_MAXTYPE            18
    133164
     165#ifdef TCPV40HDRS
    134166#define ICMP_INFOTYPE(type) \
    135167        ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
     
    137169        (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
    138170        (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)
    142182struct  icmpstat {
     183/* statistics related to icmp packets generated */
    143184        short   icps_error;
    144185        short   icps_oldshort;
    145186        short   icps_oldicmp;
    146187        short   icps_outhist[ICMP_MAXTYPE + 1];
     188/* statistics related to input messages processed */
    147189        short   icps_badcode;
    148190        short   icps_tooshort;
     
    177219        u_long  icps_OutAddrMaskReps;
    178220};
     221#pragma pack()
    179222#endif
    180223
  • trunk/src/emx/include/netinet/ip_mroute.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    5959 * Multicast Routing set/getsockopt commands.
    6060 */
     61#if 1 /* not on OS/2 - but let's include it anyway. */
    6162#define MRT_INIT        100     /* initialize forwarder */
    6263#define MRT_DONE        101     /* shut down forwarder */
    6364#define MRT_ADD_VIF     102     /* create virtual interface */
    6465#define MRT_DEL_VIF     103     /* delete virtual interface */
    65 #if 0 /* different on OS/2 */
    6666#define MRT_ADD_MFC     104     /* insert forwarding cache entry */
    6767#define MRT_DEL_MFC     105     /* delete forwarding cache entry */
    6868#define MRT_VERSION     106     /* get kernel version number */
    6969#define MRT_ASSERT      107     /* enable PIM assert processing */
     70#if 0
    7071#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
    7284#define DVMRP_ADD_LGRP  104
    7385#define DVMRP_DEL_LGRP  105
     
    105117        u_char  vifc_flags;             /* VIFF_ flags defined below */
    106118        u_char  vifc_threshold;         /* min ttl required to forward on vif */
     119#if 0 /* not on OS/2 */
    107120        u_int   vifc_rate_limit;        /* max rate */
     121#endif
    108122        struct  in_addr vifc_lcl_addr;  /* local interface address */
    109123        struct  in_addr vifc_rmt_addr;  /* remote address (tunnels only) */
  • trunk/src/emx/include/netinet/ip_var.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    9090#pragma pack()
    9191
    92 #if 0 /* different/not on OS/2 */
     92
    9393/*
    9494 * Structure stored in mbuf in inpcb.ip_options
     
    9797 * is in m_len.
    9898 */
     99#define MAX_IPOPTLEN    40
     100#if 0 /* different/not on OS/2 */
    99101struct ipoption {
    100102        struct  in_addr ipopt_dst;      /* first-hop dst if source routed */
  • trunk/src/emx/include/netinet/tcp.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv 1996
     2 * Modified for gcc/os2 by bird 2003
    23 *
    34 * Copyright (c) 1982, 1986 Regents of the University of California.
     
    4647 * Per RFC 793, September, 1981.
    4748 */
     49#pragma pack(1)
    4850struct tcphdr {
    4951        u_short th_sport;               /* source port */
     
    5153        tcp_seq th_seq;                 /* sequence number */
    5254        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
    5375#if BYTE_ORDER == LITTLE_ENDIAN
    5476        u_char  th_x2:4,                /* (unused) */
     
    6789#define TH_URG  0x20
    6890        u_short th_win;                 /* window */
     91#endif
    6992        u_short th_sum;                 /* checksum */
    7093        u_short th_urp;                 /* urgent pointer */
    7194};
     95#pragma pack()
    7296
    7397#define TCPOPT_EOL      0
    7498#define TCPOPT_NOP      1
    7599#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*/
    76122
    77123/*
     
    81127 * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
    82128 */
     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*/
    83139#define TCP_MSS 512
     140#endif
    84141
    85142#define TCP_MAXWIN      65535           /* largest value for window */
     143
     144#ifndef TCPV40HDRS
     145#define TCP_MAX_WINSHIFT        14      /* maximum window shift */
     146#endif
    86147
    87148/*
     
    90151#define TCP_NODELAY     0x01    /* don't delay send to coalesce packets */
    91152#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*/
    92169
    93 /* hv: this is a new data structure in TCPIPV4. */
    94 #ifdef TCPIPV4
     170#ifdef TCPV40HDRS
    95171#include <netinet/tcp_var.h>
    96172#endif
  • trunk/src/emx/include/netinet/tcp_var.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv 1996
    2  * 
     2 *
    33 * Copyright (c) 1982, 1986 Regents of the University of California.
    44 * All rights reserved.
     
    4444 * but that's inconvenient at the moment.
    4545 */
    46 #ifdef TCPIPCV4
    4746struct  tcpstat {
    4847        u_long  tcps_connattempt;       /* connections initiated */
     
    7271        u_long  tcps_sndwinup;          /* window update-only packets sent */
    7372        u_long  tcps_sndctrl;           /* control (SYN|FIN|RST) packets sent */
     73        u_long  tcps_sndrst;            /* RST packets sent, MIB II ... */
    7474
    7575        u_long  tcps_rcvtotal;          /* total packets received */
     
    9494        u_long  tcps_rcvackbyte;        /* bytes acked by rcvd acks */
    9595        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
    96114};
    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 */
    98152
    99153#endif /* !_NETINET_TCP_VAR_H_ */
  • trunk/src/emx/include/netinet/udp.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv 1996
     2 * Modified for gcc/os2 by bird 2003
    23 *
    34 * Copyright (c) 1982, 1986 Regents of the University of California.
     
    3940#define _NETINET_UDP_H_
    4041
     42#ifdef TCPV40HDRS
     43#include <netinet/udp_var.h>
     44#else
    4145/*
    4246 * Udp protocol header.
    4347 * Per RFC 768, September, 1981.
    4448 */
     49#pragma pack(1)
    4550struct udphdr {
    4651        u_short uh_sport;               /* source port */
     
    4954        u_short uh_sum;                 /* udp checksum */
    5055};
    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()
    6357#endif
    6458
  • trunk/src/emx/include/netinet/udp_var.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for emx by hv 1996
    2  *
     2 * Modified for gcc/os2 by bird 2003
     3 *
    34 * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
    45 * All rights reserved.
     
    3940#define _NETINET_UDP_VAR_H_
    4041
    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
     43struct  udpstat {
     44        u_long  udps_hdrops;
     45        u_long  udps_badsum;
     46        u_long  udps_badlen;
    5847        u_long  udps_udpInDatagrams;
    5948        u_long  udps_udpNoPorts;
    6049        u_long  udps_udpOutDatagrams;
    61 #endif /* __EMX__ */
    6250};
    63 #endif /* TCPIPV4 */
    6451
    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)
     58struct  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
     75struct  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 */
    66106
    67107#endif /* !_NETINET_UDP_VAR_H_ */
Note: See TracChangeset for help on using the changeset viewer.