Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
Public Member Functions | Friends | List of all members
rofl::caddress_ll Class Reference

Public Member Functions

 caddress_ll (uint8_t *buf, size_t buflen)
 
 caddress_ll (const std::string &addr)
 
 caddress_ll (uint64_t mac)
 
 caddress_ll (const caddress_ll &addr)
 
caddress_lloperator= (const caddress_ll &addr)
 
bool operator< (const caddress_ll &addr) const
 
bool operator> (const caddress_ll &addr) const
 
caddress_ll operator& (const caddress_ll &addr) const
 
bool operator== (const caddress_ll &addr) const
 
bool operator!= (const caddress_ll &addr) const
 
bool is_multicast () const
 Check for multicast bit in hardware address. More...
 
bool is_broadcast () const
 Check for broadcast hardware address. More...
 
bool is_null () const
 Check for null hardware address. More...
 
uint64_t get_mac () const
 Return the MAC address as a uint64_t value. The MAC address will be transformed to host byte order and resides in the lower bytes. More...
 
void set_mac (uint64_t mac)
 
std::string str () const
 
- Public Member Functions inherited from rofl::caddress
 caddress (size_t size=0)
 
 caddress (const rofl::cmemory &addr)
 
 caddress (const caddress &addr)
 
caddressoperator= (const caddress &addr)
 
bool operator< (const caddress &addr) const
 
bool operator> (const caddress &addr) const
 
caddress operator& (const caddress &addr) const
 
bool operator== (const caddress &addr) const
 
bool operator!= (const caddress &addr) const
 
virtual size_t length () const
 
virtual void pack (uint8_t *buf, size_t buflen)
 Copies content of this cmemory instance to specified buffer.
 
virtual void unpack (uint8_t *buf, size_t buflen)
 Copies content of specified buffer into this cmemory instance .
 
- Public Member Functions inherited from rofl::cmemory
 cmemory (size_t len=CMEMORY_DEFAULT_SIZE)
 Constructor. Allocates a new memory area with specified size (default: 1024 bytes). More...
 
 cmemory (uint8_t *data, size_t datalen)
 Constructor. Allocates a new memory area and clones specified buffer. More...
 
 cmemory (cmemory const &m)
 Copy constructor. More...
 
virtual ~cmemory ()
 Destructor. Calls C-function free() for allocated memory area.
 
cmemoryoperator= (cmemory const &m)
 Assignment operator. More...
 
uint8_t & operator[] (size_t index) const
 Index operator. More...
 
bool operator== (cmemory const &m) const
 Comparison operator. More...
 
bool operator!= (cmemory const &m) const
 Comparison operator (unequal). More...
 
bool operator< (cmemory const &m) const
 Less than operator. More...
 
bool operator> (cmemory const &m) const
 Less than operator. More...
 
cmemory operator& (cmemory const &m) const
 AND operator. More...
 
cmemoryoperator+= (cmemory const &m)
 Append operator with assignment to this cmemory instance. More...
 
cmemory operator+ (cmemory const &m)
 Append operator with assignment to temporary cmemory instance. More...
 
uint8_t * somem () const
 Returns pointer to start of allocated memory area.
 
size_t memlen () const
 Returns length of allocated memory area.
 
virtual void assign (uint8_t *buf, size_t buflen)
 Overwrites memory area with plain buffer specified. Resizes internal memory as necessary. More...
 
uint8_t * insert (uint8_t *ptr, size_t len)
 Inserts len bytes at pointer ptr into allocated memory area. More...
 
uint8_t * insert (unsigned int offset, size_t len)
 Inserts len bytes at start of allocated memory area plus offset. More...
 
void remove (uint8_t *ptr, size_t len)
 Removes len bytes starting at pointer ptr from allocated memory area. More...
 
void remove (unsigned int offset, size_t len)
 Removes len bytes starting at offset relative to the allocated memory area. More...
 
unsigned int find_first_of (uint8_t value, unsigned int start)
 Returns index of first byte with value "value" found in allocated memory area starting at offset "start". More...
 
void clear ()
 Clears the allocated memory area by setting all bytes to 0.
 
virtual std::string toString () const
 map onto std::string instance
 
virtual bool empty () const
 Returns boolean value empty/non empty.
 

Friends

std::ostream & operator<< (std::ostream &os, const caddress_ll &addr)
 
Inheritance diagram for rofl::caddress_ll:
rofl::caddress rofl::cmemory

Member Function Documentation

uint64_t caddress_ll::get_mac ( ) const

Return the MAC address as a uint64_t value. The MAC address will be transformed to host byte order and resides in the lower bytes.

Returns
uint64_t mac
bool caddress_ll::is_broadcast ( ) const

Check for broadcast hardware address.

Returns
true: hardware address equals "ff:ff:ff:ff:ff:ff", false otherwise
bool caddress_ll::is_multicast ( ) const

Check for multicast bit in hardware address.

Returns
true: hardware address has multicast bit set, false otherwise
bool caddress_ll::is_null ( ) const

Check for null hardware address.

Returns
true: hardware address equals "00:00:00:00:00:00", false otherwise

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