|
bmv2
Designing your own switch target with bmv2
|
A bi-directional map between error codes and their P4 names. More...
#include <parser_error.h>
Public Types | |
| enum class | Core { NoError , PacketTooShort , NoMatch , StackOutOfBounds , HeaderTooShort , ParserTimeout , ParserInvalidArgument } |
| The core erros, as per core.p4. More... | |
Public Member Functions | |
| ErrorCode | from_name (const std::string &name) const |
| ErrorCode | from_core (const Core &core) const |
| Retrieve an error code for one of the core errors. | |
| const std::string & | to_name (const ErrorCode &code) const |
A bi-directional map between error codes and their P4 names.
|
strong |
The core erros, as per core.p4.
| Enumerator | |
|---|---|
| NoError | No error raised in parser. |
| PacketTooShort | Not enough bits in packet for extract or lookahead. |
| NoMatch | Match statement has no matches (unused for now) |
| StackOutOfBounds | Reference to invalid element of a header stack (partial support) |
| HeaderTooShort | Extracting too many bits into a varbit field (unused for now) |
| ParserTimeout | Parser execution time limit exceeded (unused for now) |
| ParserInvalidArgument | Parser operation was called with a value not supported by the implementation. |
Retrieve an error code for one of the core errors.
| ErrorCode bm::ErrorCodeMap::from_name | ( | const std::string & | name | ) | const |
Retrieve an error code from a P4 error name. Will throw std::out_of_range exception if name does not exist.
| const std::string & bm::ErrorCodeMap::to_name | ( | const ErrorCode & | code | ) | const |
Retrieve an error code's name. Will throw std::out_of_range exception if the error code is not valid.