摘要 |
Techniques are disclosed for describing packet headers in a format that can be used by a code generation tool to generate source code that can generate any type of packet header when compiled and invoked within switch/router firmware. Such packet headers may then be used in a variety of switch diagnostic/testing functions. A code generation tool may be configured to receive a description of a packet header in the description format. The packet description language provides an easily used approach for defining fields in a packet header. Further, the code generation tool may be configured to generate packet header library for use by firmware on a network device, e.g., for testing and diagnostic functions. |