X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fipv4.h;h=2761582f78431de9a7c888eb869f37ba44962934;hb=5c76d51d0badd8a35e3883f18a5792e830448768;hp=940c239c985737669802aca300d80c34f78369af;hpb=a22041922f160667573e9a5ae3f4195e1668906a;p=tinc diff --git a/src/ipv4.h b/src/ipv4.h index 940c239c..2761582f 100644 --- a/src/ipv4.h +++ b/src/ipv4.h @@ -1,7 +1,10 @@ +#ifndef TINC_IPV4_H +#define TINC_IPV4_H + /* ipv4.h -- missing IPv4 related definitions Copyright (C) 2005 Ivo Timmermans - 2006 Guus Sliepen + 2006-2012 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 @@ -18,9 +21,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __TINC_IPV4_H__ -#define __TINC_IPV4_H__ - #ifndef AF_INET #define AF_INET 2 #endif @@ -41,6 +41,14 @@ #define ICMP_NET_UNKNOWN 6 #endif +#ifndef ICMP_TIME_EXCEEDED +#define ICMP_TIME_EXCEEDED 11 +#endif + +#ifndef ICMP_EXC_TTL +#define ICMP_EXC_TTL 0 +#endif + #ifndef ICMP_NET_UNREACH #define ICMP_NET_UNREACH 0 #endif @@ -56,15 +64,15 @@ #ifndef HAVE_STRUCT_IP struct ip { #if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int ip_hl:4; - unsigned int ip_v:4; + unsigned int ip_hl: 4; + unsigned int ip_v: 4; #else - unsigned int ip_v:4; - unsigned int ip_hl:4; + unsigned int ip_v: 4; + unsigned int ip_hl: 4; #endif uint8_t ip_tos; uint16_t ip_len; - uint16_t ip_id; + uint16_t ip_id; uint16_t ip_off; #define IP_RF 0x8000 #define IP_DF 0x4000 @@ -73,7 +81,7 @@ struct ip { uint8_t ip_p; uint16_t ip_sum; struct in_addr ip_src, ip_dst; -} __attribute__ ((__packed__)); +} __attribute__((__gcc_struct__)) __attribute((__packed__)); #endif #ifndef IP_OFFMASK @@ -135,7 +143,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__)); +} __attribute__((__gcc_struct__)) __attribute((__packed__)); #endif -#endif /* __TINC_IPV4_H__ */ +#endif