akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 1 | #ifndef _NLSR_LSDB_H_ |
| 2 | #define _NLSR_LSDB_H_ |
| 3 | |
akmhoque | f71d908 | 2012-08-22 12:51:53 -0400 | [diff] [blame] | 4 | |
| 5 | #define LS_TYPE_ADJ 1 |
| 6 | #define LS_TYPE_NAME 2 |
| 7 | |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 8 | struct link |
| 9 | { |
akmhoque | f71d908 | 2012-08-22 12:51:53 -0400 | [diff] [blame] | 10 | struct ccn_charbuf *nbr; |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 11 | int face; |
| 12 | int metric; |
| 13 | }; |
| 14 | |
akmhoque | f71d908 | 2012-08-22 12:51:53 -0400 | [diff] [blame] | 15 | |
| 16 | struct alsa_header |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 17 | { |
akmhoque | f71d908 | 2012-08-22 12:51:53 -0400 | [diff] [blame] | 18 | unsigned int ls_type; |
| 19 | long int orig_time; |
| 20 | struct ccn_charbuf *orig_router; |
| 21 | }; |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 22 | |
akmhoque | f71d908 | 2012-08-22 12:51:53 -0400 | [diff] [blame] | 23 | struct alsa |
| 24 | { |
| 25 | struct alsa_header *header; |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 26 | int no_link; |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 27 | struct link *links; |
| 28 | }; |
| 29 | |
akmhoque | f71d908 | 2012-08-22 12:51:53 -0400 | [diff] [blame] | 30 | struct nlsa_header |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 31 | { |
akmhoque | f71d908 | 2012-08-22 12:51:53 -0400 | [diff] [blame] | 32 | unsigned int ls_type; |
| 33 | long int orig_time; |
| 34 | long int ls_id; |
| 35 | struct ccn_charbuf *orig_router; |
akmhoque | 8c1cdbf | 2012-08-26 21:09:11 -0500 | [diff] [blame^] | 36 | unsigned int isValid; |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 37 | |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 38 | }; |
| 39 | |
akmhoque | f71d908 | 2012-08-22 12:51:53 -0400 | [diff] [blame] | 40 | struct nlsa |
| 41 | { |
| 42 | struct nlsa_header *header; |
| 43 | struct ccn_charbuf *name_prefix; |
| 44 | }; |
| 45 | |
| 46 | |
| 47 | int initial_build_name_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags); |
| 48 | struct nlsa * build_name_lsa(struct ccn_charbuf *name_prefix); |
| 49 | void install_name_lsa(struct nlsa *new_name_lsa); |
| 50 | void make_name_lsa_key(struct ccn_charbuf *key, struct ccn_charbuf *orig_router, unsigned int ls_type, long int nlsa_id, long int orig_time); |
| 51 | void print_name_lsdb(void); |
| 52 | void print_name_lsa(struct nlsa *name_lsa); |
| 53 | |
akmhoque | 902d57e | 2012-08-17 09:24:38 -0500 | [diff] [blame] | 54 | #endif |