implemented handshake retry on the client side
[strongswan.git] / src / libimcv / plugins / imc_test / imc_test_state.h
1 /*
2 * Copyright (C) 2011 Andreas Steffen, HSR Hochschule fuer Technik Rapperswil
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 */
14
15 /**
16 *
17 * @defgroup imc_test_state_t imc_test_state
18 * @{ @ingroup imc_test_state
19 */
20
21 #ifndef IMC_TEST_STATE_H_
22 #define IMC_TEST_STATE_H_
23
24 #include <imc/imc_state.h>
25 #include <library.h>
26
27 typedef struct imc_test_state_t imc_test_state_t;
28
29 /**
30 * Internal state of an imc_test_t connection instance
31 */
32 struct imc_test_state_t {
33
34 /**
35 * imc_state_t interface
36 */
37 imc_state_t interface;
38
39 /**
40 * get the command to send to IMV
41 *
42 * @return commmand to send to IMV
43 */
44 char* (*get_command)(imc_test_state_t *this);
45
46 /**
47 * set the command to send to IMV
48 *
49 * @param command commmand to send to IMV
50 */
51 void (*set_command)(imc_test_state_t *this, char *command);
52
53 /**
54 * Test and reset the retry handshake flag
55 *
56 * @return TRUE if a handshake retry should be done
57 */
58 bool (*do_handshake_retry)(imc_test_state_t *this);
59 };
60
61 /**
62 * Create an imc_test_state_t instance
63 *
64 * @param id connection ID
65 * @param command command to send to IMV
66 * @param retry TRUE if a handshake retry should be done
67 */
68 imc_state_t* imc_test_state_create(TNC_ConnectionID id, char* command,
69 bool retry);
70
71 #endif /** IMC_TEST_STATE_H_ @}*/