All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pasn.h
Go to the documentation of this file.
/*
* pasn.h
*
* Abstract Syntax Notation 1 classes for support of SNMP only.
*
* Portable Windows Library
*
* Copyright (c) 1993-2002 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Portable Windows Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Contributor(s): ______________________________________.
*
* $Revision: 21788 $
* $Author: rjongbloed $
* $Date: 2008-12-11 23:42:13 -0600 (Thu, 11 Dec 2008) $
*/
#ifndef PTLIB_PASN_H
#define PTLIB_PASN_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#include <ptlib/sockets.h>
//
// define some types used by the ASN classes
//
typedef PInt32 PASNInt;
typedef DWORD PASNUnsigned;
typedef DWORD PASNOid;
class PASNObject;
class PASNSequence;
PARRAY(PASNObjectArray, PASNObject);
class PASNObject : public PObject
{
PCLASSINFO(PASNObject, PObject)
public:
enum ASNType {
Integer,
String,
ObjectID,
Sequence,
Choice,
IPAddress,
Counter,
Gauge,
TimeTicks,
Opaque,
NsapAddress,
Counter64,
UInteger32,
Null,
Unknown,
ASNTypeMax
};
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 void EncodeASNLength (
PBYTEArray & buffer,
WORD length
);
static WORD GetASNLengthLength (
WORD length
);
static PBoolean 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
);
// Encode an ASN integer value into the specified buffer */
static void EncodeASNUnsigned (
PBYTEArray & buffer,
PASNUnsigned data,
PASNObject::ASNType type
);
// Encode an ASN integer value into the specified buffer */
static WORD GetASNIntegerLength (
PASNInt data
);
// Return the length of an encoded ASN integer with the specified value
static WORD GetASNUnsignedLength (
PASNUnsigned data
);
// Return the length of an encoded ASN integer with the specified value
static PBoolean DecodeASNInteger (
const PBYTEArray & buffer,
PINDEX & ptr,
PASNInt & value,
ASNType type = Integer
);
// Decode an ASN integer value in the specified buffer
static PBoolean DecodeASNUnsigned (
const PBYTEArray & buffer,
PINDEX & ptr,
PASNUnsigned & value,
ASNType type = TimeTicks
);
// Decode an ASN integer value in the specified buffer
protected:
PASNObject();
static BYTE ASNTypeToType[ASNTypeMax];
};
class PASNInteger : public PASNObject
{
PCLASSINFO(PASNInteger, PASNObject)
public:
PASNInteger(PASNInt val);
PASNInteger(const PBYTEArray & buffer, PINDEX & ptr);
void PrintOn(ostream & strm) const;
void Encode(PBYTEArray & buffer);
WORD GetEncodedLength();
PObject * Clone() const;
PASNInt GetInteger() const;
PString GetString () const;
ASNType GetType() const;
PString GetTypeAsString() const;
private:
PASNInt value;
};
class PASNString : public PASNObject
{
PCLASSINFO(PASNString, PASNObject)
public:
PASNString(const PString & str);
PASNString(const BYTE * ptr, int len);
PASNString(const PBYTEArray & buffer, PASNObject::ASNType = String);
PASNString(const PBYTEArray & buffer, PINDEX & ptr, PASNObject::ASNType = String);
void PrintOn(ostream & strm) const;
void Encode(PBYTEArray & buffer)
{ Encode(buffer, String); }
WORD GetEncodedLength();
PObject * Clone() const;
PString GetString() const;
ASNType GetType() const;
PString GetTypeAsString() const;
protected:
PBoolean Decode(const PBYTEArray & buffer, PINDEX & i, PASNObject::ASNType type);
void Encode(PBYTEArray & buffer, PASNObject::ASNType type);
PString value;
WORD valueLen;
};
class PASNIPAddress : public PASNString
{
PCLASSINFO(PASNIPAddress, PASNString)
public:
PASNIPAddress(const PIPSocket::Address & addr)
: PASNString((const BYTE *)addr.GetPointer(), addr.GetSize()) { }
PASNIPAddress(const PString & str);
PASNIPAddress(const PBYTEArray & buffer)
: PASNString(buffer, IPAddress) { }
PASNIPAddress(const PBYTEArray & buffer, PINDEX & ptr)
: PASNString(buffer, ptr, IPAddress) { }
PASNObject::ASNType GetType() const
{ return IPAddress; }
void Encode(PBYTEArray & buffer)
{ PASNString::Encode(buffer, IPAddress); }
PString GetString() const;
PString GetTypeAsString() const;
PObject * Clone() const
{ return PNEW PASNIPAddress(*this); }
PIPSocket::Address GetIPAddress () const;
};
class PASNUnsignedInteger : public PASNObject
{
PCLASSINFO(PASNUnsignedInteger, PASNObject)
public:
PASNUnsignedInteger(PASNUnsigned val)
{ value = val; }
PASNUnsignedInteger(const PBYTEArray & buffer, PINDEX & ptr);
void PrintOn(ostream & strm) const;
WORD GetEncodedLength();
PString GetString () const;
PASNUnsigned GetUnsigned() const;
protected:
PASNUnsignedInteger()
{ value = 0; }
PBoolean Decode(const PBYTEArray & buffer, PINDEX & i, PASNObject::ASNType theType);
void Encode(PBYTEArray & buffer, PASNObject::ASNType theType);
private:
PASNUnsigned value;
};
class PASNTimeTicks : public PASNUnsignedInteger
{
PCLASSINFO(PASNTimeTicks, PASNUnsignedInteger)
public:
PASNTimeTicks(PASNUnsigned val)
: PASNUnsignedInteger(val) { }
PASNTimeTicks(const PBYTEArray & buffer, PINDEX & ptr)
{ PASNUnsignedInteger::Decode(buffer, ptr, TimeTicks); }
void Encode(PBYTEArray & buffer)
{ PASNUnsignedInteger::Encode(buffer, TimeTicks); }
PObject * Clone() const
{ return PNEW PASNTimeTicks(*this); }
PASNObject::ASNType GetType() const
{ return TimeTicks; }
PString GetTypeAsString() const;
};
class PASNCounter : public PASNUnsignedInteger
{
PCLASSINFO(PASNCounter, PASNUnsignedInteger)
public:
PASNCounter(PASNUnsigned val)
: PASNUnsignedInteger(val) { }
PASNCounter(const PBYTEArray & buffer, PINDEX & ptr)
{ PASNUnsignedInteger::Decode(buffer, ptr, Counter); }
void Encode(PBYTEArray & buffer)
{ PASNUnsignedInteger::Encode(buffer, Counter); }
PObject * Clone() const
{ return PNEW PASNCounter(*this); }
PASNObject::ASNType GetType() const
{ return Counter; }
PString GetTypeAsString() const;
};
class PASNGauge : public PASNUnsignedInteger
{
PCLASSINFO(PASNGauge, PASNUnsignedInteger)
public:
PASNGauge(PASNUnsigned val)
: PASNUnsignedInteger(val) { }
PASNGauge(const PBYTEArray & buffer, PINDEX & ptr)
{ Decode(buffer, ptr); }
PBoolean Decode(const PBYTEArray & buffer, PINDEX & i)
{ return PASNUnsignedInteger::Decode(buffer, i, Gauge); }
void Encode(PBYTEArray & buffer)
{ PASNUnsignedInteger::Encode(buffer, Gauge); }
PObject * Clone() const
{ return PNEW PASNGauge(*this); }
PASNObject::ASNType GetType() const
{ return Gauge; }
PString GetTypeAsString() const;
};
class PASNObjectID : public PASNObject
{
PCLASSINFO(PASNObjectID, PASNObject)
public:
PASNObjectID(const PString & str);
PASNObjectID(PASNOid * val, BYTE theLen);
PASNObjectID(const PBYTEArray & buffer);
PASNObjectID(const PBYTEArray & buffer, PINDEX & ptr);
void PrintOn(ostream & strm) const;
void Encode(PBYTEArray & buffer);
WORD GetEncodedLength();
PObject * Clone() const;
ASNType GetType() const;
PString GetString () const;
PString GetTypeAsString() const;
protected:
PBoolean Decode(const PBYTEArray & buffer, PINDEX & i);
private:
PDWORDArray value;
};
class PASNNull : public PASNObject
{
PCLASSINFO(PASNNull, PASNObject)
public:
PASNNull();
PASNNull(const PBYTEArray & buffer, PINDEX & ptr);
void PrintOn(ostream & strm) const;
void Encode(PBYTEArray & buffer);
WORD GetEncodedLength();
PObject * Clone() const;
ASNType GetType() const;
PString GetString () const;
PString GetTypeAsString() const;
};
class PASNSequence : public PASNObject
{
PCLASSINFO(PASNSequence, PASNObject)
public:
PASNSequence();
PASNSequence(BYTE selector);
PASNSequence(const PBYTEArray & buffer);
PASNSequence(const PBYTEArray & buffer, PINDEX & i);
void Append(PASNObject * obj);
PINDEX GetSize() const;
PASNObject & operator [] (PINDEX idx) const;
const PASNSequence & GetSequence() const;
void AppendInteger (PASNInt value);
void AppendString (const PString & str);
void AppendObjectID(const PString & str);
void AppendObjectID(PASNOid * val, BYTE len);
int GetChoice() const;
// PASNInt GetInteger (PINDEX idx) const;
// PString GetString (PINDEX idx) const;
void PrintOn(ostream & strm) const;
void Encode(PBYTEArray & buffer);
PBoolean Decode(const PBYTEArray & buffer, PINDEX & i);
WORD GetEncodedLength();
ASNType GetType() const;
PString GetTypeAsString() const;
PBoolean Encode(PBYTEArray & buffer, PINDEX maxLen) ;
private:
PASNObjectArray sequence;
BYTE type;
ASNType asnType;
WORD encodedLen;
WORD seqLen;
};
#endif // PTLIB_PASN_H
// End Of File ///////////////////////////////////////////////////////////////
PASNTimeTicks::Clone
PObject * Clone() const
Virtual function used to duplicate objects.
Definition: pasn.h:394
PASNIPAddress::GetString
PString GetString() const
Return the value of the object as a PString.
PASNInteger::PrintOn
void PrintOn(ostream &strm) const
Virtual functions used by the PObject::operator<< function to print the value of the object...
PASNUnsignedInteger::GetString
PString GetString() const
Return the value of the object as a PString.
PASNUnsignedInteger
A descendant of PASNObject which is an unsigned ASN integer type.
Definition: pasn.h:351
PASNString::Clone
PObject * Clone() const
Virtual function used to duplicate objects.
PASNObjectID::GetString
PString GetString() const
Return the value of the object as a PString.
PASNInteger::PASNInteger
PASNInteger(PASNInt val)
PASNIPAddress::PASNIPAddress
PASNIPAddress(const PBYTEArray &buffer, PINDEX &ptr)
Definition: pasn.h:327
PASNTimeTicks::PASNTimeTicks
PASNTimeTicks(const PBYTEArray &buffer, PINDEX &ptr)
Definition: pasn.h:388
PASNObject::DecodeASNUnsigned
static PBoolean DecodeASNUnsigned(const PBYTEArray &buffer, PINDEX &ptr, PASNUnsigned &value, ASNType type=TimeTicks)
PASNString
A descendant of PASNObject which is a simple ASN OctetStr type.
Definition: pasn.h:281
PASNNull::GetTypeAsString
PString GetTypeAsString() const
Return a string giving the type of the object.
PASNObjectID::Decode
PBoolean Decode(const PBYTEArray &buffer, PINDEX &i)
PASNSequence::GetEncodedLength
WORD GetEncodedLength()
Virtual function used to get the length of object when encoded into ASN format.
PASNNull::Clone
PObject * Clone() const
Virtual function used to duplicate objects.
PCLASSINFO
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PASNIPAddress::Encode
void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
Definition: pasn.h:333
PASNGauge::GetType
PASNObject::ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
Definition: pasn.h:454
PASNObjectID::Encode
void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
PASNObject::GetTypeAsString
virtual PString GetTypeAsString() const
Return a string giving the type of the object.
PASNUnsignedInteger::GetEncodedLength
WORD GetEncodedLength()
Virtual function used to get the length of object when encoded into ASN format.
PASNCounter::GetTypeAsString
PString GetTypeAsString() const
Return a string giving the type of the object.
PASNNull::Encode
void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
PASNObject::ASNType
ASNType
Value returned by the GetType() function to indicate the type of an ASN object.
Definition: pasn.h:72
PASNObject::Counter64
ASN Counter64.
Definition: pasn.h:84
PASNString::GetTypeAsString
PString GetTypeAsString() const
Return a string giving the type of the object.
PASNObject::String
ASN Octet String object.
Definition: pasn.h:74
PASNIPAddress::PASNIPAddress
PASNIPAddress(const PBYTEArray &buffer)
Definition: pasn.h:324
PASNUnsignedInteger::Encode
void Encode(PBYTEArray &buffer, PASNObject::ASNType theType)
PASNObject::GetIPAddress
virtual PIPSocket::Address GetIPAddress() const
Return the value of the object as an IPAddress.
PASNObjectID::Clone
PObject * Clone() const
Virtual function used to duplicate objects.
PASNObject::Choice
ASN Sequence with discriminator.
Definition: pasn.h:77
PASNSequence::GetType
ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
PASNCounter::PASNCounter
PASNCounter(PASNUnsigned val)
Definition: pasn.h:412
PASNObjectID::GetEncodedLength
WORD GetEncodedLength()
Virtual function used to get the length of object when encoded into ASN format.
PASNGauge::GetTypeAsString
PString GetTypeAsString() const
Return a string giving the type of the object.
PASNInteger::GetInteger
PASNInt GetInteger() const
Return the value of the ASN object as a PASNInt.
PASNObject::Gauge
ASN Gauge object.
Definition: pasn.h:80
PASNObject::IPAddress
ASN IPAddress object.
Definition: pasn.h:78
PASNObjectID::GetTypeAsString
PString GetTypeAsString() const
Return a string giving the type of the object.
PASNGauge::PASNGauge
PASNGauge(PASNUnsigned val)
Definition: pasn.h:439
PASNObject::GetInteger
virtual PASNInt GetInteger() const
Return the value of the ASN object as a PASNInt.
PASNString::GetEncodedLength
WORD GetEncodedLength()
Virtual function used to get the length of object when encoded into ASN format.
PASNTimeTicks::GetTypeAsString
PString GetTypeAsString() const
Return a string giving the type of the object.
PASNTimeTicks::PASNTimeTicks
PASNTimeTicks(PASNUnsigned val)
Definition: pasn.h:385
PASNUnsignedInteger::GetUnsigned
PASNUnsigned GetUnsigned() const
Return the value of the object as a PASNUnsigned.
PASNObject::GetASNSequenceStartLength
static WORD GetASNSequenceStartLength(WORD length)
Return the encoded length of a sequence if it has the specified length.
PASNObject::ObjectID
ASN Object ID object.
Definition: pasn.h:75
PDWORDArray
Array of unsigned long integers.
Definition: array.h:764
PASNCounter::PASNCounter
PASNCounter(const PBYTEArray &buffer, PINDEX &ptr)
Definition: pasn.h:415
PASNSequence::AppendInteger
void AppendInteger(PASNInt value)
PASNInt
PInt32 PASNInt
Definition: pasn.h:43
PASNSequence::GetSequence
const PASNSequence & GetSequence() const
Return the value of the object as a PString.
PASNObject
This class defines the common behviour of all ASN objects.
Definition: pasn.h:64
PASNObject::GetString
virtual PString GetString() const
Return the value of the object as a PString.
PASNNull::GetString
PString GetString() const
Return the value of the object as a PString.
PASNObject::Opaque
ASN Opaque object.
Definition: pasn.h:82
PBoolean
BOOL PBoolean
Definition: object.h:102
PASNGauge::Clone
PObject * Clone() const
Virtual function used to duplicate objects.
Definition: pasn.h:451
PASNObject::ASNTypeMax
maximum of number of ASN object types
Definition: pasn.h:88
PASNTimeTicks::Encode
void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
Definition: pasn.h:391
PASNSequence::Decode
PBoolean Decode(const PBYTEArray &buffer, PINDEX &i)
PBYTEArray
Array of unsigned characters.
Definition: array.h:670
PASNObjectID
A descendant of PASNObject which is an unsigned ASN ObjID type.
Definition: pasn.h:466
PASNObject::Counter
ASN Counter object.
Definition: pasn.h:79
PASNString::GetType
ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
PASNObjectID::PrintOn
void PrintOn(ostream &strm) const
Virtual functions used by the PObject::operator<< function to print the value of the object...
PASNNull::PASNNull
PASNNull()
PASNSequence::PrintOn
void PrintOn(ostream &strm) const
Virtual functions used by the PObject::operator<< function to print the value of the object...
PASNInteger::GetEncodedLength
WORD GetEncodedLength()
Virtual function used to get the length of object when encoded into ASN format.
PASNObject::GetASNIntegerLength
static WORD GetASNIntegerLength(PASNInt data)
PASNString::value
PString value
Definition: pasn.h:306
PASNObject::EncodeASNSequenceStart
static void EncodeASNSequenceStart(PBYTEArray &buffer, BYTE type, WORD length)
Encode a sequence header into the buffer at the specified offset.
PASNObject::EncodeASNInteger
static void EncodeASNInteger(PBYTEArray &buffer, PASNInt data, PASNObject::ASNType type)
PASNInteger
A descendant of PASNObject which is a simple ASN integer type.
Definition: pasn.h:255
PASNObject::ASNTypeToType
static BYTE ASNTypeToType[ASNTypeMax]
Table to map enum ASNType values to ASN identifiers.
Definition: pasn.h:246
PASNInteger::GetString
PString GetString() const
Return the value of the object as a PString.
PASNInteger::Clone
PObject * Clone() const
Virtual function used to duplicate objects.
PASNNull::PrintOn
void PrintOn(ostream &strm) const
Virtual functions used by the PObject::operator<< function to print the value of the object...
PASNObject::GetSequence
virtual const PASNSequence & GetSequence() const
Return the value of the object as a PString.
PASNObject::GetEncodedLength
virtual WORD GetEncodedLength()
Virtual function used to get the length of object when encoded into ASN format.
PASNCounter::Clone
PObject * Clone() const
Virtual function used to duplicate objects.
Definition: pasn.h:421
PASNNull::GetType
ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
PASNGauge
A descendant of PASNObject which is an unsigned ASN guage type.
Definition: pasn.h:435
PASNIPAddress::GetIPAddress
PIPSocket::Address GetIPAddress() const
Return the value of the object as an IPAddress.
PASNIPAddress::GetTypeAsString
PString GetTypeAsString() const
Return a string giving the type of the object.
PASNObject::Encode
virtual void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
PASNObjectID::PASNObjectID
PASNObjectID(const PString &str)
PASNTimeTicks
A descendant of PASNObject which is an unsigned ASN time tick type.
Definition: pasn.h:381
PASNObject::GetUnsigned
virtual PASNUnsigned GetUnsigned() const
Return the value of the object as a PASNUnsigned.
PASNObject::Null
ASN Null.
Definition: pasn.h:86
PString
The character string class.
Definition: pstring.h:108
PASNSequence::GetSize
PINDEX GetSize() const
PASNCounter
A descendant of PASNObject which is an unsigned ASN counter type.
Definition: pasn.h:408
PASNObject::EncodeASNLength
static void EncodeASNLength(PBYTEArray &buffer, WORD length)
Encode an ASN length value.
PASNString::valueLen
WORD valueLen
Definition: pasn.h:307
PASNObject::DecodeASNInteger
static PBoolean DecodeASNInteger(const PBYTEArray &buffer, PINDEX &ptr, PASNInt &value, ASNType type=Integer)
PASNCounter::Encode
void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
Definition: pasn.h:418
PASNObjectID::GetType
ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
PASNTimeTicks::GetType
PASNObject::ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
Definition: pasn.h:397
PASNCounter::GetType
PASNObject::ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
Definition: pasn.h:424
PASNString::PrintOn
void PrintOn(ostream &strm) const
Virtual functions used by the PObject::operator<< function to print the value of the object...
PASNString::PASNString
PASNString(const PString &str)
PASNUnsignedInteger::Decode
PBoolean Decode(const PBYTEArray &buffer, PINDEX &i, PASNObject::ASNType theType)
PASNSequence::PASNSequence
PASNSequence()
PASNUnsignedInteger::PASNUnsignedInteger
PASNUnsignedInteger(PASNUnsigned val)
Definition: pasn.h:355
PASNIPAddress::PASNIPAddress
PASNIPAddress(const PIPSocket::Address &addr)
Definition: pasn.h:319
PASNUnsignedInteger::PASNUnsignedInteger
PASNUnsignedInteger()
Definition: pasn.h:366
PASNObject::EncodeASNHeader
static void EncodeASNHeader(PBYTEArray &buffer, PASNObject::ASNType type, WORD length)
Encode an ASN object header into the buffer.
PASNGauge::Encode
void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
Definition: pasn.h:448
PIPSocket::Address
A class describing an IP address.
Definition: ipsock.h:75
PASNOid
DWORD PASNOid
Definition: pasn.h:45
PASNGauge::PASNGauge
PASNGauge(const PBYTEArray &buffer, PINDEX &ptr)
Definition: pasn.h:442
PASNObject::UInteger32
ASN Unsigned integer 32.
Definition: pasn.h:85
PASNSequence::AppendObjectID
void AppendObjectID(const PString &str)
PASNString::GetString
PString GetString() const
Return the value of the object as a PString.
PASNObject::Sequence
ASN Sequence object.
Definition: pasn.h:76
PASNIPAddress::GetType
PASNObject::ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
Definition: pasn.h:330
PASNSequence::GetTypeAsString
PString GetTypeAsString() const
Return a string giving the type of the object.
PASNSequence::Encode
void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
sockets.h
PASNSequence::AppendString
void AppendString(const PString &str)
PASNObject::DecodeASNLength
static PBoolean DecodeASNLength(const PBYTEArray &buffer, PINDEX &ptr, WORD &len)
Decode an ASN length in the buffer at the given ptr.
PASNString::Decode
PBoolean Decode(const PBYTEArray &buffer, PINDEX &i, PASNObject::ASNType type)
PASNObject::GetChoice
int GetChoice() const
Return the descriminator for Choice sequences.
PASNObject::PrintOn
virtual void PrintOn(ostream &strm) const
Virtual functions used by the PObject::operator<< function to print the value of the object...
PASNInteger::Encode
void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
PASNObject::GetASNUnsignedLength
static WORD GetASNUnsignedLength(PASNUnsigned data)
PASNString::Encode
void Encode(PBYTEArray &buffer)
Virtual function used to encode the object into ASN format.
Definition: pasn.h:292
PASNSequence::operator[]
PASNObject & operator[](PINDEX idx) const
PASNSequence::Append
void Append(PASNObject *obj)
PARRAY
PARRAY(PASNObjectArray, PASNObject)
PASNUnsignedInteger::PrintOn
void PrintOn(ostream &strm) const
Virtual functions used by the PObject::operator<< function to print the value of the object...
PASNInteger::GetType
ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
PASNSequence
A descendant of PASNObject which is the complex sequence type.
Definition: pasn.h:520
PASNObject::GetASNLengthLength
static WORD GetASNLengthLength(WORD length)
Return the length of an encoded ASN length value.
PASNGauge::Decode
PBoolean Decode(const PBYTEArray &buffer, PINDEX &i)
Definition: pasn.h:445
PASNObject::GetASNHeaderLength
static WORD GetASNHeaderLength(WORD length)
Return the length of an ASN object header if the object is the specified length.
PASNObject::Integer
ASN Integer object.
Definition: pasn.h:73
PASNObject::Unknown
unknown ASN object type
Definition: pasn.h:87
PObject
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PASNNull::GetEncodedLength
WORD GetEncodedLength()
Virtual function used to get the length of object when encoded into ASN format.
PASNObject::EncodeASNUnsigned
static void EncodeASNUnsigned(PBYTEArray &buffer, PASNUnsigned data, PASNObject::ASNType type)
PASNObject::Clone
virtual PObject * Clone() const
Virtual function used to duplicate objects.
PASNObject::GetType
virtual ASNType GetType() const
Return a value of type enum ASNType which indicates the type of the object.
PASNUnsigned
DWORD PASNUnsigned
Definition: pasn.h:44
PASNObject::NsapAddress
ASN NsapAddress.
Definition: pasn.h:83
PNEW
#define PNEW
Macro for overriding system default new operator.
Definition: object.h:890
PASNIPAddress::Clone
PObject * Clone() const
Virtual function used to duplicate objects.
Definition: pasn.h:340
PASNNull
A descendant of PASNObject which is the NULL type.
Definition: pasn.h:496
PASNObject::PASNObject
PASNObject()
Create an empty ASN object.
PASNIPAddress
A descendant of PASNObject which is an IP address type.
Definition: pasn.h:315
PASNObject::TimeTicks
ASN TimeTicks object.
Definition: pasn.h:81
PASNSequence::GetChoice
int GetChoice() const
PASNInteger::GetTypeAsString
PString GetTypeAsString() const
Return a string giving the type of the object.