Update README and add contrib dir
This commit is contained in:
86
contrib/ethernet/model/ethernet-header2.h
Normal file
86
contrib/ethernet/model/ethernet-header2.h
Normal file
@@ -0,0 +1,86 @@
|
||||
#ifndef ETHERNET_HEADER2_H
|
||||
#define ETHERNET_HEADER2_H
|
||||
|
||||
#include "ns3/header.h"
|
||||
#include "ns3/mac48-address.h"
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
/**
|
||||
* \ingroup ethernet
|
||||
* \brief Packet header for Ethernet
|
||||
*
|
||||
* This class can be used to add a header to Ethernet packet.
|
||||
*/
|
||||
|
||||
class EthernetHeader2 : public Header
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Construct a Ethernet header.
|
||||
*/
|
||||
EthernetHeader2();
|
||||
|
||||
/**
|
||||
* \brief Destroy a Ethernet header.
|
||||
*/
|
||||
~EthernetHeader2() override;
|
||||
|
||||
/**
|
||||
* \brief Get the TypeId
|
||||
*
|
||||
* \return The TypeId for this class
|
||||
*/
|
||||
static TypeId GetTypeId();
|
||||
|
||||
/**
|
||||
* \brief Get the TypeId of the instance
|
||||
*
|
||||
* \return The TypeId for this instance
|
||||
*/
|
||||
TypeId GetInstanceTypeId() const override;
|
||||
|
||||
void Print(std::ostream& os) const override;
|
||||
void Serialize(Buffer::Iterator start) const override;
|
||||
uint32_t Deserialize(Buffer::Iterator start) override;
|
||||
uint32_t GetSerializedSize() const override;
|
||||
|
||||
void SetDest(Mac48Address addr);
|
||||
Mac48Address GetDest();
|
||||
void SetSrc(Mac48Address addr);
|
||||
Mac48Address GetSrc();
|
||||
uint8_t GetPcp();
|
||||
uint8_t GetDei();
|
||||
uint16_t GetVid();
|
||||
void SetEthertype(uint16_t ethertype);
|
||||
uint16_t GetEthertype();
|
||||
|
||||
void SetVlanTag(uint8_t pcp, uint8_t dei, uint16_t vid);
|
||||
void SetRedundancyTag(uint16_t seqNum);
|
||||
uint16_t RemoveRedundancyTag();
|
||||
|
||||
|
||||
private:
|
||||
Mac48Address m_dest;
|
||||
Mac48Address m_src;
|
||||
|
||||
//QTag (VlanTag, RedundancyTag ...)
|
||||
enum TagType
|
||||
{
|
||||
VLAN,
|
||||
REDUNDANCY,
|
||||
};
|
||||
struct Qtag
|
||||
{
|
||||
uint16_t TPID; //Tag Protocol Identifier
|
||||
uint32_t TCI; //Tag Control Information
|
||||
TagType Type;
|
||||
};
|
||||
|
||||
std::vector<Qtag> m_QTagList;
|
||||
|
||||
uint16_t m_ethertype;
|
||||
};
|
||||
|
||||
} // namespace eden
|
||||
#endif /* ETHERNET_HEADER2_H */
|
||||
Reference in New Issue
Block a user