]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ddb(4): Add some support for lexing IPv6 addresses
authorcem <cem@FreeBSD.org>
Mon, 9 Sep 2019 16:32:23 +0000 (16:32 +0000)
committercem <cem@FreeBSD.org>
Mon, 9 Sep 2019 16:32:23 +0000 (16:32 +0000)
commit17adfbe017a470d8bc557350ba74f43d2963db42
tree655011aab91ad57c4b3b723351bb7cf505daab12
parent718e6295e7fa20c0aaee209a62e0df229269ad73
ddb(4): Add some support for lexing IPv6 addresses

Allow commands to specify that (hex) numbers may start with A-F, by adding
the DRT_HEX flag for db_read_token_flags().  As before, numbers containing
invalid digits for the current radix are rejected.

Also, lex ':' and '::' tokens as tCOLON and tCOLONCOLON respectively.

There is a mild conflict here with lexed "identifiers" (tIDENT): ddb
identifiers may contain arbitrary colons, and the ddb lexer is greedy.  So
the identifier lex will swallow any colons it finds inside identifiers, and
consumers are still unable to expect the token sequence 'tIDENT tCOLON'.
That limitation does not matter for IPv6 addresses, because the lexer always
attempts to lex numbers before identifiers.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D21509
sys/ddb/db_lex.c
sys/ddb/db_lex.h