- code cleaned
[strongswan.git] / Source / charon / sa / states / initiator_init.h
1 /**
2 * @file initiator_init.h
3 *
4 * @brief Interface of initiator_init_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23
24 #ifndef INITIATOR_INIT_H_
25 #define INITIATOR_INIT_H_
26
27 #include <sa/ike_sa.h>
28 #include <sa/states/state.h>
29
30
31 typedef struct initiator_init_t initiator_init_t;
32
33 /**
34 * @brief This class represents an IKE_SA state when
35 * initializing a connection as initiator.
36 *
37 * @b Constructors:
38 * - initiator_init_create()
39 *
40 * @ingroup states
41 */
42 struct initiator_init_t {
43 /**
44 * The state_t interface.
45 */
46 state_t state_interface;
47
48 /**
49 * Initiate a new connection with given configuration name.
50 *
51 * @param this calling object
52 * @param name name of the configuration
53 * @return
54 * - SUCCESS
55 * - DELETE_ME if something failed (see log for error)
56 */
57 status_t (*initiate_connection) (initiator_init_t *this, char *name);
58
59 /**
60 * Retry to initiate a new connection with a specific dh_group_priority.
61 *
62 * The dh_group_priority is starting at 1.
63 *
64 * @param this calling object
65 * @param dh_group_priority dh group priority to try with
66 * @return
67 * - SUCCESS
68 * - DELETE_ME if something failed (see log for error)
69 */
70 status_t (*retry_initiate_connection) (initiator_init_t *this, int dh_group_priority);
71 };
72
73 /**
74 * @brief Constructor of class initiator_init_t.
75 *
76 * @param ike_sa assigned IKE_SA
77 * @return created initiator_init_t object
78 *
79 * @ingroup states
80 */
81 initiator_init_t *initiator_init_create(protected_ike_sa_t *ike_sa);
82
83
84 #endif /*INITIATOR_INIT_H_*/