NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::util::ethernet::Address Class Reference

represents an Ethernet hardware address More...

#include <ethernet.hpp>

Inheritance diagram for ndn::util::ethernet::Address:
Collaboration diagram for ndn::util::ethernet::Address:

Public Member Functions

 Address ()
 Constructs a null Ethernet address (00:00:00:00:00:00) More...
 
 Address (uint8_t a1, uint8_t a2, uint8_t a3, uint8_t a4, uint8_t a5, uint8_t a6)
 Constructs a new Ethernet address with the given octets. More...
 
 Address (const uint8_t octets[ADDR_LEN])
 Constructs a new Ethernet address with the given octets. More...
 
bool isBroadcast () const
 True if this is a broadcast address (ff:ff:ff:ff:ff:ff) More...
 
bool isMulticast () const
 True if this is a multicast address. More...
 
bool isNull () const
 True if this is a null address (00:00:00:00:00:00) More...
 
std::string toString (char sep=':') const
 Converts the address to a human-readable string. More...
 

Static Public Member Functions

static Address fromString (const std::string &str)
 Creates an Address from a string containing an Ethernet address in hexadecimal notation, with colons or hyphens as separators. More...
 

Detailed Description

represents an Ethernet hardware address

Definition at line 53 of file ethernet.hpp.

Constructor & Destructor Documentation

◆ Address() [1/3]

ndn::util::ethernet::Address::Address ( )

Constructs a null Ethernet address (00:00:00:00:00:00)

Definition at line 33 of file ethernet.cpp.

Referenced by fromString(), and isNull().

◆ Address() [2/3]

ndn::util::ethernet::Address::Address ( uint8_t  a1,
uint8_t  a2,
uint8_t  a3,
uint8_t  a4,
uint8_t  a5,
uint8_t  a6 
)

Constructs a new Ethernet address with the given octets.

Definition at line 38 of file ethernet.cpp.

◆ Address() [3/3]

ndn::util::ethernet::Address::Address ( const uint8_t  octets[ADDR_LEN])
explicit

Constructs a new Ethernet address with the given octets.

Member Function Documentation

◆ isBroadcast()

bool ndn::util::ethernet::Address::isBroadcast ( ) const

True if this is a broadcast address (ff:ff:ff:ff:ff:ff)

Definition at line 54 of file ethernet.cpp.

References ndn::util::ethernet::getBroadcastAddress().

Referenced by nfd::EthernetFace::EthernetFace().

◆ isMulticast()

bool ndn::util::ethernet::Address::isMulticast ( ) const

True if this is a multicast address.

Definition at line 60 of file ethernet.cpp.

Referenced by nfd::EthernetFactory::createMulticastFace().

◆ isNull()

bool ndn::util::ethernet::Address::isNull ( ) const

True if this is a null address (00:00:00:00:00:00)

Definition at line 66 of file ethernet.cpp.

References Address().

Referenced by ndn::util::EtherCanonizeProvider::canonize().

◆ toString()

std::string ndn::util::ethernet::Address::toString ( char  sep = ':') const

Converts the address to a human-readable string.

Parameters
sepA character used to visually separate the octets, usually ':' (the default value) or '-'

Definition at line 72 of file ethernet.cpp.

Referenced by nfd::EthernetFactory::createMulticastFace(), nfd::EthernetFace::EthernetFace(), ndn::util::FaceUri::FaceUri(), ndn::util::EtherCanonizeProvider::isCanonical(), and ndn::util::ethernet::operator<<().

◆ fromString()

Address ndn::util::ethernet::Address::fromString ( const std::string &  str)
static

Creates an Address from a string containing an Ethernet address in hexadecimal notation, with colons or hyphens as separators.

Parameters
strThe string to be parsed
Returns
Always an instance of Address, which will be null if the parsing fails

Definition at line 86 of file ethernet.cpp.

References Address().

Referenced by ndn::util::EtherCanonizeProvider::canonize(), and ndn::util::EtherCanonizeProvider::isCanonical().


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