4 * @brief Interface for a specific IKE_SA state
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
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>.
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
26 #include "../definitions.h"
28 #include "../message.h"
31 * States in which a IKE_SA can actually be
33 typedef enum ike_sa_state_e ike_sa_state_t
;
38 * IKE_SA is is not in a state as initiator
43 * IKE_SA is is not in a state as responder
48 * A IKE_SA_INIT-message was sent: role initiator
50 IKE_SA_INIT_REQUESTED
= 3,
53 * A IKE_SA_INIT-message was replied: role responder
55 IKE_SA_INIT_RESPONDED
= 4,
58 * An IKE_AUTH-message was sent after a successful
59 * IKE_SA_INIT-exchange: role initiator
61 IKE_AUTH_REQUESTED
= 5,
64 * An IKE_AUTH-message was replied: role responder.
65 * In this state, all the informations for an IKE_SA
66 * and one CHILD_SA are known.
68 IKE_SA_INITIALIZED
= 6
72 * @brief This interface represents an IKE_SA state
75 typedef struct state_s state_t
;
80 * @brief Processes a incoming IKEv2-Message of type message_t
82 * @param this state_t object
83 * @param[in] message message_t object to process
84 * @param this state_t pointer to the new state_t object
86 * - SUCCESSFUL if succeeded
89 status_t (*process_message
) (state_t
*this,message_t
*message
,state_t
**new_state
);
93 * @brief Get the current state
95 * @param this state_t object
98 ike_sa_state_t (*get_state
) (state_t
*this);
101 * @brief Destroys a state_t object
103 * @param this state_t object
104 * @return SUCCESS in any case
106 status_t (*destroy
) (state_t
*this);