[P4-dev] Pop all headers in a stack?

Huynhtu Dang huynh.tu.dang at usi.ch
Mon Jun 27 09:35:38 EDT 2016


Dear all,

I try to remove all header stack using pop operation, but hitting a semantic error. I guess POP operation requires integer type for the “count” argument. As I know so far, in P4 v1.0 spec, there is no int type. Is there any way to cast a field to “int” type in P4 v1.0 or other ways to remove all headers in a header stack?

The code snippet to show the problem is pushed here:
https://gist.github.com/tudang/4ddb635d381332d3b3ecc655d0af7dbf

Best Regards,
Tu Dang


More information about the P4-dev mailing list