SNMP++
3.3.11
|
#include <address.h>
Public Member Functions | |
UdpAddress () | |
Construct an empty invalid UDP address. More... | |
UdpAddress (const char *inaddr) | |
Construct an UDP address from a string. More... | |
UdpAddress (const UdpAddress &udpaddr) | |
Construct an UDP address from another UDP address. More... | |
UdpAddress (const GenAddress &genaddr) | |
Construct an UDP address from a GenAddress. More... | |
UdpAddress (const IpAddress &ipaddr) | |
Construct an UDP address from a IP address. More... | |
~UdpAddress () | |
Destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden). More... | |
virtual SnmpSyntax & | operator= (const SnmpSyntax &val) |
Map other SnmpSyntax objects to UdpAddress. More... | |
virtual Address & | operator= (const Address &val) |
Map other Address objects to UdpAddress. More... | |
virtual UdpAddress & | operator= (const UdpAddress &udpaddr) |
Overloaded assignment operator for UdpAddress. More... | |
virtual UdpAddress & | operator= (const IpAddress &ipaddr) |
Overloaded assignment operator for IpAddress. More... | |
SmiUINT32 | get_syntax () const |
Return the syntax. More... | |
virtual int | get_asn1_length () const |
Return the space needed for serialization. More... | |
SnmpSyntax * | clone () const |
Clone this object. More... | |
virtual const char * | get_printable () const |
Get a printable ASCII value of the address. More... | |
virtual | operator const char * () const |
Overloaded operator for streaming output. More... | |
void | set_port (const unsigned short p) |
Set the port number. More... | |
unsigned short | get_port () const |
Get the port number. More... | |
virtual int | get_length () const |
Get the length of the binary address (accessible through operator[]). More... | |
virtual addr_type | get_type () const |
Return the type of the address. More... | |
virtual bool | map_to_ipv6 () |
Map a IPv4 UDP address to a IPv6 UDP address. More... | |
void | clear () |
Reset the object. More... | |
virtual bool | set_scope (const unsigned int scope) |
Set the IPv6 scope. More... | |
virtual SnmpSyntax & | operator= (const SnmpSyntax &val) |
Map other SnmpSyntax objects to IpAddress. More... | |
virtual Address & | operator= (const Address &val) |
Map other Address objects to IpAddress. More... | |
virtual IpAddress & | operator= (const IpAddress &ipaddress) |
Overloaded assignment operator for other IP addresses. More... | |
virtual Address & | operator= (const Address &val)=0 |
Overloaded assignment operator. More... | |
virtual Address & | operator= (const char *str) |
virtual SnmpSyntax & | operator= (const SnmpSyntax &val)=0 |
Overloaded assignment operator. More... | |
Public Member Functions inherited from IpAddress | |
IpAddress () | |
Construct an empty invalid IP address. More... | |
IpAddress (const char *inaddr) | |
Construct an IP address from a string. More... | |
IpAddress (const IpAddress &ipaddr) | |
Construct an IP address from another IP address. More... | |
IpAddress (const GenAddress &genaddr) | |
Construct an IP address from a GenAddress. More... | |
~IpAddress () | |
Destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden). More... | |
const char * | friendly_name (int &status) |
Return the friendly name. More... | |
void | mask (const IpAddress &ipaddr) |
Logically AND the address with the param. More... | |
int | get_match_bits (const IpAddress match_ip) const |
Get the count of matching bits from the left. More... | |
virtual int | get_inet_address_type () const |
Get the InetAddressType value for this address. More... | |
virtual OctetStr * | clone_as_hex () const |
Return clone as binary string. More... | |
virtual version_type | get_ip_version () const |
Return the IP version of the address. More... | |
virtual unsigned int | get_scope () const |
Get the IPv6 scope. More... | |
bool | has_ipv6_scope () const |
virtual Address & | operator= (const Address &val)=0 |
Overloaded assignment operator. More... | |
virtual Address & | operator= (const char *str) |
virtual SnmpSyntax & | operator= (const SnmpSyntax &val)=0 |
Overloaded assignment operator. More... | |
Public Member Functions inherited from Address | |
Address () | |
Default constructor, clears the buffer and sets valid flag to false. More... | |
virtual | ~Address () |
Allow destruction of derived classes. More... | |
virtual bool | valid () const |
Return if the object contains a valid address. More... | |
unsigned char & | operator[] (const int position) |
Access as an array (read and write). More... | |
unsigned char | operator[] (const int position) const |
Access as an array (read only). More... | |
virtual Address & | operator= (const char *str) |
virtual unsigned int | hashFunction () const |
virtual SnmpSyntax & | operator= (const SnmpSyntax &val)=0 |
Overloaded assignment operator. More... | |
Public Member Functions inherited from SnmpSyntax | |
virtual | ~SnmpSyntax () |
Virtual destructor to ensure deletion of derived classes... More... | |
Protected Member Functions | |
virtual bool | parse_address (const char *inaddr) |
virtual void | format_output () const |
Protected Member Functions inherited from IpAddress | |
int | parse_dotted_ipstring (const char *inaddr) |
int | parse_coloned_ipstring (const char *inaddr) |
int | addr_to_friendly () |
Protected Member Functions inherited from Address | |
void | trim_white_space (char *ptr) |
Trim of whitespaces at the start and the end of the string. More... | |
virtual bool | is_gen_address () const |
Is this a GenAddress object. More... | |
Protected Member Functions inherited from SnmpSyntax | |
SnmpSyntax () | |
Protected Attributes | |
SNMP_PP_MUTABLE char | output_buffer [OUTBUFF] |
char | sep |
Protected Attributes inherited from IpAddress | |
SNMP_PP_MUTABLE char | output_buffer [OUTBUFF] |
std::string | iv_friendly_name |
int | iv_friendly_name_status |
version_type | ip_version |
bool | have_ipv6_scope |
Protected Attributes inherited from Address | |
SNMP_PP_MUTABLE bool | addr_changed |
bool | valid_flag |
unsigned char | address_buffer [ADDRBUF] |
Protected Attributes inherited from SnmpSyntax | |
SmiVALUE | smival |
Additional Inherited Members | |
Public Types inherited from Address | |
enum | addr_type { type_ip, type_ipx, type_udp, type_ipxsock, type_mac, type_invalid } |
Type returned by Address::get_type(). More... | |
enum | version_type { version_ipv4, version_ipv6 } |
Type returned by IpAddress::get_ip_version() and UdpAddress::get_ip_version(). More... | |
enum | InetAddressType { e_unknown = 0, e_ipv4 = 1, e_ipv6 = 2, e_ipv4z = 3, e_ipv6z = 4, e_dns = 16 } |
Type returned by Address::get_inet_address_type() More... | |
UdpAddress::UdpAddress | ( | ) |
Construct an empty invalid UDP address.
UdpAddress::UdpAddress | ( | const char * | inaddr | ) |
Construct an UDP address from a string.
The following formats can be used additional to those recognized by IpAdress:
inaddr | - Hostname or IP address |
UdpAddress::UdpAddress | ( | const UdpAddress & | udpaddr | ) |
Construct an UDP address from another UDP address.
udpaddr | - address to copy |
UdpAddress::UdpAddress | ( | const GenAddress & | genaddr | ) |
Construct an UDP address from a GenAddress.
genaddr | - address to copy |
UdpAddress::UdpAddress | ( | const IpAddress & | ipaddr | ) |
Construct an UDP address from a IP address.
The port will be set to 0.
ipaddr | - address to copy |
|
inline |
Destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden).
|
inlinevirtual |
Reset the object.
Reimplemented from IpAddress.
Definition at line 670 of file address.h.
References Address::clear().
|
inlinevirtual |
|
protectedvirtual |
Reimplemented from IpAddress.
|
inlinevirtual |
|
inlinevirtual |
Get the length of the binary address (accessible through operator[]).
Reimplemented from IpAddress.
Definition at line 649 of file address.h.
References UDPIP6LEN_NO_SCOPE, UDPIP6LEN_WITH_SCOPE, and UDPIPLEN.
unsigned short UdpAddress::get_port | ( | ) | const |
Get the port number.
|
inlinevirtual |
|
inlinevirtual |
Return the syntax.
Reimplemented from IpAddress.
Definition at line 602 of file address.h.
References sNMP_SYNTAX_OCTETS.
|
inlinevirtual |
Return the type of the address.
Reimplemented from IpAddress.
|
virtual |
Map a IPv4 UDP address to a IPv6 UDP address.
Reimplemented from IpAddress.
|
inlinevirtual |
virtual SnmpSyntax& IpAddress::operator= |
Map other SnmpSyntax objects to IpAddress.
virtual Address& Address::operator= |
Overloaded assignment operator.
virtual SnmpSyntax& SnmpSyntax::operator= |
Overloaded assignment operator.
virtual IpAddress& IpAddress::operator= |
Overloaded assignment operator for other IP addresses.
|
virtual |
Map other SnmpSyntax objects to UdpAddress.
Reimplemented from IpAddress.
Map other Address objects to UdpAddress.
Reimplemented from IpAddress.
|
virtual |
Overloaded assignment operator for UdpAddress.
|
virtual |
|
protectedvirtual |
Reimplemented from IpAddress.
void UdpAddress::set_port | ( | const unsigned short | p | ) |
Set the port number.
|
virtual |
Set the IPv6 scope.
Reimplemented from IpAddress.
|
protected |