blob: 67ffe3988e8da107d0c6b85d9e015b3da94d7d63 [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;
18};
19
akmhoque59980a52012-08-09 12:36:09 -050020struct nlsr
21{
22
23 struct ccn_closure in_interest;
24 struct ccn_closure in_content;
25 struct ccn_schedule *sched;
26 struct ccn_scheduled_event *event;
27
28 struct hashtb *adl;
29 struct hashtb *npl;
30
31 struct ccn *ccn;
32 char *router_name;
33
34 int is_synch_init;
35};
36
37struct nlsr *nlsr;
38
39
40void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result);
41void process_command_router_name(char *command);
42void process_command_ccnname(char *command);
43void process_command_ccnneighbor(char *command);
44void process_conf_command(char *command);
45int readConfigFile(const char *filename);
46
akmhoque28c45022012-08-09 15:38:02 -050047void add_name_prefix_to_npl(struct name_prefix *name_prefix);
48void print_name_prefix_from_npl(void);
49
50
51void add_adjacent_to_adl(struct ndn_neighbor *nbr);
52void print_adjacent_from_adl(void);
akmhoque59980a52012-08-09 12:36:09 -050053
54#endif