diff options
author | Yves-Alexis Perez <corsac@corsac.net> | 2017-04-01 16:26:44 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@corsac.net> | 2017-04-01 16:26:44 +0200 |
commit | 05ddd767992d68bb38c7f16ece142e8c2e9ae016 (patch) | |
tree | 302c618be306d4ed3c7f9fc58a1f6aaad4dd252f /src/libipsec/ip_packet.c | |
parent | 25663e04c3ab01ef8dc9f906608282319cfea2db (diff) | |
download | vyos-strongswan-05ddd767992d68bb38c7f16ece142e8c2e9ae016.tar.gz vyos-strongswan-05ddd767992d68bb38c7f16ece142e8c2e9ae016.zip |
New upstream version 5.5.2
Diffstat (limited to 'src/libipsec/ip_packet.c')
-rw-r--r-- | src/libipsec/ip_packet.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/libipsec/ip_packet.c b/src/libipsec/ip_packet.c index 0fdd5d340..78b4c407a 100644 --- a/src/libipsec/ip_packet.c +++ b/src/libipsec/ip_packet.c @@ -20,11 +20,40 @@ #include <utils/debug.h> #include <sys/types.h> + +#ifndef WIN32 #include <netinet/in.h> #include <netinet/ip.h> #ifdef HAVE_NETINET_IP6_H #include <netinet/ip6.h> #endif +#else +struct ip { +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t ip_hl: 4; + uint8_t ip_v: 4; +#elif BYTE_ORDER == BIG_ENDIAN + uint8_t ip_v: 4; + uint8_t ip_hl: 4; +#endif + uint8_t ip_tos; + uint16_t ip_len; + uint16_t ip_id; + uint16_t ip_off; + uint8_t ip_ttl; + uint8_t ip_p; + uint16_t ip_sum; + struct in_addr ip_src, ip_dst; +} __attribute__((packed)); +struct ip6_hdr { + uint32_t ip6_flow; /* 4 bit version, 8 bit TC, 20 bit flow label */ + uint16_t ip6_plen; + uint8_t ip6_nxt; + uint8_t ip6_hlim; + struct in6_addr ip6_src, ip6_dst; +} __attribute__((packed)); +#define HAVE_NETINET_IP6_H /* not really, but we only need the struct above */ +#endif /** * TCP header, defined here because platforms disagree regarding member names |