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 | { | ||||
akmhoque | a681769 | 2012-08-21 13:50:01 -0400 | [diff] [blame^] | 15 | //struct name_prefix *neighbor; |
16 | struct ccn_charbuf *neighbor; | ||||
akmhoque | 28c4502 | 2012-08-09 15:38:02 -0500 | [diff] [blame] | 17 | int face; |
18 | int status; | ||||
akmhoque | f6432c2 | 2012-08-21 13:18:05 -0400 | [diff] [blame] | 19 | long int last_lsdb_version; |
akmhoque | 386081b | 2012-08-10 10:53:21 -0500 | [diff] [blame] | 20 | struct hashtb *lsa_update_queue; |
akmhoque | 28c4502 | 2012-08-09 15:38:02 -0500 | [diff] [blame] | 21 | }; |
22 | |||||
akmhoque | 07dd8cc | 2012-08-16 10:23:01 -0500 | [diff] [blame] | 23 | struct linkStateDatabase |
24 | { | ||||
akmhoque | f6432c2 | 2012-08-21 13:18:05 -0400 | [diff] [blame] | 25 | long int version; |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 26 | struct hashtb *adj_lsdb; |
27 | struct hashtb *name_lsdb; | ||||
akmhoque | 07dd8cc | 2012-08-16 10:23:01 -0500 | [diff] [blame] | 28 | }; |
29 | |||||
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 30 | struct nlsr |
31 | { | ||||
32 | |||||
33 | struct ccn_closure in_interest; | ||||
34 | struct ccn_closure in_content; | ||||
35 | struct ccn_schedule *sched; | ||||
36 | struct ccn_scheduled_event *event; | ||||
akmhoque | 1c9b92f | 2012-08-13 10:57:50 -0500 | [diff] [blame] | 37 | struct ccn_scheduled_event *event_send_lsdb_interest; |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 38 | |
39 | struct hashtb *adl; | ||||
40 | struct hashtb *npl; | ||||
41 | |||||
42 | struct ccn *ccn; | ||||
43 | char *router_name; | ||||
44 | |||||
akmhoque | 07dd8cc | 2012-08-16 10:23:01 -0500 | [diff] [blame] | 45 | struct linkStateDatabase *lsdb; |
46 | |||||
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 47 | int is_synch_init; |
akmhoque | c928669 | 2012-08-16 09:57:58 -0500 | [diff] [blame] | 48 | int nlsa_id; |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 49 | }; |
50 | |||||
51 | struct nlsr *nlsr; | ||||
52 | |||||
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 53 | void init_nlsr(void); |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 54 | |
55 | void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result); | ||||
56 | void process_command_router_name(char *command); | ||||
57 | void process_command_ccnname(char *command); | ||||
58 | void process_command_ccnneighbor(char *command); | ||||
59 | void process_conf_command(char *command); | ||||
60 | int readConfigFile(const char *filename); | ||||
61 | |||||
akmhoque | 28c4502 | 2012-08-09 15:38:02 -0500 | [diff] [blame] | 62 | void add_name_prefix_to_npl(struct name_prefix *name_prefix); |
63 | void print_name_prefix_from_npl(void); | ||||
64 | |||||
65 | |||||
akmhoque | 8a5babe | 2012-08-16 17:39:33 -0500 | [diff] [blame] | 66 | |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 67 | |
akmhoque | 386081b | 2012-08-10 10:53:21 -0500 | [diff] [blame] | 68 | |
69 | void nlsr_destroy( void ); | ||||
70 | |||||
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 71 | #endif |