net_fill_vpn6($$, net6_prefix(&$2), net6_pxlen(&$2), $1);
}
-net_roa4_: net_ip4_ MAX NUM AS NUM
+net_roa4_: net_ip4_ MAX expr AS expr
{
$$ = cfg_alloc(sizeof(net_addr_roa4));
net_fill_roa4($$, net4_prefix(&$1), net4_pxlen(&$1), $3, $5);
cf_error("Invalid max prefix length %u", $3);
};
-net_roa6_: net_ip6_ MAX NUM AS NUM
+net_roa6_: net_ip6_ MAX expr AS expr
{
$$ = cfg_alloc(sizeof(net_addr_roa6));
net_fill_roa6($$, net6_prefix(&$1), net6_pxlen(&$1), $3, $5);
cf_error("Invalid max prefix length %u", $3);
};
-net_mpls_: MPLS NUM
+net_mpls_: MPLS expr
{
$$ = cfg_alloc(sizeof(net_addr_mpls));
net_fill_mpls($$, $2);
}
-net_aspa_: ASPA NUM
+net_aspa_: ASPA expr
{
$$ = cfg_alloc(sizeof(net_addr_aspa));
net_fill_aspa($$, $2);
}
;
-label_stack_start: NUM
+label_stack_start: expr
{
$$ = cfg_allocz(sizeof(mpls_label_stack));
$$->len = 1;
label_stack:
label_stack_start
- | label_stack '/' NUM {
+ | label_stack '/' expr {
if ($1->len >= MPLS_MAX_LABEL_STACK)
cf_error("Too many labels in stack");
$1->stack[$1->len++] = $3;
flow_builder_set_type(this_flow, $1);
flow_builder6_add_pfx(this_flow, (net_addr_ip6 *) &($2), 0);
}
- | flow_srcdst net_ip6 OFFSET NUM {
+ | flow_srcdst net_ip6 OFFSET expr {
if ($4 > $2.pxlen)
cf_error("Prefix offset is higher than prefix length");
flow_builder_set_type(this_flow, $1);
conf: bt_test_same ;
bt_test_same:
- BT_TEST_SAME '(' symbol_known ',' symbol_known ',' NUM ')' {
+ BT_TEST_SAME '(' symbol_known ',' symbol_known ',' expr ')' {
cf_assert_symbol($3, SYM_FUNCTION);
cf_assert_symbol($5, SYM_FUNCTION);
struct f_bt_test_suite *t = cfg_allocz(sizeof(struct f_bt_test_suite));
;
timeformat_spec:
- TEXT { $$ = (struct timeformat){$1, NULL, 0}; }
- | TEXT expr TEXT { $$ = (struct timeformat){$1, $3, (s64) $2 S_}; }
+ text { $$ = (struct timeformat){$1, NULL, 0}; }
+ | text expr text { $$ = (struct timeformat){$1, $3, (s64) $2 S_}; }
| ISO SHORT { $$ = TM_ISO_SHORT_S; }
| ISO SHORT MS { $$ = TM_ISO_SHORT_MS; }
| ISO SHORT US { $$ = TM_ISO_SHORT_US; }
echo_size:
/* empty */ { $$ = 4096; }
- | NUM {
+ | expr {
if ($1 < 256 || $1 > 65536) cf_error("Invalid log buffer size");
$$ = $1;
}
net_copy(n, &($4));
BGP_CFG->remote_range = n;
}
- | bgp_proto INTERFACE TEXT ';' { BGP_CFG->iface = if_get_by_name($3); }
+ | bgp_proto INTERFACE text ';' { BGP_CFG->iface = if_get_by_name($3); }
| bgp_proto RR CLUSTER ID idval ';' { BGP_CFG->rr_cluster_id = $5; }
| bgp_proto RR CLIENT bool ';' { BGP_CFG->rr_client = $4; }
| bgp_proto RS CLIENT bool ';' { BGP_CFG->rs_client = $4; }
| lsadb_args GLOBAL { $$ = $1; $$->scope = LSA_SCOPE_AS; }
| lsadb_args AREA idval { $$ = $1; $$->scope = LSA_SCOPE_AREA; $$->area = $3; }
| lsadb_args LINK { $$ = $1; $$->scope = 1; /* hack, 0 is no filter */ }
- | lsadb_args TYPE NUM { $$ = $1; $$->type = $3; }
+ | lsadb_args TYPE expr { $$ = $1; $$->type = $3; }
| lsadb_args LSID idval { $$ = $1; $$->lsid = $3; }
| lsadb_args SELF { $$ = $1; $$->router = SH_ROUTER_SELF; }
| lsadb_args ROUTER idval { $$ = $1; $$->router = $3; }
perf_proto_item:
proto_channel { this_proto->net_type = $1->net_type; }
- | EXP FROM NUM { PERF_CFG->from = $3; }
- | EXP TO NUM { PERF_CFG->to = $3; }
- | REPEAT NUM { PERF_CFG->repeat = $2; }
+ | EXP FROM expr { PERF_CFG->from = $3; }
+ | EXP TO expr { PERF_CFG->to = $3; }
+ | REPEAT expr { PERF_CFG->repeat = $2; }
| THRESHOLD MIN expr_us { PERF_CFG->threshold_min = $3; }
| THRESHOLD MAX expr_us { PERF_CFG->threshold_max = $3; }
- | ATTRIBUTES NUM { PERF_CFG->attrs_per_rte = $2; }
+ | ATTRIBUTES expr { PERF_CFG->attrs_per_rte = $2; }
| KEEP bool { PERF_CFG->keep = $2; }
| MODE IMPORT { PERF_CFG->mode = PERF_MODE_IMPORT; }
| MODE EXPORT { PERF_CFG->mode = PERF_MODE_EXPORT; }
;
-radv_dnssl_node: TEXT
+radv_dnssl_node: text
{
struct radv_dnssl_config *cf = cfg_allocz(sizeof(struct radv_dnssl_config));
add_tail(&radv_dns_list, NODE cf);
this_snh->via = IPA_NONE;
this_snh->iface = if_get_by_name($2);
}
- | stat_nexthop DEV TEXT {
+ | stat_nexthop DEV text {
this_snh->iface = if_get_by_name($3);
}
| stat_nexthop MPLS label_stack {
}
;
-stat_aspa_provider: NUM {
+stat_aspa_provider: expr {
if (this_srt->aspa->length == this_srt_aspa_max * sizeof(u32))
{
adata *new = cfg_alloc(sizeof (adata) + (this_srt_aspa_max * 2) * sizeof (u32));
log_udp_port:
/* empty */ { this_log->port = 514; }
- | PORT NUM { check_u16($2); this_log->port = $2; }
+ | PORT expr { check_u16($2); this_log->port = $2; }
;
log_mask:
cfg_name:
/* empty */ { $$ = NULL; }
- | TEXT
+ | text
;
cfg_timeout: