[Openais] Info required regarding netif_state_report parameters

Steven Dake sdake at redhat.com
Thu Aug 17 14:29:32 PDT 2006


On Thu, 2006-08-17 at 10:06 +0530, Sridhar Sahukar wrote:
> Hello Steve,
> 
> I need some information regarding the following code snippet in
> totemnet.c file.
> 
> 
>     817     if (instance->netif_bind_state == BIND_STATE_REGULAR) {
>     818         if (instance->netif_state_report &
> NETIF_STATE_REPORT_UP) {
>     819             log_printf (instance->totemnet_log_level_notice,
>     820                 "The network interface [%s] is now up.\n",
>     821                 totemip_print
> (&instance->totem_interface->boundto));
>     822             instance->netif_state_report =
> NETIF_STATE_REPORT_DOWN;
>     823             instance->totemnet_iface_change_fn
> (instance->context, &instance->my_id);
>     824         }
>     825         /*
>     826          * Add a timer to check for interface going down in
> single membership
>     827          */
>     828         if (instance->my_memb_entries == 1) {
>     829             poll_timer_add (instance->totemnet_poll_handle,
>     830                 instance->totem_config->downcheck_timeout,
>     831                 (void *)instance,
>     832                 timer_function_netif_check_timeout,
>     833                 &instance->timer_netif_check_timeout);
>     834         }
>     835
>     836     } else {
>     837         if (instance->netif_state_report &
> NETIF_STATE_REPORT_DOWN) {
>     838             log_printf (instance->totemnet_log_level_notice,
>     839                 "The network interface is down.\n");
>     840             instance->totemnet_iface_change_fn
> (instance->context, &instance->my_id);
>     841         }
>     842         instance->netif_state_report = NETIF_STATE_REPORT_UP;
>     843
>     844     }
> 
> 
> 
> 
> The above code snippet is very confusing as I dont find much comments
> for the same. Also I dont find the usage of netif_state_report parameter
> anywhere else in the code.
> 

Yes it is a little tricky.  The totem protocol in openais has the
ability to bind to a new IP address (even on a different interface) if
the ip address is changed.  This is called "down checking" which is
where the interface is checked to determine if it is down after some
time interval.  When I added the redundant ring code, I essentially took
this functionality out by making the downcheck timeout parameter very
large.

The netif_state_report is used to report if the interface has changed
states.  If the interface has changed states (ie: it has been downed) it
will be reported as down.  The above code takes care of these issues.

Regards
-steve

> Could you please explain me what exactly does this code do and what is
> the purpose of the netif_state_report parameter?
> 
> Regards,
> Shridhar.
> 
> _______________________________________________
> Openais mailing list
> Openais at lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/openais




More information about the Openais mailing list