aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server/tncs.h
blob: 18a3a1fa3c4749166080294f5e89729dc1e737fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * EAP-TNC - TNCS (IF-IMV, IF-TNCCS, and IF-TNCCS-SOH)
 * Copyright (c) 2007-2008, Jouni Malinen <j@w1.fi>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * Alternatively, this software may be distributed under the terms of BSD
 * license.
 *
 * See README and COPYING for more details.
 */

#ifndef TNCS_H
#define TNCS_H

struct tncs_data;

struct tncs_data * tncs_init(void);
void tncs_deinit(struct tncs_data *tncs);
void tncs_init_connection(struct tncs_data *tncs);
size_t tncs_total_send_len(struct tncs_data *tncs);
u8 * tncs_copy_send_buf(struct tncs_data *tncs, u8 *pos);
char * tncs_if_tnccs_start(struct tncs_data *tncs);
char * tncs_if_tnccs_end(void);

enum tncs_process_res {
	TNCCS_PROCESS_ERROR = -1,
	TNCCS_PROCESS_OK_NO_RECOMMENDATION = 0,
	TNCCS_RECOMMENDATION_ERROR,
	TNCCS_RECOMMENDATION_ALLOW,
	TNCCS_RECOMMENDATION_NONE,
	TNCCS_RECOMMENDATION_ISOLATE,
	TNCCS_RECOMMENDATION_NO_ACCESS,
	TNCCS_RECOMMENDATION_NO_RECOMMENDATION
};

enum tncs_process_res tncs_process_if_tnccs(struct tncs_data *tncs,
					    const u8 *msg, size_t len);

int tncs_global_init(void);
void tncs_global_deinit(void);

struct wpabuf * tncs_build_soh_request(void);
struct wpabuf * tncs_process_soh(const u8 *soh_tlv, size_t soh_tlv_len,
				 int *failure);

#endif /* TNCS_H */