akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 1 | #ifndef _NLSR_H_ |
| 2 | #define _NLSR_H_ |
| 3 | |
| 4 | #define LSA_ADJ_TYPE 1 |
| 5 | #define LSA_NAME_TYPE 2 |
| 6 | |
akmhoque | 8c50d0d | 2012-08-09 13:38:03 -0500 | [diff] [blame] | 7 | struct name_prefix |
| 8 | { |
| 9 | char *name; |
| 10 | int length; |
| 11 | }; |
| 12 | |
akmhoque | 28c4502 | 2012-08-09 15:38:02 -0500 | [diff] [blame] | 13 | struct ndn_neighbor |
| 14 | { |
| 15 | struct name_prefix *neighbor; |
| 16 | int face; |
| 17 | int status; |
akmhoque | 386081b | 2012-08-10 10:53:21 -0500 | [diff] [blame] | 18 | int last_lsdb_version; |
| 19 | struct hashtb *lsa_update_queue; |
akmhoque | 28c4502 | 2012-08-09 15:38:02 -0500 | [diff] [blame] | 20 | }; |
| 21 | |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 22 | struct nlsr |
| 23 | { |
| 24 | |
| 25 | struct ccn_closure in_interest; |
| 26 | struct ccn_closure in_content; |
| 27 | struct ccn_schedule *sched; |
| 28 | struct ccn_scheduled_event *event; |
| 29 | |
| 30 | struct hashtb *adl; |
| 31 | struct hashtb *npl; |
| 32 | |
| 33 | struct ccn *ccn; |
| 34 | char *router_name; |
| 35 | |
| 36 | int is_synch_init; |
| 37 | }; |
| 38 | |
| 39 | struct nlsr *nlsr; |
| 40 | |
| 41 | |
| 42 | void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result); |
| 43 | void process_command_router_name(char *command); |
| 44 | void process_command_ccnname(char *command); |
| 45 | void process_command_ccnneighbor(char *command); |
| 46 | void process_conf_command(char *command); |
| 47 | int readConfigFile(const char *filename); |
| 48 | |
akmhoque | 28c4502 | 2012-08-09 15:38:02 -0500 | [diff] [blame] | 49 | void add_name_prefix_to_npl(struct name_prefix *name_prefix); |
| 50 | void print_name_prefix_from_npl(void); |
| 51 | |
| 52 | |
| 53 | void add_adjacent_to_adl(struct ndn_neighbor *nbr); |
| 54 | void print_adjacent_from_adl(void); |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 55 | |
akmhoque | 386081b | 2012-08-10 10:53:21 -0500 | [diff] [blame] | 56 | |
| 57 | void nlsr_destroy( void ); |
| 58 | |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 59 | #endif |