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

use arraymap in examples

the use of hashmaps is just hopelessly outdated.
parent d2e06fd0
No related branches found
No related tags found
No related merge requests found
Pipeline #157250 failed
from asyncio import get_event_loop, sleep
from ebpfcat.hashmap import HashMap
from ebpfcat.arraymap import ArrayMap
from ebpfcat.xdp import XDP, XDPExitCode, XDPFlags
class Count(XDP):
license = "GPL"
userspace = HashMap()
userspace = ArrayMap()
count = userspace.globalVar()
def program(self):
......
"""example program to count IPv4 and IPv6 packets"""
from asyncio import get_event_loop, sleep
from ebpfcat.hashmap import HashMap
from ebpfcat.arraymap import ArrayMap
from ebpfcat.xdp import PacketVar, XDP, XDPExitCode, XDPFlags
class IPCount(XDP):
......@@ -9,7 +9,7 @@ class IPCount(XDP):
minimumPacketSize = 14
userspace = HashMap()
userspace = ArrayMap()
ipv4count = userspace.globalVar()
ipv6count = userspace.globalVar()
ethertype = PacketVar(12, "!H")
......
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