#include <ClnsAddress.h>
◆ AddressCategory
◆ ClnsAddress() [1/3]
| inet::ClnsAddress::ClnsAddress |
( |
| ) |
|
◆ ClnsAddress() [2/3]
| inet::ClnsAddress::ClnsAddress |
( |
std::string |
net | ) |
|
51 unsigned int dots = 0;
61 found = net.find_first_of(
".");
62 if (found != 2 || net.length() != 25) {
66 while (found != std::string::npos) {
71 areaID += (uint64_t)(strtoul(net.substr(0, 2).c_str(),
nullptr, 16)) << 16;
74 areaID += (uint64_t)(strtoul(net.substr(3, 4).c_str(),
nullptr, 16));
79 systemID += (uint64_t)(strtoul(net.substr(8, 4).c_str(),
nullptr, 16)) << 32;
83 systemID += (uint64_t)(strtoul(net.substr(13, 4).c_str(),
nullptr, 16)) << 16;
87 systemID += (uint64_t)(strtoul(net.substr(18, 4).c_str(),
nullptr, 16));
94 found = net.find_first_of(
".", found + 1);
101 nsel = strtoul(net.substr(23, 2).c_str(),
nullptr, 16);
◆ ClnsAddress() [3/3]
| inet::ClnsAddress::ClnsAddress |
( |
uint64_t |
areaID, |
|
|
uint64_t |
systemID, |
|
|
uint8_t |
nsel = 0 |
|
) |
| |
◆ ~ClnsAddress()
| inet::ClnsAddress::~ClnsAddress |
( |
| ) |
|
|
virtual |
◆ equals()
| bool inet::ClnsAddress::equals |
( |
const ClnsAddress & |
toCmp | ) |
const |
|
inline |
◆ getAreaId()
| uint64_t inet::ClnsAddress::getAreaId |
( |
| ) |
const |
◆ getNsel()
| uint8_t inet::ClnsAddress::getNsel |
( |
| ) |
const |
◆ getSystemId()
| uint64_t inet::ClnsAddress::getSystemId |
( |
| ) |
const |
◆ isUnspecified()
| bool inet::ClnsAddress::isUnspecified |
( |
| ) |
const |
◆ operator!=()
| bool inet::ClnsAddress::operator!= |
( |
const ClnsAddress & |
addr1 | ) |
const |
|
inline |
◆ operator<()
| bool inet::ClnsAddress::operator< |
( |
const ClnsAddress & |
addr1 | ) |
const |
|
inline |
Compares two CLNS addresses.
77 {
if (
areaID == addr1.getAreaId()) {
return systemID < addr1.getSystemId(); }
else {
return areaID < addr1.getAreaId(); } }
◆ operator<=()
| bool inet::ClnsAddress::operator<= |
( |
const ClnsAddress & |
addr1 | ) |
const |
|
inline |
78 {
if (
areaID == addr1.getAreaId()) {
return systemID <= addr1.getSystemId(); }
else {
return areaID < addr1.getAreaId(); } }
◆ operator==()
| bool inet::ClnsAddress::operator== |
( |
const ClnsAddress & |
addr1 | ) |
const |
|
inline |
◆ operator>()
| bool inet::ClnsAddress::operator> |
( |
const ClnsAddress & |
addr1 | ) |
const |
|
inline |
79 {
if (
areaID == addr1.getAreaId()) {
return systemID > addr1.getSystemId(); }
else {
return areaID > addr1.getAreaId(); } }
◆ operator>=()
| bool inet::ClnsAddress::operator>= |
( |
const ClnsAddress & |
addr1 | ) |
const |
|
inline |
80 {
if (
areaID == addr1.getAreaId()) {
return systemID >= addr1.getSystemId(); }
else {
return areaID > addr1.getAreaId(); } }
◆ set()
| void inet::ClnsAddress::set |
( |
uint64_t |
areaID, |
|
|
uint64_t |
systemID, |
|
|
uint8_t |
nsel = 0 |
|
) |
| |
◆ setNsel()
| void inet::ClnsAddress::setNsel |
( |
uint8_t |
nsel | ) |
|
◆ str()
| std::string inet::ClnsAddress::str |
( |
bool |
printUnspec = true | ) |
const |
Returns the string representation of the address (e.g.
"49.0001.1921.6800.1001.00")
- Parameters
-
| printUnspec | show 00.0000.0000.0000.0000.00 as "<unspec>" if true |
120 return std::string(
"<unspec>");
122 std::ostringstream buf;
123 buf <<
std::hex << std::setfill(
'0')
124 << std::setw(2) << ((
areaID >> 16) & (0xFF)) <<
"."
125 << std::setw(4) << (
areaID & 0xFFFF) <<
"."
126 << std::setw(4) << ((
systemID >> 32) & 0xFFFF) <<
"."
127 << std::setw(4) << ((
systemID >> 16) & 0xFFFF) <<
"."
128 << std::setw(4) << (
systemID & 0xFFFF) <<
"."
129 << std::setw(2) << (
nsel & 0xFF);
Referenced by inet::operator<<(), and inet::L3Address::str().
◆ areaID
| uint64_t inet::ClnsAddress::areaID |
|
private |
◆ nsel
| uint8_t inet::ClnsAddress::nsel |
|
private |
◆ systemID
| uint64_t inet::ClnsAddress::systemID |
|
private |
◆ UNSPECIFIED_ADDRESS
| const ClnsAddress inet::ClnsAddress::UNSPECIFIED_ADDRESS |
|
static |
The documentation for this class was generated from the following files: