Sha256: afe37c2add735532a7d5b38469ca9170d136eee991e0b066abc33485da7c6be5

Contents?: true

Size: 1.7 KB

Versions: 20

Compression:

Stored size: 1.7 KB

Contents

/*
 * ICMP header definitions
 *
 * Copyright (C) 2008-2013 NEC Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, version 2, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */


#ifndef ICMP_H
#define ICMP_H


typedef struct icmp_header {
  uint8_t type;
  uint8_t code;
  uint16_t csum;
  union {
    struct {
      uint16_t ident;
      uint16_t seq;
    } echo;
    uint32_t gateway;
    uint32_t pad;
  } icmp_data;
} icmp_header_t;


#define ICMP_TYPE_ECHOREP 0
#define ICMP_TYPE_UNREACH 3
#define ICMP_TYPE_SOURCEQUENCH 4
#define ICMP_TYPE_REDIRECT 5
#define ICMP_TYPE_ECHOREQ 8
#define ICMP_TYPE_ROUTERADV 9
#define ICMP_TYPE_ROUTERSOL 10
#define ICMP_TYPE_TIMEEXCEED 11
#define ICMP_TYPE_PARAMPROBLEM 12

// ICMP codes for Destination Unreachable
#define ICMP_CODE_NETUNREACH 0
#define ICMP_CODE_HOSTUNREACH 1
#define ICMP_CODE_PROTOUNREACH 2
#define ICMP_CODE_PORTUNREACH 3
#define ICMP_CODE_FRAGNEED 4
#define ICMP_CODE_SRCROUTEFAIL 5
#define ICMP_CODE_ADMINPROHIBIT 13

// ICMP codes for Time Exceeded
#define ICMP_CODE_TIMETOLIVE 0
#define ICMP_CODE_FRAGREASM 1


#endif // ICMP_H


/*
 * Local variables:
 * c-basic-offset: 2
 * indent-tabs-mode: nil
 * End:
 */

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
trema-0.4.7 src/lib/icmp.h
trema-0.4.6 src/lib/icmp.h
trema-0.4.5 src/lib/icmp.h
trema-0.4.4 src/lib/icmp.h
trema-0.4.3 src/lib/icmp.h
trema-0.4.2 src/lib/icmp.h
trema-0.4.1 src/lib/icmp.h
trema-0.4.0 src/lib/icmp.h
trema-0.3.21 src/lib/icmp.h
trema-0.3.20 src/lib/icmp.h
trema-0.3.19 src/lib/icmp.h
trema-0.3.18 src/lib/icmp.h
trema-0.3.17 src/lib/icmp.h
trema-0.3.16 src/lib/icmp.h
trema-0.3.15 src/lib/icmp.h
trema-0.3.14 src/lib/icmp.h
trema-0.3.13 src/lib/icmp.h
trema-0.3.12 src/lib/icmp.h
trema-0.3.11 src/lib/icmp.h
trema-0.3.10 src/lib/icmp.h