forked from NDN-Routing/NLSR0.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nlsr.h
134 lines (97 loc) · 2.42 KB
/
nlsr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef _NLSR_H_
#define _NLSR_H_
#define LSDB_SYNCH_INTERVAL 300
#define INTEREST_RETRY 3
#define INTEREST_RESEND_TIME 15
#define NLSR_LOCKED 1
#define NLSR_UNLOCKED 0
#define LSA_REFRESH_TIME 1800
#define ROUTER_DEAD_INTERVAL 3600
#define MAX_FACES_PER_PREFIX 0
#define LINK_METRIC 10
#define NAME_LSA_VALID 1
#define NAME_LSA_INVALID 0
#define API_PORT 9999
struct name_prefix
{
char *name;
int length;
};
struct linkStateDatabase
{
struct hashtb *name_lsdb;
struct hashtb *adj_lsdb;
struct hashtb *cor_lsdb;
char *lsdb_version;
};
struct pending_interest
{
char *int_name;
int timed_out;
};
struct nlsr
{
struct ccn_closure in_interest;
struct ccn_closure in_content;
struct ccns_name_closure *closure;
struct ccns_slice *slice;
struct ccns_handle *ccns;
struct ccn_schedule *sched;
struct ccn_scheduled_event *event;
struct ccn_scheduled_event *event_send_info_interest;
struct ccn_scheduled_event *event_build_adj_lsa;
struct ccn_scheduled_event *event_calculate_route;
struct hashtb *adl;
struct hashtb *npl;
struct hashtb *map;
struct hashtb *rev_map;
struct hashtb *npt;
struct hashtb *routing_table;
struct linkStateDatabase *lsdb;
struct ccn *ccn;
char *router_name;
int is_synch_init;
long int nlsa_id;
int adj_build_flag;
long int adj_build_count;
int is_build_adj_lsa_sheduled;
int is_send_lsdb_interest_scheduled;
int is_route_calculation_scheduled;
int interest_retry;
long int interest_resend_time;
long int lsa_refresh_time;
long int router_dead_interval;
long int max_faces_per_prefix;
char *logDir;
int detailed_logging;
int debugging;
int semaphor;
int nlsr_api_server_sock_fd;
fd_set readfds;
int api_port;
char *topo_prefix;
char *slice_prefix;
char *root_key_prefix;
char *keystore_path;
char *keystore_passphrase;
char *site_name;
int is_hyperbolic_calc;
double cor_r;
double cor_theta;
int isStrictHierchicalKeyCheck;
int tunnel_type;
};
struct nlsr *nlsr;
void process_command_ccnneighbor(char *command);
void process_command_ccnname(char *command);
void process_command_lsdb_synch_interval(char *command);
void process_command_interest_retry(char *command);
void process_command_interest_resend_time(char *command);
void process_conf_command(char *command);
int readConfigFile(const char *filename);
void nlsr_lock(void);
void nlsr_unlock(void);
int init_nlsr(void);
void nlsr_destroy( void );
void nlsr_stop_signal_handler(int sig);
#endif