aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/settings
Commit message (Collapse)AuthorAgeFilesLines
* utils: Add helper function to parse time spans from stringsTobias Brunner2017-11-021-34/+4
|
* settings: Fix possible undefined behavior with va_start() and boolTobias Brunner2017-09-182-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes compilation with -Werror when using Clang 4.0 (but not 3.9) and possibly prevents undefined behavior. According to the C standard the following applies to the second parameter of the va_start() macro (subclause 7.16.1.4, paragraph 4): The parameter parmN is the identifier of the rightmost parameter in the variable parameter list in the function definition (the one just before the ...). If the parameter parmN is declared with the register storage class, with a function or array type, or with a type that is not compatible with the type that results after application of the default argument promotions, the behavior is undefined. Because bool is usually just 1 byte and therefore smaller than int (i.e. the result of default argument promotion) its use as last argument before ... might result in undefined behavior. This theoretically can also apply to enums as a compiler may use a smaller base type than int. Since Clang 3.9 (currently in use on Travis by default) a warning is issued about this, however, that version did not yet compare the actual size of the argument's type, causing warnings where they are not warranted (basically for all cases where enum types are used for the last argument). This was apparently fixed with Clang 4.0, which only warns about this use of bool with va_start(), which makes sense.
* Change interface for enumerator_create_filter() callbackTobias Brunner2017-05-261-24/+37
| | | | | This avoids the unportable 5 pointer hack, but requires enumerating in the callback.
* Migrate all enumerators to venumerate() interface changeTobias Brunner2017-05-261-4/+2
|
* settings: Add support for hex integers (0x prefix) via get_int()Tobias Brunner2017-03-021-1/+6
|
* settings: Fix purge if order differs from alphabetical orderTobias Brunner2017-02-071-1/+1
|
* Use standard unsigned integer typesAndreas Steffen2016-03-242-12/+12
|
* settings: Add settings_value_as_uint64() helper functionTobias Brunner2015-11-112-0/+34
|
* settings: Add methods and a constructor to parse settings from stringsTobias Brunner2015-07-282-11/+112
|
* settings: Extend parser so we can parse settings from a stringTobias Brunner2015-07-282-0/+45
|
* settings: Add support for multi-line stringsTobias Brunner2015-07-282-8/+3
| | | | Unterminated strings are now an error.
* settings: Don't replace rarely used special charactersTobias Brunner2015-07-281-2/+0
|
* settings: Merge quoted strings that span multiple linesTobias Brunner2015-03-201-3/+2
|
* settings: Make loading a NULL or empty pattern a (nop-)successMartin Willi2014-09-221-1/+1
|
* settings: Use strongswan.conf used during library initialization for reloadMartin Willi2014-09-221-3/+1
| | | | | | | | Since 4b670a20 we require an explicit strongswan.conf to re-load configurations. However, the define was missing in the build, breaking SIGHUP based config reloading. Fixes #651.
* settings: Allow spaces in time settings before the optional unitMartin Willi2014-07-071-0/+5
|
* settings: Be more strict in converting settings to specific data typesMartin Willi2014-07-071-5/+15
| | | | | | | As the behavior was inconsistent for empty strings or strings with characters appended to a number, testing the code failed on some platforms. The new rules are more strict, returning the default if additional characters or an empty string was found for a setting.
* settings: Properly match } and # in include statementsTobias Brunner2014-05-151-6/+16
| | | | | | Found due to %option nodefault. A match for } was actually missing and # was not properly matched if it was part of an include statement on the last line of a file that did not end with a newline.
* settings: Eliminate performance warningTobias Brunner2014-05-151-2/+0
| | | | | This was useful during development, but we accept that matching \n together with %option yylineno impacts performance.
* parser-helper: Make parser_helper_file_t privateTobias Brunner2014-05-151-3/+3
|
* settings: strongswan.conf must be loaded explicitlyTobias Brunner2014-05-152-7/+5
|
* settings: Replace deprecated YYLEX_PARAM with %lex-paramTobias Brunner2014-05-151-3/+7
| | | | | | | | With Bison 3.x support for YYLEX_PARAM has been removed and %lex-param should be used. Unfortunately, that option does not take expressions. Instead we use a wrapper function that calls the lexer with the proper scanner object, which should also be backward compatible to older Bison versions.
* settings: Include generated header after othersTobias Brunner2014-05-152-4/+4
| | | | | Newer Bison versions declare the parser function in the header, which requires custom types.
* settings: Reduce log verbosity if files can't be openedTobias Brunner2014-05-151-1/+10
| | | | Basically reintroducing 2a38b4556e9fd8102bd6c6c61f2893599a5e8e51.
* settings: Adopt the new order of sections and settings when replacing configsTobias Brunner2014-05-151-6/+36
|
* settings: Only purge sections if necessaryTobias Brunner2014-05-153-55/+86
| | | | | Instead of removing and caching all values of a previous config, we only do this for actually removed sections/settings.
* settings: Maintain order of sections and settings while enumeratingTobias Brunner2014-05-153-9/+35
|
* settings: Don't overwrite values in-placeTobias Brunner2014-05-153-29/+36
| | | | | | | This is not thread safe. If threads are reading from pointers to existing values they could get a partially updated invalid value. Refactored assignment to a separate function.
* settings: Add functions to add sections and key/value pairs to a sectionTobias Brunner2014-05-154-68/+82
|
* settings: Don't enumerate key/value pairs with NULL valueTobias Brunner2014-05-151-1/+1
|
* settings: Use generated parser instead of our ownTobias Brunner2014-05-151-566/+53
|
* settings: Optionally keep track of removed/replaced valuesTobias Brunner2014-05-153-16/+45
|
* settings: Add flex/bison based parser for strongswan.confTobias Brunner2014-05-153-0/+495
| | | | | | | | | | | This parser features several improvements over the existing one. For instance, quoted strings (with escape sequences), unlimited includes, relaxed newline handling (e.g. at the end of files or before/after { and }), and the difference between empty and unset values (key = vs. key = ""). It also complains a lot more about invalid syntax. The current one accepts pretty odd stuff (like settings or sections without name) without any errors or warnings.
* settings: Extract section and key/value pair types and helper functionsTobias Brunner2014-05-152-0/+284
| | | | This allows us to use them in the upcoming parser.
* settings: Use glob enumerator to load included filesTobias Brunner2014-05-151-32/+13
|
* settings: Move to a separate folderTobias Brunner2014-05-152-0/+1871