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/dhcpv4.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/dhcpv4.h')
-rw-r--r-- | accel-pppd/ctrl/ipoe/dhcpv4.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.h b/accel-pppd/ctrl/ipoe/dhcpv4.h index a7fa5a90..ebb67cfb 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.h +++ b/accel-pppd/ctrl/ipoe/dhcpv4.h @@ -32,6 +32,8 @@ #define DHCPRELEASE 7 #define DHCPINFORM 8 +#define ACCEL_PPP_MAGIC 0xfd56b60a + struct dhcpv4_hdr { uint8_t op; uint8_t htype; @@ -117,6 +119,8 @@ int dhcpv4_relay_send_release(struct dhcpv4_relay *relay, uint8_t *chaddr, uint3 int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_packet *req, uint32_t yiaddr, uint32_t siaddr, uint32_t router, uint32_t mask, int lease_time, int renew_time, struct dhcpv4_packet *relay_reply); int dhcpv4_send_nak(struct dhcpv4_serv *serv, struct dhcpv4_packet *req); +void dhcpv4_send_notify(struct dhcpv4_serv *serv, struct dhcpv4_packet *req, unsigned int weight); + void dhcpv4_packet_ref(struct dhcpv4_packet *pack); struct dhcpv4_option *dhcpv4_packet_find_opt(struct dhcpv4_packet *pack, int type); int dhcpv4_packet_insert_opt82(struct dhcpv4_packet *pack, const char *agent_circuit_id, const char *agent_remote_id); |