Skip to content

Commit 4065301

Browse files
committed
Parser - extract mpls
1 parent e13d556 commit 4065301

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

input/parser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ uint16_t process_mpls_stack(const u_char *data_ptr, uint16_t data_len)
568568
uint16_t process_mpls(const u_char *data_ptr, uint16_t data_len, Packet *pkt)
569569
{
570570
Packet tmp;
571+
pkt->mplsTop = ntohl(*reinterpret_cast<const uint32_t *>(data_ptr));
571572
uint16_t length = process_mpls_stack(data_ptr, data_len);
572573
uint8_t next_hdr = (*(data_ptr + length) & 0xF0) >> 4;
573574

@@ -656,6 +657,7 @@ void parse_packet(parser_opt_t *opt, struct timeval ts, const uint8_t *data, uin
656657
pkt->tcp_window = 0;
657658
pkt->tcp_options = 0;
658659
pkt->tcp_mss = 0;
660+
pkt->mplsTop = 0;
659661

660662
uint32_t l3_hdr_offset = 0;
661663
uint32_t l4_hdr_offset = 0;

0 commit comments

Comments
 (0)