summaryrefslogtreecommitdiff
path: root/src/libpts/swid/swid_inventory.h
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-11-01 13:32:07 +0100
committerYves-Alexis Perez <corsac@debian.org>2013-11-01 13:32:07 +0100
commita54780509260a8cb6f0344f531da168b34410dd5 (patch)
tree477239a312679174252f39f7a80bc8bf33836d9a /src/libpts/swid/swid_inventory.h
parent6e50941f7ce9c6f2d6888412968c7f4ffb495379 (diff)
parent5313d2d78ca150515f7f5eb39801c100690b6b29 (diff)
downloadvyos-strongswan-a54780509260a8cb6f0344f531da168b34410dd5.tar.gz
vyos-strongswan-a54780509260a8cb6f0344f531da168b34410dd5.zip
Merge tag 'upstream/5.1.1'
Upstream version 5.1.1
Diffstat (limited to 'src/libpts/swid/swid_inventory.h')
-rw-r--r--src/libpts/swid/swid_inventory.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/libpts/swid/swid_inventory.h b/src/libpts/swid/swid_inventory.h
new file mode 100644
index 000000000..68d3047aa
--- /dev/null
+++ b/src/libpts/swid/swid_inventory.h
@@ -0,0 +1,78 @@
+/*
+ * 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 swid_inventory swid_inventory
+ * @{ @ingroup pts
+ */
+
+#ifndef SWID_INVENTORY_H_
+#define SWID_INVENTORY_H_
+
+#include <library.h>
+
+typedef struct swid_inventory_t swid_inventory_t;
+
+/**
+ * Class managing SWID tag inventory
+ */
+struct swid_inventory_t {
+
+ /**
+ * Collect the SWID tags stored on the endpoint
+ *
+ * @param directory SWID directory path
+ * @param targets List of target tag IDs
+ * @return TRUE if successful
+ */
+ bool (*collect)(swid_inventory_t *this, char *directory,
+ swid_inventory_t *targets);
+
+ /**
+ * Collect the SWID tags stored on the endpoint
+ *
+ * @param item SWID tag or tag ID to be added
+ */
+ void (*add)(swid_inventory_t *this, void *item);
+
+ /**
+ * Get the number of collected SWID tags
+ *
+ * @return Number of collected SWID tags
+ */
+ int (*get_count)(swid_inventory_t *this);
+
+ /**
+ * Create a SWID tag inventory enumerator
+ *
+ * @return Enumerator returning either tag ID or full tag
+ */
+ enumerator_t* (*create_enumerator)(swid_inventory_t *this);
+
+ /**
+ * Destroys a swid_inventory_t object.
+ */
+ void (*destroy)(swid_inventory_t *this);
+
+};
+
+/**
+ * Creates a swid_inventory_t object
+ *
+ * @param full_tags TRUE if full tags, FALSE if tag IDs only
+ */
+swid_inventory_t* swid_inventory_create(bool full_tags);
+
+#endif /** SWID_INVENTORY_H_ @}*/