20 #include "ns3/assert.h"
41 std::memset(
m_oi, 0, 5);
50 std::memcpy(
m_oi, str, length);
55 std::memcpy(
m_oi, str, length);
60 NS_FATAL_ERROR(
"cannot support organization identifier with length=" << length);
82 return (
m_oi[4] & 0x0f);
144 if ((i->m_type ==
OUI24) && (std::memcmp(i->m_oi,
m_oi, 3) == 0))
157 if ((i->m_type ==
OUI36) && (std::memcmp(i->m_oi,
m_oi, 4) == 0))
160 if ((i->m_oi[4] & 0xf0) == (
m_oi[4] & 0xf0))
170 NS_FATAL_ERROR(
"cannot deserialize the organization identifier field successfully");
190 return memcmp(a.
m_oi, b.
m_oi, 3) == 0;
195 return (memcmp(a.
m_oi, b.
m_oi, 4) == 0) && ((a.
m_oi[4] & 0xf0) == (b.
m_oi[4] & 0xf0));
234 for (
int i = 0; i < oi.
m_type; i++)
236 os <<
"0x" << std::hex << static_cast<int>(oi.
m_oi[i]) <<
" ";
286 static TypeId tid =
TypeId(
"ns3::VendorSpecificActionHeader")
288 .SetGroupName(
"Wave")
312 os <<
"VendorSpecificActionHeader[ "
313 <<
"category = 0x" << std::hex << (
int)
m_category <<
"organization identifier = " <<
m_oi
363 NS_LOG_WARN(
"there is already a VsaCallback registered for OrganizationIdentifier " << oi);
a polymophic address class
iterator in a Buffer instance
the organization identifier is a public organizationally unique identifier assigned by the IEEE.
OrganizationIdentifierType
OrganizationIdentifierType enumeration.
OrganizationIdentifier & operator=(const OrganizationIdentifier &oi)
Assignment operator.
uint32_t GetSerializedSize() const
Get serialized size.
void Serialize(Buffer::Iterator start) const
Serialize to buffer.
virtual ~OrganizationIdentifier()
uint32_t Deserialize(Buffer::Iterator start)
Deserialize from buffer.
OrganizationIdentifierType GetType() const
uint8_t m_oi[5]
organization identifier
OrganizationIdentifierType m_type
OI type.
void SetType(OrganizationIdentifierType type)
uint8_t GetManagementId() const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void RegisterVscCallback(OrganizationIdentifier oi, VscCallback cb)
bool IsVscCallbackRegistered(OrganizationIdentifier &oi)
VscCallback FindVscCallback(OrganizationIdentifier &oi)
virtual ~VendorSpecificContentManager()
std::map< OrganizationIdentifier, VscCallback >::iterator VscCallbacksI
VSC callback iterator typedef.
void DeregisterVscCallback(OrganizationIdentifier &oi)
VscCallbacks m_callbacks
VSC callbacks.
VendorSpecificContentManager()
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Callback< R, Args... > MakeNullCallback()
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_FATAL_ERROR_NO_MSG()
Report a fatal error and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static VscCallback null_callback
VSC callback function.
static std::vector< OrganizationIdentifier > OrganizationIdentifiers
the OIs
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
bool operator==(const EventId &a, const EventId &b)
ATTRIBUTE_HELPER_CPP(Length)
bool operator<(const EventId &a, const EventId &b)
std::istream & operator>>(std::istream &is, Angles &a)
std::ostream & operator<<(std::ostream &os, const Angles &a)
static const uint8_t CATEGORY_OF_VSA
see IEEE 802.11-2007 chapter 7.3.1.11 Table 7-24—Category values