xref: /freebsd/contrib/wpa/src/eap_server/tncs.h (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1 /*
2  * EAP-TNC - TNCS (IF-IMV, IF-TNCCS, and IF-TNCCS-SOH)
3  * Copyright (c) 2007-2008, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef TNCS_H
10 #define TNCS_H
11 
12 struct tncs_data;
13 
14 struct tncs_data * tncs_init(void);
15 void tncs_deinit(struct tncs_data *tncs);
16 void tncs_init_connection(struct tncs_data *tncs);
17 size_t tncs_total_send_len(struct tncs_data *tncs);
18 u8 * tncs_copy_send_buf(struct tncs_data *tncs, u8 *pos);
19 char * tncs_if_tnccs_start(struct tncs_data *tncs);
20 char * tncs_if_tnccs_end(void);
21 
22 enum tncs_process_res {
23 	TNCCS_PROCESS_ERROR = -1,
24 	TNCCS_PROCESS_OK_NO_RECOMMENDATION = 0,
25 	TNCCS_RECOMMENDATION_ERROR,
26 	TNCCS_RECOMMENDATION_ALLOW,
27 	TNCCS_RECOMMENDATION_NONE,
28 	TNCCS_RECOMMENDATION_ISOLATE,
29 	TNCCS_RECOMMENDATION_NO_ACCESS,
30 	TNCCS_RECOMMENDATION_NO_RECOMMENDATION
31 };
32 
33 enum tncs_process_res tncs_process_if_tnccs(struct tncs_data *tncs,
34 					    const u8 *msg, size_t len);
35 
36 int tncs_global_init(void);
37 void tncs_global_deinit(void);
38 
39 struct wpabuf * tncs_build_soh_request(void);
40 struct wpabuf * tncs_process_soh(const u8 *soh_tlv, size_t soh_tlv_len,
41 				 int *failure);
42 
43 #endif /* TNCS_H */
44