Ferry Huberts [Mon, 30 Nov 2015 21:45:18 +0000 (22:45 +0100)]
txtinfo: add /runtime and /startup commands
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 21:44:47 +0000 (22:44 +0100)]
txtinfo: add (unsupported) commands '/config' and '/plugins'
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 21:41:23 +0000 (22:41 +0100)]
txtinfo: '/ver' and '/neighbours' are specials when determining the action
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 13:17:04 +0000 (14:17 +0100)]
txtinfo: send the information in the runtime and startup groups for '/all'
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 13:15:34 +0000 (14:15 +0100)]
txtinfo: catch '/all' earlier when determining the action
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 20:19:29 +0000 (21:19 +0100)]
txtinfo: treat the olsrd configuration differently
It is not included in the runtime or startup groups and
therefore not a 'normal' output.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 22:38:16 +0000 (23:38 +0100)]
txtinfo: use the same 'c-basic-offset: 2' as jsoninfo
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 06:58:28 +0000 (07:58 +0100)]
src: add some forgotten includes
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 14:06:57 +0000 (15:06 +0100)]
jsoninfo: remove an unused define
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 13:18:47 +0000 (14:18 +0100)]
jsoninfo: use the same order as txtinfo
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 13:18:21 +0000 (14:18 +0100)]
txtinfo: undo output re-ordering of
4563faa
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 12:51:12 +0000 (13:51 +0100)]
exit: fix some exit codes
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 12:45:11 +0000 (13:45 +0100)]
exit: use EXIT_SUCCESS or EXIT_FAILURE exclusively
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 11:49:07 +0000 (12:49 +0100)]
olsr_exit: fix some exit codes
EXIT_FAILURE is the correct code to return on failure (duh)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 11:28:28 +0000 (12:28 +0100)]
olsr_exit: use EXIT_SUCCESS or EXIT_FAILURE exclusively
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 12:58:29 +0000 (13:58 +0100)]
txtinfo: bring over proper http header support from jsoninfo
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 15:02:38 +0000 (16:02 +0100)]
jsoninfo: send http headers by default
Make it spec compliant
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 12:58:45 +0000 (13:58 +0100)]
jsoninfo: avoid a memcpy: just move the abuf.buf pointer and clear abuf
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 15:04:21 +0000 (16:04 +0100)]
jsoninfo: also send the (UTF-8) charset in the content type
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 12:37:41 +0000 (13:37 +0100)]
jsoninfo: refactor generation of the headers
Just generate the headers at the start, leaving the Content-Length
value empty with a 12-spaces placeholder. Then at the end fill
in the value.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 15:13:03 +0000 (16:13 +0100)]
txtinfo: avoid a memcpy: just move the abuf.buf pointer and clear abuf
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 15:12:01 +0000 (16:12 +0100)]
txtinfo: also send the (UTF-8) charset in the content type
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 13:00:54 +0000 (14:00 +0100)]
txtinfo: remove a pointless assert
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 11:58:35 +0000 (12:58 +0100)]
jsoninfo: fixup the Content-Length http header
Make it spec compliant
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 11:58:17 +0000 (12:58 +0100)]
jsoninfo: fixup the Content-Type http header
Make it spec compliant
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 11:58:00 +0000 (12:58 +0100)]
jsoninfo: fixup the Connection http header
Make it spec compliant
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 11:57:39 +0000 (12:57 +0100)]
jsoninfo: fixup the Server http header
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 11:57:27 +0000 (12:57 +0100)]
jsoninfo: ensure date in http header is in GMT, as advertised
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 12:28:54 +0000 (13:28 +0100)]
txtinfo: fixup the Content-Type http header
Make it spec compliant
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Fri, 27 Nov 2015 09:01:35 +0000 (10:01 +0100)]
jsoninfo: move json support functions into their own file
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 19:21:52 +0000 (20:21 +0100)]
jsoninfo: move some variables around
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 19:21:24 +0000 (20:21 +0100)]
jsoninfo: remove personal copyrights, just check the git log
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 19:14:44 +0000 (20:14 +0100)]
jsoninfo: fix content type of http headers for /olsr.conf
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 19:05:47 +0000 (20:05 +0100)]
jsoninfo: more formatting
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 19:05:35 +0000 (20:05 +0100)]
jsoninfo: rename a function
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 19:05:10 +0000 (20:05 +0100)]
jsoninfo: limit the number of in-flight connection to 3, like txtinfo
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 19:04:27 +0000 (20:04 +0100)]
jsoninfo: use a smaller (2 CPU pages) initial buffer
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 19:04:03 +0000 (20:04 +0100)]
jsoninfo: use the plugin name in a malloc call
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 18:59:37 +0000 (19:59 +0100)]
jsoninfo: move some functions around
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 18:52:12 +0000 (19:52 +0100)]
jsoninfo: update some comments
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 18:51:15 +0000 (19:51 +0100)]
jsoninfo: initialise outbuffer_count
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 18:49:52 +0000 (19:49 +0100)]
jsoninfo: use the set_plugin_boolean function
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 18:35:46 +0000 (19:35 +0100)]
jsoninfo: use a define to rename TXTINFO_ALLOW_LOCALHOST
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 18:32:15 +0000 (19:32 +0100)]
jsoninfo: use defines for some variables
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 17:46:55 +0000 (18:46 +0100)]
jsoninfo: use a define for the plugin name
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 19:21:36 +0000 (20:21 +0100)]
txtinfo: remove personal copyrights, just check the git log
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 18:48:01 +0000 (19:48 +0100)]
txtinfo: expand SIW_RUNTIME_ALL to include all runtime information
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 18:43:27 +0000 (19:43 +0100)]
txtinfo: remove superfluous forward declarations
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 17:43:15 +0000 (18:43 +0100)]
txtinfo: some more formatting
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 17:41:01 +0000 (18:41 +0100)]
txtinfo: send everything on an unknown option
Instead of all runtime information
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 17:38:51 +0000 (18:38 +0100)]
txtinfo: the configuration is a special case
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 17:28:58 +0000 (18:28 +0100)]
txtinfo: renumber SIW_x defines and put them in 'groups'
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 14:26:33 +0000 (15:26 +0100)]
txtinfo: use a bigger (2 CPU pages) initial buffer
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 14:24:29 +0000 (15:24 +0100)]
txtinfo: use HTTP/1.1
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 14:23:23 +0000 (15:23 +0100)]
txtinfo: http headers must use \r\n line endings
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 14:20:51 +0000 (15:20 +0100)]
txtinfo: add httpheaders configuration parameter
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 14:07:48 +0000 (15:07 +0100)]
txtinfo: simplify some comparisons
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 14:04:15 +0000 (15:04 +0100)]
txtinfo: re-order the sent information
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 14:00:22 +0000 (15:00 +0100)]
txtinfo: use the plugin name in a malloc call
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:58:59 +0000 (14:58 +0100)]
txtinfo: rename txtinfo_write_data function
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:55:20 +0000 (14:55 +0100)]
txtinfo: move ipc_print_version function up a bit
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:53:49 +0000 (14:53 +0100)]
txtinfo: move ipc_print_gateways function up a bit
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:51:09 +0000 (14:51 +0100)]
txtinfo: move ipc_print_mid function up a bit
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:45:34 +0000 (14:45 +0100)]
txtinfo: rename some SIW_x flags
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:43:35 +0000 (14:43 +0100)]
txtinfo: use a define to rename TXTINFO_ALLOW_LOCALHOST
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:40:07 +0000 (14:40 +0100)]
txtinfo: use defines for some variables
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:35:01 +0000 (14:35 +0100)]
txtinfo: rename some functions
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:48:15 +0000 (14:48 +0100)]
txtinfo: use a define for the plugin name
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:26:14 +0000 (14:26 +0100)]
txtinfo: simplify some send_what checks
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:23:38 +0000 (14:23 +0100)]
txtinfo: simplify some string comparisons
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:21:18 +0000 (14:21 +0100)]
txtinfo: simplify an ifdef
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:20:57 +0000 (14:20 +0100)]
txtinfo: use the same c-basic-offset: 2 as jsoninfo
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Thu, 26 Nov 2015 13:14:14 +0000 (14:14 +0100)]
txtinfo: format code
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 25 Nov 2015 23:25:33 +0000 (00:25 +0100)]
txtinfo: sgw: print the prefix length for IPv6
A mask has no meaning there.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 25 Nov 2015 23:22:10 +0000 (00:22 +0100)]
txtinfo: sgw: do not access uninitialised memory
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 24 Nov 2015 11:19:03 +0000 (12:19 +0100)]
txtinfo: sgw: line-up to jsoninfo
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 24 Nov 2015 11:18:09 +0000 (12:18 +0100)]
txtinfo: sgw: show entries without tc too
The tc is only used for the path cost, so simply show that as
ROUTE_COST_BROKEN when there is no tc.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 24 Nov 2015 07:57:43 +0000 (08:57 +0100)]
jsoninfo: sgw: minor simplification reducing memory usage
tunnelGw is the same as originator
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 23 Nov 2015 19:56:03 +0000 (20:56 +0100)]
jsoninfo: sgw: show entries without tc too
The tc is only used for the path cost, so simply show that as
ROUTE_COST_BROKEN when there is no tc.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 23 Nov 2015 20:00:23 +0000 (21:00 +0100)]
jsoninfo: sgw: show tableNr, ruleNr and bypassRuleNr too
Now all sgw info that is available is shown.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 23 Nov 2015 20:03:09 +0000 (21:03 +0100)]
jsoninfo: sgw: simplify prefix output
Show prefix and prefix length separately.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 23 Nov 2015 14:00:06 +0000 (15:00 +0100)]
jsoninfo: sgw field in /sgw response is not an array
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 23 Nov 2015 08:00:08 +0000 (09:00 +0100)]
sgw: only select an olsr or egress interface when it is up
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 17 Nov 2015 07:50:03 +0000 (08:50 +0100)]
main: minor update
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 17 Nov 2015 07:49:28 +0000 (08:49 +0100)]
main: open syslog right at the start
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 14:33:17 +0000 (15:33 +0100)]
conf: initialise sgw uplink & downlink before setting them
Since the setters call set_smart_gateway_bandwidth_zero which
depends on both values being initialised.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 13:51:39 +0000 (14:51 +0100)]
conf: do not leak the configuration when freeing it
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 12:33:17 +0000 (13:33 +0100)]
conf: olsrd_free_cnf: free everything
Free everything and do it (inversely) symmetrically
compared to startup.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 12:39:56 +0000 (13:39 +0100)]
conf: olsrd_free_cnf: reorder a bit
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 12:38:36 +0000 (13:38 +0100)]
conf: olsrd_free_cnf: refactor a bit to use the lists directly
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 11:06:42 +0000 (12:06 +0100)]
conf: olsrd_free_cnf: set pointers back to NULL after freeing
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 12:11:37 +0000 (13:11 +0100)]
conf: add ip_prefix_list_clear function
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 11:05:54 +0000 (12:05 +0100)]
conf: ensure all config fields are explicitly initialised
And in the same order as in the struct.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 11:59:26 +0000 (12:59 +0100)]
conf: make sure debug_handle is initialised
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 12:56:56 +0000 (13:56 +0100)]
conf: avoid memory leaks during parsing
On string variables/settings, when set/declared multiple times.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 16 Nov 2015 13:35:24 +0000 (14:35 +0100)]
lock_file: explicitly ignore failure of file removal
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 11 Nov 2015 11:55:30 +0000 (12:55 +0100)]
main: move some functions around
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 11 Nov 2015 11:48:22 +0000 (12:48 +0100)]
main: move CLI related function into their own file
And refactor to not invoke olsr_exit
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 11 Nov 2015 11:37:12 +0000 (12:37 +0100)]
main: stop the scheduler in olsr_shutdown
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 11 Nov 2015 11:35:36 +0000 (12:35 +0100)]
main: close the log in olsr_shutdown
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>