From 4884ed7577bdc04806bcf09449d23c947f8d035a Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Sun, 2 Nov 2025 03:35:41 +0530 Subject: [PATCH] Fix imports for bpf_get_current_uid_gid --- pythonbpf/helper/__init__.py | 2 ++ pythonbpf/helper/helpers.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/pythonbpf/helper/__init__.py b/pythonbpf/helper/__init__.py index ee07d5a..a243140 100644 --- a/pythonbpf/helper/__init__.py +++ b/pythonbpf/helper/__init__.py @@ -10,6 +10,7 @@ from .helpers import ( random, probe_read, smp_processor_id, + uid, XDP_DROP, XDP_PASS, ) @@ -79,6 +80,7 @@ __all__ = [ "random", "probe_read", "smp_processor_id", + "uid", "XDP_DROP", "XDP_PASS", ] diff --git a/pythonbpf/helper/helpers.py b/pythonbpf/helper/helpers.py index 6bed131..84ffd9a 100644 --- a/pythonbpf/helper/helpers.py +++ b/pythonbpf/helper/helpers.py @@ -42,6 +42,11 @@ def smp_processor_id(): return ctypes.c_int32(0) +def uid(): + """get current user id""" + return ctypes.c_int32(0) + + XDP_ABORTED = ctypes.c_int64(0) XDP_DROP = ctypes.c_int64(1) XDP_PASS = ctypes.c_int64(2)