Commit Graph

8 Commits

Author SHA1 Message Date
Tim Kourt cce59ad7f1 rtnlutil: Add connected and gateway route API
The API allows to add connected and gateway routes to the main
routing table.

rtnl_route_ipv4_add_gateway() is equivalent to the following
example 'ip route' command:
ip route add default via 10.0.0.1 dev wlan0 proto dhcp src 10.0.0.2 metric 339

rtnl_route_ipv4_add_connected()  is equivalent to the following
example 'ip route' command:
sudo ip route add 10.0.0.0/24 dev wlan0 proto dhcp src 10.0.0.2 scope link

The 'ip route' output from the above commands looks as follows:

rtnl_route_ipv4_add_connected():
10.0.0.0/24 dev wlan0 proto dhcp scope link src 10.0.0.2

rtnl_route_ipv4_add_gateway():
default via 10.0.0.1 dev wlan0 proto dhcp src 10.0.0.2 metric 339
2019-07-31 03:49:35 -05:00
Tim Kourt 1c7e803dbb rtnlutil: Add utility to DUMP ipv4 routes 2019-07-21 07:04:32 -05:00
Tim Kourt 83db65e929 rtnlutil: Add utility to extract route attributes 2019-07-20 06:51:46 -05:00
Denis Kenzior ec38545a68 rtnlutil: Add utility to set MAC address 2019-07-02 15:47:05 -05:00
Tim Kourt 6aabd80051 rtnlutil: Utils to Add/Remove IPv4 addresses 2019-06-26 10:36:59 -05:00
Tim Kourt 1368851611 netconfig: Obtain all currently assigned IPv4 addresses 2019-06-26 10:27:27 -05:00
Tim Kourt f3f343c04b rtnlutil: Add parser for ifaddrmsg struct
Its purpose is to extract interface label, ip, and
broadcast addresses out of ifaddrmsg rntl message.
2019-06-26 10:26:26 -05:00
Tim Kourt 5104e6752f rtnlutil: Introduce rtnl utility
The rtnl utility will encapsulate a collection of functions for rtnl ops.
2019-05-06 13:21:15 -05:00