[strongSwan] Parsing strongswan.conf in starter

Martin Willi martin at strongswan.org
Mon May 12 16:22:44 CEST 2014


> Okay, so lib->settings->get_* returns a string then.

get_str() does. There are other methods, such as 
get_bool, get_int, get_double or get_time performing type conversions.
Refer to [1] for details.

> To implement the thing I want, I need to introduce a new parameter in
> strongswan.conf. That means, that I also need to touch the settings_t
> class and implement a method to grab the value from the parameter,
> right?

No. To simplify introducing new options, the parser does not know the
specific option keywords. You won't have to extend the parser. Just pass
a key using "dot-notation" to get_*() to select a section, subsections
and key. [2] has some more information.

Regards
Martin

[1]http://git.strongswan.org/?p=strongswan.git;a=blob;f=src/libstrongswan/utils/settings.h
[2]http://wiki.strongswan.org/projects/strongswan/wiki/StrongswanConf#Reading-values



More information about the Users mailing list