[Openais] Info required regarding netif_state_report parameters

Sridhar Sahukar ssahukar at openclovis.com
Wed Aug 16 21:36:06 PDT 2006


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.

Could you please explain me what exactly does this code do and what is
the purpose of the netif_state_report parameter?

Regards,
Shridhar.




More information about the Openais mailing list