|
|
|
@ -21,7 +21,7 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
|
|
|
|
|
|
|
|
|
control MyComputeChecksum(inout headers hdr, inout metadata meta) { |
|
|
|
|
apply { |
|
|
|
|
update_checksum_with_payload(meta.do_cksum == 1, |
|
|
|
|
update_checksum_with_payload(meta.task == TASK_CHECKSUM_ICMP6, |
|
|
|
|
{ |
|
|
|
|
hdr.ipv6.src_addr, /* 128 */ |
|
|
|
|
hdr.ipv6.dst_addr, /* 128 */ |
|
|
|
@ -34,6 +34,32 @@ control MyComputeChecksum(inout headers hdr, inout metadata meta) {
|
|
|
|
|
hdr.icmp6.checksum, |
|
|
|
|
HashAlgorithm.csum16 |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
/* checksumming for icmp6_na_ns_option */ |
|
|
|
|
update_checksum_with_payload(meta.task == TASK_CHECKSUM_ICMP6_NA, |
|
|
|
|
{ |
|
|
|
|
hdr.ipv6.src_addr, /* 128 */ |
|
|
|
|
hdr.ipv6.dst_addr, /* 128 */ |
|
|
|
|
meta.cast_length, /* 32 */ |
|
|
|
|
24w0, /* 24 0's */ |
|
|
|
|
PROTO_ICMP6, /* 8 */ |
|
|
|
|
hdr.icmp6.type, /* 8 */ |
|
|
|
|
hdr.icmp6.code, /* 8 */ |
|
|
|
|
|
|
|
|
|
hdr.icmp6_na_ns.router, |
|
|
|
|
hdr.icmp6_na_ns.solicitated, |
|
|
|
|
hdr.icmp6_na_ns.override, |
|
|
|
|
hdr.icmp6_na_ns.reserved, |
|
|
|
|
hdr.icmp6_na_ns.target_addr, |
|
|
|
|
|
|
|
|
|
hdr.icmp6_option_link_layer_addr.type, |
|
|
|
|
hdr.icmp6_option_link_layer_addr.ll_length, |
|
|
|
|
hdr.icmp6_option_link_layer_addr.mac_addr |
|
|
|
|
}, |
|
|
|
|
hdr.icmp6.checksum, |
|
|
|
|
HashAlgorithm.csum16 |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|