mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Fix imports for BPF_GET_SMP_PROCESSOR_ID
This commit is contained in:
@ -9,6 +9,7 @@ from .helpers import (
|
|||||||
probe_read_str,
|
probe_read_str,
|
||||||
random,
|
random,
|
||||||
probe_read,
|
probe_read,
|
||||||
|
smp_processor_id,
|
||||||
XDP_DROP,
|
XDP_DROP,
|
||||||
XDP_PASS,
|
XDP_PASS,
|
||||||
)
|
)
|
||||||
@ -77,6 +78,7 @@ __all__ = [
|
|||||||
"probe_read_str",
|
"probe_read_str",
|
||||||
"random",
|
"random",
|
||||||
"probe_read",
|
"probe_read",
|
||||||
|
"smp_processor_id",
|
||||||
"XDP_DROP",
|
"XDP_DROP",
|
||||||
"XDP_PASS",
|
"XDP_PASS",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -37,6 +37,11 @@ def probe_read(dst, size, src):
|
|||||||
return ctypes.c_int64(0)
|
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_ABORTED = ctypes.c_int64(0)
|
||||||
XDP_DROP = ctypes.c_int64(1)
|
XDP_DROP = ctypes.c_int64(1)
|
||||||
XDP_PASS = ctypes.c_int64(2)
|
XDP_PASS = ctypes.c_int64(2)
|
||||||
|
|||||||
Reference in New Issue
Block a user