summaryrefslogtreecommitdiff
path: root/src/app/config/confparse.h
AgeCommit message (Collapse)Author
2019-09-11Move confparse.[ch] into src/lib/confmgt/Nick Mathewson
This commit only does code movement, and does not clean up after itself. As such, it will break compilation. I'm separating it for ease of review.
2019-09-11config: make config_var_is_dumpable static.Nick Mathewson
2019-09-11config: rename "contained" to "derived", and explain it better.Nick Mathewson
Don't use "derived" directly, but check its implications for listing and copying.
2019-09-05config: Invert sense of _is_invisible, and rename to is_listable()Nick Mathewson
2019-09-05config: replace config_var_is_cumulative with is_replaced_on_set()Nick Mathewson
This change replaces the higher-level property check to match our intended flag factoring.
2019-09-05Merge branch 'tor-github/pr/1294'George Kadianakis
2019-09-04Document validate_fn_t as it stands.Nick Mathewson
Also document that it will be changed in a later branch.
2019-09-04config_assign: Document CAL_* options.Nick Mathewson
These were sort of described in config_assign() documentation, but not so well.
2019-09-04Document configuration and abbreviation types.Nick Mathewson
2019-09-04config: use ptrdiff_t for all field-offset members.Nick Mathewson
Previously we used int here, but it is more correct to use ptrdiff_t. (This never actually matters for our code in practice, since the structure we are managing here never exceed INT_MAX in size.)
2019-08-29Describe clear_cfg_fn_t better.Nick Mathewson
2019-08-28Merge branch 'ticket31240v2' into ticket31240v2_merged_2Nick Mathewson
2019-08-28Simple tests for nested configuration formatsNick Mathewson
One test makes sure that the toplevel magic numbers are distinct. One test makes sure that we can parse a configuration object with two sub-objects.
2019-08-28Better explain config_clear_fn_tNick Mathewson
2019-08-28Partial support for multiplicity in configuration objectsNick Mathewson
A configuration manager, in addition to a top-level format object, may now also know about a suite of sub-formats. Top-level configuration objects, in turn, may now have a suite of sub-objects.
2019-08-28Make a config_suite_t type to hold multiple config sub-objectsNick Mathewson
Right now, it doesn't do anything; this patch is meant to make sure that we're doing memory management correctly.
2019-08-28Refactor config free logic to use a single path.Nick Mathewson
The right way to free a config object is now to wrap config_free(), always. Instead of creating an alternative free function, objects should provide an alternative clear callback to free any fields that the configuration manager doesn't manage. This lets us simplify our code a little, and lets us extend the confparse.c code to manage additional fields in config_free.
2019-08-24Make a function for NODUMP.Nick Mathewson
2019-08-24Make config_var_is_invisible a function.Nick Mathewson
2019-07-24Remove src/core/ and src/feature dependencies from confparse.cNick Mathewson
This C file will eventually belong in lib/confmgt, so it needs to have only low-level dependencies. Now that it no longers needs routerset.c, we can adjust its includes accordingly. I'm not moving the file yet, since it would make fixup commits on earlier branches here really hard to do.
2019-07-24Make config_var and config_fmt const.Nick Mathewson
Now that we have a reasonable implementation for overriding the default options for TestingTorNetwork, we don't need to modify config_var_t structs any more. And therefore, we can have constant format options, like reasonable people.
2019-07-24Add a "freeze" function for config_mgr_t objects.Nick Mathewson
It's important to make sure that we don't change a config_mgr_t after we start using it to make objects, or we could get into inconsistent states. This feature is the start of a safety mechanism to prevent this problem.
2019-07-24Change CONFIG_CHECK() macro to not need a config_format_tNick Mathewson
We'll want it to check all the subsidiary structures of the options object.
2019-07-24Fix every place in config.c that knew about option_vars_.Nick Mathewson
Iterating over this array was once a good idea, but now that we are going to have a separate structure for each submodule's configuration variables, we should indirect through the config_mgr_t object.
2019-07-24Lower responsibility for listing changed options into confparse.cNick Mathewson
2019-07-24Replace config_find_option with a variant that exposes lessNick Mathewson
2019-07-24Add a config_mgr_t type to wrap config_format_tNick Mathewson
Remember that our goal in the present refactoring is to allow each subsystem to declare its own configuration structure and variables. To do this, each module will get its own config_format_t, and so we'll want a different structure that wraps several config_format_t objects. This is a "config_mgr_t".
2019-06-25Turn several properties of types or variables into flags.Nick Mathewson
"unsettable" is a property of types. LINELIST_V and OBSOLETE are unsettable, meaning that they cannot be set by name. "contained" is a property of types. I'm hoping to find a better name here. LINELIST_S is "contained" because it always appears within a LINELIST_V, and as such doesn't need to be dumped ore copied independently. "cumulative" is a property of types. Cumulative types can appear more than once in a torrc without causing a warning, because they add to each other rather than replacing each other. "obsolete" is a property of variables. "marking fragile" is now a command that struct members can accept. With these changes, confparse and config no longer ever need to mention CONFIG_TYPE_XYZ values by name.
2019-06-25Move responsibility for config var macrosNick Mathewson
The testing-only parts now live in a conftesting.h; the shared parts of the macros live in confmacros.h
2019-06-25Move config_var_t info conftypes.hNick Mathewson
2019-06-25Add a function to make sure all values in a config object are okNick Mathewson
2019-06-25Use struct_magic_decl to verify magic numbers in config objectsNick Mathewson
2019-06-25Port confparse to use struct_var in place of typed_var.Nick Mathewson
This requires changes to config_var_t, causing corresponding changes throughout its users.
2019-06-24Start moving types that will be used for config vars to lib/confNick Mathewson
This will be a lower-level module than anything that actually sets or handles configuration variables. Part of 30864.
2019-06-15Add more unit tests for confparse.c, so we can refactor.Nick Mathewson
This set of tests gets the line coverage to 100%.
2019-06-15Remove the PORT configuration type: nothing uses it.Nick Mathewson
All of our port configurations now use an extended format.
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-09-27Fix a memory leak in --dump-configNick Mathewson
When freeing a configuration object from confparse.c in dump_config(), we need to call the appropriate higher-level free function (like or_options_free()) and not just config_free(). This only happens with options (since they're the one where options_validate allocates extra stuff) and only when running --dump-config with something other than minimal (since OPTIONS_DUMP_MINIMAL doesn't hit this code). Fixes bug 27893; bugfix on 0.3.2.1-alpha.
2018-08-01Convert __OwningControllerFD to a 64-bit valueNick Mathewson
This lets us potentially use it for internal passing of windows sockets.
2018-07-10Document the headers in src/app/config/Nick Mathewson
2018-07-05Move literally everything out of src/orNick Mathewson
This commit won't build yet -- it just puts everything in a slightly more logical place. The reasoning here is that "src/core" will hold the stuff that every (or nearly every) tor instance will need in order to do onion routing. Other features (including some necessary ones) will live in "src/feature". The "src/app" directory will hold the stuff needed to have Tor be an application you can actually run. This commit DOES NOT refactor the former contents of src/or into a logical set of acyclic libraries, or change any code at all. That will have to come in the future. We will continue to move things around and split them in the future, but I hope this lays a reasonable groundwork for doing so.