1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
<HTML>
<HEAD>
<TITLE>PySNMP: SNMP message: ASN.1: Object-ID: Objects</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff" TEXT="#000000"
LINK="#0000bb" VLINK="#551a8b" ALINK="#ff0000">
<H3>
Objects of the <STRONG>asn1.OBJECTID</STRONG> class.
</H3>
<P>
Instances of the <STRONG>asn1.OBJECTID</STRONG> class have the following
methods:
</P>
<DL>
<DT><STRONG>encode</STRONG>([<STRONG>value</STRONG>])</DT>
<P>
The <STRONG>encode</STRONG> method converts the content of the class
instance into BER octet-stream (string).
</P>
<P>
The <STRONG>value</STRONG> parameter, whenever used for last-minute
assignment, must be an Object ID in symbolic. "dotted" form (for example
'.1.3.6.1.2.1.1.1.0').
</P>
<DT><STRONG>decode</STRONG>(<STRONG>data</STRONG>)</DT>
<P>
The <STRONG>decode</STRONG> method attempts to convert the
<STRONG>data</STRONG> octet-stream (string) into an Object-ID, and
returns a tuple of (<STRONG>objectid_class_instance</STRONG>,
<STRONG>rest</STRONG>).
</P>
<P>
Any unprocessed part of <STRONG>data</STRONG> octet-stream is returned
in the <STRONG>rest</STRONG> string.
</P>
<P>
The <STRONG>data</STRONG> octet-stream must carry an ASN.1 Object ID value
or an <A HREF=errors.html">exception</A> would be thrown.
</P>
<DT><STRONG>update</STRONG>(<STRONG>value</STRONG>)</DT>
<P>
The <STRONG>update</STRONG> method assigns the <STRONG>value</STRONG>,
given in dotted notation, to class instance payload.
</P>
<DT><STRONG>isaprefix</STRONG>(<STRONG>other</STRONG>)</DT>
<P>
The <STRONG>isaprefix</STRONG> method returns true if the payload
of class instance is a prefix of the <STRONG>other</STRONG> Object ID
(given in dotted notation as string).
</P>
<DT><STRONG>str2num</STRONG>(<STRONG>oid</STRONG>)</DT>
<P>
The <STRONG>str2num</STRONG> method converts an Object ID <STRONG>oid</STRONG>,
given in a dotted form, into a list of integer sub-Object-IDs.
</P>
<DT><STRONG>num2str</STRONG>(<STRONG>oid</STRONG>)</DT>
<P>
The <STRONG>num2str</STRONG> method converts an Object ID <STRONG>oid</STRONG>,
given as a list of integer sub-Object IDs into dotted notation.
</P>
<DT><STRONG>__call__</STRONG>()</DT>
<P>
Class instance invocation would return currently stored payload.
</P>
<DT><STRONG>__cmp__</STRONG>(<STRONG>other</STRONG>)</DT>
<P>
Class instances may be compared against each <STRONG>other</STRONG>. The
comparation would return negative if <STRONG>other</STRONG> is greater, zero
on equivalence, positive if <STRONG>other</STRONG> is less.
</P>
<DT><STRONG>__repr__</STRONG>()</DT>
<P>
Returns the canonical string representation of the class instance.
</P>
<DT><STRONG>__str__</STRONG>()</DT>
<P>
Returns a nice string representation of the class instance.
</P>
</DL>
<HR>
<ADDRESS>
ilya@glas.net
</ADDRESS>
</BODY>
</HTML>
|