mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
19 lines
268 B
Python
19 lines
268 B
Python
from pythonbpf import compile, bpf, section, bpfglobal
|
|
from ctypes import c_void_p, c_int64
|
|
|
|
|
|
@bpf
|
|
@section("sometag1")
|
|
def sometag(ctx: c_void_p) -> c_int64:
|
|
a = 1 + 2 + 1
|
|
return c_int64(0)
|
|
|
|
|
|
@bpf
|
|
@bpfglobal
|
|
def LICENSE() -> str:
|
|
return "GPL"
|
|
|
|
|
|
compile()
|