From a0ee049ec6f426d645cd84be9969ca70d47fe0b5 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Sun, 3 Feb 2013 13:11:32 +0100 Subject: [PATCH] stddef: add more useful CPP constants Signed-off-by: Daniel Borkmann --- configs/stddef.h | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/configs/stddef.h b/configs/stddef.h index 1d1f9d82..48e46b3f 100644 --- a/configs/stddef.h +++ b/configs/stddef.h @@ -81,6 +81,13 @@ #define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frames */ #define ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */ +#define INADDR_BROADCAST 0xffffffff /* 255.255.255.255 */ +#define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */ +#define INADDR_UNSPEC_GROUP 0xe0000000 /* 224.0.0.0 */ +#define INADDR_ALLHOSTS_GROUP 0xe0000001 /* 224.0.0.1 */ +#define INADDR_ALLRTRS_GROUP 0xe0000002 /* 224.0.0.2 */ +#define INADDR_MAX_LOCAL_GROUP 0xe00000ff /* 224.0.0.255 */ + #define IPPROTO_ICMP 1 /* Internet Control Message Protocol */ #define IPPROTO_IGMP 2 /* Internet Group Management Protocol */ #define IPPROTO_IPIP 4 /* IPIP tunnels (older KA9Q tunnels use 94) */ @@ -100,3 +107,57 @@ #define IPPROTO_COMP 108 /* Compression Header protocol */ #define IPPROTO_SCTP 132 /* Stream Control Transport Protocol */ #define IPPROTO_UDPLITE 136 /* UDP-Lite (RFC 3828) */ + +#define ICMP_ECHOREPLY 0 /* Echo Reply */ +#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */ +#define ICMP_SOURCE_QUENCH 4 /* Source Quench */ +#define ICMP_REDIRECT 5 /* Redirect (change route) */ +#define ICMP_ECHO 8 /* Echo Request */ +#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */ +#define ICMP_PARAMETERPROB 12 /* Parameter Problem */ +#define ICMP_TIMESTAMP 13 /* Timestamp Request */ +#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */ +#define ICMP_INFO_REQUEST 15 /* Information Request */ +#define ICMP_INFO_REPLY 16 /* Information Reply */ +#define ICMP_ADDRESS 17 /* Address Mask Request */ +#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */ + +/* Codes for UNREACH. */ +#define ICMP_NET_UNREACH 0 /* Network Unreachable */ +#define ICMP_HOST_UNREACH 1 /* Host Unreachable */ +#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */ +#define ICMP_PORT_UNREACH 3 /* Port Unreachable */ +#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */ +#define ICMP_SR_FAILED 5 /* Source Route failed */ +#define ICMP_NET_UNKNOWN 6 +#define ICMP_HOST_UNKNOWN 7 +#define ICMP_HOST_ISOLATED 8 +#define ICMP_NET_ANO 9 +#define ICMP_HOST_ANO 10 +#define ICMP_NET_UNR_TOS 11 +#define ICMP_HOST_UNR_TOS 12 +#define ICMP_PKT_FILTERED 13 /* Packet filtered */ +#define ICMP_PREC_VIOLATION 14 /* Precedence violation */ +#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */ +#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */ + +/* Codes for REDIRECT. */ +#define ICMP_REDIR_NET 0 /* Redirect Net */ +#define ICMP_REDIR_HOST 1 /* Redirect Host */ +#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */ +#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */ + +/* Codes for TIME_EXCEEDED. */ +#define ICMP_EXC_TTL 0 /* TTL count exceeded */ +#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */ + +#define TCP_FLAG_CWR 0x00800000 +#define TCP_FLAG_ECE 0x00400000 +#define TCP_FLAG_URG 0x00200000 +#define TCP_FLAG_ACK 0x00100000 +#define TCP_FLAG_PSH 0x00080000 +#define TCP_FLAG_RST 0x00040000 +#define TCP_FLAG_SYN 0x00020000 +#define TCP_FLAG_FIN 0x00010000 +#define TCP_RESERVED_BITS 0x0F000000 +#define TCP_DATA_OFFSET 0xF0000000 -- 2.11.4.GIT