# 2.11BSD#431 - /usr/src/sys/netinet/ip_icmp.h

##### Macros

    ICMP_ADVLEN       X
    ICMP_ADVLENMIN    X
    ICMP_ECHO         X
    ICMP_ECHOREPLY    X
    ICMP_INFOTYPE     X
    ICMP_IREQ         X
    ICMP_IREQREPLY    X
    ICMP_MASKLEN      X
    ICMP_MASKREPLY    X
    ICMP_MASKREQ      X
    ICMP_MAXTYPE      X
    ICMP_MINLEN       X
    ICMP_PARAMPROB    X
    ICMP_REDIRECT     X
    ICMP_REDIRECT_HOSTX
    ICMP_REDIRECT_NET X
    ICMP_REDIRECT_TOSHOSTX
    ICMP_REDIRECT_TOSNETX
    ICMP_SOURCEQUENCH X
    ICMP_TIMXCEED     X
    ICMP_TIMXCEED_INTRANSX
    ICMP_TIMXCEED_REASSX
    ICMP_TSLEN        X
    ICMP_TSTAMP       X
    ICMP_TSTAMPREPLY  X
    ICMP_UNREACH      X
    ICMP_UNREACH_HOST X
    ICMP_UNREACH_NEEDFRAGX
    ICMP_UNREACH_NET  X
    ICMP_UNREACH_PORT X
    ICMP_UNREACH_PROTOCOLX
    ICMP_UNREACH_SRCFAILX
    icmp_data         X
    icmp_gwaddr       X
    icmp_id           X
    icmp_ip           X
    icmp_mask         X
    icmp_otime        X
    icmp_pptr         X
    icmp_rtime        X
    icmp_seq          X
    icmp_ttime        X
    icmp_void         X

##### struct's

    icmp              X
    id_ip             X
    id_ts             X
    ih_idseq          X

       1: /*
       2:  * Copyright (c) 1982, 1986 Regents of the University of California.
       3:  * All rights reserved.
       4:  *
       5:  * Redistribution and use in source and binary forms are permitted
       6:  * provided that this notice is preserved and that due credit is given
       7:  * to the University of California at Berkeley. The name of the University
       8:  * may not be used to endorse or promote products derived from this
       9:  * software without specific prior written permission. This software
      10:  * is provided ``as is'' without express or implied warranty.
      11:  *
      12:  *	@(#)ip_icmp.h	7.3 (Berkeley) 12/7/87
      13:  */
      14:
      15: /*
      16:  * Interface Control Message Protocol Definitions.
      17:  * Per RFC 792, September 1981.
      18:  */
      19:
      20: /*
      21:  * Structure of an icmp header.
      22:  */
      23: struct icmp {
      24:     u_char  icmp_type;      /* type of message, see below */
      25:     u_char  icmp_code;      /* type sub code */
      26:     u_short icmp_cksum;     /* ones complement cksum of struct */
      27:     union {
      28:         u_char ih_pptr;         /* ICMP_PARAMPROB */
      29:         struct in_addr ih_gwaddr;   /* ICMP_REDIRECT */
      30:         struct ih_idseq {
      31:             n_short icd_id;
      32:             n_short icd_seq;
      33:         } ih_idseq;
      34:         long ih_void;
      35:     } icmp_hun;
      36: #define icmp_pptr   icmp_hun.ih_pptr
      37: #define icmp_gwaddr icmp_hun.ih_gwaddr
      38: #define icmp_id     icmp_hun.ih_idseq.icd_id
      39: #define icmp_seq    icmp_hun.ih_idseq.icd_seq
      40: #define icmp_void   icmp_hun.ih_void
      41:     union {
      42:         struct id_ts {
      43:             n_time its_otime;
      44:             n_time its_rtime;
      45:             n_time its_ttime;
      46:         } id_ts;
      47:         struct id_ip  {
      48:             struct ip idi_ip;
      49:             /* options and then 64 bits of data */
      50:         } id_ip;
      51:         u_long  id_mask;
      52:         char    id_data[1];
      53:     } icmp_dun;
      54: #define icmp_otime  icmp_dun.id_ts.its_otime
      55: #define icmp_rtime  icmp_dun.id_ts.its_rtime
      56: #define icmp_ttime  icmp_dun.id_ts.its_ttime
      57: #define icmp_ip     icmp_dun.id_ip.idi_ip
      58: #define icmp_mask   icmp_dun.id_mask
      59: #define icmp_data   icmp_dun.id_data
      60: };
      61:
      62: /*
      63:  * Lower bounds on packet lengths for various types.
      64:  * For the error advice packets must first insure that the
      65:  * packet is large enought to contain the returned ip header.
      66:  * Only then can we do the check to see if 64 bits of packet
      67:  * data have been returned, since we need to check the returned
      68:  * ip header length.
      69:  */
      70: #define ICMP_MINLEN 8               /* abs minimum */
      71: #define ICMP_TSLEN  (8 + 3 * sizeof (n_time))   /* timestamp */
      72: #define ICMP_MASKLEN    12              /* address mask */
      73: #define ICMP_ADVLENMIN  (8 + sizeof (struct ip) + 8)    /* min */
      74: #define ICMP_ADVLEN(p)  (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
      75:     /* N.B.: must separately check that ip_hl >= 5 */
      76:
      77: /*
      78:  * Definition of type and code field values.
      79:  */
      80: #define ICMP_ECHOREPLY      0       /* echo reply */
      81: #define ICMP_UNREACH        3       /* dest unreachable, codes: */
      82: #define     ICMP_UNREACH_NET    0       /* bad net */
      83: #define     ICMP_UNREACH_HOST   1       /* bad host */
      84: #define     ICMP_UNREACH_PROTOCOL   2       /* bad protocol */
      85: #define     ICMP_UNREACH_PORT   3       /* bad port */
      86: #define     ICMP_UNREACH_NEEDFRAG   4       /* IP_DF caused drop */
      87: #define     ICMP_UNREACH_SRCFAIL    5       /* src route failed */
      88: #define ICMP_SOURCEQUENCH   4       /* packet lost, slow down */
      89: #define ICMP_REDIRECT       5       /* shorter route, codes: */
      90: #define     ICMP_REDIRECT_NET   0       /* for network */
      91: #define     ICMP_REDIRECT_HOST  1       /* for host */
      92: #define     ICMP_REDIRECT_TOSNET    2       /* for tos and net */
      93: #define     ICMP_REDIRECT_TOSHOST   3       /* for tos and host */
      94: #define ICMP_ECHO       8       /* echo service */
      95: #define ICMP_TIMXCEED       11      /* time exceeded, code: */
      96: #define     ICMP_TIMXCEED_INTRANS   0       /* ttl==0 in transit */
      97: #define     ICMP_TIMXCEED_REASS 1       /* ttl==0 in reass */
      98: #define ICMP_PARAMPROB      12      /* ip header bad */
      99: #define ICMP_TSTAMP     13      /* timestamp request */
     100: #define ICMP_TSTAMPREPLY    14      /* timestamp reply */
     101: #define ICMP_IREQ       15      /* information request */
     102: #define ICMP_IREQREPLY      16      /* information reply */
     103: #define ICMP_MASKREQ        17      /* address mask request */
     104: #define ICMP_MASKREPLY      18      /* address mask reply */
     105:
     106: #define ICMP_MAXTYPE        18
     107:
     108: #define ICMP_INFOTYPE(type) \
     109:     ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
     110:     (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
     111:     (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
     112:     (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)

#### Defined struct's

icmp defined in line 23; used 40 times

- in /usr/src/bin/ping/ping.c line 410-414(4), 457(2), 483(2), 740(2)
- in /usr/src/sys/netinet/ip_icmp.c line 57(2), 76(2), 90(2), 141(2), 171(2), 422(2), 429(2)
- in /usr/src/usr.sbin/timed/measure.c line 48-49(8), 116(2)
- in /usr/src/usr.sbin/traceroute/traceroute.c line 616(2), 631-633(4)

id_ip defined in line 47; never used
id_ts defined in line 42; never used
ih_idseq defined in line 30; never used

#### Defined macros

ICMP_ADVLEN defined in line 74; used 2 times

- in /usr/src/sys/netinet/ip_icmp.c line 220, 292

ICMP_ADVLENMIN defined in line 73; used 3 times

- in /usr/src/sys/netinet/ip_icmp.c line 162, 220, 292

ICMP_ECHO defined in line 94; used 2 times

- in line 109
- in /usr/src/bin/ping/ping.c line 415

ICMP_ECHOREPLY defined in line 80; used 3 times

- in line 109
- in /usr/src/bin/ping/ping.c line 484
- in /usr/src/sys/netinet/ip_icmp.c line 239

ICMP_INFOTYPE defined in line 108; used 1 times

- in /usr/src/sys/netinet/ip_icmp.c line 76

ICMP_IREQ defined in line 101; used 1 times

- in line 111

ICMP_IREQREPLY defined in line 102; used 4 times

- in line 111
- in /usr/src/new/crash/inet.c line 297, 314
- in /usr/src/sys/netinet/ip_icmp.c line 257

ICMP_MASKLEN defined in line 72; used 1 times

- in /usr/src/sys/netinet/ip_icmp.c line 269

ICMP_MASKREPLY defined in line 104; used 3 times

- in line 112
- in /usr/src/bin/ping/ping.c line 865
- in /usr/src/sys/netinet/ip_icmp.c line 276

ICMP_MASKREQ defined in line 103; used 2 times

- in line 112
- in /usr/src/bin/ping/ping.c line 860

ICMP_MAXTYPE defined in line 106; used 4 times

- in /usr/src/sys/netinet/ip_icmp.c line 91, 187
- in /usr/src/ucb/netstat/inet.c line 312, 329

ICMP_MINLEN defined in line 70; used 4 times

- in /usr/src/bin/ping/ping.c line 473
- in /usr/src/sys/netinet/ip_icmp.c line 88, 158
- in /usr/src/usr.sbin/traceroute/traceroute.c line 624

ICMP_PARAMPROB defined in line 98; used 2 times

- in /usr/src/sys/netinet/ip_icmp.c line 99
- in /usr/src/sys/netinet/ip_input.c line 529

ICMP_REDIRECT defined in line 89; used 5 times

- in /usr/src/sys/netinet/ip_icmp.c line 66, 75, 95
- in /usr/src/sys/netinet/ip_input.c line 933, 968

ICMP_REDIRECT_HOST defined in line 91; used 2 times

- in /usr/src/sys/netinet/ip_input.c line 937-941(2)

ICMP_REDIRECT_NET defined in line 90; used 2 times

- in /usr/src/sys/netinet/ip_icmp.c line 310
- in /usr/src/sys/netinet/ip_input.c line 934

ICMP_REDIRECT_TOSHOST defined in line 93; never used
ICMP_REDIRECT_TOSNET defined in line 92; used 1 times

- in /usr/src/sys/netinet/ip_icmp.c line 310

ICMP_SOURCEQUENCH defined in line 88; used 1 times

- in /usr/src/sys/netinet/ip_input.c line 989

ICMP_TIMXCEED defined in line 95; used 3 times

- in /usr/src/sys/netinet/ip_input.c line 875
- in /usr/src/usr.sbin/traceroute/traceroute.c line 636, 647

ICMP_TIMXCEED_INTRANS defined in line 96; used 2 times

- in /usr/src/sys/netinet/ip_input.c line 875
- in /usr/src/usr.sbin/traceroute/traceroute.c line 636

ICMP_TIMXCEED_REASS defined in line 97; never used
ICMP_TSLEN defined in line 71; used 1 times

- in /usr/src/sys/netinet/ip_icmp.c line 243

ICMP_TSTAMP defined in line 99; used 2 times

- in line 110
- in /usr/src/usr.sbin/timed/measure.c line 80

ICMP_TSTAMPREPLY defined in line 100; used 3 times

- in line 110
- in /usr/src/sys/netinet/ip_icmp.c line 247
- in /usr/src/usr.sbin/timed/measure.c line 117

ICMP_UNREACH defined in line 81; used 8 times

- in /usr/src/sys/netinet/ip_input.c line 575, 601, 633, 690, 893, 964
- in /usr/src/sys/netinet/udp_usrreq.c line 136
- in /usr/src/usr.sbin/traceroute/traceroute.c line 637

ICMP_UNREACH_HOST defined in line 83; used 4 times

- in /usr/src/sys/netinet/ip_input.c line 634, 893, 975, 994

ICMP_UNREACH_NEEDFRAG defined in line 86; used 1 times

- in /usr/src/sys/netinet/ip_input.c line 981

ICMP_UNREACH_NET defined in line 82; used 1 times

- in /usr/src/sys/netinet/ip_input.c line 977

ICMP_UNREACH_PORT defined in line 85; used 2 times

- in /usr/src/sys/netinet/ip_input.c line 985
- in /usr/src/sys/netinet/udp_usrreq.c line 136

ICMP_UNREACH_PROTOCOL defined in line 84; never used
ICMP_UNREACH_SRCFAIL defined in line 87; used 3 times

- in /usr/src/sys/netinet/ip_input.c line 576, 602, 691

icmp_data defined in line 59; used 14 times

- in /usr/src/bin/ping/ping.c line 489-492(2), 528, 534, 773-784(4), 806-809(2), 829-832(2), 838-841(2)

icmp_gwaddr defined in line 37; used 4 times

- in /usr/src/bin/ping/ping.c line 805
- in /usr/src/sys/netinet/ip_icmp.c line 96, 304-308(2)

icmp_id defined in line 38; used 4 times

- in /usr/src/bin/ping/ping.c line 419, 485
- in /usr/src/usr.sbin/timed/measure.c line 83, 118

icmp_ip defined in line 57; used 21 times

- in line 74
- in /usr/src/bin/ping/ping.c line 490, 774, 782, 807, 830, 839
- in /usr/src/sys/netinet/ip_icmp.c line 104-105(2), 219(2), 226-231(4), 307-320(4)
- in /usr/src/usr.sbin/traceroute/traceroute.c line 641, 652

icmp_mask defined in line 58; used 1 times

- in /usr/src/sys/netinet/ip_icmp.c line 277

icmp_otime defined in line 54; used 1 times

- in /usr/src/usr.sbin/timed/measure.c line 96

icmp_pptr defined in line 36; used 1 times

- in /usr/src/sys/netinet/ip_icmp.c line 100

icmp_rtime defined in line 55; used 4 times

- in /usr/src/sys/netinet/ip_icmp.c line 248-249(2)
- in /usr/src/usr.sbin/timed/measure.c line 84, 132

icmp_seq defined in line 39; used 7 times

- in /usr/src/bin/ping/ping.c line 418-421(2), 504-509(2), 521
- in /usr/src/usr.sbin/timed/measure.c line 89, 118

icmp_ttime defined in line 56; used 2 times

- in /usr/src/sys/netinet/ip_icmp.c line 249
- in /usr/src/usr.sbin/timed/measure.c line 85

icmp_void defined in line 40; used 1 times

- in /usr/src/sys/netinet/ip_icmp.c line 98

#### Usage of this include

ip_icmp.h used 12 times

- in /usr/src/bin/ping/ping.c line 72
- in /usr/src/bin/sysctl/sysctl.c line 51
- in /usr/src/new/crash/inet.c line 22
- in /usr/src/sys/netinet/ip_icmp.c line 32
- in /usr/src/sys/netinet/ip_input.c line 34
- in /usr/src/sys/netinet/tcp_subr.c line 32
- in /usr/src/sys/netinet/udp_usrreq.c line 32
- in /usr/src/ucb/PORT/systat/netstat.c line 25
- in /usr/src/ucb/netstat/inet.c line 33
- in /usr/src/usr.sbin/timed/cmds.c line 14
- in /usr/src/usr.sbin/timed/measure.c line 15
- in /usr/src/usr.sbin/traceroute/traceroute.c line 205

Last modified: 1988-04-27 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1895 |