akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 1 | #ifndef _NLSR_NPT_H_ |
| 2 | #define _NLSR_NPT_H_ |
| 3 | |
| 4 | #define NO_FACE -12345 |
akmhoque | a30cb77 | 2012-10-07 09:50:34 -0500 | [diff] [blame] | 5 | #define ZERO_FACE 0 |
akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 6 | |
| 7 | struct npt_entry |
| 8 | { |
akmhoque | 810a5b5 | 2012-09-09 16:53:14 -0500 | [diff] [blame] | 9 | char *orig_router; |
| 10 | struct hashtb *name_list; |
akmhoque | de61ba9 | 2012-09-20 22:19:12 -0500 | [diff] [blame] | 11 | struct hashtb *face_list; |
akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 12 | }; |
| 13 | |
akmhoque | 810a5b5 | 2012-09-09 16:53:14 -0500 | [diff] [blame] | 14 | struct name_list_entry |
akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 15 | { |
akmhoque | 810a5b5 | 2012-09-09 16:53:14 -0500 | [diff] [blame] | 16 | char *name; |
akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 17 | }; |
| 18 | |
| 19 | |
akmhoque | de61ba9 | 2012-09-20 22:19:12 -0500 | [diff] [blame] | 20 | int add_npt_entry(char *orig_router, char *name_prefix, int num_face, int *faces, int *route_costs); |
akmhoque | 3cced64 | 2012-09-24 16:20:20 -0500 | [diff] [blame] | 21 | int delete_npt_entry_by_router_and_name_prefix(char *orig_router, char *name_prefix); |
akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 22 | void print_npt(void); |
akmhoque | de61ba9 | 2012-09-20 22:19:12 -0500 | [diff] [blame] | 23 | void delete_orig_router_from_npt(char *orig_router); |
akmhoque | 3cced64 | 2012-09-24 16:20:20 -0500 | [diff] [blame] | 24 | void update_npt_with_new_route(void); |
akmhoque | fbfd098 | 2012-09-09 20:59:03 -0500 | [diff] [blame] | 25 | void destroy_all_face_by_nlsr(void); |
akmhoque | 3cced64 | 2012-09-24 16:20:20 -0500 | [diff] [blame] | 26 | void sort_faces_by_distance(int *faces,int *route_costs,int start,int element); |
| 27 | void update_ccnd_fib_for_orig_router(char *orig_router); |
| 28 | void get_all_faces_for_orig_router_from_npt(char *orig_router, int *faces, int *route_costs, int num_faces); |
akmhoque | 54a14f4 | 2013-02-24 06:16:20 -0600 | [diff] [blame] | 29 | void destroy_name_list(struct hashtb *name_list); |
| 30 | void destroy_face_list(struct hashtb *face_list); |
| 31 | void destroy_npt(void); |
akmhoque | 3560cb6 | 2012-09-09 10:52:30 -0500 | [diff] [blame] | 32 | |
| 33 | #endif |