netgroup / eclat-daemon

eCLAT (eBPF Chains Language And Toolset) daemon.
2 stars 0 forks source link

Map lookup failure #68

Open lorenzobracciale opened 2 years ago

lorenzobracciale commented 2 years ago

The two last commands on README seem to have problems

python eclat.py --dumpmap /sys/fs/bpf/maps/system/hvm_chain_map

Traceback (most recent call last): File "/opt/eclat-daemon/eclat.py", line 153, in <module> main() File "/opt/eclat-daemon/eclat.py", line 139, in main ret = dump_map(*args['dumpmap']) File "/opt/eclat-daemon/eclat.py", line 100, in dump_map return json.loads(response.message) File "/usr/lib/python3.9/json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.9/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 36 column 41 (char 1316)

python eclat.py --lookup /sys/fs/bpf/maps/system/hvm_chain_map 64

(Traceback on eclatd) Exec: bpftool map update pinned /sys/fs/bpf/maps/hike_default/ip6_simple_classifier/ipv6_simple_classifier_map key hex 0 0 0 0 value hex 1 0 0 40 Exec: bpftool map dump pinned /sys/fs/bpf/maps/system/hvm_chain_map Exec: bpftool map lookup --json pinned /sys/fs/bpf/maps/system/hvm_chain_map key 0x40 0x0 0x0 0x0 Traceback (most recent call last): File "/opt/eclat-daemon/eclatd.py", line 82, in GetMapValue ret = self.controller.get_map_value( File "/opt/eclat-daemon/controller.py", line 162, in get_map_value return cal.bpftool_map_lookup(mapname, int(key)) File "/opt/eclat-daemon/cal.py", line 350, in bpftool_map_lookup raise Exception(f"Map lookup {map_reference} failed.") Exception: Map lookup /sys/fs/bpf/maps/system/hvm_chain_map failed.

StefanoSalsano commented 2 years ago

there is an error when the info is showing correctly

Traceback (most recent call last): File "/opt/eclat-daemon/eclat.py", line 252, in main() File "/opt/eclat-daemon/eclat.py", line 182, in main print(f"status: {ret.status}") AttributeError: 'list' object has no attribute 'status'

29 python eclat.py read-map /sys/fs/bpf/maps/hike_default/monitor/map_pcpu_mon 30 python eclat.py read-map /sys/fs/bpf/maps/hike_default/monitor/map_pcpu_mon --lookup 0 31 python eclat.py read-map /sys/fs/bpf/maps/hike_default/monitor/map_pcpu_mon --lookup 1 32 python eclat.py read-map /sys/fs/bpf/maps/system/hvm_chain_map

to run the testbed testbed/ddos_double_token_bucket_with_sampler.sh the go in the SUT window