diff options
Diffstat (limited to 'proto/rip')
-rw-r--r-- | proto/rip/config.Y | 4 | ||||
-rw-r--r-- | proto/rip/rip.c | 17 | ||||
-rw-r--r-- | proto/rip/rip.h | 4 |
3 files changed, 12 insertions, 13 deletions
diff --git a/proto/rip/config.Y b/proto/rip/config.Y index aff63f03..c46cf00c 100644 --- a/proto/rip/config.Y +++ b/proto/rip/config.Y @@ -186,8 +186,8 @@ rip_iface: rip_iface_start iface_patt_list_nopx rip_iface_opt_list rip_iface_finish; -CF_ADDTO(dynamic_attr, RIP_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_METRIC); }) -CF_ADDTO(dynamic_attr, RIP_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_TAG); }) +CF_ADDTO(dynamic_attr, RIP_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_RIP_METRIC); }) +CF_ADDTO(dynamic_attr, RIP_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_RIP_TAG); }) CF_CLI_HELP(SHOW RIP, ..., [[Show information about RIP protocol]]); diff --git a/proto/rip/rip.c b/proto/rip/rip.c index baf98737..90bf8e5c 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -298,7 +298,7 @@ rip_withdraw_rte(struct rip_proto *p, net_addr *n, struct rip_neighbor *from) */ static void rip_rt_notify(struct proto *P, struct channel *ch UNUSED, struct network *net, struct rte *new, - struct rte *old UNUSED, struct ea_list *attrs) + struct rte *old UNUSED) { struct rip_proto *p = (struct rip_proto *) P; struct rip_entry *en; @@ -307,8 +307,8 @@ rip_rt_notify(struct proto *P, struct channel *ch UNUSED, struct network *net, s if (new) { /* Update */ - u32 rt_metric = ea_get_int(attrs, EA_RIP_METRIC, 1); - u32 rt_tag = ea_get_int(attrs, EA_RIP_TAG, 0); + u32 rt_metric = ea_get_int(new->attrs->eattrs, EA_RIP_METRIC, 1); + u32 rt_tag = ea_get_int(new->attrs->eattrs, EA_RIP_TAG, 0); if (rt_metric > p->infinity) { @@ -1040,10 +1040,10 @@ rip_make_tmp_attrs(struct rte *rt, struct linpool *pool) } static void -rip_store_tmp_attrs(struct rte *rt, struct ea_list *attrs) +rip_store_tmp_attrs(struct rte *rt) { - rt->u.rip.metric = ea_get_int(attrs, EA_RIP_METRIC, 1); - rt->u.rip.tag = ea_get_int(attrs, EA_RIP_TAG, 0); + rt->u.rip.metric = ea_get_int(rt->attrs->eattrs, EA_RIP_METRIC, 1); + rt->u.rip.tag = ea_get_int(rt->attrs->eattrs, EA_RIP_TAG, 0); } static int @@ -1081,7 +1081,6 @@ rip_init(struct proto_config *CF) P->if_notify = rip_if_notify; P->rt_notify = rip_rt_notify; P->neigh_notify = rip_neigh_notify; - // P->import_control = rip_import_control; P->reload_routes = rip_reload_routes; P->make_tmp_attrs = rip_make_tmp_attrs; P->store_tmp_attrs = rip_store_tmp_attrs; @@ -1145,7 +1144,7 @@ rip_reconfigure(struct proto *P, struct proto_config *CF) } static void -rip_get_route_info(rte *rte, byte *buf, ea_list *attrs UNUSED) +rip_get_route_info(rte *rte, byte *buf) { buf += bsprintf(buf, " (%d/%d)", rte->pref, rte->u.rip.metric); @@ -1274,7 +1273,7 @@ rip_dump(struct proto *P) struct protocol proto_rip = { .name = "RIP", .template = "rip%d", - .attr_class = EAP_RIP, + .class = PROTOCOL_RIP, .preference = DEF_PREF_RIP, .channel_mask = NB_IP, .proto_size = sizeof(struct rip_proto), diff --git a/proto/rip/rip.h b/proto/rip/rip.h index 55696333..2dc34862 100644 --- a/proto/rip/rip.h +++ b/proto/rip/rip.h @@ -182,8 +182,8 @@ struct rip_rte #define RIP_ENTRY_VALID 1 /* Valid outgoing route */ #define RIP_ENTRY_STALE 2 /* Stale outgoing route, waiting for GC */ -#define EA_RIP_METRIC EA_CODE(EAP_RIP, 0) -#define EA_RIP_TAG EA_CODE(EAP_RIP, 1) +#define EA_RIP_METRIC EA_CODE(PROTOCOL_RIP, 0) +#define EA_RIP_TAG EA_CODE(PROTOCOL_RIP, 1) static inline int rip_is_v2(struct rip_proto *p) { return p->rip2; } |