Merged libpts into libimcv
[strongswan.git] / src / libimcv / swid / swid_inventory.h
1 /*
2 * Copyright (C) 2013-2014 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 * @param generator Path to SWID generator
38 * @param targets List of target tag IDs
39 * @param pretty Generate indented XML SWID tags
40 * @param full Include file information in SWID tags
41 * @return TRUE if successful
42 */
43 bool (*collect)(swid_inventory_t *this, char *directory, char *generator,
44 swid_inventory_t *targets, bool pretty, bool full);
45
46 /**
47 * Collect the SWID tags stored on the endpoint
48 *
49 * @param item SWID tag or tag ID to be added
50 */
51 void (*add)(swid_inventory_t *this, void *item);
52
53 /**
54 * Get the number of collected SWID tags
55 *
56 * @return Number of collected SWID tags
57 */
58 int (*get_count)(swid_inventory_t *this);
59
60 /**
61 * Create a SWID tag inventory enumerator
62 *
63 * @return Enumerator returning either tag ID or full tag
64 */
65 enumerator_t* (*create_enumerator)(swid_inventory_t *this);
66
67 /**
68 * Destroys a swid_inventory_t object.
69 */
70 void (*destroy)(swid_inventory_t *this);
71
72 };
73
74 /**
75 * Creates a swid_inventory_t object
76 *
77 * @param full_tags TRUE if full tags, FALSE if tag IDs only
78 */
79 swid_inventory_t* swid_inventory_create(bool full_tags);
80
81 #endif /** SWID_INVENTORY_H_ @}*/