Browse Source

s/bool/bit<1>/

Fixing

Invalid entry type 'expression' in field list
bad json:
{
   "type" : "expression",
   "value" : {
      "type" : "expression",
      "value" : {
         "left" : null,
         "op" : "d2b",
         "right" : {
            "type" : "field",
            "value" : [ "scalars", "metadata.chk_icmp6" ]
         }
      }
   }
}
master
Nico Schottelius 4 years ago
parent
commit
ec40bc2c54
  1. 4
      p4src/checksums.p4
  2. 4
      p4src/headers.p4
  3. 4
      p4src/parsers.p4

4
p4src/checksums.p4

@ -22,7 +22,7 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
control MyComputeChecksum(inout headers hdr, inout metadata meta) {
apply {
update_checksum_with_payload(meta.chk_icmp6 == true,
update_checksum_with_payload(meta.chk_icmp6 == 1,
{
hdr.ipv6.src_addr, /* 128 */
hdr.ipv6.dst_addr, /* 128 */
@ -61,7 +61,7 @@ control MyComputeChecksum(inout headers hdr, inout metadata meta) {
HashAlgorithm.csum16
);
update_checksum_with_payload(meta.chk_icmp == true,
update_checksum_with_payload(meta.chk_icmp == 1,
{
hdr.icmp.type,
hdr.icmp.code

4
p4src/headers.p4

@ -182,8 +182,8 @@ struct metadata {
/* migrate tasks to bool */
bit<1> chk_icmp6_na_ns;
bool chk_icmp6;
bool chk_icmp;
bit<1> chk_icmp6;
bit<1> chk_icmp;
bit<16> tcp_length;
bit<32> cast_length;

4
p4src/parsers.p4

@ -14,8 +14,8 @@ parser MyParser(packet_in packet,
state start {
meta.chk_icmp = false;
meta.chk_icmp6 = false;
meta.chk_icmp = 0;
meta.chk_icmp6 = 0;
meta.chk_icmp6_na_ns = 0;
packet.extract(hdr.ethernet);

Loading…
Cancel
Save