Permalink
Browse files

merge

  • Loading branch information...
2 parents 89f3e1e + 103d1e1 commit 047681c185942df1ed727c2ec0ff99083c843ffd @samrushing samrushing committed Jul 11, 2012
View
@@ -22,7 +22,7 @@ Features
* with_timeout(): wrap any funcall with a timeout.
* Wait on kqueue events like file/directory changes, signals, processes, etc... [kqueue only]
* DNS stub resolver (full-fledged resolver may be forthcoming)
- * HTTP server and client
+ * HTTP server and client (plus WebSocket, RFC6455 & hixie-76)
* Support for TLS via tlslite (openssl interface may be forthcoming)
* other protocols/codecs: ldap, asn1, ftp, mysql, postgres, AMQP_.
* `MIT License`_.
View
@@ -0,0 +1,2 @@
+# -*- Mode: Python -*-
+# even empty, this file is needed so cython will see the .pxd
View
@@ -0,0 +1,52 @@
+# -*- Mode: Cython -*-
+
+# flags for BER tags
+cdef enum FLAGS:
+ FLAGS_UNIVERSAL = 0x00
+ FLAGS_STRUCTURED = 0x20
+ FLAGS_APPLICATION = 0x40
+ FLAGS_CONTEXT = 0x80
+
+# NULL is a pyrex keyword
+# universal BER tags
+cdef enum TAGS:
+ TAGS_BOOLEAN = 0x01
+ TAGS_INTEGER = 0x02
+ TAGS_BITSTRING = 0x03
+ TAGS_OCTET_STRING = 0x04
+ TAGS_NULL = 0x05
+ TAGS_OBJID = 0x06
+ TAGS_OBJDESCRIPTOR = 0x07
+ TAGS_EXTERNAL = 0x08
+ TAGS_REAL = 0x09
+ TAGS_ENUMERATED = 0x0a
+ TAGS_EMBEDDED_PDV = 0x0b
+ TAGS_UTF8STRING = 0x0c
+ TAGS_SEQUENCE = 0x10 | 0x20 # Equivalent to FLAGS_STRUCTURED
+ TAGS_SET = 0x11 | 0x20 # Equivalent to FLAGS_STRUCTURED
+
+cdef int length_of_length (int n)
+cdef void encode_length (int l, int n, char * buffer)
+cdef object _encode_integer (int n)
+cdef object _encode_long_integer (n)
+cdef object _TLV1 (int tag, bytes data)
+cdef object _TLV (int tag, object data)
+cdef object _CHOICE (int n, bint structured)
+cdef object _APPLICATION (int n)
+cdef object _ENUMERATED (int n)
+cdef object _INTEGER (int n)
+cdef object _BOOLEAN (int n)
+cdef object _SEQUENCE (object elems)
+cdef object _SET (object elems)
+cdef object _OCTET_STRING (bytes s)
+cdef object _OBJID (list l)
+cdef object decode_string (unsigned char * s, int * pos, int length)
+cdef object decode_raw (unsigned char * s, int * pos, int length)
+cdef object decode_bitstring (unsigned char * s, int * pos, int length)
+cdef object decode_integer (unsigned char * s, int * pos, int length)
+cdef object decode_long_integer (unsigned char * s, int * pos, int length)
+cdef object decode_structured (unsigned char * s, int * pos, int length)
+cdef object decode_objid (unsigned char * s, int * pos, int length)
+cdef object decode_boolean (unsigned char * s, int * pos, int length)
+cdef int _decode_length (unsigned char * s, int * pos, int lol)
+cdef object _decode (unsigned char * s, int * pos, int eos, bint just_tlv)
Oops, something went wrong.

0 comments on commit 047681c

Please sign in to comment.