summaryrefslogtreecommitdiff
path: root/proto/babel
diff options
context:
space:
mode:
Diffstat (limited to 'proto/babel')
-rw-r--r--proto/babel/babel.c19
-rw-r--r--proto/babel/babel.h4
-rw-r--r--proto/babel/config.Y2
3 files changed, 13 insertions, 12 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 20953044..b4404f45 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -1833,7 +1833,7 @@ babel_dump(struct proto *P)
}
static void
-babel_get_route_info(rte *rte, byte *buf, ea_list *attrs UNUSED)
+babel_get_route_info(rte *rte, byte *buf)
{
buf += bsprintf(buf, " (%d/%d) [%lR]", rte->pref, rte->u.babel.metric, rte->u.babel.router_id);
}
@@ -2091,12 +2091,13 @@ babel_prepare_attrs(struct linpool *pool, ea_list *next, uint metric, u64 router
static int
-babel_import_control(struct proto *P, struct rte **new, struct ea_list **attrs UNUSED, struct linpool *pool UNUSED)
+babel_import_control(struct proto *P, struct rte **new, struct linpool *pool)
{
- rte *e = *new;
+ struct babel_proto *p = (void *) P;
+ struct rta *a = (*new)->attrs;
/* Reject our own unreachable routes */
- if ((e->attrs->dest == RTD_UNREACHABLE) && (e->attrs->src->proto == P))
+ if ((a->dest == RTD_UNREACHABLE) && (a->src->proto == P))
return -1;
return 0;
@@ -2109,9 +2110,9 @@ babel_make_tmp_attrs(struct rte *rt, struct linpool *pool)
}
static void
-babel_store_tmp_attrs(struct rte *rt, struct ea_list *attrs)
+babel_store_tmp_attrs(struct rte *rt)
{
- rt->u.babel.metric = ea_get_int(attrs, EA_BABEL_METRIC, 0);
+ rt->u.babel.metric = ea_get_int(rt->attrs->eattrs, EA_BABEL_METRIC, 0);
}
/*
@@ -2120,7 +2121,7 @@ babel_store_tmp_attrs(struct rte *rt, struct ea_list *attrs)
*/
static void
babel_rt_notify(struct proto *P, struct channel *c UNUSED, struct network *net,
- struct rte *new, struct rte *old UNUSED, struct ea_list *attrs UNUSED)
+ struct rte *new, struct rte *old UNUSED)
{
struct babel_proto *p = (void *) P;
struct babel_entry *e;
@@ -2130,7 +2131,7 @@ babel_rt_notify(struct proto *P, struct channel *c UNUSED, struct network *net,
/* Update */
uint internal = (new->attrs->src->proto == P);
uint rt_seqno = internal ? new->u.babel.seqno : p->update_seqno;
- uint rt_metric = ea_get_int(attrs, EA_BABEL_METRIC, 0);
+ uint rt_metric = ea_get_int(new->attrs->eattrs, EA_BABEL_METRIC, 0);
u64 rt_router_id = internal ? new->u.babel.router_id : p->router_id;
if (rt_metric > BABEL_INFINITY)
@@ -2316,7 +2317,7 @@ babel_reconfigure(struct proto *P, struct proto_config *CF)
struct protocol proto_babel = {
.name = "Babel",
.template = "babel%d",
- .attr_class = EAP_BABEL,
+ .class = PROTOCOL_BABEL,
.preference = DEF_PREF_BABEL,
.channel_mask = NB_IP | NB_IP6_SADR,
.proto_size = sizeof(struct babel_proto),
diff --git a/proto/babel/babel.h b/proto/babel/babel.h
index e5c9cd5b..14765c60 100644
--- a/proto/babel/babel.h
+++ b/proto/babel/babel.h
@@ -25,8 +25,8 @@
#include "lib/string.h"
#include "lib/timer.h"
-#define EA_BABEL_METRIC EA_CODE(EAP_BABEL, 0)
-#define EA_BABEL_ROUTER_ID EA_CODE(EAP_BABEL, 1)
+#define EA_BABEL_METRIC EA_CODE(PROTOCOL_BABEL, 0)
+#define EA_BABEL_ROUTER_ID EA_CODE(PROTOCOL_BABEL, 1)
#define BABEL_MAGIC 42
#define BABEL_VERSION 2
diff --git a/proto/babel/config.Y b/proto/babel/config.Y
index 205b4e4f..2b20c43f 100644
--- a/proto/babel/config.Y
+++ b/proto/babel/config.Y
@@ -125,7 +125,7 @@ babel_iface_opt_list:
babel_iface:
babel_iface_start iface_patt_list_nopx babel_iface_opt_list babel_iface_finish;
-CF_ADDTO(dynamic_attr, BABEL_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_BABEL_METRIC); })
+CF_ADDTO(dynamic_attr, BABEL_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_BABEL_METRIC); })
CF_CLI_HELP(SHOW BABEL, ..., [[Show information about Babel protocol]]);