summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2007-04-21 20:53:26 +0200
committerMichael Brown2007-04-21 20:53:26 +0200
commit95206577a7fe82317e669c022d809838fe6ae023 (patch)
treeb4f7b7f812298db82224f54b661f4e352e098ac9 /src/include
parenthoffmeis: Preparations for syslog support (LOGSERVER in DHCP, linewise (diff)
downloadipxe-95206577a7fe82317e669c022d809838fe6ae023.tar.gz
ipxe-95206577a7fe82317e669c022d809838fe6ae023.tar.xz
ipxe-95206577a7fe82317e669c022d809838fe6ae023.zip
Trivial ASN.1 decoding functions.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/asn1.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/include/gpxe/asn1.h b/src/include/gpxe/asn1.h
new file mode 100644
index 000000000..1ad90050e
--- /dev/null
+++ b/src/include/gpxe/asn1.h
@@ -0,0 +1,32 @@
+#ifndef _GPXE_ASN1_H
+#define _GPXE_ASN1_H
+
+/** @file
+ *
+ * ASN.1 encoding
+ *
+ */
+
+#define ASN1_INTEGER 0x02
+#define ASN1_BIT_STRING 0x03
+#define ASN1_OCTET_STRING 0x04
+#define ASN1_NULL 0x05
+#define ASN1_OID 0x06
+#define ASN1_SEQUENCE 0x30
+#define ASN1_IP_ADDRESS 0x40
+#define ASN1_EXPLICIT_TAG 0xa0
+
+/**
+ * A DER-encoded ASN.1 object cursor
+ */
+struct asn1_cursor {
+ /** Start of data */
+ uint8_t *data;
+ /** Length of data */
+ size_t len;
+};
+
+extern int asn1_enter_object ( struct asn1_cursor *cursor, unsigned int type );
+extern int asn1_skip_object ( struct asn1_cursor *cursor, unsigned int type );
+
+#endif /* _GPXE_ASN1_H */