summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-08-28Use special magic to enforce manager/object connection.Nick Mathewson
Every time we finalize a config manager, we now generate a new magic number for it, so that we'll get an assertion failure if we ever try to use an object with a different configuration manager than the one that generated it.
2019-07-24Use config_new() to construct configuration objects.Nick Mathewson
We'll need to do it this way once the objects become more complex.
2019-07-24Sort variables in config_mgr_t.all_vars alphabeticallyNick Mathewson
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-24Start teaching config_mgr_t to handle sub-objects and sub-formatsNick Mathewson
The eventual design here will be that multiple config_format_t objects get registered with a single config_mgr_t. That config_mgr_t manages a "top-level" object, which has a pointer to the other objects. I had earlier thought of a different design, where there would be no top-level object, and config_mgr_t would deal with a container instead. But this would require a bunch of invasive refactoring that I don't think we should do just yet.
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-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-24Refactor handling of TestingTorNetworkNick Mathewson
Previously, when TestingTorNetwork was set, we would manually adjust the initvalue members of a bunch of other config_var_t, and then re-run the early parts or parsing the options. Now we treat the initvalue fields as immutable, but instead assign to them in options_init(), as early as possible. Rather than re-running the early parts of options, we just re-call the options_init_from_string() function. This patch de-kludges some of our code pretty handily. I think it could later handle authorities and fallbacks, but for now I think we should leave those alone.
2019-06-25Make "invisibility" and "undumpability" properties of variables.Nick Mathewson
Previously, these were magical things that we detected by checking whether a variable's name was prefixed with two or three underscores.
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-25Extend macros to allow flag arguments.Nick Mathewson
2019-06-25Add a "flags" member to config_var_tNick Mathewson
Additionally, adjust the macros so that we can add new members like this more easily.
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-25A few more test cases and unreachable linesNick Mathewson
2019-06-25Add a function to make sure all values in a config object are okNick Mathewson
2019-06-25Use structvar to find the types for config vars.Nick Mathewson
2019-06-25Use struct_var_{copy,eq} in confparse.c.Nick 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-25Add new "struct_var_" functions to manipulate struct fields.Nick Mathewson
These functions exist one level higher than typed_var_t. They describe a type, a name, and an offset within a structure.
2019-06-24Partially port routerset to being a full-fledged config type again.Nick Mathewson
2019-06-24Add unit tests for the unitparse.c module.Nick Mathewson
2019-06-24Further clarify our clarification about the type of POSINTNick Mathewson
2019-06-24Add a "typed_var" abstraction to implement lvalue access in C.Nick Mathewson
Right now, this has been done at a high level by confparse.c, but it makes more sense to lower it. This API is radically un-typesafe as it stands; we'll be wrapping it in a safer API as we do #30914 and lower the struct manipulation code as well. Closes ticket 30864.
2019-06-24Add a function to append an existing line to a config line list.Nick Mathewson
We had an existing function to do this, but it took a pair of strings rather than a line.
2019-06-24Move unit-parsing code to src/lib/confmgtNick Mathewson
lib/confmgt is at a higher level than lib/conf, since it needs to call down to logging and similar modules.
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-24stats: Split extrainfo_dump_to_string() into smaller functions.teor
Closes ticket 30956.
2019-06-24Merge branch 'bug30956_041' into bug30956_masterteor
2019-06-24stats: Always publish pluggable transports in extra info documentsteor
Always publish bridge pluggable transport information in the extra info descriptor, even if ExtraInfoStatistics is 0. This information is needed by BridgeDB. Fixes bug 30956; bugfix on 0.4.1.1-alpha.
2019-06-19Merge branch 'tor-github/pr/1113'David Goulet
2019-06-17Merge remote-tracking branch 'tor-github/pr/1100'Nick Mathewson
2019-06-15Merge branch 'bug30894_035' into ticket30893Nick Mathewson
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-15Fix memleak when failing to parse a CSV_INTERVAL.Nick Mathewson
Fixes bug 30894; bugfix on 0.3.4.1-alpha
2019-06-15Remove the PORT configuration type: nothing uses it.Nick Mathewson
All of our port configurations now use an extended format.
2019-06-15Renaming: CONFIG_TYPE_UINT -> CONFIG_TYPE_POSINTNick Mathewson
This name has been a historical source of confusion, since "uint" usually suggests "unsigned int" to people, when the real type is "nonnegative int".
2019-06-14Merge branch 'bug30806'George Kadianakis
2019-06-14Make evloop into a subsystem.Nick Mathewson
Note that the event base object is _not_ created from the initialize function, since it is configuration-dependent. This will wait until configuration is integrated into subsystems. Closes ticket 30806.
2019-06-12Merge branch 'tor-github/pr/1088'George Kadianakis
2019-06-11Merge branch 'tor-github/pr/1040'David Goulet
2019-06-11Rework origin circuit tracking to use pubsubTaylor Yu
Part of ticket 29976.
2019-06-11Rework orconn tracking to use pubsubTaylor Yu
Part of ticket 29976.
2019-06-11Merge branch 'tor-github/pr/1031'David Goulet