Merge branch 'master' of gitlab.ethz.ch:nicosc/master-thesis
This commit is contained in:
commit
6522cfb501
1 changed files with 11 additions and 11 deletions
|
@ -50,6 +50,8 @@ control MyIngress(inout headers hdr,
|
|||
|
||||
/* NAT64 protocol unspecific changes */
|
||||
action nat64_generic(ipv4_addr_t src, ipv4_addr_t dst) {
|
||||
hdr.ipv4.setValid();
|
||||
|
||||
/* Stuff that might need to be fixed */
|
||||
hdr.ipv4.version = (bit<4>)4;
|
||||
hdr.ipv4.diff_serv = (bit<6>)0; // no ToS
|
||||
|
@ -72,11 +74,11 @@ control MyIngress(inout headers hdr,
|
|||
hdr.ipv4.protocol = hdr.ipv6.next_header;
|
||||
|
||||
hdr.ipv6.setInvalid();
|
||||
hdr.ipv4.setValid();
|
||||
}
|
||||
|
||||
/* NAT46: protocol unspecific changes */
|
||||
action nat46_generic(ipv6_addr_t src, ipv6_addr_t dst) {
|
||||
hdr.ipv6.setValid();
|
||||
hdr.ethernet.ethertype = TYPE_IPV6;
|
||||
|
||||
hdr.ipv6.dst_addr = dst;
|
||||
|
@ -91,7 +93,6 @@ control MyIngress(inout headers hdr,
|
|||
hdr.ipv6.hop_limit = hdr.ipv4.ttl;
|
||||
|
||||
hdr.ipv4.setInvalid();
|
||||
hdr.ipv6.setValid();
|
||||
}
|
||||
|
||||
|
||||
|
@ -336,18 +337,17 @@ control MyIngress(inout headers hdr,
|
|||
if(hdr.ipv6.isValid()) {
|
||||
icmp6.apply(); /* icmp6 echo, icmp6 ndp */
|
||||
if(nat64.apply().hit) { /* translating */
|
||||
// v4_networks.apply(); /* apply egress */
|
||||
// exit; /* no further v6 processing */
|
||||
v4_networks.apply(); /* apply egress */
|
||||
exit; /* no further v6 processing */
|
||||
}
|
||||
v6_networks.apply(); /* egress / routing */
|
||||
} else if(hdr.ipv4.isValid()) {
|
||||
if(nat46.apply().hit) { /* v4->v6 */
|
||||
v6_networks.apply(); /* Now apply v6 egress */
|
||||
exit; /* no further v4 processing */
|
||||
}
|
||||
v4_networks.apply(); /* routing, egress */
|
||||
}
|
||||
// else if(hdr.ipv4.isValid()) {
|
||||
// if(nat46.apply().hit) { /* v4->v6 */
|
||||
// v6_networks.apply(); /* Now apply v6 egress */
|
||||
// exit; /* no further v4 processing */
|
||||
// }
|
||||
// v4_networks.apply(); /* routing, egress */
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue