blob: 23a670ecc2f9cdc14fa3fd1184c59104f93d50e4 [file] [log] [blame]
akmhoque902d57e2012-08-17 09:24:38 -05001#ifndef _NLSR_LSDB_H_
2#define _NLSR_LSDB_H_
3
akmhoquef71d9082012-08-22 12:51:53 -04004
5#define LS_TYPE_ADJ 1
6#define LS_TYPE_NAME 2
7
akmhoque902d57e2012-08-17 09:24:38 -05008struct link
9{
akmhoquef71d9082012-08-22 12:51:53 -040010 struct ccn_charbuf *nbr;
akmhoque902d57e2012-08-17 09:24:38 -050011 int face;
12 int metric;
13};
14
akmhoquef71d9082012-08-22 12:51:53 -040015
16struct alsa_header
akmhoque902d57e2012-08-17 09:24:38 -050017{
akmhoquef71d9082012-08-22 12:51:53 -040018 unsigned int ls_type;
19 long int orig_time;
20 struct ccn_charbuf *orig_router;
21};
akmhoque902d57e2012-08-17 09:24:38 -050022
akmhoquef71d9082012-08-22 12:51:53 -040023struct alsa
24{
25 struct alsa_header *header;
akmhoque902d57e2012-08-17 09:24:38 -050026 int no_link;
akmhoque902d57e2012-08-17 09:24:38 -050027 struct link *links;
28};
29
akmhoquef71d9082012-08-22 12:51:53 -040030struct nlsa_header
akmhoque902d57e2012-08-17 09:24:38 -050031{
akmhoquef71d9082012-08-22 12:51:53 -040032 unsigned int ls_type;
33 long int orig_time;
34 long int ls_id;
35 struct ccn_charbuf *orig_router;
akmhoque8c1cdbf2012-08-26 21:09:11 -050036 unsigned int isValid;
akmhoque902d57e2012-08-17 09:24:38 -050037
akmhoque902d57e2012-08-17 09:24:38 -050038};
39
akmhoquef71d9082012-08-22 12:51:53 -040040struct nlsa
41{
42 struct nlsa_header *header;
43 struct ccn_charbuf *name_prefix;
44};
45
46
47int initial_build_name_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
48struct nlsa * build_name_lsa(struct ccn_charbuf *name_prefix);
49void install_name_lsa(struct nlsa *new_name_lsa);
50void 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);
51void print_name_lsdb(void);
52void print_name_lsa(struct nlsa *name_lsa);
53
akmhoqued79438d2012-08-27 13:31:42 -050054
55int install_adj_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
56
akmhoque902d57e2012-08-17 09:24:38 -050057#endif