23 #include "ns3/assert.h" 39 std::memset (
m_oi, 0, 5);
48 std::memcpy (
m_oi, str, length);
53 std::memcpy (
m_oi, str, length);
58 NS_FATAL_ERROR (
"cannot support organization identifier with length=" << length);
66 std::memcpy (this->
m_oi, oi.
m_oi, 5);
80 return (
m_oi[4] & 0x0f);
140 if ((i->m_type ==
OUI24)
141 && (std::memcmp (i->m_oi,
m_oi, 3) == 0 ))
152 if ((i->m_type ==
OUI36)
153 && (std::memcmp (i->m_oi,
m_oi, 4) == 0 ))
156 if ((i->m_oi[4] & 0xf0) == (
m_oi[4] & 0xf0))
166 NS_FATAL_ERROR (
"cannot deserialize the organization identifier field successfully");
185 return memcmp (a.
m_oi, b.
m_oi, 3) == 0;
190 return (memcmp (a.
m_oi, b.
m_oi, 4) == 0)
191 && ((a.
m_oi[4] & 0xf0) == (b.
m_oi[4] & 0xf0));
227 for (
int i = 0; i < oi.
m_type; i++)
229 os <<
"0x" << std::hex << static_cast<int> (oi.
m_oi[i]) <<
" ";
278 static TypeId tid =
TypeId (
"ns3::VendorSpecificActionHeader")
280 .SetGroupName (
"Wave")
305 os <<
"VendorSpecificActionHeader[ " 306 <<
"category = 0x" << std::hex << (int)
m_category 307 <<
"organization identifier = " <<
m_oi 357 NS_LOG_WARN (
"there is already a VsaCallback registered for OrganizationIdentifier " << oi);
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
virtual ~VendorSpecificContentManager(void)
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void RegisterVscCallback(OrganizationIdentifier oi, VscCallback cb)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
VendorSpecificContentManager(void)
#define ATTRIBUTE_HELPER_CPP(type)
Define the attribute value, accessor and checkers for class type.
uint32_t Deserialize(Buffer::Iterator start)
Deserialize from buffer.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
OrganizationIdentifier(void)
enum OrganizationIdentifierType GetType(void) const
void SetType(enum OrganizationIdentifierType type)
iterator in a Buffer instance
a polymophic address class
void DeregisterVscCallback(OrganizationIdentifier &oi)
bool operator<(const EventId &a, const EventId &b)
uint8_t m_oi[5]
organization identifier
VscCallbacks m_callbacks
VSC callbacks.
uint8_t GetManagementId(void) const
the organization identifier is a public organizationally unique identifier assigned by the IEEE...
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool IsVscCallbackRegistered(OrganizationIdentifier &oi)
virtual ~OrganizationIdentifier(void)
#define NS_FATAL_ERROR_NO_MSG()
Report a fatal error and terminate.
OrganizationIdentifier & operator=(const OrganizationIdentifier &oi)
assignment operator
VscCallback FindVscCallback(OrganizationIdentifier &oi)
static const uint8_t CATEGORY_OF_VSA
see IEEE 802.11-2007 chapter 7.3.1.11 Table 7-24—Category values
uint32_t GetSerializedSize(void) const
Get serialized size.
static VscCallback null_callback
VSC callback function.
static std::vector< OrganizationIdentifier > OrganizationIdentifiers
the OIs
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
bool operator==(const EventId &a, const EventId &b)
OrganizationIdentifierType
OrganizationIdentifierType enumeration.
void Serialize(Buffer::Iterator start) const
Serialize to buffer.
a unique identifier for an interface.
enum OrganizationIdentifierType m_type
OI type.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
std::map< OrganizationIdentifier, VscCallback >::iterator VscCallbacksI
VSC callback iterator typedef.