1/* 2 * Fundamental constants relating to ICMP Protocol 3 * 4 * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. 5 * 6 * Permission to use, copy, modify, and/or distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 * $Id: bcmicmp.h 384537 2013-02-12 04:27:03Z $ 19 */ 20 21#ifndef _bcmicmp_h_ 22#define _bcmicmp_h_ 23 24#ifndef _TYPEDEFS_H_ 25#include <typedefs.h> 26#endif 27 28/* This marks the start of a packed structure section. */ 29#include <packed_section_start.h> 30 31 32#define ICMP_TYPE_ECHO_REQUEST 8 /* ICMP type echo request */ 33#define ICMP_TYPE_ECHO_REPLY 0 /* ICMP type echo reply */ 34 35#define ICMP_CHKSUM_OFFSET 2 /* ICMP body checksum offset */ 36 37/* ICMP6 error and control message types */ 38#define ICMP6_DEST_UNREACHABLE 1 39#define ICMP6_PKT_TOO_BIG 2 40#define ICMP6_TIME_EXCEEDED 3 41#define ICMP6_PARAM_PROBLEM 4 42#define ICMP6_ECHO_REQUEST 128 43#define ICMP6_ECHO_REPLY 129 44#define ICMP_MCAST_LISTENER_QUERY 130 45#define ICMP_MCAST_LISTENER_REPORT 131 46#define ICMP_MCAST_LISTENER_DONE 132 47#define ICMP6_RTR_SOLICITATION 133 48#define ICMP6_RTR_ADVERTISEMENT 134 49#define ICMP6_NEIGH_SOLICITATION 135 50#define ICMP6_NEIGH_ADVERTISEMENT 136 51#define ICMP6_REDIRECT 137 52 53#define ICMP6_RTRSOL_OPT_OFFSET 8 54#define ICMP6_RTRADV_OPT_OFFSET 16 55#define ICMP6_NEIGHSOL_OPT_OFFSET 24 56#define ICMP6_NEIGHADV_OPT_OFFSET 24 57#define ICMP6_REDIRECT_OPT_OFFSET 40 58 59BWL_PRE_PACKED_STRUCT struct icmp6_opt { 60 uint8 type; /* Option identifier */ 61 uint8 length; /* Lenth including type and length */ 62 uint8 data[0]; /* Variable length data */ 63} BWL_POST_PACKED_STRUCT; 64 65#define ICMP6_OPT_TYPE_SRC_LINK_LAYER 1 66#define ICMP6_OPT_TYPE_TGT_LINK_LAYER 2 67#define ICMP6_OPT_TYPE_PREFIX_INFO 3 68#define ICMP6_OPT_TYPE_REDIR_HDR 4 69#define ICMP6_OPT_TYPE_MTU 5 70 71/* These fields are stored in network order */ 72BWL_PRE_PACKED_STRUCT struct bcmicmp_hdr { 73 uint8 type; /* Echo or Echo-reply */ 74 uint8 code; /* Always 0 */ 75 uint16 chksum; /* Icmp packet checksum */ 76} BWL_POST_PACKED_STRUCT; 77 78/* This marks the end of a packed structure section. */ 79#include <packed_section_end.h> 80 81#endif /* #ifndef _bcmicmp_h_ */ 82