14 * Description: EAP and WLAN authentication protocols. |
14 * Description: EAP and WLAN authentication protocols. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 /* |
18 /* |
19 * %version: % |
19 * %version: 3.1.2 % |
20 */ |
20 */ |
21 |
21 |
22 #if !defined(_GSMSIM_HEADER_H_) |
22 #if !defined(_GSMSIM_HEADER_H_) |
23 #define _GSMSIM_HEADER_H_ |
23 #define _GSMSIM_HEADER_H_ |
24 |
24 |
|
25 #include "eap_am_export.h" |
|
26 // Start: added by script change_export_macros.sh. |
|
27 #if defined(EAP_NO_EXPORT_EAP_TYPE_GSMSIM_HEADER_H) |
|
28 #define EAP_CLASS_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H EAP_NONSHARABLE |
|
29 #define EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H |
|
30 #define EAP_C_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H |
|
31 #define EAP_FUNC_EXPORT_EAP_TYPE_GSMSIM_HEADER_H |
|
32 #define EAP_C_FUNC_EXPORT_EAP_TYPE_GSMSIM_HEADER_H |
|
33 #elif defined(EAP_EXPORT_EAP_TYPE_GSMSIM_HEADER_H) |
|
34 #define EAP_CLASS_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H EAP_EXPORT |
|
35 #define EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H EAP_FUNC_EXPORT |
|
36 #define EAP_C_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H EAP_C_FUNC_EXPORT |
|
37 #define EAP_FUNC_EXPORT_EAP_TYPE_GSMSIM_HEADER_H EAP_FUNC_EXPORT |
|
38 #define EAP_C_FUNC_EXPORT_EAP_TYPE_GSMSIM_HEADER_H EAP_C_FUNC_EXPORT |
|
39 #else |
|
40 #define EAP_CLASS_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H EAP_IMPORT |
|
41 #define EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H EAP_FUNC_IMPORT |
|
42 #define EAP_C_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H EAP_C_FUNC_IMPORT |
|
43 #define EAP_FUNC_EXPORT_EAP_TYPE_GSMSIM_HEADER_H |
|
44 #define EAP_C_FUNC_EXPORT_EAP_TYPE_GSMSIM_HEADER_H |
|
45 #endif |
|
46 // End: added by script change_export_macros.sh. |
25 #include "eap_tools.h" |
47 #include "eap_tools.h" |
26 #include "eap_header.h" |
48 #include "eap_header.h" |
27 #include "eap_type_gsmsim_types.h" |
49 #include "eap_type_gsmsim_types.h" |
28 |
50 |
29 /** @file */ |
51 /** @file */ |
74 //-------------------------------------------------- |
96 //-------------------------------------------------- |
75 public: |
97 public: |
76 //-------------------------------------------------- |
98 //-------------------------------------------------- |
77 |
99 |
78 // |
100 // |
79 EAP_FUNC_IMPORT virtual ~gsmsim_payload_AT_header_c(); |
101 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H virtual ~gsmsim_payload_AT_header_c(); |
80 |
102 |
81 // |
103 // |
82 EAP_FUNC_IMPORT gsmsim_payload_AT_header_c( |
104 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H gsmsim_payload_AT_header_c( |
83 abs_eap_am_tools_c * const tools, |
105 abs_eap_am_tools_c * const tools, |
84 void * const header_buffer, |
106 void * const header_buffer, |
85 const u32_t header_buffer_length); |
107 const u32_t header_buffer_length); |
86 |
108 |
87 EAP_FUNC_IMPORT gsmsim_payload_AT_type_e get_current_payload() const; |
109 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H gsmsim_payload_AT_type_e get_current_payload() const; |
88 |
110 |
89 EAP_FUNC_IMPORT u16_t get_payload_length() const; |
111 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u16_t get_payload_length() const; |
90 |
112 |
91 EAP_FUNC_IMPORT u16_t get_reserved() const; |
113 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u16_t get_reserved() const; |
92 |
114 |
93 EAP_FUNC_IMPORT u32_t get_data_length() const; |
115 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u32_t get_data_length() const; |
94 |
116 |
95 EAP_FUNC_IMPORT static u16_t get_header_length(); |
117 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H static u16_t get_header_length(); |
96 |
118 |
97 EAP_FUNC_IMPORT static u16_t get_max_payload_data_length(); |
119 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H static u16_t get_max_payload_data_length(); |
98 |
120 |
99 EAP_FUNC_IMPORT u8_t * get_data(const u32_t contignuous_bytes) const; |
121 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u8_t * get_data(const u32_t contignuous_bytes) const; |
100 |
122 |
101 EAP_FUNC_IMPORT u8_t * get_data_offset(const u32_t offset, const u32_t contignuous_bytes) const; |
123 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u8_t * get_data_offset(const u32_t offset, const u32_t contignuous_bytes) const; |
102 |
124 |
103 EAP_FUNC_IMPORT u8_t * get_next_header() const; |
125 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u8_t * get_next_header() const; |
104 |
126 |
105 // Mostly this is zero. |
127 // Mostly this is zero. |
106 // With some attributes this is used for special purposes. |
128 // With some attributes this is used for special purposes. |
107 EAP_FUNC_IMPORT void set_reserved(const u16_t reserved); |
129 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H void set_reserved(const u16_t reserved); |
108 |
130 |
109 EAP_FUNC_IMPORT void set_current_payload(const gsmsim_payload_AT_type_e p_current_payload); |
131 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H void set_current_payload(const gsmsim_payload_AT_type_e p_current_payload); |
110 |
132 |
111 EAP_FUNC_IMPORT void set_data_length(const u16_t p_data_length); |
133 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H void set_data_length(const u16_t p_data_length); |
112 |
134 |
113 EAP_FUNC_IMPORT void reset_header(const u16_t data_length); |
135 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H void reset_header(const u16_t data_length); |
114 |
136 |
115 EAP_FUNC_IMPORT static eap_const_string get_payload_AT_string(const gsmsim_payload_AT_type_e payload_type); |
137 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H static eap_const_string get_payload_AT_string(const gsmsim_payload_AT_type_e payload_type); |
116 |
138 |
117 EAP_FUNC_IMPORT eap_const_string get_payload_AT_string() const; |
139 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H eap_const_string get_payload_AT_string() const; |
118 |
140 |
119 EAP_FUNC_IMPORT eap_status_e check_header() const; |
141 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H eap_status_e check_header() const; |
120 |
142 |
121 // |
143 // |
122 //-------------------------------------------------- |
144 //-------------------------------------------------- |
123 }; // class gsmsim_payload_AT_header_c |
145 }; // class gsmsim_payload_AT_header_c |
124 |
146 |
163 //-------------------------------------------------- |
185 //-------------------------------------------------- |
164 public: |
186 public: |
165 //-------------------------------------------------- |
187 //-------------------------------------------------- |
166 |
188 |
167 // |
189 // |
168 EAP_FUNC_IMPORT virtual ~gsmsim_header_c(); |
190 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H virtual ~gsmsim_header_c(); |
169 |
191 |
170 // |
192 // |
171 EAP_FUNC_IMPORT gsmsim_header_c( |
193 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H gsmsim_header_c( |
172 abs_eap_am_tools_c * const tools, |
194 abs_eap_am_tools_c * const tools, |
173 u8_t * const header_buffer, |
195 u8_t * const header_buffer, |
174 const u32_t header_buffer_length); |
196 const u32_t header_buffer_length); |
175 |
197 |
176 EAP_FUNC_IMPORT gsmsim_subtype_e get_subtype() const; |
198 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H gsmsim_subtype_e get_subtype() const; |
177 |
199 |
178 EAP_FUNC_IMPORT u16_t get_data_length() const; |
200 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u16_t get_data_length() const; |
179 |
201 |
180 /// This returns the length of EAP-header, EAP-type, subtype and reserved fields. |
202 /// This returns the length of EAP-header, EAP-type, subtype and reserved fields. |
181 EAP_FUNC_IMPORT u32_t get_header_length() const; |
203 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u32_t get_header_length() const; |
182 |
204 |
183 EAP_FUNC_IMPORT u32_t get_sub_type_offset() const; |
205 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u32_t get_sub_type_offset() const; |
184 |
206 |
185 EAP_FUNC_IMPORT u8_t * get_data_offset(const u32_t offset, const u32_t contignuous_bytes) const; |
207 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u8_t * get_data_offset(const u32_t offset, const u32_t contignuous_bytes) const; |
186 |
208 |
187 EAP_FUNC_IMPORT u8_t * get_data(const u32_t contignuous_bytes) const; |
209 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u8_t * get_data(const u32_t contignuous_bytes) const; |
188 |
210 |
189 EAP_FUNC_IMPORT u16_t get_reserved() const; |
211 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H u16_t get_reserved() const; |
190 |
212 |
191 EAP_FUNC_IMPORT eap_status_e check_header() const; |
213 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H eap_status_e check_header() const; |
192 |
214 |
193 EAP_FUNC_IMPORT eap_const_string get_subtype_string() const; |
215 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H eap_const_string get_subtype_string() const; |
194 |
216 |
195 EAP_FUNC_IMPORT eap_const_string get_code_string() const; |
217 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H eap_const_string get_code_string() const; |
196 |
218 |
197 EAP_FUNC_IMPORT eap_const_string get_eap_type_string() const; |
219 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H eap_const_string get_eap_type_string() const; |
198 |
220 |
199 EAP_FUNC_IMPORT void set_reserved(const u16_t reserved); |
221 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H void set_reserved(const u16_t reserved); |
200 |
222 |
201 EAP_FUNC_IMPORT void set_subtype(const gsmsim_subtype_e p_subtype); |
223 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H void set_subtype(const gsmsim_subtype_e p_subtype); |
202 |
224 |
203 EAP_FUNC_IMPORT void set_data_length( |
225 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H void set_data_length( |
204 const u32_t p_data_length, |
226 const u32_t p_data_length, |
205 const bool expanded_type_when_true); |
227 const bool expanded_type_when_true); |
206 |
228 |
207 EAP_FUNC_IMPORT void reset_header( |
229 EAP_FUNC_VISIBILITY_EAP_TYPE_GSMSIM_HEADER_H void reset_header( |
208 const u32_t buffer_length, |
230 const u32_t buffer_length, |
209 const bool expanded_type_when_true); |
231 const bool expanded_type_when_true); |
210 |
232 |
211 // |
233 // |
212 //-------------------------------------------------- |
234 //-------------------------------------------------- |