ANNA Suite
2020b
Multipurpose development suite for Telco applications
|
#include <Address.hpp>
Public Member Functions | |
Address () | |
virtual | ~Address () |
void | setAbbreviatePresentation (bool abb) |
const iana_address_t & | getIANAAddress () const |
void | setIANAAddress (const iana_address_t &address) noexcept(false) |
std::string | getFormatName () const |
std::string | asPrintableString () noexcept(false) |
std::string | asString () noexcept(false) |
void | decode (const char *buffer, const int size) noexcept(false) |
Diameter Address container
Diameter address includes 2 bytes with ip version and 4/16 more for IPv4 and IPv6 respectively
IPv6 ADDRESS FORMAT CONSIDERATIONS
IPv6 addresses have two logical parts: a 64-bit network prefix, and a 64-bit host address part. The host address is often automatically generated from the interface MAC address. An IPv6 address is represented by 8 groups of 16-bit hexadecimal values separated by colons (:) shown as follows:
A typical example of an IPv6 address is2001:0db8:85a3:0000:0000:8a2e:0370:7334.
The hexadecimal digits are case-insensitive.
The 128-bit IPv6 address can be abbreviated with the following rules:* Rule one: Leading zeroes within a 16-bit value may be omitted. For example, the address fe80:0000:0000:0000:0202:b3ff:fe1e:8329 may be written as fe80:0:0:0:202:b3ff:fe1e:8329 * Rule two: A single occurrence of consecutive groups of zeroes within an address may be replaced by a double colon. For example, fe80:0:0:0:202:b3ff:fe1e:8329 becomes fe80::202:b3ff:fe1e:8329
RULE ONE IS AUTOMATICALLY APPLIED BY sscanf and X parsing RULE TWO IS NOT APPLIED OVER THIS CLASS METHODS
In environments of dual-stack hosts that support both IPv4 and IPv6, an IPv4 address is expressed as an IPv6 address in an IPv6-mapped address. For example, the IPv4-mapped IPv6 address ::ffff:c000:280 is usually written as ::ffff:192.0.2.128, thus expressing clearly the original IPv4 address that was mapped to IPv6. The address ::ffff:1.2.3.4 is IPv4-mapped, different than address ::1.2.3.4 which is IPV4-compatible.
|
inline |
|
virtualnoexcept |
Gets the natural/smart string representation for IANA address Launch exception when data is not printable: only IPv4 and IPv6 are printable-supported
Reimplemented from anna::diameter::codec::basetypes::AvpData.
|
inlinevirtualnoexcept |
Class string representation Default implementation invokes raw DataBlock 'asString' method, but it should be different specially with complex application data types.
Reimplemented from anna::diameter::codec::basetypes::AvpData.
|
virtualnoexcept |
Decodes provided buffer/size
Derived types must invoke base class 'decode()' at the end in order to keep coherence with parent members. This base class decodification actually sets the base class members with the same buffer provided, being more comfortable than using base class setters.
buffer | Raw avp data |
size | Raw avp data length |
Implements anna::diameter::codec::basetypes::AvpData.
|
inlinevirtual |
Gets the avp data format name
Reimplemented from anna::diameter::codec::basetypes::OctetString.
|
inline |
|
inline |
|
inlinenoexcept |