From 14375237f6901a926d59cc54870cf44ed2a61d20 Mon Sep 17 00:00:00 2001 From: Jan Maria Matejka Date: Wed, 14 Feb 2018 13:42:53 +0100 Subject: Terminology cleanup: The import_control hook is now called preexport. Once upon a time, far far away, there were the old Bird developers discussing what direction of route flow shall be called import and export. They decided to say "import to protocol" and "export to table" when speaking about a protocol. When speaking about a table, they spoke about "importing to table" and "exporting to protocol". The latter terminology was adopted in configuration, then also the bird CLI in commit ea2ae6dd0 started to use it (in year 2009). Now it's 2018 and the terminology is the latter. Import is from protocol to table, export is from table to protocol. Anyway, there was still an import_control hook which executed right before route export. One thing is funny. There are two commits in April 1999 with just two minutes between them. The older announces the final settlement on config terminology, the newer uses the other definition. Let's see their commit messages as the git-log tool shows them (the newer first): commit 9e0e485e50ea74c4f1c5cb65bdfe6ce819c2cee2 Author: Martin Mares Date: Mon Apr 5 20:17:59 1999 +0000 Added some new protocol hooks (look at the comments for better explanation): make_tmp_attrs Convert inline attributes to ea_list store_tmp_attrs Convert ea_list to inline attributes import_control Pre-import decisions commit 5056c559c4eb253a4eee10cf35b694faec5265eb Author: Martin Mares Date: Mon Apr 5 20:15:31 1999 +0000 Changed syntax of attaching filters to protocols to hopefully the final version: EXPORT for outbound routes (i.e., those announced by BIRD to the rest of the world). IMPORT for inbound routes (i.e., those imported by BIRD from the rest of the world). where is one of: ALL pass all routes NONE drop all routes FILTER use named filter FILTER { } use explicitly defined filter For all protocols, the default is IMPORT ALL, EXPORT NONE. This includes the kernel protocol, so that you need to add EXPORT ALL to get the previous configuration of kernel syncer (as usually, see doc/bird.conf.example for a bird.conf example :)). Let's say RIP to this almost 19-years-old inconsistency. For now, if you import a route, it is always from protocol to table. If you export a route, it is always from table to protocol. And they lived happily ever after. --- proto/pipe/pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'proto/pipe') diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c index 82ccf38a..efb992ca 100644 --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@ -98,7 +98,7 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o } static int -pipe_import_control(struct proto *P, rte **ee, struct linpool *p UNUSED) +pipe_preexport(struct proto *P, rte **ee, struct linpool *p UNUSED) { struct proto *pp = (*ee)->sender->proto; @@ -179,7 +179,7 @@ pipe_init(struct proto_config *CF) struct pipe_config *cf = (void *) CF; P->rt_notify = pipe_rt_notify; - P->import_control = pipe_import_control; + P->preexport = pipe_preexport; P->reload_routes = pipe_reload_routes; pipe_configure_channels(p, cf); -- cgit v1.2.3