mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-24 10:23:08 +08:00
13 lines
312 B
C
13 lines
312 B
C
#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 |