#include <source/ariba/utility/transport/tcpip/protlib/network_message.h>
Public Member Functions | |
| NetMsg (uint32 s) | |
| constructor | |
| NetMsg (uchar *b, uint32 s, bool copy=true) | |
| constructor | |
| NetMsg (const NetMsg &n) | |
| copy constructor | |
| ~NetMsg () | |
| destructor | |
| uint32 | get_size () const |
| get buffer size | |
| uint32 | get_bytes_left () const |
| get bytes left until buffer ends | |
| uint32 | get_pos () const |
| get pointer offset | |
| NetMsg & | set_pos (uint32 p) |
| move pointer to offset | |
| NetMsg & | set_pos_r (int32 rp) |
| move pointer relative | |
| NetMsg & | to_start () |
| set pointer to beginning | |
| uint32 | copy_from (const uchar *b, uint32 n) |
| copy into NetMsg buffer | |
| uint32 | copy_from (const uchar *b, uint32 start, uint32 end) |
| copy into NetMsg buffer | |
| uint32 | copy_to (uchar *b, uint32 n) const |
| copy from NetMsg buffer | |
| uint32 | copy_to (uchar *b, uint32 start, uint32 n) const |
| copy from NetMsg buffer | |
| uchar * | get_buffer () const |
| get pointer to buffer | |
| uint8 | decode8 (bool move=true) |
| decode uint8 | |
| uint16 | decode16 (bool move=true) |
| decode uint16 | |
| uint32 | decode32 (bool move=true) |
| decode uint32 | |
| uint64 | decode64 (bool move=true) |
| decode uint64 | |
| uint128 | decode128 (bool move=true) |
| decode uint128 | |
| void | encode8 (uint8 i, bool move=true) |
| encode uint8 | |
| void | encode16 (uint16 i, bool move=true) |
| encode uint16 | |
| void | encode32 (uint32 i, bool move=true) |
| encode uint32 | |
| void | encode64 (uint64 i, bool move=true) |
| encode uint64 | |
| void | encode128 (uint128 i, bool move=true) |
| encode uint128 | |
| void | decode (uchar *c, uint32 len, bool move=true) |
| decode uchars | |
| void | encode (const uchar *c, uint32 len, bool move=true) |
| encode uchars | |
| uint32 | decode (string &s, uint32 len, bool move=true) |
| decode string | |
| uint32 | encode (const string &s, bool move=true) |
| encode string | |
| void | decode (struct in_addr &in, bool move=true) |
| decode IPv4 | |
| void | encode (const struct in_addr &in, bool move=true) |
| encode IPv4 | |
| void | decode (struct in6_addr &in, bool move=true) |
| decode IPv6 | |
| void | encode (const struct in6_addr &in, bool move=true) |
| encode IPv6 | |
| uint32 | truncate () |
| truncate buffer | |
| uint32 | truncate (uint32 t) |
| truncate buffer | |
| void | padding (uint32 len, bool move=true) |
| apply padding | |
| bool | operator== (const NetMsg &n) const |
| test for equality | |
| void | encode (const NetMsg &m, uint32 len, bool move=true) |
| encode a NetMsg into this NetMsg | |
| void | decode (NetMsg &m, bool move=true) |
| decode a NetMsg from this NetMsg | |
| ostream & | hexdump (ostream &os, uchar *startpos=0, uint32 length=0) const |
| print a raw hexdump of the buffer | |
Static Public Attributes | |
| static const uint32 | max_size = 128000 |
Private Attributes | |
| uchar * | buf |
| buffer for data | |
| uint32 | buf_len |
| buffer size | |
| uchar * | pos |
| current reading/writing position | |
| uchar * | buf_end |
| buffer end | |
network message
This class is used to exchange data between signalling and transport protocol.
Definition at line 77 of file network_message.h.
uchar* protlib::NetMsg::buf [private] |
buffer for data
Definition at line 163 of file network_message.h.
Referenced by copy_from(), copy_to(), decode(), encode(), get_buffer(), get_bytes_left(), get_pos(), hexdump(), NetMsg(), operator==(), set_pos(), set_pos_r(), to_start(), truncate(), and ~NetMsg().
uchar* protlib::NetMsg::buf_end [private] |
buffer end
Ponter to the last byte of the buffer.
Definition at line 170 of file network_message.h.
Referenced by decode(), decode16(), decode32(), decode64(), decode8(), encode(), encode16(), encode32(), encode64(), encode8(), get_bytes_left(), get_pos(), hexdump(), NetMsg(), padding(), set_pos_r(), and truncate().
uint32 protlib::NetMsg::buf_len [private] |
buffer size
Definition at line 165 of file network_message.h.
Referenced by copy_from(), copy_to(), get_size(), hexdump(), NetMsg(), operator==(), set_pos(), and truncate().
uchar* protlib::NetMsg::pos [private] |
current reading/writing position
Definition at line 167 of file network_message.h.
Referenced by decode(), decode16(), decode32(), decode64(), decode8(), encode(), encode16(), encode32(), encode64(), encode8(), get_bytes_left(), get_pos(), NetMsg(), operator==(), padding(), set_pos(), set_pos_r(), to_start(), and truncate().
1.6.1