tncs.h revision 189261
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 program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 * 9 * Alternatively, this software may be distributed under the terms of BSD 10 * license. 11 * 12 * See README and COPYING for more details. 13 */ 14 15#ifndef TNCS_H 16#define TNCS_H 17 18struct tncs_data; 19 20struct tncs_data * tncs_init(void); 21void tncs_deinit(struct tncs_data *tncs); 22void tncs_init_connection(struct tncs_data *tncs); 23size_t tncs_total_send_len(struct tncs_data *tncs); 24u8 * tncs_copy_send_buf(struct tncs_data *tncs, u8 *pos); 25char * tncs_if_tnccs_start(struct tncs_data *tncs); 26char * tncs_if_tnccs_end(void); 27 28enum tncs_process_res { 29 TNCCS_PROCESS_ERROR = -1, 30 TNCCS_PROCESS_OK_NO_RECOMMENDATION = 0, 31 TNCCS_RECOMMENDATION_ERROR, 32 TNCCS_RECOMMENDATION_ALLOW, 33 TNCCS_RECOMMENDATION_NONE, 34 TNCCS_RECOMMENDATION_ISOLATE, 35 TNCCS_RECOMMENDATION_NO_ACCESS, 36 TNCCS_RECOMMENDATION_NO_RECOMMENDATION 37}; 38 39enum tncs_process_res tncs_process_if_tnccs(struct tncs_data *tncs, 40 const u8 *msg, size_t len); 41 42int tncs_global_init(void); 43void tncs_global_deinit(void); 44 45struct wpabuf * tncs_build_soh_request(void); 46struct wpabuf * tncs_process_soh(const u8 *soh_tlv, size_t soh_tlv_len, 47 int *failure); 48 49#endif /* TNCS_H */ 50