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

wccpv1_proto.h

Go to the documentation of this file.
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 
00026 #ifndef __WCCP_V1_PROTO_H__
00027 #define __WCCP_V1_PROTO_H__ 1
00028 
00029 #include "types.h"
00030 
00031 
00032 /*
00033  * Constants
00034  */
00035 
00037 #define WCCP1_PORT              2048
00038 
00040 #define WCCP1_PROTO_VERSION_MIN 3
00041 
00042 #define WCCP1_PROTO_VERSION_MAX 4
00043 
00044 #define WCCP1_HASH_REVISION     0
00045 
00047 enum WCCPV1_TYPES {
00049         WCCP1_HERE_I_AM     = 7,
00051         WCCP1_I_SEE_YOU     = 8,
00053         WCCP1_ASSIGN_BUCKET = 9
00054 };
00055 
00057 #define WCCP1_HERE_I_AM_T       10
00058 
00059 #define WCCP1_HERE_I_AM_TIMEOUT (3 * WCCP1_HERE_I_AM_T)
00060 
00061 #define WCCP1_MAX_CACHES        32
00062 
00064 #define WCCP1_MAX_PACKET_SIZE   (sizeof(WCCP1_ASSIGN_BUCKET_MSG) +       \
00065                                  (sizeof(u_int32) * WCCP1_MAX_CACHES) + \
00066                                  sizeof(WCCP1_ASSIGN_BUCKET_HASHINFO))
00067 
00068 
00069 /*
00070  * Message formats
00071  *
00072  * Everything is in Network Byte Order.
00073  */
00074 
00076 typedef u_int32 WCCP1_HINFO [8];
00077 
00079 typedef struct {
00081         u_int32     type;
00083         u_int32     version;
00085         u_int32     hrev;
00087         WCCP1_HINFO hinfo;
00088 #if defined(WORDS_BIGENDIAN)
00089 
00090         u_int32 u:1,
00092                 reserved:31;
00093 #else /* !defined (WORDS_BIGENDIAN) */
00094         u_int32 reserved:1,
00095                 u:31;
00096 #endif /* !defined (WORDS_BIGENDIAN) */
00097 
00098         u_int32 rid;
00099 } WCCP1_HERE_I_AM_MSG;
00100 
00107 typedef struct {
00109         u_int32 type;
00111         u_int32 version;
00113         u_int32 chgnbr;
00115         u_int32 rid;
00117         u_int32 wccount;
00118         /* WCCP1_I_SEE_YOU_WC_ENTRY 0..wccount */
00119 } WCCP1_I_SEE_YOU_MSG;
00120 
00122 typedef struct {
00124         u_int32     ip;
00126         u_int32     hrev;
00128         WCCP1_HINFO hinfo;
00129 #if defined(WORDS_BIGENDIAN)
00130 
00131         u_int32 u:1,
00133                 reserved:31;
00134 #else /* !defined (WORDS_BIGENDIAN) */
00135         u_int32 reserved:1,
00136                 u:31;
00137 #endif /* !defined (WORDS_BIGENDIAN) */
00138 } WCCP1_I_SEE_YOU_WC_ENTRY;
00139 
00147 typedef struct {
00149         u_int32 type;
00151         u_int32 rid;
00153         u_int32 wccount;
00154         /* Web-Cache n IP Address list (u_int32) */
00155         /* WCCP1_ASSIGN_BUCKET_HASHINFO */
00156 } WCCP1_ASSIGN_BUCKET_MSG;
00157 
00164 typedef struct {
00166         u_int8 bucket [256];
00167 } WCCP1_ASSIGN_BUCKET_HASHINFO;
00168 
00169 #endif /* __WCCP_V1_PROTO_H__ */

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