blob: d2274eec051a3b6996bd34a1c8ed540760825fde [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;
akmhoque386081b2012-08-10 10:53:21 -050018 int last_lsdb_version;
19 struct hashtb *lsa_update_queue;
akmhoque28c45022012-08-09 15:38:02 -050020};
21
akmhoque59980a52012-08-09 12:36:09 -050022struct nlsr
23{
24
25 struct ccn_closure in_interest;
26 struct ccn_closure in_content;
27 struct ccn_schedule *sched;
28 struct ccn_scheduled_event *event;
akmhoque1c9b92f2012-08-13 10:57:50 -050029 struct ccn_scheduled_event *event_send_lsdb_interest;
akmhoque59980a52012-08-09 12:36:09 -050030
31 struct hashtb *adl;
32 struct hashtb *npl;
33
34 struct ccn *ccn;
35 char *router_name;
36
37 int is_synch_init;
38};
39
40struct nlsr *nlsr;
41
42
43void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result);
44void process_command_router_name(char *command);
45void process_command_ccnname(char *command);
46void process_command_ccnneighbor(char *command);
47void process_conf_command(char *command);
48int readConfigFile(const char *filename);
49
akmhoque28c45022012-08-09 15:38:02 -050050void add_name_prefix_to_npl(struct name_prefix *name_prefix);
51void print_name_prefix_from_npl(void);
52
53
54void add_adjacent_to_adl(struct ndn_neighbor *nbr);
55void print_adjacent_from_adl(void);
akmhoque59980a52012-08-09 12:36:09 -050056
akmhoque386081b2012-08-10 10:53:21 -050057
58void nlsr_destroy( void );
59
akmhoque59980a52012-08-09 12:36:09 -050060#endif