move doxygen doc into Header and Trailer classes.
parent
7c4b2d67f6
commit
12fa2d9178
|
@ -28,17 +28,6 @@
|
||||||
|
|
||||||
namespace ns3 {
|
namespace ns3 {
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Protocol header and trailer serialization and deserialization.
|
|
||||||
*
|
|
||||||
* Every Protocol header or trailer which needs to be inserted and removed
|
|
||||||
* from a Packet instance must derive from this abstract base class
|
|
||||||
* and implement the private pure virtual methods listed below:
|
|
||||||
* - ns3::Chunk::SerializeTo
|
|
||||||
* - ns3::Chunk::DeserializeFrom
|
|
||||||
* - ns3::Chunk::GetSerializedSize
|
|
||||||
* - ns3::Chunk::PrintTo
|
|
||||||
*/
|
|
||||||
class Chunk {
|
class Chunk {
|
||||||
public:
|
public:
|
||||||
Chunk ();
|
Chunk ();
|
||||||
|
@ -49,31 +38,9 @@ public:
|
||||||
void Serialize (Buffer::Iterator start) const;
|
void Serialize (Buffer::Iterator start) const;
|
||||||
uint32_t Deserialize (Buffer::Iterator start);
|
uint32_t Deserialize (Buffer::Iterator start);
|
||||||
private:
|
private:
|
||||||
/**
|
|
||||||
* \param os the std output stream in which this
|
|
||||||
* protocol header must print itself.
|
|
||||||
*/
|
|
||||||
virtual void PrintTo (std::ostream &os) const = 0;
|
virtual void PrintTo (std::ostream &os) const = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* \returns the size of the serialized Header.
|
|
||||||
*/
|
|
||||||
virtual uint32_t GetSerializedSize (void) const = 0;
|
virtual uint32_t GetSerializedSize (void) const = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* \param i the buffer iterator in which the protocol header
|
|
||||||
* must serialize itself. If this is a trailer, the index
|
|
||||||
* identifies the end of the buffer. If this is a header,
|
|
||||||
* the index identifies the start of the buffer.
|
|
||||||
*/
|
|
||||||
virtual void SerializeTo (Buffer::Iterator i) const = 0;
|
virtual void SerializeTo (Buffer::Iterator i) const = 0;
|
||||||
/**
|
|
||||||
* \param i the buffer iterator from which the protocol header must
|
|
||||||
* deserialize itself. If this is a trailer, the index
|
|
||||||
* identifies the end of the buffer. If this is a header,
|
|
||||||
* the index identifies the start of the buffer.
|
|
||||||
* \returns the number of bytes read from the buffer
|
|
||||||
*/
|
|
||||||
virtual uint32_t DeserializeFrom (Buffer::Iterator i) = 0;
|
virtual uint32_t DeserializeFrom (Buffer::Iterator i) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,45 @@
|
||||||
|
|
||||||
namespace ns3 {
|
namespace ns3 {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Protocol header serialization and deserialization.
|
||||||
|
*
|
||||||
|
* Every Protocol header which needs to be inserted or removed
|
||||||
|
* from a Packet instance must derive from this abstract base class
|
||||||
|
* and implement the private pure virtual methods listed below:
|
||||||
|
* - ns3::Header::SerializeTo
|
||||||
|
* - ns3::Header::DeserializeFrom
|
||||||
|
* - ns3::Header::GetSerializedSize
|
||||||
|
* - ns3::Header::PrintTo
|
||||||
|
*/
|
||||||
class Header : public Chunk {
|
class Header : public Chunk {
|
||||||
public:
|
public:
|
||||||
virtual ~Header ();
|
virtual ~Header ();
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* \param os the std output stream in which this
|
||||||
|
* protocol header must print itself.
|
||||||
|
*/
|
||||||
|
virtual void PrintTo (std::ostream &os) const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \returns the size of the serialized Header.
|
||||||
|
*/
|
||||||
|
virtual uint32_t GetSerializedSize (void) const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \param i the buffer iterator in which the protocol header
|
||||||
|
* must serialize itself. This iterator identifies
|
||||||
|
* the start of the buffer.
|
||||||
|
*/
|
||||||
|
virtual void SerializeTo (Buffer::Iterator i) const = 0;
|
||||||
|
/**
|
||||||
|
* \param i the buffer iterator from which the protocol header must
|
||||||
|
* deserialize itself. This iterator identifies
|
||||||
|
* the start of the buffer.
|
||||||
|
* \returns the number of bytes read from the buffer
|
||||||
|
*/
|
||||||
|
virtual uint32_t DeserializeFrom (Buffer::Iterator i) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace ns3
|
}; // namespace ns3
|
||||||
|
|
|
@ -26,9 +26,45 @@
|
||||||
|
|
||||||
namespace ns3 {
|
namespace ns3 {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Protocol trailer serialization and deserialization.
|
||||||
|
*
|
||||||
|
* Every Protocol trailer which needs to be inserted or removed
|
||||||
|
* from a Packet instance must derive from this abstract base class
|
||||||
|
* and implement the private pure virtual methods listed below:
|
||||||
|
* - ns3::Trailer::SerializeTo
|
||||||
|
* - ns3::Trailer::DeserializeFrom
|
||||||
|
* - ns3::Trailer::GetSerializedSize
|
||||||
|
* - ns3::Trailer::PrintTo
|
||||||
|
*/
|
||||||
class Trailer : public Chunk {
|
class Trailer : public Chunk {
|
||||||
public:
|
public:
|
||||||
virtual ~Trailer ();
|
virtual ~Trailer ();
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* \param os the std output stream in which this
|
||||||
|
* protocol trailer must print itself.
|
||||||
|
*/
|
||||||
|
virtual void PrintTo (std::ostream &os) const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \returns the size of the serialized Trailer.
|
||||||
|
*/
|
||||||
|
virtual uint32_t GetSerializedSize (void) const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \param i the buffer iterator in which the protocol trailer
|
||||||
|
* must serialize itself. This iterator identifies
|
||||||
|
* the end of the buffer.
|
||||||
|
*/
|
||||||
|
virtual void SerializeTo (Buffer::Iterator i) const = 0;
|
||||||
|
/**
|
||||||
|
* \param i the buffer iterator from which the protocol trailer must
|
||||||
|
* deserialize itself. This iterator identifies
|
||||||
|
* the end of the buffer.
|
||||||
|
* \returns the number of bytes read from the buffer
|
||||||
|
*/
|
||||||
|
virtual uint32_t DeserializeFrom (Buffer::Iterator i) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace ns3
|
}; // namespace ns3
|
||||||
|
|
Loading…
Reference in New Issue