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_ev ietf_swima_attr_sw_ev
18 * @{ @ingroup ietf_attr
21 #ifndef IETF_SWIMA_ATTR_SW_EV_H_
22 #define IETF_SWIMA_ATTR_SW_EV_H_
24 #define IETF_SWIMA_SW_EV_MIN_SIZE 20
26 typedef struct ietf_swima_attr_sw_ev_t ietf_swima_attr_sw_ev_t
;
27 typedef enum ietf_swima_attr_sw_ev_flag_t ietf_swima_attr_sw_ev_flag_t
;
29 enum ietf_swima_attr_sw_ev_flag_t
{
30 IETF_SWIMA_ATTR_SW_EV_FLAG_NONE
= 0,
31 IETF_SWIMA_ATTR_SW_EV_FLAG_S_F
= (1 << 7)
34 #include "ietf/ietf_attr.h"
35 #include "swima/swima_events.h"
36 #include "pa_tnc/pa_tnc_attr.h"
39 * Class implementing the IETF SW Identifier Inventory attribute
42 struct ietf_swima_attr_sw_ev_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_ev_t
*this);
61 uint32_t (*get_request_id
)(ietf_swima_attr_sw_ev_t
*this);
64 * Get number of Software [Identifier] Events
66 * @return Software [Identifier] event count
68 uint32_t (*get_event_count
)(ietf_swima_attr_sw_ev_t
*this);
71 * Add Software [Identifier] Events
73 * @param sw_events List of Software [Identifier] events to be added
75 void (*set_events
)(ietf_swima_attr_sw_ev_t
*this,
76 swima_events_t
*sw_events
);
78 * Get Software [Identifier] Events
80 * @result Software [Identifier] events
82 swima_events_t
* (*get_events
)(ietf_swima_attr_sw_ev_t
*this);
85 * Remove all Software [Identifier] events
87 void (*clear_events
)(ietf_swima_attr_sw_ev_t
*this);
92 * Creates an ietf_swima_attr_sw_ev_t object
94 * @param flags Sets the flags
95 * @param request_id Copy of the Request ID
96 * @param sw_id_only TRUE if the Software ID, only is transmitted
98 pa_tnc_attr_t
* ietf_swima_attr_sw_ev_create(uint8_t flags
, uint32_t request_id
,
102 * Creates an ietf_swima_attr_sw_ev_t object from received data
104 * @param length Total length of attribute value
105 * @param value Unparsed attribute value (might be a segment)
106 * @param sw_id_only TRUE if the Software ID, only is transmitted
108 pa_tnc_attr_t
* ietf_swima_attr_sw_ev_create_from_data(size_t length
,
109 chunk_t value
, bool sw_id_only
);
111 #endif /** IETF_SWIMA_ATTR_SW_EV_H_ @}*/