0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-08 12:18:42 +00:00

Nest: Use 'distance' instead of 'preference'

This commit is contained in:
Ondrej Zajicek (work) 2018-11-13 14:31:54 +01:00
parent bf58ebc0bb
commit 8777f29783
3 changed files with 9 additions and 3 deletions

View File

@ -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;

View File

@ -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; }
;

View File

@ -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));