blob: 884ae2240a6944da081a436cb30282e3260b3dc8 [file] [log] [blame]
akmhoque8a5babe2012-08-16 17:39:33 -05001#ifndef _NLSR_ADL_H_
2#define _NLSR_ADL_H_
3
akmhoque42098b12012-08-27 22:54:23 -05004#define NBR_DOWN 0
akmhoque03004e62012-09-06 01:12:28 -05005#define NBR_ACTIVE 1
akmhoque42098b12012-08-27 22:54:23 -05006
akmhoque03004e62012-09-06 01:12:28 -05007struct ndn_neighbor
8{
9 struct name_prefix *neighbor;
10 int face;
11 int status;
12 char * last_lsdb_version;
13 char * last_info_version;
akmhoqueb77b95f2013-02-08 12:28:47 -060014 char *ip_address;
akmhoque03004e62012-09-06 01:12:28 -050015 int info_interest_timed_out;
akmhoque14b3f342012-09-14 10:39:02 -050016 int lsdb_interest_timed_out;
17 int lsdb_random_time_component;
akmhoque03004e62012-09-06 01:12:28 -050018 long int lsdb_synch_interval;
19 long int last_lsdb_requested;
20 int is_lsdb_send_interest_scheduled;
21 int metric;
22};
23
akmhoqueb77b95f2013-02-08 12:28:47 -060024void add_nbr_to_adl(struct name_prefix *new_nbr,int face,char *ip);
akmhoque3171d652012-11-13 11:44:33 -060025void delete_nbr_from_adl(struct name_prefix *nbr);
akmhoque53f64222012-09-05 13:57:51 -050026void print_adjacent(struct ndn_neighbor *nbr);
akmhoque8a5babe2012-08-16 17:39:33 -050027void print_adjacent_from_adl(void);
akmhoque53f64222012-09-05 13:57:51 -050028int get_adjacent_status(struct name_prefix *nbr);
akmhoque53f64222012-09-05 13:57:51 -050029int get_timed_out_number(struct name_prefix *nbr);
akmhoque14b3f342012-09-14 10:39:02 -050030int get_lsdb_interest_timed_out_number(struct name_prefix *nbr);
akmhoque53f64222012-09-05 13:57:51 -050031void update_adjacent_timed_out_to_adl(struct name_prefix *nbr, int increment);
32void update_adjacent_timed_out_zero_to_adl(struct name_prefix *nbr);
akmhoque14b3f342012-09-14 10:39:02 -050033void update_lsdb_interest_timed_out_to_adl(struct name_prefix *nbr, int increment);
34void update_lsdb_interest_timed_out_zero_to_adl(struct name_prefix *nbr);
akmhoque03004e62012-09-06 01:12:28 -050035void update_adjacent_status_to_adl(struct name_prefix *nbr, int status);
36void update_lsdb_synch_interval_to_adl(struct name_prefix *nbr, long int interval);
akmhoque53f64222012-09-05 13:57:51 -050037int no_active_nbr(void);
akmhoque03004e62012-09-06 01:12:28 -050038int is_adj_lsa_build(void);
akmhoque53f64222012-09-05 13:57:51 -050039void get_active_nbr_adj_data(struct ccn_charbuf *c);
akmhoque03004e62012-09-06 01:12:28 -050040long int get_nbr_time_diff_lsdb_req(char *nbr);
41long int get_nbr_last_lsdb_requested(char *nbr);
42long int get_nbr_last_lsdb_requested(char *nbr);
43long int get_lsdb_synch_interval(char *nbr);
akmhoque14b3f342012-09-14 10:39:02 -050044int get_nbr_random_time_component(char *nbr);
akmhoque53f64222012-09-05 13:57:51 -050045char * get_nbr_lsdb_version(char *nbr);
46void update_adjacent_last_lsdb_requested_to_adl(char *nbr, long int timestamp);
akmhoque53f64222012-09-05 13:57:51 -050047void set_is_lsdb_send_interest_scheduled_to_zero(char *nbr);
akmhoque03004e62012-09-06 01:12:28 -050048void update_adjacent_lsdb_version_to_adl(struct name_prefix *nbr, char *version);
akmhoque53f64222012-09-05 13:57:51 -050049void adjust_adjacent_last_lsdb_requested_to_adl(char *nbr, long int sec);
akmhoquefbfd0982012-09-09 20:59:03 -050050int get_next_hop_face_from_adl(char *nbr);
akmhoquede61ba92012-09-20 22:19:12 -050051int is_neighbor(char *nbr);
akmhoqueb77b95f2013-02-08 12:28:47 -060052int is_active_neighbor(char *nbr);
53void update_face_to_adl_for_nbr(char *nbr, int face);
akmhoqueccb33e92013-02-20 11:44:28 -060054
55void get_host_name_from_command_string(struct name_prefix *name_part,char *nbr_name_uri, int offset);
akmhoque8a5babe2012-08-16 17:39:33 -050056#endif