#include <octet.h>
Inheritance diagram for OctetStr:
Public Types | |
| enum | OutputType { OutputHexAndClear, OutputHex, OutputClear } |
| Enum for setting the hex output format. More... | |
Public Member Functions | |
| OctetStr () | |
| Constructs a valid OctetStr with zero length. | |
| OctetStr (const char *str) | |
| Constructs a OctetStr with the given value. | |
| OctetStr (const unsigned char *str, unsigned long len) | |
| Constructs a OctetStr with the given value. | |
| OctetStr (const OctetStr &octet) | |
| Construct a OctetStr from another OctetStr. | |
| ~OctetStr () | |
| Destructor, frees allocated space. | |
| OctetStr & | operator= (const char *str) |
| Assign a char string to a OctetStr. | |
| OctetStr & | operator= (const OctetStr &octet) |
| Assign a OctetStr to a OctetStr. | |
| OctetStr & | operator+= (const char *a) |
| Append a char string to this OctetStr. | |
| OctetStr & | operator+= (const unsigned char c) |
| Append a single char to this OctetStr. | |
| OctetStr & | operator+= (const OctetStr &octet) |
| Append another OctetStr to this OctetStr. | |
| unsigned char & | operator[] (int i) |
| Allow access as if it was an array. | |
| unsigned char | operator[] (int i) const |
| Allow access as if it was an array for const OctetStr objects. | |
| SmiUINT32 | get_syntax () const |
| Return the syntax. | |
| int | get_asn1_length () const |
| Return the space needed for serialization. | |
| bool | valid () const |
| Return validity of the object. | |
| SnmpSyntax * | clone () const |
| Clone this object. | |
| SnmpSyntax & | operator= (const SnmpSyntax &val) |
| Map other SnmpSyntax objects to OctetStr. | |
| const char * | get_printable () const |
| Get a printable ASCII value of the string. | |
| const char * | get_printable_hex () const |
| Get an ASCII formatted hex dump of the contents. | |
| const char * | get_printable_clear () const |
| Get the contents with all non printable characters replaced. | |
| void | set_data (const unsigned char *str, unsigned long len) |
| Set the data on an already constructed OctetStr. | |
| unsigned long | len () const |
| Get the length of the string. | |
| unsigned char * | data () const |
| Get a pointer to internal data. | |
| int | nCompare (const unsigned long n, const OctetStr &o) const |
| void | clear () |
| Null out the contents of the string. | |
Static Public Member Functions | |
| void | set_hex_output_type (const enum OutputType ot) |
| Set the output format for get_pritable_hex(). | |
| void | set_hex_np_char (const char np) |
| Set the char get_printable_hex() will use for non printable characters. | |
| OctetStr | from_hex_string (const OctetStr &hex_string) |
| Build an OctetStr from a hex string. | |
Protected Attributes | |
| char * | output_buffer |
| unsigned int | output_buffer_len |
| bool | validity |
Static Protected Attributes | |
| enum OutputType | hex_output_type |
| char | hex_nonprintable_char |
Friends | |
| DLLOPT friend int | operator== (const OctetStr &lhs, const OctetStr &rhs) |
| Equal operator for two OctetStr. | |
| DLLOPT friend int | operator!= (const OctetStr &lhs, const OctetStr &rhs) |
| Not equal operator for two OctetStr. | |
| DLLOPT friend int | operator< (const OctetStr &lhs, const OctetStr &rhs) |
| Not equal operator for two OctetStr. | |
| DLLOPT friend int | operator<= (const OctetStr &lhs, const OctetStr &rhs) |
| Less than operator for two OctetStr. | |
| DLLOPT friend int | operator> (const OctetStr &lhs, const OctetStr &rhs) |
| Greater than operator for two OctetStr. | |
| DLLOPT friend int | operator>= (const OctetStr &lhs, const OctetStr &rhs) |
| Greater than or equal operator for two OctetStr. | |
| DLLOPT friend int | operator== (const OctetStr &lhs, const char *rhs) |
| Equal operator for OctetStr and char string. | |
| DLLOPT friend int | operator!= (const OctetStr &lhs, const char *rhs) |
| Not equal operator for OctetStr and char string. | |
| DLLOPT friend int | operator< (const OctetStr &lhs, const char *rhs) |
| Less than operator for OctetStr and char string. | |
| DLLOPT friend int | operator<= (const OctetStr &lhs, const char *rhs) |
| Less than or equal operator for OctetStr and char string. | |
| DLLOPT friend int | operator> (const OctetStr &lhs, const char *rhs) |
| Greater than operator for OctetStr and char string. | |
| DLLOPT friend int | operator>= (const OctetStr &lhs, const char *rhs) |
| Greater than or equal operator for OctetStr and char string. | |
|
|
Enum for setting the hex output format.
|
|
|
Constructs a valid OctetStr with zero length.
|
|
|
Constructs a OctetStr with the given value. The OctetStr will be valid unless a call to new fails.
|
|
||||||||||||
|
Constructs a OctetStr with the given value. The OctetStr will be valid unless a call to new fails.
|
|
|
Construct a OctetStr from another OctetStr. The OctetStr will be valid unless a call to new fails.
|
|
|
Destructor, frees allocated space.
|
|
|
Null out the contents of the string. The string will be empty after calling this method Implements SnmpSyntax. |
|
|
Clone this object.
Implements SnmpSyntax. Reimplemented in OpaqueStr. |
|
|
Get a pointer to internal data.
|
|
|
Build an OctetStr from a hex string. Called with "5465 737469 6e672074686973206D657468 6f 64 21" the returned value will be "Testing this method!"
|
|
|
Return the space needed for serialization.
Implements SnmpSyntax. |
|
|
Get a printable ASCII value of the string.
Implements SnmpSyntax. Referenced by CTarget::get_writecommunity(). |
|
|
Get the contents with all non printable characters replaced.
|
|
|
Get an ASCII formatted hex dump of the contents. If the output format was set to OctetStr::OutputHexAndClear, the produced string of this method will look like this:
|
|
|
Return the syntax.
Implements SnmpSyntax. Reimplemented in OpaqueStr. Definition at line 235 of file octet.h. References SmiUINT32, and sNMP_SYNTAX_OCTETS. |
|
|
Get the length of the string.
|
|
||||||||||||
|
|
|
|
Append another OctetStr to this OctetStr.
|
|
|
Append a single char to this OctetStr.
|
|
|
Append a char string to this OctetStr.
|
|
|
Map other SnmpSyntax objects to OctetStr.
Reimplemented from SnmpSyntax. Reimplemented in OpaqueStr. |
|
|
Assign a OctetStr to a OctetStr.
|
|
|
Assign a char string to a OctetStr.
Referenced by OpaqueStr::operator=(). |
|
|
Allow access as if it was an array for const OctetStr objects.
|
|
|
Allow access as if it was an array.
|
|
||||||||||||
|
Set the data on an already constructed OctetStr. The given string is copied to an internal member var, so the params can be destroyed afterwards.
|
|
|
Set the char get_printable_hex() will use for non printable characters.
|
|
|
Set the output format for get_pritable_hex().
|
|
|
Return validity of the object.
Implements SnmpSyntax. Definition at line 245 of file octet.h. Referenced by Pdu::get_context_engine_id(), Pdu::get_context_name(), Pdu::set_context_engine_id(), and Pdu::set_context_name(). |
|
||||||||||||
|
Not equal operator for OctetStr and char string.
|
|
||||||||||||
|
Not equal operator for two OctetStr.
|
|
||||||||||||
|
Less than operator for OctetStr and char string.
|
|
||||||||||||
|
Not equal operator for two OctetStr.
|
|
||||||||||||
|
Less than or equal operator for OctetStr and char string.
|
|
||||||||||||
|
Less than operator for two OctetStr.
|
|
||||||||||||
|
Equal operator for OctetStr and char string.
|
|
||||||||||||
|
Equal operator for two OctetStr.
|
|
||||||||||||
|
Greater than operator for OctetStr and char string.
|
|
||||||||||||
|
Greater than operator for two OctetStr.
|
|
||||||||||||
|
Greater than or equal operator for OctetStr and char string.
|
|
||||||||||||
|
Greater than or equal operator for two OctetStr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.2