INET Framework for OMNeT++/OMNEST
|
Converts between cPacket and binary (network byte order) packet. More...
#include <SerializerBase.h>
Public Member Functions | |
SerializerBase (const char *name=nullptr) | |
void | serializePacket (const cPacket *pkt, Buffer &b, Context &context) |
cPacket * | deserializePacket (const Buffer &b, Context &context) |
Static Public Member Functions | |
static SerializerBase & | lookupSerializer (const cPacket *pkt, Context &context, ProtocolGroup group, int id) |
static void | lookupAndSerialize (const cPacket *pkt, Buffer &b, Context &context, ProtocolGroup group, int id, unsigned int maxLength=(unsigned int)(-1)) |
static SerializerBase & | lookupDeserializer (Context &context, ProtocolGroup group, int id) |
static cPacket * | lookupAndDeserialize (const Buffer &b, Context &context, ProtocolGroup group, int id, unsigned int maxLength=(unsigned int)(-1)) |
Protected Member Functions | |
virtual void | serialize (const cPacket *pkt, Buffer &b, Context &context)=0 |
Serializes a cPacket for transmission on the wire. More... | |
virtual cPacket * | deserialize (const Buffer &b, Context &context)=0 |
Puts a packet sniffed from the wire into an EtherFrame. More... | |
Converts between cPacket and binary (network byte order) packet.
|
inline |
|
protectedpure virtual |
Puts a packet sniffed from the wire into an EtherFrame.
Implemented in inet::serializer::ByteArraySerializer, inet::serializer::DefaultSerializer, inet::serializer::IPv4Serializer, inet::serializer::EtherPhySerializer, inet::serializer::ARPSerializer, inet::serializer::EthernetSerializer, inet::serializer::TCPSerializer, inet::serializer::Ieee80211Serializer, inet::serializer::ICMPSerializer, inet::serializer::IGMPSerializer, inet::serializer::ICMPv6Serializer, inet::serializer::SCTPSerializer, inet::serializer::UDPSerializer, and inet::serializer::IPv6Serializer.
Referenced by deserializePacket().
cPacket * inet::serializer::SerializerBase::deserializePacket | ( | const Buffer & | b, |
Context & | context | ||
) |
Referenced by inet::serializer::Ieee80211PhySerializer::deserialize(), inet::serializer::IGMPSerializer::deserialize(), inet::serializer::UDPSerializer::deserialize(), inet::physicallayer::APSKPhyFrameSerializer::deserialize(), inet::ExtInterface::handleMessage(), and lookupAndDeserialize().
|
static |
Referenced by inet::IPv4FragBuf::addFragment(), inet::EtherMACBase::decapsulate(), inet::serializer::IPv6Serializer::deserialize(), inet::serializer::ICMPSerializer::deserialize(), inet::serializer::Ieee80211Serializer::deserialize(), inet::serializer::EthernetSerializer::deserialize(), inet::serializer::EtherPhySerializer::deserialize(), and inet::serializer::IPv4Serializer::deserialize().
|
static |
Referenced by inet::serializer::IPv6Serializer::serialize(), inet::serializer::ICMPv6Serializer::serialize(), inet::serializer::UDPSerializer::serialize(), inet::serializer::ICMPSerializer::serialize(), inet::serializer::EthernetSerializer::serialize(), inet::serializer::Ieee80211Serializer::serialize(), inet::serializer::EtherPhySerializer::serialize(), and inet::serializer::IPv4Serializer::serialize().
|
static |
Referenced by lookupAndDeserialize().
|
static |
Referenced by lookupAndSerialize().
|
protectedpure virtual |
Serializes a cPacket for transmission on the wire.
Returns the length of data written into buffer.
Implemented in inet::serializer::ByteArraySerializer, inet::serializer::DefaultSerializer, inet::serializer::IPv4Serializer, inet::serializer::EtherPhySerializer, inet::serializer::TCPSerializer, inet::serializer::ARPSerializer, inet::serializer::Ieee80211Serializer, inet::serializer::EthernetSerializer, inet::serializer::ICMPSerializer, inet::serializer::IGMPSerializer, inet::serializer::ICMPv6Serializer, inet::serializer::SCTPSerializer, inet::serializer::UDPSerializer, and inet::serializer::IPv6Serializer.
Referenced by serializePacket().
void inet::serializer::SerializerBase::serializePacket | ( | const cPacket * | pkt, |
Buffer & | b, | ||
Context & | context | ||
) |
Referenced by inet::serializer::SCTPSerializer::deserialize(), inet::tcp::TCP_NSC::handleIpInputMessage(), inet::tcp::TCP_lwIP::handleIpInputMessage(), inet::ExtInterface::handleMessage(), lookupAndSerialize(), inet::sctp::SCTP::send_to_ip(), inet::physicallayer::APSKPhyFrameSerializer::serialize(), inet::PcapDump::writeFrame(), and inet::PcapDump::writeIPv6Frame().