]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
String constants could be used for string option values.
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 29 May 2014 21:05:03 +0000 (23:05 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 29 May 2014 21:05:03 +0000 (23:05 +0200)
Thanks to Frederik Kriewitz for the patch.

conf/confbase.Y
nest/config.Y
proto/bfd/config.Y
proto/bgp/config.Y
sysdep/unix/config.Y

index 8b9f206a9efab2050664701e6a304ebe21bb02e7..cba6fc562b7343fee458095ae29d4a70e048832b 100644 (file)
@@ -77,6 +77,7 @@ CF_DECLS
 %type <time> datetime
 %type <a> ipa
 %type <px> prefix prefix_or_ipa
+%type <t> text
 %type <t> text_or_none
 
 %nonassoc PREFIX_DUMMY
@@ -191,6 +192,14 @@ datetime:
    }
  ;
 
+text:
+   TEXT
+ | SYM {
+     if ($1->class != (SYM_CONSTANT | T_STRING)) cf_error("String expected");
+     $$ = SYM_VAL($1).s;
+   }
+ ;
+
 text_or_none:
    TEXT { $$ = $1; }
  |      { $$ = NULL; }
index 85c06e74907281363e695965e0b71e9161c8e22e..eef7422cd71cb6871b521f43ae0dc573abcec5c7 100644 (file)
@@ -208,7 +208,7 @@ proto_item:
  | IMPORT KEEP FILTERED bool { this_proto->in_keep_filtered = $4; }
  | TABLE rtable { this_proto->table = $2; }
  | ROUTER ID idval { this_proto->router_id = $3; }
- | DESCRIPTION TEXT { this_proto->dsc = $2; }
+ | DESCRIPTION text { this_proto->dsc = $2; }
  ;
 
 imexport:
@@ -388,7 +388,7 @@ password_item:
 ;
 
 password_item_begin:
-   PASSWORD TEXT {
+   PASSWORD text {
      if (!this_p_list) {
        this_p_list = cfg_alloc(sizeof(list));
        init_list(this_p_list);
index 948079df1d34ce7b4e1190d7868de3330bd7e201..1b07495e809002a7b012c9794554d1ca43718b88 100644 (file)
@@ -99,7 +99,7 @@ bfd_multihop: bfd_iface_start bfd_iface_opt_list
 bfd_neigh_iface:
    /* empty */ { $$ = NULL; }
  | '%' SYM { $$ = if_get_by_name($2->name); }
- | DEV TEXT { $$ = if_get_by_name($2); }
+ | DEV text { $$ = if_get_by_name($2); }
  ;
 
 bfd_neigh_local:
index 6b885032a37199c6deb33a3173f7e85bfaaf8000..4d085d420b2bfa028053a564a777f7c947e42665 100644 (file)
@@ -103,7 +103,7 @@ bgp_proto:
  | bgp_proto ENABLE AS4 bool ';' { BGP_CFG->enable_as4 = $4; }
  | bgp_proto CAPABILITIES bool ';' { BGP_CFG->capabilities = $3; }
  | bgp_proto ADVERTISE IPV4 bool ';' { BGP_CFG->advertise_ipv4 = $4; }
- | bgp_proto PASSWORD TEXT ';' { BGP_CFG->password = $3; }
+ | bgp_proto PASSWORD text ';' { BGP_CFG->password = $3; }
  | bgp_proto ROUTE LIMIT expr ';' {
      this_proto->in_limit = cfg_allocz(sizeof(struct proto_limit));
      this_proto->in_limit->limit = $4;
index 1bba9a0d483113fb3aab1b184e36843bc5beab53..7fd0ad2db0de907d5ac245b5e82d583fbad25e88 100644 (file)
@@ -35,12 +35,12 @@ log_config: LOG log_file log_mask ';' {
  ;
 
 syslog_name:
-   NAME TEXT { $$ = $2; }
+   NAME text { $$ = $2; }
  | { $$ = bird_name; }
  ;
 
 log_file:
-   TEXT {
+   text {
      FILE *f = tracked_fopen(new_config->pool, $1, "a");
      if (!f) cf_error("Unable to open log file `%s': %m", $1);
      $$ = f;
@@ -76,7 +76,7 @@ CF_ADDTO(conf, mrtdump_base)
 
 mrtdump_base:
    MRTDUMP PROTOCOLS mrtdump_mask ';' { new_config->proto_default_mrtdump = $3; }
- | MRTDUMP TEXT ';' {
+ | MRTDUMP text ';' {
      FILE *f = tracked_fopen(new_config->pool, $2, "a");
      if (!f) cf_error("Unable to open MRTDump file '%s': %m", $2);
      new_config->mrtdump_file = fileno(f);