akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 1 | #ifndef _NLSR_H_ |
| 2 | #define _NLSR_H_ |
| 3 | |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame^] | 4 | |
akmhoque | d79438d | 2012-08-27 13:31:42 -0500 | [diff] [blame] | 5 | #define LSDB_SYNCH_INTERVAL 300 |
| 6 | #define INTEREST_RETRY 3 |
| 7 | #define INTEREST_RESEND_TIME 15 |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 8 | |
akmhoque | 8c50d0d | 2012-08-09 13:38:03 -0500 | [diff] [blame] | 9 | struct name_prefix |
| 10 | { |
| 11 | char *name; |
| 12 | int length; |
| 13 | }; |
| 14 | |
akmhoque | 07dd8cc | 2012-08-16 10:23:01 -0500 | [diff] [blame] | 15 | struct linkStateDatabase |
| 16 | { |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 17 | struct hashtb *name_lsdb; |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame^] | 18 | struct hashtb *adj_lsdb; |
| 19 | char *lsdb_version; |
akmhoque | 07dd8cc | 2012-08-16 10:23:01 -0500 | [diff] [blame] | 20 | }; |
| 21 | |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 22 | struct 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; |
akmhoque | 1c9b92f | 2012-08-13 10:57:50 -0500 | [diff] [blame] | 29 | struct ccn_scheduled_event *event_send_lsdb_interest; |
akmhoque | d79438d | 2012-08-27 13:31:42 -0500 | [diff] [blame] | 30 | struct ccn_scheduled_event *event_send_info_interest; |
| 31 | struct ccn_scheduled_event *event_build_name_lsa; |
| 32 | struct ccn_scheduled_event *event_build_adj_lsa; |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 33 | |
| 34 | struct hashtb *adl; |
| 35 | struct hashtb *npl; |
| 36 | |
akmhoque | 07dd8cc | 2012-08-16 10:23:01 -0500 | [diff] [blame] | 37 | struct linkStateDatabase *lsdb; |
| 38 | |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame^] | 39 | struct ccn *ccn; |
| 40 | char *router_name; |
| 41 | |
| 42 | |
| 43 | |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 44 | int is_synch_init; |
akmhoque | f71d908 | 2012-08-22 12:51:53 -0400 | [diff] [blame] | 45 | long int nlsa_id; |
akmhoque | d79438d | 2012-08-27 13:31:42 -0500 | [diff] [blame] | 46 | int adj_build_flag; |
| 47 | long int adj_build_count; |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 48 | int is_build_adj_lsa_sheduled; |
| 49 | int is_send_lsdb_interest_scheduled; |
akmhoque | d79438d | 2012-08-27 13:31:42 -0500 | [diff] [blame] | 50 | |
| 51 | long int lsdb_synch_interval; |
| 52 | int interest_retry; |
| 53 | long int interest_resend_time; |
akmhoque | 42098b1 | 2012-08-27 22:54:23 -0500 | [diff] [blame] | 54 | |
| 55 | int semaphor; |
akmhoque | d79438d | 2012-08-27 13:31:42 -0500 | [diff] [blame] | 56 | |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | struct nlsr *nlsr; |
| 60 | |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 61 | void process_command_ccnneighbor(char *command); |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame^] | 62 | void process_command_ccnname(char *command); |
akmhoque | d79438d | 2012-08-27 13:31:42 -0500 | [diff] [blame] | 63 | void process_command_lsdb_synch_interval(char *command); |
| 64 | void process_command_interest_retry(char *command); |
| 65 | void process_command_interest_resend_time(char *command); |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 66 | void process_conf_command(char *command); |
| 67 | int readConfigFile(const char *filename); |
| 68 | |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame^] | 69 | void init_nlsr(void); |
akmhoque | 386081b | 2012-08-10 10:53:21 -0500 | [diff] [blame] | 70 | void nlsr_destroy( void ); |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame^] | 71 | void nlsr_stop_signal_handler(int sig); |
akmhoque | 386081b | 2012-08-10 10:53:21 -0500 | [diff] [blame] | 72 | |
akmhoque | 59980a5 | 2012-08-09 12:36:09 -0500 | [diff] [blame] | 73 | #endif |