mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-12-06 01:48:35 +00:00
Revert "Core: Export every XDP action from pythonbpf.helper"
This reverts commit 55fb6d6b9a.
This commit is contained in:
@ -18,11 +18,8 @@ from .helpers import (
|
||||
skb_store_bytes,
|
||||
get_current_cgroup_id,
|
||||
get_stack,
|
||||
XDP_ABORTED,
|
||||
XDP_DROP,
|
||||
XDP_PASS,
|
||||
XDP_TX,
|
||||
XDP_REDIRECT,
|
||||
)
|
||||
|
||||
|
||||
@ -89,9 +86,6 @@ __all__ = [
|
||||
"uid",
|
||||
"skb_store_bytes",
|
||||
"get_stack",
|
||||
"XDP_ABORTED",
|
||||
"XDP_DROP",
|
||||
"XDP_PASS",
|
||||
"XDP_TX",
|
||||
"XDP_REDIRECT",
|
||||
]
|
||||
|
||||
@ -3,15 +3,18 @@
|
||||
# Bounce every packet back out of the interface it arrived on. Upstream is
|
||||
# the transmit side of the veth XDP tests.
|
||||
#
|
||||
# XDP_TX comes from vmlinux because pythonbpf.helper exports only XDP_PASS
|
||||
# and XDP_DROP; that is why this lives under vmlinux/.
|
||||
|
||||
from pythonbpf import bpf, section, bpfglobal, compile
|
||||
from pythonbpf.helper import XDP_TX
|
||||
from vmlinux import XDP_TX
|
||||
from ctypes import c_void_p, c_int64
|
||||
|
||||
|
||||
@bpf
|
||||
@section("xdp")
|
||||
def xdp_tx(xdp: c_void_p) -> c_int64:
|
||||
return XDP_TX # bare, like the C: resolved by the return fast path
|
||||
return c_int64(XDP_TX)
|
||||
|
||||
|
||||
@bpf
|
||||
|
||||
Reference in New Issue
Block a user