22 #include "ns3/address.h"
23 #include "ns3/assert.h"
35 #define ASCII_a (0x41)
36 #define ASCII_z (0x5a)
37 #define ASCII_A (0x61)
38 #define ASCII_Z (0x7a)
39 #define ASCII_COLON (0x3a)
40 #define ASCII_ZERO (0x30)
65 while (*str != 0 && i < 2)
124 address.
CopyTo (retval.m_address);
138 static uint64_t
id = 0;
159 os.setf (std::ios::hex, std::ios::basefield);
161 for (uint8_t i = 0; i < 1; i++)
163 os << std::setw (2) << (uint32_t)ad[i] <<
":";
166 os << std::setw (2) << (uint32_t)ad[1];
167 os.setf (std::ios::dec, std::ios::basefield);
176 std::istringstream iss;
179 iss >> std::hex >> retval >> std::dec;
188 std::string::size_type col = 0;
189 for (uint8_t i = 0; i < 2; ++i)
192 std::string::size_type next;
193 next = v.find (
":", col);
194 if (next == std::string::npos)
196 tmp = v.substr (col, v.size ()-col);
202 tmp = v.substr (col, next-col);
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
#define NS_LOG_FUNCTION(parameters)
static Mac16Address ConvertFrom(const Address &address)
void CopyFrom(const uint8_t buffer[2])
#define NS_ASSERT(condition)
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
static uint8_t AsInt(std::string v)
a polymophic address class
bool CheckCompatible(uint8_t type, uint8_t len) const
static char AsciiToLowCase(char c)
NS_LOG_COMPONENT_DEFINE("Mac16Address")
static uint8_t GetType(void)
Address ConvertTo(void) const
void CopyTo(uint8_t buffer[2]) const
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
This class can contain 16 bit addresses.
uint32_t CopyTo(uint8_t buffer[MAX_SIZE]) const
ATTRIBUTE_HELPER_CPP(ObjectFactory)
static bool IsMatchingType(const Address &address)
static Mac16Address Allocate(void)
Allocate a new Mac16Address.
#define ASCII_a
Macro to make help make class an ns-3 attribute.
static uint8_t Register(void)
Allocate a new type id for a new type of address.