/usr/share/doc/libldap-ocaml-dev/html/api/Lber.html is in libldap-ocaml-dev 2.1.8-10+b3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="next" href="Ldap_dn.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Lber" rel="Chapter" href="Lber.html">
<link title="Ldap_dn" rel="Chapter" href="Ldap_dn.html">
<link title="Ldap_dnparser" rel="Chapter" href="Ldap_dnparser.html">
<link title="Ldap_error" rel="Chapter" href="Ldap_error.html">
<link title="Ldap_filter" rel="Chapter" href="Ldap_filter.html">
<link title="Ldap_filterparser" rel="Chapter" href="Ldap_filterparser.html">
<link title="Ldap_funclient" rel="Chapter" href="Ldap_funclient.html">
<link title="Ldap_funserver" rel="Chapter" href="Ldap_funserver.html">
<link title="Ldap_mutex" rel="Chapter" href="Ldap_mutex.html">
<link title="Ldap_ooclient" rel="Chapter" href="Ldap_ooclient.html">
<link title="Ldap_protocol" rel="Chapter" href="Ldap_protocol.html">
<link title="Ldap_schemaparser" rel="Chapter" href="Ldap_schemaparser.html">
<link title="Ldap_toplevel" rel="Chapter" href="Ldap_toplevel.html">
<link title="Ldap_txooclient" rel="Chapter" href="Ldap_txooclient.html">
<link title="Ldap_types" rel="Chapter" href="Ldap_types.html">
<link title="Ldap_url" rel="Chapter" href="Ldap_url.html">
<link title="Ldap_urlparser" rel="Chapter" href="Ldap_urlparser.html">
<link title="Ldif_changerec_oo" rel="Chapter" href="Ldif_changerec_oo.html">
<link title="Ldif_changerec_parser" rel="Chapter" href="Ldif_changerec_parser.html">
<link title="Ldif_oo" rel="Chapter" href="Ldif_oo.html"><title>Lber</title>
</head>
<body>
<div class="navbar"> <a class="up" href="index.html" title="Index">Up</a>
<a class="post" href="Ldap_dn.html" title="Ldap_dn">Next</a>
</div>
<h1>Module <a href="type_Lber.html">Lber</a></h1>
<pre><span class="keyword">module</span> Lber: <code class="code">sig</code> <a href="Lber.html">..</a> <code class="code">end</code></pre><div class="info module top">
This library implements the subset of ber<br>
</div>
<hr width="100%">
<pre><span id="EXCEPTIONDecoding_error"><span class="keyword">exception</span> Decoding_error</span> <span class="keyword">of</span> <code class="type">string</code></pre>
<pre><span id="EXCEPTIONEncoding_error"><span class="keyword">exception</span> Encoding_error</span> <span class="keyword">of</span> <code class="type">string</code></pre>
<pre><code><span id="TYPEreadbyte_error"><span class="keyword">type</span> <code class="type"></code>readbyte_error</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTreadbyte_error.End_of_stream"><span class="constructor">End_of_stream</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTreadbyte_error.Transport_error"><span class="constructor">Transport_error</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTreadbyte_error.Peek_error"><span class="constructor">Peek_error</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTreadbyte_error.Request_too_large"><span class="constructor">Request_too_large</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTreadbyte_error.Not_implemented"><span class="constructor">Not_implemented</span></span></code></td>
</tr></table>
<pre><span id="EXCEPTIONReadbyte_error"><span class="keyword">exception</span> Readbyte_error</span> <span class="keyword">of</span> <code class="type"><a href="Lber.html#TYPEreadbyte_error">readbyte_error</a></code></pre>
<pre><span id="TYPEreadbyte"><span class="keyword">type</span> <code class="type"></code>readbyte</span> = <code class="type">?peek:bool -> int -> string</code> </pre>
<pre><span id="TYPEwritebyte"><span class="keyword">type</span> <code class="type"></code>writebyte</span> = <code class="type">char -> unit</code> </pre>
<pre><code><span id="TYPEber_class"><span class="keyword">type</span> <code class="type"></code>ber_class</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_class.Universal"><span class="constructor">Universal</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_class.Application"><span class="constructor">Application</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_class.Context_specific"><span class="constructor">Context_specific</span></span></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_class.Private"><span class="constructor">Private</span></span></code></td>
</tr></table>
<pre><code><span id="TYPEber_length"><span class="keyword">type</span> <code class="type"></code>ber_length</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_length.Definite"><span class="constructor">Definite</span></span> <span class="keyword">of</span> <code class="type">int</code></code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_length.Indefinite"><span class="constructor">Indefinite</span></span></code></td>
</tr></table>
<pre><code><span id="TYPEber_val_header"><span class="keyword">type</span> <code class="type"></code>ber_val_header</span> = {</code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_val_header.ber_class">ber_class</span> : <code class="type"><a href="Lber.html#TYPEber_class">ber_class</a></code>;</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_val_header.ber_primitive">ber_primitive</span> : <code class="type">bool</code>;</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_val_header.ber_tag">ber_tag</span> : <code class="type">int</code>;</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code> </code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTber_val_header.ber_length">ber_length</span> : <code class="type"><a href="Lber.html#TYPEber_length">ber_length</a></code>;</code></td>
</tr></table>
}
<pre><span id="VALreadbyte_of_string"><span class="keyword">val</span> readbyte_of_string</span> : <code class="type">string -> <a href="Lber.html#TYPEreadbyte">readbyte</a></code></pre><div class="info ">
return a readbyte function for a string, currently not implemented<br>
</div>
<pre><span id="VALreadbyte_of_ber_element"><span class="keyword">val</span> readbyte_of_ber_element</span> : <code class="type"><a href="Lber.html#TYPEber_length">ber_length</a> -> <a href="Lber.html#TYPEreadbyte">readbyte</a> -> <a href="Lber.html#TYPEreadbyte">readbyte</a></code></pre><div class="info ">
return a readbyte implementation which uses another readbyte, but
allows setting a read boundry. Useful for constructing views of the
octet stream which end at the end of a ber structure. This is
essential for reading certian structures because length is only
encoded in the toplevel in order to save space. Currently only
implemented for definite lengths.<br>
<b>Raises</b> <code>Readbyte_error</code> in the event of a an io error, or the end of file<br>
</div>
<pre><span id="VALreadbyte_of_fd"><span class="keyword">val</span> readbyte_of_fd</span> : <code class="type">Unix.file_descr -> <a href="Lber.html#TYPEreadbyte">readbyte</a></code></pre><div class="info ">
a readbyte implementation which reads from an FD. It implements a
peek buffer, so it can garentee that it will work with
rb_of_ber_element, even with blocking fds.<br>
<b>Raises</b> <code>Readbyte_error</code> in the event of a an io error, or the end of file<br>
</div>
<pre><span id="VALreadbyte_of_ssl"><span class="keyword">val</span> readbyte_of_ssl</span> : <code class="type">Ssl.socket -> <a href="Lber.html#TYPEreadbyte">readbyte</a></code></pre><div class="info ">
a readbyte implementation which reads from an SSL socket. It is
otherwise the same as readbyte_of_fd.<br>
<b>Raises</b> <code>Readbyte_error</code> in the event of a an io error, or the end of file<br>
</div>
<pre><span id="VALdecode_ber_header"><span class="keyword">val</span> decode_ber_header</span> : <code class="type">?peek:bool -> <a href="Lber.html#TYPEreadbyte">readbyte</a> -> <a href="Lber.html#TYPEber_val_header">ber_val_header</a></code></pre><div class="info ">
decoding and encoding of the ber header<br>
</div>
<pre><span id="VALencode_ber_header"><span class="keyword">val</span> encode_ber_header</span> : <code class="type"><a href="Lber.html#TYPEber_val_header">ber_val_header</a> -> string</code></pre>
<pre><span id="VALread_contents"><span class="keyword">val</span> read_contents</span> : <code class="type">?peek:bool -> <a href="Lber.html#TYPEreadbyte">readbyte</a> -> <a href="Lber.html#TYPEber_length">ber_length</a> -> string</code></pre><div class="info ">
reads the contents octets<br>
</div>
<br>
ENCODING and DECODING Functions
<p>
Explanation of optional arguments:
The optional arguments are there to deal with a number of
situations, cls, and tag are for context specific or application
situations where it is expected that the value will not be marked
with the class and tag defined in X.680. Contents is there for
akward situations which arise because of the choice
structure. Normally the decode functions will always read the header
for you, however with the choice structure this is impossible. In
this case you should read the header manually, determine which
decode function to call, unpack the contents with read_contents, and
send them in the contents optional. If contents is not None, then
readbyte will never be called, and no attempt will be made to read
the header or length.<br>
<pre><span id="VALdecode_ber_bool"><span class="keyword">val</span> decode_ber_bool</span> : <code class="type">?peek:bool -><br> ?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -><br> ?tag:int -> ?contents:string option -> <a href="Lber.html#TYPEreadbyte">readbyte</a> -> bool</code></pre><div class="info ">
Encoding/Decoding of the boolean primative ASN.1 type. Encode
function encodes a valid ber type, including the header and length
octets.<br>
</div>
<pre><span id="VALencode_ber_bool"><span class="keyword">val</span> encode_ber_bool</span> : <code class="type">?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -> ?tag:int -> bool -> string</code></pre>
<pre><span id="VALdecode_ber_int32"><span class="keyword">val</span> decode_ber_int32</span> : <code class="type">?peek:bool -><br> ?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -><br> ?tag:int -> ?contents:string option -> <a href="Lber.html#TYPEreadbyte">readbyte</a> -> int32</code></pre><div class="info ">
Encoding/Decoding of the integer primative ASN.1 type. Note, in
this library, integers are represented as 32 bit values. In ASN.1
there is no practical limit to the size of an integer, later on,
this library may provide an encoder/decoder to Int64, and Bigints,
however for now, this will have to do. Encode function encodes a
valid ber type, including the header and length octets<br>
</div>
<pre><span id="VALencode_ber_int32"><span class="keyword">val</span> encode_ber_int32</span> : <code class="type">?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -> ?tag:int -> int32 -> string</code></pre>
<pre><span id="VALdecode_ber_enum"><span class="keyword">val</span> decode_ber_enum</span> : <code class="type">?peek:bool -><br> ?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -><br> ?tag:int -> ?contents:string option -> <a href="Lber.html#TYPEreadbyte">readbyte</a> -> int32</code></pre><div class="info ">
Encoding/Decoding of enum primative ASN.1 type. Enums are simply
integers, the same drawbacks apply as for decode_ber_int32. Encode
function encodes a valid ber type, including the header and length
octets<br>
</div>
<pre><span id="VALencode_ber_enum"><span class="keyword">val</span> encode_ber_enum</span> : <code class="type">?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -> ?tag:int -> int32 -> string</code></pre>
<pre><span id="VALdecode_ber_octetstring"><span class="keyword">val</span> decode_ber_octetstring</span> : <code class="type">?peek:bool -><br> ?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -><br> ?tag:int -> ?contents:string option -> <a href="Lber.html#TYPEreadbyte">readbyte</a> -> string</code></pre><div class="info ">
Encoding/Decoding of octetstring ASN.1 types. The Nested or
"segmented" version of the octetstring encoding described in X.690
is not yet supported. Encode function encodes a valid ber type,
including the header and length octets<br>
</div>
<pre><span id="VALencode_ber_octetstring"><span class="keyword">val</span> encode_ber_octetstring</span> : <code class="type">?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -> ?tag:int -> string -> string</code></pre>
<pre><span id="VALdecode_ber_null"><span class="keyword">val</span> decode_ber_null</span> : <code class="type">?peek:bool -><br> ?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -><br> ?tag:int -> ?contents:string option -> <a href="Lber.html#TYPEreadbyte">readbyte</a> -> unit</code></pre><div class="info ">
Encoding/Decoding of Null ASN.1 type. Almost useful as an
assertion-type operation<br>
</div>
<pre><span id="VALencode_ber_null"><span class="keyword">val</span> encode_ber_null</span> : <code class="type">?cls:<a href="Lber.html#TYPEber_class">ber_class</a> -> ?tag:int -> unit -> string</code></pre>
<pre><span id="VALencode_berval_list"><span class="keyword">val</span> encode_berval_list</span> : <code class="type">?buf:Buffer.t -> ('a -> string) -> 'a list -> string</code></pre><div class="info ">
this function is for encoding lists of bervals, a common case.
you pass it a list of things to encode, and an encoding function, and it
will apply the encoding function to each element in the list, storing the
resulting encoding in a buffer (which you may either pass in or not)<br>
</div>
<pre><span id="VALdecode_berval_list"><span class="keyword">val</span> decode_berval_list</span> : <code class="type">?lst:'a list -> (<a href="Lber.html#TYPEreadbyte">readbyte</a> -> 'a) -> <a href="Lber.html#TYPEreadbyte">readbyte</a> -> 'a list</code></pre><div class="info ">
this is the reverse of the above, it takes a readbyte structure, and
returns a list of decoded elements, processed according to the decoder
function you pass in. Note, that you MUST pass a readbyte structure built
with readbyte_of_string, OR, your reabyte function must raise Stream.Failure
when you reach the end of input. Otherwise this function will explode. That said,
it is usually not practical to pass anything but a readbyte created by
readbyte_of_string so this should not be a huge problem.<br>
</div>
</body></html>
|