-
Notifications
You must be signed in to change notification settings - Fork 446
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
Showing
13 changed files
with
350 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
Copyright 2013-present Barefoot Networks, Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
header_type h { | ||
fields { | ||
b : 1; | ||
} | ||
} | ||
|
||
metadata h m; | ||
|
||
parser start { | ||
return ingress; | ||
} | ||
|
||
action x() {} | ||
|
||
table t { | ||
actions { x; } | ||
} | ||
|
||
control c { | ||
apply(t); | ||
} | ||
|
||
control e { | ||
apply(t); | ||
} | ||
|
||
control ingress { | ||
c(); | ||
} |
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,65 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
struct h { | ||
bit<1> b; | ||
} | ||
|
||
struct metadata { | ||
@name(".m") | ||
h m; | ||
} | ||
|
||
struct headers { | ||
} | ||
|
||
parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name(".start") state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control c(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name(".x") action x() { | ||
} | ||
@name(".t") table t { | ||
actions = { | ||
x(); | ||
@defaultonly NoAction(); | ||
} | ||
default_action = NoAction(); | ||
} | ||
apply { | ||
t.apply(); | ||
} | ||
} | ||
|
||
control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name(".c") c() c_0; | ||
apply { | ||
c_0.apply(hdr, meta, standard_metadata); | ||
} | ||
} | ||
|
||
control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
apply { | ||
} | ||
} | ||
|
||
control DeparserImpl(packet_out packet, in headers hdr) { | ||
apply { | ||
} | ||
} | ||
|
||
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,60 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
struct h { | ||
bit<1> b; | ||
} | ||
|
||
struct metadata { | ||
@name(".m") | ||
h m; | ||
} | ||
|
||
struct headers { | ||
} | ||
|
||
parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name(".start") state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name("NoAction") action NoAction_0() { | ||
} | ||
@name(".x") action _x() { | ||
} | ||
@name(".t") table _t_0 { | ||
actions = { | ||
_x(); | ||
@defaultonly NoAction_0(); | ||
} | ||
default_action = NoAction_0(); | ||
} | ||
apply { | ||
_t_0.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 { | ||
} | ||
} | ||
|
||
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,60 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
struct h { | ||
bit<1> b; | ||
} | ||
|
||
struct metadata { | ||
@name(".m") | ||
h m; | ||
} | ||
|
||
struct headers { | ||
} | ||
|
||
parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name(".start") state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { | ||
@name("NoAction") action NoAction_0() { | ||
} | ||
@name(".x") action _x() { | ||
} | ||
@name(".t") table _t_0 { | ||
actions = { | ||
_x(); | ||
@defaultonly NoAction_0(); | ||
} | ||
default_action = NoAction_0(); | ||
} | ||
apply { | ||
_t_0.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 { | ||
} | ||
} | ||
|
||
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.