strongswan.conf Reference » History » Version 3
Tobias Brunner, 18.04.2008 15:24
hash and url added
1 | 1 | Martin Willi | = strongswan.conf = |
---|---|---|---|
2 | 1 | Martin Willi | |
3 | 1 | Martin Willi | == Overview == |
4 | 1 | Martin Willi | |
5 | 1 | Martin Willi | While the [wiki:IpsecConf ipsec.conf] configuration file is well suited to define IPsec related configuration parameters, it is not useful for other strongSwan applications to read options from this file. The file is hard to parse and only starter is capable of doing so. |
6 | 1 | Martin Willi | |
7 | 1 | Martin Willi | As the number of components of the strongSwan project is growing, we need a more flexible configuration file, easy to extend and useable by all components. The configuration format uses hierarchal sections and a list of key/value pairs in each section. |
8 | 1 | Martin Willi | |
9 | 2 | Martin Willi | Since 4.2.1, a default strongswan.conf gets installed in your sysconfdir, e.g. ''/etc/strongswan.conf''. |
10 | 2 | Martin Willi | |
11 | 1 | Martin Willi | == Syntax == |
12 | 1 | Martin Willi | |
13 | 1 | Martin Willi | Each section has a name, followed by C-Style curly brackets defining the sections body. Each section body contains a set of subsections and key/value pairs: |
14 | 1 | Martin Willi | {{{ |
15 | 1 | Martin Willi | settings := (section|keyvalue)* |
16 | 1 | Martin Willi | section := name { settings } |
17 | 1 | Martin Willi | keyvalue := key = value\n |
18 | 1 | Martin Willi | }}} |
19 | 1 | Martin Willi | Values must be terminated by a newline. Comments are possible using the #-character, but be careful: The parser implementation is currently limited and does not like brackets in comments. Section names and keys may contain any printable character except: |
20 | 1 | Martin Willi | {{{ |
21 | 1 | Martin Willi | . { } # \n \t space |
22 | 1 | Martin Willi | }}} |
23 | 1 | Martin Willi | An example might look like this: |
24 | 1 | Martin Willi | {{{ |
25 | 1 | Martin Willi | a = b |
26 | 1 | Martin Willi | section-one { |
27 | 1 | Martin Willi | somevalue = asdf |
28 | 1 | Martin Willi | subsection { |
29 | 1 | Martin Willi | othervalue = xxx |
30 | 1 | Martin Willi | } |
31 | 1 | Martin Willi | # yei, a comment |
32 | 1 | Martin Willi | yetanother = zz |
33 | 1 | Martin Willi | } |
34 | 1 | Martin Willi | section-two { |
35 | 1 | Martin Willi | x = 12 |
36 | 1 | Martin Willi | } |
37 | 1 | Martin Willi | }}} |
38 | 1 | Martin Willi | Indentation is optional, you may use tabs or spaces. |
39 | 1 | Martin Willi | |
40 | 1 | Martin Willi | == Reading values == |
41 | 1 | Martin Willi | |
42 | 1 | Martin Willi | The config file is read by libstrongswan during library initialization. Values are accessed using a dot-separated section list and a key: Accessing '''section-one.subsection.othervalue''' will return '''xxx'''. |
43 | 1 | Martin Willi | Have a look at the [source:trunk/src/libstrongswan/settings.h settings interface] how to query values. |
44 | 1 | Martin Willi | |
45 | 1 | Martin Willi | == Defined keys == |
46 | 1 | Martin Willi | The following keys are currently defined (using dot notation). |
47 | 1 | Martin Willi | |
48 | 1 | Martin Willi | ||charon.threads||Number of worker threads in charon|| |
49 | 1 | Martin Willi | ||charon.plugins.sql.database||Database URI for charons [wiki:SQL] plugin|| |
50 | 1 | Martin Willi | ||charon.plugins.sql.loglevel||Loglevel for logging to [wiki:SQL] database|| |
51 | 3 | Tobias Brunner | ||charon.hash_and_url||Enable hash and URL support|| |
52 | 1 | Martin Willi | ||manager.socket||FastCGI socket of manager, to run it statically|| |
53 | 1 | Martin Willi | ||manager.debug||Enable debugging in manager|| |
54 | 1 | Martin Willi | ||manager.timeout||Session timeout for manager|| |
55 | 1 | Martin Willi | ||manager.threads||Threads to use for request handling|| |
56 | 1 | Martin Willi | ||manager.database||Database URI|| |