2
Copyright (c) 2007, 2008 by Juliusz Chroboczek
2
Copyright (c) 2007-2011 by Juliusz Chroboczek
4
4
Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
of this software and associated documentation files (the "Software"), to deal
39
39
unsigned short hold_time; /* in seconds */
41
41
unsigned char channels[DIVERSITY_HOPS];
44
extern struct route *routes;
45
extern int numroutes, maxroutes;
45
extern struct route **routes;
46
46
extern int kernel_metric, allow_duplicates;
47
47
extern int diversity_kind, diversity_factor;
48
48
extern int keep_unfeasible;
69
69
struct neighbour *neigh, const unsigned char *nexthop);
70
70
struct route *find_installed_route(const unsigned char *prefix,
71
71
unsigned char plen);
72
int installed_routes_estimate(void);
72
73
void flush_route(struct route *route);
74
void flush_all_routes(void);
73
75
void flush_neighbour_routes(struct neighbour *neigh);
74
void flush_network_routes(struct network *net, int v4only);
76
void flush_interface_routes(struct interface *ifp, int v4only);
77
void for_all_routes(void (*f)(struct route*, void*), void *closure);
78
void for_all_installed_routes(void (*f)(struct route*, void*), void *closure);
75
79
void install_route(struct route *route);
76
80
void uninstall_route(struct route *route);
77
81
void switch_route(struct route *old, struct route *new);
78
82
int route_feasible(struct route *route);
79
83
int route_old(struct route *route);
80
84
int route_expired(struct route *route);
81
int route_interferes(struct route *route, struct network *net);
85
int route_interferes(struct route *route, struct interface *ifp);
82
86
int update_feasible(struct source *src,
83
87
unsigned short seqno, unsigned short refmetric);
84
88
struct route *find_best_route(const unsigned char *prefix, unsigned char plen,
86
90
struct route *install_best_route(const unsigned char prefix[16],
87
91
unsigned char plen);
88
92
void update_neighbour_metric(struct neighbour *neigh, int changed);
89
void update_network_metric(struct network *net);
93
void update_interface_metric(struct interface *ifp);
90
94
void update_route_metric(struct route *route);
91
struct route *update_route(const unsigned char *a,
92
const unsigned char *p, unsigned char plen,
95
struct route *update_route(const unsigned char *id,
96
const unsigned char *prefix, unsigned char plen,
93
97
unsigned short seqno, unsigned short refmetric,
94
98
unsigned short interval, struct neighbour *neigh,
95
99
const unsigned char *nexthop,