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