akmhoque | 8a5babe | 2012-08-16 17:39:33 -0500 | [diff] [blame] | 1 | #ifndef _NLSR_ADL_H_ |
| 2 | #define _NLSR_ADL_H_ |
| 3 | |
akmhoque | 42098b1 | 2012-08-27 22:54:23 -0500 | [diff] [blame] | 4 | #define NBR_DOWN 0 |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame] | 5 | #define NBR_ACTIVE 1 |
akmhoque | 42098b1 | 2012-08-27 22:54:23 -0500 | [diff] [blame] | 6 | |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame] | 7 | struct ndn_neighbor |
| 8 | { |
| 9 | struct name_prefix *neighbor; |
| 10 | int face; |
| 11 | int status; |
| 12 | char * last_lsdb_version; |
| 13 | char * last_info_version; |
akmhoque | b77b95f | 2013-02-08 12:28:47 -0600 | [diff] [blame] | 14 | char *ip_address; |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame] | 15 | int info_interest_timed_out; |
akmhoque | 14b3f34 | 2012-09-14 10:39:02 -0500 | [diff] [blame] | 16 | int lsdb_interest_timed_out; |
| 17 | int lsdb_random_time_component; |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame] | 18 | long int lsdb_synch_interval; |
| 19 | long int last_lsdb_requested; |
| 20 | int is_lsdb_send_interest_scheduled; |
| 21 | int metric; |
| 22 | }; |
| 23 | |
akmhoque | b77b95f | 2013-02-08 12:28:47 -0600 | [diff] [blame] | 24 | void add_nbr_to_adl(struct name_prefix *new_nbr,int face,char *ip); |
akmhoque | 3171d65 | 2012-11-13 11:44:33 -0600 | [diff] [blame] | 25 | void delete_nbr_from_adl(struct name_prefix *nbr); |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 26 | void print_adjacent(struct ndn_neighbor *nbr); |
akmhoque | 8a5babe | 2012-08-16 17:39:33 -0500 | [diff] [blame] | 27 | void print_adjacent_from_adl(void); |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 28 | int get_adjacent_status(struct name_prefix *nbr); |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 29 | int get_timed_out_number(struct name_prefix *nbr); |
akmhoque | 14b3f34 | 2012-09-14 10:39:02 -0500 | [diff] [blame] | 30 | int get_lsdb_interest_timed_out_number(struct name_prefix *nbr); |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 31 | void update_adjacent_timed_out_to_adl(struct name_prefix *nbr, int increment); |
| 32 | void update_adjacent_timed_out_zero_to_adl(struct name_prefix *nbr); |
akmhoque | 14b3f34 | 2012-09-14 10:39:02 -0500 | [diff] [blame] | 33 | void update_lsdb_interest_timed_out_to_adl(struct name_prefix *nbr, int increment); |
| 34 | void update_lsdb_interest_timed_out_zero_to_adl(struct name_prefix *nbr); |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame] | 35 | void update_adjacent_status_to_adl(struct name_prefix *nbr, int status); |
| 36 | void update_lsdb_synch_interval_to_adl(struct name_prefix *nbr, long int interval); |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 37 | int no_active_nbr(void); |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame] | 38 | int is_adj_lsa_build(void); |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 39 | void get_active_nbr_adj_data(struct ccn_charbuf *c); |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame] | 40 | long int get_nbr_time_diff_lsdb_req(char *nbr); |
| 41 | long int get_nbr_last_lsdb_requested(char *nbr); |
| 42 | long int get_nbr_last_lsdb_requested(char *nbr); |
| 43 | long int get_lsdb_synch_interval(char *nbr); |
akmhoque | 14b3f34 | 2012-09-14 10:39:02 -0500 | [diff] [blame] | 44 | int get_nbr_random_time_component(char *nbr); |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 45 | char * get_nbr_lsdb_version(char *nbr); |
| 46 | void update_adjacent_last_lsdb_requested_to_adl(char *nbr, long int timestamp); |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 47 | void set_is_lsdb_send_interest_scheduled_to_zero(char *nbr); |
akmhoque | 03004e6 | 2012-09-06 01:12:28 -0500 | [diff] [blame] | 48 | void update_adjacent_lsdb_version_to_adl(struct name_prefix *nbr, char *version); |
akmhoque | 53f6422 | 2012-09-05 13:57:51 -0500 | [diff] [blame] | 49 | void adjust_adjacent_last_lsdb_requested_to_adl(char *nbr, long int sec); |
akmhoque | fbfd098 | 2012-09-09 20:59:03 -0500 | [diff] [blame] | 50 | int get_next_hop_face_from_adl(char *nbr); |
akmhoque | de61ba9 | 2012-09-20 22:19:12 -0500 | [diff] [blame] | 51 | int is_neighbor(char *nbr); |
akmhoque | b77b95f | 2013-02-08 12:28:47 -0600 | [diff] [blame] | 52 | int is_active_neighbor(char *nbr); |
| 53 | void update_face_to_adl_for_nbr(char *nbr, int face); |
akmhoque | ccb33e9 | 2013-02-20 11:44:28 -0600 | [diff] [blame] | 54 | |
| 55 | void get_host_name_from_command_string(struct name_prefix *name_part,char *nbr_name_uri, int offset); |
akmhoque | e6f98a1 | 2013-02-22 10:33:26 -0600 | [diff] [blame] | 56 | void destroy_nbr_component(struct ndn_neighbor *nbr); |
| 57 | void destroy_adl(void); |
akmhoque | 8a5babe | 2012-08-16 17:39:33 -0500 | [diff] [blame] | 58 | #endif |