Annotation of embedaddon/strongswan/src/libimcv/ietf/swima/ietf_swima_attr_sw_inv.h, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (C) 2017 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 ietf_swima_attr_sw_inv ietf_swima_attr_sw_inv
18: * @{ @ingroup ietf_attr
19: */
20:
21: #ifndef IETF_SWIMA_ATTR_SW_INV_H_
22: #define IETF_SWIMA_ATTR_SW_INV_H_
23:
24: #define IETF_SWIMA_SW_INV_MIN_SIZE 16
25:
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;
28:
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)
32: };
33:
34: #include "ietf/ietf_attr.h"
35: #include "swima/swima_inventory.h"
36: #include "pa_tnc/pa_tnc_attr.h"
37:
38: /**
39: * Class implementing the IETF SW Identifier Inventory attribute
40: *
41: */
42: struct ietf_swima_attr_sw_inv_t {
43:
44: /**
45: * Public PA-TNC attribute interface
46: */
47: pa_tnc_attr_t pa_tnc_attribute;
48:
49: /**
50: * Get Software Inventory flags
51: *
52: * @return Flags
53: */
54: uint8_t (*get_flags)(ietf_swima_attr_sw_inv_t *this);
55:
56: /**
57: * Get Request ID
58: *
59: * @return Request ID
60: */
61: uint32_t (*get_request_id)(ietf_swima_attr_sw_inv_t *this);
62:
63: /**
64: * Get number of Software [Identifier] Inventory records
65: *
66: * @return Software ID count
67: */
68: uint32_t (*get_record_count)(ietf_swima_attr_sw_inv_t *this);
69:
70: /**
71: * Add a Software [Identifier] Inventory
72: *
73: * @param sw_inventory Software [Identifier] record to be added
74: */
75: void (*set_inventory)(ietf_swima_attr_sw_inv_t *this,
76: swima_inventory_t *sw_inventory);
77: /**
78: * Get Software [Identifier] Inventory
79: *
80: * @result Software [Identifier] Inventory
81: */
82: swima_inventory_t* (*get_inventory)(ietf_swima_attr_sw_inv_t *this);
83:
84: /**
85: * Remove all Software [Identifier] records from the inventory
86: */
87: void (*clear_inventory)(ietf_swima_attr_sw_inv_t *this);
88:
89:
90: };
91:
92: /**
93: * Creates an ietf_swima_attr_sw_inv_t object
94: *
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
98: */
99: pa_tnc_attr_t* ietf_swima_attr_sw_inv_create(uint8_t flags, uint32_t request_id,
100: bool sw_id_only);
101:
102: /**
103: * Creates an ietf_swima_attr_sw_inv_t object from received data
104: *
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
108: */
109: pa_tnc_attr_t* ietf_swima_attr_sw_inv_create_from_data(size_t length,
110: chunk_t value, bool sw_id_only);
111:
112: #endif /** IETF_SWIMA_ATTR_SW_INV_H_ @}*/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>