Skip to content

Create and potentially include in p4c repo p4include directory a "stdheaders.p4" file #25

@jafingerhut

Description

@jafingerhut

Alan Lo created a detailed proposal for the contents of such a file, which basically contained definitions for standard packet header formats like Ethernet, IPv4, IPv6, TCP, UDP, and a dozen or two others.

Alan sent me the document he wrote privately, and gave me permission to publish it under the Apache 2 license, which I have done here for now, in case others take up this work besides me:

It was discussed in (I believe) the P4 language design work group meeting during 2021.

I do recall that one of the last things discussed on this topic was to postpone it until we had implemented P4 namespaces (#3), to prevent people from having conflicts in the type names between the proposed new file, and existing header definitions they might already be using. Unfortunately the stalling of the P4 namespaces work also ended up stalling the introduction of a 'stdheaders.p4' file.

I would propose that we create a 'stdheaders.p4' file, even in the absence of an implementation of P4 namespaces, and simply tell people "use it if you like". They can always either (a) avoid using stdheaders.p4, or (b) #include it, but create their own custom definitions if they wish, as long as their custom definitions use different type names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    smalltaskA task that appears to require a small amount of work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions