bmv2
Designing your own switch target with bmv2
|
Inherits Data.
Public Member Functions | |
const ByteContainer & | get_bytes () const |
int | get_nbytes () const |
int | get_nbits () const |
Get the number of bits occupied by this field in the packet header. More... | |
void | set_written_to (bool v) |
bool | get_written_to () const |
Field objects are used to represent P4 fields. Each Field instance belongs to a Header instance. When defining your own target, you will have to manipulate Field objects to set and access the target's intrinsic metadata. Most of the interesting methods for a target designer are inherited from Data.
|
inline |
Return the byte representation of this field. Note that this returns a reference to a byte container, which is only valid as long as the Field instance is alive.
|
inline |
Get the number of bits occupied by this field in the packet header.
|
inline |
Get the number of bytes occupied by this field, not based on its layout in the packet header, but assuming a byte boundary alignment for the most significant bit. nbytes = (nbits + 7) / 8
|
inline |
Get the value of the written_to flag. See set_written_to() for more information.
|
inline |
Set the value of the written_to flag for the field. This flag can be queried at any time using get_written_to() and is used to check whether the field has been modified since written_to was last set to false
.