Created
July 26, 2016 06:41
-
-
Save Yi-Tseng/9c2a0f5587e93e3a6dbc1de5c2b779ca to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| header_type my_header_t { | |
| fields { | |
| a: 8; | |
| b: 8; | |
| } | |
| } | |
| header my_header_t header_a; | |
| header my_header_t header_b; | |
| parser start { | |
| return header_b; | |
| } | |
| parser header_b { | |
| return header_a; | |
| } | |
| parser header_a { | |
| extract(header_a); | |
| return ingress; | |
| } | |
| table table1 { | |
| actions { | |
| action_add_header_and_forward; | |
| } | |
| } | |
| action action_add_header_and_forward() { | |
| add_header(header_b); | |
| modify_field(header_b.a, 0x10); | |
| modify_field(header_b.b, 0x20); | |
| modify_field(standard_metadata.egress_spec, 1); | |
| } | |
| control ingress { | |
| apply(table1); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment