aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/settings/settings.c
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-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
|
* Use standard unsigned integer typesAndreas Steffen2016-03-241-7/+7
|
* settings: Add settings_value_as_uint64() helper functionTobias Brunner2015-11-111-0/+25
|
* settings: Add methods and a constructor to parse settings from stringsTobias Brunner2015-07-281-11/+58
|
* settings: Make loading a NULL or empty pattern a (nop-)successMartin Willi2014-09-221-1/+1
|
* 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: strongswan.conf must be loaded explicitlyTobias Brunner2014-05-151-6/+2
|
* settings: Only purge sections if necessaryTobias Brunner2014-05-151-40/+1
| | | | | 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-151-5/+11
|
* settings: Don't overwrite values in-placeTobias Brunner2014-05-151-20/+1
| | | | | | | 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-151-6/+3
|
* 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: Use glob enumerator to load included filesTobias Brunner2014-05-151-32/+13
|
* settings: Move to a separate folderTobias Brunner2014-05-151-0/+1520