Added add_segment() method to IETF attributes
[strongswan.git] / src / libimcv / plugins / imv_test / imv_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 * @defgroup imv_test imv_test
17 * @ingroup libimcv_plugins
18 *
19 * @defgroup imv_test_state_t imv_test_state
20 * @{ @ingroup imv_test
21 */
22
23 #ifndef IMV_TEST_STATE_H_
24 #define IMV_TEST_STATE_H_
25
26 #include <imv/imv_state.h>
27 #include <library.h>
28
29 typedef struct imv_test_state_t imv_test_state_t;
30
31 /**
32 * Internal state of an imv_test_t connection instance
33 */
34 struct imv_test_state_t {
35
36 /**
37 * imv_state_t interface
38 */
39 imv_state_t interface;
40
41 /**
42 * Add an IMC
43 *
44 * @param imc_id ID of the IMC to be added
45 * @param rounds number of re-measurement rounds
46 */
47 void (*add_imc)(imv_test_state_t *this, TNC_UInt32 imc_id, int rounds);
48
49 /**
50 * Set the IMC-IMV round-trip count
51 *
52 * @param rounds number of re-measurement rounds
53 */
54 void (*set_rounds)(imv_test_state_t *this, int rounds);
55
56 /**
57 * Check and decrease IMC-IMV round-trip count
58 *
59 * @param imc_id ID of the IMC to be checked
60 * @return new connection state
61 */
62 bool (*another_round)(imv_test_state_t *this, TNC_UInt32 imc_id);
63 };
64
65 /**
66 * Create an imv_test_state_t instance
67 *
68 * @param id connection ID
69 */
70 imv_state_t* imv_test_state_create(TNC_ConnectionID id);
71
72 #endif /** IMV_TEST_STATE_H_ @}*/