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 "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)
 
 DefineRunnerRegistrator (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)
 
static void clientdbGC (void *)
 
Ip::Addressclient_entry (Ip::Address *current)
 
variable_listsnmp_meshCtblFn (variable_list *Var, snint *ErrP)
 

Variables

static hash_tableclient_table = nullptr
 
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

◆ CLIENT_DB_HASH_SIZE

#define CLIENT_DB_HASH_SIZE   65357

Definition at line 49 of file client_db.cc.

◆ CUTOFF_SECONDS

#define CUTOFF_SECONDS   3600

Definition at line 206 of file client_db.cc.

Function Documentation

◆ client_entry()

Ip::Address * client_entry ( Ip::Address current)

◆ clientdbAdd()

◆ clientdbCutoffDenied()

◆ clientdbDump()

◆ clientdbEstablished()

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 182 of file client_db.cc.

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

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

◆ clientdbFreeItem()

static void clientdbFreeItem ( void *  data)
static

Definition at line 329 of file client_db.cc.

◆ clientdbGC()

◆ clientdbGetInfo()

◆ clientdbInit()

static void clientdbInit ( void  )
static

Definition at line 91 of file client_db.cc.

References CLIENT_DB_HASH_SIZE, client_table, hash_create(), and hash_string.

Referenced by ClientDbRr::useConfig().

◆ clientdbScheduledGC()

static void clientdbScheduledGC ( void *  )
static

Definition at line 350 of file client_db.cc.

References cleanup_scheduled, and clientdbStartGC().

Referenced by clientdbAdd(), and clientdbGC().

◆ clientdbStartGC()

static void clientdbStartGC ( void  )
static

◆ clientdbUpdate()

◆ DefineRunnerRegistrator()

DefineRunnerRegistrator ( ClientDbRr  )

◆ snmp_meshCtblFn()

Variable Documentation

◆ cleanup_removed

int cleanup_removed
static

Definition at line 46 of file client_db.cc.

Referenced by clientdbGC(), and clientdbStartGC().

◆ cleanup_running

int cleanup_running = 0
static

Definition at line 44 of file client_db.cc.

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

◆ cleanup_scheduled

int cleanup_scheduled = 0
static

Definition at line 45 of file client_db.cc.

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

◆ client_table

◆ clientdbFreeItem

FREE clientdbFreeItem
static

Definition at line 34 of file client_db.cc.

Referenced by clientdbGC().

◆ max_clients

int max_clients = 32768
static

Definition at line 39 of file client_db.cc.

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors