-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlink-cache.h
52 lines (42 loc) · 1.24 KB
/
link-cache.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
/* Copyright (C) Uppsala University
*
* This file is distributed under the terms of the GNU general Public
* License (GPL), see the file LICENSE
*
* Author: Erik Nordström, <[email protected]>
*/
#ifndef _LINK_CACHE_H
#define _LINK_CACHE_H
#include "tbl.h"
#include "timer.h"
//#define LC_TIMER
#ifndef NO_GLOBALS
struct lc_graph {
struct tbl nodes;
struct tbl links;
struct lc_node *src;
#ifdef __KERNEL__
struct timer_list timer;
rwlock_t lock;
#endif
};
#define dsr_rtc_find(s,d) lc_srt_find(s,d)
#define dsr_rtc_add(srt,t,f) lc_srt_add(srt,t,f)
#endif /* NO_GLOBALS */
#ifndef NO_DECLS
int lc_link_del(struct in_addr src, struct in_addr dst);
int __lc_link_add(struct in_addr src, struct in_addr dst,
unsigned long timeout, int status, int cost);
int lc_link_add(struct in_addr src, struct in_addr dst,
unsigned long timeout, int status, int cost);
void lc_garbage_collect_set(void);
void lc_garbage_collect(unsigned long data);
struct dsr_srt *lc_srt_find(struct in_addr src, struct in_addr dst);
int lc_srt_add(struct dsr_srt *srt, unsigned long timeout,
unsigned short flags);
void lc_flush(void);
void __dijkstra(struct in_addr src);
int lc_init(void);
void lc_cleanup(void);
#endif /* NO_DECLS */
#endif /* _LINK_CACHE */