22 #if !defined(_PEAP_TLV_PAYLOADS_H_) |
22 #if !defined(_PEAP_TLV_PAYLOADS_H_) |
23 #define _PEAP_TLV_PAYLOADS_H_ |
23 #define _PEAP_TLV_PAYLOADS_H_ |
24 |
24 |
25 #include "eap_variable_data.h" |
25 #include "eap_variable_data.h" |
26 #include "eap_am_export.h" |
26 #include "eap_am_export.h" |
|
27 // Start: added by script change_export_macros.sh. |
|
28 #if defined(EAP_NO_EXPORT_TLS_PEAP_TLV_PAYLOADS_H) |
|
29 #define EAP_CLASS_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H EAP_NONSHARABLE |
|
30 #define EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H |
|
31 #define EAP_C_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H |
|
32 #define EAP_FUNC_EXPORT_TLS_PEAP_TLV_PAYLOADS_H |
|
33 #define EAP_C_FUNC_EXPORT_TLS_PEAP_TLV_PAYLOADS_H |
|
34 #elif defined(EAP_EXPORT_TLS_PEAP_TLV_PAYLOADS_H) |
|
35 #define EAP_CLASS_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H EAP_EXPORT |
|
36 #define EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H EAP_FUNC_EXPORT |
|
37 #define EAP_C_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H EAP_C_FUNC_EXPORT |
|
38 #define EAP_FUNC_EXPORT_TLS_PEAP_TLV_PAYLOADS_H EAP_FUNC_EXPORT |
|
39 #define EAP_C_FUNC_EXPORT_TLS_PEAP_TLV_PAYLOADS_H EAP_C_FUNC_EXPORT |
|
40 #else |
|
41 #define EAP_CLASS_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H EAP_IMPORT |
|
42 #define EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H EAP_FUNC_IMPORT |
|
43 #define EAP_C_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H EAP_C_FUNC_IMPORT |
|
44 #define EAP_FUNC_EXPORT_TLS_PEAP_TLV_PAYLOADS_H |
|
45 #define EAP_C_FUNC_EXPORT_TLS_PEAP_TLV_PAYLOADS_H |
|
46 #endif |
|
47 // End: added by script change_export_macros.sh. |
27 #include "tls_peap_tlv_header.h" |
48 #include "tls_peap_tlv_header.h" |
28 |
49 |
29 |
50 |
30 |
51 |
31 class EAP_EXPORT peap_tlv_variable_data_c |
52 class EAP_CLASS_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H peap_tlv_variable_data_c |
32 : public eap_variable_data_c |
53 : public eap_variable_data_c |
33 { |
54 { |
34 private: |
55 private: |
35 //-------------------------------------------------- |
56 //-------------------------------------------------- |
36 |
57 |
46 |
67 |
47 //-------------------------------------------------- |
68 //-------------------------------------------------- |
48 public: |
69 public: |
49 //-------------------------------------------------- |
70 //-------------------------------------------------- |
50 |
71 |
51 EAP_FUNC_IMPORT virtual ~peap_tlv_variable_data_c(); |
72 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H virtual ~peap_tlv_variable_data_c(); |
52 |
73 |
53 EAP_FUNC_IMPORT peap_tlv_variable_data_c(abs_eap_am_tools_c * const tools); |
74 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H peap_tlv_variable_data_c(abs_eap_am_tools_c * const tools); |
54 |
75 |
55 EAP_FUNC_IMPORT const tls_peap_tlv_header_c * get_original_header() const; |
76 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H const tls_peap_tlv_header_c * get_original_header() const; |
56 |
77 |
57 EAP_FUNC_IMPORT eap_status_e set_buffer( |
78 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H eap_status_e set_buffer( |
58 const tls_peap_tlv_header_c * const original_header, |
79 const tls_peap_tlv_header_c * const original_header, |
59 u8_t *data_buffer, |
80 u8_t *data_buffer, |
60 const u32_t data_buffer_length, |
81 const u32_t data_buffer_length, |
61 const bool free_buffer, |
82 const bool free_buffer, |
62 const bool is_writable); |
83 const bool is_writable); |
63 |
84 |
64 EAP_FUNC_IMPORT eap_status_e set_copy_of_buffer( |
85 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H eap_status_e set_copy_of_buffer( |
65 const tls_peap_tlv_header_c * const original_header); |
86 const tls_peap_tlv_header_c * const original_header); |
66 |
87 |
67 //-------------------------------------------------- |
88 //-------------------------------------------------- |
68 }; // class peap_tlv_variable_data_c |
89 }; // class peap_tlv_variable_data_c |
69 |
90 |
70 |
91 |
71 //-------------------------------------------------- |
92 //-------------------------------------------------- |
72 |
93 |
73 |
94 |
74 // |
95 // |
75 class EAP_EXPORT peap_tlv_payloads_c |
96 class EAP_CLASS_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H peap_tlv_payloads_c |
76 { |
97 { |
77 private: |
98 private: |
78 //-------------------------------------------------- |
99 //-------------------------------------------------- |
79 |
100 |
80 abs_eap_am_tools_c * const m_am_tools; |
101 abs_eap_am_tools_c * const m_am_tools; |
106 peap_tlv_payload_status_must_be, |
127 peap_tlv_payload_status_must_be, |
107 peap_tlv_payload_status_must_not_be |
128 peap_tlv_payload_status_must_not_be |
108 }; |
129 }; |
109 |
130 |
110 |
131 |
111 EAP_FUNC_IMPORT virtual ~peap_tlv_payloads_c(); |
132 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H virtual ~peap_tlv_payloads_c(); |
112 |
133 |
113 EAP_FUNC_IMPORT peap_tlv_payloads_c( |
134 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H peap_tlv_payloads_c( |
114 abs_eap_am_tools_c * const tools); |
135 abs_eap_am_tools_c * const tools); |
115 |
136 |
116 EAP_FUNC_IMPORT bool check_one_payload( |
137 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H bool check_one_payload( |
117 const peap_tlv_payload_status_e status, |
138 const peap_tlv_payload_status_e status, |
118 const peap_tlv_variable_data_c * const payload); |
139 const peap_tlv_variable_data_c * const payload); |
119 |
140 |
120 /** This function checks the correct set of payloads are included in the message. |
141 /** This function checks the correct set of payloads are included in the message. |
121 * NOTE do not change the order of parameters. |
142 * NOTE do not change the order of parameters. |
122 * Add new payload type to the last of the parameter list. |
143 * Add new payload type to the last of the parameter list. |
123 */ |
144 */ |
124 EAP_FUNC_IMPORT bool check_payloads( |
145 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H bool check_payloads( |
125 const peap_tlv_payload_status_e result_tlv, |
146 const peap_tlv_payload_status_e result_tlv, |
126 const peap_tlv_payload_status_e nak_tlv, |
147 const peap_tlv_payload_status_e nak_tlv, |
127 const peap_tlv_payload_status_e crypto_binding_tlv, |
148 const peap_tlv_payload_status_e crypto_binding_tlv, |
128 const peap_tlv_payload_status_e eap_payload_tlv, |
149 const peap_tlv_payload_status_e eap_payload_tlv, |
129 const peap_tlv_payload_status_e intermediate_result_tlv |
150 const peap_tlv_payload_status_e intermediate_result_tlv |
130 ); |
151 ); |
131 |
152 |
132 EAP_FUNC_IMPORT peap_tlv_variable_data_c * get_result_tlv(); |
153 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H peap_tlv_variable_data_c * get_result_tlv(); |
133 |
154 |
134 EAP_FUNC_IMPORT peap_tlv_variable_data_c * get_nak_tlv(); |
155 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H peap_tlv_variable_data_c * get_nak_tlv(); |
135 |
156 |
136 EAP_FUNC_IMPORT peap_tlv_variable_data_c * get_crypto_binding_tlv(); |
157 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H peap_tlv_variable_data_c * get_crypto_binding_tlv(); |
137 |
158 |
138 EAP_FUNC_IMPORT peap_tlv_variable_data_c * get_eap_payload_tlv(); |
159 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H peap_tlv_variable_data_c * get_eap_payload_tlv(); |
139 |
160 |
140 EAP_FUNC_IMPORT peap_tlv_variable_data_c * get_intermediate_result_tlv(); |
161 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H peap_tlv_variable_data_c * get_intermediate_result_tlv(); |
141 |
162 |
142 EAP_FUNC_IMPORT void reset(); |
163 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H void reset(); |
143 |
164 |
144 EAP_FUNC_IMPORT bool get_is_valid() const; |
165 EAP_FUNC_VISIBILITY_TLS_PEAP_TLV_PAYLOADS_H bool get_is_valid() const; |
145 |
166 |
146 //-------------------------------------------------- |
167 //-------------------------------------------------- |
147 }; // class peap_tlv_payloads_c |
168 }; // class peap_tlv_payloads_c |
148 |
169 |
149 |
170 |