Commit f4a60a9b authored by Ondrej Zajicek (work)'s avatar Ondrej Zajicek (work) Committed by Jan Moskyto Matejka
Browse files

Channels - explicit links between protocols and tables

The patch adds support for channels, structures connecting protocols and
tables and handling most interactions between them. The documentation is
missing yet.
parent 9f5782d9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -136,12 +136,14 @@ config_parse(struct config *c)
  protos_preconfig(c);
  rt_preconfig(c);
  cf_parse();
  protos_postconfig(c);

  if (EMPTY_LIST(c->protos))
    cf_error("No protocol is specified in the config file");
  /* XXXX */

  /*
  if (!c->router_id)
    cf_error("Router ID must be configured manually");
  */

  done = 1;

+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ struct config {

  int mrtdump_file;			/* Configured MRTDump file (sysdep, fd in unix) */
  char *syslog_name;			/* Name used for syslog (NULL -> no syslog) */
  struct rtable_config *master_rtc;	/* Configuration of master routing table */
  struct rtable_config *def_tables[NET_MAX]; /* Default routing tables for each network */
  struct iface_patt *router_id_from;	/* Configured list of router ID iface patterns */

  u32 router_id;			/* Our Router ID */
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ CF_DECLS
  struct symbol *s;
  char *t;
  struct rtable_config *r;
  struct channel_config *cc;
  struct f_inst *x;
  struct filter *f;
  struct f_tree *e;
@@ -61,6 +62,7 @@ CF_DECLS
  bird_clock_t time;
  struct f_prefix px;
  struct proto_spec ps;
  struct channel_limit cl;
  struct timeformat *tf;
}

+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#define ABS(a)   ((a)>=0 ? (a) : -(a))
#define DELTA(a,b) (((a)>=(b))?(a)-(b):(b)-(a))
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(*(a)))
#define CALL(fn, args...) ({ if (fn) fn(args); })

static inline int uint_cmp(uint i1, uint i2)
{ return (int)(i1 > i2) - (int)(i1 < i2); }
+4 −1
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ typedef struct list { /* In fact two overlayed nodes */
  for(nn=(list).head; NODE_VALID(nn) && (n=SKIP_BACK(typeof(*n),pos,nn)); nn=nn->next)
#define WALK_LIST_DELSAFE(n,nxt,list) \
  for(n=HEAD(list); nxt=NODE_NEXT(n); n=(void *) nxt)
#define WALK_LIST2_DELSAFE(n,nn,nxt,list,pos) \
  for(nn=HEAD(list); (nxt=nn->next) && (n=SKIP_BACK(typeof(*n),pos,nn)); nn=nxt)

/* WALK_LIST_FIRST supposes that called code removes each processed node */
#define WALK_LIST_FIRST(n,list) \
     while(n=HEAD(list), (NODE (n))->next)
Loading