blob: 9895256a39bf85ed48b536900aa2642a6b304bfc [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;
25 struct hashtb *db;
26};
27
akmhoque59980a52012-08-09 12:36:09 -050028struct nlsr
29{
30
31 struct ccn_closure in_interest;
32 struct ccn_closure in_content;
33 struct ccn_schedule *sched;
34 struct ccn_scheduled_event *event;
akmhoque1c9b92f2012-08-13 10:57:50 -050035 struct ccn_scheduled_event *event_send_lsdb_interest;
akmhoque59980a52012-08-09 12:36:09 -050036
37 struct hashtb *adl;
38 struct hashtb *npl;
39
40 struct ccn *ccn;
41 char *router_name;
42
akmhoque07dd8cc2012-08-16 10:23:01 -050043 struct linkStateDatabase *lsdb;
44
akmhoque59980a52012-08-09 12:36:09 -050045 int is_synch_init;
akmhoquec9286692012-08-16 09:57:58 -050046 int nlsa_id;
akmhoque59980a52012-08-09 12:36:09 -050047};
48
49struct nlsr *nlsr;
50
51
52void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result);
53void process_command_router_name(char *command);
54void process_command_ccnname(char *command);
55void process_command_ccnneighbor(char *command);
56void process_conf_command(char *command);
57int readConfigFile(const char *filename);
58
akmhoque28c45022012-08-09 15:38:02 -050059void add_name_prefix_to_npl(struct name_prefix *name_prefix);
60void print_name_prefix_from_npl(void);
61
62
63void add_adjacent_to_adl(struct ndn_neighbor *nbr);
64void print_adjacent_from_adl(void);
akmhoque59980a52012-08-09 12:36:09 -050065
akmhoque386081b2012-08-10 10:53:21 -050066
67void nlsr_destroy( void );
68
akmhoque59980a52012-08-09 12:36:09 -050069#endif