mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
fix context debug info repetition circular reference error
This commit is contained in:
@ -3,6 +3,12 @@ from pythonbpf import bpf, section, bpfglobal, compile_to_ir, compile
|
||||
from vmlinux import struct_xdp_md
|
||||
from vmlinux import XDP_PASS
|
||||
|
||||
@bpf
|
||||
@section("xdp")
|
||||
def print_xdp_dat2a(ct2x: struct_xdp_md) -> c_int64:
|
||||
data = ct2x.data # 32-bit field: packet start pointer
|
||||
print(f"ct2x->data = {data}")
|
||||
return c_int64(XDP_PASS)
|
||||
|
||||
@bpf
|
||||
@section("xdp")
|
||||
@ -12,13 +18,6 @@ def print_xdp_data(ctx: struct_xdp_md) -> c_int64:
|
||||
print(f"ctx->data = {something}")
|
||||
return c_int64(XDP_PASS)
|
||||
|
||||
@bpf
|
||||
@section("xdp")
|
||||
def print_xdp_dat2a(ct2x: struct_xdp_md) -> c_int64:
|
||||
data = ct2x.data # 32-bit field: packet start pointer
|
||||
print(f"ct2x->data = {data}")
|
||||
return c_int64(XDP_PASS)
|
||||
|
||||
@bpf
|
||||
@bpfglobal
|
||||
def LICENSE() -> str:
|
||||
|
||||
Reference in New Issue
Block a user