From fbffec1feb9ad3e7209bf0ec4c295ad5dd4603ea Mon Sep 17 00:00:00 2001 From: Martin Teichmann <martin.teichmann@gmail.com> Date: Mon, 24 Apr 2023 12:55:43 +0100 Subject: [PATCH] improve cross-referencing in documentation --- ebpfcat/ebpf.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ebpfcat/ebpf.rst b/ebpfcat/ebpf.rst index 2e65851..36f3aad 100644 --- a/ebpfcat/ebpf.rst +++ b/ebpfcat/ebpf.rst @@ -1,3 +1,5 @@ +.. currentmodule:: ebpfcat + A Python-base EBPF code generator ================================= @@ -37,7 +39,7 @@ Instead it generates EBPF code that we can later load into the kernel:: self.count += 1 self.exit(XDPExitCode.PASS) # pass packet on to network stack -Now we can attach this program to a network interface. We use ``asyncio`` +Now we can attach this program to a network interface. We use :mod:`asyncio` for synchronization:: async def main(): @@ -166,11 +168,11 @@ is too small (by default ``XDPExitCode.PASS``). So the above example becomes:: with self.pH[12] == 8: self.count += 1 -With the ``PacketVar`` descriptor it is possible to declare certain positions -in the packet as variables. As parameters it takes the position within the -packet, and the data format, following the conventions from the Python -:mod:`struct`` package, including the endianness markers ``<>!``. So the above -example simplifies to:: +With the :class:`xdp.PacketVar`` descriptor it is possible to declare certain +positions in the packet as variables. As parameters it takes the position +within the packet, and the data format, following the conventions from the +Python :mod:`struct` package, including the endianness markers ``<>!``. So the +above example simplifies to:: class Program(XDP): minimumPacketSize = 16 -- GitLab