Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

wccpv1.h File Reference

Go to the source code of this file.

Compounds

struct  S_WCCP1_CLIENT
 Defines the data for a WCCP version 1 client. More...


Defines

#define __WCCP_V1_H__   1
 Defines the high-level structures for WCCP version 1.


Typedefs

typedef struct S_WCCP1_CLIENT  WCCP1_CLIENT
 Defines the data for a WCCP version 1 client.


Functions

struct msghdr* WCCP1Receive (u_int32 ip, void *packet, int len)
 Process a received WCCP version 1 packet. More...

void WCCP1FreeReply (struct msghdr *reply)
 Frees a reply from WCCP1Receive. More...

void WCCP1Init ()
 Initialize WCCP version 1 client database.

WCCP1_CLIENTWCCP1GetClientByIP (u_int32 ip)
 Get a WCCP version 1 client by IP address. More...

WCCP1_CLIENTWCCP1AddClient (u_int32 ip)
 Adds a WCCP version 1 client with the given IP address to the list of clients. More...

void WCCP1UpdateChangeNumber ()
 Update the global WCCP version 1 change number. More...

u_int32 WCCP1GetChangeNumber ()
 Get the current global WCCP version 1 change number. More...

u_int32 WCCP1GetUsableCacheCount ()
 Gets a count of usable client caches. More...

void WCCP1GetUsableCacheData (struct iovec *iov)
 Gets the data to be sent for each usable client cache. More...

void WCCP1UpdateHashInfo (u_int32 wccount, u_int32 *ips, WCCP1_HINFO hashes[])
 Update the hash information with the given IPs and hashes. More...

int WCCP1TimeOutEntries ()
 Expire timed-out clints, and get when will the next timeout will be. More...

void WCCP1ClearAllClients ()
 Disables all WebCaches and clears the clients database.


Define Documentation

#define __WCCP_V1_H__   1
 

Defines the high-level structures for WCCP version 1.


Typedef Documentation

typedef struct S_WCCP1_CLIENT WCCP1_CLIENT
 

Defines the data for a WCCP version 1 client.


Function Documentation

WCCP1_CLIENT * WCCP1AddClient ( u_int32 ip )
 

Adds a WCCP version 1 client with the given IP address to the list of clients.

Parameters:
ip   the IP address of the client to add.
Returns:
the newly created client's data, or NULL if allocation failed.

void WCCP1ClearAllClients ( )
 

Disables all WebCaches and clears the clients database.

void WCCP1FreeReply ( struct msghdr * reply )
 

Frees a reply from WCCP1Receive.

Parameters:
reply   the pointer to the msghdr obtained from WCCP1Receive.

u_int32 WCCP1GetChangeNumber ( )
 

Get the current global WCCP version 1 change number.

Returns:
the current change number.

WCCP1_CLIENT * WCCP1GetClientByIP ( u_int32 ip )
 

Get a WCCP version 1 client by IP address.

Parameters:
ip   the IP address of the client to get.
Returns:
the client's data, or NULL if no client was found for the given IP.

u_int32 WCCP1GetUsableCacheCount ( )
 

Gets a count of usable client caches.

Usable caches are those for which reachability has been tested.

Returns:
the number of usable caches.

void WCCP1GetUsableCacheData ( struct iovec * iov )
 

Gets the data to be sent for each usable client cache.

Usable caches are those for which reachability has been tested. It fills the given iov vector with pointers to the data element of each client. It is assumed that enough iov entries were provided. This function will typically be called after WCCP1GetUsableCacheCount.

Parameters:
iov   a iov array where the data must be stored.

void WCCP1Init ( )
 

Initialize WCCP version 1 client database.

struct msghdr * WCCP1Receive ( u_int32 ip,
void * packet,
int len )
 

Process a received WCCP version 1 packet.

This is the entry point for all WCCP version 1 packet processing.

This function does not fill in the msghdr.msg_name and msghdr.msg_namelen, that will be taken care of by the caller. The caller is also responsible of deallocating the reply by calling WCCP1FreeReply.

Parameters:
ip   the IP address of the client that sent this packet.
packet   the packet's data.
len   the length of the packet, as received from the socket layer.
Returns:
a pointer to a msghdr with the reply to send to the client thru sendmsg.

int WCCP1TimeOutEntries ( )
 

Expire timed-out clints, and get when will the next timeout will be.

Returns:
the number of seconds until the next timeout.

void WCCP1UpdateChangeNumber ( )
 

Update the global WCCP version 1 change number.

According to the specs, the change number must be updated each time a usable cache is added, deleted, or changes it's hash information.

void WCCP1UpdateHashInfo ( u_int32 wccount,
u_int32 * ips,
WCCP1_HINFO hashes[] )
 

Update the hash information with the given IPs and hashes.

The caller must ensure that all the given IPs in the list belong to valid and usable clients before calling this function.

Parameters:
wccount   the number of cache entries in this update.
ips   a vector of IP addresses for this update.
hashes   the new hash for each of the above given IPs.


Generated at Fri Jan 25 19:22:24 2002 for wccpd by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001