]>
Commit | Line | Data |
---|---|---|
ca10883e DS |
1 | /* |
2 | Copyright (c) 2007, 2008 by Juliusz Chroboczek | |
3 | ||
4 | Permission is hereby granted, free of charge, to any person obtaining a copy | |
5 | of this software and associated documentation files (the "Software"), to deal | |
6 | in the Software without restriction, including without limitation the rights | |
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
8 | copies of the Software, and to permit persons to whom the Software is | |
9 | furnished to do so, subject to the following conditions: | |
10 | ||
11 | The above copyright notice and this permission notice shall be included in | |
12 | all copies or substantial portions of the Software. | |
13 | ||
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
20 | THE SOFTWARE. | |
21 | */ | |
22 | #ifndef BABEL_RESEND_H | |
23 | #define BABEL_RESEND_H | |
24 | ||
25 | #define REQUEST_TIMEOUT 65000 | |
26 | #define RESEND_MAX 3 | |
27 | ||
28 | #define RESEND_REQUEST 1 | |
29 | #define RESEND_UPDATE 2 | |
30 | ||
31 | struct resend { | |
32 | unsigned char kind; | |
33 | unsigned char max; | |
34 | unsigned short delay; | |
35 | struct timeval time; | |
36 | unsigned char prefix[16]; | |
37 | unsigned char plen; | |
38 | unsigned short seqno; | |
39 | unsigned char id[8]; | |
40 | struct interface *ifp; | |
41 | struct resend *next; | |
42 | }; | |
43 | ||
44 | extern struct timeval resend_time; | |
45 | ||
46 | struct resend *find_request(const unsigned char *prefix, unsigned char plen, | |
47 | struct resend **previous_return); | |
48 | void flush_resends(struct neighbour *neigh); | |
49 | int record_resend(int kind, const unsigned char *prefix, unsigned char plen, | |
50 | unsigned short seqno, const unsigned char *id, | |
51 | struct interface *ifp, int delay); | |
52 | int unsatisfied_request(const unsigned char *prefix, unsigned char plen, | |
53 | unsigned short seqno, const unsigned char *id); | |
54 | int request_redundant(struct interface *ifp, | |
55 | const unsigned char *prefix, unsigned char plen, | |
56 | unsigned short seqno, const unsigned char *id); | |
57 | int satisfy_request(const unsigned char *prefix, unsigned char plen, | |
58 | unsigned short seqno, const unsigned char *id, | |
59 | struct interface *ifp); | |
60 | ||
61 | void expire_resend(void); | |
62 | void recompute_resend_time(void); | |
63 | void do_resend(void); | |
64 | ||
65 | #endif /* BABEL_RESEND_H */ |