2012-11-26 05:42:46 +00:00
|
|
|
/*
|
|
|
|
Serval DNA configuration
|
|
|
|
Copyright (C) 2012 Serval Project Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2012-11-26 05:45:59 +00:00
|
|
|
/* This file contains definitions for the schema of the Serval DNA configuration file. See comments
|
|
|
|
* in "config.h" for a description of the internal configuration API.
|
|
|
|
*
|
|
|
|
* A configuration schema is set of nested structures and arrays. By convention, the top level, or
|
|
|
|
* root of the schema is called "main", but every structure and array has its own complete API which
|
|
|
|
* can be used by itself. So if there were two independent configuration files, both could be
|
|
|
|
* defined in this file, each with a conventional name for its own root element.
|
|
|
|
*
|
2012-11-27 07:40:51 +00:00
|
|
|
* A configuration file consists of lines of the form:
|
|
|
|
*
|
|
|
|
* FULLKEY "=" VALUE "\n"
|
|
|
|
*
|
|
|
|
* where FULLKEY has the form KEY [ "." KEY [ "." KEY [ ... ] ] ] and VALUE is any string not
|
|
|
|
* containing newline. Lines ending with "\r\n" have the "\r" stripped from the end of VALUE.
|
|
|
|
* Otherwise VALUE is preserved exactly, with all leading and trailing spaces intact.
|
|
|
|
*
|
2012-11-26 05:45:59 +00:00
|
|
|
* To describe a configuration file that looks like this:
|
|
|
|
*
|
|
|
|
* some.thing.element1=integer
|
|
|
|
* some.thing.element2=string
|
|
|
|
* some.list.foo.element1=integer
|
|
|
|
* some.list.foo.element2=string
|
|
|
|
* some.list.bar.element1=integer
|
|
|
|
* some.list.bar.element2=string
|
|
|
|
* another_thing=http://my.host.com:1234/path/to/nowhere
|
|
|
|
*
|
|
|
|
* the following schema would do:
|
|
|
|
*
|
|
|
|
* STRUCT(happy)
|
2013-02-27 06:00:23 +00:00
|
|
|
* ATOM(int32_t, element1, 0, int32_nonneg,, "An integer >= 0")
|
2013-02-25 06:53:44 +00:00
|
|
|
* STRING(80, element2, "boo!", str_nonempty, MANDATORY, "A non-empty string")
|
2012-11-26 05:45:59 +00:00
|
|
|
* END_STRUCT
|
|
|
|
*
|
2012-11-30 02:02:30 +00:00
|
|
|
* ARRAY(joy,)
|
2013-02-25 06:53:44 +00:00
|
|
|
* KEY_STRING(3, happy, str)
|
2012-11-28 22:54:02 +00:00
|
|
|
* VALUE_SUB_STRUCT(happy)
|
|
|
|
* END_ARRAY(16)
|
2012-11-26 05:45:59 +00:00
|
|
|
*
|
|
|
|
* STRUCT(love)
|
|
|
|
* SUB_STRUCT(happy, thing,)
|
|
|
|
* SUB_STRUCT(joy, list,)
|
|
|
|
* END_STRUCT
|
|
|
|
*
|
|
|
|
* STRUCT(main)
|
|
|
|
* SUB_STRUCT(love, some,)
|
2013-02-25 06:53:44 +00:00
|
|
|
* STRING(128, another_thing, "", uri,, "URL; protocol://hostname[:port][/path]")
|
2012-11-26 05:45:59 +00:00
|
|
|
* END_STRUCT
|
|
|
|
*
|
|
|
|
* which would produce an API based on the following definitions (see "config.h" for more
|
|
|
|
* information):
|
|
|
|
*
|
|
|
|
* struct config_happy {
|
|
|
|
* int32_t element1;
|
|
|
|
* char element2[81];
|
|
|
|
* };
|
|
|
|
* struct config_joy {
|
|
|
|
* unsigned ac;
|
2012-11-28 19:17:52 +00:00
|
|
|
* struct config_joy__element {
|
2012-11-28 22:54:02 +00:00
|
|
|
* char key[4];
|
2012-11-26 05:45:59 +00:00
|
|
|
* struct config_happy value;
|
|
|
|
* } av[16];
|
|
|
|
* };
|
|
|
|
* struct config_love {
|
|
|
|
* struct config_happy thing;
|
|
|
|
* struct config_joy list;
|
|
|
|
* };
|
|
|
|
* struct config_main {
|
|
|
|
* struct config_love some;
|
|
|
|
* char another_thing[129];
|
|
|
|
* };
|
|
|
|
*
|
|
|
|
* A schema definition is composed from the following STRUCT and ARRAY definitions:
|
|
|
|
*
|
2013-04-05 03:37:31 +00:00
|
|
|
* STRUCT(name [, validatorfunc])
|
2012-11-28 22:54:02 +00:00
|
|
|
* element-declaration
|
|
|
|
* element-declaration
|
|
|
|
* ...
|
|
|
|
* END_STRUCT
|
|
|
|
*
|
|
|
|
* where each element-declaration is one of:
|
|
|
|
*
|
2013-02-25 06:53:44 +00:00
|
|
|
* ATOM(type, element, default, repr, flags, comment)
|
|
|
|
* NODE(type, element, default, repr, flags, comment)
|
|
|
|
* STRING(strlen, element, default, repr, flags, comment)
|
2013-04-05 03:37:31 +00:00
|
|
|
* SUB_STRUCT(structname, element, flags [, default_label])
|
|
|
|
* NODE_STRUCT(structname, element, repr, flags [, default_label])
|
2012-11-26 05:45:59 +00:00
|
|
|
*
|
2013-04-05 03:37:31 +00:00
|
|
|
* ARRAY(name, flags [, validatorfunc])
|
2012-11-28 22:54:02 +00:00
|
|
|
* key-declaration
|
|
|
|
* value-declaration
|
|
|
|
* END_ARRAY(size)
|
2013-04-05 03:37:31 +00:00
|
|
|
*
|
2012-11-28 22:54:02 +00:00
|
|
|
* where key-declaration is one of:
|
|
|
|
*
|
2013-03-01 04:57:28 +00:00
|
|
|
* KEY_ATOM(type, repr)
|
|
|
|
* KEY_STRING(strlen, repr)
|
2012-11-28 22:54:02 +00:00
|
|
|
*
|
|
|
|
* and value-declaration is one of:
|
|
|
|
*
|
2013-02-25 06:53:44 +00:00
|
|
|
* VALUE_ATOM(type, repr)
|
|
|
|
* VALUE_STRING(strlen, repr)
|
|
|
|
* VALUE_NODE(type, repr)
|
2012-11-28 22:54:02 +00:00
|
|
|
* VALUE_SUB_STRUCT(structname)
|
2013-02-25 06:53:44 +00:00
|
|
|
* VALUE_NODE_STRUCT(structname, repr)
|
2012-11-26 05:45:59 +00:00
|
|
|
*
|
2013-04-05 03:37:31 +00:00
|
|
|
* For defining alternative STRUCT default settings:
|
|
|
|
*
|
|
|
|
* STRUCT_DEFAULT(name, default_label)
|
|
|
|
* default-declaration
|
|
|
|
* default-declaration
|
|
|
|
* ...
|
|
|
|
* END_STRUCT_DEFAULT
|
|
|
|
*
|
|
|
|
* where each default-declaration is one of:
|
|
|
|
*
|
|
|
|
* ATOM_DEFAULT(element, default)
|
|
|
|
* STRING_DEFAULT(element, default)
|
|
|
|
* SUB_STRUCT_DEFAULT(structname, element [, default_label])
|
|
|
|
*
|
|
|
|
* Every structure defined by STRUCT has its own, native default values as given by
|
|
|
|
* the 'default' parameter in each of its element declarations. The STRUCT_DEFAULT
|
|
|
|
* declaration defines a variation on the default values that can be used to give the
|
|
|
|
* structure alternative defaults when included as a SUB_STRUCT (or NODE_STRUCT) from
|
|
|
|
* within another structure. Not all the STRUCT's elements have to be defined within
|
|
|
|
* a STRUCT_DEFAULT definition; any omitted ones take the STRUCT's native default.
|
|
|
|
*
|
|
|
|
* For defining that one STRUCT can be treated as a subset of another:
|
|
|
|
*
|
|
|
|
* STRUCT_ASSIGN(substruct, superstruct)
|
|
|
|
* element-declaration
|
|
|
|
* element-declaration
|
|
|
|
* ...
|
|
|
|
* END_STRUCT_ASSIGN
|
|
|
|
*
|
|
|
|
* where element-declaration is exactly as for STRUCT(...) above.
|
|
|
|
*
|
|
|
|
* This generates a structure copy function that copies the given elements of 'substruct'
|
|
|
|
* into the equivalent elements of 'superstruct'; ie, both structures must have the same
|
|
|
|
* element names and types.
|
|
|
|
*
|
2012-11-26 05:45:59 +00:00
|
|
|
* The meanings of the parameters are:
|
|
|
|
*
|
|
|
|
* 'name'
|
|
|
|
* A label used to qualify this struct/array's API from the API components of other structs and
|
|
|
|
* arrays. This label does not appear anywhere in the config file itself; it is purely for
|
|
|
|
* internal code-related purposes.
|
2012-11-28 19:17:52 +00:00
|
|
|
* 'strlen'
|
2012-11-28 22:54:02 +00:00
|
|
|
* For STRING, LABEL_STRING and VALUE_STRING, gives the maximum length of the string. The
|
|
|
|
* string is declared as an array of char[strlen+1] to leave room for a terminating nul.
|
2012-11-27 06:17:30 +00:00
|
|
|
* 'size'
|
|
|
|
* For all ARRAYs, gives the maximum size of the array.
|
2012-11-26 05:45:59 +00:00
|
|
|
* 'type'
|
2012-11-28 22:54:02 +00:00
|
|
|
* Used for ATOM, NODE, LABEL_ATOM, VALUE_ATOM and VALUE_NODE declarations. Gives the C type
|
2013-02-25 06:53:44 +00:00
|
|
|
* of the element. For STRING, KEY_STRING and VALUE_STRING this is implicitly char[strlen+1].
|
2012-11-26 05:45:59 +00:00
|
|
|
* 'structname'
|
2012-11-28 22:54:02 +00:00
|
|
|
* Only used for SUB_STRUCT, NODE_STRUCT, VALUE_SUB_STRUCT and VALUE_NODE_STRUCT declarations.
|
|
|
|
* Identifies a sub- structure by 'name' to nest in the enclosing struct or array.
|
2012-11-26 05:45:59 +00:00
|
|
|
* 'element'
|
|
|
|
* The name of the struct element and the key in the configuration file. This name does appear
|
|
|
|
* in the config file and also in the API, so that an option mamed "some.thing.element1" in the
|
|
|
|
* file is referred to as some.thing.element1 in the C code. Arrays are more complicated:
|
|
|
|
* "some.list.foo.element1" in the config file is referred to as some.list.av[n].value.element1
|
|
|
|
* in the C code, and some.list.ac gives the size of the some.list.av array.
|
|
|
|
* 'default'
|
|
|
|
* Only used for ATOM and NODE struct elements. Gives the default value for the element if
|
|
|
|
* absent from the config file.
|
2013-02-25 06:53:44 +00:00
|
|
|
* 'repr'
|
2013-02-27 07:41:18 +00:00
|
|
|
* The string representation. This name specifies a trio of functions, cf_opt_<repr>(),
|
|
|
|
* cf_fmt_<repr>() and cf_cmp_<repr>():
|
|
|
|
* - The cf_opt_<repr>() functions for ATOM, STRING, KEY_ATOM, KEY_STRING, VALUE_ATOM and
|
2013-02-25 06:53:44 +00:00
|
|
|
* VALUE_STRING take a (const char *) argument pointing to nul-terminated text. The
|
|
|
|
* <repr> functions for NODE and VALUE_NODE take a pointer to a COM node (const
|
|
|
|
* struct cf_om_node *), and are responsible for parsing the node's text and all of its
|
|
|
|
* descendents (children).
|
2013-02-27 07:41:18 +00:00
|
|
|
* - Each cf_fmt_<repr>() function is the inverse of cf_opt_<repr>. The cf_fmt_<repr>
|
|
|
|
* functions for ATOM, KEY_ATOM, KEY_STRING, VALUE_ATOM and VALUE_STRING all take a pointer
|
|
|
|
* to a const 'type', and produce a malloc()ed nul-terminated string which, if passed to
|
|
|
|
* cf_opt_<repr>(), would produce the same original value. If the value is invalid (outside
|
|
|
|
* the legal range) then cf_fmt_<repr> returns CFINVALID or CFEMPTY. The cf_fmt_<repr>
|
|
|
|
* functions for NODE and VALUE_NODE take a pointer to a const 'type' and produce a
|
|
|
|
* malloc()ed COM node (struct cf_om_node *) which, if passed to cf_opt_<repr> would produce
|
|
|
|
* the same original value.
|
|
|
|
* - Each cf_cmp_<repr>() function compares two values of the given 'type' and returns -1, 0
|
|
|
|
* or 1 to indicate the natural ordering of the values. These functions are used to detect
|
|
|
|
* when config elements have their default values, to avoid calling cf_fmt_<repr>(). They
|
|
|
|
* are also used to sort array keys.
|
2012-11-27 06:17:30 +00:00
|
|
|
* 'validatorfunc'
|
|
|
|
* A function that is called after the struct/array is fully parsed and populated. This
|
|
|
|
* function can perform validation checks on the whole struct/array that cannot be performed by
|
|
|
|
* the parse functions of each element in isolation, and can even alter the contents of the
|
|
|
|
* struct/array, eg, sort an array or fill in default values in structs that depend on other
|
|
|
|
* elements. Takes as its second argument the CFxxx code produced by the parser, and returns
|
|
|
|
* an updated CFxxx result code (which could be the same) as documented in "config.h".
|
2012-11-26 05:45:59 +00:00
|
|
|
* 'flags'
|
|
|
|
* A space-separated list of flags. At present only the MANDATORY flag is supported, which
|
|
|
|
* will cause parsing to fail if the given STRUCT element is not set in the config file. In
|
|
|
|
* the case of struct elements that are arrays, the config file must set at least one element
|
|
|
|
* of the array, or parsing fails.
|
|
|
|
* 'comment'
|
|
|
|
* A human-readable string describing the value of the configuration option. Must be
|
|
|
|
* informative enough to help users diagnose parse errors. Eg, "An integer" is not enough;
|
|
|
|
* better would be "Integer >= 0, number of seconds since Unix epoch".
|
2013-04-05 03:37:31 +00:00
|
|
|
* 'default_label'
|
|
|
|
* A label used to qualify an alternative STRUCT default set. These labels need only be unique
|
|
|
|
* for each given struct 'name', so different STRUCTs may re-use the same labels.
|
2012-11-26 05:45:59 +00:00
|
|
|
*
|
|
|
|
* @author Andrew Bettison <andrew@servalproject.com>
|
|
|
|
*/
|
|
|
|
|
2012-12-11 05:29:46 +00:00
|
|
|
STRUCT(debug)
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, verbose, 0, boolean,, "")
|
2013-08-30 05:26:22 +00:00
|
|
|
ATOM(bool_t, ack, 0, boolean,, "")
|
2014-04-16 09:42:01 +00:00
|
|
|
ATOM(bool_t, config, 0, boolean,, "")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, dnaresponses, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, dnahelper, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, queues, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, timing, 0, boolean,, "")
|
2014-01-31 07:32:41 +00:00
|
|
|
ATOM(bool_t, http_server, 0, boolean,, "")
|
2013-10-25 07:08:51 +00:00
|
|
|
ATOM(bool_t, httpd, 0, boolean,, "")
|
2014-01-31 07:32:41 +00:00
|
|
|
ATOM(bool_t, nohttptx, 0, boolean,, "")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, io, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, verbose_io, 0, boolean,, "")
|
2013-09-01 08:03:32 +00:00
|
|
|
ATOM(bool_t, interactive_io, 0, boolean,, "")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, packetformats, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, gateway, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, keyring, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, security, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, mdprequests, 0, boolean,, "")
|
2014-04-29 06:01:50 +00:00
|
|
|
ATOM(bool_t, mdp_filter, 0, boolean,, "")
|
2013-12-20 02:02:47 +00:00
|
|
|
ATOM(bool_t, msp, 0, boolean,, "")
|
2014-02-03 05:21:48 +00:00
|
|
|
ATOM(bool_t, monitor, 0, boolean,, "")
|
2013-10-30 06:39:37 +00:00
|
|
|
ATOM(bool_t, radio_link, 0, boolean,, "")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, peers, 0, boolean,, "")
|
2013-11-25 06:13:32 +00:00
|
|
|
ATOM(bool_t, overlaybuffer, 0, boolean,, "")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, overlayframes, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, overlayabbreviations, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, overlayrouting, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, overlayroutemonitor, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, overlayinterfaces, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, broadcasts, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, packettx, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, packetrx, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, packetradio, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, rejecteddata, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, slip, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, slipdecode, 0, boolean,, "")
|
2013-05-07 07:59:11 +00:00
|
|
|
ATOM(bool_t, slipbytestream, 0, boolean,, "")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, packetconstruction, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, rhizome, 0, boolean,, "")
|
Refactor manifest: specific setter functions
Replace generic rhizome_manifest_set() and rhizome_manifest_set_ll()
with per-field setter functions, eg, rhizome_manifest_set_filesize().
Struct rhizome_manifest elements for all known fields, to replace the
use of rhizome_manifest_get() and rhizome_manifest_get_ll() everywhere:
sender, recipient, service, name, date, bundle_key.
Add boolean validity flags for binary blob types, to avoid having to compare
with many bytes of all-zero to detect presence, eg, has_sender, has_recipient,
has_author, has_bundle_key. These maintained by the setter functions.
Rename existing manifest struct elements to be the same as their field
names: fileLength -> filesize, journalTail -> tail.
More use of unsigned int, size_t and uint64_t for payload sizes, offsets, byte
counts, etc. especially in rhizome_store.c and meshms.c. More uniform use of
size_t to dimension memory buffers. Fix some printf(3) style format strings
for 64-bit correctness on 32-bit systems. Use new constant RHIZOME_SIZE_UNSET
instead of -1 to indicate unknown dimension, and explicitly assert its absence
before comparisons and arithmetic, for safety.
Replace some 'int' loop variables with 'unsigned' where appropriate.
Fix bugs discovered in MeshMS bundle private/public key generation and
bundle secret key handling for export/extract commands.
Instrument the first MeshMS test case to aid debugging.
New debug config flag: debug.manifest logs all modifications to all manifest
fields by setter functions.
Rename debug config flag: debug.rhizome_bind -> debug.rhizome_sql_bind.
2013-10-30 12:52:19 +00:00
|
|
|
ATOM(bool_t, rhizome_manifest, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, rhizome_sql_bind, 0, boolean,, "")
|
2014-03-12 03:18:08 +00:00
|
|
|
ATOM(bool_t, rhizome_store, 0, boolean,, "")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, rhizome_tx, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, rhizome_rx, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, rhizome_ads, 0, boolean,, "")
|
2013-08-25 11:46:33 +00:00
|
|
|
ATOM(bool_t, rhizome_mdp_rx, 0, boolean,, "")
|
2013-11-25 12:10:14 +00:00
|
|
|
ATOM(bool_t, subscriber, 0, boolean,, "")
|
2013-08-27 11:13:56 +00:00
|
|
|
ATOM(bool_t, throttling, 0, boolean,, "")
|
2013-07-22 08:25:02 +00:00
|
|
|
ATOM(bool_t, meshms, 0, boolean,, "")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, manifests, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, vomp, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, trace, 0, boolean,, "")
|
|
|
|
ATOM(bool_t, profiling, 0, boolean,, "")
|
2013-04-26 07:23:04 +00:00
|
|
|
ATOM(bool_t, linkstate, 0, boolean,, "")
|
2014-04-16 08:36:27 +00:00
|
|
|
ATOM(bool_t, watchdog, 0, boolean,, "")
|
2012-12-11 05:29:46 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2013-04-05 03:37:31 +00:00
|
|
|
#define LOG_FORMAT_OPTIONS \
|
|
|
|
ATOM(bool_t, show_pid, 1, boolean,, "If true, all log lines contain PID of logging process") \
|
|
|
|
ATOM(bool_t, show_time, 1, boolean,, "If true, all log lines contain time stamp") \
|
|
|
|
ATOM(int, level, LOG_LEVEL_DEBUG, log_level,, "Only log messages at and above this level of severity") \
|
2013-03-28 13:52:08 +00:00
|
|
|
ATOM(bool_t, dump_config, 1, boolean,, "If true, current configuration is dumped into start of log")
|
2013-04-05 03:37:31 +00:00
|
|
|
|
|
|
|
STRUCT(log_format)
|
|
|
|
LOG_FORMAT_OPTIONS
|
2013-03-25 07:16:56 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2013-04-05 03:37:31 +00:00
|
|
|
STRUCT(log_format_file)
|
2014-03-26 05:05:43 +00:00
|
|
|
STRING(256, directory_path, "", str,, "Path of directory for log files, either absolute or relative to instance log directory")
|
2013-04-05 05:53:20 +00:00
|
|
|
STRING(256, path, "", str_nonempty,, "Path of single log file, either absolute or relative to directory_path")
|
2013-04-05 03:37:31 +00:00
|
|
|
ATOM(unsigned short, rotate, 12, ushort,, "Number of log files to rotate, zero means no deletion")
|
|
|
|
ATOM(uint32_t, duration, 3600, uint32_time_interval,, "Time duration of each log file, zero means one file per invocation")
|
|
|
|
LOG_FORMAT_OPTIONS
|
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT_ASSIGN(log_format, log_format_file)
|
|
|
|
LOG_FORMAT_OPTIONS
|
|
|
|
END_STRUCT_ASSIGN
|
|
|
|
|
2013-03-25 07:16:56 +00:00
|
|
|
STRUCT(log)
|
2013-04-05 03:37:31 +00:00
|
|
|
SUB_STRUCT(log_format_file, file,,)
|
2013-04-09 07:47:22 +00:00
|
|
|
SUB_STRUCT(log_format, console,, console)
|
2013-04-05 03:37:31 +00:00
|
|
|
SUB_STRUCT(log_format, android,, android)
|
2012-11-22 23:41:07 +00:00
|
|
|
END_STRUCT
|
2012-11-20 07:39:19 +00:00
|
|
|
|
2013-04-09 07:47:22 +00:00
|
|
|
STRUCT_DEFAULT(log_format, console)
|
2013-03-28 13:52:08 +00:00
|
|
|
ATOM_DEFAULT(show_pid, 0)
|
|
|
|
ATOM_DEFAULT(show_time, 0)
|
2013-04-09 07:47:22 +00:00
|
|
|
ATOM_DEFAULT(level, LOG_LEVEL_HINT)
|
2013-03-28 13:52:08 +00:00
|
|
|
ATOM_DEFAULT(dump_config, 0)
|
2013-03-25 07:16:56 +00:00
|
|
|
END_STRUCT_DEFAULT
|
|
|
|
|
2013-03-26 07:54:37 +00:00
|
|
|
STRUCT_DEFAULT(log_format, android)
|
2013-03-28 13:52:08 +00:00
|
|
|
ATOM_DEFAULT(show_pid, 0)
|
2013-03-26 07:54:37 +00:00
|
|
|
END_STRUCT_DEFAULT
|
|
|
|
|
2014-04-16 08:36:27 +00:00
|
|
|
STRUCT(watchdog)
|
|
|
|
STRING(256, executable, "", absolute_path,, "Absolute path of watchdog executable")
|
|
|
|
ATOM(uint32_t, interval_ms, 60000, uint32_nonzero,, "Time interval between watchdog invocations, in milliseconds")
|
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-26 07:03:54 +00:00
|
|
|
STRUCT(server)
|
2013-02-25 06:53:44 +00:00
|
|
|
STRING(256, chdir, "/", absolute_path,, "Absolute path of chdir(2) for server process")
|
|
|
|
STRING(256, interface_path, "", str_nonempty,, "Path of directory containing interface files, either absolute or relative to instance directory")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, respawn_on_crash, 0, boolean,, "If true, server will exec(2) itself on fatal signals, eg SEGV")
|
2014-04-16 08:54:16 +00:00
|
|
|
ATOM(uint32_t, config_reload_interval_ms, 1000, uint32_nonzero,, "Time interval between configuration reload polls, in milliseconds")
|
2014-04-16 08:36:27 +00:00
|
|
|
SUB_STRUCT(watchdog, watchdog,)
|
2014-04-29 04:27:29 +00:00
|
|
|
STRING(120, motd, "", str_nonempty,, "Message Of The Day displayed on HTTPD root page")
|
2012-11-26 07:03:54 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-28 07:43:53 +00:00
|
|
|
STRUCT(monitor)
|
2013-02-27 06:00:23 +00:00
|
|
|
ATOM(uint32_t, uid, 0, uint32_nonzero,, "Allowed UID for monitor socket client")
|
2012-11-28 22:54:02 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(mdp_iftype)
|
2013-10-08 06:06:07 +00:00
|
|
|
ATOM(int32_t, tick_ms, -1, int32_nonneg,, "Tick interval")
|
2013-02-27 06:00:23 +00:00
|
|
|
ATOM(int32_t, packet_interval, -1, int32_nonneg,, "Minimum interval between packets in microseconds")
|
2013-10-08 06:06:07 +00:00
|
|
|
ATOM(int32_t, reachable_timeout_ms, -1, int32_nonneg,, "Inactivity timeout after which node considered unreachable")
|
2012-11-28 22:54:02 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-30 02:02:30 +00:00
|
|
|
ARRAY(mdp_iftypelist, NO_DUPLICATES)
|
2013-03-01 04:57:28 +00:00
|
|
|
KEY_ATOM(short, interface_type)
|
2012-11-28 22:54:02 +00:00
|
|
|
VALUE_SUB_STRUCT(mdp_iftype)
|
|
|
|
END_ARRAY(5)
|
|
|
|
|
|
|
|
STRUCT(mdp)
|
|
|
|
SUB_STRUCT(mdp_iftypelist, iftype,)
|
2014-02-24 06:17:16 +00:00
|
|
|
ATOM(bool_t, enable_inet, 0, boolean,, "If true, allow mdp clients to connect over loopback UDP")
|
2014-04-29 06:01:50 +00:00
|
|
|
STRING(256, filter_rules_path, "", str_nonempty,, "Path of file containing MDP filter rules, either absolute or relative to instance directory")
|
2012-11-28 07:43:53 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2014-04-10 01:44:46 +00:00
|
|
|
STRUCT(vomp)
|
|
|
|
ATOM(int32_t, dial_timeout_ms, 15000, int32_nonneg,, "Timeout to establish a call when dialling")
|
|
|
|
ATOM(int32_t, ring_timeout_ms, 30000, int32_nonneg,, "Timeout for the other user to answer")
|
|
|
|
ATOM(int32_t, network_timeout_ms, 30000, int32_nonneg,, "Timeout for network activity until a call will end")
|
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-29 02:51:12 +00:00
|
|
|
STRUCT(olsr)
|
2013-08-20 23:51:40 +00:00
|
|
|
ATOM(bool_t, enable, 0, boolean,, "If true, OLSR is used for mesh routing")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(uint16_t, remote_port, 4130, uint16_nonzero,, "Remote port number")
|
|
|
|
ATOM(uint16_t, local_port, 4131, uint16_nonzero,, "Local port number")
|
2012-11-29 02:51:12 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2013-03-01 04:57:28 +00:00
|
|
|
ARRAY(argv, NO_DUPLICATES, vld_argv)
|
|
|
|
KEY_ATOM(unsigned short, ushort_nonzero)
|
2013-02-25 06:53:44 +00:00
|
|
|
VALUE_STRING(128, str)
|
2012-11-28 22:54:02 +00:00
|
|
|
END_ARRAY(16)
|
2012-11-26 07:03:54 +00:00
|
|
|
|
2012-11-27 06:17:30 +00:00
|
|
|
STRUCT(executable)
|
2013-02-25 06:53:44 +00:00
|
|
|
STRING(256, executable, "", absolute_path, MANDATORY, "Absolute path of dna helper executable")
|
2012-11-26 07:03:54 +00:00
|
|
|
SUB_STRUCT(argv, argv,)
|
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(dna)
|
2012-11-27 06:17:30 +00:00
|
|
|
SUB_STRUCT(executable, helper,)
|
2012-11-26 07:03:54 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-12-04 03:42:28 +00:00
|
|
|
STRUCT(rhizome_peer)
|
2013-02-25 06:53:44 +00:00
|
|
|
STRING(25, protocol, "http", protocol,, "Protocol name")
|
|
|
|
STRING(256, host, "", str_nonempty, MANDATORY, "Host name or IP address")
|
2014-01-31 07:32:41 +00:00
|
|
|
ATOM(uint16_t, port, HTTPD_PORT, uint16_nonzero,, "Port number")
|
2012-11-22 23:41:07 +00:00
|
|
|
END_STRUCT
|
2012-11-20 07:39:19 +00:00
|
|
|
|
2012-11-30 02:02:30 +00:00
|
|
|
ARRAY(peerlist,)
|
2013-02-25 06:53:44 +00:00
|
|
|
KEY_STRING(15, str)
|
|
|
|
VALUE_NODE_STRUCT(rhizome_peer, rhizome_peer)
|
2012-11-28 22:54:02 +00:00
|
|
|
END_ARRAY(10)
|
2012-11-22 07:50:13 +00:00
|
|
|
|
2012-11-29 02:51:12 +00:00
|
|
|
STRUCT(rhizome_direct)
|
2012-11-23 08:43:02 +00:00
|
|
|
SUB_STRUCT(peerlist, peer,)
|
2012-11-22 23:41:07 +00:00
|
|
|
END_STRUCT
|
2012-11-21 07:39:05 +00:00
|
|
|
|
2013-10-14 07:16:09 +00:00
|
|
|
STRUCT(user)
|
|
|
|
STRING(50, password, "", str,, "Authentication password")
|
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
ARRAY(userlist,)
|
|
|
|
KEY_STRING(25, str)
|
|
|
|
VALUE_SUB_STRUCT(user)
|
|
|
|
END_ARRAY(10)
|
|
|
|
|
2012-11-29 02:51:12 +00:00
|
|
|
STRUCT(rhizome_api_addfile)
|
2013-03-05 02:05:30 +00:00
|
|
|
STRING(64, uri_path, "", absolute_path,, "URI path for HTTP add-file request")
|
|
|
|
ATOM(struct in_addr, allow_host, hton_in_addr(INADDR_LOOPBACK), in_addr,, "IP address of host allowed to make HTTP add-file request")
|
2013-02-25 06:53:44 +00:00
|
|
|
STRING(256, manifest_template_file, "", str_nonempty,, "Path of manifest template file, either absolute or relative to instance directory")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(sid_t, default_author, SID_ANY, sid,, "Author of add-file bundle if sender not given")
|
|
|
|
ATOM(rhizome_bk_t, bundle_secret_key, RHIZOME_BK_NONE, rhizome_bk,, "Secret key of add-file bundle to try if sender not given")
|
2012-11-29 02:51:12 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2013-10-14 07:16:09 +00:00
|
|
|
STRUCT(rhizome_api_restful)
|
|
|
|
SUB_STRUCT(userlist, users,)
|
2013-11-19 05:13:51 +00:00
|
|
|
ATOM(uint32_t, newsince_timeout, 60, uint32_time_interval,, "Time to block while reporting new bundles")
|
2013-11-20 04:20:57 +00:00
|
|
|
ATOM(uint32_t, newsince_poll_ms, 2000, uint32_nonzero,, "Database poll interval while blocked reporting new bundles")
|
2013-10-14 07:16:09 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-29 02:51:12 +00:00
|
|
|
STRUCT(rhizome_api)
|
|
|
|
SUB_STRUCT(rhizome_api_addfile, addfile,)
|
2013-10-14 07:16:09 +00:00
|
|
|
SUB_STRUCT(rhizome_api_restful, restful,)
|
2012-11-29 02:51:12 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-12-07 03:39:55 +00:00
|
|
|
STRUCT(rhizome_http)
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, enable, 1, boolean,, "If true, Rhizome HTTP server is started")
|
2012-12-07 03:39:55 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(rhizome_mdp)
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, enable, 1, boolean,, "If true, Rhizome MDP server is started")
|
2012-12-07 03:39:55 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(rhizome_advertise)
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, enable, 1, boolean,, "If true, Rhizome advertisements are sent")
|
2013-02-25 06:53:44 +00:00
|
|
|
ATOM(uint32_t, interval, 500, uint32_nonzero,, "Interval between Rhizome advertisements")
|
2012-12-07 03:39:55 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(rhizome)
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, enable, 1, boolean,, "If true, server opens Rhizome database when starting")
|
|
|
|
ATOM(bool_t, fetch, 1, boolean,, "If false, no new bundles will be fetched from peers")
|
2013-08-27 04:12:56 +00:00
|
|
|
ATOM(bool_t, clean_on_open, 0, boolean,, "If true, Rhizome database is cleaned at start of every command")
|
|
|
|
ATOM(bool_t, clean_on_start, 1, boolean,, "If true, Rhizome database is cleaned at start of daemon")
|
2014-03-07 06:25:38 +00:00
|
|
|
STRING(256, datastore_path, "", str_nonempty,, "Path of rhizome storage directory, absolute or relative to instance directory")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(uint64_t, database_size, 1000000, uint64_scaled,, "Size of database in bytes")
|
2013-12-30 04:21:20 +00:00
|
|
|
ATOM(uint32_t, max_blob_size, 128 * 1024, uint32_scaled,, "Store payloads larger than this in files not SQLite blobs")
|
2013-02-18 04:39:03 +00:00
|
|
|
|
2013-02-25 06:53:44 +00:00
|
|
|
ATOM(uint64_t, rhizome_mdp_block_size, 512, uint64_scaled,, "Rhizome MDP block size.")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(uint64_t, idle_timeout, RHIZOME_IDLE_TIMEOUT, uint64_scaled,, "Rhizome transfer timeout if no data received.")
|
2013-11-04 01:42:58 +00:00
|
|
|
ATOM(uint64_t, mdp_stall_timeout, 1000, uint64_scaled,, "Timeout to request more data via mdp.")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(uint32_t, fetch_delay_ms, 50, uint32_nonzero,, "Delay from receiving first bundle advert to initiating fetch")
|
2012-11-29 02:51:12 +00:00
|
|
|
SUB_STRUCT(rhizome_direct, direct,)
|
|
|
|
SUB_STRUCT(rhizome_api, api,)
|
2012-12-07 03:39:55 +00:00
|
|
|
SUB_STRUCT(rhizome_http, http,)
|
|
|
|
SUB_STRUCT(rhizome_mdp, mdp,)
|
|
|
|
SUB_STRUCT(rhizome_advertise, advertise,)
|
2012-11-22 23:41:07 +00:00
|
|
|
END_STRUCT
|
2012-11-22 07:50:13 +00:00
|
|
|
|
2012-11-22 23:41:07 +00:00
|
|
|
STRUCT(directory)
|
2013-02-25 06:53:44 +00:00
|
|
|
ATOM(sid_t, service, SID_ANY, sid,, "Subscriber ID of Serval Directory Service")
|
2012-11-22 23:41:07 +00:00
|
|
|
END_STRUCT
|
2012-11-21 07:39:05 +00:00
|
|
|
|
2012-11-28 19:58:28 +00:00
|
|
|
STRUCT(host)
|
2013-02-25 06:53:44 +00:00
|
|
|
STRING(INTERFACE_NAME_STRLEN, interface, "", str_nonempty,, "Interface name")
|
2013-03-05 02:05:30 +00:00
|
|
|
STRING(256, host, "", str_nonempty,, "Host Name")
|
|
|
|
ATOM(struct in_addr, address, hton_in_addr(INADDR_NONE), in_addr,, "Host IP address")
|
|
|
|
ATOM(uint16_t, port, PORT_DNA, uint16_nonzero,, "Port number")
|
2012-11-28 19:58:28 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-30 02:02:30 +00:00
|
|
|
ARRAY(host_list, NO_DUPLICATES)
|
2013-03-01 04:57:28 +00:00
|
|
|
KEY_ATOM(sid_t, sid)
|
2012-11-28 22:54:02 +00:00
|
|
|
VALUE_SUB_STRUCT(host)
|
|
|
|
END_ARRAY(32)
|
2012-11-28 19:58:28 +00:00
|
|
|
|
2012-12-05 02:28:07 +00:00
|
|
|
STRUCT(network_interface, vld_network_interface)
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, exclude, 0, boolean,, "If true, do not use matching interfaces")
|
|
|
|
ATOM(struct pattern_list, match, PATTERN_LIST_EMPTY, pattern_list,, "Names that match network interface")
|
2013-09-16 05:34:08 +00:00
|
|
|
ATOM(short, socket_type, SOCK_UNSPECIFIED, socket_type,, "Type of network socket; stream, dgram or file")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(short, encapsulation, ENCAP_OVERLAY, encapsulation,, "Type of packet encapsulation")
|
|
|
|
STRING(256, file, "", str_nonempty,, "Path of interface file, absolute or relative to server.interface_path")
|
|
|
|
ATOM(struct in_addr, dummy_address, hton_in_addr(INADDR_LOOPBACK), in_addr,, "Dummy interface address")
|
|
|
|
ATOM(struct in_addr, dummy_netmask, hton_in_addr(0xFFFFFF00), in_addr,, "Dummy interface netmask")
|
|
|
|
ATOM(uint16_t, port, PORT_DNA, uint16_nonzero,, "Port number for network interface")
|
2013-08-12 04:51:31 +00:00
|
|
|
ATOM(bool_t, drop_broadcasts, 0, boolean,, "If true, drop all incoming broadcast packets")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, drop_unicasts, 0, boolean,, "If true, drop all incoming unicast packets")
|
2013-08-12 04:51:31 +00:00
|
|
|
ATOM(uint16_t, drop_packets, 0, uint16_nonzero,, "Percentage of incoming packets that should be dropped for testing purposes")
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(short, type, OVERLAY_INTERFACE_WIFI, interface_type,, "Type of network interface")
|
2013-10-08 06:06:07 +00:00
|
|
|
SUB_STRUCT(mdp_iftype, mdp,)
|
2013-03-05 02:05:30 +00:00
|
|
|
ATOM(bool_t, send_broadcasts, 1, boolean,, "If false, don't send any broadcast packets")
|
|
|
|
ATOM(bool_t, default_route, 0, boolean,, "If true, use this interface as a default route")
|
|
|
|
ATOM(bool_t, prefer_unicast, 0, boolean,, "If true, send unicast data as unicast IP packets if available")
|
2013-07-15 05:57:41 +00:00
|
|
|
ATOM(bool_t, debug, 0, boolean,, "If true, log details of every outgoing packet")
|
2013-07-16 05:46:07 +00:00
|
|
|
ATOM(bool_t, point_to_point, 0, boolean,, "If true, assume there will only be two devices on this interface")
|
2013-07-15 05:57:41 +00:00
|
|
|
ATOM(bool_t, ctsrts, 0, boolean,, "If true, enable CTS/RTS hardware handshaking")
|
|
|
|
ATOM(int32_t, uartbps, 57600, int32_rs232baudrate,, "Speed of serial UART link speed (which may be different to serial device link speed)")
|
2012-11-22 23:41:07 +00:00
|
|
|
END_STRUCT
|
2012-11-22 07:50:13 +00:00
|
|
|
|
2013-03-01 04:57:28 +00:00
|
|
|
ARRAY(interface_list, NO_DUPLICATES)
|
2013-02-25 06:53:44 +00:00
|
|
|
KEY_ATOM(unsigned, uint)
|
|
|
|
VALUE_NODE_STRUCT(network_interface, network_interface)
|
2012-11-28 22:54:02 +00:00
|
|
|
END_ARRAY(10)
|
2012-11-22 07:50:13 +00:00
|
|
|
|
2012-11-29 02:51:12 +00:00
|
|
|
// The top level.
|
2012-11-22 23:41:07 +00:00
|
|
|
STRUCT(main)
|
2013-02-25 06:53:44 +00:00
|
|
|
NODE_STRUCT(interface_list, interfaces, interface_list,)
|
2012-11-23 08:43:02 +00:00
|
|
|
SUB_STRUCT(log, log,)
|
2012-11-26 07:03:54 +00:00
|
|
|
SUB_STRUCT(server, server,)
|
2012-11-28 07:43:53 +00:00
|
|
|
SUB_STRUCT(monitor, monitor,)
|
2012-11-28 22:54:02 +00:00
|
|
|
SUB_STRUCT(mdp, mdp,)
|
2012-11-26 07:03:54 +00:00
|
|
|
SUB_STRUCT(dna, dna,)
|
2014-04-10 01:44:46 +00:00
|
|
|
SUB_STRUCT(vomp, vomp,)
|
2012-12-11 05:29:46 +00:00
|
|
|
SUB_STRUCT(debug, debug,)
|
2012-11-23 08:43:02 +00:00
|
|
|
SUB_STRUCT(rhizome, rhizome,)
|
|
|
|
SUB_STRUCT(directory, directory,)
|
2012-11-30 02:02:30 +00:00
|
|
|
SUB_STRUCT(olsr, olsr,)
|
2012-11-28 19:58:28 +00:00
|
|
|
SUB_STRUCT(host_list, hosts,)
|
2012-11-22 23:41:07 +00:00
|
|
|
END_STRUCT
|