Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="module-netrc.html" /> | |
13 | <link rel="prev" href="module-uu.html" /> | |
14 | <link rel="parent" href="netdata.html" /> | |
15 | <link rel="next" href="xdr-packer-objects.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>12.17 xdrlib -- Encode and decode XDR data</title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="12.16 uu " | |
25 | href="module-uu.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="12. Internet Data Handling" | |
28 | href="netdata.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="12.17.1 Packer Objects" | |
31 | href="xdr-packer-objects.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="module-uu.html">12.16 uu </A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="netdata.html">12. Internet Data Handling</A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="xdr-packer-objects.html">12.17.1 Packer Objects</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H1><A NAME="SECTION00141700000000000000000"> | |
56 | 12.17 <tt class="module">xdrlib</tt> -- | |
57 | Encode and decode XDR data</A> | |
58 | </H1> | |
59 | ||
60 | <P> | |
61 | <A NAME="module-xdrlib"></A> | |
62 | ||
63 | <P> | |
64 | <a id='l2h-4164' xml:id='l2h-4164'></a> | |
65 | ||
66 | <P> | |
67 | The <tt class="module">xdrlib</tt> module supports the External Data Representation | |
68 | Standard as described in <a class="rfc" id='rfcref-91292' xml:id='rfcref-91292' | |
69 | href="http://www.faqs.org/rfcs/rfc1014.html">RFC 1014</a>, written by Sun Microsystems, | |
70 | Inc. June 1987. It supports most of the data types described in the | |
71 | RFC. | |
72 | ||
73 | <P> | |
74 | The <tt class="module">xdrlib</tt> module defines two classes, one for packing | |
75 | variables into XDR representation, and another for unpacking from XDR | |
76 | representation. There are also two exception classes. | |
77 | ||
78 | <P> | |
79 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
80 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-4162' xml:id='l2h-4162' class="class">Packer</tt></b>(</nobr></td> | |
81 | <td><var></var>)</td></tr></table></dt> | |
82 | <dd> | |
83 | <tt class="class">Packer</tt> is the class for packing data into XDR representation. | |
84 | The <tt class="class">Packer</tt> class is instantiated with no arguments. | |
85 | </dl> | |
86 | ||
87 | <P> | |
88 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
89 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-4163' xml:id='l2h-4163' class="class">Unpacker</tt></b>(</nobr></td> | |
90 | <td><var>data</var>)</td></tr></table></dt> | |
91 | <dd> | |
92 | <code>Unpacker</code> is the complementary class which unpacks XDR data | |
93 | values from a string buffer. The input buffer is given as | |
94 | <var>data</var>. | |
95 | </dl> | |
96 | ||
97 | <P> | |
98 | <div class="seealso"> | |
99 | <p class="heading">See Also:</p> | |
100 | ||
101 | <dl compact="compact" class="seerfc"> | |
102 | <dt><a href="http://www.faqs.org/rfcs/rfc1014.html" | |
103 | title="XDR: External Data Representation Standard" | |
104 | >RFC 1014, <em>XDR: External Data Representation Standard</em></a> | |
105 | <dd>This RFC | |
106 | defined the encoding of data which was XDR at the time | |
107 | this module was originally written. It has | |
108 | apparently been obsoleted by <a class="rfc" id='rfcref-91288' xml:id='rfcref-91288' | |
109 | href="http://www.faqs.org/rfcs/rfc1832.html">RFC 1832</a>. | |
110 | </dl> | |
111 | ||
112 | <P> | |
113 | <dl compact="compact" class="seerfc"> | |
114 | <dt><a href="http://www.faqs.org/rfcs/rfc1832.html" | |
115 | title="XDR: External Data Representation Standard" | |
116 | >RFC 1832, <em>XDR: External Data Representation Standard</em></a> | |
117 | <dd>Newer RFC | |
118 | that provides a revised definition of XDR. | |
119 | </dl> | |
120 | </div> | |
121 | ||
122 | <P> | |
123 | ||
124 | <p><br /></p><hr class='online-navigation' /> | |
125 | <div class='online-navigation'> | |
126 | <!--Table of Child-Links--> | |
127 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> | |
128 | ||
129 | <UL CLASS="ChildLinks"> | |
130 | <LI><A href="xdr-packer-objects.html">12.17.1 Packer Objects</a> | |
131 | <LI><A href="xdr-unpacker-objects.html">12.17.2 Unpacker Objects</a> | |
132 | <LI><A href="xdr-exceptions.html">12.17.3 Exceptions</a> | |
133 | </ul> | |
134 | <!--End of Table of Child-Links--> | |
135 | </div> | |
136 | ||
137 | <DIV CLASS="navigation"> | |
138 | <div class='online-navigation'> | |
139 | <p></p><hr /> | |
140 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
141 | <tr> | |
142 | <td class='online-navigation'><a rel="prev" title="12.16 uu " | |
143 | href="module-uu.html"><img src='../icons/previous.png' | |
144 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
145 | <td class='online-navigation'><a rel="parent" title="12. Internet Data Handling" | |
146 | href="netdata.html"><img src='../icons/up.png' | |
147 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
148 | <td class='online-navigation'><a rel="next" title="12.17.1 Packer Objects" | |
149 | href="xdr-packer-objects.html"><img src='../icons/next.png' | |
150 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
151 | <td align="center" width="100%">Python Library Reference</td> | |
152 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
153 | href="contents.html"><img src='../icons/contents.png' | |
154 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
155 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
156 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
157 | <td class='online-navigation'><a rel="index" title="Index" | |
158 | href="genindex.html"><img src='../icons/index.png' | |
159 | border='0' height='32' alt='Index' width='32' /></A></td> | |
160 | </tr></table> | |
161 | <div class='online-navigation'> | |
162 | <b class="navlabel">Previous:</b> | |
163 | <a class="sectref" rel="prev" href="module-uu.html">12.16 uu </A> | |
164 | <b class="navlabel">Up:</b> | |
165 | <a class="sectref" rel="parent" href="netdata.html">12. Internet Data Handling</A> | |
166 | <b class="navlabel">Next:</b> | |
167 | <a class="sectref" rel="next" href="xdr-packer-objects.html">12.17.1 Packer Objects</A> | |
168 | </div> | |
169 | </div> | |
170 | <hr /> | |
171 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
172 | </DIV> | |
173 | <!--End of Navigation Panel--> | |
174 | <ADDRESS> | |
175 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
176 | </ADDRESS> | |
177 | </BODY> | |
178 | </HTML> |