TSG-13684 tsg-service-chaining-engine使用VLAN封装Packet并执行Traffic Mirroring
This commit is contained in:
@@ -51,7 +51,7 @@ extern marsio_buff_t *marsio_mbuff_dup(marsio_buff_t *m);
|
||||
memcpy(ptr, data, len); \
|
||||
}
|
||||
|
||||
#define build_mbuf_for_raw_pkt(mbuf, data, len, id, is_decrypt) \
|
||||
#define build_mbuf_for_data_pkt(mbuf, data, len, id, is_decrypt) \
|
||||
{ \
|
||||
struct metadata meta; \
|
||||
set_metadata(meta, id, 0, 0, is_decrypt); \
|
||||
@@ -164,7 +164,7 @@ inline void gtest_frame_run(struct gtest_frame *instance, marsio_buff_t *tx_mbuf
|
||||
}
|
||||
else
|
||||
{
|
||||
EXPECT_TRUE(packet_io_thread_polling_endpoint(sce_ctx->io, thread_ctx) == 1);
|
||||
EXPECT_TRUE(packet_io_thread_polling_endpoint_l3(sce_ctx->io, thread_ctx) == 1);
|
||||
}
|
||||
|
||||
rx_mbuf = marsio_get_send_mbuff(mr_instance);
|
||||
@@ -204,16 +204,16 @@ inline void gtest_frame_log(struct gtest_frame *instance)
|
||||
system(cmdline);
|
||||
}
|
||||
|
||||
inline int mbuff_cmp_payload(marsio_buff_t *raw_pkt, marsio_buff_t *vxlan_pkt)
|
||||
inline int mbuff_cmp_payload(marsio_buff_t *buff, marsio_buff_t *vxlan_pkt)
|
||||
{
|
||||
struct g_vxlan *g_vxlan_hdr = NULL;
|
||||
int raw_pkt_len = marsio_buff_datalen(raw_pkt);
|
||||
char *raw_pkt_data = marsio_buff_mtod(raw_pkt);
|
||||
int buff_len = marsio_buff_datalen(buff);
|
||||
char *buff_data = marsio_buff_mtod(buff);
|
||||
|
||||
int vxlan_pkt_len = marsio_buff_datalen(vxlan_pkt);
|
||||
char *vxlan_pkt_data = marsio_buff_mtod(vxlan_pkt);
|
||||
|
||||
if (raw_pkt_len + 50 != vxlan_pkt_len)
|
||||
if (buff_len + 50 != vxlan_pkt_len)
|
||||
{
|
||||
goto error_out;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ inline int mbuff_cmp_payload(marsio_buff_t *raw_pkt, marsio_buff_t *vxlan_pkt)
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
if (memcmp(raw_pkt_data, vxlan_pkt_data + 50, raw_pkt_len) != 0)
|
||||
if (memcmp(buff_data, vxlan_pkt_data + 50, buff_len) != 0)
|
||||
{
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user