Created
June 27, 2016 13:24
-
-
Save tudang/4ddb635d381332d3b3ecc655d0af7dbf to your computer and use it in GitHub Desktop.
"Semantic error: Error when calling primitive pop (my_table -> untag -> pop) line 20: argument 1 has type field, but formal count has type integer value"
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
// Metadata to count number of labels | |
header_type ingress_metadata_t { | |
fields { | |
count : 32; | |
} | |
} | |
// Count number of labels in the stack | |
parser parse_label { | |
extract(label_stack[next]); | |
set_metadata(ingress_metadata.count, (ingress_metadata.count + 1)); | |
return select(latest.bos) { | |
0 : parse_label; | |
1 : ingress; | |
} | |
} | |
// Remove all labels | |
action untag() { | |
pop(label_stack, ingress_metadata.count); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment