433f55ee0e26ccb860b427bc52ba51f1f06db268
[strongswan.git] / src / libpts / tcg / swid / tcg_swid_attr_tag_inv.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 tcg_swid_attr_tag_inv tcg_swid_attr_tag_inv
18 * @{ @ingroup tcg_attr
19 */
20
21 #ifndef TCG_SWID_ATTR_TAG_INV_H_
22 #define TCG_SWID_ATTR_TAG_INV_H_
23
24 typedef struct tcg_swid_attr_tag_inv_t tcg_swid_attr_tag_inv_t;
25
26 #include "tcg/tcg_attr.h"
27 #include "swid/swid_tag.h"
28 #include "swid/swid_inventory.h"
29
30 #include <pa_tnc/pa_tnc_attr.h>
31
32 /**
33 * Class implementing the TCG SWID Tag Inventory attribute
34 *
35 */
36 struct tcg_swid_attr_tag_inv_t {
37
38 /**
39 * Public PA-TNC attribute interface
40 */
41 pa_tnc_attr_t pa_tnc_attribute;
42
43 /**
44 * Get Request ID
45 *
46 * @return Request ID
47 */
48 u_int32_t (*get_request_id)(tcg_swid_attr_tag_inv_t *this);
49
50 /**
51 * Get Last Event ID
52 *
53 * @param eid_epoch Event ID Epoch
54 * @return Last Event ID
55 */
56 u_int32_t (*get_last_eid)(tcg_swid_attr_tag_inv_t *this,
57 u_int32_t *eid_epoch);
58
59 /**
60 * Get Inventory of SWID tags
61 *
62 * @result SWID Tag Inventory
63 */
64 swid_inventory_t* (*get_inventory)(tcg_swid_attr_tag_inv_t *this);
65
66 };
67
68 /**
69 * Creates an tcg_swid_attr_tag_inv_t object
70 *
71 * @param request_id Copy of the Request ID
72 * @param eid_epoch Event ID Epoch
73 * @param eid Last Event ID
74 * @param inventory SWID Tag Inventory
75 */
76 pa_tnc_attr_t* tcg_swid_attr_tag_inv_create(u_int32_t request_id,
77 u_int32_t eid_epoch,
78 u_int32_t eid,
79 swid_inventory_t *inventory);
80
81 /**
82 * Creates an tcg_swid_attr_tag_inv_t object from received data
83 *
84 * @param value unparsed attribute value
85 */
86 pa_tnc_attr_t* tcg_swid_attr_tag_inv_create_from_data(chunk_t value);
87
88 #endif /** TCG_SWID_ATTR_TAG_INV_H_ @}*/