Length of a BER object.
More...
#include <src/BER.h>
|
| | Length (unsigned int length=0) |
| | Creates a BER length from a length value.
|
| |
| void | encode (Stream &stream) |
| | Encodes BER length to stream.
|
| |
| void | decode (Stream &stream) |
| | Decodes BER length from stream.
|
| |
| uint8_t * | encode (uint8_t *buffer) |
| | Encodes BER length to memory buffer.
|
| |
| uint8_t * | decode (uint8_t *buffer) |
| | Decodes BER length from memory buffer.
|
| |
| | operator unsigned int () const |
| | Unsigned int conversion function.
|
| |
| Length & | operator= (const unsigned int length) |
| | Unsigned int assignment operator.
|
| |
| Length & | operator+= (const unsigned int length) |
| | Addition operator.
|
| |
| Length & | operator-= (const unsigned int length) |
| | Subtraction operator.
|
| |
| Length & | operator++ () |
| | Prefix increment operator.
|
| |
| Length | operator++ (int) |
| | Postfix increment operator.
|
| |
| void | encode7bits (uint32_t value, uint8_t *buffer, const uint8_t size) |
| | Encodes integer value to memory buffer.
|
| |
|
| void | setLength (unsigned int length) |
| | Sets length from integer.
|
| |
|
| static void | encode7bits (uint32_t value, Stream &stream, const uint8_t size) |
| | Encodes integer value to stream.
|
| |
| unsigned int | _size = 0 |
| |
Length of a BER object.
This class handles the length of a BER object.
Definition at line 549 of file BER.h.
◆ Length()
| SNMP::Length::Length |
( |
unsigned int | length = 0 | ) |
|
|
inline |
◆ decode() [1/2]
| void SNMP::Length::decode |
( |
Stream & | stream | ) |
|
|
inline |
◆ decode() [2/2]
| uint8_t * SNMP::Length::decode |
( |
uint8_t * | buffer | ) |
|
|
inline |
Decodes BER length from memory buffer.
- Parameters
-
| buffer | Pointer to the buffer. |
- Returns
- Next position to be read in buffer.
Definition at line 637 of file BER.h.
References _length, and SNMP::Base::_size.
◆ encode() [1/2]
| void SNMP::Length::encode |
( |
Stream & | stream | ) |
|
|
inline |
Encodes BER length to stream.
There is two ways to encode a BER length.
- Short form if length < 127.
- Long form otherwise.
- Parameters
-
| stream | Stream to write to. |
Definition at line 572 of file BER.h.
References _length, and SNMP::Base::_size.
◆ encode() [2/2]
| uint8_t * SNMP::Length::encode |
( |
uint8_t * | buffer | ) |
|
|
inline |
Encodes BER length to memory buffer.
There is two ways to encode a BER length.
- Short form if length < 127.
- Long form otherwise.
- Parameters
-
| buffer | Pointer to the buffer. |
- Returns
- Next position to be written in buffer.
Definition at line 614 of file BER.h.
References _length, and SNMP::Base::_size.
◆ operator unsigned int()
| SNMP::Length::operator unsigned int |
( |
| ) |
const |
|
inline |
Unsigned int conversion function.
Gets length as integer.
unsigned int a = length;
Length(unsigned int length=0)
Creates a BER length from a length value.
- Returns
- BER length.
Definition at line 665 of file BER.h.
References _length.
◆ operator++() [1/2]
| Length & SNMP::Length::operator++ |
( |
| ) |
|
|
inline |
◆ operator++() [2/2]
| Length SNMP::Length::operator++ |
( |
int | | ) |
|
|
inline |
Postfix increment operator.
Increments length and return value before increment.
- Returns
- Length value.
Definition at line 752 of file BER.h.
References Length(), and operator++().
◆ operator+=()
| Length & SNMP::Length::operator+= |
( |
const unsigned int | length | ) |
|
|
inline |
◆ operator-=()
| Length & SNMP::Length::operator-= |
( |
const unsigned int | length | ) |
|
|
inline |
◆ operator=()
| Length & SNMP::Length::operator= |
( |
const unsigned int | length | ) |
|
|
inline |
Unsigned int assignment operator.
Sets length from integer.
- Parameters
-
- Returns
- Length object.
Definition at line 682 of file BER.h.
References Length(), and setLength().
◆ setLength()
| void SNMP::Length::setLength |
( |
unsigned int | length | ) |
|
|
inlineprivate |
◆ _length
| unsigned int SNMP::Length::_length |
|
private |
The documentation for this class was generated from the following file: