akmhoque | 29c1db5 | 2012-09-07 14:47:43 -0500 | [diff] [blame] | 1 | #ifndef _NLSR_ROUTE_H_ |
| 2 | #define _NLSR_ROUTE_H_ |
| 3 | |
| 4 | #define EMPTY_PARENT -12345 |
| 5 | #define INF_DISTANCE 2147483647 |
| 6 | |
akmhoque | 810a5b5 | 2012-09-09 16:53:14 -0500 | [diff] [blame^] | 7 | #define NO_NEXT_HOP -12345 |
| 8 | #define NO_MAPPING_NUM -1 |
akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 9 | |
akmhoque | 29c1db5 | 2012-09-07 14:47:43 -0500 | [diff] [blame] | 10 | struct map_entry |
| 11 | { |
| 12 | char *router; |
| 13 | int mapping; |
| 14 | }; |
| 15 | |
akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 16 | |
| 17 | struct routing_table_entry |
| 18 | { |
| 19 | char *dest_router; |
| 20 | int next_hop_face; |
| 21 | } |
| 22 | ; |
| 23 | |
akmhoque | 29c1db5 | 2012-09-07 14:47:43 -0500 | [diff] [blame] | 24 | int route_calculate(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags); |
| 25 | void make_map(void); |
| 26 | void add_map_entry(char *router); |
| 27 | void add_adj_data_to_map(char *orig_router, char *body, int no_link); |
| 28 | void print_map(void); |
| 29 | void assign_mapping_number(void); |
| 30 | void make_adj_matrix(int **adj_matrix,int map_element); |
| 31 | void init_adj_matrix(int **adj_matrix,int map_element); |
| 32 | void print_adj_matrix(int **adj_matrix, int map_element); |
| 33 | int get_mapping_no(char *router); |
| 34 | void calculate_path(int **adj_matrix, long int *parent, long int V, long int S); |
| 35 | void sort_queue_by_distance(long int *Q,long int *dist,long int start,long int element); |
| 36 | int is_not_explored(long int *Q, long int u,long int start, long int element); |
| 37 | void print_path(long int *parent, long int dest); |
| 38 | void print_all_path_from_source(long int *parent,long int source); |
| 39 | |
akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 40 | /* Routing Table Relates function */ |
| 41 | |
| 42 | int get_next_hop(char *dest_router); |
| 43 | void add_next_hop_router(char *dest_router); |
| 44 | void add_next_hop_from_lsa_adj_body(char *body, int no_link); |
| 45 | void print_routing_table(void); |
| 46 | void do_old_routing_table_updates(); |
| 47 | |
akmhoque | 29c1db5 | 2012-09-07 14:47:43 -0500 | [diff] [blame] | 48 | #endif |