acbbb37815e80834ee6c60c912e31cca0175000e
[strongswan.git] / src / charon / sa / states / ike_sa_established.c
1 /**
2 * @file ike_sa_established.c
3 *
4 * @brief Implementation of ike_sa_established_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 #include "ike_sa_established.h"
24
25 #include <daemon.h>
26 #include <encoding/payloads/delete_payload.h>
27
28
29 typedef struct private_ike_sa_established_t private_ike_sa_established_t;
30
31 /**
32 * Private data of a ike_sa_established_t object.
33 */
34 struct private_ike_sa_established_t {
35 /**
36 * methods of the state_t interface
37 */
38 ike_sa_established_t public;
39
40 /**
41 * Assigned IKE_SA.
42 */
43 protected_ike_sa_t *ike_sa;
44
45 /**
46 * Assigned logger. Use logger of IKE_SA.
47 */
48 logger_t *logger;
49 };
50
51
52 /**
53 * Implements state_t.get_state
54 */
55 static status_t process_message(private_ike_sa_established_t *this, message_t *message)
56 {
57
58 }
59
60 /**
61 * Implementation of state_t.get_state.
62 */
63 static ike_sa_state_t get_state(private_ike_sa_established_t *this)
64 {
65 return IKE_SA_ESTABLISHED;
66 }
67
68 /**
69 * Implementation of state_t.get_state
70 */
71 static void destroy(private_ike_sa_established_t *this)
72 {
73 free(this);
74 }
75
76 /*
77 * Described in header.
78 */
79 ike_sa_established_t *ike_sa_established_create(protected_ike_sa_t *ike_sa)
80 {
81 private_ike_sa_established_t *this = malloc_thing(private_ike_sa_established_t);
82
83 /* interface functions */
84 this->public.state_interface.process_message = (status_t (*) (state_t *,message_t *)) process_message;
85 this->public.state_interface.get_state = (ike_sa_state_t (*) (state_t *)) get_state;
86 this->public.state_interface.destroy = (void (*) (state_t *)) destroy;
87
88 /* private data */
89 this->ike_sa = ike_sa;
90 this->logger = logger_manager->get_logger(logger_manager, IKE_SA);
91
92 return &(this->public);
93 }