Make SWID directory where tags are stored configurable
[strongswan.git] / src / libpts / swid / swid_inventory.h
1 /*
2 * Copyright (C) 2013 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup swid_inventory swid_inventory
18 * @{ @ingroup pts
19 */
20
21 #ifndef SWID_INVENTORY_H_
22 #define SWID_INVENTORY_H_
23
24 #include <library.h>
25
26 typedef struct swid_inventory_t swid_inventory_t;
27
28 /**
29 * Class managing SWID tag inventory
30 */
31 struct swid_inventory_t {
32
33 /**
34 * Collect the SWID tags stored on the endpoint
35 *
36 * @param directory SWID directory path
37 * @return TRUE if successful
38 */
39 bool (*collect)(swid_inventory_t *this, char *directory);
40
41 /**
42 * Collect the SWID tags stored on the endpoint
43 *
44 * @param item SWID tag or tag ID to be added
45 */
46 void (*add)(swid_inventory_t *this, void *item);
47
48 /**
49 * Get the number of collected SWID tags
50 *
51 * @return Number of collected SWID tags
52 */
53 int (*get_count)(swid_inventory_t *this);
54
55 /**
56 * Create a SWID tag inventory enumerator
57 *
58 * @return Enumerator returning either tag ID or full tag
59 */
60 enumerator_t* (*create_enumerator)(swid_inventory_t *this);
61
62 /**
63 * Destroys a swid_inventory_t object.
64 */
65 void (*destroy)(swid_inventory_t *this);
66
67 };
68
69 /**
70 * Creates a swid_inventory_t object
71 *
72 * @param full_tags TRUE if full tags, FALSE if tag IDs only
73 */
74 swid_inventory_t* swid_inventory_create(bool full_tags);
75
76 #endif /** SWID_INVENTORY_H_ @}*/