format chore and pre commit hook addition

This commit is contained in:
2025-10-01 00:41:00 +05:30
parent 8658143b16
commit 8d5067996f
37 changed files with 83187 additions and 82671 deletions

View File

@ -1,15 +1,18 @@
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()

View File

@ -1,6 +1,7 @@
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:
@ -8,9 +9,11 @@ def sometag(ctx: c_void_p) -> c_int64:
a = 1 + b
return c_int64(a)
@bpf
@bpfglobal
def LICENSE() -> str:
return "GPL"
compile()

View File

@ -4,6 +4,7 @@ from pythonbpf.maps import HashMap
from ctypes import c_void_p, c_int64
@bpf
@map
def count() -> HashMap:
@ -22,9 +23,11 @@ def hello_world(ctx: c_void_p) -> c_int64:
return XDP_PASS
@bpf
@bpfglobal
def LICENSE() -> str:
return "GPL"
compile()

View File

@ -1,6 +1,7 @@
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:
@ -8,9 +9,11 @@ def sometag(ctx: c_void_p) -> c_int64:
return c_int64(5)
return c_int64(0)
@bpf
@bpfglobal
def LICENSE() -> str:
return "GPL"
compile()

View File

@ -1,6 +1,7 @@
from pythonbpf import compile, bpf, section, bpfglobal
from pythonbpf import compile, bpf, section
from ctypes import c_void_p, c_int64
# FAILS WHEN THERE IS NO LICENSE. which is wrong.
@bpf
@section("sometag1")
@ -8,4 +9,5 @@ def sometag(ctx: c_void_p) -> c_int64:
a = 1 + 2
return c_int64(0)
compile()

View File

@ -1,14 +1,17 @@
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:
return c_int64(1 - 1)
@bpf
@bpfglobal
def LICENSE() -> str:
return "GPL"
compile()