diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2016-01-29 16:18:55 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-01-29 16:29:04 +0100 |
commit | 0042946ef9e332e32af00a0fe0c6c7b6eec4b0e1 (patch) | |
tree | 22152705c6fd6138b613714760e7592551ce5b61 /trafgen_parser.y | |
parent | f711e3c80a35e0762c719c0ef35fddfa35d92bbd (diff) |
trafgen: parser: Rename IPv4 specific types and union members
Rename lexer/parser type and union member ip_addr to ip4_addr. This
will make it easier to distinguish from IPv6 addresses, to be added an a
follow-up patch.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_parser.y')
-rw-r--r-- | trafgen_parser.y | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/trafgen_parser.y b/trafgen_parser.y index 71f88d8..e512aed 100644 --- a/trafgen_parser.y +++ b/trafgen_parser.y @@ -341,7 +341,7 @@ static void proto_add(enum proto_id pid) %} %union { - struct in_addr ip_addr; + struct in_addr ip4_addr; long long int number; uint8_t bytes[256]; char *str; @@ -362,12 +362,12 @@ static void proto_add(enum proto_id pid) %token ',' '{' '}' '(' ')' '[' ']' ':' '-' '+' '*' '/' '%' '&' '|' '<' '>' '^' -%token number string mac ip_addr +%token number string mac ip4_addr %type <number> number expression %type <str> string %type <bytes> mac -%type <ip_addr> ip_addr +%type <ip4_addr> ip4_addr %left '-' '+' '*' '/' '%' '&' '|' '<' '>' '^' @@ -636,9 +636,9 @@ arp_field { proto_field_set_bytes(hdr, ARP_SHA, $5); } | K_THA skip_white '=' skip_white mac { proto_field_set_bytes(hdr, ARP_THA, $5); } - | K_SPA skip_white '=' skip_white ip_addr + | K_SPA skip_white '=' skip_white ip4_addr { proto_field_set_u32(hdr, ARP_SPA, $5.s_addr); } - | K_TPA skip_white '=' skip_white ip_addr + | K_TPA skip_white '=' skip_white ip4_addr { proto_field_set_u32(hdr, ARP_TPA, $5.s_addr); } ; arp @@ -660,9 +660,9 @@ ip4_field { proto_field_set_u8(hdr, IP4_VER, $5); } | K_IHL skip_white '=' skip_white number { proto_field_set_u8(hdr, IP4_IHL, $5); } - | K_DADDR skip_white '=' skip_white ip_addr + | K_DADDR skip_white '=' skip_white ip4_addr { proto_field_set_u32(hdr, IP4_DADDR, $5.s_addr); } - | K_SADDR skip_white '=' skip_white ip_addr + | K_SADDR skip_white '=' skip_white ip4_addr { proto_field_set_u32(hdr, IP4_SADDR, $5.s_addr); } | K_PROT skip_white '=' skip_white number { proto_field_set_u8(hdr, IP4_PROTO, $5); } |