2 * @file responder_init.c
4 * @brief Start state of a IKE_SA as responder
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 "responder_init.h"
25 #include "../utils/allocator.h"
28 * Private data of a responder_init_t object.
31 typedef struct private_responder_init_s private_responder_init_t
;
32 struct private_responder_init_s
{
34 * methods of the state_t interface
36 responder_init_t
public;
41 * Implements state_t.get_state
43 static status_t
process_message(private_responder_init_t
*this, message_t
*message
, state_t
**new_state
)
45 *new_state
= (state_t
*) this;
50 * Implements state_t.get_state
52 static ike_sa_state_t
get_state(private_responder_init_t
*this)
54 return INITIATOR_INIT
;
58 * Implements state_t.get_state
60 static status_t
destroy(private_responder_init_t
*this)
67 * Described in header.
69 responder_init_t
*responder_init_create()
71 private_responder_init_t
*this = allocator_alloc_thing(private_responder_init_t
);
78 /* interface functions */
79 this->public.state_interface
.process_message
= (status_t (*) (state_t
*,message_t
*,state_t
**)) process_message
;
80 this->public.state_interface
.get_state
= (ike_sa_state_t (*) (state_t
*)) get_state
;
81 this->public.state_interface
.destroy
= (status_t (*) (state_t
*)) destroy
;
83 return &(this->public);