1: /*
2: * Copyright (C) 2015 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 generic_attr_bool generic_attr_bool
18: * @{ @ingroup generic_attr
19: */
20:
21: #ifndef GENERIC_ATTR_BOOL_H_
22: #define GENERIC_ATTR_BOOL_H_
23:
24: typedef struct generic_attr_bool_t generic_attr_bool_t;
25:
26: #include <pen/pen.h>
27: #include "pa_tnc/pa_tnc_attr.h"
28:
29: /**
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
32: */
33: struct generic_attr_bool_t {
34:
35: /**
36: * Public PA-TNC attribute interface
37: */
38: pa_tnc_attr_t pa_tnc_attribute;
39:
40: /**
41: * Gets boolean value
42: *
43: * @return Boolean status value
44: */
45: bool (*get_status)(generic_attr_bool_t *this);
46:
47: };
48:
49: /**
50: * Creates a generic_attr_bool_t object
51: *
52: * @param status Boolean status value
53: * @param type Vendor ID / Attribute Type
54: */
55: pa_tnc_attr_t* generic_attr_bool_create(bool status, pen_type_t type);
56:
57: /**
58: * Creates an generic_attr_bool_t object from received data
59: *
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
63: */
64: pa_tnc_attr_t* generic_attr_bool_create_from_data(size_t length, chunk_t value,
65: pen_type_t type);
66:
67: #endif /** GENERIC_ATTR_BOOL_H_ @}*/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>