#define IPV6_SET_L4PROTO(p,proto) (p)->ip6vars.l4proto = proto
+
/* ONLY call these functions after making sure that:
* 1. p->ip6h is set
* 2. p->ip6h is valid (len is correct)
#define IPV6_GET_L4PROTO(p) \
((p)->ip6vars.l4proto)
+/** \brief get the highest proto/next header field we know */
+#define IPV6_GET_UPPER_PROTO(p) (p)->ip6eh.ip6_exthdrs_cnt ? \
+ (p)->ip6eh.ip6_exthdrs[(p)->ip6eh.ip6_exthdrs_cnt - 1].next : IPV6_GET_NH((p))
+
/* helper structure with parsed ipv6 info */
typedef struct IPV6Vars_
{
/* Retrieve proto regardless of IP version */
#define IP_GET_IPPROTO(p) \
- (PKT_IS_IPV4((p))? IPV4_GET_IPPROTO((p)) : (PKT_IS_IPV6((p))? IPV6_GET_NH((p)) : 0))
+ (PKT_IS_IPV4((p))? IPV4_GET_IPPROTO((p)) : (PKT_IS_IPV6((p))? IPV6_GET_UPPER_PROTO((p)) : 0))
/* structure to store the sids/gids/etc the detection engine
* found in this packet */