sub-component depth from pts database on component evidence request
[strongswan.git] / src / libpts / pts / components / pts_component_manager.h
1 /*
2 * Copyright (C) 2011 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 pts_component_manager pts_component_manager
18 * @{ @ingroup pts
19 */
20
21 #ifndef PTS_COMPONENT_MANAGER_H_
22 #define PTS_COMPONENT_MANAGER_H_
23
24 typedef struct pts_component_manager_t pts_component_manager_t;
25
26 #include "pts/components/pts_component.h"
27 #include "pts/components/pts_comp_func_name.h"
28
29 #include <library.h>
30 #include <pen/pen.h>
31
32 typedef pts_component_t* (*pts_component_create_t)(u_int8_t qualifier,
33 u_int32_t depth);
34
35 /**
36 * Manages PTS Functional Components
37 */
38 struct pts_component_manager_t {
39
40 /**
41 * Add vendor-specific functional component names
42 *
43 * @param vendor_id Private Enterprise Number (PEN)
44 * @param comp_func_names Vendor-specific Component Functional names
45 * @param qualifier_type_size Vendor-specific Qualifier Type size
46 * @param qualifier_flag_names Vendor-specific Qualifier Flag names
47 * @param qualifier_type_names Vendor-specific Qualifier Type names
48 */
49 void (*add_vendor)(pts_component_manager_t *this, pen_t vendor_id,
50 enum_name_t *comp_func_names,
51 int qualifier_type_size,
52 char *qualifier_flag_names,
53 enum_name_t *qualifier_type_names);
54
55 /**
56 * Add vendor-specific functional component
57 *
58 * @param vendor_id Private Enterprise Number (PEN)
59 * @param names Component Functional Name
60 * @param create Functional Component creation method
61 */
62 void (*add_component)(pts_component_manager_t *this, pen_t vendor_id,
63 u_int32_t name, pts_component_create_t create);
64
65 /**
66 * Remove vendor-specific components and associated namespace
67 *
68 * @param vendor_id Private Enterprise Number (PEN)
69 */
70 void (*remove_vendor)(pts_component_manager_t *this, pen_t vendor_id);
71
72 /**
73 * Return the Functional Component names for a given vendor ID
74 *
75 * @param vendor_id Private Enterprise Number (PEN)
76 * @return Comp. Func. names if found, NULL else
77 */
78 enum_name_t* (*get_comp_func_names)(pts_component_manager_t *this,
79 pen_t vendor_id);
80
81 /**
82 * Return the Functional Component Qualifier Type names for a given vendor ID
83 *
84 * @param vendor_id Private Enterprise Number (PEN)
85 * @return Qualifier Type names if found, NULL else
86 */
87 enum_name_t* (*get_qualifier_type_names)(pts_component_manager_t *this,
88 pen_t vendor_id);
89
90 /**
91 * Return the Qualifier Type and Flags
92 *
93 * @param name Component Functional Name
94 * @param flags Qualifier Flags as a string in a char buffer
95 * @return Qualifier Type
96 */
97 u_int8_t (*get_qualifier)(pts_component_manager_t *this,
98 pts_comp_func_name_t *name, char *flags);
99
100 /**
101 * Create a PTS Component object from a Functional Component Name object
102 *
103 * @param name Component Functional Name
104 * @param depth Sub-component Depth
105 * @return Component object if supported, NULL else
106 */
107 pts_component_t* (*create)(pts_component_manager_t *this,
108 pts_comp_func_name_t *name, u_int32_t depth);
109
110 /**
111 * Destroys a pts_component_manager_t object.
112 */
113 void (*destroy)(pts_component_manager_t *this);
114 };
115
116 /**
117 * Create a PA-TNC attribute manager
118 */
119 pts_component_manager_t* pts_component_manager_create(void);
120
121 #endif /** PTS_COMPONENT_MANAGER_H_ @}*/