5 ipv4.h -- missing IPv4 related definitions
6 Copyright (C) 2005 Ivo Timmermans
7 2006-2012 Guus Sliepen <guus@tinc-vpn.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 #define IPPROTO_ICMP 1
34 #ifndef ICMP_DEST_UNREACH
35 #define ICMP_DEST_UNREACH 3
38 #ifndef ICMP_FRAG_NEEDED
39 #define ICMP_FRAG_NEEDED 4
42 #ifndef ICMP_NET_UNKNOWN
43 #define ICMP_NET_UNKNOWN 6
46 #ifndef ICMP_TIME_EXCEEDED
47 #define ICMP_TIME_EXCEEDED 11
51 #define ICMP_EXC_TTL 0
54 #ifndef ICMP_NET_UNREACH
55 #define ICMP_NET_UNREACH 0
59 #define ICMP_NET_ANO 9
66 #ifndef HAVE_STRUCT_IP
68 #if __BYTE_ORDER == __LITTLE_ENDIAN
69 unsigned int ip_hl: 4;
73 unsigned int ip_hl: 4;
85 struct in_addr ip_src, ip_dst;
90 #define IP_OFFMASK 0x1fff
93 #ifndef HAVE_STRUCT_ICMP
100 struct in_addr ih_gwaddr;
110 uint16_t ipm_nextmtu;
114 uint8_t irt_num_addrs;
116 uint16_t irt_lifetime;
119 #define icmp_pptr icmp_hun.ih_pptr
120 #define icmp_gwaddr icmp_hun.ih_gwaddr
121 #define icmp_id icmp_hun.ih_idseq.icd_id
122 #define icmp_seq icmp_hun.ih_idseq.icd_seq
123 #define icmp_void icmp_hun.ih_void
124 #define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
125 #define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
126 #define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
127 #define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
128 #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
141 #define icmp_otime icmp_dun.id_ts.its_otime
142 #define icmp_rtime icmp_dun.id_ts.its_rtime
143 #define icmp_ttime icmp_dun.id_ts.its_ttime
144 #define icmp_ip icmp_dun.id_ip.idi_ip
145 #define icmp_radv icmp_dun.id_radv
146 #define icmp_mask icmp_dun.id_mask
147 #define icmp_data icmp_dun.id_data