options: add IPv4 support to '--show-gateway <arg>'
This is an old debug option, which used to print "the default routes found"
for IPv4 and IPv6, and optionally "a route to a particular IPv6 target"
if passed an argument.
With the work started in commit
0fcfc8381f60d we want this to handle
IPv4 as well, mostly to be able to easily test per-platform
get_default_gateway() implementations.
The implementation is simplistic - if <arg> can be parsed as an IPv4 or
IPv6 address, that particular protocol lookup will do "the host route"
and the other one will stick to "the default route".
NOTE: as of this commit, there is no backend functionality for IPv4, so
it will not actually print anything interesting. This will be added in
further platform dependent commits.
v2: amend --help output
v3: uncrustify (#ifdef block too long, comments at #endif required now)
Change-Id: Ic438c583a782035ecb9b5ea65702a768ae2585f5
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <
20250129173007.3280-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30728.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>