2 ipv4.h -- missing IPv4 related definitions
4 Copyright (C) 2003-2004 Ivo Timmermans <ivo@tinc-vpn.org>
5 2003-2004 Guus Sliepen <guus@tinc-vpn.org>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32 #define IPPROTO_ICMP 1
35 #ifndef ICMP_DEST_UNREACH
36 #define ICMP_DEST_UNREACH 3
39 #ifndef ICMP_NET_UNKNOWN
40 #define ICMP_NET_UNKNOWN 6
43 #ifndef ICMP_NET_UNREACH
44 #define ICMP_NET_UNREACH 0
51 #ifndef HAVE_STRUCT_IP
53 #if __BYTE_ORDER == __LITTLE_ENDIAN
67 #define IP_OFFMASK 0x1fff
71 struct in_addr ip_src, ip_dst;
72 } __attribute__ ((__packed__));
75 #ifndef HAVE_STRUCT_ICMP
82 struct in_addr ih_gwaddr;
96 uint8_t irt_num_addrs;
98 uint16_t irt_lifetime;
101 #define icmp_pptr icmp_hun.ih_pptr
102 #define icmp_gwaddr icmp_hun.ih_gwaddr
103 #define icmp_id icmp_hun.ih_idseq.icd_id
104 #define icmp_seq icmp_hun.ih_idseq.icd_seq
105 #define icmp_void icmp_hun.ih_void
106 #define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
107 #define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
108 #define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
109 #define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
110 #define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
123 #define icmp_otime icmp_dun.id_ts.its_otime
124 #define icmp_rtime icmp_dun.id_ts.its_rtime
125 #define icmp_ttime icmp_dun.id_ts.its_ttime
126 #define icmp_ip icmp_dun.id_ip.idi_ip
127 #define icmp_radv icmp_dun.id_radv
128 #define icmp_mask icmp_dun.id_mask
129 #define icmp_data icmp_dun.id_data
130 } __attribute__ ((__packed__));