summaryrefslogtreecommitdiff
path: root/src/libimcv/imv/imv_workitem.h
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-08-25 15:37:26 +0200
committerYves-Alexis Perez <corsac@debian.org>2013-08-25 15:37:26 +0200
commit6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349 (patch)
tree009fc492961e13860d2a4bc2de8caf2bbe2975e7 /src/libimcv/imv/imv_workitem.h
parentc83921a2b566aa9d55d8ccc7258f04fca6292ee6 (diff)
downloadvyos-strongswan-6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349.tar.gz
vyos-strongswan-6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349.zip
Imported Upstream version 5.1.0
Diffstat (limited to 'src/libimcv/imv/imv_workitem.h')
-rw-r--r--src/libimcv/imv/imv_workitem.h138
1 files changed, 138 insertions, 0 deletions
diff --git a/src/libimcv/imv/imv_workitem.h b/src/libimcv/imv/imv_workitem.h
new file mode 100644
index 000000000..f6ca3ea68
--- /dev/null
+++ b/src/libimcv/imv/imv_workitem.h
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2013 Andreas Steffen
+ * HSR Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+/**
+ *
+ * @defgroup imv_workitem_t imv_workitem
+ * @{ @ingroup libimcv_imv
+ */
+
+#ifndef IMV_WORKITEM_H_
+#define IMV_WORKITEM_H_
+
+#include <tncifimv.h>
+
+#include <library.h>
+
+typedef struct imv_workitem_t imv_workitem_t;
+typedef enum imv_workitem_type_t imv_workitem_type_t;
+
+enum imv_workitem_type_t {
+ IMV_WORKITEM_PACKAGES = 1,
+ IMV_WORKITEM_UNKNOWN_SOURCE = 2,
+ IMV_WORKITEM_FORWARDING = 3,
+ IMV_WORKITEM_DEFAULT_PWD = 4,
+ IMV_WORKITEM_FILE_REF_MEAS = 5,
+ IMV_WORKITEM_FILE_MEAS = 6,
+ IMV_WORKITEM_FILE_META = 7,
+ IMV_WORKITEM_DIR_REF_MEAS = 8,
+ IMV_WORKITEM_DIR_MEAS = 9,
+ IMV_WORKITEM_DIR_META = 10,
+ IMV_WORKITEM_TCP_PORT_OPEN = 11,
+ IMV_WORKITEM_TCP_PORT_BLOCK = 12,
+ IMV_WORKITEM_UDP_PORT_OPEN = 13,
+ IMV_WORKITEM_UDP_PORT_BLOCK = 14
+};
+
+extern enum_name_t *imv_workitem_type_names;
+
+/**
+ * IMV database interface
+ */
+struct imv_workitem_t {
+
+ /**
+ * Get primary workitem key
+ *
+ * @return Primary workitem key
+ */
+ int (*get_id)(imv_workitem_t *this);
+
+ /**
+ * Get workitem type
+ *
+ * @return Workitem type
+ */
+ imv_workitem_type_t (*get_type)(imv_workitem_t *this);
+
+ /**
+ * Set IMV ID
+ *
+ * @param id IMV ID
+ */
+ void (*set_imv_id)(imv_workitem_t *this, TNC_IMVID imv_id);
+
+ /**
+ * Get IMV ID
+ *
+ * @return IMV ID
+ */
+ TNC_IMVID (*get_imv_id)(imv_workitem_t *this);
+
+ /**
+ * Get string argument
+ *
+ * @return Argument string
+ */
+ char* (*get_arg_str)(imv_workitem_t *this);
+
+ /**
+ * Get integer argument
+ *
+ * @return Argument integer
+ */
+ int (*get_arg_int)(imv_workitem_t *this);
+
+ /**
+ * Set result string
+ *
+ * @param result Result string
+ * @param eval Evaluation Result
+ * @return Action Recommendation
+ */
+ TNC_IMV_Action_Recommendation (*set_result)(imv_workitem_t *this,
+ char *result, TNC_IMV_Evaluation_Result eval);
+
+ /**
+ * Set result string
+ *
+ * @param result Result string
+ * @return Action Recommendatino
+ */
+ TNC_IMV_Action_Recommendation (*get_result)(imv_workitem_t *this,
+ char **result);
+
+ /**
+ * Destroys an imv_workitem_t object
+ */
+ void (*destroy)(imv_workitem_t *this);
+};
+
+/**
+ * Create an imv_workitem_t instance
+ *
+ * @param id Primary workitem key
+ * @param type Workitem type
+ * @param arg_str String argument
+ * @param arg_int Integer argument
+ * @param rec_fail Recommendation with minor/major non-compliance case
+ * @param rec_noresult Recommendation in don't know/error case
+ */
+imv_workitem_t *imv_workitem_create(int id, imv_workitem_type_t type,
+ char *arg_str, int arg_int,
+ TNC_IMV_Action_Recommendation rec_fail,
+ TNC_IMV_Action_Recommendation rec_noresult);
+
+#endif /** IMV_WORKITEM_H_ @}*/