Ferry Huberts [Wed, 2 Dec 2015 10:32:51 +0000 (11:32 +0100)]
jsoninfo: put command parsing in the functions table
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:32:44 +0000 (11:32 +0100)]
txtinfo: put command parsing in the functions table
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:31:09 +0000 (11:31 +0100)]
jsoninfo: put the plugin init hook in the functions table
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:31:04 +0000 (11:31 +0100)]
txtinfo: put the plugin init hook in the functions table
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:29:40 +0000 (11:29 +0100)]
jsoninfo: determine the mime type via the functions table
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:29:32 +0000 (11:29 +0100)]
txtinfo: determine the mime type via the functions table
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 14:09:13 +0000 (15:09 +0100)]
jsoninfo: only need to reset entry number for json output
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:25:43 +0000 (11:25 +0100)]
jsoninfo: wrap the outbuffer in a struct for easier usage
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:25:39 +0000 (11:25 +0100)]
txtinfo: wrap the outbuffer in a struct for easier usage
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:24:08 +0000 (11:24 +0100)]
jsoninfo: move SIW_x defines into common code
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:24:04 +0000 (11:24 +0100)]
txtinfo: move SIW_x defines into common code
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 15:41:42 +0000 (16:41 +0100)]
jsoninfo: use a table of function pointers in send_info
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 08:53:38 +0000 (09:53 +0100)]
txtinfo: use a table of function pointers in send_info
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 07:31:04 +0000 (08:31 +0100)]
jsoninfo: move ipc_print_* functions into a 'printers' unit
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 07:08:19 +0000 (08:08 +0100)]
txtinfo: move ipc_print_* functions into a 'printers' unit
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 06:43:24 +0000 (07:43 +0100)]
jsoninfo: add plugin_init hook
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 06:43:14 +0000 (07:43 +0100)]
txtinfo: add plugin_init hook
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 06:41:37 +0000 (07:41 +0100)]
jsoninfo: move determining the action into a separate function
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 06:41:26 +0000 (07:41 +0100)]
txtinfo: move determining the action into a separate function
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:06:23 +0000 (11:06 +0100)]
jsoninfo: move http header related functions into common code
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:06:11 +0000 (11:06 +0100)]
txtinfo: move http header related functions into common code
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 20:37:23 +0000 (21:37 +0100)]
jsoninfo: add Freifunk neighbours special case, like txtinfo
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 20:33:00 +0000 (21:33 +0100)]
jsoninfo: fix some indents
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Wed, 2 Dec 2015 10:03:30 +0000 (11:03 +0100)]
jsoninfo: reorder some includes
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 08:14:04 +0000 (09:14 +0100)]
jsoninfo: use standard set_plugin_string function for uuidfile parameter
Not the custom store_string function
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 08:11:22 +0000 (09:11 +0100)]
jsoninfo: initialise uuidfile as well
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Tue, 1 Dec 2015 08:10:42 +0000 (09:10 +0100)]
jsoninfo: fix PLUGIN_NAME that is reported on plugin init
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Ferry Huberts [Mon, 30 Nov 2015 21:50:54 +0000 (22:50 +0100)]
jsoninfo: INADDR_LOOPBACK is in host format and the socket address is not
e2149e7 did this for txtinfo, but forgot to apply the same
fix for jsoninfo
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
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>