Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ebpfCAT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
karaboDevices
ebpfCAT
Commits
fbffec1f
Commit
fbffec1f
authored
1 year ago
by
Martin Teichmann
Browse files
Options
Downloads
Patches
Plain Diff
improve cross-referencing in documentation
parent
a2d118ec
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ebpfcat/ebpf.rst
+8
-6
8 additions, 6 deletions
ebpfcat/ebpf.rst
with
8 additions
and
6 deletions
ebpfcat/ebpf.rst
+
8
−
6
View file @
fbffec1f
.. 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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment