Go to the source code of this file.
◆ TlvEncoder_ConstTL1
#define TlvEncoder_ConstTL1 |
( |
|
type, |
|
|
|
length |
|
) |
| |
Value: __extension__({ \
static_assert(__builtin_constant_p((type)), ""); \
static_assert(__builtin_constant_p((length)), ""); \
static_assert((type) < 0xFD, ""); \
static_assert((length) <= UINT8_MAX, ""); \
rte_cpu_to_be_16(((type) << 8) | (length)); \
})
Encode constant TLV-TYPE and TLV-LENGTH to unaligned_uint16_t constant.
- Parameters
-
type | TLV-TYPE number, compile-time constant less than 0xFD. |
length | TLV-LENGTH number, compile-time constant no more than 0xFF. |
◆ TlvEncoder_ConstTL3
#define TlvEncoder_ConstTL3 |
( |
|
type, |
|
|
|
length |
|
) |
| |
Value: __extension__({ \
static_assert(__builtin_constant_p((type)), ""); \
static_assert(__builtin_constant_p((length)), ""); \
static_assert(0xFD <= (type) && (type) <= UINT16_MAX, ""); \
static_assert((length) <= UINT8_MAX, ""); \
rte_cpu_to_be_32(0xFD000000 | ((type) << 8) | (length)); \
})
Encode constant TLV-TYPE and TLV-LENGTH to unaligned_uint32_t constant.
- Parameters
-
type | TLV-TYPE number, compile-time constant between 0xFD and 0xFFFF. |
length | TLV-LENGTH number, compile-time constant no more than 0xFF. |