blob: 41df3c5e8417178ac1bb26c74e4e398d7daac25a [file] [log] [blame]
akmhoque59980a52012-08-09 12:36:09 -05001#ifndef _NLSR_H_
2#define _NLSR_H_
3
akmhoque03004e62012-09-06 01:12:28 -05004
akmhoqued79438d2012-08-27 13:31:42 -05005#define LSDB_SYNCH_INTERVAL 300
6#define INTEREST_RETRY 3
7#define INTEREST_RESEND_TIME 15
akmhoque59980a52012-08-09 12:36:09 -05008
akmhoque8c50d0d2012-08-09 13:38:03 -05009struct name_prefix
10{
11 char *name;
12 int length;
13};
14
akmhoque07dd8cc2012-08-16 10:23:01 -050015struct linkStateDatabase
16{
akmhoque902d57e2012-08-17 09:24:38 -050017 struct hashtb *name_lsdb;
akmhoque03004e62012-09-06 01:12:28 -050018 struct hashtb *adj_lsdb;
19 char *lsdb_version;
akmhoque07dd8cc2012-08-16 10:23:01 -050020};
21
akmhoque29c1db52012-09-07 14:47:43 -050022struct pneding_interest
23{
24 char *int_name;
25 int timed_out;
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;
akmhoqued79438d2012-08-27 13:31:42 -050036 struct ccn_scheduled_event *event_send_info_interest;
37 struct ccn_scheduled_event *event_build_name_lsa;
38 struct ccn_scheduled_event *event_build_adj_lsa;
akmhoque29c1db52012-09-07 14:47:43 -050039 struct ccn_scheduled_event *event_calculate_route;
akmhoque59980a52012-08-09 12:36:09 -050040
41 struct hashtb *adl;
42 struct hashtb *npl;
akmhoque29c1db52012-09-07 14:47:43 -050043 struct hashtb *pit_alsa;
44 struct hashtb *map;
akmhoque59980a52012-08-09 12:36:09 -050045
akmhoque07dd8cc2012-08-16 10:23:01 -050046 struct linkStateDatabase *lsdb;
47
akmhoque03004e62012-09-06 01:12:28 -050048 struct ccn *ccn;
49 char *router_name;
50
51
52
akmhoque59980a52012-08-09 12:36:09 -050053 int is_synch_init;
akmhoquef71d9082012-08-22 12:51:53 -040054 long int nlsa_id;
akmhoqued79438d2012-08-27 13:31:42 -050055 int adj_build_flag;
56 long int adj_build_count;
akmhoque53f64222012-09-05 13:57:51 -050057 int is_build_adj_lsa_sheduled;
58 int is_send_lsdb_interest_scheduled;
akmhoque29c1db52012-09-07 14:47:43 -050059 int is_route_calculation_scheduled;
akmhoqued79438d2012-08-27 13:31:42 -050060
61 long int lsdb_synch_interval;
62 int interest_retry;
63 long int interest_resend_time;
akmhoque42098b12012-08-27 22:54:23 -050064
65 int semaphor;
akmhoqued79438d2012-08-27 13:31:42 -050066
akmhoque59980a52012-08-09 12:36:09 -050067};
68
69struct nlsr *nlsr;
70
akmhoque59980a52012-08-09 12:36:09 -050071void process_command_ccnneighbor(char *command);
akmhoque03004e62012-09-06 01:12:28 -050072void process_command_ccnname(char *command);
akmhoqued79438d2012-08-27 13:31:42 -050073void process_command_lsdb_synch_interval(char *command);
74void process_command_interest_retry(char *command);
75void process_command_interest_resend_time(char *command);
akmhoque59980a52012-08-09 12:36:09 -050076void process_conf_command(char *command);
77int readConfigFile(const char *filename);
78
akmhoque03004e62012-09-06 01:12:28 -050079void init_nlsr(void);
akmhoque386081b2012-08-10 10:53:21 -050080void nlsr_destroy( void );
akmhoque03004e62012-09-06 01:12:28 -050081void nlsr_stop_signal_handler(int sig);
akmhoque386081b2012-08-10 10:53:21 -050082
akmhoque59980a52012-08-09 12:36:09 -050083#endif