add GetUid methods to all headers and trailers

This commit is contained in:
Mathieu Lacage
2007-08-03 09:23:41 +02:00
parent 740ad8c1b2
commit e672f9711f
12 changed files with 61 additions and 8 deletions

View File

@@ -25,6 +25,12 @@
namespace ns3 {
const char *
ArpHeader::GetUid (void)
{
return "ArpHeader.ns3";
}
ArpHeader::~ArpHeader ()
{}

View File

@@ -30,8 +30,11 @@ namespace ns3 {
/**
* \brief The packet header for an ARP packet
*/
class ArpHeader : public Header {
public:
class ArpHeader : public Header
{
public:
static const char *GetUid (void);
virtual ~ArpHeader ();
void SetRequest (MacAddress sourceHardwareAddress,

View File

@@ -30,6 +30,12 @@ namespace ns3 {
bool Ipv4Header::m_calcChecksum = false;
const char *
Ipv4Header::GetUid (void)
{
return "Ipv4Header.ns3";
}
Ipv4Header::Ipv4Header ()
: m_payloadSize (0),
m_identification (0),

View File

@@ -29,8 +29,10 @@ namespace ns3 {
/**
* \brief Packet header for IPv4
*/
class Ipv4Header : public Header {
class Ipv4Header : public Header
{
public:
static const char *GetUid (void);
/**
* \brief Construct a null IPv4 header
*/

View File

@@ -26,6 +26,12 @@ namespace ns3 {
bool UdpHeader::m_calcChecksum = false;
const char *
UdpHeader::GetUid (void)
{
return "UdpHeader.ns3";
}
/* The magic values below are used only for debugging.
* They can be used to easily detect memory corruption
* problems so you can see the patterns in memory.

View File

@@ -30,8 +30,11 @@ namespace ns3 {
/**
* \brief Packet header for UDP packets
*/
class UdpHeader : public Header {
class UdpHeader : public Header
{
public:
static const char *GetUid (void);
/**
* \brief Constructor
*

View File

@@ -29,6 +29,12 @@ NS_DEBUG_COMPONENT_DEFINE ("EthernetHeader");
namespace ns3 {
const char *
EthernetHeader::GetUid (void)
{
return "EthernetHeader.ns3";
}
EthernetHeader::EthernetHeader (bool hasPreamble)
: m_enPreambleSfd (hasPreamble),
m_lengthType (0)

View File

@@ -45,8 +45,11 @@ namespace ns3 {
* the packet. Eventually the class will be improved to also support
* VLAN tags in packet headers.
*/
class EthernetHeader : public Header {
class EthernetHeader : public Header
{
public:
static const char *GetUid (void);
/**
* \brief Construct a null ethernet header
* \param hasPreamble if true, insert and remove an ethernet preamble from the

View File

@@ -30,6 +30,12 @@ namespace ns3 {
bool EthernetTrailer::m_calcFcs = false;
const char *
EthernetTrailer::GetUid (void)
{
return "EthernetTrailer.ns3";
}
EthernetTrailer::EthernetTrailer ()
{
Init();

View File

@@ -33,8 +33,11 @@ namespace ns3 {
* ethernet packet. The actual FCS functionality is not yet coded and
* so this acts more as a placeholder.
*/
class EthernetTrailer : public Trailer {
class EthernetTrailer : public Trailer
{
public:
static const char *GetUid (void);
/**
* \brief Construct a null ethernet trailer
*/

View File

@@ -25,6 +25,12 @@
namespace ns3 {
const char *
LlcSnapHeader::GetUid (void)
{
return "LlcSnapHeader.ns3";
}
LlcSnapHeader::LlcSnapHeader ()
{}

View File

@@ -27,8 +27,11 @@
namespace ns3 {
class LlcSnapHeader : public Header {
public:
class LlcSnapHeader : public Header
{
public:
static const char *GetUid (void);
LlcSnapHeader ();
virtual ~LlcSnapHeader ();