Remove unused get_vendor_id() method in IETF error IF-M attributes
[strongswan.git] / src / libimcv / ietf / ietf_attr_pa_tnc_error.h
1 /*
2 * Copyright (C) 2011-2012 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_attr_pa_tnc_errort ietf_attr_pa_tnc_error
18 * @{ @ingroup ietf_attr_pa_tnc_error
19 */
20
21 #ifndef IETF_ATTR_PA_TNC_ERROR_H_
22 #define IETF_ATTR_PA_TNC_ERROR_H_
23
24 typedef struct ietf_attr_pa_tnc_error_t ietf_attr_pa_tnc_error_t;
25 typedef enum pa_tnc_error_code_t pa_tnc_error_code_t;
26
27 #include "ietf_attr.h"
28 #include "pa_tnc/pa_tnc_attr.h"
29
30
31 /**
32 * IETF Standard PA-TNC Error Codes as defined in section 4.2.8 of RFC 5792
33 */
34 enum pa_tnc_error_code_t {
35 PA_ERROR_RESERVED = 0,
36 PA_ERROR_INVALID_PARAMETER = 1,
37 PA_ERROR_VERSION_NOT_SUPPORTED = 2,
38 PA_ERROR_ATTR_TYPE_NOT_SUPPORTED = 3,
39 };
40
41 /**
42 * enum name for pa_tnc_error_code_t.
43 */
44 extern enum_name_t *pa_tnc_error_code_names;
45
46 /**
47 * Class implementing the IETF PA-TNC Error attribute.
48 *
49 */
50 struct ietf_attr_pa_tnc_error_t {
51
52 /**
53 * Public PA-TNC attribute interface
54 */
55 pa_tnc_attr_t pa_tnc_attribute;
56
57 /**
58 * Get Vendor-specific PA-TNC error code
59 *
60 * @return error code
61 */
62 pen_type_t (*get_error_code)(ietf_attr_pa_tnc_error_t *this);
63
64 /**
65 * Get first 8 bytes of erroneous PA-TNC message
66 *
67 * @return PA-TNC message info
68 */
69 chunk_t (*get_msg_info)(ietf_attr_pa_tnc_error_t *this);
70
71 /**
72 * Get first 8 bytes of unsupported PA-TNC attribute
73 *
74 * @return PA-TNC attribute info
75 */
76 chunk_t (*get_attr_info)(ietf_attr_pa_tnc_error_t *this);
77
78 /**
79 * Set first 8 bytes of unsupported PA-TNC attribute
80 *
81 * @param attr_info PA-TNC message info
82 */
83 void (*set_attr_info)(ietf_attr_pa_tnc_error_t *this, chunk_t attr_info);
84
85 /**
86 * Get the PA-TNC error offset
87 *
88 * @return PA-TNC error offset
89 */
90 u_int32_t (*get_offset)(ietf_attr_pa_tnc_error_t *this);
91
92 };
93
94 /**
95 * Creates an ietf_attr_pa_tnc_error_t object from an error code
96 *
97 * @param error_code Vendor-specific PA-TNC error code
98 * @param header PA-TNC message header (first 8 bytes)
99 *
100 */
101 pa_tnc_attr_t* ietf_attr_pa_tnc_error_create(pen_type_t error_code,
102 chunk_t header);
103
104 /**
105 * Creates an ietf_attr_pa_tnc_error_t object from an error code with offset
106 *
107 * @param error_code Vendor-specifica PA-TNC error code
108 * @param header PA-TNC message header (first 8 bytes)
109 * @param error_offset PA-TNC error offset in bytes
110 *
111 */
112 pa_tnc_attr_t* ietf_attr_pa_tnc_error_create_with_offset(pen_type_t error_code,
113 chunk_t header,
114 u_int32_t error_offset);
115
116 /**
117 * Creates an ietf_attr_pa_tnc_error_t object from received data
118 *
119 * @param value unparsed attribute value
120 */
121 pa_tnc_attr_t* ietf_attr_pa_tnc_error_create_from_data(chunk_t value);
122
123 #endif /** IETF_ATTR_PA_TNC_ERROR_H_ @}*/