#include "squid.h"
#include "comm.h"
#include "comm/Connection.h"
#include "comm/Loops.h"
#include "event.h"
#include "fatal.h"
#include "SquidConfig.h"
#include "wccp.h"
Go to the source code of this file.
Classes | |
struct | wccp_here_i_am_t |
struct | wccp_cache_entry_t |
struct | wccp_i_see_you_t |
struct | wccp_assign_bucket_t |
Macros | |
#define | WCCP_PORT 2048 |
#define | WCCP_REVISION 0 |
#define | WCCP_ACTIVE_CACHES 32 |
#define | WCCP_HASH_SIZE 32 |
#define | WCCP_BUCKETS 256 |
#define | WCCP_CACHE_LEN 4 |
#define | WCCP_HERE_I_AM 7 |
#define | WCCP_I_SEE_YOU 8 |
#define | WCCP_ASSIGN_BUCKET 9 |
Functions | |
static int | wccpLowestIP (void) |
static void | wccpAssignBuckets (void) |
void | wccpInit (void) |
void | wccpConnectionOpen (void) |
void | wccpConnectionClose (void) |
static void | wccpHandleUdp (int sock, void *) |
static void | wccpHereIam (void *) |
Variables | |
static int | theWccpConnection = -1 |
static struct wccp_here_i_am_t | wccp_here_i_am |
static struct wccp_i_see_you_t | wccp_i_see_you |
static int | last_change |
static int | last_id |
static int | last_assign_buckets_change |
static unsigned int | number_caches |
static Ip::Address | local_ip |
static PF | wccpHandleUdp |
static EVH | wccpHereIam |
Macro Definition Documentation
◆ WCCP_ACTIVE_CACHES
◆ WCCP_ASSIGN_BUCKET
◆ WCCP_BUCKETS
◆ WCCP_CACHE_LEN
◆ WCCP_HASH_SIZE
◆ WCCP_HERE_I_AM
◆ WCCP_I_SEE_YOU
◆ WCCP_PORT
◆ WCCP_REVISION
Function Documentation
◆ wccpAssignBuckets()
|
static |
Definition at line 295 of file wccp.cc.
References assert, buckets, comm_udp_send(), debugs, wccp_i_see_you_t::id, wccp_assign_bucket_t::id, wccp_cache_entry_t::ip_addr, last_change, wccp_i_see_you_t::number, wccp_assign_bucket_t::number, number_caches, theWccpConnection, wccp_assign_bucket_t::type, WCCP_ACTIVE_CACHES, WCCP_ASSIGN_BUCKET, WCCP_BUCKETS, wccp_i_see_you_t::wccp_cache_entry, WCCP_CACHE_LEN, wccp_i_see_you, xfree, and xmalloc.
Referenced by wccpHandleUdp().
◆ wccpConnectionClose()
void wccpConnectionClose | ( | void | ) |
Definition at line 161 of file wccp.cc.
References comm_close, DBG_IMPORTANT, debugs, and theWccpConnection.
Referenced by serverConnectionsClose(), and SquidShutdown().
◆ wccpConnectionOpen()
void wccpConnectionOpen | ( | void | ) |
Definition at line 109 of file wccp.cc.
References SquidConfig::address, COMM_NONBLOCKING, comm_open_listener(), COMM_SELECT_READ, Config, DBG_CRITICAL, DBG_IMPORTANT, debugs, fatal(), Ip::Address::getSockAddr(), Ip::Address::isAnyAddr(), local_ip, Ip::Address::port(), SquidConfig::router, Ip::Address::setIPv4(), Comm::SetSelect(), theWccpConnection, SquidConfig::Wccp, WCCP_PORT, and wccpHandleUdp.
Referenced by serverConnectionsOpen().
◆ wccpHandleUdp()
|
static |
Definition at line 178 of file wccp.cc.
References wccp_i_see_you_t::change, COMM_SELECT_READ, comm_udp_recvfrom(), Config, DBG_IMPORTANT, debugs, wccp_i_see_you_t::id, last_assign_buckets_change, last_change, last_id, wccp_i_see_you_t::number, number_caches, SquidConfig::router, Comm::SetSelect(), wccp_i_see_you_t::type, SquidConfig::version, wccp_i_see_you_t::version, SquidConfig::Wccp, WCCP_ACTIVE_CACHES, WCCP_I_SEE_YOU, wccp_i_see_you, wccpAssignBuckets(), wccpHandleUdp, and wccpLowestIP().
◆ wccpHereIam()
|
static |
Definition at line 275 of file wccp.cc.
References comm_udp_send(), debugs, eventAdd(), eventFind(), wccp_here_i_am_t::id, last_id, theWccpConnection, wccp_here_i_am, wccpHereIam, and xstrerr().
◆ wccpInit()
void wccpInit | ( | void | ) |
Definition at line 91 of file wccp.cc.
References Config, debugs, eventAdd(), eventFind(), Ip::Address::isAnyAddr(), last_assign_buckets_change, last_change, last_id, number_caches, wccp_here_i_am_t::revision, SquidConfig::router, wccp_here_i_am_t::type, SquidConfig::version, wccp_here_i_am_t::version, SquidConfig::Wccp, WCCP_HERE_I_AM, wccp_here_i_am, WCCP_REVISION, and wccpHereIam.
Referenced by mainInitialize(), and mainReconfigureFinish().
◆ wccpLowestIP()
|
static |
Definition at line 252 of file wccp.cc.
References assert, wccp_cache_entry_t::ip_addr, local_ip, wccp_i_see_you_t::number, WCCP_ACTIVE_CACHES, wccp_i_see_you_t::wccp_cache_entry, and wccp_i_see_you.
Referenced by wccpHandleUdp().
Variable Documentation
◆ last_assign_buckets_change
|
static |
Definition at line 72 of file wccp.cc.
Referenced by wccpHandleUdp(), and wccpInit().
◆ last_change
|
static |
Definition at line 70 of file wccp.cc.
Referenced by wccpAssignBuckets(), wccpHandleUdp(), and wccpInit().
◆ last_id
|
static |
Definition at line 71 of file wccp.cc.
Referenced by wccpHandleUdp(), wccpHereIam(), and wccpInit().
◆ local_ip
|
static |
Definition at line 75 of file wccp.cc.
Referenced by wccpConnectionOpen(), and wccpLowestIP().
◆ number_caches
|
static |
Definition at line 73 of file wccp.cc.
Referenced by wccpAssignBuckets(), wccpHandleUdp(), and wccpInit().
◆ theWccpConnection
|
static |
Definition at line 65 of file wccp.cc.
Referenced by wccpAssignBuckets(), wccpConnectionClose(), wccpConnectionOpen(), and wccpHereIam().
◆ wccp_here_i_am
|
static |
Definition at line 67 of file wccp.cc.
Referenced by wccpHereIam(), and wccpInit().
◆ wccp_i_see_you
|
static |
Definition at line 69 of file wccp.cc.
Referenced by wccpAssignBuckets(), wccpHandleUdp(), and wccpLowestIP().
◆ wccpHandleUdp
|
static |
Definition at line 77 of file wccp.cc.
Referenced by wccpConnectionOpen(), and wccpHandleUdp().
◆ wccpHereIam
|
static |
Definition at line 79 of file wccp.cc.
Referenced by wccpHereIam(), and wccpInit().