Annotation of embedaddon/strongswan/src/libcharon/sa/ikev2/tasks/ike_dpd.c, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (C) 2007 Martin Willi
3: * HSR Hochschule fuer Technik Rapperswil
4: *
5: * This program is free software; you can redistribute it and/or modify it
6: * under the terms of the GNU General Public License as published by the
7: * Free Software Foundation; either version 2 of the License, or (at your
8: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9: *
10: * This program is distributed in the hope that it will be useful, but
11: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13: * for more details.
14: */
15:
16: #include "ike_dpd.h"
17:
18: #include <daemon.h>
19:
20:
21: typedef struct private_ike_dpd_t private_ike_dpd_t;
22:
23: /**
24: * Private members of a ike_dpd_t task.
25: */
26: struct private_ike_dpd_t {
27:
28: /**
29: * Public methods and task_t interface.
30: */
31: ike_dpd_t public;
32: };
33:
34: METHOD(task_t, return_need_more, status_t,
35: private_ike_dpd_t *this, message_t *message)
36: {
37: return NEED_MORE;
38: }
39:
40: METHOD(task_t, get_type, task_type_t,
41: private_ike_dpd_t *this)
42: {
43: return TASK_IKE_DPD;
44: }
45:
46:
47: METHOD(task_t, migrate, void,
48: private_ike_dpd_t *this, ike_sa_t *ike_sa)
49: {
50:
51: }
52:
53: METHOD(task_t, destroy, void,
54: private_ike_dpd_t *this)
55: {
56: free(this);
57: }
58:
59: /*
60: * Described in header.
61: */
62: ike_dpd_t *ike_dpd_create(bool initiator)
63: {
64: private_ike_dpd_t *this;
65:
66: INIT(this,
67: .public = {
68: .task = {
69: .get_type = _get_type,
70: .migrate = _migrate,
71: .destroy = _destroy,
72: },
73: },
74: );
75:
76: if (initiator)
77: {
78: this->public.task.build = _return_need_more;
79: this->public.task.process = (void*)return_success;
80: }
81: else
82: {
83: this->public.task.build = (void*)return_success;
84: this->public.task.process = _return_need_more;
85: }
86:
87: return &this->public;
88: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>