Syntax change: no +=

This commit is contained in:
Nico Schottelius 2019-07-10 08:49:09 +02:00
parent c714b2748b
commit d32543cf1b

View file

@ -624,37 +624,37 @@ Echo or Echo Reply Message
bit<16> localsum = 0;
localsum = localsum + hdr.ipv4.src[15:0]; // 16 bit
localsum += hdr.ipv4.src[31:16]; // 16 bit
localsum += hdr.ipv4.dst[15:0]; // 16 bit
localsum += hdr.ipv4.dst[31:16]; // 16 bit
localsum = localsum + hdr.ipv4.src[31:16]; // 16 bit
localsum = localsum + hdr.ipv4.dst[15:0]; // 16 bit
localsum = localsum + hdr.ipv4.dst[31:16]; // 16 bit
localsum += hdr.ipv4.totalLen -20; // 16 bit
localsum += (bit<16>) hdr.ipv4.protocol; // 8 bit
localsum = localsum + hdr.ipv4.totalLen -20; // 16 bit
localsum = localsum + (bit<16>) hdr.ipv4.protocol; // 8 bit
}
action v6sum() {
bit<16> localsum = 0;
localsum += hdr.ipv6.src[15:0]; // 16 bit
localsum += hdr.ipv6.src[31:16]; // 16 bit
localsum += hdr.ipv6.src[47:32]; // 16 bit
localsum += hdr.ipv6.src[63:48]; // 16 bit
localsum += hdr.ipv6.src[79:64]; // 16 bit
localsum += hdr.ipv6.src[95:80]; // 16 bit
localsum += hdr.ipv6.src[111:96]; // 16 bit
localsum += hdr.ipv6.src[127:112]; // 16 bit
localsum = localsum + hdr.ipv6.src[15:0]; // 16 bit
localsum = localsum + hdr.ipv6.src[31:16]; // 16 bit
localsum = localsum + hdr.ipv6.src[47:32]; // 16 bit
localsum = localsum + hdr.ipv6.src[63:48]; // 16 bit
localsum = localsum + hdr.ipv6.src[79:64]; // 16 bit
localsum = localsum + hdr.ipv6.src[95:80]; // 16 bit
localsum = localsum + hdr.ipv6.src[111:96]; // 16 bit
localsum = localsum + hdr.ipv6.src[127:112]; // 16 bit
localsum += hdr.ipv6.dst[15:0]; // 16 bit
localsum += hdr.ipv6.dst[31:16]; // 16 bit
localsum += hdr.ipv6.dst[47:32]; // 16 bit
localsum += hdr.ipv6.dst[63:48]; // 16 bit
localsum += hdr.ipv6.dst[79:64]; // 16 bit
localsum += hdr.ipv6.dst[95:80]; // 16 bit
localsum += hdr.ipv6.dst[111:96]; // 16 bit
localsum += hdr.ipv6.dst[127:112]; // 16 bit
localsum = localsum + hdr.ipv6.dst[15:0]; // 16 bit
localsum = localsum + hdr.ipv6.dst[31:16]; // 16 bit
localsum = localsum + hdr.ipv6.dst[47:32]; // 16 bit
localsum = localsum + hdr.ipv6.dst[63:48]; // 16 bit
localsum = localsum + hdr.ipv6.dst[79:64]; // 16 bit
localsum = localsum + hdr.ipv6.dst[95:80]; // 16 bit
localsum = localsum + hdr.ipv6.dst[111:96]; // 16 bit
localsum = localsum + hdr.ipv6.dst[127:112]; // 16 bit
localsum += hdr.ipv6.payload_length; // 16 bit
localsum += (bit<16>) hdr.ipv6.next_header; // 8 bit
localsum = localsum + hdr.ipv6.payload_length; // 16 bit
localsum = localsum + (bit<16>) hdr.ipv6.next_header; // 8 bit
}
/********************** APPLYING TABLES ***********************************/