2 * @file ike_auth_requested.c
4 * @brief State of an IKE_SA, which has requested an IKE_AUTH.
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
23 #include "ike_auth_requested.h"
25 #include <utils/allocator.h>
28 typedef struct private_ike_auth_requested_t private_ike_auth_requested_t
;
31 * Private data of a ike_auth_requested_t object.
34 struct private_ike_auth_requested_t
{
36 * methods of the state_t interface
38 ike_auth_requested_t
public;
44 protected_ike_sa_t
*ike_sa
;
48 * Implements state_t.get_state
50 static status_t
process_message(private_ike_auth_requested_t
*this, message_t
*message
, state_t
**new_state
)
52 *new_state
= (state_t
*) this;
57 * Implements state_t.get_state
59 static ike_sa_state_t
get_state(private_ike_auth_requested_t
*this)
61 return IKE_AUTH_REQUESTED
;
65 * Implements state_t.get_state
67 static status_t
destroy(private_ike_auth_requested_t
*this)
74 * Described in header.
76 ike_auth_requested_t
*ike_auth_requested_create(protected_ike_sa_t
*ike_sa
)
78 private_ike_auth_requested_t
*this = allocator_alloc_thing(private_ike_auth_requested_t
);
85 /* interface functions */
86 this->public.state_interface
.process_message
= (status_t (*) (state_t
*,message_t
*,state_t
**)) process_message
;
87 this->public.state_interface
.get_state
= (ike_sa_state_t (*) (state_t
*)) get_state
;
88 this->public.state_interface
.destroy
= (status_t (*) (state_t
*)) destroy
;
91 this->ike_sa
= ike_sa
;
93 return &(this->public);