2 * Copyright (C) 2013-2017 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
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>.
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
17 * @defgroup tcg_swid_attr_req tcg_swid_attr_req
18 * @{ @ingroup tcg_attr
21 #ifndef TCG_SWID_ATTR_REQ_H_
22 #define TCG_SWID_ATTR_REQ_H_
24 #define TCG_SWID_REQ_MIN_SIZE 12
26 typedef struct tcg_swid_attr_req_t tcg_swid_attr_req_t
;
27 typedef enum tcg_swid_attr_req_flag_t tcg_swid_attr_req_flag_t
;
29 enum tcg_swid_attr_req_flag_t
{
30 TCG_SWID_ATTR_REQ_FLAG_NONE
= 0,
31 TCG_SWID_ATTR_REQ_FLAG_C
= (1 << 7),
32 TCG_SWID_ATTR_REQ_FLAG_S
= (1 << 6),
33 TCG_SWID_ATTR_REQ_FLAG_R
= (1 << 5)
36 #include "tcg/tcg_attr.h"
37 #include "swid/swid_tag_id.h"
38 #include "swid/swid_inventory.h"
39 #include "pa_tnc/pa_tnc_attr.h"
42 * Class implementing the TCG SWID Request attribute
44 struct tcg_swid_attr_req_t
{
47 * Public PA-TNC attribute interface
49 pa_tnc_attr_t pa_tnc_attribute
;
52 * Get SWID request flags
56 uint8_t (*get_flags
)(tcg_swid_attr_req_t
*this);
63 uint32_t (*get_request_id
)(tcg_swid_attr_req_t
*this);
70 uint32_t (*get_earliest_eid
)(tcg_swid_attr_req_t
*this);
75 * @param tag_id SWID Tag ID (is not cloned by constructor!)
77 void (*add_target
)(tcg_swid_attr_req_t
*this, swid_tag_id_t
*tag_id
);
80 * Create Tag ID enumerator
82 * @return Get a list of target tag IDs
84 swid_inventory_t
* (*get_targets
)(tcg_swid_attr_req_t
*this);
89 * Creates an tcg_swid_attr_req_t object
91 * @param flags Sets the C|S|R flags
92 * @param request_id Request ID
93 * @param eid Earliest Event ID
95 pa_tnc_attr_t
* tcg_swid_attr_req_create(uint8_t flags
, uint32_t request_id
,
99 * Creates an tcg_swid_attr_req_t object from received data
101 * @param length Total length of attribute value
102 * @param value Unparsed attribute value (might be a segment)
104 pa_tnc_attr_t
* tcg_swid_attr_req_create_from_data(size_t length
, chunk_t value
);
106 #endif /** TCG_SWID_ATTR_REQ_H_ @}*/