]> git.proxmox.com Git - mirror_frr.git/blame - babeld/resend.h
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / babeld / resend.h
CommitLineData
ca10883e
DS
1/*
2Copyright (c) 2007, 2008 by Juliusz Chroboczek
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20THE 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
31struct 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
44extern struct timeval resend_time;
45
46struct resend *find_request(const unsigned char *prefix, unsigned char plen,
47 struct resend **previous_return);
48void flush_resends(struct neighbour *neigh);
49int 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);
52int unsatisfied_request(const unsigned char *prefix, unsigned char plen,
53 unsigned short seqno, const unsigned char *id);
54int request_redundant(struct interface *ifp,
55 const unsigned char *prefix, unsigned char plen,
56 unsigned short seqno, const unsigned char *id);
57int satisfy_request(const unsigned char *prefix, unsigned char plen,
58 unsigned short seqno, const unsigned char *id,
59 struct interface *ifp);
60
61void expire_resend(void);
62void recompute_resend_time(void);
63void do_resend(void);
64
65#endif /* BABEL_RESEND_H */