444ed576619954ffb9f57f24783eca4262139a4b
[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 * @return TRUE if successful
37 */
38 bool (*collect)(swid_inventory_t *this);
39
40 /**
41 * Collect the SWID tags stored on the endpoint
42 *
43 * @param item SWID tag or tag ID to be added
44 */
45 void (*add)(swid_inventory_t *this, void *item);
46
47 /**
48 * Get the number of collected SWID tags
49 *
50 * @return Number of collected SWID tags
51 */
52 int (*get_count)(swid_inventory_t *this);
53
54 /**
55 * Create a SWID tag inventory enumerator
56 *
57 * @return Enumerator returning either tag ID or full tag
58 */
59 enumerator_t* (*create_enumerator)(swid_inventory_t *this);
60
61 /**
62 * Destroys a swid_inventory_t object.
63 */
64 void (*destroy)(swid_inventory_t *this);
65
66 };
67
68 /**
69 * Creates a swid_inventory_t object
70 *
71 * @param full_tags TRUE if full tags, FALSE if tag IDs only
72 */
73 swid_inventory_t* swid_inventory_create(bool full_tags);
74
75 #endif /** SWID_INVENTORY_H_ @}*/