diff options
author | Florian Westphal <fw@strlen.de> | 2021-03-11 14:23:07 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2021-03-16 23:59:42 +0100 |
commit | 7ae67aafa8a86b9a66bf9cb102ea551e33d243cf (patch) | |
tree | 35163e5cd42d213ef1e787f326c3a2bd17ab5619 /src/scanner.l | |
parent | 8e006bb06f1bf07fb042b8d52ae6ae5bb54f38ae (diff) |
scanner: arp: move to own scope
allows to move the arp specific tokens out of the INITIAL scope.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/scanner.l')
-rw-r--r-- | src/scanner.l | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/scanner.l b/src/scanner.l index b1b03b95..509b1b0d 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -196,6 +196,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) %option nodefault %option warn %option stack +%s SCANSTATE_ARP %s SCANSTATE_CT %s SCANSTATE_ETH %s SCANSTATE_IP @@ -405,12 +406,14 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) "cfi" { return CFI; } "pcp" { return PCP; } -"arp" { return ARP; } -"htype" { return HTYPE; } -"ptype" { return PTYPE; } -"hlen" { return HLEN; } -"plen" { return PLEN; } -"operation" { return OPERATION; } +"arp" { scanner_push_start_cond(yyscanner, SCANSTATE_ARP); return ARP; } +<SCANSTATE_ARP>{ + "htype" { return HTYPE; } + "ptype" { return PTYPE; } + "hlen" { return HLEN; } + "plen" { return PLEN; } + "operation" { return OPERATION; } +} "ip" { scanner_push_start_cond(yyscanner, SCANSTATE_IP); return IP; } "version" { return HDRVERSION; } |