00001 /* 00002 * Copyright (C) 2001 NetLabs SRL (ejbs@netlabs.com.uy) 00003 * 00004 * This file is part of wccpd. 00005 * 00006 * wccpd is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * wccpd is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with wccpd; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00025 #ifndef __WCCP_V1_H__ 00026 #define __WCCP_V1_H__ 1 00027 00028 #include <time.h> 00029 #include <sys/uio.h> 00030 #include "wccpv1_proto.h" 00031 00032 /* 00033 * Server structures 00034 */ 00035 00039 typedef struct S_WCCP1_CLIENT { 00041 int usable : 1, 00043 assigned : 1; 00045 time_t expire; 00053 u_int32 version; 00055 u_int32 rid; 00057 WCCP1_I_SEE_YOU_WC_ENTRY data; 00059 struct S_WCCP1_CLIENT* next; 00060 } WCCP1_CLIENT; 00061 00062 /* wccpv1_proto.c */ 00078 extern struct msghdr* WCCP1Receive (u_int32 ip, void* packet, int len); 00079 00085 extern void WCCP1FreeReply (struct msghdr* reply); 00086 00087 /* wccpv1_clients.c */ 00089 extern void WCCP1Init (); 00090 00096 extern WCCP1_CLIENT* WCCP1GetClientByIP (u_int32 ip); 00097 00104 extern WCCP1_CLIENT* WCCP1AddClient (u_int32 ip); 00105 00111 extern void WCCP1UpdateChangeNumber (); 00112 00118 extern u_int32 WCCP1GetChangeNumber (); 00119 00126 extern u_int32 WCCP1GetUsableCacheCount (); 00127 00139 extern void WCCP1GetUsableCacheData (struct iovec* iov); 00140 00151 extern void WCCP1UpdateHashInfo (u_int32 wccount, u_int32* ips, 00152 WCCP1_HINFO hashes[]); 00158 extern int WCCP1TimeOutEntries (); 00159 00163 extern void WCCP1ClearAllClients (); 00164 00165 #endif /* __WCCP_V1_H__ */