Re-re-re-try to do checkumming based on a meta field

This commit is contained in:
Nico Schottelius 2019-03-06 15:15:46 +01:00
commit 591175db7a
3 changed files with 28 additions and 15 deletions

View file

@ -21,18 +21,18 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
control MyComputeChecksum(inout headers hdr, inout metadata meta) {
apply {
// GRRRRR update_checksum_with_payload(meta.do_cksum,
// GRRRRR {
// GRRRRR hdr.ipv6.src_addr, /* 128 */
// GRRRRR hdr.ipv6.dst_addr, /* 128 */
// GRRRRR 16w0, /* 16 try implicit cast */
// GRRRRR hdr.ipv6.payload_length, /* 16 */
// GRRRRR 24w0, /* 24 0's */
// GRRRRR PROTO_ICMP6 /* 8 */
// GRRRRR },
// GRRRRR hdr.icmp6.checksum,
// GRRRRR HashAlgorithm.csum16
// GRRRRR );
update_checksum_with_payload(meta.do_cksum == 1,
{
hdr.ipv6.src_addr, /* 128 */
hdr.ipv6.dst_addr, /* 128 */
16w0, /* 16 try implicit cast */
hdr.ipv6.payload_length, /* 16 */
24w0, /* 24 0's */
PROTO_ICMP6 /* 8 */
},
hdr.icmp6.checksum,
HashAlgorithm.csum16
);
}
}

View file

@ -66,6 +66,16 @@ control MyIngress(inout headers hdr,
//meta.cast_length = (bit<32>) hdr.ipv6.payload_length;
}
/* this needs SESSIONS!!
- icmp6: (src addr, dst addr, ID??, )
- tcp: (src port, dst port, dst_addr, src addr)
- udp: (src port, dst port, dst_addr, src addr)
*/
action nat64_static(ipv4_addr_t nataddr, ipv6_addr_t nat64_prefix) {
hdr.ipv4.dst_addr = hdr.ipv6.dst_addr - nat64_prefix;
hdr.ipv4.dst_addr = hdr.ipv6.dst_addr - nat64_prefix;
}
/********************** Reply to NDP for US ***********************************/
table ndp_answer {
key = {