starter: Use automake LEX/YACC automatisms.
[strongswan.git] / src / starter / ipsec-parser.h
1 /* strongSwan config file parser
2 * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 */
14
15 #ifndef _IPSEC_PARSER_H_
16 #define _IPSEC_PARSER_H_
17
18 #include "keywords.h"
19
20 typedef struct kw_entry kw_entry_t;
21
22 struct kw_entry {
23 char *name;
24 kw_token_t token;
25 };
26
27 typedef struct kw_list kw_list_t;
28
29 struct kw_list {
30 kw_entry_t *entry;
31 char *value;
32 kw_list_t *next;
33 };
34
35 typedef struct section_list section_list_t;
36
37 struct section_list {
38 char *name;
39 kw_list_t *kw;
40 section_list_t *next;
41 };
42
43 typedef struct config_parsed config_parsed_t;
44
45 struct config_parsed {
46 kw_list_t *config_setup;
47 section_list_t *conn_first, *conn_last;
48 section_list_t *ca_first, *ca_last;
49 };
50
51 config_parsed_t *parser_load_conf (const char *file);
52 void parser_free_conf (config_parsed_t *cfg);
53
54 #endif /* _IPSEC_PARSER_H_ */
55