Fix imports for BPF_GET_SMP_PROCESSOR_ID

This commit is contained in:
Pragyansh Chaturvedi
2025-11-01 14:07:47 +05:30
parent 19dedede53
commit dabb8bf0df
2 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,7 @@ from .helpers import (
probe_read_str,
random,
probe_read,
smp_processor_id,
XDP_DROP,
XDP_PASS,
)
@ -77,6 +78,7 @@ __all__ = [
"probe_read_str",
"random",
"probe_read",
"smp_processor_id",
"XDP_DROP",
"XDP_PASS",
]

View File

@ -37,6 +37,11 @@ def probe_read(dst, size, src):
return ctypes.c_int64(0)
def smp_processor_id():
"""get the current CPU id"""
return ctypes.c_int32(0)
XDP_ABORTED = ctypes.c_int64(0)
XDP_DROP = ctypes.c_int64(1)
XDP_PASS = ctypes.c_int64(2)