From 0dc8791afb164d849cfffe4bf84d46f542f54965 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 25 Mar 2019 13:11:47 +0100 Subject: [PATCH] More debug in controller --- p4app/controller.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/p4app/controller.py b/p4app/controller.py index 79ccb53..31916ce 100755 --- a/p4app/controller.py +++ b/p4app/controller.py @@ -424,9 +424,16 @@ class L2Controller(object): if packet.type == 0x0800: - pass + log.debug("Received raw (untagged) packet - BUG") + self.debug_print_pkg(pkg) + elif packet.type == 0x86dd: self.debug_print_pkg(pkg) + cpu_header = CpuHeader(packet.payload) + ether_orig = Ether(src=packet.src, dst=packet.dst, type=cpu_header.type) + orig_packet = ether_orig / IPv4(cpu_header.load) + log.debug("v4 reassambled={}".format(orig_packet.__repr__())) + elif packet.type == 0x4242: cpu_header = CpuHeader(packet.payload) @@ -447,7 +454,7 @@ class L2Controller(object): src = orig_packet['IPv6'].src log.debug("Router solicitation from {} -- should probably handle this?".format(src)) elif cpu_header.task == self.task['DEBUG']: - log.debug("reassambled={}".format(orig_packet.__repr__())) + log.debug("v6 reassambled={}".format(orig_packet.__repr__())) elif cpu_header.task == self.task['ICMP6_NS']: log.info("Doing neighbor solicitation for the switch in the controller") self.handle_icmp6_ns(orig_packet)