X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=lib%2Fipv4.h;h=940c239c985737669802aca300d80c34f78369af;hp=39d914eff5414b8fa1ed515e09b1323f59d562b8;hb=d1cc637470edaed663e694fdeb290eb45cc9ecca;hpb=96ee04b678143defa1040f2defdd3424efedea11 diff --git a/lib/ipv4.h b/lib/ipv4.h index 39d914ef..940c239c 100644 --- a/lib/ipv4.h +++ b/lib/ipv4.h @@ -1,7 +1,7 @@ /* ipv4.h -- missing IPv4 related definitions - Copyright (C) 2003 Ivo Timmermans - 2003 Guus Sliepen + Copyright (C) 2005 Ivo Timmermans + 2006 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,11 +13,9 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id: ipv4.h,v 1.1.2.2 2003/07/18 13:42:35 guus Exp $ + 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 __TINC_IPV4_H__ @@ -35,6 +33,10 @@ #define ICMP_DEST_UNREACH 3 #endif +#ifndef ICMP_FRAG_NEEDED +#define ICMP_FRAG_NEEDED 4 +#endif + #ifndef ICMP_NET_UNKNOWN #define ICMP_NET_UNKNOWN 6 #endif @@ -43,6 +45,10 @@ #define ICMP_NET_UNREACH 0 #endif +#ifndef ICMP_NET_ANO +#define ICMP_NET_ANO 9 +#endif + #ifndef IP_MSS #define IP_MSS 576 #endif @@ -57,18 +63,21 @@ struct ip { unsigned int ip_hl:4; #endif uint8_t ip_tos; - u_short ip_len; - u_short ip_id; - u_short ip_off; + uint16_t ip_len; + uint16_t ip_id; + uint16_t ip_off; #define IP_RF 0x8000 #define IP_DF 0x4000 #define IP_MF 0x2000 -#define IP_OFFMASK 0x1fff uint8_t ip_ttl; uint8_t ip_p; - u_short ip_sum; + uint16_t ip_sum; struct in_addr ip_src, ip_dst; -}; +} __attribute__ ((__packed__)); +#endif + +#ifndef IP_OFFMASK +#define IP_OFFMASK 0x1fff #endif #ifndef HAVE_STRUCT_ICMP @@ -77,7 +86,7 @@ struct icmp { uint8_t icmp_code; uint16_t icmp_cksum; union { - u_char ih_pptr; + uint8_t ih_pptr; struct in_addr ih_gwaddr; struct ih_idseq { uint16_t icd_id; @@ -126,7 +135,7 @@ struct icmp { #define icmp_radv icmp_dun.id_radv #define icmp_mask icmp_dun.id_mask #define icmp_data icmp_dun.id_data -}; +} __attribute__ ((__packed__)); #endif #endif /* __TINC_IPV4_H__ */