Commit Graph

29 Commits

Author SHA1 Message Date
Andrew Bettison
757e6c62ab Merge network simulator into development 2014-05-26 15:52:40 +09:30
Andrew Bettison
21f51965c1 Overhaul Makefile and header files
Make .o files in separate subdirectories for servald and library
Factor struct __sourceloc and __WHENCE__ from "log.h" into "whence.h"
Factor sid_t etc from "serval.h" into "serval_types.h"
Factor rhizome_bid_t etc from "rhizome.h" into "rhizome_types.h"
Do not include "serval.h" in library sources
Add log_stderr.c and logMessage.c for stand-alone executables
2014-05-26 15:36:26 +09:30
Jeremy Lakeman
41853da7ce Use inline logMessage definition 2014-05-26 13:57:27 +09:30
Jeremy Lakeman
1d88df594b Fix unsigned warning 2014-01-09 15:01:37 +10:30
Andrew Bettison
9b64bb87e0 Uniform copyright notices
Added some missing copyright/license block comments
2013-12-04 17:15:36 +10:30
Andrew Bettison
92253ca97d Revive config_test.c
Move config-dependent code (recvwithttl) from net.c to mdp_net.c (new)

Move log-implementation-independent code from log.c to log_util.c (new)

Build config_test binary in Makefile
2013-11-21 16:05:17 +10:30
Andrew Bettison
a95ef79139 Use sid_t everywhere
Remove stowSid() at last

Change API of tohex() and strbuf_tohex(), to pass string length instead of
binary byte count.  This allows odd numbers of hex digits to be produced.

Remove alloca_tohex_sid(); replace with alloca_tohex_sid_t()

New alloca_tohex_sid_t_trunc() macro
2013-10-09 18:54:21 +10:30
Andrew Bettison
ffafae86b1 Issue #11: replace long long with int64_t 2013-10-07 05:54:46 +10:30
Andrew Bettison
4aac3637ed Improve new config code, SORTED and NO_DUPLICATE flags
Config Object Model parser now returns bitmask result of CFxxx flags and only
allocates root node if the config file is non-empty.

Added emalloc_zero().
2012-11-30 12:32:30 +10:30
Andrew Bettison
3686a4ade4 Improve new config code to use "log.h"
With all the __whence/__WHENCE__ goodness, ready for integration into servald.
2012-11-29 16:44:06 +10:30
Andrew Bettison
2853d346f1 Re-organise new config code some more
Split into several source .c files, leave throw-away code in config_test.c.
2012-11-29 16:07:34 +10:30
Andrew Bettison
32debf57ef Reorganise and rename new config code ready for integration 2012-11-29 14:33:32 +10:30
Andrew Bettison
23fff99fee Add remaining config options to new config schema 2012-11-29 13:21:12 +10:30
Andrew Bettison
b940ac8617 Improve new config prototype code
Sort ARRAYs if optional key comparison function is given in schema, no longer
the role of the validator function.
2012-11-29 11:48:01 +10:30
Andrew Bettison
e2f6989fe8 Improve new config prototype code
Rework ARRAYs, replacing label string with typed key, declaring KEY and VALUE
independently.

Implement dna.helper.argv array using key of type unsigned short.

Implement mdp.iftype.<interfacetype>.tick_ms using key of type short for the
interface type code.
2012-11-29 09:24:02 +10:30
Andrew Bettison
58bf0e1752 Improve new config prototype code
Add hosts.SIDHEX.{interface,network,port} config options.
2012-11-29 06:28:28 +10:30
Andrew Bettison
e7cda64190 Improve new config prototype code
The dna.helper.argv validation function now sorts the array in numerical order
of labels using qsort(3).

Add LABELLEN argument to ARRAY schema macros, to control the size of the
label[] string (was fixed at 41 chars before).
2012-11-29 05:47:52 +10:30
Andrew Bettison
c6b2efe396 Improve new config prototype code
Add monitor.socket and monitor.uid to schema.

Remove some deprecated warning functions.
2012-11-28 18:13:53 +10:30
Andrew Bettison
af6a912a1f Improve new config prototype code
Implement dna.helper.argv array label validation.

Ignore comment lines starting with '#'.
2012-11-28 17:54:19 +10:30
Andrew Bettison
8e8a3b1ea2 Improve new config prototype code
Add label parser functions to ARRAY schema, use to enforce numeric argv labels
numbered from 1.
2012-11-27 18:10:51 +10:30
Andrew Bettison
479ec5d0df Improve new config prototype code
Add optional validator functions for STRUCT and ARRAY parsing.  Tighten up
logic for parsing STRUCTs and ARRAYs and the result flags.  Improve
documentation in block comments.  Add CFUNSUPPORTED result flag.
2012-11-27 16:47:30 +10:30
Andrew Bettison
cf3c069f83 Improve new config prototype code
Refactor ARRAY_xxx() schema declaration macros to fix problem in ARRAY_STRING().

Add dna.helper.executable, dna.helper.argv and server.chdir to config schema.
2012-11-26 17:33:54 +10:30
Andrew Bettison
8479c52f54 Improve new config prototype code
Replace ARRAY() macro with ARRAY_ATOM(), ARRAY_STRING(), ARRAY_NODE() and
ARRAY_STRUCT().

Change parse function return value to flag bits, add CFEMPTY, rename CFMISSING
to CFINCOMPLETE, improve logic around mandatory struct items.

Renamed struct config_node to struct cf_om_node.
2012-11-26 16:12:46 +10:30
Andrew Bettison
2d7766eacd Improve new config prototype code
Finish parsing 'interfaces' old- and new-style.
2012-11-24 03:38:10 +10:30
Andrew Bettison
98c3af967d Improve new config prototype code
Refactor and rename, improve logic for reporting unsupported nodes.
2012-11-23 19:13:02 +10:30
Andrew Bettison
8c36b23417 Improve new config prototype code
Refactor to make opt_parsing() functions simpler for ATOM -- no need to check
for missing text or unsupported child nodes, or log parse failures.

Introduce NODE option which passes whole config_node struct to parsing
function.
2012-11-23 10:11:07 +10:30
Andrew Bettison
70531fccb6 Improve new config prototype code
Make config LISTs more flexible.  Start implementing existing config options:
directory.service (SID parsing), interfaces (better list logic).
2012-11-22 18:20:13 +10:30
Andrew Bettison
a3cdf17410 Improve new config prototype, add LIST to schema 2012-11-21 18:09:05 +10:30
Andrew Bettison
f78098afd8 Prototype code for new config parser 2012-11-20 18:10:38 +10:30