INET Framework for OMNeT++/OMNEST
|
Buffer for serializer/deserializer. More...
#include <Buffer.h>
Public Member Functions | |
Buffer (const Buffer &base, unsigned int maxLength) | |
Buffer (void *buf, unsigned int bufLen) | |
void | seek (unsigned int newpos) const |
unsigned int | getPos () const |
unsigned int | getRemainingSize () const |
unsigned int | getRemainingSize (unsigned int reservedSize) const |
bool | hasError () const |
void | setError () const |
unsigned char | readByte () const |
void | readNBytes (unsigned int length, void *dest) const |
uint16_t | readUint16 () const |
uint32_t | readUint32 () const |
uint64_t | readUint64 () const |
MACAddress | readMACAddress () const |
IPv4Address | readIPv4Address () const |
IPv6Address | readIPv6Address () const |
void | writeByte (unsigned char data) |
void | writeByteTo (unsigned int position, unsigned char data) |
void | writeNBytes (unsigned int length, const void *src) |
void | writeNBytes (Buffer &inputBuffer, unsigned int length) |
void | fillNBytes (unsigned int length, unsigned char data) |
void | writeUint16 (uint16_t data) |
void | writeUint16To (unsigned int position, uint16_t data) |
void | writeUint32 (uint32_t data) |
void | writeUint64 (uint64_t data) |
void | writeMACAddress (const MACAddress &addr) |
void | writeIPv4Address (IPv4Address addr) |
void | writeIPv6Address (const IPv6Address &addr) |
void * | accessNBytes (unsigned int length) |
const void * | accessNBytes (unsigned int length) const |
unsigned char * | _getBuf () const |
unsigned int | _getBufSize () const |
Protected Attributes | |
unsigned char * | buf = nullptr |
unsigned int | bufsize = 0 |
unsigned int | pos = 0 |
bool | errorFound = false |
Buffer for serializer/deserializer.
inet::serializer::Buffer::Buffer | ( | const Buffer & | base, |
unsigned int | maxLength | ||
) |
|
inline |
|
inline |
Referenced by inet::serializer::ICMPSerializer::deserialize(), inet::serializer::ICMPv6Serializer::deserialize(), inet::serializer::UDPSerializer::deserialize(), inet::serializer::Ieee80211Serializer::deserialize(), inet::serializer::EthernetSerializer::deserialize(), inet::serializer::TCPSerializer::deserialize(), inet::serializer::ICMPv6Serializer::serialize(), inet::serializer::ICMPSerializer::serialize(), inet::serializer::UDPSerializer::serialize(), inet::serializer::EthernetSerializer::serialize(), inet::serializer::Ieee80211Serializer::serialize(), and inet::serializer::TCPSerializer::serialize().
|
inline |
void * inet::serializer::Buffer::accessNBytes | ( | unsigned int | length | ) |
Referenced by inet::serializer::IPv6Serializer::deserialize(), inet::serializer::ICMPSerializer::deserialize(), inet::serializer::UDPSerializer::deserialize(), inet::serializer::IGMPSerializer::deserialize(), inet::serializer::SCTPSerializer::deserialize(), inet::serializer::Ieee80211Serializer::deserialize(), inet::serializer::TCPSerializer::deserialize(), inet::serializer::EthernetSerializer::deserialize(), inet::serializer::IPv4Serializer::deserialize(), inet::serializer::DefaultSerializer::deserialize(), inet::serializer::ByteArraySerializer::deserialize(), inet::serializer::SerializerBase::lookupAndDeserialize(), inet::serializer::SerializerBase::lookupAndSerialize(), inet::serializer::IPv6Serializer::serialize(), inet::serializer::Ieee80211PhySerializer::serialize(), inet::serializer::IGMPSerializer::serialize(), inet::serializer::ICMPSerializer::serialize(), inet::serializer::SCTPSerializer::serialize(), inet::serializer::TCPSerializer::serialize(), inet::serializer::IPv4Serializer::serialize(), and inet::serializer::ByteArraySerializer::serialize().
|
inline |
Referenced by accessNBytes().
void inet::serializer::Buffer::fillNBytes | ( | unsigned int | length, |
unsigned char | data | ||
) |
Referenced by inet::serializer::IPv6Serializer::serialize(), inet::serializer::ICMPv6Serializer::serialize(), inet::serializer::UDPSerializer::serialize(), inet::serializer::ICMPSerializer::serialize(), inet::serializer::EthernetSerializer::serialize(), inet::serializer::TCPSerializer::serialize(), inet::serializer::EtherPhySerializer::serialize(), inet::serializer::IPv4Serializer::serialize(), inet::serializer::DefaultSerializer::serialize(), inet::serializer::ByteArraySerializer::serialize(), and inet::serializer::IPv4Serializer::serializeOptions().
|
inline |
Referenced by inet::serializer::IPv6Serializer::deserialize(), inet::serializer::IGMPSerializer::deserialize(), inet::serializer::UDPSerializer::deserialize(), inet::serializer::ICMPSerializer::deserialize(), inet::serializer::ICMPv6Serializer::deserialize(), inet::serializer::Ieee80211Serializer::deserialize(), inet::serializer::EthernetSerializer::deserialize(), inet::serializer::ARPSerializer::deserialize(), inet::serializer::EtherPhySerializer::deserialize(), inet::serializer::IPv4Serializer::deserialize(), inet::serializer::IPv4OptionDefaultSerializer::deserializeOption(), inet::serializer::IPv4Serializer::deserializeOptions(), inet::serializer::SerializerBase::deserializePacket(), inet::tcp::TCP_NSC::handleIpInputMessage(), inet::tcp::TCP_lwIP::handleIpInputMessage(), inet::serializer::SerializerBase::lookupAndDeserialize(), inet::serializer::SerializerBase::lookupAndSerialize(), inet::serializer::ARPSerializer::readIPv4Address(), inet::serializer::ARPSerializer::readMACAddress(), inet::sctp::SCTP::send_to_ip(), inet::serializer::Ieee80211PhySerializer::serialize(), inet::serializer::IPv6Serializer::serialize(), inet::serializer::IGMPSerializer::serialize(), inet::serializer::UDPSerializer::serialize(), inet::serializer::ICMPv6Serializer::serialize(), inet::serializer::ICMPSerializer::serialize(), inet::physicallayer::APSKPhyFrameSerializer::serialize(), inet::serializer::EthernetSerializer::serialize(), inet::serializer::Ieee80211Serializer::serialize(), inet::serializer::TCPSerializer::serialize(), inet::serializer::ARPSerializer::serialize(), inet::serializer::EtherPhySerializer::serialize(), inet::serializer::IPv4Serializer::serialize(), inet::serializer::SerializerBase::serializePacket(), inet::PcapDump::writeFrame(), and inet::PcapDump::writeIPv6Frame().
|
inline |
Referenced by inet::serializer::ICMPSerializer::deserialize(), inet::serializer::ICMPv6Serializer::deserialize(), inet::serializer::SCTPSerializer::deserialize(), inet::serializer::Ieee80211Serializer::deserialize(), inet::serializer::TCPSerializer::deserialize(), inet::serializer::EthernetSerializer::deserialize(), inet::serializer::EtherPhySerializer::deserialize(), inet::serializer::IPv4Serializer::deserialize(), inet::serializer::DefaultSerializer::deserialize(), inet::serializer::ByteArraySerializer::deserialize(), inet::serializer::IPv4Serializer::deserializeOptions(), inet::serializer::SerializerBase::deserializePacket(), inet::serializer::Ieee80211PhySerializer::serialize(), inet::serializer::ICMPSerializer::serialize(), inet::serializer::SCTPSerializer::serialize(), inet::serializer::EthernetSerializer::serialize(), inet::serializer::Ieee80211Serializer::serialize(), inet::serializer::TCPSerializer::serialize(), inet::serializer::EtherPhySerializer::serialize(), inet::serializer::ByteArraySerializer::serialize(), and inet::serializer::IPv4Serializer::serializeOptions().
|
inline |
|
inline |
Referenced by inet::serializer::IGMPSerializer::deserialize(), inet::serializer::TCPSerializer::deserialize(), inet::serializer::IPv4Serializer::deserialize(), inet::serializer::SerializerBase::deserializePacket(), inet::serializer::SerializerBase::lookupAndSerialize(), inet::serializer::IPv4Serializer::serialize(), and inet::serializer::SerializerBase::serializePacket().
unsigned char inet::serializer::Buffer::readByte | ( | ) | const |
Referenced by inet::serializer::ICMPSerializer::deserialize(), inet::serializer::IGMPSerializer::deserialize(), inet::serializer::ICMPv6Serializer::deserialize(), inet::serializer::Ieee80211Serializer::deserialize(), inet::serializer::EthernetSerializer::deserialize(), inet::serializer::ARPSerializer::deserialize(), inet::serializer::IPv4OptionDefaultSerializer::deserializeOption(), inet::serializer::TCPSerializer::deserializeOption(), inet::serializer::IPv4Serializer::deserializeOptions(), inet::serializer::Ieee80211Serializer::parseDataOrMgmtFrame(), readMACAddress(), and writeNBytes().
|
inline |
IPv6Address inet::serializer::Buffer::readIPv6Address | ( | ) | const |
Referenced by inet::serializer::ICMPv6Serializer::deserialize().
MACAddress inet::serializer::Buffer::readMACAddress | ( | ) | const |
void inet::serializer::Buffer::readNBytes | ( | unsigned int | length, |
void * | dest | ||
) | const |
uint16_t inet::serializer::Buffer::readUint16 | ( | ) | const |
Referenced by inet::serializer::ICMPSerializer::deserialize(), inet::serializer::ICMPv6Serializer::deserialize(), inet::serializer::UDPSerializer::deserialize(), inet::serializer::IGMPSerializer::deserialize(), inet::serializer::Ieee80211Serializer::deserialize(), inet::serializer::EthernetSerializer::deserialize(), inet::serializer::ARPSerializer::deserialize(), inet::serializer::IPv4OptionDefaultSerializer::deserializeOption(), inet::serializer::TCPSerializer::deserializeOption(), and inet::serializer::Ieee80211Serializer::parseDataOrMgmtFrame().
uint32_t inet::serializer::Buffer::readUint32 | ( | ) | const |
Referenced by inet::serializer::ICMPSerializer::deserialize(), inet::serializer::ICMPv6Serializer::deserialize(), inet::serializer::Ieee80211Serializer::deserialize(), inet::serializer::EthernetSerializer::deserialize(), inet::serializer::IPv4OptionDefaultSerializer::deserializeOption(), inet::serializer::TCPSerializer::deserializeOption(), and readIPv6Address().
uint64_t inet::serializer::Buffer::readUint64 | ( | ) | const |
Referenced by inet::serializer::Ieee80211Serializer::deserialize().
|
inline |
Referenced by inet::serializer::ICMPv6Serializer::deserialize(), inet::serializer::IGMPSerializer::deserialize(), inet::serializer::TCPSerializer::deserialize(), inet::serializer::EtherPhySerializer::deserialize(), inet::serializer::IPv4Serializer::deserialize(), inet::serializer::IPv4OptionDefaultSerializer::deserializeOption(), inet::serializer::IPv4Serializer::deserializeOptions(), inet::serializer::SerializerBase::deserializePacket(), inet::serializer::Ieee80211Serializer::parseDataOrMgmtFrame(), inet::serializer::ARPSerializer::readIPv4Address(), inet::serializer::ARPSerializer::readMACAddress(), and inet::serializer::IPv4Serializer::serialize().
|
inline |
Referenced by inet::serializer::IPv6Serializer::deserialize(), inet::serializer::Ieee80211Serializer::deserialize(), inet::serializer::TCPSerializer::deserialize(), inet::serializer::IPv4Serializer::deserialize(), inet::serializer::SerializerBase::lookupAndSerialize(), and inet::serializer::IPv4Serializer::serialize().
void inet::serializer::Buffer::writeByte | ( | unsigned char | data | ) |
Referenced by inet::serializer::IPv6Serializer::serialize(), inet::serializer::ICMPSerializer::serialize(), inet::serializer::ICMPv6Serializer::serialize(), inet::serializer::IGMPSerializer::serialize(), inet::serializer::EthernetSerializer::serialize(), inet::serializer::ARPSerializer::serialize(), inet::serializer::Ieee80211Serializer::serialize(), inet::serializer::EtherPhySerializer::serialize(), inet::serializer::IPv4OptionDefaultSerializer::serializeOption(), and inet::serializer::TCPSerializer::serializeOption().
void inet::serializer::Buffer::writeByteTo | ( | unsigned int | position, |
unsigned char | data | ||
) |
|
inline |
|
inline |
void inet::serializer::Buffer::writeMACAddress | ( | const MACAddress & | addr | ) |
Referenced by inet::serializer::ICMPv6Serializer::serialize(), inet::serializer::EthernetSerializer::serialize(), inet::serializer::Ieee80211Serializer::serialize(), and inet::serializer::ARPSerializer::serialize().
void inet::serializer::Buffer::writeNBytes | ( | unsigned int | length, |
const void * | src | ||
) |
void inet::serializer::Buffer::writeNBytes | ( | Buffer & | inputBuffer, |
unsigned int | length | ||
) |
void inet::serializer::Buffer::writeUint16 | ( | uint16_t | data | ) |
Referenced by inet::serializer::IPv6Serializer::serialize(), inet::serializer::ICMPSerializer::serialize(), inet::serializer::ICMPv6Serializer::serialize(), inet::serializer::UDPSerializer::serialize(), inet::serializer::IGMPSerializer::serialize(), inet::serializer::EthernetSerializer::serialize(), inet::serializer::ARPSerializer::serialize(), inet::serializer::Ieee80211Serializer::serialize(), inet::serializer::IPv4OptionDefaultSerializer::serializeOption(), and inet::serializer::TCPSerializer::serializeOption().
void inet::serializer::Buffer::writeUint16To | ( | unsigned int | position, |
uint16_t | data | ||
) |
Referenced by inet::serializer::ICMPSerializer::serialize(), inet::serializer::UDPSerializer::serialize(), inet::serializer::IGMPSerializer::serialize(), inet::serializer::ICMPv6Serializer::serialize(), inet::serializer::EthernetSerializer::serialize(), and inet::serializer::TCPSerializer::serialize().
void inet::serializer::Buffer::writeUint32 | ( | uint32_t | data | ) |
Referenced by inet::serializer::IPv6Serializer::serialize(), inet::serializer::ICMPSerializer::serialize(), inet::serializer::ICMPv6Serializer::serialize(), inet::serializer::EthernetSerializer::serialize(), inet::serializer::Ieee80211Serializer::serialize(), inet::serializer::IPv4OptionDefaultSerializer::serializeOption(), and inet::serializer::TCPSerializer::serializeOption().
void inet::serializer::Buffer::writeUint64 | ( | uint64_t | data | ) |
Referenced by inet::serializer::Ieee80211Serializer::serialize().
|
protected |
Referenced by accessNBytes(), Buffer(), fillNBytes(), readByte(), readNBytes(), readUint16(), readUint32(), readUint64(), writeByte(), writeByteTo(), writeNBytes(), writeUint16(), writeUint16To(), writeUint32(), and writeUint64().
|
protected |
Referenced by accessNBytes(), Buffer(), readByte(), readNBytes(), readUint16(), readUint32(), readUint64(), writeByte(), writeByteTo(), writeUint16(), writeUint16To(), writeUint32(), and writeUint64().
|
mutableprotected |
Referenced by accessNBytes(), fillNBytes(), readByte(), readNBytes(), readUint16(), readUint32(), readUint64(), writeByte(), writeByteTo(), writeNBytes(), writeUint16(), writeUint16To(), writeUint32(), and writeUint64().
|
mutableprotected |
Referenced by accessNBytes(), Buffer(), fillNBytes(), readByte(), readNBytes(), readUint16(), readUint32(), readUint64(), writeByte(), writeNBytes(), writeUint16(), writeUint32(), and writeUint64().