send wccpv2 HERE_I_AM message to 2 router

From: Nont Banditwong <biomed@dont-contact.us>
Date: Fri, 02 Apr 2004 14:39:15 +0700

Dear group
I'm very new for squid developer, I've read "Squid Programmers Guide" already but
there are thing I'm not clear.
I wish to develop WCCPv2 on squid to support multi-router, first I start with 2.
 
Could you suggest me what is the proper way to send HERE_I_AM message to 2 routers.
 
if I uncomment on a 2nd half of function below this cache is mask as unusable.
 
 
static void
wccp2HereIam(void *voidnotused)
{
   u_short port = WCCP_PORT;
   struct sockaddr_in router;
   int router_len;
 
 
   debug(80, 6) ("wccp2HereIam: Called\n");
 
   router_len = sizeof(router);
 
   memset(&router, '\0', router_len);
   router.sin_family = AF_INET;
   router.sin_port = htons(port);
   router.sin_addr = Config.Wccp2.router;
 
   if (connect(theOutWccpConnection, (struct sockaddr *) &router, router_len))
     fatal("wccp2HereIam: Unable to connect WCCP out socket");
 
   wccp2_here_i_am.cache_identity_addr = local_ip;
   wccp2_here_i_am.id = wccp2_i_see_you_id1; // wccp2_i_see_you.id;
   wccp2_here_i_am.cache_view_rtr1_receive_id = wccp2_received_id;
   wccp2_here_i_am.cache_view_rtr1_addr = wccp2_router_addr;
 
send(theOutWccpConnection,
        &wccp2_here_i_am,
        sizeof(wccp2_here_i_am),
        0);
 
/* commSetSelect(theOutWccpConnection,
                         COMM_SELECT_WRITE,
                         wccp2HereIam,
                         NULL,
                         0);
*/
/* if (!eventFind(wccp2HereIam, NULL))
                      eventAdd("wccp2HereIam", wccp2HereIam, NULL, 10.0, 1);
*/
        /* for router 2 */
/* memset(&router, '\0', router_len);
           router.sin_family = AF_INET;
           router.sin_port = htons(port);
           router.sin_addr = Config.Wccp2.router2;
        if (connect(theOutWccpConnection, (struct sockaddr *) &router, router_len))
                     fatal("wccp2HereIam: Unable to connect WCCP out socket");
 
           wccp2_here_i_am.cache_identity_addr = local_ip;
           wccp2_here_i_am.id = wccp2_i_see_you_id2; //wccp2_i_see_you.id;
           wccp2_here_i_am.cache_view_rtr1_receive_id = wccp2_received_id2;
           wccp2_here_i_am.cache_view_rtr1_addr = wccp2_router2_addr;
 
           send(theOutWccpConnection,
                &wccp2_here_i_am,
                sizeof(wccp2_here_i_am),
                0);
          */
           if (!eventFind(wccp2HereIam, NULL))
                eventAdd("wccp2HereIam", wccp2HereIam, NULL, 10.0, 1);
}
 

-- 
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org 
This allows you to send and receive SMS through your mailbox.
Powered by Outblaze
Received on Fri Apr 02 2004 - 00:39:18 MST

This archive was generated by hypermail pre-2.1.9 : Thu Apr 29 2004 - 12:00:03 MDT