Ejemplo n.º 1
0
/**
*   Ages groups in the last member check state. If the
*   route is not found, or not in this state, 0 is returned.
*/
int lastMemberGroupAge(struct in6_addr * group, struct in6_addr * src) 
{
    struct Config       *conf = NULL;
    struct RouteTable   *croute, *nroute;
    int i;
    
    conf = getCommonConfig();
/*
    printf("\nlastMemberGroupAge called, src = \n");
    for (i=0; i <16; i++)
        printf("%02x ",((char*)group)[i] & 255);
    printf("\n");  
    for (i=0; i <16; i++)
        printf("%02x ",((char*)src)[i] & 255);
    printf("\n");      
*/
    if( !IN6_ARE_ADDR_EQUAL( src, &allzero_addr ) ) 
    {
        croute = findRoute(group, src);
        if(croute!=NULL)
        {
            if(croute->upstrState == ROUTESTATE_CHECK_LAST_MEMBER) 
            {
                internAgeRoute(croute);
            }
        }
    }
    else
    {
        //showRoute();

        for( croute = routing_table; croute != NULL; croute = nroute )
        {        
            // Keep the next route (since current route may be removed)...
            nroute = croute->nextroute;

            // Run the aging round algorithm.
            if( croute->upstrState = ROUTESTATE_CHECK_LAST_MEMBER && 
                IN6_ARE_ADDR_EQUAL( &croute->group, group ) 
              )
            {
                // Only age routes if Last member probe is not active...
                internAgeRoute(croute);
            }
        }
    }    
    return 0;
}
Ejemplo n.º 2
0
/**
*   Ages groups in the last member check state. If the
*   route is not found, or not in this state, 0 is returned.
*/
int lastMemberGroupAge(uint32_t group) {
    struct RouteTable   *croute;

    croute = findRoute(group);
    if(croute!=NULL) {
        if(croute->upstrState == ROUTESTATE_CHECK_LAST_MEMBER) {
            return !internAgeRoute(croute);
        } else {
            return 0;
        }
    }
    return 0;
}
Ejemplo n.º 3
0
/**
*   This function loops through all routes, and updates the age 
*   of any active routes.
*/
void ageActiveRoutes() {
    struct RouteTable   *croute, *nroute;
    
    my_log(LOG_DEBUG, 0, "Aging routes in table.");

    // Scan all routes...
    for( croute = routing_table; croute != NULL; croute = nroute ) {
        
        // Keep the next route (since current route may be removed)...
        nroute = croute->nextroute;

        // Run the aging round algorithm.
        if(croute->upstrState != ROUTESTATE_CHECK_LAST_MEMBER) {
            // Only age routes if Last member probe is not active...
            internAgeRoute(croute);
        }
    }
    logRouteTable("Age active routes");
}