49#define CLIENT_DB_HASH_SIZE 65357
51#define CLIENT_DB_HASH_SIZE 467
62 , writeLimitingActive(false),
63 firstTimeConnection(true),
70 debugs(77, 9,
"ClientInfo constructed, this=" <<
static_cast<void*
>(
this));
131 debugs(77,
DBG_IMPORTANT,
"Client db does not contain information for given IP address "<<(
const char*)key);
154 debug_trap(
"clientdbUpdate: Failed to add entry");
199 debug_trap(
"clientdbUpdate: Failed to add entry");
206#define CUTOFF_SECONDS 3600
252 " ICP replies are DENIED");
312 " %-20.20s %7d %3d%%\n",
341 q->clientInfo =
nullptr;
346 debugs(77, 9,
"ClientInfo destructed, this=" <<
static_cast<void*
>(
this));
359 static int bucket = 0;
364 while (link_next !=
nullptr) {
367 link_next = link_next->
next;
372 if (age < 24 * 3600 && c->
Http.n_requests > 100)
438 return c ? &c->
addr :
nullptr;
460 keyIp.
toStr(key,
sizeof(key));
461 debugs(49, 5,
"[" << key <<
"] requested!");
465 debugs(49, 5,
"not found.");
491 Answer->
val_len = strlen(client);
553 debugs(49, 5,
"snmp_meshCtblFn: illegal column.");
#define DefineRunnerRegistrator(ClassName)
Base class for Squid-to-client bandwidth limiting.
void useConfig() override
struct ClientInfo::Protocol Icp
CommQuotaQueue * quotaQueue
clients waiting for more write quota
ClientInfo(const Ip::Address &)
struct ClientInfo::Protocol Http
struct ClientInfo::Cutoff cutoff
char * toStr(char *buf, const unsigned int blen, int force=AF_UNSPEC) const
struct SquidConfig::@90 onoff
struct StatCounters::@104 client_http
static void clientdbGC(void *)
static int cleanup_running
static void clientdbStartGC(void)
Ip::Address * client_entry(Ip::Address *current)
int clientdbEstablished(const Ip::Address &addr, int delta)
void clientdbUpdate(const Ip::Address &addr, const LogTags <ype, AnyP::ProtocolType p, size_t size)
static void clientdbScheduledGC(void *)
static int cleanup_removed
variable_list * snmp_meshCtblFn(variable_list *Var, snint *ErrP)
static ClientInfo * clientdbAdd(const Ip::Address &addr)
static void clientdbInit(void)
static int cleanup_scheduled
static hash_table * client_table
static FREE clientdbFreeItem
int clientdbCutoffDenied(const Ip::Address &addr)
ClientInfo * clientdbGetInfo(const Ip::Address &addr)
#define CLIENT_DB_HASH_SIZE
void clientdbDump(StoreEntry *sentry)
#define debugs(SECTION, LEVEL, CONTENT)
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
const char * fqdncache_gethostbyaddr(const Ip::Address &addr, int flags)
hash_link * hash_lookup(hash_table *, const void *)
hash_table * hash_create(HASHCMP *, int, HASHHASH *)
int HASHCMP(const void *, const void *)
void hash_last(hash_table *)
hash_link * hash_next(hash_table *)
hash_link * hash_get_bucket(hash_table *, unsigned int)
void hash_first(hash_table *)
void hash_join(hash_table *, hash_link *)
void hash_remove_link(hash_table *, hash_link *)
const char * hashKeyStr(const hash_link *)
#define MAX_IPSTRLEN
Length of buffer that needs to be allocated to old a null-terminated IP-string.
int intPercent(const int a, const int b)
void RegisterAction(char const *action, char const *desc, OBJH *handler, Protected, Atomic, Format)
const char * snmpDebugOid(oid *Name, snint Len, MemBuf &outbuf)
void oid2addr(oid *id, Ip::Address &addr, u_int size)
#define SNMP_ERR_NOSUCHNAME
#define INETADDRESSTYPE_IPV4
struct variable_list * snmp_var_new(oid *, int)
#define INETADDRESSTYPE_IPV6
struct variable_list * snmp_var_new_integer(oid *, int, int, unsigned char)
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
ByteCounter hit_kbytes_out
int result_hist[LOG_TYPE_MAX]
union variable_list::@0 val