Skip to content
Snippets Groups Projects
Commit 9def990a authored by Martin Teichmann's avatar Martin Teichmann
Browse files

add reference documentation for ebpf

parent 0fd11ca8
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,11 @@ ...@@ -15,6 +15,11 @@
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""The ``arraymap`` module defines array maps, usually used for global
variables in EBPF programs"""
__all__ = ["ArrayMap"]
from itertools import chain from itertools import chain
from mmap import mmap from mmap import mmap
from struct import pack_into, unpack_from, calcsize from struct import pack_into, unpack_from, calcsize
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""The ``ebpf`` module contains the core ebpf code generation"""
__all__ = ["EBPF", "LocalVar", "prandom", "ktime"]
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from collections import namedtuple from collections import namedtuple
from contextlib import contextmanager, ExitStack from contextlib import contextmanager, ExitStack
......
...@@ -251,3 +251,15 @@ floor divisions ``//`` result in a standard integer. Some examples:: ...@@ -251,3 +251,15 @@ floor divisions ``//`` result in a standard integer. Some examples::
self.normal_var = self.fixed_var # automatically truncated self.normal_var = self.fixed_var # automatically truncated
self.fixed_var = self.normal_var / 5 # keep decimals self.fixed_var = self.normal_var / 5 # keep decimals
self.fixed_var = self.normal_var // 5 # floor division self.fixed_var = self.normal_var // 5 # floor division
Reference Documentation
-----------------------
.. automodule:: ebpfcat.ebpf
:members:
.. automodule:: ebpfcat.xdp
:members:
.. automodule:: ebpfcat.arraymap
:members:
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""support for XDP programs""" """support for XDP programs"""
__all__ = ["XDPExitCode", "XDPFlags", "PacketVar", "XDP"]
from asyncio import DatagramProtocol, Future, get_event_loop from asyncio import DatagramProtocol, Future, get_event_loop
from enum import Enum from enum import Enum
from contextlib import asynccontextmanager, contextmanager from contextlib import asynccontextmanager, contextmanager
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment