summaryrefslogtreecommitdiff
path: root/trafgen_parser.y
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-12-18 11:52:44 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-12-21 16:47:32 +0100
commitd7ef402f03369f1c1c1bd302edad449e0f7bf37d (patch)
tree932af45467839e3e516aca5e4e4a62cd3f44acb6 /trafgen_parser.y
parent1edfb2409d159f46af385ef36b2017a4102cf67f (diff)
trafgen: parser: Rename field_expr -> field_value_expr rule
Rename field_expr rule to field_value_expr to indicate the rule relates to field value part in case if there will be added field_expr rule to describe field expression syntax. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_parser.y')
-rw-r--r--trafgen_parser.y30
1 files changed, 15 insertions, 15 deletions
diff --git a/trafgen_parser.y b/trafgen_parser.y
index 1e20cff..7e22a1d 100644
--- a/trafgen_parser.y
+++ b/trafgen_parser.y
@@ -718,7 +718,7 @@ proto
| tcp_proto { }
;
-field_expr
+field_value_expr
: number { field_expr.type = FIELD_EXPR_NUMB;
field_expr.val.number = $1; }
| mac { field_expr.type = FIELD_EXPR_MAC;
@@ -783,7 +783,7 @@ eth_field
| eth_type { proto_field_set(ETH_TYPE); }
eth_expr
- : eth_field skip_white '=' skip_white field_expr
+ : eth_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
;
@@ -807,7 +807,7 @@ pause_field
;
pause_expr
- : pause_field skip_white '=' skip_white field_expr
+ : pause_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
;
@@ -843,7 +843,7 @@ pfc_field
;
pfc_expr
- : pfc_field skip_white '=' skip_white field_expr
+ : pfc_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
;
@@ -875,7 +875,7 @@ vlan_field
;
vlan_expr
- : vlan_field skip_white '=' skip_white field_expr
+ : vlan_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
| K_1Q
{ proto_field_set_be16(hdr, VLAN_TPID, ETH_P_8021Q); }
@@ -910,7 +910,7 @@ mpls_field
;
mpls_expr
- : mpls_field skip_white '=' skip_white field_expr
+ : mpls_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
arp_proto
@@ -939,9 +939,9 @@ arp_field
;
arp_expr
- : arp_field skip_white '=' skip_white field_expr
+ : arp_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
- | K_OPER skip_white '=' skip_white field_expr
+ | K_OPER skip_white '=' skip_white field_value_expr
{ proto_field_set(ARP_OPER);
proto_field_expr_eval(); }
| K_OPER skip_white '=' skip_white K_REQUEST
@@ -985,7 +985,7 @@ ip4_field
;
ip4_expr
- : ip4_field skip_white '=' skip_white field_expr
+ : ip4_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
| K_DF { proto_field_set_be16(hdr, IP4_DF, 1); }
| K_MF { proto_field_set_be16(hdr, IP4_MF, 1); }
@@ -1022,7 +1022,7 @@ ip6_field
;
ip6_expr
- : ip6_field skip_white '=' skip_white field_expr
+ : ip6_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
;
@@ -1050,7 +1050,7 @@ icmp4_field
;
icmp4_expr
- : icmp4_field skip_white '=' skip_white field_expr
+ : icmp4_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
| K_ECHO_REQUEST
{ proto_field_set_u8(hdr, ICMPV4_TYPE, ICMP_ECHO);
@@ -1079,9 +1079,9 @@ icmp6_field
;
icmp6_expr
- : icmp6_field skip_white '=' skip_white field_expr
+ : icmp6_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
- | K_TYPE skip_white '=' skip_white field_expr
+ | K_TYPE skip_white '=' skip_white field_value_expr
{ proto_field_set(ICMPV6_TYPE);
proto_field_expr_eval(); }
| K_TYPE skip_white '=' K_ECHO_REQUEST
@@ -1115,7 +1115,7 @@ udp_field
;
udp_expr
- : udp_field skip_white '=' skip_white field_expr
+ : udp_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
;
@@ -1145,7 +1145,7 @@ tcp_field
;
tcp_expr
- : tcp_field skip_white '=' skip_white field_expr
+ : tcp_field skip_white '=' skip_white field_value_expr
{ proto_field_expr_eval(); }
| K_CWR { proto_field_set_be16(hdr, TCP_CWR, 1); }
| K_ECE { proto_field_set_be16(hdr, TCP_ECE, 1); }