blob: d9cc410c9b0ff0970d7ec19ab049f1ac53ca41aa [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;
29
30 struct hashtb *adl;
31 struct hashtb *npl;
32
33 struct ccn *ccn;
34 char *router_name;
35
36 int is_synch_init;
37};
38
39struct nlsr *nlsr;
40
41
42void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result);
43void process_command_router_name(char *command);
44void process_command_ccnname(char *command);
45void process_command_ccnneighbor(char *command);
46void process_conf_command(char *command);
47int readConfigFile(const char *filename);
48
akmhoque28c45022012-08-09 15:38:02 -050049void add_name_prefix_to_npl(struct name_prefix *name_prefix);
50void print_name_prefix_from_npl(void);
51
52
53void add_adjacent_to_adl(struct ndn_neighbor *nbr);
54void print_adjacent_from_adl(void);
akmhoque59980a52012-08-09 12:36:09 -050055
akmhoque386081b2012-08-10 10:53:21 -050056
57void nlsr_destroy( void );
58
akmhoque59980a52012-08-09 12:36:09 -050059#endif