#include <pasn.h>
Inheritance diagram for PASNObject:
Public Types | |
enum | ASNType { Integer, String, ObjectID, Sequence, Choice, IPAddress, Counter, Gauge, TimeTicks, Opaque, NsapAddress, Counter64, UInteger32, Null, Unknown, ASNTypeMax } |
Public Member Functions | |
virtual ASNType | GetType () const |
int | GetChoice () const |
virtual PString | GetTypeAsString () const |
virtual PASNInt | GetInteger () const |
virtual PASNUnsigned | GetUnsigned () const |
virtual PString | GetString () const |
virtual const PASNSequence & | GetSequence () const |
virtual PIPSocket::Address | GetIPAddress () const |
virtual void | PrintOn (ostream &strm) const |
virtual void | Encode (PBYTEArray &buffer) |
virtual WORD | GetEncodedLength () |
virtual PObject * | Clone () const |
Static Public Member Functions | |
static void | EncodeASNLength (PBYTEArray &buffer, WORD length) |
static WORD | GetASNLengthLength (WORD length) |
static BOOL | DecodeASNLength (const PBYTEArray &buffer, PINDEX &ptr, WORD &len) |
static void | EncodeASNSequenceStart (PBYTEArray &buffer, BYTE type, WORD length) |
static WORD | GetASNSequenceStartLength (WORD length) |
static void | EncodeASNHeader (PBYTEArray &buffer, PASNObject::ASNType type, WORD length) |
static WORD | GetASNHeaderLength (WORD length) |
static void | EncodeASNInteger (PBYTEArray &buffer, PASNInt data, PASNObject::ASNType type) |
static void | EncodeASNUnsigned (PBYTEArray &buffer, PASNUnsigned data, PASNObject::ASNType type) |
static WORD | GetASNIntegerLength (PASNInt data) |
static WORD | GetASNUnsignedLength (PASNUnsigned data) |
static BOOL | DecodeASNInteger (const PBYTEArray &buffer, PINDEX &ptr, PASNInt &value, ASNType type=Integer) |
static BOOL | DecodeASNUnsigned (const PBYTEArray &buffer, PINDEX &ptr, PASNUnsigned &value, ASNType type=TimeTicks) |
Protected Member Functions | |
PASNObject () | |
Static Protected Attributes | |
static BYTE | ASNTypeToType [ASNTypeMax] |
This class will never be instantiated directly. See the PASNInteger, PASNSequence, PASNString and PASNObjectID classes for examples of ASN objects that can be created.
Only descendants of this class can be put into the ASNSequence class.
|
Value returned by the GetType() function to indicate the type of an ASN object
|
|
Create an empty ASN object. Used only by descendant constructors |
|
Virtual function used to duplicate objects Reimplemented from PObject. Reimplemented in PASNInteger, PASNString, PASNIPAddress, PASNTimeTicks, PASNCounter, PASNGauge, PASNObjectID, and PASNNull. |
|
|
|
Decode an ASN length in the buffer at the given ptr. The ptr is moved to the byte after the end of the encoded length.
|
|
|
|
Virtual function used to encode the object into ASN format
Reimplemented in PASNInteger, PASNString, PASNIPAddress, PASNTimeTicks, PASNCounter, PASNGauge, PASNObjectID, PASNNull, and PASNSequence. |
|
Encode an ASN object header into the buffer
|
|
|
|
Encode an ASN length value
|
|
Encode a sequence header into the buffer at the specified offset.
|
|
|
|
Return the length of an ASN object header if the object is the specified length
|
|
|
|
Return the length of an encoded ASN length value
|
|
Return the encoded length of a sequence if it has the specified length
|
|
|
|
Return the descriminator for Choice sequences Reimplemented in PASNSequence. |
|
Virtual function used to get the length of object when encoded into ASN format Reimplemented in PASNInteger, PASNString, PASNUnsignedInteger, PASNObjectID, PASNNull, and PASNSequence. |
|
Return the value of the ASN object as a PASNInt. This function will assert if the object is not a descendant of PASNInteger. Reimplemented in PASNInteger. |
|
Return the value of the object as an IPAddress This function will assert if the object is not a descendant of PASNIPAddress. Reimplemented in PASNIPAddress. |
|
Return the value of the object as a PString This function will assert if the object is not a descendant of PASNSequence. Reimplemented in PASNSequence. |
|
Return the value of the object as a PString. This function can be use for all ASN object types Reimplemented in PASNInteger, PASNString, PASNIPAddress, PASNUnsignedInteger, PASNObjectID, and PASNNull. |
|
Return a value of type enum ASNType which indicates the type of the object Reimplemented in PASNInteger, PASNString, PASNIPAddress, PASNTimeTicks, PASNCounter, PASNGauge, PASNObjectID, PASNNull, and PASNSequence. |
|
Return a string giving the type of the object Reimplemented in PASNInteger, PASNString, PASNIPAddress, PASNTimeTicks, PASNCounter, PASNGauge, PASNObjectID, PASNNull, and PASNSequence. |
|
Return the value of the object as a PASNUnsigned This function will assert if the object is not a descendant of PASNTimeTicks or Reimplemented in PASNUnsignedInteger. |
|
Virtual functions used by the PObject::operator<< function to print the value of the object.
Reimplemented from PObject. Reimplemented in PASNInteger, PASNString, PASNUnsignedInteger, PASNObjectID, PASNNull, and PASNSequence. |
|
Table to map enum ASNType values to ASN identifiers |