From dd6986cf6020f672171b44950f2da385c3a8096c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Mar 2019 16:19:43 +0100 Subject: [PATCH] Disable multicast catchall by default --- doc/plan.org | 19 ++++++++++++++++++- p4app/controller.py | 5 +++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/doc/plan.org b/doc/plan.org index 99d64ee..4986657 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -114,7 +114,24 @@ ****** DONE Parse ICMPv6 up to neighbor solicitation -> no: checksum problem ****** DONE Use NDP (Neighbor Solicitation (NDP) , Neighbor Advertisement (NDP)) -> no: controller ****** Approach 2: use cpu header, forward information to controller -****** TODO Fix the ip address match/mapping: 42 -> 2a -> use hex originally +****** DONE Fix the ip address match/mapping: 42 -> 2a -> use hex originally +****** TODO Find out why wrong type is used -> overlapping with NDP +DEBUG:main:INCOMING: > +p=> +DEBUG:main:cpu = > +DEBUG:main:o=>>> +DEBUG:main:Debug purpose only +DEBUG:main:INCOMING: > +p=> +DEBUG:main:cpu = > +DEBUG:main:o=>>> +DEBUG:main:Debug purpose only +DEBUG:main:INCOMING: > +p=> +DEBUG:main:cpu = > +DEBUG:main:o=>>> +DEBUG:main:Debug purpose only + ***** TODO For other nodes -> multicast ***** TODO Maybe implement link local addresses (missing at the moment) ****** ff02::/?? diff --git a/p4app/controller.py b/p4app/controller.py index 480d037..431a8f0 100644 --- a/p4app/controller.py +++ b/p4app/controller.py @@ -163,7 +163,8 @@ class L2Controller(object): for v6route in self.v6_routes[self.mode]: self.controller.table_add("v6_networks", "set_egress_port", [str(v6route['net'])], [str(v6route['port'])]) - self.listen_to_icmp6_multicast() + if self.args.multicast_to_controller: + self.listen_to_icmp6_multicast() self.controller.table_clear("v4_routing") for v4route in self.v4_routes[self.mode]: @@ -233,7 +234,6 @@ class L2Controller(object): packet = Ether(str(pkg)) self.debug_print_pkg(pkg) - print("p={}".format(pkg.__repr__())) if packet.type == 0x0800: pass @@ -266,6 +266,7 @@ class L2Controller(object): parser = argparse.ArgumentParser(description='controller++') parser.add_argument('--mode', help='Select mode / settings to use', choices=self.modes) parser.add_argument('--debug', help='Enable debug logging', action='store_true') + parser.add_argument('--multicast-to-controller', help='Send debug multicast to controller', action='store_true') self.args = parser.parse_args() self.mode = self.args.mode