diff --git a/pythonbpf/helper/__init__.py b/pythonbpf/helper/__init__.py index a243140..4c1d283 100644 --- a/pythonbpf/helper/__init__.py +++ b/pythonbpf/helper/__init__.py @@ -11,6 +11,7 @@ from .helpers import ( probe_read, smp_processor_id, uid, + skb_store_bytes, XDP_DROP, XDP_PASS, ) @@ -81,6 +82,7 @@ __all__ = [ "probe_read", "smp_processor_id", "uid", + "skb_store_bytes", "XDP_DROP", "XDP_PASS", ] diff --git a/pythonbpf/helper/helpers.py b/pythonbpf/helper/helpers.py index 84ffd9a..0e55a20 100644 --- a/pythonbpf/helper/helpers.py +++ b/pythonbpf/helper/helpers.py @@ -47,6 +47,11 @@ def uid(): return ctypes.c_int32(0) +def skb_store_bytes(skb, offset, from_buf, size, flags=0): + """store bytes into a socket buffer""" + return ctypes.c_int64(0) + + XDP_ABORTED = ctypes.c_int64(0) XDP_DROP = ctypes.c_int64(1) XDP_PASS = ctypes.c_int64(2)