diff --git a/p4app/controller.py b/p4app/controller.py index 4c8a484..73c8a78 100644 --- a/p4app/controller.py +++ b/p4app/controller.py @@ -240,35 +240,19 @@ class L2Controller(object): elif packet.type == 0x86dd: pass elif packet.type == 0x4242: - log.debug("CPU packet") cpu_header = CpuHeader(packet.payload) - log.debug("cpu = {}".format(cpu_header.__repr__())) - sz = 0 - for field in CpuHeader.fields_desc: - sz += field.sz - - shift_by = sz - - log.debug("Len of cpu= {}, shift={}".format(sz, shift_by)) - ether_orig = Ether(src=packet.src, dst=packet.dst, type=cpu_header.type) - - orig_packet = ether_orig / IPv6(packet.load[sz:]) + orig_packet = ether_orig / IPv6(cpu_header.load) log.debug("o={}".format(orig_packet.__repr__())) - orig_packet = ether_orig / IPv6(cpu_header.load) - log.debug("o2={}".format(orig_packet.__repr__())) - - - # for i in range(1,15): - # try: - # orig_packet = ether_orig / IPv6(packet.load[i:]) - # log.debug("o={} {}".format(orig_packet.__repr__(), i)) - # except Exception: - # pass - + if cpu_header.task == self.task['DEBUG']: + pass + elif cpu_header.task == self.task['ICMP6_NS']: + log.debug("Doing neighbor solicitation") + elif cpu_header.task == self.task['ICMP6_GENERAL']: + log.debug("Replying to ICMP packet") else: