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