-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mihai Budiu
authored
May 1, 2018
1 parent
27477d7
commit 9724fe8
Showing
12 changed files
with
415 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
header_type affairs { | ||
fields { | ||
flaccidly : 48; | ||
sleeting : 16; | ||
} | ||
} | ||
|
||
header_type backs { | ||
fields { | ||
sharps : 16; | ||
peptides : 16; | ||
whirs : 16; | ||
breasted : 16; | ||
browning : 16; | ||
jews : 32; | ||
} | ||
} | ||
|
||
header affairs kilometer; | ||
|
||
header backs expressivenesss; | ||
|
||
parser start { | ||
extract(kilometer); | ||
extract(expressivenesss); | ||
return ingress; | ||
} | ||
|
||
action mooneys() { | ||
subtract_from_field(expressivenesss.breasted, expressivenesss.peptides); | ||
subtract_from_field(kilometer.sleeting, 7); | ||
} | ||
|
||
table conceptualization { | ||
reads { | ||
kilometer : valid; | ||
kilometer.flaccidly mask 0 : lpm; | ||
expressivenesss : valid; | ||
} | ||
actions { | ||
mooneys; | ||
} | ||
} | ||
|
||
control ingress { | ||
apply(conceptualization); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
@name("backs") header backs_0 { | ||
bit<16> sharps; | ||
bit<16> peptides; | ||
bit<16> whirs; | ||
bit<16> breasted; | ||
bit<16> browning; | ||
bit<32> jews; | ||
} | ||
|
||
@name("affairs") header affairs_0 { | ||
bit<48> flaccidly; | ||
bit<16> sleeting; | ||
} | ||
|
||
struct metadata { | ||
} | ||
|
||
struct headers { | ||
@name(".expressivenesss") | ||
backs_0 expressivenesss; | ||
@name(".kilometer") | ||
affairs_0 kilometer; | ||
} | ||
|
||
parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name(".start") state start { | ||
packet.extract<affairs_0>(hdr.kilometer); | ||
packet.extract<backs_0>(hdr.expressivenesss); | ||
transition accept; | ||
} | ||
} | ||
|
||
control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name(".mooneys") action mooneys() { | ||
hdr.expressivenesss.breasted = hdr.expressivenesss.breasted - hdr.expressivenesss.peptides; | ||
hdr.kilometer.sleeting = hdr.kilometer.sleeting + 16w65529; | ||
} | ||
@name(".conceptualization") table conceptualization { | ||
actions = { | ||
mooneys(); | ||
@defaultonly NoAction(); | ||
} | ||
key = { | ||
hdr.kilometer.isValid() : exact @name("kilometer.$valid$") ; | ||
48w0 : lpm @name("0") ; | ||
hdr.expressivenesss.isValid(): exact @name("expressivenesss.$valid$") ; | ||
} | ||
default_action = NoAction(); | ||
} | ||
apply { | ||
conceptualization.apply(); | ||
} | ||
} | ||
|
||
control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
apply { | ||
} | ||
} | ||
|
||
control DeparserImpl(packet_out packet, in headers hdr) { | ||
apply { | ||
packet.emit<affairs_0>(hdr.kilometer); | ||
packet.emit<backs_0>(hdr.expressivenesss); | ||
} | ||
} | ||
|
||
control verifyChecksum(inout headers hdr, inout metadata meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control computeChecksum(inout headers hdr, inout metadata meta) { | ||
apply { | ||
} | ||
} | ||
|
||
V1Switch<headers, metadata>(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
@name("backs") header backs_0 { | ||
bit<16> sharps; | ||
bit<16> peptides; | ||
bit<16> whirs; | ||
bit<16> breasted; | ||
bit<16> browning; | ||
bit<32> jews; | ||
} | ||
|
||
@name("affairs") header affairs_0 { | ||
bit<48> flaccidly; | ||
bit<16> sleeting; | ||
} | ||
|
||
struct metadata { | ||
} | ||
|
||
struct headers { | ||
@name(".expressivenesss") | ||
backs_0 expressivenesss; | ||
@name(".kilometer") | ||
affairs_0 kilometer; | ||
} | ||
|
||
parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name(".start") state start { | ||
packet.extract<affairs_0>(hdr.kilometer); | ||
packet.extract<backs_0>(hdr.expressivenesss); | ||
transition accept; | ||
} | ||
} | ||
|
||
control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name(".NoAction") action NoAction_0() { | ||
} | ||
@name(".mooneys") action mooneys_0() { | ||
hdr.expressivenesss.breasted = hdr.expressivenesss.breasted - hdr.expressivenesss.peptides; | ||
hdr.kilometer.sleeting = hdr.kilometer.sleeting + 16w65529; | ||
} | ||
@name(".conceptualization") table conceptualization { | ||
actions = { | ||
mooneys_0(); | ||
@defaultonly NoAction_0(); | ||
} | ||
key = { | ||
hdr.kilometer.isValid() : exact @name("kilometer.$valid$") ; | ||
48w0 : lpm @name("0") ; | ||
hdr.expressivenesss.isValid(): exact @name("expressivenesss.$valid$") ; | ||
} | ||
default_action = NoAction_0(); | ||
} | ||
apply { | ||
conceptualization.apply(); | ||
} | ||
} | ||
|
||
control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
apply { | ||
} | ||
} | ||
|
||
control DeparserImpl(packet_out packet, in headers hdr) { | ||
apply { | ||
packet.emit<affairs_0>(hdr.kilometer); | ||
packet.emit<backs_0>(hdr.expressivenesss); | ||
} | ||
} | ||
|
||
control verifyChecksum(inout headers hdr, inout metadata meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control computeChecksum(inout headers hdr, inout metadata meta) { | ||
apply { | ||
} | ||
} | ||
|
||
V1Switch<headers, metadata>(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; | ||
|
Oops, something went wrong.