update P4D2 and SIGCOMM2017 examples for new checksum API (#56)
This commit is contained in:
parent
ef64a2cfd8
commit
28a8414c58
@ -152,7 +152,7 @@ parser MyParser(
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
control MyVerifyChecksum(
|
||||
in my_headers_t hdr,
|
||||
inout my_headers_t hdr,
|
||||
inout my_metadata_t meta)
|
||||
{
|
||||
apply { }
|
||||
|
@ -150,7 +150,7 @@ parser MyParser(
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
control MyVerifyChecksum(
|
||||
in my_headers_t hdr,
|
||||
inout my_headers_t hdr,
|
||||
inout my_metadata_t meta)
|
||||
{
|
||||
apply { }
|
||||
|
@ -69,7 +69,7 @@ parser MyParser(
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
control MyVerifyChecksum(
|
||||
in my_headers_t hdr,
|
||||
inout my_headers_t hdr,
|
||||
inout my_metadata_t meta)
|
||||
{
|
||||
apply {
|
||||
|
@ -134,7 +134,7 @@ parser MyParser(
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
control MyVerifyChecksum(
|
||||
in my_headers_t hdr,
|
||||
inout my_headers_t hdr,
|
||||
inout my_metadata_t meta)
|
||||
{
|
||||
apply {
|
||||
|
@ -72,7 +72,7 @@ parser ParserImpl(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control verifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control verifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ parser ParserImpl(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control verifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control verifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
@ -132,13 +132,9 @@ control computeChecksum(
|
||||
inout headers hdr,
|
||||
inout metadata meta)
|
||||
{
|
||||
Checksum16() ipv4_checksum;
|
||||
|
||||
apply {
|
||||
if (hdr.ipv4.isValid()) {
|
||||
hdr.ipv4.hdrChecksum = ipv4_checksum.get(
|
||||
{
|
||||
hdr.ipv4.version,
|
||||
update_checksum(true,
|
||||
{ hdr.ipv4.version,
|
||||
hdr.ipv4.ihl,
|
||||
hdr.ipv4.diffserv,
|
||||
hdr.ipv4.totalLen,
|
||||
@ -149,8 +145,8 @@ control computeChecksum(
|
||||
hdr.ipv4.protocol,
|
||||
hdr.ipv4.srcAddr,
|
||||
hdr.ipv4.dstAddr
|
||||
});
|
||||
}
|
||||
},
|
||||
hdr.ipv4.hdrChecksum, HashAlgorithm.csum16);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ inout standard_metadata_t standard_metadata) {
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control verifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control verifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ inout standard_metadata_t standard_metadata) {
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control verifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control verifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
@ -228,13 +228,9 @@ control computeChecksum(
|
||||
inout headers hdr,
|
||||
inout metadata meta)
|
||||
{
|
||||
Checksum16() ipv4_checksum;
|
||||
|
||||
apply {
|
||||
if (hdr.ipv4.isValid()) {
|
||||
hdr.ipv4.hdrChecksum = ipv4_checksum.get(
|
||||
{
|
||||
hdr.ipv4.version,
|
||||
update_checksum(true,
|
||||
{ hdr.ipv4.version,
|
||||
hdr.ipv4.ihl,
|
||||
hdr.ipv4.diffserv,
|
||||
hdr.ipv4.totalLen,
|
||||
@ -245,8 +241,8 @@ inout metadata meta)
|
||||
hdr.ipv4.protocol,
|
||||
hdr.ipv4.srcAddr,
|
||||
hdr.ipv4.dstAddr
|
||||
});
|
||||
}
|
||||
},
|
||||
hdr.ipv4.hdrChecksum, HashAlgorithm.csum16);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ parser MyParser(packet_in packet,
|
||||
/*************************************************************************
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
control MyVerifyChecksum(in headers hdr,
|
||||
control MyVerifyChecksum(inout headers hdr,
|
||||
inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ parser MyParser(packet_in packet,
|
||||
/*************************************************************************
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
control MyVerifyChecksum(in headers hdr,
|
||||
control MyVerifyChecksum(inout headers hdr,
|
||||
inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ parser MyParser(packet_in packet,
|
||||
************ C H E C K S U M V E R I F I C A T I O N *************
|
||||
*************************************************************************/
|
||||
|
||||
control MyVerifyChecksum(in headers hdr, inout metadata meta) {
|
||||
control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||
apply { }
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user