summaryrefslogtreecommitdiff
path: root/proto/ospf
diff options
context:
space:
mode:
authorJan Maria Matejka <mq@ucw.cz>2018-02-14 13:42:53 +0100
committerJan Maria Matejka <mq@ucw.cz>2018-12-04 10:53:01 +0100
commit14375237f6901a926d59cc54870cf44ed2a61d20 (patch)
treee704518cc25caf08985cd169e1e29208da9ac222 /proto/ospf
parente2ae08694e45b2a127c9d741e41dee4b14c2964d (diff)
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 <mj@ucw.cz> 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 <mj@ucw.cz> Date: Mon Apr 5 20:15:31 1999 +0000 Changed syntax of attaching filters to protocols to hopefully the final version: EXPORT <filter-spec> for outbound routes (i.e., those announced by BIRD to the rest of the world). IMPORT <filter-spec> for inbound routes (i.e., those imported by BIRD from the rest of the world). where <filter-spec> is one of: ALL pass all routes NONE drop all routes FILTER <name> use named filter 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.
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/ospf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 4faad360..dbae585d 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -101,7 +101,7 @@
#include <stdlib.h>
#include "ospf.h"
-static int ospf_import_control(struct proto *P, rte **new, struct linpool *pool);
+static int ospf_preexport(struct proto *P, rte **new, struct linpool *pool);
static struct ea_list *ospf_make_tmp_attrs(struct rte *rt, struct linpool *pool);
static void ospf_store_tmp_attrs(struct rte *rt);
static void ospf_reload_routes(struct channel *C);
@@ -315,7 +315,7 @@ ospf_init(struct proto_config *CF)
P->rt_notify = ospf_rt_notify;
P->if_notify = ospf_if_notify;
P->ifa_notify = cf->ospf2 ? ospf_ifa_notify2 : ospf_ifa_notify3;
- P->import_control = ospf_import_control;
+ P->preexport = ospf_preexport;
P->reload_routes = ospf_reload_routes;
P->make_tmp_attrs = ospf_make_tmp_attrs;
P->store_tmp_attrs = ospf_store_tmp_attrs;
@@ -434,7 +434,7 @@ ospf_disp(timer * timer)
/**
- * ospf_import_control - accept or reject new route from nest's routing table
+ * ospf_preexport - accept or reject new route from nest's routing table
* @P: OSPF protocol instance
* @new: the new route
* @attrs: list of attributes
@@ -444,7 +444,7 @@ ospf_disp(timer * timer)
* import to the filters.
*/
static int
-ospf_import_control(struct proto *P, rte **new, struct linpool *pool UNUSED)
+ospf_preexport(struct proto *P, rte **new, struct linpool *pool UNUSED)
{
struct ospf_proto *p = (struct ospf_proto *) P;
struct ospf_area *oa = ospf_main_area(p);