C.9. Initializing the Virtual Router Structure

/*********************************************************
 NAME : init_virtual_srv
*********************************************************/
static void init_virtual_srv( vrrp_rt *vsrv )
{
   memset( vsrv, 0, sizeof(*vsrv) );
   vsrv->state       = VRRP_STATE_INIT;
   vsrv->priority    = VRRP_PRIO_DFL;
   vsrv->adver_int   = VRRP_ADVER_DFL*VRRP_TIMER_HZ;
   vsrv->preempt     = VRRP_PREEMPT_DFL;
}

The function init_virtual_srv initialized the virtual router structure vsrv. Note that the initial state of the virtual router is set to VRRP_STATE_INIT. The priority, advertisement interval, and preempt are set to defaults unless the user changes them. Note that the advertisement interval default, which is 1 second, is multiplied ...

Get VRRP: Increasing Reliability and Failover with the Virtual Router Redundance Protocol now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.