summaryrefslogtreecommitdiff
path: root/trafgen_lexer.l
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-01-29 16:18:55 +0100
committerTobias Klauser <tklauser@distanz.ch>2016-01-29 16:29:04 +0100
commit0042946ef9e332e32af00a0fe0c6c7b6eec4b0e1 (patch)
tree22152705c6fd6138b613714760e7592551ce5b61 /trafgen_lexer.l
parentf711e3c80a35e0762c719c0ef35fddfa35d92bbd (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_lexer.l')
-rw-r--r--trafgen_lexer.l6
1 files changed, 3 insertions, 3 deletions
diff --git a/trafgen_lexer.l b/trafgen_lexer.l
index a661922..5ab0815 100644
--- a/trafgen_lexer.l
+++ b/trafgen_lexer.l
@@ -79,7 +79,7 @@ number_ascii ([a-zA-Z])
mac_hex ([a-fA-F0-9]+)
mac ({mac_hex}:{mac_hex}:{mac_hex}:{mac_hex}:{mac_hex}:{mac_hex})
-ip_addr ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)
+ip4_addr ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)
%%
@@ -200,9 +200,9 @@ ip_addr ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)
panic("Failed to parse MAC address %s\n", yytext);
return mac; }
-{ip_addr} { if (inet_pton(AF_INET, yytext, &yylval.ip_addr) != 1)
+{ip4_addr} { if (inet_pton(AF_INET, yytext, &yylval.ip4_addr) != 1)
panic("Failed to parse IPv4 address %s\n", yytext);
- return ip_addr; };
+ return ip4_addr; };
"'\\x"[a-fA-F0-9]{2}"'" { yylval.number = strtol(yytext + 3, NULL, 16);
return number; }