Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] P4 standard headers file #40

Open
EmanueleGallone opened this issue Jan 28, 2021 · 2 comments
Open

[Question] P4 standard headers file #40

EmanueleGallone opened this issue Jan 28, 2021 · 2 comments

Comments

@EmanueleGallone
Copy link

EmanueleGallone commented Jan 28, 2021

Hi,
is it possible to create a single P4 file template containing the common standard headers that P4 is actually able to parse? for example, containing:

  • L2 headers
  • IPv4 headers
  • IPv6 headers
  • TCP headers
  • UDP headers
  • ...

This way, whenever someone has to deal with standard protocols it's just a matter of 'copy-paste'.

@EmanueleGallone EmanueleGallone changed the title P4 standard headers file [Question] P4 standard headers file Jan 28, 2021
@jafingerhut
Copy link
Owner

Recently someone volunteered to coordinate an effort to create such a file that would be published by the P4.org group in one of their repositories. I will try to remember to update this issue when that is published, but I suspect there will be a fair amount of discussion and editing that happens between now and when it is published, e.g. it could easily be at least a month, if not two.

@jafingerhut
Copy link
Owner

And a mere 3.5 years later, an update :-). Alan Lo worked towards this idea in 2021, but the effort kind of stalled and was mostly forgotten about. Recently I asked him if he was willing to publish his work under the Apache 2 license, and he agreed. The resulting files are in this directory of this repo now: https://github.com/jafingerhut/p4-guide/tree/master/standard-header-defns

Davide Scano is interested in enhancing this and seeing if we can convince the p4c developers to add a file like this into p4c's set of system-wide include files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants