From bc63f5edcfa0ec6bada4e42302195b851602bb53 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Mar 2019 18:13:34 +0100 Subject: [PATCH] Bitwidth change / adjust --- p4src/headers.p4 | 4 ++-- p4src/static-mapping.p4 | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/p4src/headers.p4 b/p4src/headers.p4 index 9d500f5..5382d10 100644 --- a/p4src/headers.p4 +++ b/p4src/headers.p4 @@ -8,7 +8,7 @@ typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typedef bit<128> ipv6_addr_t; -typedef bit<16> port_t; +typedef bit<9> port_t; typedef bit<16> mcast_t; typedef bit<8> task_t; @@ -112,8 +112,8 @@ header icmp_t { } header cpu_t { - port_t ingress_port; task_t task; + bit<16> ingress_port; bit<16> ethertype; } diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 218e2bc..cb2ac64 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -229,11 +229,4 @@ MyDeparser() ) main; - /* set tcp header valid after modifying it -- keep this in mind*/ - // hdr.tcp.setValid(); - - - // hdr.cpu.srcAddr = hdr.ethernet.srcAddr; - // hdr.cpu.ingress_port = (bit<16>)meta.ingress_port; - // truncate((bit<32>)22); //ether+cpu header