Begin icmp6 in controller -> pass special info

This commit is contained in:
Nico Schottelius 2019-03-03 22:36:25 +01:00
commit 7f1e9f6252
5 changed files with 81 additions and 22 deletions

View file

@ -22,7 +22,7 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
control MyComputeChecksum(inout headers hdr, inout metadata meta) {
apply {
bit<32> icmp6_len = 1; /* for icmp6 NS */
bit<32> icmp6_len = 32; /* for icmp6 NS */
update_checksum (
hdr.icmp6.isValid(),

View file

@ -14,6 +14,8 @@ 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<8> PROTO_ICMP = 1;
const bit<8> PROTO_TCP = 6;

View file

@ -28,6 +28,11 @@ control MyIngress(inout headers hdr,
clone3(CloneType.I2E, 100, meta);
}
action controller_reply() {
hdr.ethernet.etherType = TYPE_CPU;
clone3(CloneType.I2E, 100, meta);
}
/* Output PKG on correct ports (plural) */
action multicast_pkg(mcast_t mcast_grp) {
standard_metadata.mcast_grp = mcast_grp;
@ -131,7 +136,7 @@ control MyIngress(inout headers hdr,
// hdr.ipv6.next_header: exact;
}
actions = {
icmp6_answer;
// icmp6_answer;
send_to_controller;
NoAction;
}
@ -197,6 +202,17 @@ control MyEgress(inout headers hdr,
/* set tcp header valid after modifying it -- keep this in mind*/
// hdr.tcp.setValid();
// If ingress clone
if (standard_metadata.instance_type == 1){
// hdr.cpu.setValid();
// hdr.cpu.srcAddr = hdr.ethernet.srcAddr;
// hdr.cpu.ingress_port = (bit<16>)meta.ingress_port;
// hdr.ethernet.etherType = L2_LEARN_ETHER_TYPE;
// truncate((bit<32>)22); //ether+cpu header
}
}
}