mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Add struct example and decorator
This commit is contained in:
@ -9,11 +9,19 @@ def bpfglobal(func):
|
||||
func._is_bpfglobal = True
|
||||
return func
|
||||
|
||||
|
||||
def map(func):
|
||||
"""Decorator to mark a function as a BPF map."""
|
||||
func._is_map = True
|
||||
return func
|
||||
|
||||
|
||||
def struct(cls):
|
||||
"""Decorator to mark a class as a BPF struct."""
|
||||
cls._is_struct = True
|
||||
return cls
|
||||
|
||||
|
||||
def section(name: str):
|
||||
def wrapper(fn):
|
||||
fn._section = name
|
||||
|
||||
Reference in New Issue
Block a user