mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/ipv6-configure-checks'
* origin/topic/jsiwek/ipv6-configure-checks: Add more support for <netinet/ip6.h>'s that lack some structure definitions. Closes #810.
This commit is contained in:
commit
ecfdf7d33c
5 changed files with 125 additions and 8 deletions
5
CHANGES
5
CHANGES
|
@ -1,4 +1,9 @@
|
|||
|
||||
2.0-276 | 2012-04-17 17:35:56 -0700
|
||||
|
||||
* Add more support for <netinet/ip6.h>'s that lack some structure
|
||||
definitions. (Jon Siwek)
|
||||
|
||||
2.0-273 | 2012-04-16 18:08:56 -0700
|
||||
|
||||
* Removing QR flag from DNS log in response, which should not have
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
2.0-273
|
||||
2.0-276
|
||||
|
|
44
config.h.in
44
config.h.in
|
@ -152,3 +152,47 @@
|
|||
#ifndef HAVE_DLT_PPP_SERIAL
|
||||
#define DLT_PPP_SERIAL @DLT_PPP_SERIAL@
|
||||
#endif
|
||||
|
||||
/* IPv6 Next Header values defined by RFC 3542 */
|
||||
#cmakedefine HAVE_IPPROTO_HOPOPTS
|
||||
#ifndef HAVE_IPPROTO_HOPOPTS
|
||||
#define IPPROTO_HOPOPTS 0
|
||||
#endif
|
||||
#cmakedefine HAVE_IPPROTO_IPV6
|
||||
#ifndef HAVE_IPPROTO_IPV6
|
||||
#define IPPROTO_IPV6 41
|
||||
#endif
|
||||
#cmakedefine HAVE_IPPROTO_ROUTING
|
||||
#ifndef HAVE_IPPROTO_ROUTING
|
||||
#define IPPROTO_ROUTING 43
|
||||
#endif
|
||||
#cmakedefine HAVE_IPPROTO_FRAGMENT
|
||||
#ifndef HAVE_IPPROTO_FRAGMENT
|
||||
#define IPPROTO_FRAGMENT 44
|
||||
#endif
|
||||
#cmakedefine HAVE_IPPROTO_ESP
|
||||
#ifndef HAVE_IPPROTO_ESP
|
||||
#define IPPROTO_ESP 50
|
||||
#endif
|
||||
#cmakedefine HAVE_IPPROTO_AH
|
||||
#ifndef HAVE_IPPROTO_AH
|
||||
#define IPPROTO_AH 51
|
||||
#endif
|
||||
#cmakedefine HAVE_IPPROTO_ICMPV6
|
||||
#ifndef HAVE_IPPROTO_ICMPV6
|
||||
#define IPPROTO_ICMPV6 58
|
||||
#endif
|
||||
#cmakedefine HAVE_IPPROTO_NONE
|
||||
#ifndef HAVE_IPPROTO_NONE
|
||||
#define IPPROTO_NONE 59
|
||||
#endif
|
||||
#cmakedefine HAVE_IPPROTO_DSTOPTS
|
||||
#ifndef HAVE_IPPROTO_DSTOPTS
|
||||
#define IPPROTO_DSTOPTS 60
|
||||
#endif
|
||||
|
||||
/* IPv6 options structure defined by RFC 3542 */
|
||||
#cmakedefine HAVE_IP6_OPT
|
||||
|
||||
/* Common IPv6 extension structure */
|
||||
#cmakedefine HAVE_IP6_EXT
|
||||
|
|
1
src/IP.h
1
src/IP.h
|
@ -12,7 +12,6 @@
|
|||
#include <vector>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/ip6.h>
|
||||
|
||||
#ifdef ENABLE_MOBILE_IPV6
|
||||
|
||||
|
|
|
@ -31,13 +31,82 @@ typedef enum { IPv4, IPv6 } IPFamily;
|
|||
|
||||
#ifdef HAVE_NETINET_IP6_H
|
||||
#include <netinet/ip6.h>
|
||||
#else
|
||||
struct ip6_hdr {
|
||||
uint16 ip6_plen;
|
||||
uint8 ip6_nxt;
|
||||
uint8 ip6_hlim;
|
||||
|
||||
#ifndef HAVE_IP6_OPT
|
||||
struct ip6_opt {
|
||||
uint8 ip6o_type;
|
||||
uint8 ip6o_len;
|
||||
};
|
||||
#endif
|
||||
#endif // HAVE_IP6_OPT
|
||||
|
||||
#ifndef HAVE_IP6_EXT
|
||||
struct ip6_ext {
|
||||
uint8 ip6e_nxt;
|
||||
uint8 ip6e_len;
|
||||
};
|
||||
#endif // HAVE_IP6_EXT
|
||||
|
||||
#else
|
||||
|
||||
struct ip6_hdr {
|
||||
union {
|
||||
struct ip6_hdrctl {
|
||||
uint32 ip6_un1_flow; /* 4 bits version, 8 bits TC, 20 bits
|
||||
flow-ID */
|
||||
uint16 ip6_un1_plen; /* payload length */
|
||||
uint8 ip6_un1_nxt; /* next header */
|
||||
uint8 ip6_un1_hlim; /* hop limit */
|
||||
} ip6_un1;
|
||||
uint8 ip6_un2_vfc; /* 4 bits version, top 4 bits tclass */
|
||||
} ip6_ctlun;
|
||||
struct in6_addr ip6_src; /* source address */
|
||||
struct in6_addr ip6_dst; /* destination address */
|
||||
};
|
||||
|
||||
#define ip6_vfc ip6_ctlun.ip6_un2_vfc
|
||||
#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
|
||||
#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
|
||||
#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
|
||||
#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
|
||||
#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
|
||||
|
||||
struct ip6_opt {
|
||||
uint8 ip6o_type;
|
||||
uint8 ip6o_len;
|
||||
};
|
||||
|
||||
struct ip6_ext {
|
||||
uint8 ip6e_nxt;
|
||||
uint8 ip6e_len;
|
||||
};
|
||||
|
||||
struct ip6_frag {
|
||||
uint8 ip6f_nxt; /* next header */
|
||||
uint8 ip6f_reserved; /* reserved field */
|
||||
uint16 ip6f_offlg; /* offset, reserved, and flag */
|
||||
uint32 ip6f_ident; /* identification */
|
||||
};
|
||||
|
||||
struct ip6_hbh {
|
||||
uint8 ip6h_nxt; /* next header */
|
||||
uint8 ip6h_len; /* length in units of 8 octets */
|
||||
/* followed by options */
|
||||
};
|
||||
|
||||
struct ip6_dest {
|
||||
uint8 ip6d_nxt; /* next header */
|
||||
uint8 ip6d_len; /* length in units of 8 octets */
|
||||
/* followed by options */
|
||||
};
|
||||
|
||||
struct ip6_rthdr {
|
||||
uint8 ip6r_nxt; /* next header */
|
||||
uint8 ip6r_len; /* length in units of 8 octets */
|
||||
uint8 ip6r_type; /* routing type */
|
||||
uint8 ip6r_segleft; /* segments left */
|
||||
/* followed by routing type specific data */
|
||||
};
|
||||
#endif // HAVE_NETINET_IP6_H
|
||||
|
||||
// For Solaris.
|
||||
#if !defined(TCPOPT_WINDOW) && defined(TCPOPT_WSCALE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue