8ed5de9a524768474027fe6ffc62c3650219e7b7
[strongswan.git] / src / pluto / modecfg.h
1 /* Mode Config related functions
2 * Copyright (C) 2001-2002 Colubris Networks
3 * Copyright (C) 2003-2004 Xelerance Corporation
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 #ifndef _MODECFG_H
17 #define _MODECFG_H
18
19 #include <chunk.h>
20 #include <attributes/attribute_handler.h>
21
22 #include "state.h"
23 #include "demux.h"
24
25 typedef struct modecfg_attribute_t modecfg_attribute_t;
26
27 /**
28 * Defines a modecfg_attribute_t object.
29 */
30 struct modecfg_attribute_t {
31 /**
32 * Type of the attribute.
33 */
34 u_int16_t type;
35
36 /**
37 * Attribute value as chunk.
38 */
39 chunk_t value;
40
41 /**
42 * Attribute handler.
43 */
44 attribute_handler_t *handler;
45 };
46
47 /* Destroys a modecfg_attribute_t object */
48 extern void modecfg_attribute_destroy(modecfg_attribute_t *this);
49
50 /* ModeConfig pull mode start function */
51 extern stf_status modecfg_send_request(struct state *st);
52
53 /* ModeConfig pull mode state transition functions */
54 extern stf_status modecfg_inR0(struct msg_digest *md);
55 extern stf_status modecfg_inI1(struct msg_digest *md);
56
57 /* ModeConfig push mode start function */
58 extern stf_status modecfg_send_set(struct state *st);
59
60 /* ModeConfig push mode state transition functions */
61 extern stf_status modecfg_inI0(struct msg_digest *md);
62 extern stf_status modecfg_inR3(struct msg_digest *md);
63
64 /* XAUTH start function */
65 extern stf_status xauth_send_request(struct state *st);
66
67 /* XAUTH state transition funcgtions */
68 extern stf_status xauth_inI0(struct msg_digest *md);
69 extern stf_status xauth_inR1(struct msg_digest *md);
70 extern stf_status xauth_inI1(struct msg_digest *md);
71 extern stf_status xauth_inR2(struct msg_digest *md);
72
73 #endif /* _MODECFG_H */