Changeset 1550


Ignore:
Timestamp:
Oct 9, 2004, 10:39:47 AM (21 years ago)
Author:
bird
Message:

Updated to FreeBSD 5.2 level.

File:
1 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1549 r1550  
    1 /* Modified for emx by hv 1994
    2  * Modified for gcc/os2 by bird 2003
    3  *
    4  * Copyright (c) 1982, 1986 Regents of the University of California.
    5  * All rights reserved.
     1/** $Id$ */
     2/** @file
     3 * FreeBSD 5.2
     4 * @changed bird (2003): modified for gcc/os2
     5 * @changed bird (2004): updated to FreeBSD 5.2 and __USE_LIBC_TCPIP
     6 */
     7
     8/*
     9 * Copyright (c) 1982, 1986, 1993
     10 *      The Regents of the University of California.  All rights reserved.
    611 *
    712 * Redistribution and use in source and binary forms, with or without
     
    1318 *    notice, this list of conditions and the following disclaimer in the
    1419 *    documentation and/or other materials provided with the distribution.
    15  * 3. All advertising materials mentioning features or use of this software
    16  *    must display the following acknowledgement:
    17  *      This product includes software developed by the University of
    18  *      California, Berkeley and its contributors.
    1920 * 4. Neither the name of the University nor the names of its contributors
    2021 *    may be used to endorse or promote products derived from this software
     
    3334 * SUCH DAMAGE.
    3435 *
    35  *      from: @(#)ip_icmp.h     7.5 (Berkeley) 6/28/90
    36  *      $Id$
     36 *      @(#)ip_icmp.h   8.1 (Berkeley) 6/10/93
     37 * $FreeBSD: src/sys/netinet/ip_icmp.h,v 1.22 2004/04/07 20:46:13 imp Exp $
    3738 */
    3839
     
    4445 * Per RFC 792, September 1981.
    4546 */
     47
     48#ifdef __USE_LIBC_TCPIP
     49/*
     50 * Internal of an ICMP Router Advertisement
     51 */
     52struct icmp_ra_addr {
     53        u_int32_t ira_addr;
     54        u_int32_t ira_preference;
     55};
     56#endif
    4657
    4758/*
     
    6172                } ih_idseq;
    6273                int ih_void;
    63 #ifndef TCPV40HDRS
    64 
     74
     75#if !defined(TCPV40HDRS) || defined(__USE_LIBC_TCPIP)
    6576                /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
    6677                struct ih_pmtu {
     
    6879                        n_short ipm_nextmtu;
    6980                } ih_pmtu;
     81
     82#ifdef __USE_LIBC_TCPIP
     83                struct ih_rtradv {
     84                        u_char irt_num_addrs;
     85                        u_char irt_wpa;
     86                        u_int16_t irt_lifetime;
     87                } ih_rtradv;
     88#endif
    7089#endif
    7190        } icmp_hun;
     
    7594#define icmp_seq        icmp_hun.ih_idseq.icd_seq
    7695#define icmp_void       icmp_hun.ih_void
    77 #ifndef TCPV40HDRS
     96#if !defined(TCPV40HDRS) || defined(__USE_LIBC_TCPIP)
    7897#define icmp_pmvoid     icmp_hun.ih_pmtu.ipm_void
    7998#define icmp_nextmtu    icmp_hun.ih_pmtu.ipm_nextmtu
     99#ifdef __USE_LIBC_TCPIP
     100#define icmp_num_addrs  icmp_hun.ih_rtradv.irt_num_addrs
     101#define icmp_wpa        icmp_hun.ih_rtradv.irt_wpa
     102#define icmp_lifetime   icmp_hun.ih_rtradv.irt_lifetime
     103#endif
    80104#endif
    81105        union {
    82                 struct id_ts {
    83                         n_time its_otime;
    84                         n_time its_rtime;
    85                         n_time its_ttime;
     106                struct id_ts {                  /* ICMP Timestamp */
     107                        n_time its_otime;       /* Originate */
     108                        n_time its_rtime;       /* Receive */
     109                        n_time its_ttime;       /* Transmit */
    86110                } id_ts;
    87111                struct id_ip  {
     
    89113                        /* options and then 64 bits of data */
    90114                } id_ip;
     115#ifdef __USE_LIBC_TCPIP
     116                struct icmp_ra_addr id_radv;
     117                u_int32_t id_mask;
     118#else
    91119                u_long  id_mask;
     120#endif
    92121                char    id_data[1];
    93122        } icmp_dun;
     
    96125#define icmp_ttime      icmp_dun.id_ts.its_ttime
    97126#define icmp_ip         icmp_dun.id_ip.idi_ip
     127#ifdef __USE_LIBC_TCPIP
     128#define icmp_radv       icmp_dun.id_radv
     129#endif
    98130#define icmp_mask       icmp_dun.id_mask
    99131#define icmp_data       icmp_dun.id_data
     
    104136 * Lower bounds on packet lengths for various types.
    105137 * For the error advice packets must first insure that the
    106  * packet is large enought to contain the returned ip header.
     138 * packet is large enough to contain the returned ip header.
    107139 * Only then can we do the check to see if 64 bits of packet
    108140 * data have been returned, since we need to check the returned
     
    127159#define         ICMP_UNREACH_NEEDFRAG   4               /* IP_DF caused drop */
    128160#define         ICMP_UNREACH_SRCFAIL    5               /* src route failed */
    129 #ifndef TCPV40HDRS
     161#if !defined(TCPV40HDRS) || defined(__USE_LIBC_TCPIP)
    130162#define         ICMP_UNREACH_NET_UNKNOWN 6              /* unknown net */
    131163#define         ICMP_UNREACH_HOST_UNKNOWN 7             /* unknown host */
     
    135167#define         ICMP_UNREACH_TOSNET     11              /* bad tos for net */
    136168#define         ICMP_UNREACH_TOSHOST    12              /* bad tos for host */
     169#ifdef __USE_LIBC_TCPIP
     170#define         ICMP_UNREACH_FILTER_PROHIB 13           /* admin prohib */
     171#define         ICMP_UNREACH_HOST_PRECEDENCE 14         /* host prec vio. */
     172#define         ICMP_UNREACH_PRECEDENCE_CUTOFF 15       /* prec cutoff */
     173#endif
    137174#endif
    138175#define ICMP_SOURCEQUENCH       4               /* packet lost, slow down */
     
    142179#define         ICMP_REDIRECT_TOSNET    2               /* for tos and net */
    143180#define         ICMP_REDIRECT_TOSHOST   3               /* for tos and host */
     181#ifdef __USE_LIBC_TCPIP
     182#define ICMP_ALTHOSTADDR        6               /* alternate host address */
     183#endif
    144184#define ICMP_ECHO               8               /* echo service */
    145 #ifndef TCPV40HDRS
     185#if !defined(TCPV40HDRS) || defined(__USE_LIBC_TCPIP)
    146186#define ICMP_ROUTERADVERT       9               /* router advertisement */
     187#ifdef __USE_LIBC_TCPIP
     188#define         ICMP_ROUTERADVERT_NORMAL                0       /* normal advertisement */
     189#define         ICMP_ROUTERADVERT_NOROUTE_COMMON        16      /* selective routing */
     190#endif
    147191#define ICMP_ROUTERSOLICIT      10              /* router solicitation */
    148192#endif
     
    151195#define         ICMP_TIMXCEED_REASS     1               /* ttl==0 in reass */
    152196#define ICMP_PARAMPROB          12              /* ip header bad */
    153 #ifndef TCPV40HDRS
     197#if !defined(TCPV40HDRS) || defined(__USE_LIBC_TCPIP)
     198#ifdef __USE_LIBC_TCPIP
     199#define         ICMP_PARAMPROB_ERRATPTR 0               /* error at param ptr */
     200#endif
    154201#define         ICMP_PARAMPROB_OPTABSENT 1              /* req. opt. absent */
     202#ifdef __USE_LIBC_TCPIP
     203#define         ICMP_PARAMPROB_LENGTH 2                 /* bad length */
     204#endif
    155205#endif
    156206#define ICMP_TSTAMP             13              /* timestamp request */
     
    160210#define ICMP_MASKREQ            17              /* address mask request */
    161211#define ICMP_MASKREPLY          18              /* address mask reply */
    162 
     212#ifdef __USE_LIBC_TCPIP
     213#define ICMP_TRACEROUTE         30              /* traceroute */
     214#define ICMP_DATACONVERR        31              /* data conversion error */
     215#define ICMP_MOBILE_REDIRECT    32              /* mobile host redirect */
     216#define ICMP_IPV6_WHEREAREYOU   33              /* IPv6 where-are-you */
     217#define ICMP_IPV6_IAMHERE       34              /* IPv6 i-am-here */
     218#define ICMP_MOBILE_REGREQUEST  35              /* mobile registration req */
     219#define ICMP_MOBILE_REGREPLY    36              /* mobile registration reply */
     220#define ICMP_SKIP               39              /* SKIP */
     221#define ICMP_PHOTURIS           40              /* Photuris */
     222#define         ICMP_PHOTURIS_UNKNOWN_INDEX     1       /* unknown sec index */
     223#define         ICMP_PHOTURIS_AUTH_FAILED       2       /* auth failed */
     224#define         ICMP_PHOTURIS_DECRYPT_FAILED    3       /* decrypt failed */
     225#endif
     226
     227#ifdef __USE_LIBC_TCPIP
     228#define ICMP_MAXTYPE            40
     229#else
    163230#define ICMP_MAXTYPE            18
    164 
    165 #ifdef TCPV40HDRS
    166 #define ICMP_INFOTYPE(type) \
    167         ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
    168         (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
    169         (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
    170         (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
    171 #else
     231#endif
     232
     233#ifndef TCPV40HDRS
    172234#define ICMP_INFOTYPE(type) \
    173235        ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
     
    176238        (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
    177239        (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
     240#else
     241#define ICMP_INFOTYPE(type) \
     242        ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
     243        (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
     244        (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
     245        (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
     246#endif
     247
     248#ifdef _KERNEL
     249void    icmp_error(struct mbuf *, int, int, n_long, struct ifnet *);
     250void    icmp_input(struct mbuf *, int);
    178251#endif
    179252
Note: See TracChangeset for help on using the changeset viewer.