blob: 100b69e5b2c716018ef653ed8f71fe49331ca8de [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
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;
akmhoquec9286692012-08-16 09:57:58 -050038 int nlsa_id;
akmhoque59980a52012-08-09 12:36:09 -050039};
40
41struct nlsr *nlsr;
42
43
44void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result);
45void process_command_router_name(char *command);
46void process_command_ccnname(char *command);
47void process_command_ccnneighbor(char *command);
48void process_conf_command(char *command);
49int readConfigFile(const char *filename);
50
akmhoque28c45022012-08-09 15:38:02 -050051void add_name_prefix_to_npl(struct name_prefix *name_prefix);
52void print_name_prefix_from_npl(void);
53
54
55void add_adjacent_to_adl(struct ndn_neighbor *nbr);
56void print_adjacent_from_adl(void);
akmhoque59980a52012-08-09 12:36:09 -050057
akmhoque386081b2012-08-10 10:53:21 -050058
59void nlsr_destroy( void );
60
akmhoque59980a52012-08-09 12:36:09 -050061#endif