Merge branch 'swima-reserved'
[strongswan.git] / src / libimcv / swima / swima_inventory.h
1 /*
2 * Copyright (C) 2017 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 swima_inventory swima_inventory
18 * @{ @ingroup libimcv_swima
19 */
20
21 #ifndef SWIMA_INVENTORY_H_
22 #define SWIMA_INVENTORY_H_
23
24 #define SWIMA_MAX_ATTR_SIZE 10000000
25
26 #include "swima_record.h"
27
28 #include <library.h>
29
30 typedef struct swima_inventory_t swima_inventory_t;
31
32 /**
33 * Class managing software inventory
34 */
35 struct swima_inventory_t {
36
37 /**
38 * Add evidence record to software inventory
39 *
40 * @param record Software evidence record to be added
41 */
42 void (*add)(swima_inventory_t *this, swima_record_t *record);
43
44 /**
45 * Get the number of evidence records in the software inventory
46 *
47 * @return Number evidence records
48 */
49 int (*get_count)(swima_inventory_t *this);
50
51 /**
52 * Set the earliest or last event ID of the inventory
53 *
54 * @param Event ID
55 * @param Epoch of event IDs
56 */
57 void (*set_eid)(swima_inventory_t *this, uint32_t eid, uint32_t epoch);
58
59 /**
60 * Get the earliest or last event ID of the inventory
61 *
62 * @param Epoch of event IDs
63 * @return Event ID
64 */
65 uint32_t (*get_eid)(swima_inventory_t *this, uint32_t *epoch);
66
67 /**
68 * Create a software inventory evidence record enumerator
69 *
70 * @return Enumerator returning evidence records
71 */
72 enumerator_t* (*create_enumerator)(swima_inventory_t *this);
73
74 /**
75 * Get a new reference to a swima_inventory object
76 *
77 * @return This, with an increased refcount
78 */
79 swima_inventory_t* (*get_ref)(swima_inventory_t *this);
80
81 /**
82 * Clears the inventory, keeping the eid and epoch values
83 */
84 void (*clear)(swima_inventory_t *this);
85
86 /**
87 * Destroys a swima_inventory_t object
88 */
89 void (*destroy)(swima_inventory_t *this);
90
91 };
92
93 /**
94 * Creates a swima_inventory_t object
95 *
96 */
97 swima_inventory_t* swima_inventory_create(void);
98
99 #endif /** SWIMA_INVENTORY_H_ @}*/