summaryrefslogtreecommitdiff
path: root/proto/ospf
diff options
context:
space:
mode:
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/config.Y8
-rw-r--r--proto/ospf/ospf.c20
-rw-r--r--proto/ospf/ospf.h8
-rw-r--r--proto/ospf/topology.c3
-rw-r--r--proto/ospf/topology.h2
5 files changed, 21 insertions, 20 deletions
diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y
index 0b09966d..c439a614 100644
--- a/proto/ospf/config.Y
+++ b/proto/ospf/config.Y
@@ -497,10 +497,10 @@ ospf_iface:
ospf_iface_start ospf_iface_patt_list ospf_iface_opt_list { ospf_iface_finish(); }
;
-CF_ADDTO(dynamic_attr, OSPF_METRIC1 { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_OSPF_METRIC1); })
-CF_ADDTO(dynamic_attr, OSPF_METRIC2 { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_OSPF_METRIC2); })
-CF_ADDTO(dynamic_attr, OSPF_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_OSPF_TAG); })
-CF_ADDTO(dynamic_attr, OSPF_ROUTER_ID { $$ = f_new_dynamic_attr(EAF_TYPE_ROUTER_ID | EAF_TEMP, T_QUAD, EA_OSPF_ROUTER_ID); })
+CF_ADDTO(dynamic_attr, OSPF_METRIC1 { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_OSPF_METRIC1); })
+CF_ADDTO(dynamic_attr, OSPF_METRIC2 { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_OSPF_METRIC2); })
+CF_ADDTO(dynamic_attr, OSPF_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_OSPF_TAG); })
+CF_ADDTO(dynamic_attr, OSPF_ROUTER_ID { $$ = f_new_dynamic_attr(EAF_TYPE_ROUTER_ID, T_QUAD, EA_OSPF_ROUTER_ID); })
CF_CLI_HELP(SHOW OSPF, ..., [[Show information about OSPF protocol]]);
CF_CLI(SHOW OSPF, optsym, [<name>], [[Show information about OSPF protocol]])
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 0a9efd19..fa122f01 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -101,9 +101,9 @@
#include <stdlib.h>
#include "ospf.h"
-static int ospf_import_control(struct proto *P, rte **new, ea_list **attrs, struct linpool *pool);
+static int ospf_import_control(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, struct ea_list *attrs);
+static void ospf_store_tmp_attrs(struct rte *rt);
static void ospf_reload_routes(struct channel *C);
static int ospf_rte_better(struct rte *new, struct rte *old);
static int ospf_rte_same(struct rte *new, struct rte *old);
@@ -446,7 +446,7 @@ ospf_disp(timer * timer)
* import to the filters.
*/
static int
-ospf_import_control(struct proto *P, rte **new, ea_list **attrs UNUSED, struct linpool *pool UNUSED)
+ospf_import_control(struct proto *P, rte **new, struct linpool *pool)
{
struct ospf_proto *p = (struct ospf_proto *) P;
struct ospf_area *oa = ospf_main_area(p);
@@ -471,12 +471,12 @@ ospf_make_tmp_attrs(struct rte *rt, struct linpool *pool)
}
static void
-ospf_store_tmp_attrs(struct rte *rt, struct ea_list *attrs)
+ospf_store_tmp_attrs(struct rte *rt)
{
- rt->u.ospf.metric1 = ea_get_int(attrs, EA_OSPF_METRIC1, LSINFINITY);
- rt->u.ospf.metric2 = ea_get_int(attrs, EA_OSPF_METRIC2, 10000);
- rt->u.ospf.tag = ea_get_int(attrs, EA_OSPF_TAG, 0);
- rt->u.ospf.router_id = ea_get_int(attrs, EA_OSPF_ROUTER_ID, 0);
+ rt->u.ospf.metric1 = ea_get_int(rt->attrs->eattrs, EA_OSPF_METRIC1, LSINFINITY);
+ rt->u.ospf.metric2 = ea_get_int(rt->attrs->eattrs, EA_OSPF_METRIC2, 10000);
+ rt->u.ospf.tag = ea_get_int(rt->attrs->eattrs, EA_OSPF_TAG, 0);
+ rt->u.ospf.router_id = ea_get_int(rt->attrs->eattrs, EA_OSPF_ROUTER_ID, 0);
}
/**
@@ -535,7 +535,7 @@ ospf_get_status(struct proto *P, byte * buf)
}
static void
-ospf_get_route_info(rte * rte, byte * buf, ea_list * attrs UNUSED)
+ospf_get_route_info(rte * rte, byte * buf)
{
char *type = "<bug>";
@@ -1463,7 +1463,7 @@ ospf_sh_lsadb(struct lsadb_show_data *ld)
struct protocol proto_ospf = {
.name = "OSPF",
.template = "ospf%d",
- .attr_class = EAP_OSPF,
+ .class = PROTOCOL_OSPF,
.preference = DEF_PREF_OSPF,
.channel_mask = NB_IP,
.proto_size = sizeof(struct ospf_proto),
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index f26ed99c..ff55621a 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -863,10 +863,10 @@ struct lsadb_show_data {
};
-#define EA_OSPF_METRIC1 EA_CODE(EAP_OSPF, 0)
-#define EA_OSPF_METRIC2 EA_CODE(EAP_OSPF, 1)
-#define EA_OSPF_TAG EA_CODE(EAP_OSPF, 2)
-#define EA_OSPF_ROUTER_ID EA_CODE(EAP_OSPF, 3)
+#define EA_OSPF_METRIC1 EA_CODE(PROTOCOL_OSPF, 0)
+#define EA_OSPF_METRIC2 EA_CODE(PROTOCOL_OSPF, 1)
+#define EA_OSPF_TAG EA_CODE(PROTOCOL_OSPF, 2)
+#define EA_OSPF_ROUTER_ID EA_CODE(PROTOCOL_OSPF, 3)
/* ospf.c */
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c
index e909bbe9..54b255c9 100644
--- a/proto/ospf/topology.c
+++ b/proto/ospf/topology.c
@@ -1243,11 +1243,12 @@ find_surrogate_fwaddr(struct ospf_proto *p, struct ospf_area *oa)
}
void
-ospf_rt_notify(struct proto *P, struct channel *ch UNUSED, net *n, rte *new, rte *old UNUSED, ea_list *ea)
+ospf_rt_notify(struct proto *P, struct channel *ch UNUSED, net *n, rte *new, rte *old UNUSED)
{
struct ospf_proto *p = (struct ospf_proto *) P;
struct ospf_area *oa = NULL; /* non-NULL for NSSA-LSA */
ort *nf;
+ struct ea_list *ea = new->attrs->eattrs;
/*
* There are several posibilities:
diff --git a/proto/ospf/topology.h b/proto/ospf/topology.h
index ac87334b..54ec9ccf 100644
--- a/proto/ospf/topology.h
+++ b/proto/ospf/topology.h
@@ -188,7 +188,7 @@ void ospf_originate_sum_net_lsa(struct ospf_proto *p, struct ospf_area *oa, ort
void ospf_originate_sum_rt_lsa(struct ospf_proto *p, struct ospf_area *oa, u32 drid, int metric, u32 options);
void ospf_originate_ext_lsa(struct ospf_proto *p, struct ospf_area *oa, ort *nf, u8 mode, u32 metric, u32 ebit, ip_addr fwaddr, u32 tag, int pbit);
-void ospf_rt_notify(struct proto *P, struct channel *ch, net *n, rte *new, rte *old, ea_list *attrs);
+void ospf_rt_notify(struct proto *P, struct channel *ch, net *n, rte *new, rte *old);
void ospf_update_topology(struct ospf_proto *p);
struct top_hash_entry *ospf_hash_find(struct top_graph *, u32 domain, u32 lsa, u32 rtr, u32 type);