]> git.proxmox.com Git - mirror_frr.git/blame - babeld/neighbour.h
Merge pull request #13440 from zice312963205/bgpfix
[mirror_frr.git] / babeld / neighbour.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: MIT
ca10883e
DS
2/*
3Copyright (c) 2007, 2008 by Juliusz Chroboczek
ca10883e
DS
4*/
5
6#ifndef BABEL_NEIGHBOUR_H
7#define BABEL_NEIGHBOUR_H
8
9struct neighbour {
10 struct neighbour *next;
11 /* This is -1 when unknown, so don't make it unsigned */
12 int hello_seqno;
13 unsigned char address[16];
14 unsigned short reach;
15 unsigned short txcost;
16 struct timeval hello_time;
17 struct timeval ihu_time;
18 unsigned short hello_interval; /* in centiseconds */
19 unsigned short ihu_interval; /* in centiseconds */
20 /* Used for RTT estimation. */
21 /* Absolute time (modulo 2^32) at which the Hello was sent,
22 according to remote clock. */
23 unsigned int hello_send_us;
24 struct timeval hello_rtt_receive_time;
25 unsigned int rtt;
26 struct timeval rtt_time;
27 struct interface *ifp;
28};
29
30extern struct neighbour *neighs;
31
32#define FOR_ALL_NEIGHBOURS(_neigh) \
33 for(_neigh = neighs; _neigh; _neigh = _neigh->next)
34
35int neighbour_valid(struct neighbour *neigh);
36void flush_neighbour(struct neighbour *neigh);
37struct neighbour *find_neighbour(const unsigned char *address,
38 struct interface *ifp);
39int update_neighbour(struct neighbour *neigh, int hello, int hello_interval);
40unsigned check_neighbours(void);
41unsigned neighbour_txcost(struct neighbour *neigh);
42unsigned neighbour_rxcost(struct neighbour *neigh);
43unsigned neighbour_rttcost(struct neighbour *neigh);
44unsigned neighbour_cost(struct neighbour *neigh);
45int valid_rtt(struct neighbour *neigh);
46
47#endif /* BABEL_NEIGHBOUR_H */