2 * Copyright (C) 2015 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 generic_attr_bool generic_attr_bool
18 * @{ @ingroup generic_attr
21 #ifndef GENERIC_ATTR_BOOL_H_
22 #define GENERIC_ATTR_BOOL_H_
24 typedef struct generic_attr_bool_t generic_attr_bool_t
;
27 #include "pa_tnc/pa_tnc_attr.h"
30 * Class implementing a generic PA-TNC attribute containing a boolean status
31 * value encoded as a 32 bit unsigned integer (0,1) in network order
33 struct generic_attr_bool_t
{
36 * Public PA-TNC attribute interface
38 pa_tnc_attr_t pa_tnc_attribute
;
43 * @return Boolean status value
45 bool (*get_status
)(generic_attr_bool_t
*this);
50 * Creates a generic_attr_bool_t object
52 * @param status Boolean status value
53 * @param type Vendor ID / Attribute Type
55 pa_tnc_attr_t
* generic_attr_bool_create(bool status
, pen_type_t type
);
58 * Creates an generic_attr_bool_t object from received data
60 * @param length Total length of attribute value
61 * @param value Unparsed attribute value (might be a segment)
62 * @param type Vendor ID / Attribute Type
64 pa_tnc_attr_t
* generic_attr_bool_create_from_data(size_t length
, chunk_t value
,
67 #endif /** GENERIC_ATTR_BOOL_H_ @}*/