OpenSDN source code
MacAddress Class Reference

#include <mac_address.h>

Collaboration diagram for MacAddress:

Public Member Functions

 MacAddress ()
 
 MacAddress (const uint8_t *data)
 
 MacAddress (const MacAddress &rhs)
 
 MacAddress (const struct ether_addr &a)
 
 MacAddress (const struct ether_addr *a)
 
 MacAddress (unsigned int a, unsigned int b, unsigned int c, unsigned int d, unsigned int e, unsigned int f)
 
 MacAddress (const std::string &s, boost::system::error_code *error=NULL)
 
bool IsBroadcast () const
 
bool IsMulticast () const
 
bool IsZero () const
 
int CompareTo (const MacAddress &rhs, int len=0) const
 
bool operator== (const MacAddress *rhs) const
 
bool operator== (const MacAddress &rhs) const
 
bool operator< (const MacAddress &rhs) const
 
bool operator> (const MacAddress &rhs) const
 
bool operator!= (const MacAddress &rhs) const
 
u_int8_t & operator[] (size_t i)
 
u_int8_t operator[] (size_t i) const
 
MacAddress & operator= (const u_int8_t *c)
 
MacAddress & operator= (const struct sockaddr *sa)
 
MacAddress & operator= (const struct sockaddr &sa)
 
MacAddress & operator= (const struct ether_addr &ea)
 
MacAddress & operator= (const MacAddress &rhs)
 
bool ToArray (u_int8_t *p, size_t s) const
 
 operator ether_addr ()
 
 operator ether_addr & ()
 
 operator sockaddr () const
 
 operator const ether_addr & () const
 
 operator const u_int8_t * () const
 
 operator u_int8_t * ()
 
 operator const int8_t * () const
 
 operator int8_t * ()
 
u_int8_t & last_octet ()
 
void Zero ()
 
void Broadcast ()
 
void Multicast ()
 
const uint8_t * GetData () const
 
std::string ToString () const
 

Static Public Member Functions

static size_t size ()
 
static size_t bit_len ()
 
static MacAddress FromString (const std::string &str, boost::system::error_code *error=NULL)
 
static const MacAddress & BroadcastMac ()
 
static const MacAddress & MulticastMac ()
 
static const MacAddress & ZeroMac ()
 

Static Public Attributes

static const MacAddress kZeroMac
 
static const MacAddress kBroadcastMac
 
static const MacAddress kMulticastMac
 

Private Attributes

struct ether_addr addr_
 

Detailed Description

Definition at line 14 of file mac_address.h.

Constructor & Destructor Documentation

◆ MacAddress() [1/7]

MacAddress::MacAddress ( )

Definition at line 21 of file mac_address.cc.

◆ MacAddress() [2/7]

MacAddress::MacAddress ( const uint8_t *  data)
explicit

Definition at line 25 of file mac_address.cc.

◆ MacAddress() [3/7]

MacAddress::MacAddress ( const MacAddress &  rhs)
inline

Definition at line 19 of file mac_address.h.

◆ MacAddress() [4/7]

MacAddress::MacAddress ( const struct ether_addr &  a)
inlineexplicit

Definition at line 23 of file mac_address.h.

◆ MacAddress() [5/7]

MacAddress::MacAddress ( const struct ether_addr *  a)
inlineexplicit

Definition at line 26 of file mac_address.h.

◆ MacAddress() [6/7]

MacAddress::MacAddress ( unsigned int  a,
unsigned int  b,
unsigned int  c,
unsigned int  d,
unsigned int  e,
unsigned int  f 
)

Definition at line 41 of file mac_address.cc.

◆ MacAddress() [7/7]

MacAddress::MacAddress ( const std::string &  s,
boost::system::error_code *  error = NULL 
)
explicit

Definition at line 48 of file mac_address.cc.

Here is the call graph for this function:

Member Function Documentation

◆ bit_len()

static size_t MacAddress::bit_len ( )
inlinestatic

Definition at line 61 of file mac_address.h.

◆ Broadcast()

void MacAddress::Broadcast ( )
inline

Definition at line 135 of file mac_address.h.

◆ BroadcastMac()

static const MacAddress& MacAddress::BroadcastMac ( )
inlinestatic

Definition at line 152 of file mac_address.h.

◆ CompareTo()

int MacAddress::CompareTo ( const MacAddress &  rhs,
int  len = 0 
) const

Definition at line 87 of file mac_address.cc.

◆ FromString()

MacAddress MacAddress::FromString ( const std::string &  str,
boost::system::error_code *  error = NULL 
)
static

Definition at line 71 of file mac_address.cc.

◆ GetData()

const uint8_t* MacAddress::GetData ( ) const
inline

Definition at line 143 of file mac_address.h.

◆ IsBroadcast()

bool MacAddress::IsBroadcast ( ) const

Definition at line 33 of file mac_address.cc.

Here is the call graph for this function:

◆ IsMulticast()

bool MacAddress::IsMulticast ( ) const

Definition at line 37 of file mac_address.cc.

Here is the call graph for this function:

◆ IsZero()

bool MacAddress::IsZero ( ) const

Definition at line 29 of file mac_address.cc.

Here is the call graph for this function:

◆ last_octet()

u_int8_t& MacAddress::last_octet ( )
inline

Definition at line 127 of file mac_address.h.

◆ Multicast()

void MacAddress::Multicast ( )
inline

Definition at line 139 of file mac_address.h.

◆ MulticastMac()

static const MacAddress& MacAddress::MulticastMac ( )
inlinestatic

Definition at line 155 of file mac_address.h.

◆ operator const ether_addr &()

MacAddress::operator const ether_addr & ( ) const
inline

Definition at line 107 of file mac_address.h.

◆ operator const int8_t *()

MacAddress::operator const int8_t * ( ) const
inline

Definition at line 119 of file mac_address.h.

◆ operator const u_int8_t *()

MacAddress::operator const u_int8_t * ( ) const
inline

Definition at line 111 of file mac_address.h.

◆ operator ether_addr()

MacAddress::operator ether_addr ( )
inline

Definition at line 93 of file mac_address.h.

◆ operator ether_addr &()

MacAddress::operator ether_addr & ( )
inline

Definition at line 97 of file mac_address.h.

◆ operator int8_t *()

MacAddress::operator int8_t * ( )
inline

Definition at line 123 of file mac_address.h.

◆ operator sockaddr()

MacAddress::operator sockaddr ( ) const
inline

Definition at line 101 of file mac_address.h.

Here is the call graph for this function:

◆ operator u_int8_t *()

MacAddress::operator u_int8_t * ( )
inline

Definition at line 115 of file mac_address.h.

◆ operator!=()

bool MacAddress::operator!= ( const MacAddress &  rhs) const
inline

Definition at line 53 of file mac_address.h.

Here is the call graph for this function:

◆ operator<()

bool MacAddress::operator< ( const MacAddress &  rhs) const
inline

Definition at line 47 of file mac_address.h.

Here is the call graph for this function:

◆ operator=() [1/5]

MacAddress& MacAddress::operator= ( const MacAddress &  rhs)
inline

Definition at line 86 of file mac_address.h.

◆ operator=() [2/5]

MacAddress& MacAddress::operator= ( const struct ether_addr &  ea)
inline

Definition at line 81 of file mac_address.h.

◆ operator=() [3/5]

MacAddress& MacAddress::operator= ( const struct sockaddr &  sa)
inline

Definition at line 77 of file mac_address.h.

Here is the call graph for this function:

◆ operator=() [4/5]

MacAddress & MacAddress::operator= ( const struct sockaddr *  sa)

Definition at line 105 of file mac_address.cc.

◆ operator=() [5/5]

MacAddress & MacAddress::operator= ( const u_int8_t *  c)

Definition at line 100 of file mac_address.cc.

◆ operator==() [1/2]

bool MacAddress::operator== ( const MacAddress &  rhs) const
inline

Definition at line 44 of file mac_address.h.

Here is the call graph for this function:

◆ operator==() [2/2]

bool MacAddress::operator== ( const MacAddress *  rhs) const
inline

Definition at line 41 of file mac_address.h.

Here is the call graph for this function:

◆ operator>()

bool MacAddress::operator> ( const MacAddress &  rhs) const
inline

Definition at line 50 of file mac_address.h.

Here is the call graph for this function:

◆ operator[]() [1/2]

u_int8_t& MacAddress::operator[] ( size_t  i)
inline

Definition at line 65 of file mac_address.h.

◆ operator[]() [2/2]

u_int8_t MacAddress::operator[] ( size_t  i) const
inline

Definition at line 69 of file mac_address.h.

◆ size()

static size_t MacAddress::size ( )
inlinestatic

Definition at line 57 of file mac_address.h.

◆ ToArray()

bool MacAddress::ToArray ( u_int8_t *  p,
size_t  s 
) const

Definition at line 93 of file mac_address.cc.

◆ ToString()

string MacAddress::ToString ( ) const

Definition at line 53 of file mac_address.cc.

◆ Zero()

void MacAddress::Zero ( )
inline

Definition at line 131 of file mac_address.h.

◆ ZeroMac()

static const MacAddress& MacAddress::ZeroMac ( )
inlinestatic

Definition at line 158 of file mac_address.h.

Member Data Documentation

◆ addr_

struct ether_addr MacAddress::addr_
private

Definition at line 158 of file mac_address.h.

◆ kBroadcastMac

const MacAddress MacAddress::kBroadcastMac
static

Definition at line 150 of file mac_address.h.

◆ kMulticastMac

const MacAddress MacAddress::kMulticastMac
static

Definition at line 151 of file mac_address.h.

◆ kZeroMac

const MacAddress MacAddress::kZeroMac
static

Definition at line 149 of file mac_address.h.


The documentation for this class was generated from the following files: