aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1parser/asn1p_oid.h
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-06-03 03:38:44 +0000
committerLev Walkin <vlm@lionet.info>2004-06-03 03:38:44 +0000
commitf15320bf6b50a0c02636405561ac8323ae901abd (patch)
tree33461d45122896c6dde35f82f5c7d19b62004a6b /libasn1parser/asn1p_oid.h
parent746cb60bbccf47019563665f4aec4b6c462c4163 (diff)
Initial revision
Diffstat (limited to 'libasn1parser/asn1p_oid.h')
-rw-r--r--libasn1parser/asn1p_oid.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/libasn1parser/asn1p_oid.h b/libasn1parser/asn1p_oid.h
new file mode 100644
index 00000000..cbb6b079
--- /dev/null
+++ b/libasn1parser/asn1p_oid.h
@@ -0,0 +1,66 @@
+/*
+ * Object Identifier definition.
+ */
+#ifndef ASN1_PARSER_OID_H
+#define ASN1_PARSER_OID_H
+
+/********************************
+ * Single Object Identifier Arc *
+ ********************************/
+
+/*
+ * Object identifier arc (one number in the hierarchy).
+ */
+typedef struct asn1p_oid_arc_s {
+ asn1_integer_t number; /* -1 if not yet defined */
+ char *name; /* 0 if not defined */
+} asn1p_oid_arc_t;
+
+
+/*
+ * Arc constructor.
+ */
+asn1p_oid_arc_t *asn1p_oid_arc_new(
+ const char *optName, asn1_integer_t optNumber /* = -1 */);
+/*
+ * Arc destructor.
+ */
+void asn1p_oid_arc_free(asn1p_oid_arc_t *);
+
+
+/**************************************************
+ * Object Identifier itself, a collection of arcs *
+ **************************************************/
+
+/*
+ * Object Identifier as a collection of arcs.
+ */
+typedef struct asn1p_oid_s {
+ asn1p_oid_arc_t *arcs;
+ int arcs_count;
+} asn1p_oid_t;
+
+/*
+ * OID constructor.
+ */
+asn1p_oid_t *asn1p_oid_new(void);
+
+/*
+ * Add another arc using given one as a template
+ */
+int asn1p_oid_add_arc(asn1p_oid_t *, asn1p_oid_arc_t *template);
+
+/*
+ * OID destructor.
+ */
+void asn1p_oid_free(asn1p_oid_t *);
+
+/*
+ * RETURN VALUES:
+ * 0: The specified OIDs are equal.
+ * -1 or 1 otherwise.
+ */
+int asn1p_oid_compare(asn1p_oid_t *a, asn1p_oid_t *b);
+
+
+#endif /* ASN1_PARSER_OID_H */