#include <bytebuffer.h>
Inheritance diagram for openikev2::ByteBuffer:

Public Member Functions | |
| ByteBuffer (uint32_t capacity) | |
| Creates a new ByteBuffer. | |
| ByteBuffer (const ByteBuffer &other) | |
| Creates a new ByteBuffer cloning another one. | |
| ByteBuffer (const ByteArray &byte_array) | |
| Creates a new ByteBuffer copying the data from a ByteArray. | |
| virtual void | writeBuffer (const void *buffer, uint32_t buffer_size) |
| Appends a standard byte array at the end of this ByteBuffer. | |
| virtual void | writeByteArray (const ByteArray &byte_array) |
| Appends a ByteArray at the end of this ByteBuffer. | |
| virtual void | writeInt8 (uint8_t value) |
| Appends a 8 bit integer at the end of the ByteBuffer. | |
| virtual void | writeInt16 (uint16_t value) |
| Appends a 16 bit integer at the end of the ByteBuffer, in network byte order. | |
| virtual void | writeInt32 (uint32_t value) |
| Appends a 32 bit integer at the end of the ByteBuffer, in network byte order. | |
| virtual void | fillBytes (uint32_t num_bytes, uint8_t byte) |
| Appends a 8 bit integer repeated num_bytes times. | |
| virtual void | readBuffer (uint32_t size_to_read, void *destination_buffer) |
| Reads size bytes and stores them in destination_buffer. | |
| virtual auto_ptr< ByteArray > | readByteArray (uint32_t size) |
| Reads size bytes and stores them in a new ByteArray. | |
| virtual uint8_t | readInt8 () |
| Reads a 8 bit integer from the begin of the ByteBuffer. | |
| virtual uint16_t | readInt16 () |
| Reads a 16 bit integer from the begin of the ByteBuffer, in network byte order. | |
| virtual uint32_t | readInt32 () |
| Reads a 32 bit integer from the begin of the ByteBuffer, in network byte order. | |
| virtual uint8_t * | getWritePosition () const |
| Gets the current write position. | |
| virtual void | setWritePosition (uint8_t *position) |
| Sets the write position. | |
| virtual uint8_t * | getReadPosition () const |
| Gets the current read position. | |
| virtual void | setReadPosition (uint8_t *position) |
| Sets the read position. | |
| virtual void | reset () |
| Resets the pointers. | |
| virtual void | skip (uint32_t bytes) |
| Skips the read of the indicated bytes. | |
Protected Member Functions | |
| virtual uint32_t | capacity () const |
| Returns the internal array capacity. | |
Protected Attributes | |
| uint8_t * | real_begin_array |
| Internal array. | |
| openikev2::ByteBuffer::ByteBuffer | ( | uint32_t | capacity | ) |
| openikev2::ByteBuffer::ByteBuffer | ( | const ByteBuffer & | other | ) |
| openikev2::ByteBuffer::ByteBuffer | ( | const ByteArray & | byte_array | ) |
Creates a new ByteBuffer copying the data from a ByteArray.
| byte_array | ByteArray to copy the data |
| uint32_t openikev2::ByteBuffer::capacity | ( | ) | const [protected, virtual] |
Returns the internal array capacity.
Reimplemented from openikev2::ByteArray.
| void openikev2::ByteBuffer::writeBuffer | ( | const void * | buffer, | |
| uint32_t | buffer_size | |||
| ) | [virtual] |
Appends a standard byte array at the end of this ByteBuffer.
| buffer | Standard byte arrray | |
| buffer_size | Size of the byte array |
| void openikev2::ByteBuffer::writeByteArray | ( | const ByteArray & | byte_array | ) | [virtual] |
| void openikev2::ByteBuffer::writeInt8 | ( | uint8_t | value | ) | [virtual] |
| void openikev2::ByteBuffer::writeInt16 | ( | uint16_t | value | ) | [virtual] |
Appends a 16 bit integer at the end of the ByteBuffer, in network byte order.
| value | 16 bit integer in host byte order |
| void openikev2::ByteBuffer::writeInt32 | ( | uint32_t | value | ) | [virtual] |
Appends a 32 bit integer at the end of the ByteBuffer, in network byte order.
| value | 32 bit integer in host byte order |
| void openikev2::ByteBuffer::fillBytes | ( | uint32_t | num_bytes, | |
| uint8_t | byte | |||
| ) | [virtual] |
Appends a 8 bit integer repeated num_bytes times.
| num_bytes | Number of bytes | |
| byte | 8 bit value |
| void openikev2::ByteBuffer::readBuffer | ( | uint32_t | size_to_read, | |
| void * | destination_buffer | |||
| ) | [virtual] |
Reads size bytes and stores them in destination_buffer.
| size_to_read | Size to read | |
| destination_buffer | Destination buffer |
| auto_ptr< ByteArray > openikev2::ByteBuffer::readByteArray | ( | uint32_t | size | ) | [virtual] |
| uint8_t openikev2::ByteBuffer::readInt8 | ( | ) | [virtual] |
| uint16_t openikev2::ByteBuffer::readInt16 | ( | ) | [virtual] |
Reads a 16 bit integer from the begin of the ByteBuffer, in network byte order.
| uint32_t openikev2::ByteBuffer::readInt32 | ( | ) | [virtual] |
Reads a 32 bit integer from the begin of the ByteBuffer, in network byte order.
| uint8_t * openikev2::ByteBuffer::getWritePosition | ( | ) | const [virtual] |
Gets the current write position.
| void openikev2::ByteBuffer::setWritePosition | ( | uint8_t * | position | ) | [virtual] |
Sets the write position.
| position | New write position |
| uint8_t * openikev2::ByteBuffer::getReadPosition | ( | ) | const [virtual] |
Gets the current read position.
| void openikev2::ByteBuffer::setReadPosition | ( | uint8_t * | position | ) | [virtual] |
Sets the read position.
| position | New read position |
| void openikev2::ByteBuffer::skip | ( | uint32_t | bytes | ) | [virtual] |
Skips the read of the indicated bytes.
| bytes | Number of bytes to be skipped |
1.5.1