diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2017-12-27 13:19:48 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2017-12-27 13:19:53 +0300 |
commit | 1d6f68a518cd7f8cc182080b57d76ed16dc3973a (patch) | |
tree | f6ee4aa24f323191bf7b7691a0546cfb7ac571e4 /accel-pppd/ctrl/ipoe/ipoe.h | |
parent | 4c746c721ed4fadc15964b725707faf753843a9d (diff) | |
download | accel-ppp-1d6f68a518cd7f8cc182080b57d76ed16dc3973a.tar.gz accel-ppp-1d6f68a518cd7f8cc182080b57d76ed16dc3973a.zip |
ipoe: implemented new load balancing mechanism
new config options:
[ipoe]
weight=N - global weight
interface=ethX,weight=N - per-interface weight
How it works:
On reception of DHCPDISCOVER accel-ppp sends broadcast DHCP message to port 67 with same xid and add special vendor-specific option
where encodes its current session count multipled by weight.
On reception of such message accel-ppp searches session with same xid and compares weight.
If received weight is less than session's weight then it terminates this session.
per-interface weight=0 has special meaning as backup (fail-over) interface, f.e. it terminates session on any received weight.
By default weight based load balancing is disabled.
To enable need to specify global or/and per-interface weight.
Diffstat (limited to 'accel-pppd/ctrl/ipoe/ipoe.h')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.h b/accel-pppd/ctrl/ipoe/ipoe.h index 2b04ea0..fc774f6 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.h +++ b/accel-pppd/ctrl/ipoe/ipoe.h @@ -37,6 +37,7 @@ struct ipoe_serv { int ifindex; uint8_t hwaddr[ETH_ALEN]; struct list_head sessions; + unsigned int sess_cnt; struct dhcpv4_serv *dhcpv4; struct dhcpv4_relay *dhcpv4_relay; void *arp; @@ -57,6 +58,7 @@ struct ipoe_serv { #ifdef USE_LUA char *opt_lua_username_func; #endif + int opt_weight; int opt_shared:1; int opt_dhcpv4:1; int opt_up:1; @@ -102,6 +104,7 @@ struct ipoe_session { int ifindex; char *username; struct ipv4db_item_t ipv4; + unsigned int weight; #ifdef RADIUS struct rad_plugin_t radius; #endif |