INFOCOM
DEPARTMENT

 


 

OPTIMIZATION IN THE SHORTEST PATH FIRST COMPUTATION

FOR THE QUAGGA SOFTWARE ROUTING
 V. Eramo, M. Listanti, G. Gasparro, A. Cianfrani
University of Roma “La Sapienza”, INFOCOM Dept.
Via Eudossiana, 18 – 00184 Roma, Italy
Tel: +39 6 44585458; Fax: +39 6 4744481
E-mail: eramo@infocom.uniroma1.it

 


 

/* OSPF SPF calculation.

 

      [ ... ]      

/* heap related functions, for the managment of the candidates, to be used with pqueue */

 

 int cmp ( void * node1 , void * node2 )

 {

    struct vertex * v1 = (struct vertex *) node1;

    struct vertex * v2 = (struct vertex *) node2;

    if (v1 != NULL && v2 != NULL ) {

       return (v1->distance - v2->distance);

    } else return 0;

 }

 

 void update_stat (void * node , int position)

 {

   struct vertex * v = (struct vertex *) node;

   /* set the status of the vertex, when its position changes */

   *(v->stat) = position ;

 }

 

/* end of the heap related functions */

Figure 6. The “cmp” and “update_stat” functions in “ospf_spf.c” file

 

       
Via Cavour 256, 00184, Roma (Italy) - Phone: +39 0647852300  Fax: +39 064744481

 

 

BACK