SNMP++
3.3.11
|
Base class of all Address classes. More...
#include <address.h>
Public Types | |
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... | |
Public Member Functions | |
Address () | |
Default constructor, clears the buffer and sets valid flag to false. More... | |
virtual | ~Address () |
Allow destruction of derived classes. More... | |
virtual | operator const char * () const =0 |
Overloaded operator for streaming output. More... | |
virtual bool | valid () const |
Return if the object contains a valid address. More... | |
virtual int | get_asn1_length () const =0 |
Return the space needed for serialization. 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 int | get_length () const =0 |
Get the length of the binary address (accessible through operator[]). More... | |
virtual addr_type | get_type () const =0 |
Get the type of the address. More... | |
virtual Address & | operator= (const Address &val)=0 |
Overloaded assignment operator. 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 const char * | get_printable () const =0 |
Virtual function for getting a printable ASCII value for any SNMP value. More... | |
virtual SmiUINT32 | get_syntax () const =0 |
Return the current syntax. More... | |
virtual SnmpSyntax * | clone () const =0 |
Virtual clone operation for creating a new Value from an existing value. More... | |
virtual | ~SnmpSyntax () |
Virtual destructor to ensure deletion of derived classes... More... | |
virtual SnmpSyntax & | operator= (const SnmpSyntax &val)=0 |
Overloaded assignment operator. More... | |
Protected Member Functions | |
virtual bool | parse_address (const char *inaddr)=0 |
virtual void | format_output () const =0 |
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... | |
void | clear () |
Reset the object. More... | |
Protected Member Functions inherited from SnmpSyntax | |
SnmpSyntax () | |
Protected Attributes | |
SNMP_PP_MUTABLE bool | addr_changed |
bool | valid_flag |
unsigned char | address_buffer [ADDRBUF] |
Protected Attributes inherited from SnmpSyntax | |
SmiVALUE | smival |
Friends | |
class | GenAddress |
DLLOPT friend int | operator== (const Address &lhs, const Address &rhs) |
overloaded equivlence operator, are two addresses equal? More... | |
DLLOPT friend int | operator!= (const Address &lhs, const Address &rhs) |
overloaded not equivlence operator, are two addresses not equal? More... | |
DLLOPT friend int | operator> (const Address &lhs, const Address &rhs) |
overloaded > operator, is a1 > a2 More... | |
DLLOPT friend int | operator>= (const Address &lhs, const Address &rhs) |
overloaded >= operator, is a1 >= a2 More... | |
DLLOPT friend int | operator< (const Address &lhs, const Address &rhs) |
overloaded < operator, is a1 < a2 More... | |
DLLOPT friend int | operator<= (const Address &lhs, const Address &rhs) |
overloaded <= operator, is a1 <= a2 More... | |
DLLOPT friend int | operator== (const Address &lhs, const char *rhs) |
equivlence operator overloaded, are an address and a string equal? More... | |
DLLOPT friend int | operator!= (const Address &lhs, const char *rhs) |
overloaded not equivlence operator, are an address and string not equal? More... | |
DLLOPT friend int | operator> (const Address &lhs, const char *rhs) |
overloaded < , is an address greater than a string? More... | |
DLLOPT friend int | operator>= (const Address &lhs, const char *rhs) |
overloaded >=, is an address greater than or equal to a string? More... | |
DLLOPT friend int | operator< (const Address &lhs, const char *rhs) |
overloaded < , is an address less than a string? More... | |
DLLOPT friend int | operator<= (const Address &lhs, const char *rhs) |
overloaded <=, is an address less than or equal to a string? More... | |
enum Address::addr_type |
Type returned by Address::get_type().
Enumerator | |
---|---|
type_ip | IpAddress (IPv4 or IPv6) |
type_ipx | IpxAddress. |
type_udp | UdpAddress (IPv4 or IPv6) |
type_ipxsock | IpxSockAddress. |
type_mac | MacAddress. |
type_invalid | Used by GenAddress::get_type() if address is not valid. |
Type returned by IpAddress::get_ip_version() and UdpAddress::get_ip_version().
Enumerator | |
---|---|
version_ipv4 | IPv4. |
version_ipv6 | IPv6. |
Address::Address | ( | ) |
Default constructor, clears the buffer and sets valid flag to false.
|
inlinevirtual |
|
protectedvirtual |
Reset the object.
Implements SnmpSyntax.
Reimplemented in GenAddress, UdpAddress, and IpAddress.
Referenced by UdpAddress::clear().
|
protectedpure virtual |
Implemented in GenAddress, UdpAddress, and IpAddress.
|
pure virtual |
Return the space needed for serialization.
Implements SnmpSyntax.
Implemented in GenAddress, UdpAddress, and IpAddress.
|
pure virtual |
Get the length of the binary address (accessible through operator[]).
Implemented in GenAddress, UdpAddress, and IpAddress.
|
pure virtual |
Get the type of the address.
Implemented in GenAddress, UdpAddress, and IpAddress.
|
inlinevirtual |
|
inlineprotectedvirtual |
|
pure virtual |
Overloaded operator for streaming output.
Implemented in GenAddress, UdpAddress, and IpAddress.
virtual SnmpSyntax& SnmpSyntax::operator= |
Overloaded assignment operator.
Overloaded assignment operator.
Implemented in GenAddress, UdpAddress, and IpAddress.
|
inlinevirtual |
Definition at line 275 of file address.h.
References addr_changed, GenAddress::parse_address(), and valid_flag.
|
inline |
Access as an array (read and write).
position | - pos to return |
Definition at line 243 of file address.h.
References addr_changed, ADDRBUF, address_buffer, and valid_flag.
|
inline |
Access as an array (read only).
position | - pos to return |
Definition at line 255 of file address.h.
References ADDRBUF, and address_buffer.
|
protectedpure virtual |
Implemented in GenAddress, UdpAddress, and IpAddress.
|
protected |
Trim of whitespaces at the start and the end of the string.
ptr | - string to trim |
|
inlinevirtual |
Return if the object contains a valid address.
Implements SnmpSyntax.
Definition at line 229 of file address.h.
References valid_flag.
|
friend |
overloaded < operator, is a1 < a2
overloaded < , is an address less than a string?
overloaded <=, is an address less than or equal to a string?
overloaded equivlence operator, are two addresses equal?
equivlence operator overloaded, are an address and a string equal?
overloaded > operator, is a1 > a2
overloaded < , is an address greater than a string?
overloaded >=, is an address greater than or equal to a string?
|
protected |
Definition at line 281 of file address.h.
Referenced by operator=(), and operator[]().
|
protected |
Definition at line 283 of file address.h.
Referenced by operator[]().
|
protected |
Definition at line 282 of file address.h.
Referenced by operator=(), operator[](), and valid().