summaryrefslogtreecommitdiffstats
path: root/include/internal/namemap.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-05-04 12:55:32 +0200
committerRichard Levitte <levitte@openssl.org>2019-05-12 13:43:38 -0700
commitf2182a4e6fef098014117eb4a4f35ca84cd2cf8e (patch)
tree9559cb125e86e497fe3baa042f9741d2fc1ca789 /include/internal/namemap.h
parentffa9bff8a2024bc8e6322be2cbff7d17fb8d828d (diff)
Create internal number<->name mapping API
This can be used as a general name to identity map. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8878)
Diffstat (limited to 'include/internal/namemap.h')
-rw-r--r--include/internal/namemap.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/internal/namemap.h b/include/internal/namemap.h
new file mode 100644
index 0000000000..30028182fd
--- /dev/null
+++ b/include/internal/namemap.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "internal/cryptlib.h"
+
+typedef struct ossl_namemap_st OSSL_NAMEMAP;
+
+OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx);
+
+OSSL_NAMEMAP *ossl_namemap_new(void);
+void ossl_namemap_free(OSSL_NAMEMAP *namemap);
+
+int ossl_namemap_add(OSSL_NAMEMAP *namemap, const char *name);
+const char *ossl_namemap_name(const OSSL_NAMEMAP *namemap, int number);
+int ossl_namemap_number(const OSSL_NAMEMAP *namemap, const char *name);