blob: c26ffdf64be690762a9060ee311a07de2f02b0a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
/*
* Copyright (C) 2017 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
/**
* @defgroup swima_record swima_record
* @{ @ingroup libimcv_swima
*/
#ifndef SWIMA_RECORD_H_
#define SWIMA_RECORD_H_
#include <library.h>
#include <pen/pen.h>
typedef struct swima_record_t swima_record_t;
/**
* Class storing a Software Inventory Evidence Collection record
*/
struct swima_record_t {
/**
* Get Software Identifier and optional Software Location
*
* @return Record ID
*/
uint32_t (*get_record_id)(swima_record_t *this);
/**
* Get Software Identifier and optional Software Location
*
* @param sw_locator Optional Software Locator
* @return Software Identifier
*/
chunk_t (*get_sw_id)(swima_record_t *this, chunk_t *sw_locator);
/**
* Set Data Model
*
* @param Data model type in PEN namespace
*/
void (*set_data_model)(swima_record_t *this, pen_type_t data_model);
/**
* Get Data Model
*
* @return Data model type in PEN namespace
*/
pen_type_t (*get_data_model)(swima_record_t *this);
/**
* Set Source ID
*
* @param Source ID
*/
void (*set_source_id)(swima_record_t *this, uint8_t source_id);
/**
* Get Source ID
*
* @return Source ID
*/
uint8_t (*get_source_id)(swima_record_t *this);
/**
* Set Software Inventory Evidence Record
*
* @param Software Inventory Evidence Record
*/
void (*set_record)(swima_record_t *this, chunk_t record);
/**
* Get Software Inventory Evidence Record
*
* @return Software Inventory Evidence Record
*/
chunk_t (*get_record)(swima_record_t *this);
/**
* Get a new reference to a swima_record object
*
* @return this, with an increased refcount
*/
swima_record_t* (*get_ref)(swima_record_t *this);
/**
* Destroys a swima_record_t object.
*/
void (*destroy)(swima_record_t *this);
};
/**
* Creates a swima_record_t object
*
* @param record_id Record ID
* @param sw_id Software Identifierl
* @param sw_locator Software Locator or empty chunk
*/
swima_record_t* swima_record_create(uint32_t record_id, chunk_t sw_id,
chunk_t sw_locator);
#endif /** SWIMA_RECORD_H_ @}*/
|