Add support for parsing PW Ethernet and Enhanced MPLS parsing

This commit is contained in:
luwenpeng
2024-06-02 00:07:33 +08:00
parent f3b92a8a15
commit 18fe1e2e41
13 changed files with 615 additions and 250 deletions

View File

@@ -7,6 +7,7 @@ extern "C"
#endif
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#define __FAVOR_BSD 1
#include <netinet/udp.h>
@@ -73,6 +74,10 @@ static inline void udp_hdr_set_checksum(struct udphdr *hdr, uint16_t sum)
hdr->uh_sum = htons(sum);
}
/******************************************************************************
* print
******************************************************************************/
static inline int udp_hdr_to_str(const struct udphdr *hdr, char *buf, size_t size)
{
memset(buf, 0, size);