client_db.cc File Reference
#include "squid.h"
#include "base/RunnersRegistry.h"
#include "client_db.h"
#include "ClientInfo.h"
#include "event.h"
#include "format/Token.h"
#include "fqdncache.h"
#include "ip/Address.h"
#include "log/access_log.h"
#include "mgr/Registration.h"
#include "SquidConfig.h"
#include "SquidMath.h"
#include "SquidTime.h"
#include "StatCounters.h"
#include "Store.h"
#include "tools.h"
#include "snmp_core.h"
Include dependency graph for client_db.cc:

Go to the source code of this file.

Classes

class  ClientDbRr
 

Macros

#define CLIENT_DB_HASH_SIZE   65357
 
#define CUTOFF_SECONDS   3600
 

Functions

static ClientInfoclientdbAdd (const Ip::Address &addr)
 
static void clientdbStartGC (void)
 
static void clientdbScheduledGC (void *)
 
static void clientdbInit (void)
 
 RunnerRegistrationEntry (ClientDbRr)
 
ClientInfoclientdbGetInfo (const Ip::Address &addr)
 
void clientdbUpdate (const Ip::Address &addr, const LogTags &ltype, AnyP::ProtocolType p, size_t size)
 
int clientdbEstablished (const Ip::Address &addr, int delta)
 
int clientdbCutoffDenied (const Ip::Address &addr)
 
void clientdbDump (StoreEntry *sentry)
 
static void clientdbFreeItem (void *data)
 
void clientdbFreeMemory (void)
 
static void clientdbGC (void *)
 
Ip::Addressclient_entry (Ip::Address *current)
 
variable_listsnmp_meshCtblFn (variable_list *Var, snint *ErrP)
 

Variables

static hash_tableclient_table = NULL
 
static FREE clientdbFreeItem
 
static int max_clients = 32768
 
static int cleanup_running = 0
 
static int cleanup_scheduled = 0
 
static int cleanup_removed
 

Macro Definition Documentation

#define CLIENT_DB_HASH_SIZE   65357

Definition at line 50 of file client_db.cc.

Referenced by clientdbGC(), and clientdbInit().

#define CUTOFF_SECONDS   3600

Definition at line 207 of file client_db.cc.

Referenced by clientdbCutoffDenied().

Function Documentation

Ip::Address* client_entry ( Ip::Address current)
int clientdbEstablished ( const Ip::Address addr,
int  delta 
)

This function tracks the number of currently established connections for a client IP address. When a connection is accepted, call this with delta = 1. When the connection is closed, call with delta = -1. To get the current value, simply call with delta = 0.

Definition at line 183 of file client_db.cc.

References SquidConfig::client_db, clientdbAdd(), Config, debug_trap(), hash_lookup(), key, MAX_IPSTRLEN, ClientInfo::n_established, NULL, SquidConfig::onoff, and Ip::Address::toStr().

Referenced by ACLMaxConnection::match(), Comm::TcpAcceptor::oldAccept(), ConnStateData::swanSong(), and ConnStateData::whenClientIpKnown().

static void clientdbFreeItem ( void *  data)
static

Definition at line 330 of file client_db.cc.

void clientdbFreeMemory ( void  )

Definition at line 351 of file client_db.cc.

References clientdbFreeItem, hashFreeItems(), hashFreeMemory(), and NULL.

Referenced by SquidShutdown().

static void clientdbInit ( void  )
static

Definition at line 92 of file client_db.cc.

References CLIENT_DB_HASH_SIZE, hash_create(), and hash_string.

Referenced by ClientDbRr::useConfig().

static void clientdbScheduledGC ( void *  )
static

Definition at line 359 of file client_db.cc.

References cleanup_scheduled, and clientdbStartGC().

Referenced by clientdbAdd(), and clientdbGC().

static void clientdbStartGC ( void  )
static
RunnerRegistrationEntry ( ClientDbRr  )

Variable Documentation

int cleanup_removed
static

Definition at line 47 of file client_db.cc.

Referenced by clientdbGC(), and clientdbStartGC().

int cleanup_running = 0
static

Definition at line 45 of file client_db.cc.

Referenced by clientdbAdd(), clientdbGC(), and clientdbStartGC().

int cleanup_scheduled = 0
static

Definition at line 46 of file client_db.cc.

Referenced by clientdbAdd(), clientdbGC(), and clientdbScheduledGC().

hash_table* client_table = NULL
static

Definition at line 32 of file client_db.cc.

FREE clientdbFreeItem
static

Definition at line 35 of file client_db.cc.

Referenced by clientdbFreeMemory(), and clientdbGC().

int max_clients = 32768
static

Definition at line 40 of file client_db.cc.

Referenced by clientdbAdd(), clientdbGC(), and clientdbStartGC().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors