blob: 11635fc0bac15b94f63bcfb45f2af366c4d9f962 [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{
15 struct name_prefix *neighbor;
16 int face;
17 int status;
akmhoquec9286692012-08-16 09:57:58 -050018 char *last_lsdb_version;
akmhoque386081b2012-08-10 10:53:21 -050019 struct hashtb *lsa_update_queue;
akmhoque28c45022012-08-09 15:38:02 -050020};
21
akmhoque07dd8cc2012-08-16 10:23:01 -050022struct linkStateDatabase
23{
24 char *version;
akmhoque902d57e2012-08-17 09:24:38 -050025 struct hashtb *adj_lsdb;
26 struct hashtb *name_lsdb;
akmhoque07dd8cc2012-08-16 10:23:01 -050027};
28
akmhoque59980a52012-08-09 12:36:09 -050029struct 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;
akmhoque1c9b92f2012-08-13 10:57:50 -050036 struct ccn_scheduled_event *event_send_lsdb_interest;
akmhoque59980a52012-08-09 12:36:09 -050037
38 struct hashtb *adl;
39 struct hashtb *npl;
40
41 struct ccn *ccn;
42 char *router_name;
43
akmhoque07dd8cc2012-08-16 10:23:01 -050044 struct linkStateDatabase *lsdb;
45
akmhoque59980a52012-08-09 12:36:09 -050046 int is_synch_init;
akmhoquec9286692012-08-16 09:57:58 -050047 int nlsa_id;
akmhoque59980a52012-08-09 12:36:09 -050048};
49
50struct nlsr *nlsr;
51
akmhoque902d57e2012-08-17 09:24:38 -050052void init_nlsr(void);
akmhoque59980a52012-08-09 12:36:09 -050053
54void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result);
55void process_command_router_name(char *command);
56void process_command_ccnname(char *command);
57void process_command_ccnneighbor(char *command);
58void process_conf_command(char *command);
59int readConfigFile(const char *filename);
60
akmhoque28c45022012-08-09 15:38:02 -050061void add_name_prefix_to_npl(struct name_prefix *name_prefix);
62void print_name_prefix_from_npl(void);
63
64
akmhoque8a5babe2012-08-16 17:39:33 -050065
akmhoque59980a52012-08-09 12:36:09 -050066
akmhoque386081b2012-08-10 10:53:21 -050067
68void nlsr_destroy( void );
69
akmhoque59980a52012-08-09 12:36:09 -050070#endif