This interface is meant to have error format strings to be resolved to
unique error ids.
Signed-off-by: Thomas Egerer <[email protected]>
---
src/libcharon/bus/error_unifier/error_unifier.h | 54 +++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
create mode 100644 src/libcharon/bus/error_unifier/error_unifier.h
diff --git a/src/libcharon/bus/error_unifier/error_unifier.h b/src/libcharon/bus/error_unifier/error_unifier.h
new file mode 100644
index 0000000..4c39830
--- /dev/null
+++ b/src/libcharon/bus/error_unifier/error_unifier.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2013 secunet Security Networks AG
+ * Copyright (C) 2013 Thomas Egerer
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * @defgroup error_unifier error_unifier
+ * @{ @ingroup libcharon
+ */
+
+#ifndef ERROR_UNIFIER_H_
+#define ERROR_UNIFIER_H_
+
+#include <sys/types.h>
+
+typedef struct error_unifier_t error_unifier_t;
+
+/**
+ * Map error messages to a unique error code
+ */
+struct error_unifier_t {
+ /**
+ * Return a unique error id by a given format string.
+ *
+ * @param format format string as specified in the DBG-macro
+ * @return unique error code for the given format string
+ */
+ u_int64_t (*get_id_by_format)(error_unifier_t *this, const char *format);
+
+ /**
+ * Destroy error unifier.
+ */
+ void (*destroy)(error_unifier_t *this);
+};
+
+#endif /** ERROR_UNIFIER_H_ @}*/
_______________________________________________
Dev mailing list
[email protected]
https://lists.strongswan.org/mailman/listinfo/dev