21 #include "ns3/address.h"
22 #include "ns3/assert.h"
34 #define ASCII_a (0x41)
35 #define ASCII_z (0x5a)
36 #define ASCII_A (0x61)
37 #define ASCII_Z (0x7a)
38 #define ASCII_COLON (0x3a)
39 #define ASCII_ZERO (0x30)
64 while (*str != 0 && i < 8)
120 address.
CopyTo (retval.m_address);
135 static uint64_t
id = 0;
138 address.
m_address[0] = (
id >> 56) & 0xff;
139 address.
m_address[1] = (
id >> 48) & 0xff;
140 address.
m_address[2] = (
id >> 40) & 0xff;
141 address.
m_address[3] = (
id >> 32) & 0xff;
142 address.
m_address[4] = (
id >> 24) & 0xff;
143 address.
m_address[5] = (
id >> 16) & 0xff;
161 os.setf (std::ios::hex, std::ios::basefield);
163 for (uint8_t i=0; i < 7; i++)
165 os << std::setw (2) << (uint32_t)ad[i] <<
":";
168 os << std::setw (2) << (uint32_t)ad[7];
169 os.setf (std::ios::dec, std::ios::basefield);
178 std::istringstream iss;
181 iss >> std::hex >> retval >> std::dec;
190 std::string::size_type col = 0;
191 for (uint8_t i = 0; i < 8; ++i)
194 std::string::size_type next;
195 next = v.find (
":", col);
196 if (next == std::string::npos)
198 tmp = v.substr (col, v.size ()-col);
204 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 bool IsMatchingType(const Address &address)
#define NS_ASSERT(condition)
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
static uint8_t AsInt(std::string v)
NS_LOG_COMPONENT_DEFINE("Mac64Address")
a polymophic address class
bool CheckCompatible(uint8_t type, uint8_t len) const
static char AsciiToLowCase(char c)
void CopyTo(uint8_t buffer[8]) const
void CopyFrom(const uint8_t buffer[8])
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
#define ASCII_a
Macro to make help make class an ns-3 attribute.
Address ConvertTo(void) const
uint32_t CopyTo(uint8_t buffer[MAX_SIZE]) const
static Mac64Address ConvertFrom(const Address &address)
static uint8_t GetType(void)
ATTRIBUTE_HELPER_CPP(ObjectFactory)
static uint8_t Register(void)
Allocate a new type id for a new type of address.
static Mac64Address Allocate(void)
Allocate a new Mac64Address.