Finished adapting the code to tcp packets (+ researched a lot about xdp and ebpf, we should be OK with xdps, found a lot of ideas)

This commit is contained in:
h3xduck
2021-11-23 19:55:44 -05:00
parent 516e98748c
commit 72fddcac62
12 changed files with 319 additions and 1503 deletions

View File

@@ -0,0 +1,13 @@
#ifndef __PACKET_MANAGER_H__
#define __PACKET_MANAGER_H__
#include <linux/bpf.h>
#include <linux/if_ether.h>
static __always_inline int ethernet_header_bound_check(struct ethhdr *eth, void* data_end){
if ((void *)eth + sizeof(struct ethhdr) > data_end){
return -1;
}
return 0; //OK
}
#endif