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)
|
2012-11-29 04:03:32 +00:00
|
|
|
* ATOM(int32_t, element1, 0, cf_opt_int32_nonnegative,, "An integer >= 0")
|
|
|
|
* STRING(80, element2, "boo!", cf_opt_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,)
|
2012-11-29 04:03:32 +00:00
|
|
|
* KEY_STRING(3, happy, cf_opt_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,)
|
2012-11-29 04:03:32 +00:00
|
|
|
* STRING(128, another_thing, "", cf_opt_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:
|
|
|
|
*
|
2012-11-27 06:17:30 +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:
|
|
|
|
*
|
2012-11-26 05:45:59 +00:00
|
|
|
* ATOM(type, element, default, parsefunc, flags, comment)
|
|
|
|
* NODE(type, element, default, parsefunc, flags, comment)
|
2012-11-28 19:17:52 +00:00
|
|
|
* STRING(strlen, element, default, parsefunc, flags, comment)
|
2012-11-26 05:45:59 +00:00
|
|
|
* SUB_STRUCT(structname, element, flags)
|
|
|
|
* NODE_STRUCT(structname, element, parsefunc, flags)
|
|
|
|
*
|
2012-11-30 02:02:30 +00:00
|
|
|
* ARRAY(name, flags[, validatorfunc])
|
2012-11-28 22:54:02 +00:00
|
|
|
* key-declaration
|
|
|
|
* value-declaration
|
|
|
|
* END_ARRAY(size)
|
|
|
|
*
|
|
|
|
* where key-declaration is one of:
|
|
|
|
*
|
2012-11-29 01:18:01 +00:00
|
|
|
* KEY_ATOM(type, parsefunc[, comparefunc])
|
|
|
|
* KEY_STRING(strlen, parsefunc[, comparefunc])
|
2012-11-28 22:54:02 +00:00
|
|
|
*
|
|
|
|
* and value-declaration is one of:
|
|
|
|
*
|
|
|
|
* VALUE_ATOM(type, parsefunc)
|
|
|
|
* VALUE_STRING(strlen, parsefunc)
|
|
|
|
* VALUE_NODE(type, parsefunc)
|
|
|
|
* VALUE_SUB_STRUCT(structname)
|
|
|
|
* VALUE_NODE_STRUCT(structname, parsefunc)
|
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
|
|
|
|
* of the element. For STRING, KEY_STRING and VALUE_STRING this is implicitly a char[].
|
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.
|
|
|
|
* 'parsefunc'
|
2012-11-28 22:54:02 +00:00
|
|
|
* The function used to parse a VALUE from the config file for a STRUCT element, or a KEY or
|
|
|
|
* VALUE for an array element. Parse functions for ATOM, STRING, KEY_ATOM, KEY_STRING,
|
|
|
|
* VALUE_ATOM and VALUE_STRING all take a string argument (const char *) which is a
|
|
|
|
* nul-terminated text. The parse functions for NODE, NODE_STRUCT, VALUE_NODE and
|
|
|
|
* VALUE_NODE_STRUCT 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).
|
2012-11-29 01:18:01 +00:00
|
|
|
* 'comparefunc'
|
|
|
|
* A function used to sort an array after all elements have been parsed, and before being
|
|
|
|
* validated (see below).
|
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".
|
|
|
|
*
|
|
|
|
* @author Andrew Bettison <andrew@servalproject.com>
|
|
|
|
*/
|
|
|
|
|
2012-12-11 05:29:46 +00:00
|
|
|
STRUCT(debug)
|
|
|
|
ATOM(char, verbose, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, dnaresponses, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, dnahelper, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, queues, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, timing, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, io, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, verbose_io, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, packetformats, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, gateway, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, keyring, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, security, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, mdprequests, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, peers, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, overlayframes, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, overlayabbreviations, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, overlayrouting, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, overlayroutemonitor, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, overlayinterfaces, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, broadcasts, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, packettx, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, packetrx, 0, cf_opt_char_boolean,, "")
|
2013-02-04 19:12:50 +00:00
|
|
|
ATOM(char, packetradio, 0, cf_opt_char_boolean,, "")
|
2013-02-15 03:12:05 +00:00
|
|
|
ATOM(char, rejecteddata, 0, cf_opt_char_boolean,, "")
|
2013-02-14 20:11:40 +00:00
|
|
|
ATOM(char, slip, 0, cf_opt_char_boolean,, "")
|
2013-02-15 20:21:33 +00:00
|
|
|
ATOM(char, slipdecode, 0, cf_opt_char_boolean,, "")
|
2012-12-11 05:29:46 +00:00
|
|
|
ATOM(char, packetconstruction, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, rhizome, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, rhizome_tx, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, rhizome_rx, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, rhizome_ads, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, manifests, 0, cf_opt_char_boolean,, "")
|
|
|
|
ATOM(char, vomp, 0, cf_opt_char_boolean,, "")
|
2013-02-15 19:52:37 +00:00
|
|
|
ATOM(char, trace, 0, cf_opt_char_boolean,, "")
|
2013-02-16 17:47:24 +00:00
|
|
|
ATOM(char, profiling, 0, cf_opt_char_boolean,, "")
|
2013-02-18 03:47:20 +00:00
|
|
|
ATOM(char, externalblobs, 0, cf_opt_char_boolean,, "")
|
2012-12-11 05:29:46 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-22 23:41:07 +00:00
|
|
|
STRUCT(log)
|
2013-01-23 04:23:26 +00:00
|
|
|
STRING(256, file, "", cf_opt_str_nonempty,, "Path of log file, either absolute or relative to instance directory")
|
2012-12-11 05:29:46 +00:00
|
|
|
ATOM(int, show_pid, 1, cf_opt_int_boolean,, "If true, all log lines contain PID of logging process")
|
|
|
|
ATOM(int, show_time, 1, cf_opt_int_boolean,, "If true, all log lines contain time stamp")
|
2012-11-22 23:41:07 +00:00
|
|
|
END_STRUCT
|
2012-11-20 07:39:19 +00:00
|
|
|
|
2012-11-26 07:03:54 +00:00
|
|
|
STRUCT(server)
|
2012-11-29 04:03:32 +00:00
|
|
|
STRING(256, chdir, "/", cf_opt_absolute_path,, "Absolute path of chdir(2) for server process")
|
2013-02-14 03:48:56 +00:00
|
|
|
STRING(256, interface_path, "", cf_opt_str_nonempty,, "Path of directory containing interface files, either absolute or relative to instance directory")
|
2012-12-11 05:29:46 +00:00
|
|
|
ATOM(int, respawn_on_crash, 0, cf_opt_int_boolean,, "If true, server will exec(2) itself on fatal signals, eg SEGV")
|
2012-11-26 07:03:54 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-28 07:43:53 +00:00
|
|
|
STRUCT(monitor)
|
2012-11-29 04:03:32 +00:00
|
|
|
STRING(256, socket, DEFAULT_MONITOR_SOCKET_NAME, cf_opt_str_nonempty,, "Name of socket for monitor interface")
|
|
|
|
ATOM(int, uid, -1, cf_opt_int,, "Allowed UID for monitor socket client")
|
2012-11-28 22:54:02 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(mdp_iftype)
|
2012-12-13 07:20:09 +00:00
|
|
|
ATOM(uint32_t, tick_ms, -1, cf_opt_uint32_nonzero,, "Tick interval for this interface type")
|
|
|
|
ATOM(int, packet_interval, -1, cf_opt_int,, "Minimum interval between packets in microseconds")
|
2012-11-28 22:54:02 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-30 02:02:30 +00:00
|
|
|
ARRAY(mdp_iftypelist, NO_DUPLICATES)
|
2012-11-29 04:03:32 +00:00
|
|
|
KEY_ATOM(short, cf_opt_interface_type, cmp_short)
|
2012-11-28 22:54:02 +00:00
|
|
|
VALUE_SUB_STRUCT(mdp_iftype)
|
|
|
|
END_ARRAY(5)
|
|
|
|
|
|
|
|
STRUCT(mdp)
|
2012-11-29 04:03:32 +00:00
|
|
|
STRING(256, socket, DEFAULT_MDP_SOCKET_NAME, cf_opt_str_nonempty,, "Name of socket for MDP client interface")
|
2012-11-28 22:54:02 +00:00
|
|
|
SUB_STRUCT(mdp_iftypelist, iftype,)
|
2012-11-28 07:43:53 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-29 02:51:12 +00:00
|
|
|
STRUCT(olsr)
|
2012-12-11 05:29:46 +00:00
|
|
|
ATOM(int, enable, 1, cf_opt_int_boolean,, "If true, OLSR is used for mesh routing")
|
2012-12-07 00:44:05 +00:00
|
|
|
ATOM(uint16_t, remote_port,4130, cf_opt_uint16_nonzero,, "Remote port number")
|
|
|
|
ATOM(uint16_t, local_port, 4131, cf_opt_uint16_nonzero,, "Local port number")
|
2012-11-29 02:51:12 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
2012-11-30 02:02:30 +00:00
|
|
|
ARRAY(argv, SORTED NO_DUPLICATES, vld_argv)
|
2012-11-29 04:03:32 +00:00
|
|
|
KEY_ATOM(unsigned short, cf_opt_ushort_nonzero, cmp_ushort)
|
|
|
|
VALUE_STRING(128, cf_opt_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)
|
2012-11-29 04:03:32 +00:00
|
|
|
STRING(256, executable, "", cf_opt_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)
|
2012-11-29 04:03:32 +00:00
|
|
|
STRING(25, protocol, "http", cf_opt_protocol,, "Protocol name")
|
|
|
|
STRING(256, host, "", cf_opt_str_nonempty, MANDATORY, "Host name or IP address")
|
2012-12-07 00:44:05 +00:00
|
|
|
ATOM(uint16_t, port, RHIZOME_HTTP_PORT, cf_opt_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,)
|
2012-11-29 04:03:32 +00:00
|
|
|
KEY_STRING(15, cf_opt_str)
|
2012-12-04 03:42:28 +00:00
|
|
|
VALUE_NODE_STRUCT(rhizome_peer, cf_opt_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
|
|
|
|
2012-11-29 02:51:12 +00:00
|
|
|
STRUCT(rhizome_api_addfile)
|
2012-11-29 04:03:32 +00:00
|
|
|
STRING(64, uri_path, "", cf_opt_absolute_path,, "URI path for HTTP add-file request")
|
2013-02-05 06:26:37 +00:00
|
|
|
ATOM(struct in_addr, allow_host, hton_in_addr(INADDR_LOOPBACK), cf_opt_in_addr,, "IP address of host allowed to make HTTP add-file request")
|
2012-11-29 04:03:32 +00:00
|
|
|
STRING(256, manifest_template_file, "", cf_opt_str_nonempty,, "Path of manifest template file, either absolute or relative to instance directory")
|
2012-12-04 03:42:28 +00:00
|
|
|
ATOM(sid_t, default_author, SID_ANY, cf_opt_sid,, "Author of add-file bundle if sender not given")
|
2012-11-29 04:03:32 +00:00
|
|
|
ATOM(rhizome_bk_t, bundle_secret_key, RHIZOME_BK_NONE, cf_opt_rhizome_bk,, "Secret key of add-file bundle to try if sender not given")
|
2012-11-29 02:51:12 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(rhizome_api)
|
|
|
|
SUB_STRUCT(rhizome_api_addfile, addfile,)
|
|
|
|
END_STRUCT
|
|
|
|
|
2012-12-07 03:39:55 +00:00
|
|
|
STRUCT(rhizome_http)
|
2012-12-11 05:29:46 +00:00
|
|
|
ATOM(int, enable, 1, cf_opt_int_boolean,, "If true, Rhizome HTTP server is started")
|
2012-12-07 03:39:55 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(rhizome_mdp)
|
2012-12-11 05:29:46 +00:00
|
|
|
ATOM(int, enable, 1, cf_opt_int_boolean,, "If true, Rhizome MDP server is started")
|
2012-12-07 03:39:55 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(rhizome_advertise)
|
2012-12-11 05:29:46 +00:00
|
|
|
ATOM(int, enable, 1, cf_opt_int_boolean,, "If true, Rhizome advertisements are sent")
|
2013-02-14 06:48:01 +00:00
|
|
|
ATOM(uint32_t, interval, 500, cf_opt_uint32_nonzero,, "Interval between Rhizome advertisements")
|
2012-12-07 03:39:55 +00:00
|
|
|
END_STRUCT
|
|
|
|
|
|
|
|
STRUCT(rhizome)
|
2012-12-11 05:29:46 +00:00
|
|
|
ATOM(int, enable, 1, cf_opt_int_boolean,, "If true, server opens Rhizome database when starting")
|
2012-12-04 03:42:28 +00:00
|
|
|
STRING(256, datastore_path, "", cf_opt_absolute_path,, "Path of rhizome storage directory, absolute or relative to instance directory")
|
2012-11-29 04:03:32 +00:00
|
|
|
ATOM(uint64_t, database_size, 1000000, cf_opt_uint64_scaled,, "Size of database in bytes")
|
2013-02-16 09:55:26 +00:00
|
|
|
ATOM(uint64_t, max_internal_blob_size, 10000000000, cf_opt_uint64_scaled,, "Size of largest bundle to store internally in database.")
|
2013-02-17 06:31:23 +00:00
|
|
|
ATOM(uint64_t, rhizome_mdp_block_size, 512, cf_opt_uint64_scaled,, "Rhizome MDP block size.")
|
2013-02-17 07:07:34 +00:00
|
|
|
ATOM(uint64_t, idle_timeout, RHIZOME_IDLE_TIMEOUT, cf_opt_uint64_scaled,, "Rhizome transfer timeout if no data received.")
|
2012-11-29 04:03:32 +00:00
|
|
|
ATOM(uint32_t, fetch_delay_ms, 50, cf_opt_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)
|
2012-12-04 03:42:28 +00:00
|
|
|
ATOM(sid_t, service, SID_ANY, cf_opt_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)
|
2012-12-08 04:39:41 +00:00
|
|
|
STRING(INTERFACE_NAME_STRLEN, interface, "", cf_opt_str_nonempty,, "Interface name")
|
2012-12-07 01:41:48 +00:00
|
|
|
STRING(256, host, "", cf_opt_str_nonempty,, "Host Name")
|
2013-02-05 06:26:37 +00:00
|
|
|
ATOM(struct in_addr, address, hton_in_addr(INADDR_NONE), cf_opt_in_addr,, "Host IP address")
|
2012-12-07 00:44:05 +00:00
|
|
|
ATOM(uint16_t, port, PORT_DNA, cf_opt_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)
|
2012-11-29 04:03:32 +00:00
|
|
|
KEY_ATOM(sid_t, cf_opt_sid, cmp_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)
|
2012-12-11 05:29:46 +00:00
|
|
|
ATOM(int, exclude, 0, cf_opt_int_boolean,, "If true, do not use matching interfaces")
|
2012-12-05 02:28:07 +00:00
|
|
|
ATOM(struct pattern_list, match, PATTERN_LIST_EMPTY, cf_opt_pattern_list,, "Names that match network interface")
|
2013-02-14 03:48:56 +00:00
|
|
|
ATOM(int, socket_type, SOCK_UNSPECIFIED, cf_opt_socket_type,, "Type of network socket")
|
|
|
|
ATOM(int, encapsulation, ENCAP_OVERLAY, cf_opt_encapsulation,, "Type of packet encapsulation")
|
|
|
|
STRING(256, file, "", cf_opt_str_nonempty,, "Path of interface file, absolute or relative to server.interface_path")
|
2013-02-05 06:26:37 +00:00
|
|
|
ATOM(struct in_addr, dummy_address, hton_in_addr(INADDR_LOOPBACK), cf_opt_in_addr,, "Dummy interface address")
|
|
|
|
ATOM(struct in_addr, dummy_netmask, hton_in_addr(0xFFFFFF00), cf_opt_in_addr,, "Dummy interface netmask")
|
2013-02-14 03:48:56 +00:00
|
|
|
ATOM(uint16_t, port, PORT_DNA, cf_opt_uint16_nonzero,, "Port number for network interface")
|
|
|
|
ATOM(char, drop_broadcasts, 0, cf_opt_char_boolean,, "If true, drop all incoming broadcast packets")
|
|
|
|
ATOM(char, drop_unicasts, 0, cf_opt_char_boolean,, "If true, drop all incoming unicast packets")
|
2012-11-29 04:03:32 +00:00
|
|
|
ATOM(short, type, OVERLAY_INTERFACE_WIFI, cf_opt_interface_type,, "Type of network interface")
|
2012-12-13 07:20:09 +00:00
|
|
|
ATOM(int, packet_interval, -1, cf_opt_int,, "Minimum interval between packets in microseconds")
|
2012-12-04 03:42:28 +00:00
|
|
|
ATOM(int, mdp_tick_ms, -1, cf_opt_int32_nonneg,, "Override MDP tick interval for this interface")
|
2012-12-13 07:20:09 +00:00
|
|
|
ATOM(char, send_broadcasts, 1, cf_opt_char_boolean,, "If false, don't send any broadcast packets")
|
2013-01-29 00:57:13 +00:00
|
|
|
ATOM(char, default_route, 0, cf_opt_char_boolean,, "If true, use this interface as a default route")
|
|
|
|
ATOM(char, prefer_unicast, 0, cf_opt_char_boolean,, "If true, send unicast data as unicast IP packets if available")
|
2012-11-22 23:41:07 +00:00
|
|
|
END_STRUCT
|
2012-11-22 07:50:13 +00:00
|
|
|
|
2012-12-05 02:28:07 +00:00
|
|
|
ARRAY(interface_list, SORTED NO_DUPLICATES)
|
|
|
|
KEY_ATOM(unsigned, cf_opt_uint)
|
2012-12-04 07:52:26 +00:00
|
|
|
VALUE_NODE_STRUCT(network_interface, cf_opt_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)
|
2012-12-04 06:22:49 +00:00
|
|
|
NODE_STRUCT(interface_list, interfaces, cf_opt_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,)
|
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
|