(Raw) SGCTP payload
More...
#include <sgctp/payload.hpp>
|
| CPayload () |
|
virtual | ~CPayload () |
|
virtual int | alloc () |
| Allocate resources for payload (un-)serialization. More...
|
|
virtual int | serialize (unsigned char *_pucBuffer, const CData &_roData) |
| Serialize the given SGCTP data into the given payload buffer. More...
|
|
virtual int | unserialize (CData *_poData, const unsigned char *_pucBuffer, uint16_t _ui16tBufferSize) |
| Unserialize the SGCTP data from the given payload buffer. More...
|
|
virtual void | free () |
| Free resources for payload (un-)serialization. More...
|
|
|
static unsigned char * | allocBuffer () |
| Allocate a buffer for payload (un-)serialization. More...
|
|
static void | zeroBuffer (unsigned char *_pucBuffer) |
| Zero-out a buffer required for payload (un-)serialization. More...
|
|
static void | freeBuffer (unsigned char *_pucBuffer) |
| Free a buffer allocated for payload (un-)serialization. More...
|
|
|
static const uint16_t | BUFFER_SIZE = 33024 |
| Buffer size required for payload (un-)serialization. More...
|
|
|
void | putBits (uint8_t _ui8tBitsSize, uint8_t _ui8tBits) |
| Add the given bits to the payload. More...
|
|
void | putBytes (uint16_t _ui16tBytesSize, const unsigned char *_pucBytes) |
| Add the given bytes to the payload. More...
|
|
uint8_t | getBits (uint8_t _ui8tBitsSize) |
| Retrieve the given bits from the payload. More...
|
|
void | getBytes (uint16_t _ui16tBytesSize, unsigned char *_pucBytes) |
| Retrieve the given bytes from the payload. More...
|
|
|
static const uint8_t | BITMASK [9] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 } |
| Bit masks used to (un-)serialize data bit-per-bit. More...
|
|
(Raw) SGCTP payload
This class (un-)serializes data from/to a (raw) SGCTP payload.
Definition at line 41 of file payload.hpp.
SGCTP::CPayload::CPayload |
( |
| ) |
|
|
inline |
virtual SGCTP::CPayload::~CPayload |
( |
| ) |
|
|
inlinevirtual |
static unsigned char* SGCTP::CPayload::allocBuffer |
( |
| ) |
|
|
inlinestatic |
Allocate a buffer for payload (un-)serialization.
- Returns
- Pointer to the allocated buffer; NULL in case of error
Definition at line 61 of file payload.hpp.
static void SGCTP::CPayload::zeroBuffer |
( |
unsigned char * |
_pucBuffer | ) |
|
|
inlinestatic |
Zero-out a buffer required for payload (un-)serialization.
- Parameters
-
[in] | _pucBuffer | Allocated buffer |
- See Also
- allocBuffer()
Definition at line 70 of file payload.hpp.
static void SGCTP::CPayload::freeBuffer |
( |
unsigned char * |
_pucBuffer | ) |
|
|
inlinestatic |
Free a buffer allocated for payload (un-)serialization.
- Parameters
-
[in] | _pucBuffer | Allocated buffer |
- See Also
- allocBuffer()
Definition at line 79 of file payload.hpp.
void CPayload::putBits |
( |
uint8_t |
_ui8tBitsSize, |
|
|
uint8_t |
_ui8tBits |
|
) |
| |
|
private |
Add the given bits to the payload.
- Parameters
-
[in] | _ui8tBitsSize | Data size (bits quantity) |
[in] | _ui8tBits | Data (bits) |
Definition at line 42 of file payload.cpp.
void CPayload::putBytes |
( |
uint16_t |
_ui16tBytesSize, |
|
|
const unsigned char * |
_pucBytes |
|
) |
| |
|
private |
Add the given bytes to the payload.
- Parameters
-
[in] | _ui16tBytesSize | Data size (bytes quantity) |
[in] | _pucBytes | Data buffer (to read the data from) |
Definition at line 57 of file payload.cpp.
uint8_t CPayload::getBits |
( |
uint8_t |
_ui8tBitsSize | ) |
|
|
private |
Retrieve the given bits from the payload.
- Parameters
-
[in] | _ui8tBitsSize | Data size (bits quantity) |
- Returns
- Data (bits)
Definition at line 69 of file payload.cpp.
void CPayload::getBytes |
( |
uint16_t |
_ui16tBytesSize, |
|
|
unsigned char * |
_pucBytes |
|
) |
| |
|
private |
Retrieve the given bytes from the payload.
- Parameters
-
[in] | _ui16tBytesSize | Data size (bytes quantity) |
[in] | _pucBytes | Data buffer (to write the data to) |
Definition at line 81 of file payload.cpp.
virtual int SGCTP::CPayload::alloc |
( |
| ) |
|
|
inlinevirtual |
Allocate resources for payload (un-)serialization.
- Returns
- Negative error code in case of error, zero otherwise
Reimplemented in SGCTP::CPayload_AES128.
Definition at line 146 of file payload.hpp.
int CPayload::serialize |
( |
unsigned char * |
_pucBuffer, |
|
|
const CData & |
_roData |
|
) |
| |
|
virtual |
Serialize the given SGCTP data into the given payload buffer.
- Parameters
-
[in] | _pucBuffer | Payload buffer (to write the serialization data to) |
[in] | _roData | SGCTP data object (to be serialized) |
- Returns
- (Positive) Quantity of data actually serialized; Negative error code in case of error
Reimplemented in SGCTP::CPayload_AES128.
Definition at line 93 of file payload.cpp.
int CPayload::unserialize |
( |
CData * |
_poData, |
|
|
const unsigned char * |
_pucBuffer, |
|
|
uint16_t |
_ui16tBufferSize |
|
) |
| |
|
virtual |
Unserialize the SGCTP data from the given payload buffer.
- Parameters
-
[in] | _poData | SGCTP data object (to store unserialized data) |
[in] | _pucBuffer | Payload buffer (to read the serialization data from) |
- Returns
- (Positive) Quantity of data actually unserialized; Negative error code in case of error
Reimplemented in SGCTP::CPayload_AES128.
Definition at line 355 of file payload.cpp.
virtual void SGCTP::CPayload::free |
( |
| ) |
|
|
inlinevirtual |
const uint16_t SGCTP::CPayload::BUFFER_SIZE = 33024 |
|
static |
Buffer size required for payload (un-)serialization.
Definition at line 50 of file payload.hpp.
const uint8_t CPayload::BITMASK = { 0, 1, 3, 7, 15, 31, 63, 127, 255 } |
|
staticprivate |
Bit masks used to (un-)serialize data bit-per-bit.
Definition at line 54 of file payload.hpp.
unsigned char* SGCTP::CPayload::pucBufferPut |
|
private |
const unsigned char* SGCTP::CPayload::pucBufferGet |
|
private |
uint32_t SGCTP::CPayload::ui32tBufferBitOffset |
|
private |
The documentation for this class was generated from the following files: