wccp2.cc File Reference
#include "squid.h"
#include "cache_cf.h"
#include "comm.h"
#include "comm/Connection.h"
#include "comm/Loops.h"
#include "ConfigParser.h"
#include "event.h"
#include "ip/Address.h"
#include "md5.h"
#include "Parsing.h"
#include "SquidConfig.h"
#include "Store.h"
Include dependency graph for wccp2.cc:

Go to the source code of this file.

Classes

struct  wccp2_item_header_t
 
struct  wccp2_message_header_t
 
struct  wccp2_security_none_t
 
struct  wccp2_security_md5_t
 
struct  wccp2_service_info_t
 
struct  wccp2_cache_identity_info_t
 
struct  wccp2_identity_info_t
 
struct  wccp2_mask_element_t
 
struct  wccp2_cache_mask_identity_info_t
 
struct  wccp2_mask_identity_info_t
 
struct  wccp2_cache_view_header_t
 
struct  wccp2_cache_view_info_t
 
struct  wccp2_router_id_element_t
 
struct  wccp2_capability_info_header_t
 
struct  wccp2_capability_element_t
 
struct  wccp2_value_element_t
 
struct  wccp2_i_see_you_t
 
struct  wccp2_router_assign_element_t
 
struct  router_identity_info_t
 
struct  cache_mask_info_t
 
struct  assignment_key_t
 
struct  router_view_t
 
struct  wccp2_cache_list_t
 
struct  wccp2_router_list_t
 
struct  wccp2_service_list_t
 

Macros

#define WCCP_PORT   2048
 
#define WCCP_RESPONSE_SIZE   12448
 
#define WCCP_BUCKETS   256
 
#define WCCP2_HASH_ASSIGNMENT   0x00
 
#define WCCP2_MASK_ASSIGNMENT   0x01
 
#define WCCP2_NONE_SECURITY_LEN   0
 
#define WCCP2_MD5_SECURITY_LEN   SQUID_MD5_DIGEST_LENGTH
 
#define WCCP2_NUMPORTS   8
 
#define WCCP2_PASSWORD_LEN   8
 
#define WCCP2_SECURITY_INFO   0
 
#define WCCP2_SERVICE_INFO   1
 
#define WCCP2_ROUTER_ID_INFO   2
 
#define WCCP2_WC_ID_INFO   3
 
#define WCCP2_RTR_VIEW_INFO   4
 
#define WCCP2_WC_VIEW_INFO   5
 
#define WCCP2_REDIRECT_ASSIGNMENT   6
 
#define WCCP2_QUERY_INFO   7
 
#define WCCP2_CAPABILITY_INFO   8
 
#define WCCP2_ALT_ASSIGNMENT   13
 
#define WCCP2_ASSIGN_MAP   14
 
#define WCCP2_COMMAND_EXTENSION   15
 
#define WCCP2_VERSION   0x200
 
#define WCCP2_HERE_I_AM   10
 
#define WCCP2_I_SEE_YOU   11
 
#define WCCP2_REDIRECT_ASSIGN   12
 
#define WCCP2_REMOVAL_QUERY   13
 
#define WCCP2_NO_SECURITY   0
 
#define WCCP2_MD5_SECURITY   1
 
#define WCCP2_SERVICE_STANDARD   0
 
#define WCCP2_SERVICE_DYNAMIC   1
 
#define WCCP2_SERVICE_ID_HTTP   0x00
 
#define WCCP2_SERVICE_SRC_IP_HASH   0x1
 
#define WCCP2_SERVICE_DST_IP_HASH   0x2
 
#define WCCP2_SERVICE_SRC_PORT_HASH   0x4
 
#define WCCP2_SERVICE_DST_PORT_HASH   0x8
 
#define WCCP2_SERVICE_PORTS_DEFINED   0x10
 
#define WCCP2_SERVICE_PORTS_SOURCE   0x20
 
#define WCCP2_SERVICE_SRC_IP_ALT_HASH   0x100
 
#define WCCP2_SERVICE_DST_IP_ALT_HASH   0x200
 
#define WCCP2_SERVICE_SRC_PORT_ALT_HASH   0x400
 
#define WCCP2_SERVICE_DST_PORT_ALT_HASH   0x800
 
#define WCCP2_MASK_ASSIGNMENT_DATA   (0x2)
 
#define WCCP2_CAPABILITY_FORWARDING_METHOD   0x01
 
#define WCCP2_CAPABILITY_ASSIGNMENT_METHOD   0x02
 
#define WCCP2_CAPABILITY_RETURN_METHOD   0x03
 
#define WCCP2_METHOD_GRE   0x00000001
 
#define WCCP2_METHOD_L2   0x00000002
 
#define WCCP2_FORWARDING_METHOD_GRE   WCCP2_METHOD_GRE
 
#define WCCP2_FORWARDING_METHOD_L2   WCCP2_METHOD_L2
 
#define WCCP2_ASSIGNMENT_METHOD_HASH   0x00000001
 
#define WCCP2_ASSIGNMENT_METHOD_MASK   0x00000002
 
#define WCCP2_PACKET_RETURN_METHOD_GRE   WCCP2_METHOD_GRE
 
#define WCCP2_PACKET_RETURN_METHOD_L2   WCCP2_METHOD_L2
 

Functions

void wccp2_add_service_list (int service, int service_id, int service_priority, int service_proto, int service_flags, int ports[], int security_type, char *password)
 
static void wccp2SortCacheList (struct wccp2_cache_list_t *head)
 
static void wccp2InitServices (void)
 
static void wccp2_update_service (struct wccp2_service_list_t *srv, int service, int service_id, int service_priority, int service_proto, int service_flags, int ports[])
 
static struct wccp2_service_list_twccp2_get_service_by_id (int service, int service_id)
 
static char wccp2_update_md5_security (char *password, char *ptr, char *packet, int len)
 
static char wccp2_check_security (struct wccp2_service_list_t *srv, char *security, char *packet, int len)
 
void wccp2Init (void)
 
void wccp2ConnectionOpen (void)
 
void wccp2ConnectionClose (void)
 
static void wccp2HandleUdp (int sock, void *)
 
static void wccp2HereIam (void *)
 
static void wccp2AssignBuckets (void *)
 
void parse_wccp2_method (int *method)
 
void dump_wccp2_method (StoreEntry *e, const char *label, int v)
 
void free_wccp2_method (int *)
 
void parse_wccp2_amethod (int *method)
 
void dump_wccp2_amethod (StoreEntry *e, const char *label, int v)
 
void free_wccp2_amethod (int *)
 
void parse_wccp2_service (void *)
 
void dump_wccp2_service (StoreEntry *e, const char *label, void *)
 
void free_wccp2_service (void *)
 
int check_null_wccp2_service (void *)
 
static int parse_wccp2_service_flags (char *flags)
 
static void parse_wccp2_service_ports (char *options, int portlist[])
 
void parse_wccp2_service_info (void *)
 
void dump_wccp2_service_info (StoreEntry *e, const char *label, void *)
 
void free_wccp2_service_info (void *)
 

Variables

static int theWccp2Connection = -1
 
static int wccp2_connected = 0
 
static PF wccp2HandleUdp
 
static EVH wccp2HereIam
 
static EVH wccp2AssignBuckets
 
static struct wccp2_message_header_t wccp2_here_i_am_header
 
static struct wccp2_identity_info_t wccp2_identity_info
 
static struct wccp2_mask_identity_info_t wccp2_mask_identity_info
 
static struct wccp2_cache_view_header_t wccp2_cache_view_header
 
static struct wccp2_cache_view_info_t wccp2_cache_view_info
 
static struct wccp2_capability_info_header_t wccp2_capability_info_header
 
static struct wccp2_capability_element_t wccp2_capability_element
 
static struct wccp2_i_see_you_t wccp2_i_see_you
 
static int wccp2_numrouters
 
static struct wccp2_service_list_twccp2_service_list_head = NULL
 
int empty_portlist [WCCP2_NUMPORTS] = {0, 0, 0, 0, 0, 0, 0, 0}
 

Macro Definition Documentation

◆ WCCP2_ALT_ASSIGNMENT

#define WCCP2_ALT_ASSIGNMENT   13

Definition at line 75 of file wccp2.cc.

Referenced by wccp2AssignBuckets().

◆ WCCP2_ASSIGN_MAP

#define WCCP2_ASSIGN_MAP   14

Definition at line 76 of file wccp2.cc.

Referenced by wccp2HandleUdp().

◆ WCCP2_ASSIGNMENT_METHOD_HASH

#define WCCP2_ASSIGNMENT_METHOD_HASH   0x00000001

◆ WCCP2_ASSIGNMENT_METHOD_MASK

#define WCCP2_ASSIGNMENT_METHOD_MASK   0x00000002

◆ WCCP2_CAPABILITY_ASSIGNMENT_METHOD

#define WCCP2_CAPABILITY_ASSIGNMENT_METHOD   0x02

Definition at line 305 of file wccp2.cc.

Referenced by wccp2HandleUdp(), and wccp2Init().

◆ WCCP2_CAPABILITY_FORWARDING_METHOD

#define WCCP2_CAPABILITY_FORWARDING_METHOD   0x01

Definition at line 304 of file wccp2.cc.

Referenced by wccp2HandleUdp(), and wccp2Init().

◆ WCCP2_CAPABILITY_INFO

#define WCCP2_CAPABILITY_INFO   8

Definition at line 74 of file wccp2.cc.

Referenced by wccp2HandleUdp(), and wccp2Init().

◆ WCCP2_CAPABILITY_RETURN_METHOD

#define WCCP2_CAPABILITY_RETURN_METHOD   0x03

Definition at line 306 of file wccp2.cc.

Referenced by wccp2HandleUdp(), and wccp2Init().

◆ WCCP2_COMMAND_EXTENSION

#define WCCP2_COMMAND_EXTENSION   15

Definition at line 77 of file wccp2.cc.

◆ WCCP2_FORWARDING_METHOD_GRE

#define WCCP2_FORWARDING_METHOD_GRE   WCCP2_METHOD_GRE

Definition at line 314 of file wccp2.cc.

Referenced by wccp2HandleUdp().

◆ WCCP2_FORWARDING_METHOD_L2

#define WCCP2_FORWARDING_METHOD_L2   WCCP2_METHOD_L2

Definition at line 315 of file wccp2.cc.

◆ WCCP2_HASH_ASSIGNMENT

#define WCCP2_HASH_ASSIGNMENT   0x00

Definition at line 44 of file wccp2.cc.

◆ WCCP2_HERE_I_AM

#define WCCP2_HERE_I_AM   10

Definition at line 92 of file wccp2.cc.

Referenced by wccp2Init().

◆ WCCP2_I_SEE_YOU

#define WCCP2_I_SEE_YOU   11

Definition at line 93 of file wccp2.cc.

Referenced by wccp2HandleUdp().

◆ WCCP2_MASK_ASSIGNMENT

#define WCCP2_MASK_ASSIGNMENT   0x01

Definition at line 45 of file wccp2.cc.

Referenced by wccp2AssignBuckets().

◆ WCCP2_MASK_ASSIGNMENT_DATA

#define WCCP2_MASK_ASSIGNMENT_DATA   (0x2)

Definition at line 218 of file wccp2.cc.

Referenced by wccp2Init().

◆ WCCP2_MD5_SECURITY

◆ WCCP2_MD5_SECURITY_LEN

#define WCCP2_MD5_SECURITY_LEN   SQUID_MD5_DIGEST_LENGTH

Definition at line 48 of file wccp2.cc.

◆ WCCP2_METHOD_GRE

#define WCCP2_METHOD_GRE   0x00000001

Definition at line 311 of file wccp2.cc.

Referenced by dump_wccp2_method(), and parse_wccp2_method().

◆ WCCP2_METHOD_L2

#define WCCP2_METHOD_L2   0x00000002

Definition at line 312 of file wccp2.cc.

Referenced by dump_wccp2_method(), and parse_wccp2_method().

◆ WCCP2_NO_SECURITY

#define WCCP2_NO_SECURITY   0

Definition at line 109 of file wccp2.cc.

Referenced by parse_wccp2_service(), wccp2_check_security(), wccp2AssignBuckets(), and wccp2Init().

◆ WCCP2_NONE_SECURITY_LEN

#define WCCP2_NONE_SECURITY_LEN   0

Definition at line 47 of file wccp2.cc.

◆ WCCP2_NUMPORTS

#define WCCP2_NUMPORTS   8

Definition at line 51 of file wccp2.cc.

Referenced by parse_wccp2_service_info(), and parse_wccp2_service_ports().

◆ WCCP2_PACKET_RETURN_METHOD_GRE

#define WCCP2_PACKET_RETURN_METHOD_GRE   WCCP2_METHOD_GRE

Definition at line 320 of file wccp2.cc.

Referenced by wccp2HandleUdp().

◆ WCCP2_PACKET_RETURN_METHOD_L2

#define WCCP2_PACKET_RETURN_METHOD_L2   WCCP2_METHOD_L2

Definition at line 321 of file wccp2.cc.

◆ WCCP2_PASSWORD_LEN

#define WCCP2_PASSWORD_LEN   8

◆ WCCP2_QUERY_INFO

#define WCCP2_QUERY_INFO   7

Definition at line 73 of file wccp2.cc.

◆ WCCP2_REDIRECT_ASSIGN

#define WCCP2_REDIRECT_ASSIGN   12

Definition at line 94 of file wccp2.cc.

Referenced by wccp2AssignBuckets().

◆ WCCP2_REDIRECT_ASSIGNMENT

#define WCCP2_REDIRECT_ASSIGNMENT   6

Definition at line 72 of file wccp2.cc.

Referenced by wccp2AssignBuckets(), and wccp2HandleUdp().

◆ WCCP2_REMOVAL_QUERY

#define WCCP2_REMOVAL_QUERY   13

Definition at line 95 of file wccp2.cc.

◆ WCCP2_ROUTER_ID_INFO

#define WCCP2_ROUTER_ID_INFO   2

Definition at line 68 of file wccp2.cc.

Referenced by wccp2HandleUdp().

◆ WCCP2_RTR_VIEW_INFO

#define WCCP2_RTR_VIEW_INFO   4

Definition at line 70 of file wccp2.cc.

Referenced by wccp2HandleUdp().

◆ WCCP2_SECURITY_INFO

#define WCCP2_SECURITY_INFO   0

Definition at line 66 of file wccp2.cc.

Referenced by wccp2_update_md5_security(), wccp2HandleUdp(), and wccp2Init().

◆ WCCP2_SERVICE_DST_IP_ALT_HASH

#define WCCP2_SERVICE_DST_IP_ALT_HASH   0x200

◆ WCCP2_SERVICE_DST_IP_HASH

#define WCCP2_SERVICE_DST_IP_HASH   0x2

◆ WCCP2_SERVICE_DST_PORT_ALT_HASH

#define WCCP2_SERVICE_DST_PORT_ALT_HASH   0x800

◆ WCCP2_SERVICE_DST_PORT_HASH

#define WCCP2_SERVICE_DST_PORT_HASH   0x8

◆ WCCP2_SERVICE_DYNAMIC

#define WCCP2_SERVICE_DYNAMIC   1

Definition at line 149 of file wccp2.cc.

Referenced by dump_wccp2_service(), parse_wccp2_service(), and parse_wccp2_service_info().

◆ WCCP2_SERVICE_ID_HTTP

#define WCCP2_SERVICE_ID_HTTP   0x00

Definition at line 152 of file wccp2.cc.

◆ WCCP2_SERVICE_INFO

#define WCCP2_SERVICE_INFO   1

Definition at line 67 of file wccp2.cc.

Referenced by wccp2_add_service_list(), and wccp2HandleUdp().

◆ WCCP2_SERVICE_PORTS_DEFINED

#define WCCP2_SERVICE_PORTS_DEFINED   0x10

Definition at line 159 of file wccp2.cc.

Referenced by dump_wccp2_service_info(), and parse_wccp2_service_info().

◆ WCCP2_SERVICE_PORTS_SOURCE

#define WCCP2_SERVICE_PORTS_SOURCE   0x20

Definition at line 160 of file wccp2.cc.

Referenced by dump_wccp2_service_info(), and parse_wccp2_service_flags().

◆ WCCP2_SERVICE_SRC_IP_ALT_HASH

#define WCCP2_SERVICE_SRC_IP_ALT_HASH   0x100

◆ WCCP2_SERVICE_SRC_IP_HASH

#define WCCP2_SERVICE_SRC_IP_HASH   0x1

◆ WCCP2_SERVICE_SRC_PORT_ALT_HASH

#define WCCP2_SERVICE_SRC_PORT_ALT_HASH   0x400

◆ WCCP2_SERVICE_SRC_PORT_HASH

#define WCCP2_SERVICE_SRC_PORT_HASH   0x4

◆ WCCP2_SERVICE_STANDARD

#define WCCP2_SERVICE_STANDARD   0

◆ WCCP2_VERSION

#define WCCP2_VERSION   0x200

Definition at line 85 of file wccp2.cc.

Referenced by wccp2AssignBuckets(), wccp2HandleUdp(), and wccp2Init().

◆ WCCP2_WC_ID_INFO

#define WCCP2_WC_ID_INFO   3

Definition at line 69 of file wccp2.cc.

Referenced by wccp2Init().

◆ WCCP2_WC_VIEW_INFO

#define WCCP2_WC_VIEW_INFO   5

Definition at line 71 of file wccp2.cc.

Referenced by wccp2Init().

◆ WCCP_BUCKETS

#define WCCP_BUCKETS   256

Definition at line 33 of file wccp2.cc.

Referenced by wccp2AssignBuckets().

◆ WCCP_PORT

#define WCCP_PORT   2048

Definition at line 31 of file wccp2.cc.

Referenced by wccp2AssignBuckets(), wccp2ConnectionOpen(), and wccp2HereIam().

◆ WCCP_RESPONSE_SIZE

#define WCCP_RESPONSE_SIZE   12448

Definition at line 32 of file wccp2.cc.

Referenced by wccp2AssignBuckets(), wccp2HandleUdp(), and wccp2Init().

Function Documentation

◆ check_null_wccp2_service()

int check_null_wccp2_service ( void *  )

Definition at line 2175 of file wccp2.cc.

References wccp2_service_list_head.

◆ dump_wccp2_amethod()

void dump_wccp2_amethod ( StoreEntry e,
const char *  label,
int  v 
)

◆ dump_wccp2_method()

void dump_wccp2_method ( StoreEntry e,
const char *  label,
int  v 
)

◆ dump_wccp2_service()

◆ dump_wccp2_service_info()

◆ free_wccp2_amethod()

void free_wccp2_amethod ( int )

Definition at line 2086 of file wccp2.cc.

◆ free_wccp2_method()

void free_wccp2_method ( int )

Definition at line 2038 of file wccp2.cc.

◆ free_wccp2_service()

void free_wccp2_service ( void *  )

Definition at line 2171 of file wccp2.cc.

◆ free_wccp2_service_info()

void free_wccp2_service_info ( void *  )

Definition at line 2525 of file wccp2.cc.

◆ parse_wccp2_amethod()

void parse_wccp2_amethod ( int method)

Parse wccp2_assignment_method option they can be '1' aka 'hash' or '2' aka 'mask' repesenting the integer numeric of the same.

Definition at line 2047 of file wccp2.cc.

References DBG_CRITICAL, debugs, ConfigParser::NextToken(), NULL, self_destruct(), WCCP2_ASSIGNMENT_METHOD_HASH, and WCCP2_ASSIGNMENT_METHOD_MASK.

◆ parse_wccp2_method()

void parse_wccp2_method ( int method)

Parse wccp2_return_method and wccp2_forwarding_method options they can be '1' aka 'gre' or '2' aka 'l2' repesenting the integer numeric of the same.

Definition at line 1999 of file wccp2.cc.

References DBG_CRITICAL, debugs, ConfigParser::NextToken(), NULL, self_destruct(), WCCP2_METHOD_GRE, and WCCP2_METHOD_L2.

◆ parse_wccp2_service()

◆ parse_wccp2_service_flags()

◆ parse_wccp2_service_info()

◆ parse_wccp2_service_ports()

static void parse_wccp2_service_ports ( char *  options,
int  portlist[] 
)
static

Definition at line 2240 of file wccp2.cc.

References fatalf(), i, len, p, WCCP2_NUMPORTS, and xatoi().

Referenced by parse_wccp2_service_info().

◆ wccp2_add_service_list()

void wccp2_add_service_list ( int  service,
int  service_id,
int  service_priority,
int  service_proto,
int  service_flags,
int  ports[],
int  security_type,
char *  password 
)

◆ wccp2_check_security()

◆ wccp2_get_service_by_id()

static struct wccp2_service_list_t* wccp2_get_service_by_id ( int  service,
int  service_id 
)
static

◆ wccp2_update_md5_security()

static char wccp2_update_md5_security ( char *  password,
char *  ptr,
char *  packet,
int  len 
)
static

◆ wccp2_update_service()

◆ wccp2AssignBuckets()

static void wccp2AssignBuckets ( void *  )
static

Definition at line 1604 of file wccp2.cc.

References assert, SquidConfig::assignment_method, buckets, wccp2_value_element_t::cache_ip, wccp2_cache_list_t::cache_ip, wccp2_router_list_t::cache_list_head, wccp2_service_list_t::change_num, wccp2_router_assign_element_t::change_number, comm_udp_sendto(), Config, debugs, wccp2_mask_element_t::dest_ip_mask, wccp2_value_element_t::dest_ip_value, wccp2_mask_element_t::dest_port_mask, wccp2_value_element_t::dest_port_value, fatalf(), wccp2_router_list_t::info, wccp2_service_list_t::info, int, wccp2_item_header_t::length, wccp2_message_header_t::length, wccp2_router_list_t::local_ip, wccp2_service_list_t::lowest_ip, assignment_key_t::master_ip, assignment_key_t::master_number, wccp2_router_list_t::member_change, wccp2_cache_list_t::next, wccp2_router_list_t::next, wccp2_service_list_t::next, NULL, wccp2_router_list_t::num_caches, wccp2_service_list_t::num_routers, wccp2_mask_element_t::number_values, port, wccp2_router_id_element_t::received_id, wccp2_router_assign_element_t::received_id, wccp2_router_id_element_t::router_address, wccp2_router_assign_element_t::router_address, wccp2_service_list_t::router_list_head, wccp2_router_list_t::router_sendto_address, safe_free, wccp2_service_list_t::security_info, wccp2_service_info_t::service, wccp2_service_info_t::service_flags, wccp2_service_list_t::service_info, wccp2_mask_element_t::source_ip_mask, wccp2_value_element_t::source_ip_value, wccp2_mask_element_t::source_port_mask, wccp2_value_element_t::source_port_value, theWccp2Connection, wccp2_item_header_t::type, wccp2_message_header_t::type, wccp2_message_header_t::version, SquidConfig::Wccp2, WCCP2_ALT_ASSIGNMENT, WCCP2_ASSIGNMENT_METHOD_HASH, WCCP2_ASSIGNMENT_METHOD_MASK, WCCP2_MASK_ASSIGNMENT, WCCP2_MD5_SECURITY, WCCP2_NO_SECURITY, wccp2_numrouters, WCCP2_REDIRECT_ASSIGN, WCCP2_REDIRECT_ASSIGNMENT, wccp2_service_list_t::wccp2_security_type, WCCP2_SERVICE_DST_IP_ALT_HASH, WCCP2_SERVICE_DST_IP_HASH, WCCP2_SERVICE_DST_PORT_ALT_HASH, WCCP2_SERVICE_DST_PORT_HASH, wccp2_service_list_head, WCCP2_SERVICE_SRC_IP_ALT_HASH, WCCP2_SERVICE_SRC_IP_HASH, WCCP2_SERVICE_SRC_PORT_ALT_HASH, WCCP2_SERVICE_SRC_PORT_HASH, WCCP2_SERVICE_STANDARD, wccp2_update_md5_security(), WCCP2_VERSION, WCCP_BUCKETS, wccp2_service_list_t::wccp_password, WCCP_PORT, WCCP_RESPONSE_SIZE, wccp2_cache_list_t::weight, xcalloc, and xstrerr().

◆ wccp2ConnectionClose()

◆ wccp2ConnectionOpen()

◆ wccp2HandleUdp()

static void wccp2HandleUdp ( int  sock,
void *   
)
static

Definition at line 1113 of file wccp2.cc.

References wccp2_cache_identity_info_t::addr, wccp2_cache_mask_identity_info_t::addr, cache_mask_info_t::addr, SquidConfig::assignment_method, wccp2_cache_list_t::cache_ip, wccp2_router_list_t::cache_list_head, wccp2_capability_info_header_t::capability_info_length, router_view_t::change_number, COMM_SELECT_READ, comm_udp_recvfrom(), Config, data, wccp2_i_see_you_t::data, DBG_IMPORTANT, debugs, eventAdd(), eventDelete(), fatalf(), SquidConfig::forwarding_method, Ip::Address::getSockAddr(), wccp2_router_list_t::info, int, len, wccp2_item_header_t::length, wccp2_i_see_you_t::length, wccp2_router_list_t::local_ip, wccp2_service_list_t::lowest_ip, wccp2_router_list_t::member_change, wccp2_cache_list_t::next, wccp2_router_list_t::next, wccp2_service_list_t::next, NULL, cache_mask_info_t::num1, wccp2_router_list_t::num_caches, wccp2_router_id_element_t::received_id, SquidConfig::return_method, wccp2_router_id_element_t::router_address, router_identity_info_t::router_id_element, wccp2_service_list_t::router_list_head, wccp2_router_list_t::router_sendto_address, wccp2_service_list_t::security_info, wccp2_security_none_t::security_option, wccp2_security_md5_t::security_option, wccp2_service_info_t::service_id, wccp2_service_list_t::service_info, Ip::Address::setIPv4(), Comm::SetSelect(), wccp2_item_header_t::type, wccp2_i_see_you_t::type, wccp2_i_see_you_t::version, SquidConfig::Wccp2, WCCP2_ASSIGN_MAP, WCCP2_ASSIGNMENT_METHOD_HASH, WCCP2_ASSIGNMENT_METHOD_MASK, WCCP2_CAPABILITY_ASSIGNMENT_METHOD, WCCP2_CAPABILITY_FORWARDING_METHOD, WCCP2_CAPABILITY_INFO, WCCP2_CAPABILITY_RETURN_METHOD, wccp2_check_security(), WCCP2_FORWARDING_METHOD_GRE, wccp2_i_see_you, WCCP2_I_SEE_YOU, WCCP2_PACKET_RETURN_METHOD_GRE, WCCP2_REDIRECT_ASSIGNMENT, WCCP2_ROUTER_ID_INFO, WCCP2_RTR_VIEW_INFO, WCCP2_SECURITY_INFO, WCCP2_SERVICE_INFO, wccp2_service_list_head, WCCP2_VERSION, wccp2AssignBuckets, wccp2ConnectionClose(), wccp2HandleUdp, wccp2SortCacheList(), WCCP_RESPONSE_SIZE, wccp2_cache_identity_info_t::weight, wccp2_cache_list_t::weight, xcalloc, and xfree.

◆ wccp2HereIam()

◆ wccp2Init()

void wccp2Init ( void  )

Definition at line 653 of file wccp2.cc.

References wccp2_cache_identity_info_t::addr, wccp2_cache_mask_identity_info_t::addr, assert, SquidConfig::assignment_method, wccp2_cache_identity_info_t::bits, wccp2_cache_mask_identity_info_t::bits, wccp2_cache_identity_info_t::buckets, wccp2_identity_info_t::cache_identity, wccp2_mask_identity_info_t::cache_identity, wccp2_identity_info_t::cache_identity_length, wccp2_mask_identity_info_t::cache_identity_length, wccp2_identity_info_t::cache_identity_type, wccp2_mask_identity_info_t::cache_identity_type, wccp2_cache_view_header_t::cache_view_length, wccp2_cache_view_header_t::cache_view_type, wccp2_cache_view_header_t::cache_view_version, wccp2_capability_info_header_t::capability_info_length, wccp2_capability_info_header_t::capability_info_type, wccp2_capability_element_t::capability_length, wccp2_capability_element_t::capability_type, wccp2_capability_element_t::capability_value, Config, debugs, wccp2_mask_element_t::dest_ip_mask, wccp2_mask_element_t::dest_port_mask, eventAdd(), eventFind(), fatalf(), SquidConfig::forwarding_method, Ip::Address::getInAddr(), wccp2_cache_identity_info_t::hash_revision, wccp2_router_list_t::info, wccp2_service_list_t::info, Ip::Address::isAnyAddr(), wccp2_message_header_t::length, wccp2_cache_mask_identity_info_t::mask, wccp2_cache_mask_identity_info_t::mask_element_count, wccp2_router_list_t::member_change, Ip::Address_list::next, wccp2_router_list_t::next, wccp2_service_list_t::next, NULL, wccp2_cache_view_info_t::num_caches, wccp2_service_list_t::num_routers, wccp2_router_id_element_t::received_id, SquidConfig::return_method, SquidConfig::router, wccp2_router_id_element_t::router_address, wccp2_service_list_t::router_list_head, wccp2_router_list_t::router_sendto_address, Ip::Address_list::s, wccp2_service_list_t::security_info, wccp2_security_md5_t::security_length, wccp2_security_md5_t::security_option, wccp2_security_md5_t::security_type, wccp2_service_info_t::service, wccp2_service_info_t::service_flags, wccp2_service_list_t::service_info, wccp2_mask_element_t::source_ip_mask, wccp2_mask_element_t::source_port_mask, wccp2_cache_identity_info_t::status, wccp2_cache_mask_identity_info_t::status, wccp2_message_header_t::type, wccp2_message_header_t::version, SquidConfig::Wccp2, WCCP2_ASSIGNMENT_METHOD_HASH, WCCP2_ASSIGNMENT_METHOD_MASK, wccp2_cache_view_header, wccp2_cache_view_info, WCCP2_CAPABILITY_ASSIGNMENT_METHOD, wccp2_capability_element, WCCP2_CAPABILITY_FORWARDING_METHOD, WCCP2_CAPABILITY_INFO, wccp2_capability_info_header, WCCP2_CAPABILITY_RETURN_METHOD, wccp2_connected, WCCP2_HERE_I_AM, wccp2_here_i_am_header, wccp2_identity_info, wccp2_service_list_t::wccp2_identity_info_ptr, WCCP2_MASK_ASSIGNMENT_DATA, wccp2_mask_identity_info, WCCP2_MD5_SECURITY, WCCP2_NO_SECURITY, wccp2_numrouters, WCCP2_SECURITY_INFO, wccp2_service_list_t::wccp2_security_type, WCCP2_SERVICE_DST_IP_ALT_HASH, WCCP2_SERVICE_DST_IP_HASH, WCCP2_SERVICE_DST_PORT_ALT_HASH, WCCP2_SERVICE_DST_PORT_HASH, wccp2_service_list_head, WCCP2_SERVICE_SRC_IP_ALT_HASH, WCCP2_SERVICE_SRC_IP_HASH, WCCP2_SERVICE_SRC_PORT_ALT_HASH, WCCP2_SERVICE_SRC_PORT_HASH, WCCP2_SERVICE_STANDARD, WCCP2_VERSION, WCCP2_WC_ID_INFO, WCCP2_WC_VIEW_INFO, wccp2HereIam, wccp2InitServices(), wccp2_service_list_t::wccp_packet, wccp2_service_list_t::wccp_packet_size, WCCP_RESPONSE_SIZE, SquidConfig::weight, wccp2_cache_identity_info_t::weight, wccp2_cache_mask_identity_info_t::weight, and xcalloc.

Referenced by mainInitialize(), and mainReconfigureFinish().

◆ wccp2InitServices()

static void wccp2InitServices ( void  )
static

Definition at line 476 of file wccp2.cc.

References debugs.

Referenced by wccp2Init().

◆ wccp2SortCacheList()

static void wccp2SortCacheList ( struct wccp2_cache_list_t head)
static

Definition at line 2491 of file wccp2.cc.

References wccp2_cache_list_t::cache_ip, and wccp2_cache_list_t::next.

Referenced by wccp2HandleUdp().

Variable Documentation

◆ empty_portlist

int empty_portlist[WCCP2_NUMPORTS] = {0, 0, 0, 0, 0, 0, 0, 0}

Definition at line 460 of file wccp2.cc.

Referenced by parse_wccp2_service().

◆ theWccp2Connection

int theWccp2Connection = -1
static

◆ wccp2_cache_view_header

struct wccp2_cache_view_header_t wccp2_cache_view_header
static

Definition at line 260 of file wccp2.cc.

Referenced by wccp2Init().

◆ wccp2_cache_view_info

struct wccp2_cache_view_info_t wccp2_cache_view_info
static

Definition at line 269 of file wccp2.cc.

Referenced by wccp2Init().

◆ wccp2_capability_element

struct wccp2_capability_element_t wccp2_capability_element
static

Definition at line 301 of file wccp2.cc.

Referenced by wccp2Init().

◆ wccp2_capability_info_header

struct wccp2_capability_info_header_t wccp2_capability_info_header
static

Definition at line 291 of file wccp2.cc.

Referenced by wccp2Init().

◆ wccp2_connected

int wccp2_connected = 0
static

◆ wccp2_here_i_am_header

struct wccp2_message_header_t wccp2_here_i_am_header
static

Definition at line 89 of file wccp2.cc.

Referenced by wccp2Init().

◆ wccp2_i_see_you

struct wccp2_i_see_you_t wccp2_i_see_you
static

Definition at line 347 of file wccp2.cc.

Referenced by wccp2HandleUdp().

◆ wccp2_identity_info

struct wccp2_identity_info_t wccp2_identity_info
static

Definition at line 198 of file wccp2.cc.

Referenced by wccp2Init().

◆ wccp2_mask_identity_info

struct wccp2_mask_identity_info_t wccp2_mask_identity_info
static

Definition at line 246 of file wccp2.cc.

Referenced by wccp2Init().

◆ wccp2_numrouters

int wccp2_numrouters
static

Definition at line 433 of file wccp2.cc.

Referenced by wccp2AssignBuckets(), wccp2ConnectionOpen(), wccp2HereIam(), and wccp2Init().

◆ wccp2_service_list_head

◆ wccp2AssignBuckets

EVH wccp2AssignBuckets
static

Definition at line 40 of file wccp2.cc.

Referenced by wccp2ConnectionClose(), and wccp2HandleUdp().

◆ wccp2HandleUdp

PF wccp2HandleUdp
static

Definition at line 38 of file wccp2.cc.

Referenced by wccp2ConnectionOpen(), and wccp2HandleUdp().

◆ wccp2HereIam

EVH wccp2HereIam
static

Definition at line 39 of file wccp2.cc.

Referenced by wccp2ConnectionClose(), wccp2HereIam(), and wccp2Init().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors