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