Skip to content

Commit

Permalink
Implement route_old and route_expired.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliusz Chroboczek committed Oct 25, 2008
1 parent 131be26 commit 5d715b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions route.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ route_feasible(struct route *route)
return update_feasible(route->src, route->seqno, route->refmetric);
}

int
route_old(struct route *route)
{
return route->time < now.tv_sec - route->hold_time * 7 / 8;
}

int
route_expired(struct route *route)
{
return route->time < now.tv_sec - route->hold_time;
}

int
update_feasible(struct source *src,
unsigned short seqno, unsigned short refmetric)
Expand Down
2 changes: 2 additions & 0 deletions route.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ void uninstall_route(struct route *route);
void switch_route(struct route *old, struct route *new);
void change_route_metric(struct route *route, unsigned newmetric);
int route_feasible(struct route *route);
int route_old(struct route *route);
int route_expired(struct route *route);
int update_feasible(struct source *src,
unsigned short seqno, unsigned short refmetric);
struct route *find_best_route(const unsigned char *prefix, unsigned char plen,
Expand Down

0 comments on commit 5d715b5

Please sign in to comment.