libdnet-stripped/route: add the interface name to the route_entry struct
libdnet-stripped/route-linux: route_entry should be zeroed
libdnet-stripped/route-linux: read ipv4 interface name from route entries
libdnet-stripped/route-linux: avoid an off-by-one overwrite.

Add a byte to destination buffer since sscanf will add a null terminator.
libdnet-stripped/route-linux: read interface name from IPv6 routes
libnetutil: add the device name support to sys_route struct
libdnet-stripped/route-linux: add a missing struct key word

Fix a compilation error by adding the missing struct key word.
libnetutil: copy device name from libdnet

Copy the device name so we can use it to match routes correctly. This
will handle the following cases:

(1) Where the gateway address goes through another route on the same
    device.
(2) Where the same address and route can be used by multiple interfaces.
libnetutil: Check the device name before any match

Before any gateway matching, check if the route is referencing the
appropriate device.
libnetutil: revert last commit

Revert last commit 'libnetutil: Check the device name before any match'
since we will need to improve the route matching logic and the commit
history.
libnetutil: check the device name before matching remaining routes

The second stage matching tries to find and match remaining routes that
don't have interfaces. However the interface that handles the default
route might end up matching all these remaining routes, and all these
remaining routes will be attached to the wrong interface.

Fix this by explicitly checking if the device name also matches.

This was also reported by Thomas, Ulrich H.
http://seclists.org/nmap-dev/2012/q2/884
libnetutil: Add sys_route pointer to reduce dereferences

Add a direct pointer to the current route to reduce the number of
dereferences and to make the code more readable.
libnetutil: check if the gateway was set in the current route

This commit fixes two different bugs:

(1) First in some situations Nmap will only see routes that are attached
to the device that handles the default route.

(2) On boxes without a default route, Nmap will not see any route.

These two bugs are caused by sysroutes_dnet_find_interfaces() logic
which will use only the geteway to match interface addresses.

To fix this, first check the current route and see if the gateway was set
otherwise use the destination address to match the address of an
interface.
libnetutil: Add a comment to note the check on the gateway
libnetutil: check the device name before the gateway/destination match

Some route entries will match interface addresses which are on the wrong
device.

The best example is the IPv6 link local generated addresses which are
assigned to every IPv6 network interface with the prefix fe80::/64.

If we do not explicitly check the interface name, then the first returned
interface with an IPv6 link local address will match all fe80::/64 routes.
This will result on: all these routes will be attached to that first same
interface.

This patch will modify sysroutes_dnet_find_interfaces() function to check
first the interface name, to see if the current route entry and interface
are referencing the same device, if so then move forward, otherwise just
ignore the current interface and loop to the next one.

Before patch (all routes will attached to wlan0):
**************************ROUTES**************************
DST/MASK         DEV    GATEWAY
fe80::/64        wlan0
fe80::/64        wlan0

After patch (each route will be attached to its appropriate device):
**************************ROUTES**************************
DST/MASK         DEV    GATEWAY
fe80::/64        eth0
fe80::/64        wlan0
libnetutil: add an error message to note that the device was not found

Add an error message to note that route tables are referencing an
interface that we were not able to find in the network interfaces list.

This perhaps will show some rare situations where the list all network
interfaces logic contains some bugs.
libdnet-stripped/route-linux: check if the IPv6 route is usable
libdnet-stripped/route-linux: make iflags unsigned int
libdnet-stripped/route-linux: ipv4 route input contains 11 element
libdnet-stripped/route-linux: ipv6 route: check the number of input elements