]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Use 'distance' instead of 'preference'
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 13 Nov 2018 13:31:54 +0000 (14:31 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 13 Nov 2018 13:31:54 +0000 (14:31 +0100)
filter/config.Y
nest/config.Y
nest/proto.c

index f8170a834ea03c52bd0c553407319106d1731e98..a83510d72e1d52155a79f987b68a51cf877840d1 100644 (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;
index 5f89918ade0193123eb4840a75437ca0e8d1bdf0..76de67f97e3e5e4c3e4ad19a402ff6a9eb58da26 100644 (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; }
  ;
 
index 15d6f4de6d9d056b77c5bbe3ab49c0ed64da7c67..a895ef30455a8bee4dc60271091cc7aea133acbf 100644 (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));