blob: 803e6b81a74391617d91909bd5bb792b880122aa [file] [log] [blame]
akmhoque59980a52012-08-09 12:36:09 -05001#ifndef _NLSR_H_
2#define _NLSR_H_
3
4#define LSA_ADJ_TYPE 1
5#define LSA_NAME_TYPE 2
6
akmhoque8c50d0d2012-08-09 13:38:03 -05007struct name_prefix
8{
9 char *name;
10 int length;
11};
12
akmhoque28c45022012-08-09 15:38:02 -050013struct ndn_neighbor
14{
akmhoquea6817692012-08-21 13:50:01 -040015 //struct name_prefix *neighbor;
16 struct ccn_charbuf *neighbor;
akmhoque28c45022012-08-09 15:38:02 -050017 int face;
18 int status;
akmhoquef6432c22012-08-21 13:18:05 -040019 long int last_lsdb_version;
akmhoque386081b2012-08-10 10:53:21 -050020 struct hashtb *lsa_update_queue;
akmhoque28c45022012-08-09 15:38:02 -050021};
22
akmhoque07dd8cc2012-08-16 10:23:01 -050023struct linkStateDatabase
24{
akmhoquef6432c22012-08-21 13:18:05 -040025 long int version;
akmhoque902d57e2012-08-17 09:24:38 -050026 struct hashtb *adj_lsdb;
27 struct hashtb *name_lsdb;
akmhoque07dd8cc2012-08-16 10:23:01 -050028};
29
akmhoque59980a52012-08-09 12:36:09 -050030struct 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;
akmhoque1c9b92f2012-08-13 10:57:50 -050037 struct ccn_scheduled_event *event_send_lsdb_interest;
akmhoque59980a52012-08-09 12:36:09 -050038
39 struct hashtb *adl;
40 struct hashtb *npl;
41
42 struct ccn *ccn;
43 char *router_name;
44
akmhoque07dd8cc2012-08-16 10:23:01 -050045 struct linkStateDatabase *lsdb;
46
akmhoque59980a52012-08-09 12:36:09 -050047 int is_synch_init;
akmhoquec9286692012-08-16 09:57:58 -050048 int nlsa_id;
akmhoque59980a52012-08-09 12:36:09 -050049};
50
51struct nlsr *nlsr;
52
akmhoque902d57e2012-08-17 09:24:38 -050053void init_nlsr(void);
akmhoque59980a52012-08-09 12:36:09 -050054
55void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result);
56void process_command_router_name(char *command);
57void process_command_ccnname(char *command);
58void process_command_ccnneighbor(char *command);
59void process_conf_command(char *command);
60int readConfigFile(const char *filename);
61
akmhoque28c45022012-08-09 15:38:02 -050062void add_name_prefix_to_npl(struct name_prefix *name_prefix);
63void print_name_prefix_from_npl(void);
64
65
akmhoque8a5babe2012-08-16 17:39:33 -050066
akmhoque59980a52012-08-09 12:36:09 -050067
akmhoque386081b2012-08-10 10:53:21 -050068
69void nlsr_destroy( void );
70
akmhoque59980a52012-08-09 12:36:09 -050071#endif