reactor packet I/O & duplicated packet filter & evicted session filter
This commit is contained in:
@@ -8,17 +8,15 @@ extern "C"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "timestamp.h"
|
||||
#include "udp_utils.h"
|
||||
#include "tcp_utils.h"
|
||||
#include "ipv4_utils.h"
|
||||
#include "ipv6_utils.h"
|
||||
#include "packet_utils.h"
|
||||
#include "ip_reassembly.h"
|
||||
|
||||
static inline void packet_set_ipv4_src_addr(struct packet *pkt, uint32_t saddr)
|
||||
{
|
||||
const struct layer_record *ipv4_layer = packet_get_innermost_layer(pkt, LAYER_TYPE_IPV4);
|
||||
const struct layer *ipv4_layer = packet_get_innermost_layer(pkt, LAYER_TYPE_IPV4);
|
||||
EXPECT_TRUE(ipv4_layer);
|
||||
struct ip *hdr = (struct ip *)ipv4_layer->hdr_ptr;
|
||||
ipv4_hdr_set_src_addr(hdr, saddr);
|
||||
@@ -26,7 +24,7 @@ static inline void packet_set_ipv4_src_addr(struct packet *pkt, uint32_t saddr)
|
||||
|
||||
static inline void packet_set_ipv6_src_addr(struct packet *pkt, struct in6_addr saddr)
|
||||
{
|
||||
const struct layer_record *ipv6_layer = packet_get_innermost_layer(pkt, LAYER_TYPE_IPV6);
|
||||
const struct layer *ipv6_layer = packet_get_innermost_layer(pkt, LAYER_TYPE_IPV6);
|
||||
EXPECT_TRUE(ipv6_layer);
|
||||
struct ip6_hdr *hdr = (struct ip6_hdr *)ipv6_layer->hdr_ptr;
|
||||
ipv6_hdr_set_src_in6_addr(hdr, saddr);
|
||||
@@ -34,7 +32,7 @@ static inline void packet_set_ipv6_src_addr(struct packet *pkt, struct in6_addr
|
||||
|
||||
static inline void packet_set_ipv6_frag_offset(struct packet *pkt, uint16_t offset)
|
||||
{
|
||||
const struct layer_record *ipv6_layer = (struct layer_record *)packet_get_innermost_layer(pkt, LAYER_TYPE_IPV6);
|
||||
const struct layer *ipv6_layer = (struct layer *)packet_get_innermost_layer(pkt, LAYER_TYPE_IPV6);
|
||||
EXPECT_TRUE(ipv6_layer);
|
||||
struct ip6_hdr *hdr = (struct ip6_hdr *)ipv6_layer->hdr_ptr;
|
||||
struct ip6_frag *frag_hdr = ipv6_hdr_get_frag_ext(hdr);
|
||||
|
||||
Reference in New Issue
Block a user