Commit f81702b7 authored by Maria Matejka's avatar Maria Matejka
Browse files

Table import and export are now explicit hooks.

Channels have now included rt_import_req and rt_export_req to hook into
the table instead of just one list node. This will (in future) allow for:

* channel import and export bound to different tables
* more efficient pipe code (dropping most of the channel code)
* conversion of 'show route' to a special kind of export
* temporary static routes from CLI

The import / export states are also updated to the new algorithms.
parent 3a8197a9
Loading
Loading
Loading
Loading
+21 −13
Original line number Diff line number Diff line
@@ -425,6 +425,23 @@ filter_commit(struct config *new, struct config *old)
    }
}

void channel_filter_dump(const struct filter *f)
{
  if (f == FILTER_ACCEPT)
    debug(" ALL");
  else if (f == FILTER_REJECT)
    debug(" NONE");
  else if (f == FILTER_UNDEF)
    debug(" UNDEF");
  else if (f->sym) {
    ASSERT(f->sym->filter == f);
    debug(" named filter %s", f->sym->name);
  } else {
    debug("\n");
    f_dump_line(f->root, 2);
  }
}

void filters_dump_all(void)
{
  struct symbol *sym;
@@ -444,19 +461,10 @@ void filters_dump_all(void)
	  struct channel *c;
	  WALK_LIST(c, sym->proto->proto->channels) {
	    debug(" Channel %s (%s) IMPORT", c->name, net_label[c->net_type]);
	    if (c->in_filter == FILTER_ACCEPT)
	      debug(" ALL\n");
	    else if (c->in_filter == FILTER_REJECT)
	      debug(" NONE\n");
	    else if (c->in_filter == FILTER_UNDEF)
	      debug(" UNDEF\n");
	    else if (c->in_filter->sym) {
	      ASSERT(c->in_filter->sym->filter == c->in_filter);
	      debug(" named filter %s\n", c->in_filter->sym->name);
	    } else {
	    channel_filter_dump(c->in_filter);
	    debug(" EXPORT", c->name, net_label[c->net_type]);
	    channel_filter_dump(c->out_filter);
	    debug("\n");
	      f_dump_line(c->in_filter->root, 2);
	    }
	  }
	}
    }
+3 −1
Original line number Diff line number Diff line
@@ -820,8 +820,10 @@ CF_CLI(DUMP NEIGHBORS,,, [[Dump neighbor cache]])
{ neigh_dump_all(); cli_msg(0, ""); } ;
CF_CLI(DUMP ATTRIBUTES,,, [[Dump attribute cache]])
{ rta_dump_all(); cli_msg(0, ""); } ;
CF_CLI(DUMP ROUTES,,, [[Dump routing table]])
CF_CLI(DUMP ROUTES,,, [[Dump routes]])
{ rt_dump_all(); cli_msg(0, ""); } ;
CF_CLI(DUMP TABLES,,, [[Dump table connections]])
{ rt_dump_hooks_all(); cli_msg(0, ""); } ;
CF_CLI(DUMP PROTOCOLS,,, [[Dump protocol information]])
{ protos_dump_all(); cli_msg(0, ""); } ;
CF_CLI(DUMP FILTER ALL,,, [[Dump all filters in linearized form]])
+319 −202

File changed.

Preview size limit exceeded, changes collapsed.

+36 −47

File changed.

Preview size limit exceeded, changes collapsed.

+133 −12

File changed.

Preview size limit exceeded, changes collapsed.

Loading