diff --git a/filter/config.Y b/filter/config.Y index f8170a83..a83510d7 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -410,7 +410,7 @@ CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UNSET, RETURN, IF, THEN, ELSE, CASE, TRUE, FALSE, RT, RO, UNKNOWN, GENERIC, FROM, GW, NET, MASK, PROTO, SOURCE, SCOPE, DEST, IFNAME, IFINDEX, - PREFERENCE, + PREFERENCE, DISTANCE, ROA_CHECK, ASN, IS_V4, IS_V6, LEN, MAXLEN, @@ -886,6 +886,7 @@ term: | constructor { $$ = $1; } | PREFERENCE { $$ = f_new_inst(FI_PREF_GET); } + | DISTANCE { $$ = f_new_inst(FI_PREF_GET); } | rtadot static_attr { $$ = f_new_inst_sa(FI_RTA_GET, $2); } @@ -1031,6 +1032,10 @@ cmd: $$ = f_new_inst(FI_PREF_SET); $$->a1.p = $3; } + | DISTANCE '=' term ';' { + $$ = f_new_inst(FI_PREF_SET); + $$->a1.p = $3; + } | UNSET '(' rtadot dynamic_attr ')' ';' { $$ = f_new_inst_da(FI_EA_SET, $4); $$->aux = EAF_TYPE_UNDEF | EAF_TEMP; diff --git a/nest/config.Y b/nest/config.Y index 5f89918a..76de67f9 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -64,7 +64,7 @@ proto_postconfig(void) CF_DECLS -CF_KEYWORDS(ROUTER, ID, PROTOCOL, TEMPLATE, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT) +CF_KEYWORDS(ROUTER, ID, PROTOCOL, TEMPLATE, PREFERENCE, DISTANCE, DISABLED, DEBUG, ALL, OFF, DIRECT) CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, VRF, TABLE, STATES, ROUTES, FILTERS) CF_KEYWORDS(IPV4, IPV6, VPN4, VPN6, ROA4, ROA6, FLOW4, FLOW6, SADR, MPLS) CF_KEYWORDS(RECEIVE, LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE, KEEP, FILTERED) @@ -230,6 +230,7 @@ channel_item: | IMPORT LIMIT limit_spec { this_channel->in_limit = $3; } | EXPORT LIMIT limit_spec { this_channel->out_limit = $3; } | PREFERENCE expr { this_channel->preference = $2; check_u16($2); } + | DISTANCE expr { this_channel->preference = $2; check_u16($2); } | IMPORT KEEP FILTERED bool { this_channel->in_keep_filtered = $4; } ; diff --git a/nest/proto.c b/nest/proto.c index 15d6f4de..a895ef30 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -1658,7 +1658,7 @@ channel_show_info(struct channel *c) cli_msg(-1006, " Channel %s", c->name); cli_msg(-1006, " State: %s", c_states[c->channel_state]); cli_msg(-1006, " Table: %s", c->table->name); - cli_msg(-1006, " Preference: %d", c->preference); + cli_msg(-1006, " Distance: %d", c->preference); cli_msg(-1006, " Input filter: %s", filter_name(c->in_filter)); cli_msg(-1006, " Output filter: %s", filter_name(c->out_filter));