olsrd.git
4 years agoabuf: add abuf_concat function
Ferry Huberts [Thu, 7 Apr 2016 11:13:14 +0000 (13:13 +0200)]
abuf: add abuf_concat function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoplugin util: add set_plugin_long function
Ferry Huberts [Thu, 7 Apr 2016 19:31:23 +0000 (21:31 +0200)]
plugin util: add set_plugin_long function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoplugin util: make set_plugin_boolean actually set a bool
Ferry Huberts [Thu, 7 Apr 2016 19:01:37 +0000 (21:01 +0200)]
plugin util: make set_plugin_boolean actually set a bool

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: make SIW_ENTRIES accessible from other functions
Ferry Huberts [Thu, 7 Apr 2016 16:35:32 +0000 (18:35 +0200)]
info: make SIW_ENTRIES accessible from other functions

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: make the INFO_PLUGIN_CONFIG_PLUGIN_PARAMETERS a bit safer
Ferry Huberts [Thu, 7 Apr 2016 18:56:09 +0000 (20:56 +0200)]
info: make the INFO_PLUGIN_CONFIG_PLUGIN_PARAMETERS a bit safer

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: move some type delcarations up in a header file
Ferry Huberts [Thu, 7 Apr 2016 16:32:08 +0000 (18:32 +0200)]
info: move some type delcarations up in a header file

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: fix a type
Ferry Huberts [Thu, 7 Apr 2016 16:36:44 +0000 (18:36 +0200)]
info: fix a type

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: use AUTOBUFCHUNK instead of hard-coding it
Ferry Huberts [Thu, 7 Apr 2016 17:32:23 +0000 (19:32 +0200)]
info: use AUTOBUFCHUNK instead of hard-coding it

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: minor layout improvements
Ferry Huberts [Thu, 7 Apr 2016 19:06:16 +0000 (21:06 +0200)]
info: minor layout improvements

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agosgw: remove some dead code left over in the previous commit
Ferry Huberts [Thu, 7 Apr 2016 17:38:35 +0000 (19:38 +0200)]
sgw: remove some dead code left over in the previous commit

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agosgw: do not show unused tunnels in the status file
Ferry Huberts [Thu, 7 Apr 2016 10:51:00 +0000 (12:51 +0200)]
sgw: do not show unused tunnels in the status file

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agomake: improve jsoninfo and txtinfo dependencies on info
Ferry Huberts [Tue, 5 Apr 2016 19:46:57 +0000 (21:46 +0200)]
make: improve jsoninfo and txtinfo dependencies on info

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: in /sgw separate prefixes and their lengths
Ferry Huberts [Tue, 29 Mar 2016 14:44:30 +0000 (16:44 +0200)]
jsoninfo: in /sgw separate prefixes and their lengths

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: do not null-deref prefix in abuf_json_prefix
Ferry Huberts [Tue, 29 Mar 2016 12:10:16 +0000 (14:10 +0200)]
jsoninfo: do not null-deref prefix in abuf_json_prefix

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: also show egress information in /sgw
Ferry Huberts [Tue, 29 Mar 2016 07:46:40 +0000 (09:46 +0200)]
jsoninfo: also show egress information in /sgw

SO that the same information is shown as in the sgw status file.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agosgw: add isEgressSelected function
Ferry Huberts [Tue, 29 Mar 2016 07:47:07 +0000 (09:47 +0200)]
sgw: add isEgressSelected function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: rename json helpers files
Ferry Huberts [Tue, 29 Mar 2016 06:45:46 +0000 (08:45 +0200)]
info: rename json helpers files

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: move iterating over a table of siw/function entries into a function
Ferry Huberts [Mon, 28 Mar 2016 15:54:19 +0000 (17:54 +0200)]
info: move iterating over a table of siw/function entries into a function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: minor layout improvements
Ferry Huberts [Mon, 28 Mar 2016 15:52:20 +0000 (17:52 +0200)]
info: minor layout improvements

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: add abuf_json_prefix json helper
Ferry Huberts [Mon, 28 Mar 2016 11:07:13 +0000 (13:07 +0200)]
info: add abuf_json_prefix json helper

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: move json helpers here from jsoninfo
Ferry Huberts [Mon, 28 Mar 2016 10:02:48 +0000 (12:02 +0200)]
info: move json helpers here from jsoninfo

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agosgw: update a comment
Ferry Huberts [Thu, 24 Mar 2016 17:21:39 +0000 (18:21 +0100)]
sgw: update a comment

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoRevert "sgw: fix a mask in the sgw status file"
Ferry Huberts [Thu, 24 Mar 2016 17:13:17 +0000 (18:13 +0100)]
Revert "sgw: fix a mask in the sgw status file"

This reverts commit 3f329381a1d4edb3988cf84daa1bf85c586d42a0.

4 years agosgw: fix a mask in the sgw status file
Ferry Huberts [Thu, 24 Mar 2016 16:57:17 +0000 (17:57 +0100)]
sgw: fix a mask in the sgw status file

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: fix a typo in /config
Ferry Huberts [Thu, 24 Mar 2016 11:52:46 +0000 (12:52 +0100)]
jsoninfo: fix a typo in /config

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: remove a derived field from the /config output
Ferry Huberts [Tue, 22 Mar 2016 15:33:36 +0000 (16:33 +0100)]
jsoninfo: remove a derived field from the /config output

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: in /config rename sgw weight section to costsCalculation
Ferry Huberts [Mon, 21 Mar 2016 14:18:17 +0000 (15:18 +0100)]
jsoninfo: in /config rename sgw weight section to costsCalculation

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: improve /config
Ferry Huberts [Mon, 21 Mar 2016 13:38:55 +0000 (14:38 +0100)]
jsoninfo: improve /config

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: allow key to be NULL when printing a string
Ferry Huberts [Fri, 18 Mar 2016 16:34:19 +0000 (17:34 +0100)]
jsoninfo: allow key to be NULL when printing a string

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: in /interfaces show message times like validity times
Ferry Huberts [Fri, 18 Mar 2016 13:26:01 +0000 (14:26 +0100)]
jsoninfo: in /interfaces show message times like validity times

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: remove an obsolete comment
Ferry Huberts [Fri, 18 Mar 2016 12:58:22 +0000 (13:58 +0100)]
jsoninfo: remove an obsolete comment

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: in /interfaces use the new IP address helper function
Ferry Huberts [Fri, 18 Mar 2016 12:57:40 +0000 (13:57 +0100)]
jsoninfo: in /interfaces use the new IP address helper function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: in /interfaces show 'state' text as 'up' boolean
Ferry Huberts [Fri, 18 Mar 2016 12:57:18 +0000 (13:57 +0100)]
jsoninfo: in /interfaces show 'state' text as 'up' boolean

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: add a function to directly convert an IP address
Ferry Huberts [Fri, 18 Mar 2016 12:55:37 +0000 (13:55 +0100)]
jsoninfo: add a function to directly convert an IP address

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: create more space for more info commands
Ferry Huberts [Fri, 18 Mar 2016 08:22:21 +0000 (09:22 +0100)]
info: create more space for more info commands

By changing the bitmask to ULL.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: minor simplification in /2hop
Ferry Huberts [Thu, 17 Mar 2016 17:59:50 +0000 (18:59 +0100)]
jsoninfo: minor simplification in /2hop

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: print the 2-hops neighbors as a simple list of IP addresses
Ferry Huberts [Thu, 17 Mar 2016 17:33:35 +0000 (18:33 +0100)]
jsoninfo: print the 2-hops neighbors as a simple list of IP addresses

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: allow key to be NULL when printing an IP address
Ferry Huberts [Thu, 17 Mar 2016 17:31:10 +0000 (18:31 +0100)]
jsoninfo: allow key to be NULL when printing an IP address

For simple lists/sets

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: in /plugins list plugin parameters as map entries
Ferry Huberts [Thu, 17 Mar 2016 16:29:25 +0000 (17:29 +0100)]
jsoninfo: in /plugins list plugin parameters as map entries

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: simplify /mid output
Ferry Huberts [Thu, 17 Mar 2016 14:04:53 +0000 (15:04 +0100)]
jsoninfo: simplify /mid output

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: in /plugins show parameters as name/value
Ferry Huberts [Wed, 9 Mar 2016 15:03:33 +0000 (16:03 +0100)]
jsoninfo: in /plugins show parameters as name/value

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: in /plugins list plugin parameters as array entries
Ferry Huberts [Wed, 9 Mar 2016 13:37:06 +0000 (14:37 +0100)]
jsoninfo: in /plugins list plugin parameters as array entries

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: protect against out-of-bounds accesses of TXT array
Ferry Huberts [Wed, 9 Mar 2016 13:00:09 +0000 (14:00 +0100)]
jsoninfo: protect against out-of-bounds accesses of TXT array

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: protect against nulll-deref in print_interface_config
Ferry Huberts [Wed, 9 Mar 2016 12:43:29 +0000 (13:43 +0100)]
jsoninfo: protect against nulll-deref in print_interface_config

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: add some asserts
Ferry Huberts [Wed, 9 Mar 2016 12:43:05 +0000 (13:43 +0100)]
jsoninfo: add some asserts

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: re-introduce composite commands
Ferry Huberts [Wed, 9 Mar 2016 10:19:18 +0000 (11:19 +0100)]
info: re-introduce composite commands

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: skip multiple leading slashes on the command
Ferry Huberts [Tue, 8 Mar 2016 15:59:04 +0000 (16:59 +0100)]
info: skip multiple leading slashes on the command

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: strip trailing slashes from the command
Ferry Huberts [Tue, 8 Mar 2016 15:39:04 +0000 (16:39 +0100)]
info: strip trailing slashes from the command

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: move some static functions around
Ferry Huberts [Wed, 9 Mar 2016 12:00:43 +0000 (13:00 +0100)]
jsoninfo: move some static functions around

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: do not show interface /sys/class/net/data in /interfaces
Ferry Huberts [Tue, 8 Mar 2016 14:13:42 +0000 (15:13 +0100)]
jsoninfo: do not show interface /sys/class/net/data in /interfaces

Has nothing to do with olsrd and can be obtained through other means

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: improve /interfaces
Ferry Huberts [Mon, 7 Mar 2016 09:43:47 +0000 (10:43 +0100)]
jsoninfo: improve /interfaces

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: add print_interface_config function and use it
Ferry Huberts [Tue, 8 Mar 2016 09:22:45 +0000 (10:22 +0100)]
jsoninfo: add print_interface_config function and use it

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: use print_link_quality_multipliers_array_entry in /interfaces
Ferry Huberts [Mon, 7 Mar 2016 13:23:05 +0000 (14:23 +0100)]
jsoninfo: use print_link_quality_multipliers_array_entry in /interfaces

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: use the abuf_json_ip_address helper
Ferry Huberts [Mon, 7 Mar 2016 19:30:21 +0000 (20:30 +0100)]
jsoninfo: use the abuf_json_ip_address helper

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: improve and update /config
Ferry Huberts [Mon, 7 Mar 2016 09:41:19 +0000 (10:41 +0100)]
jsoninfo: improve and update /config

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: put printing a hna entry into a function and use it
Ferry Huberts [Mon, 7 Mar 2016 19:21:09 +0000 (20:21 +0100)]
jsoninfo: put printing a hna entry into a function and use it

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: minor improvements
Ferry Huberts [Mon, 7 Mar 2016 13:21:45 +0000 (14:21 +0100)]
jsoninfo: minor improvements

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: simplify output_error by using an abuf
Ferry Huberts [Mon, 7 Mar 2016 13:20:52 +0000 (14:20 +0100)]
jsoninfo: simplify output_error by using an abuf

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: add some comments
Ferry Huberts [Mon, 7 Mar 2016 09:41:39 +0000 (10:41 +0100)]
jsoninfo: add some comments

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: helpers: account for NaN and INF in float printing
Ferry Huberts [Tue, 8 Mar 2016 13:50:04 +0000 (14:50 +0100)]
jsoninfo: helpers: account for NaN and INF in float printing

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: helpers: output an empty string when the string is null
Ferry Huberts [Mon, 7 Mar 2016 09:17:17 +0000 (10:17 +0100)]
jsoninfo: helpers: output an empty string when the string is null

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: helpers: add asserts
Ferry Huberts [Mon, 7 Mar 2016 09:15:18 +0000 (10:15 +0100)]
jsoninfo: helpers: add asserts

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: helpers: move a static string declaration
Ferry Huberts [Mon, 7 Mar 2016 09:16:33 +0000 (10:16 +0100)]
jsoninfo: helpers: move a static string declaration

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: minor improvement to /2hop
Ferry Huberts [Mon, 7 Mar 2016 09:29:28 +0000 (10:29 +0100)]
jsoninfo: minor improvement to /2hop

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agomain: do not allow nested shutdown
Ferry Huberts [Mon, 7 Mar 2016 14:45:35 +0000 (15:45 +0100)]
main: do not allow nested shutdown

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoscheduler: make olsr_flush_timers more robust
Ferry Huberts [Mon, 7 Mar 2016 14:20:06 +0000 (15:20 +0100)]
scheduler: make olsr_flush_timers more robust

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoscheduler: do not stop timers that are not running
Ferry Huberts [Mon, 7 Mar 2016 14:19:42 +0000 (15:19 +0100)]
scheduler: do not stop timers that are not running

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoscheduler: fix a typo
Ferry Huberts [Mon, 7 Mar 2016 14:18:47 +0000 (15:18 +0100)]
scheduler: fix a typo

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: fix a windows compile error
Ferry Huberts [Mon, 7 Mar 2016 15:12:34 +0000 (16:12 +0100)]
jsoninfo: fix a windows compile error

src/olsrd_jsoninfo_helpers.c: In function 'abuf_json_int':
src/olsrd_jsoninfo_helpers.c:145:22: error: unknown conversion type character 'l' in format [-Werror=format=]
   abuf_appendf(abuf, "\"%s\": %lld", key, value);
                      ^
src/olsrd_jsoninfo_helpers.c:145:22: error: too many arguments for format [-Werror=format-extra-args]

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: simplify /plugins
Ferry Huberts [Sun, 6 Mar 2016 11:38:58 +0000 (12:38 +0100)]
jsoninfo: simplify /plugins

Treat all plugin parameters as strings, just like the
plugin loader does and just like in the configuration
file.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: make abuf_json_int take a long long value
Ferry Huberts [Sun, 6 Mar 2016 11:37:42 +0000 (12:37 +0100)]
jsoninfo: make abuf_json_int take a long long value

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agobmf: ignore case on the BmfMechanism plugin parameter value
Ferry Huberts [Sun, 6 Mar 2016 12:50:37 +0000 (13:50 +0100)]
bmf: ignore case on the BmfMechanism plugin parameter value

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoconfig: always lower-case plugin parameter names
Ferry Huberts [Sun, 6 Mar 2016 16:03:38 +0000 (17:03 +0100)]
config: always lower-case plugin parameter names

Case is already ignored and this avoids extra code in other plugins.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: show more information in /version
Ferry Huberts [Sun, 6 Mar 2016 09:59:26 +0000 (10:59 +0100)]
jsoninfo: show more information in /version

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agobuilddata: generate more build information
Ferry Huberts [Sat, 5 Mar 2016 21:03:12 +0000 (22:03 +0100)]
builddata: generate more build information

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: improve the skip condition in ipc_print_gateways_ipvx
Ferry Huberts [Sat, 5 Mar 2016 20:33:07 +0000 (21:33 +0100)]
jsoninfo: improve the skip condition in ipc_print_gateways_ipvx

Make it more readable, all the negations were confusing.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: improve the ipc_print_gateways_ipvx function
Ferry Huberts [Sat, 5 Mar 2016 20:24:22 +0000 (21:24 +0100)]
jsoninfo: improve the ipc_print_gateways_ipvx function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: improve printing a gateway entry, and add expiry/cleanup timers
Ferry Huberts [Sat, 5 Mar 2016 19:36:31 +0000 (20:36 +0100)]
jsoninfo: improve printing a gateway entry, and add expiry/cleanup timers

Affects /gateways and /sgw

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: improve /mid and add validityTime of mid entry itself
Ferry Huberts [Sat, 5 Mar 2016 17:11:11 +0000 (18:11 +0100)]
jsoninfo: improve /mid and add validityTime of mid entry itself

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agogui: fix a few clang warnings
Ferry Huberts [Sat, 5 Mar 2016 14:59:09 +0000 (15:59 +0100)]
gui: fix a few clang warnings

src/ipc.c:165:17: warning: cast from 'char *' to 'union olsr_message *' increases required alignment from 1 to 4 [-Wcast-align]
          msg = (union olsr_message *)&tmp[tmp_len];
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ipc.c:184:19: warning: cast from 'char *' to 'union olsr_message *' increases required alignment from 1 to 4 [-Wcast-align]
            msg = (union olsr_message *)tmp;
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
src/main.c:54:16: warning: cast from 'char *' to 'struct in_addr *' increases required alignment from 1 to 4 [-Wcast-align]
  in.s_addr = ((struct in_addr *)(hp->h_addr_list[0]))->s_addr;
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.c:60:26: warning: cast from 'char *' to 'struct in_addr *' increases required alignment from 1 to 4 [-Wcast-align]
  pin.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr_list[0]))->s_addr;
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agomake: fix compiler flags probing
Ferry Huberts [Sat, 5 Mar 2016 11:22:16 +0000 (12:22 +0100)]
make: fix compiler flags probing

Basically reverts
  "make: need to load the OS specific makefile before evaluating WARNINGS"
  d9b773d94c5f84a769a20a563f9cf25a81a030fa.
and then adds OS specific compiler support

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agomake: move -Werror flag into the normal list of warnings
Ferry Huberts [Sat, 5 Mar 2016 11:28:19 +0000 (12:28 +0100)]
make: move -Werror flag into the normal list of warnings

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agomake: do not add -Wcast-qual on Windows
Ferry Huberts [Sat, 5 Mar 2016 11:22:57 +0000 (12:22 +0100)]
make: do not add -Wcast-qual on Windows

It triggers a _lot_ of warnings in src/win32/compat.h

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agomake: improve clang support
Ferry Huberts [Sat, 5 Mar 2016 14:30:32 +0000 (15:30 +0100)]
make: improve clang support

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agomain: add noreturn attribute on olsr_segv_handler
Ferry Huberts [Sat, 5 Mar 2016 10:37:31 +0000 (11:37 +0100)]
main: add noreturn attribute on olsr_segv_handler

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agotxtinfo: check INFO_HTTP_OK upon entry of the function
Ferry Huberts [Fri, 4 Mar 2016 19:09:29 +0000 (20:09 +0100)]
txtinfo: check INFO_HTTP_OK upon entry of the function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: remove some dead code
Ferry Huberts [Fri, 4 Mar 2016 19:09:07 +0000 (20:09 +0100)]
jsoninfo: remove some dead code

INFO_HTTP_OK was already checked upon entry of the function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: check for retry after trying to send
Ferry Huberts [Fri, 4 Mar 2016 18:56:57 +0000 (19:56 +0100)]
info: check for retry after trying to send

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: speed up sending pending responses
Ferry Huberts [Fri, 4 Mar 2016 18:27:25 +0000 (19:27 +0100)]
info: speed up sending pending responses

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: try to send the response immediately
Ferry Huberts [Fri, 4 Mar 2016 18:20:11 +0000 (19:20 +0100)]
info: try to send the response immediately

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agoinfo: add a comment about why info_plugin_outbuffer_t is there
Ferry Huberts [Fri, 4 Mar 2016 18:18:06 +0000 (19:18 +0100)]
info: add a comment about why info_plugin_outbuffer_t is there

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: improve /hna
Ferry Huberts [Fri, 4 Mar 2016 16:37:56 +0000 (17:37 +0100)]
jsoninfo: improve /hna

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: improve /topology, show more information
Ferry Huberts [Fri, 4 Mar 2016 16:22:59 +0000 (17:22 +0100)]
jsoninfo: improve /topology, show more information

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: add etx to /routes
Ferry Huberts [Fri, 4 Mar 2016 15:15:42 +0000 (16:15 +0100)]
jsoninfo: add etx to /routes

And protect against a possible null-deref.
Minor optimisation.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: add hysteresis to /links
Ferry Huberts [Fri, 4 Mar 2016 14:38:47 +0000 (15:38 +0100)]
jsoninfo: add hysteresis to /links

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: all neighbour entries now have twoHopNeighborCount
Ferry Huberts [Fri, 4 Mar 2016 14:04:31 +0000 (15:04 +0100)]
jsoninfo: all neighbour entries now have twoHopNeighborCount

Affects a 2-hop neighbour entry, it gains this field.
Also improve ipc_print_neighbors_internal

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: re-arrange some imports
Ferry Huberts [Fri, 4 Mar 2016 12:49:34 +0000 (13:49 +0100)]
jsoninfo: re-arrange some imports

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agojsoninfo: output an error on unknown status codes too
Ferry Huberts [Fri, 4 Mar 2016 12:55:12 +0000 (13:55 +0100)]
jsoninfo: output an error on unknown status codes too

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agotxtinfo: move a function
Ferry Huberts [Fri, 4 Mar 2016 12:56:52 +0000 (13:56 +0100)]
txtinfo: move a function

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
4 years agotxtinfo: output an error on unknown status codes too
Ferry Huberts [Fri, 4 Mar 2016 12:56:02 +0000 (13:56 +0100)]
txtinfo: output an error on unknown status codes too

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>