Revision 3b3b0910 proto/babel/babel.h

View differences:

proto/babel/babel.h
2 2
 *	BIRD -- The Babel protocol
3 3
 *
4 4
 *	Copyright (c) 2015--2016 Toke Hoiland-Jorgensen
5
 * 	(c) 2016--2017 Ondrej Zajicek <santiago@crfreenet.org>
6
 *	(c) 2016--2017 CZ.NIC z.s.p.o.
5 7
 *
6 8
 *	Can be freely distributed and used under the terms of the GNU GPL.
7 9
 *
......
37 39
#define BABEL_HELLO_LIMIT		12
38 40
#define BABEL_UPDATE_INTERVAL_FACTOR	4
39 41
#define BABEL_IHU_INTERVAL_FACTOR	3
42
#define BABEL_HOLD_TIME_FACTOR		4	/* How long we keep unreachable route relative to update interval */
40 43
#define BABEL_IHU_EXPIRY_FACTOR(X)	((btime)(X)*7/2)	/* 3.5 */
41 44
#define BABEL_HELLO_EXPIRY_FACTOR(X)	((btime)(X)*3/2)	/* 1.5 */
42 45
#define BABEL_ROUTE_EXPIRY_FACTOR(X)	((btime)(X)*7/2)	/* 3.5 */
43
#define BABEL_ROUTE_REFRESH_INTERVAL	(2 S_)	/* Time before route expiry to send route request */
44
#define BABEL_HOLD_TIME			(10 S_)	/* Expiry time for our own routes */
46
#define BABEL_ROUTE_REFRESH_FACTOR(X)	((btime)(X)*5/2)	/* 2.5 */
45 47
#define BABEL_SEQNO_REQUEST_RETRY	4
46 48
#define BABEL_SEQNO_REQUEST_EXPIRY	(2 S_)
47 49
#define BABEL_GARBAGE_INTERVAL		(300 S_)
......
105 107

  
106 108
struct babel_config {
107 109
  struct proto_config c;
108

  
109
  list iface_list;              /* Patterns configured -- keep it first; see babel_reconfigure why */
110
  list iface_list;			/* List of iface configs (struct babel_iface_config) */
111
  uint hold_time;			/* Time to hold stale entries and unreachable routes */
110 112
};
111 113

  
112 114
struct babel_iface_config {
......
220 222
  struct babel_entry    *e;
221 223
  struct babel_neighbor *neigh;
222 224

  
225
  u8 feasible;
223 226
  u16 seqno;
224
  u16 advert_metric;
225 227
  u16 metric;
226
  u16 old_metric;
228
  u16 advert_metric;
227 229
  u64 router_id;
228 230
  ip_addr next_hop;
229 231
  btime refresh_time;
230 232
  btime expires;
231
  btime expiry_interval;
232 233
};
233 234

  
234 235
struct babel_seqno_request {
......
242 243
};
243 244

  
244 245
struct babel_entry {
245
  struct babel_route *selected_in;
246
  struct babel_route *selected_out;
246
  struct babel_route *selected;
247 247

  
248
  btime updated;
249

  
250
  list requests;
251
  list sources;				/* Source entries for this prefix (struct babel_source). */
252 248
  list routes;				/* Routes for this prefix (struct babel_route) */
249
  list sources;				/* Source entries for this prefix (struct babel_source). */
250
  list requests;
251

  
252
  u8 valid;				/* Entry validity state (BABEL_ENTRY_*) */
253
  u8 unreachable;			/* Unreachable route is announced */
254
  u16 seqno;				/* Outgoing seqno */
255
  u16 metric;				/* Outgoing metric */
256
  u64 router_id;			/* Outgoing router ID */
257
  btime updated;			/* Last change of outgoing rte, for triggered updates */
253 258

  
254 259
  struct fib_node n;
255 260
};
256 261

  
257
/* Stores forwarded seqno requests for duplicate suppression. */
262
#define BABEL_ENTRY_DUMMY	0	/* No outgoing route */
263
#define BABEL_ENTRY_VALID	1	/* Valid outgoing route */
264
#define BABEL_ENTRY_STALE	2	/* Stale outgoing route, waiting for GC */
258 265

  
259 266

  
260 267
/*
......
346 353
void babel_show_interfaces(struct proto *P, char *iff);
347 354
void babel_show_neighbors(struct proto *P, char *iff);
348 355
void babel_show_entries(struct proto *P);
356
void babel_show_routes(struct proto *P);
349 357

  
350 358
/* packets.c */
351 359
void babel_enqueue(union babel_msg *msg, struct babel_iface *ifa);

Also available in: Unified diff