[icmp6] forward NDP multicast to controller in correct fashion
This commit is contained in:
parent
165f0e6b98
commit
0fa70432d1
4 changed files with 39 additions and 27 deletions
|
|
@ -15,6 +15,7 @@ typedef bit<16> mcast_t;
|
|||
const bit<16> TYPE_IPV4 = 0x0800;
|
||||
const bit<16> TYPE_IPV6 = 0x86DD;
|
||||
const bit<16> TYPE_CPU = 0x4242;
|
||||
const bit<16> TYPE_DEBUG = 0x2323;
|
||||
|
||||
|
||||
const bit<8> PROTO_ICMP = 1;
|
||||
|
|
|
|||
|
|
@ -18,13 +18,16 @@ control MyIngress(inout headers hdr,
|
|||
|
||||
/********************** ACTIONS ***********************************/
|
||||
|
||||
/* As the name says */
|
||||
action drop() {
|
||||
mark_to_drop();
|
||||
}
|
||||
|
||||
/* As the name says */
|
||||
action send_to_controller() {
|
||||
action set_egress_port (port_t out_port) {
|
||||
standard_metadata.egress_spec = out_port;
|
||||
}
|
||||
|
||||
action controller_debug() {
|
||||
hdr.ethernet.ethertype = TYPE_DEBUG;
|
||||
clone3(CloneType.I2E, 100, meta);
|
||||
}
|
||||
|
||||
|
|
@ -33,8 +36,7 @@ control MyIngress(inout headers hdr,
|
|||
clone3(CloneType.I2E, 100, meta);
|
||||
}
|
||||
|
||||
/* Output PKG on correct ports (plural) */
|
||||
action multicast_pkg(mcast_t mcast_grp) {
|
||||
action multicast_pkg(mcast_t mcast_grp) { /* Output PKG on correct ports (plural) */
|
||||
standard_metadata.mcast_grp = mcast_grp;
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +56,7 @@ control MyIngress(inout headers hdr,
|
|||
hdr.icmp6.type: exact;
|
||||
}
|
||||
actions = {
|
||||
send_to_controller;
|
||||
controller_debug;
|
||||
icmp6_neighbor_solicitation;
|
||||
NoAction;
|
||||
}
|
||||
|
|
@ -70,12 +72,12 @@ control MyIngress(inout headers hdr,
|
|||
}
|
||||
actions = {
|
||||
multicast_pkg;
|
||||
send_to_controller;
|
||||
controller_debug;
|
||||
NoAction;
|
||||
}
|
||||
size = NDP_TABLE_SIZE;
|
||||
default_action = NoAction;
|
||||
// default_action = send_to_controller;
|
||||
// default_action = controller_debug;
|
||||
}
|
||||
|
||||
/* Handle multicast registration of NDP */
|
||||
|
|
@ -85,12 +87,12 @@ control MyIngress(inout headers hdr,
|
|||
}
|
||||
actions = {
|
||||
multicast_pkg;
|
||||
send_to_controller;
|
||||
controller_debug;
|
||||
NoAction;
|
||||
}
|
||||
size = NDP_TABLE_SIZE;
|
||||
default_action = NoAction;
|
||||
// default_action = send_to_controller;
|
||||
// default_action = controller_debug;
|
||||
}
|
||||
|
||||
/********************** NDP support ***********************************/
|
||||
|
|
@ -103,12 +105,12 @@ control MyIngress(inout headers hdr,
|
|||
}
|
||||
actions = {
|
||||
multicast_pkg;
|
||||
send_to_controller;
|
||||
controller_debug;
|
||||
NoAction;
|
||||
}
|
||||
size = NDP_TABLE_SIZE;
|
||||
// default_action = NoAction;
|
||||
default_action = send_to_controller;
|
||||
default_action = controller_debug;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -130,28 +132,24 @@ control MyIngress(inout headers hdr,
|
|||
*/
|
||||
}
|
||||
|
||||
|
||||
/********************** ROUTING (egress definiton) TABLES ***********************************/
|
||||
|
||||
table v6_addresses {
|
||||
key = {
|
||||
hdr.ipv6.dst_addr: exact;
|
||||
// hdr.ipv6.next_header: exact;
|
||||
}
|
||||
actions = {
|
||||
// icmp6_answer;
|
||||
send_to_controller;
|
||||
controller_debug;
|
||||
controller_reply;
|
||||
NoAction;
|
||||
}
|
||||
size = ADDRESS_TABLE_SIZE;
|
||||
// default_action = send_to_controller;
|
||||
default_action = NoAction;
|
||||
|
||||
}
|
||||
|
||||
/********************** ROUTING (egress definiton) TABLES ***********************************/
|
||||
action set_egress_port (port_t out_port) {
|
||||
standard_metadata.egress_spec = out_port;
|
||||
}
|
||||
table v6_routing {
|
||||
table v6_networks {
|
||||
key = {
|
||||
hdr.ipv6.dst_addr: lpm;
|
||||
}
|
||||
|
|
@ -163,6 +161,7 @@ control MyIngress(inout headers hdr,
|
|||
default_action = NoAction;
|
||||
}
|
||||
|
||||
|
||||
table v4_routing {
|
||||
key = {
|
||||
hdr.ipv4.dst_addr: lpm;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue