|
/* 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 */
|