#include "squid.h"#include "event.h"#include "CacheManager.h"#include "ClientInfo.h"#include "ip/Address.h"#include "SquidMath.h"#include "SquidTime.h"#include "Store.h"
Go to the source code of this file.
Defines | |
| #define | CLIENT_DB_HASH_SIZE 467 |
| #define | CUTOFF_SECONDS 3600 |
Functions | |
| static ClientInfo * | clientdbAdd (const Ip::Address &addr) |
| static void | clientdbStartGC (void) |
| static void | clientdbScheduledGC (void *) |
| static void | clientdbRegisterWithCacheManager (void) |
| void | clientdbInit (void) |
| void | clientdbUpdate (const Ip::Address &addr, log_type ltype, protocol_t p, size_t size) |
| int | clientdbEstablished (const Ip::Address &addr, int delta) |
| int | clientdbCutoffDenied (const Ip::Address &addr) |
| log_type & | operator++ (log_type &aLogType) |
| void | clientdbDump (StoreEntry *sentry) |
| static void | clientdbFreeItem (void *data) |
| void | clientdbFreeMemory (void) |
| static void | clientdbGC (void *unused) |
| Ip::Address * | client_entry (Ip::Address *current) |
| variable_list * | snmp_meshCtblFn (variable_list *Var, snint *ErrP) |
Variables | |
| static hash_table * | client_table = NULL |
| static FREE | clientdbFreeItem |
| static int | max_clients = 32 |
| static int | cleanup_running = 0 |
| static int | cleanup_scheduled = 0 |
| static int | cleanup_removed |
Define Documentation
| #define CLIENT_DB_HASH_SIZE 467 |
Definition at line 57 of file client_db.cc.
Referenced by clientdbGC(), and clientdbInit().
| #define CUTOFF_SECONDS 3600 |
Definition at line 167 of file client_db.cc.
Referenced by clientdbCutoffDenied().
Function Documentation
| Ip::Address* client_entry | ( | Ip::Address * | current | ) |
Definition at line 385 of file client_db.cc.
References ClientInfo::addr, c, ClientInfo::hash, hash_first(), hash_last(), hash_next(), hashKeyStr(), MAX_IPSTRLEN, and NULL.
Referenced by client_Inst().
| static ClientInfo * clientdbAdd | ( | const Ip::Address & | addr | ) | [static] |
Definition at line 61 of file client_db.cc.
References ClientInfo::addr, c, cleanup_running, cleanup_scheduled, _StatCounters::client_http, clientdbScheduledGC(), _StatCounters::clients, eventAdd(), ClientInfo::hash, hash_join(), _hash_link::key, max_clients, MAX_IPSTRLEN, MEM_CLIENT_INFO, memAllocate(), NULL, and statCounter.
Referenced by clientdbEstablished(), and clientdbUpdate().
| int clientdbCutoffDenied | ( | const Ip::Address & | addr | ) |
Definition at line 170 of file client_db.cc.
References c, SquidConfig::client_db, Config, ClientInfo::cutoff, CUTOFF_SECONDS, debugs, hash_lookup(), ClientInfo::Icp, MAX_IPSTRLEN, ClientInfo::n_denied, ClientInfo::n_req, ClientInfo::n_requests, NULL, SquidConfig::onoff, p, ClientInfo::result_hist, squid_curtime, and ClientInfo::time.
Referenced by icpDenyAccess().
| void clientdbDump | ( | StoreEntry * | sentry | ) |
Definition at line 235 of file client_db.cc.
References ClientInfo::addr, c, fqdncache_gethostbyaddr(), ClientInfo::hash, hash_first(), hash_next(), hashKeyStr(), ClientInfo::Http, ClientInfo::Icp, Math::intPercent(), LOG_TAG_NONE, log_tags, LOG_UDP_HIT, logTypeIsATcpHit(), ClientInfo::n_established, ClientInfo::n_requests, name, ClientInfo::result_hist, and storeAppendPrintf().
Referenced by clientdbRegisterWithCacheManager().
| 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 143 of file client_db.cc.
References c, SquidConfig::client_db, clientdbAdd(), Config, debug_trap(), hash_lookup(), MAX_IPSTRLEN, ClientInfo::n_established, NULL, and SquidConfig::onoff.
Referenced by httpAccept(), httpsAccept(), ACLMaxConnection::match(), Comm::ListenStateData::oldAccept(), and ConnStateData::swanSong().
| static void clientdbFreeItem | ( | void * | data | ) | [static] |
Definition at line 298 of file client_db.cc.
References c, ClientInfo::hash, _hash_link::key, MEM_CLIENT_INFO, memFree(), and safe_free.
| void clientdbFreeMemory | ( | void | ) |
Definition at line 306 of file client_db.cc.
References clientdbFreeItem, hashFreeItems(), and hashFreeMemory().
Referenced by SquidShutdown().
| static void clientdbGC | ( | void * | unused | ) | [static] |
Definition at line 321 of file client_db.cc.
References c, cleanup_removed, cleanup_running, cleanup_scheduled, CLIENT_DB_HASH_SIZE, _StatCounters::client_http, clientdbFreeItem, clientdbScheduledGC(), _StatCounters::clients, debugs, eventAdd(), ClientInfo::hash, hash_get_bucket(), hash_remove_link(), ClientInfo::Http, ClientInfo::Icp, ClientInfo::last_seen, max_clients, ClientInfo::n_established, ClientInfo::n_requests, _hash_link::next, NULL, squid_curtime, and statCounter.
Referenced by clientdbStartGC().
| void clientdbInit | ( | void | ) |
Definition at line 87 of file client_db.cc.
References CLIENT_DB_HASH_SIZE, clientdbRegisterWithCacheManager(), hash_create(), and hash_string.
Referenced by serverConnectionsOpen().
| static void clientdbRegisterWithCacheManager | ( | void | ) | [static] |
Definition at line 80 of file client_db.cc.
References clientdbDump(), and CacheManager::GetInstance().
Referenced by clientdbInit().
| static void clientdbScheduledGC | ( | void * | unused | ) | [static] |
Definition at line 314 of file client_db.cc.
References cleanup_scheduled, and clientdbStartGC().
Referenced by clientdbAdd(), and clientdbGC().
| static void clientdbStartGC | ( | void | ) | [static] |
Definition at line 374 of file client_db.cc.
References cleanup_removed, cleanup_running, _StatCounters::client_http, clientdbGC(), _StatCounters::clients, max_clients, NULL, and statCounter.
Referenced by clientdbScheduledGC().
| void clientdbUpdate | ( | const Ip::Address & | addr, | |
| log_type | ltype, | |||
| protocol_t | p, | |||
| size_t | size | |||
| ) |
Definition at line 99 of file client_db.cc.
References c, SquidConfig::client_db, clientdbAdd(), Config, debug_trap(), hash_lookup(), ClientInfo::hit_kbytes_out, ClientInfo::Http, ClientInfo::Icp, kb_incr(), ClientInfo::kbytes_out, ClientInfo::last_seen, LOG_UDP_HIT, logTypeIsATcpHit(), MAX_IPSTRLEN, ClientInfo::n_requests, NULL, SquidConfig::onoff, PROTO_HTTP, PROTO_ICP, ClientInfo::result_hist, and squid_curtime.
Referenced by icpDenyAccess(), icpLogIcp(), and ClientHttpRequest::logRequest().
Definition at line 227 of file client_db.cc.
| variable_list* snmp_meshCtblFn | ( | variable_list * | Var, | |
| snint * | ErrP | |||
| ) |
Definition at line 414 of file client_db.cc.
References ClientInfo::addr, c, debugs, hash_lookup(), HERE, ClientInfo::hit_kbytes_out, ClientInfo::Http, ClientInfo::Icp, INETADDRESSTYPE_IPV4, kb_t::kb, ClientInfo::kbytes_out, LEN_SQ_NET, LOG_TAG_NONE, logTypeIsATcpHit(), MAX_IPSTRLEN, MESH_CTBL_ADDR, MESH_CTBL_ADDR_TYPE, MESH_CTBL_HTBYTES, MESH_CTBL_HTHITBYTES, MESH_CTBL_HTHITS, MESH_CTBL_HTREQ, MESH_CTBL_ICPBYTES, MESH_CTBL_ICPHITBYTES, MESH_CTBL_ICPHITS, MESH_CTBL_ICPREQ, ClientInfo::n_requests, variable_list::name, variable_list::name_length, NULL, oid2addr(), ClientInfo::result_hist, SMI_COUNTER32, SMI_INTEGER, snint, snmp_var_new(), snmp_var_new_integer(), snmpDebugOid(), variable_list::string, variable_list::type, variable_list::val, variable_list::val_len, and xstrdup().
Referenced by snmpInit().
Variable Documentation
int cleanup_removed [static] |
Definition at line 55 of file client_db.cc.
Referenced by clientdbGC(), and clientdbStartGC().
int cleanup_running = 0 [static] |
Definition at line 53 of file client_db.cc.
Referenced by clientdbAdd(), clientdbGC(), and clientdbStartGC().
int cleanup_scheduled = 0 [static] |
Definition at line 54 of file client_db.cc.
Referenced by clientdbAdd(), clientdbGC(), and clientdbScheduledGC().
hash_table* client_table = NULL [static] |
Definition at line 45 of file client_db.cc.
FREE clientdbFreeItem [static] |
Definition at line 48 of file client_db.cc.
Referenced by clientdbFreeMemory(), and clientdbGC().
int max_clients = 32 [static] |
Definition at line 52 of file client_db.cc.
Referenced by clientdbAdd(), clientdbGC(), and clientdbStartGC().
Search
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Help Out
- Getting Squid
- Donate
- Squid Deployment Case-Studies
Documentation
- FAQ | Wiki | Book
- Configuration Reference
- Configuration Guide - Visolve
- Configuration Examples
- Users guide
- Non-English
- Security Advisories
- More...
Support
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products
