2 * Copyright (C) 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 ietf_swima_attr_sw_inv ietf_swima_attr_sw_inv
18 * @{ @ingroup ietf_attr
21 #ifndef IETF_SWIMA_ATTR_SW_INV_H_
22 #define IETF_SWIMA_ATTR_SW_INV_H_
24 #define IETF_SWIMA_SW_INV_MIN_SIZE 16
26 typedef struct ietf_swima_attr_sw_inv_t ietf_swima_attr_sw_inv_t
;
27 typedef enum ietf_swima_attr_sw_inv_flag_t ietf_swima_attr_sw_inv_flag_t
;
29 enum ietf_swima_attr_sw_inv_flag_t
{
30 IETF_SWIMA_ATTR_SW_INV_FLAG_NONE
= 0,
31 IETF_SWIMA_ATTR_SW_INV_FLAG_S_F
= (1 << 7)
34 #include "ietf/ietf_attr.h"
35 #include "swima/swima_inventory.h"
36 #include "pa_tnc/pa_tnc_attr.h"
39 * Class implementing the IETF SW Identifier Inventory attribute
42 struct ietf_swima_attr_sw_inv_t
{
45 * Public PA-TNC attribute interface
47 pa_tnc_attr_t pa_tnc_attribute
;
50 * Get Software Inventory flags
54 uint8_t (*get_flags
)(ietf_swima_attr_sw_inv_t
*this);
61 uint32_t (*get_request_id
)(ietf_swima_attr_sw_inv_t
*this);
64 * Get number of Software [Identifier] Inventory records
66 * @return Software ID count
68 uint32_t (*get_record_count
)(ietf_swima_attr_sw_inv_t
*this);
71 * Add a Software [Identifier] Inventory
73 * @param sw_inventory Software [Identifier] record to be added
75 void (*set_inventory
)(ietf_swima_attr_sw_inv_t
*this,
76 swima_inventory_t
*sw_inventory
);
78 * Get Software [Identifier] Inventory
80 * @result Software [Identifier] Inventory
82 swima_inventory_t
* (*get_inventory
)(ietf_swima_attr_sw_inv_t
*this);
85 * Remove all Software [Identifier] records from the inventory
87 void (*clear_inventory
)(ietf_swima_attr_sw_inv_t
*this);
93 * Creates an ietf_swima_attr_sw_inv_t object
95 * @param flags Sets the flags
96 * @param request_id Copy of the Request ID
97 * @param sw_id_only TRUE if the Software ID, only is transmitted
99 pa_tnc_attr_t
* ietf_swima_attr_sw_inv_create(uint8_t flags
, uint32_t request_id
,
103 * Creates an ietf_swima_attr_sw_inv_t object from received data
105 * @param length Total length of attribute value
106 * @param value Unparsed attribute value (might be a segment)
107 * @param sw_id_only TRUE if the Software ID, only is transmitted
109 pa_tnc_attr_t
* ietf_swima_attr_sw_inv_create_from_data(size_t length
,
110 chunk_t value
, bool sw_id_only
);
112 #endif /** IETF_SWIMA_ATTR_SW_INV_H_ @}*/