mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-27 03:43:09 +08:00
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:
13
src/include/packet_manager.h
Normal file
13
src/include/packet_manager.h
Normal 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
|
||||
Reference in New Issue
Block a user