When the packet length is greater than the IP expected length, the padding data at the end of the frame will be trimmed.

This commit is contained in:
luwenpeng
2024-05-24 19:10:33 +08:00
parent 94fc1af6bd
commit 54385ed08b
6 changed files with 264 additions and 45 deletions

View File

@@ -45,6 +45,7 @@ struct packet
const char *data_ptr;
uint16_t data_len;
uint16_t trim_len; // trim eth padding
void *origin_ctx; // mbuff or pcap pointer
enum packet_action action;
@@ -53,7 +54,8 @@ struct packet
// return innermost payload
const char *packet_parse(struct packet *pkt, const char *data, uint16_t len);
void packet_print(const struct packet *pkt);
void packet_print_str(const struct packet *pkt);
void packet_print_table(const struct packet *pkt);
// direction 1: E2I
// direction 0: I2E