aboutsummaryrefslogtreecommitdiffstats
path: root/pingu_netlink.c
Commit message (Collapse)AuthorAgeFilesLines
* pingu_iface: support binding multiple ping hosts to same ifaceNatanael Copa2011-10-071-3/+1
| | | | | | | Add config option for executing actions when interface gateway goes up/down. Add config option for required hosts up per interface (defaults to 1)
* pingu: rename pingu_gateway to pingu_routeNatanael Copa2011-10-071-12/+12
|
* pingu_netlink: log route changes as info instead as debugNatanael Copa2011-09-231-1/+1
| | | | Routing changes should not happen that often so we can log them as info
* pingu_netlink: delete multipath route if there are no pathsNatanael Copa2011-09-091-2/+4
| | | | | | The normal action is to replace but if all ISPs goes down we need to explicit delete the multipath route. Otherwise we will have the last default gw hanging around.
* pingu_host: cleanup. use constant to indicate host online/offlineNatanael Copa2011-09-091-1/+2
| | | | This is to make code cleaner and easier to read.
* pingu_netlink: do not add dead routes to multipathNatanael Copa2011-09-091-1/+4
| | | | | We don't was add a multipath via an interface that a pinghost has set as DOWN.
* pingu_netlink: delete the exact multipath we createdNatanael Copa2011-09-091-7/+20
| | | | | We need to keep track how we created the multipath and delete the corresponding.
* pingu_netlink: do not try remove routes that kernel aready removedNatanael Copa2011-09-091-4/+8
| | | | | | | When losing an address the kernel will remove the routes with it so we don't need to try remove it. This is only to avoid error messages in log.
* pingu_netlink: update iface index even if we dont have linkNatanael Copa2011-09-081-11/+9
| | | | | We might have got a new interface but still not got a link. We need update the iface index in such case.
* pingu_netlink: remove ip rule before we reset the addressNatanael Copa2011-09-081-1/+1
| | | | We use the address when removing the ip rule.
* pingu_netlink: save all routes for cleaup laterNatanael Copa2011-09-081-28/+15
| | | | | Instead of only saving the default gateways we save all routes and use those when we clean up on exit.
* pingu_netlink: flush route tables on exitNatanael Copa2011-09-071-0/+26
|
* pingu_{iface,netlink}: only remove route rules that we actually createdNatanael Copa2011-09-071-2/+11
|
* pingu_netlink: get errorcodes from route changesNatanael Copa2011-09-071-37/+83
| | | | | We use netlink_talk() to get back the error code. This helps us to giver more accurate error messages in logs.
* pingu: cleanup on exitNatanael Copa2011-09-061-1/+14
| | | | We remove the ip rule, close the ping sockets and netlink sockets.
* pingu: only create/lose binding when we get/lose addressNatanael Copa2011-09-061-1/+1
| | | | | We don't need to rebind every burst. We only bind when we get an address and we only lose the binding when the address is lost.
* pingu_netlink: fix logging of routesNatanael Copa2011-09-061-3/+5
| | | | Sometimes we have via a gateway and sometimes we don't.
* pingu_netlink: create nexthop route even if its aloneNatanael Copa2011-08-181-3/+1
| | | | | Otherwise it will not adjust the default route if one of the ISPs goes down.
* pingu: add config option 'load-balance'Natanael Copa2011-08-161-4/+12
| | | | | Add a config option to tell pingu that we want the interface to be load balanced. We also have an optional value to tell the weight.
* pingu: implement load balancing with nexthopsNatanael Copa2011-08-151-14/+132
| | | | We do loadbalancing by creating a new default gw with nexthops
* pingu_gateway: move is_default_gwNatanael Copa2011-08-151-14/+0
| | | | It belongs in pingu_gateway
* pingu_netlink: log error responsesNatanael Copa2011-08-151-0/+13
|
* pingu: use source address for ip rule and copy scope link routeNatanael Copa2011-08-021-14/+27
|
* pingu: remove default gw from main route table when isp goes downNatanael Copa2011-07-291-3/+10
|
* pingu: clean up for ipv6 support in futureNatanael Copa2011-07-281-49/+89
| | | | | | | make the pingu_gateway struct also hold a destination so the struct can be reused. use sockaddr_any as much as possible.
* pingu: add gw to list and minor cleanupNatanael Copa2011-07-281-2/+6
| | | | | | | | - add default gateways to our gw list - use sockaddr_init to init our gw - implement sockaddr_to_string TODO: delete default gateways from list
* pingu_netlink: remove duplicate routing code.Natanael Copa2011-07-281-43/+16
|
* pingu_netlink: add support for metric and sync deleted routesNatanael Copa2011-07-221-19/+98
| | | | | If a route is manually removed in main table we also remove it from our separate route table.
* pingu: create or delete ip rule on link status changeNatanael Copa2011-07-211-7/+58
| | | | | When we detect link on interface we create a route rule and we delete it when we lose the link.
* pingu: add initial code to modify routing tablesNatanael Copa2011-07-211-5/+91
| | | | | For now we just create the alternate routing tables from table 10 and +1 for each new interface. First interface is 10, second is 11 etc.
* pingu_netlink: pick up primary address for interfacesNatanael Copa2011-07-151-7/+50
|
* pingu_netlink: monitor link status of interfaces via netlinkNatanael Copa2011-07-131-0/+318