SWID IMC proposes IF-M segmentation contracts
[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 /* Maximum size of a SWID Tag Inventory: 100 MB */
27 #define SWID_MAX_ATTR_SIZE 100000000
28
29 typedef struct swid_inventory_t swid_inventory_t;
30
31 /**
32 * Class managing SWID tag inventory
33 */
34 struct swid_inventory_t {
35
36 /**
37 * Collect the SWID tags stored on the endpoint
38 *
39 * @param directory SWID directory path
40 * @param generator Path to SWID generator
41 * @param targets List of target tag IDs
42 * @param pretty Generate indented XML SWID tags
43 * @param full Include file information in SWID tags
44 * @return TRUE if successful
45 */
46 bool (*collect)(swid_inventory_t *this, char *directory, char *generator,
47 swid_inventory_t *targets, bool pretty, bool full);
48
49 /**
50 * Collect the SWID tags stored on the endpoint
51 *
52 * @param item SWID tag or tag ID to be added
53 */
54 void (*add)(swid_inventory_t *this, void *item);
55
56 /**
57 * Get the number of collected SWID tags
58 *
59 * @return Number of collected SWID tags
60 */
61 int (*get_count)(swid_inventory_t *this);
62
63 /**
64 * Create a SWID tag inventory enumerator
65 *
66 * @return Enumerator returning either tag ID or full tag
67 */
68 enumerator_t* (*create_enumerator)(swid_inventory_t *this);
69
70 /**
71 * Destroys a swid_inventory_t object.
72 */
73 void (*destroy)(swid_inventory_t *this);
74
75 };
76
77 /**
78 * Creates a swid_inventory_t object
79 *
80 * @param full_tags TRUE if full tags, FALSE if tag IDs only
81 */
82 swid_inventory_t* swid_inventory_create(bool full_tags);
83
84 #endif /** SWID_INVENTORY_H_ @}*/