5
#include "config/config"
6
#include "timestamp/timestamp"
7
#include "balancer/balancer"
8
#include "ThreadsAndMutexes/mutex/mutex"
17
struct ClientDataCmp {
18
bool operator() (struct in_addr a, struct in_addr b) const {
20
memcpy (&la, &a, sizeof(long));
21
memcpy (&lb, &b, sizeof(long));
26
typedef map<struct in_addr, ClientData, ClientDataCmp> StoreMap;
28
static int target(struct in_addr clientip);
29
static void activity(struct in_addr clientip, unsigned curbackend);
30
static unsigned anticipated(unsigned bckend);
31
static void clear(struct in_addr clientip);
32
static void clearoldest();
34
static void on() { onoff = true; }
35
static void off() { onoff = false; }
41
static StoreMap store;