Project

General

Profile

strongswan.conf Reference » History » Version 1

Martin Willi, 18.04.2008 14:43

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 1 Martin Willi
== Syntax ==
10 1 Martin Willi
11 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:
12 1 Martin Willi
{{{
13 1 Martin Willi
settings := (section|keyvalue)*
14 1 Martin Willi
section  := name { settings }
15 1 Martin Willi
keyvalue := key = value\n
16 1 Martin Willi
}}}
17 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:
18 1 Martin Willi
{{{
19 1 Martin Willi
. { } # \n \t space
20 1 Martin Willi
}}}
21 1 Martin Willi
An example might look like this:
22 1 Martin Willi
{{{
23 1 Martin Willi
a = b
24 1 Martin Willi
section-one {
25 1 Martin Willi
  somevalue = asdf
26 1 Martin Willi
  subsection {
27 1 Martin Willi
    othervalue = xxx
28 1 Martin Willi
  }
29 1 Martin Willi
  # yei, a comment 
30 1 Martin Willi
  yetanother = zz
31 1 Martin Willi
}
32 1 Martin Willi
section-two {
33 1 Martin Willi
  x = 12
34 1 Martin Willi
}
35 1 Martin Willi
}}}
36 1 Martin Willi
Indentation is optional, you may use tabs or spaces.
37 1 Martin Willi
38 1 Martin Willi
== Reading values ==
39 1 Martin Willi
40 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'''.
41 1 Martin Willi
Have a look at the [source:trunk/src/libstrongswan/settings.h settings interface] how to query values.
42 1 Martin Willi
43 1 Martin Willi
== Defined keys ==
44 1 Martin Willi
The following keys are currently defined (using dot notation).
45 1 Martin Willi
46 1 Martin Willi
||charon.threads||Number of worker threads in charon||
47 1 Martin Willi
||charon.plugins.sql.database||Database URI for charons [wiki:SQL] plugin||
48 1 Martin Willi
||charon.plugins.sql.loglevel||Loglevel for logging to [wiki:SQL] database||
49 1 Martin Willi
||manager.socket||FastCGI socket of manager, to run it statically||
50 1 Martin Willi
||manager.debug||Enable debugging in manager||
51 1 Martin Willi
||manager.timeout||Session timeout for manager||
52 1 Martin Willi
||manager.threads||Threads to use for request handling||
53 1 Martin Willi
||manager.database||Database URI||