diff options
author | Jan Hák <jan.hak@nic.cz> | 2019-07-29 15:53:18 +0200 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2019-09-08 17:10:04 +0200 |
commit | 63d9d0933e7b577e1b8c4ab27b2a5ecb676eb8e9 (patch) | |
tree | 89653dbc440f4167c3221607d22aac998db6eaaf /src/libknot/yparser | |
parent | suppress gcc 'uninitialized' warning (diff) | |
download | knot-63d9d0933e7b577e1b8c4ab27b2a5ecb676eb8e9.tar.xz knot-63d9d0933e7b577e1b8c4ab27b2a5ecb676eb8e9.zip |
geoip: added wildcard as possible configuration
Diffstat (limited to 'src/libknot/yparser')
-rw-r--r-- | src/libknot/yparser/ypbody.c | 186 | ||||
-rw-r--r-- | src/libknot/yparser/ypbody.rl | 2 |
2 files changed, 97 insertions, 91 deletions
diff --git a/src/libknot/yparser/ypbody.c b/src/libknot/yparser/ypbody.c index 0ecf116f6..9256b1c3c 100644 --- a/src/libknot/yparser/ypbody.c +++ b/src/libknot/yparser/ypbody.c @@ -1,3 +1,4 @@ + /* Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz> This program is free software: you can redistribute it and/or modify @@ -41,133 +42,138 @@ static const char _yparser_actions[] = { }; static const unsigned char _yparser_key_offsets[] = { - 0, 0, 13, 15, 16, 25, 36, 38, - 39, 49, 60, 71, 73, 76, 89, 93, - 96, 100, 102, 105, 115, 124, 127, 130, - 133, 137, 140, 143, 146, 157, 170, 183, - 196 + 0, 0, 14, 16, 17, 28, 30, 33, + 34, 45, 46, 56, 57, 68, 70, 71, + 81, 92, 96, 98, 101, 105, 108, 111, + 124, 134, 143, 146, 149, 152, 156, 159, + 162, 176, 190, 204 }; static const char _yparser_trans_keys[] = { - 10, 13, 32, 35, 45, 46, 92, 48, - 57, 65, 90, 97, 122, 10, 13, 32, - 32, 46, 92, 48, 57, 65, 90, 97, - 122, 32, 58, 92, 45, 46, 48, 57, + 10, 13, 32, 35, 42, 45, 46, 92, + 48, 57, 65, 90, 97, 122, 10, 13, + 46, 32, 58, 92, 45, 46, 48, 57, + 65, 90, 97, 122, 32, 58, 10, 13, + 32, 46, 32, 58, 92, 45, 46, 48, + 57, 65, 90, 97, 122, 32, 32, 42, + 46, 92, 48, 57, 65, 90, 97, 122, + 46, 32, 58, 92, 45, 46, 48, 57, 65, 90, 97, 122, 32, 58, 32, 32, 33, 34, 92, 36, 43, 45, 90, 94, 126, 10, 13, 32, 33, 92, 36, 43, - 45, 90, 94, 126, 32, 58, 92, 45, - 46, 48, 57, 65, 90, 97, 122, 32, - 58, 10, 13, 32, 10, 13, 32, 34, - 35, 91, 92, 33, 43, 45, 90, 94, - 126, 34, 92, 32, 126, 10, 13, 32, - 10, 13, 32, 35, 10, 13, 34, 32, - 126, 32, 33, 34, 92, 36, 43, 45, - 90, 94, 126, 32, 33, 44, 92, 93, - 36, 90, 94, 126, 32, 44, 93, 10, - 13, 32, 34, 32, 126, 34, 92, 32, - 126, 32, 44, 93, 34, 32, 126, 34, - 32, 126, 32, 58, 92, 45, 46, 48, - 57, 65, 90, 97, 122, 10, 13, 32, - 35, 45, 46, 92, 48, 57, 65, 90, - 97, 122, 10, 13, 32, 35, 45, 46, - 92, 48, 57, 65, 90, 97, 122, 10, - 13, 32, 35, 45, 46, 92, 48, 57, + 45, 90, 94, 126, 10, 13, 32, 35, + 10, 13, 34, 32, 126, 34, 92, 32, + 126, 10, 13, 32, 34, 32, 126, 10, + 13, 32, 34, 35, 91, 92, 33, 43, + 45, 90, 94, 126, 32, 33, 34, 92, + 36, 43, 45, 90, 94, 126, 32, 33, + 44, 92, 93, 36, 90, 94, 126, 32, + 44, 93, 10, 13, 32, 34, 32, 126, + 34, 92, 32, 126, 32, 44, 93, 34, + 32, 126, 10, 13, 32, 35, 42, 45, + 46, 92, 48, 57, 65, 90, 97, 122, + 10, 13, 32, 35, 42, 45, 46, 92, + 48, 57, 65, 90, 97, 122, 10, 13, + 32, 35, 42, 45, 46, 92, 48, 57, 65, 90, 97, 122, 10, 13, 32, 35, - 45, 46, 92, 48, 57, 65, 90, 97, - 122, 0 + 42, 45, 46, 92, 48, 57, 65, 90, + 97, 122, 0 }; static const char _yparser_single_lengths[] = { - 0, 7, 2, 1, 3, 3, 2, 1, - 4, 5, 3, 2, 3, 7, 2, 3, - 4, 2, 1, 4, 5, 3, 3, 1, - 2, 3, 1, 1, 3, 7, 7, 7, - 7 + 0, 8, 2, 1, 3, 2, 3, 1, + 3, 1, 4, 1, 3, 2, 1, 4, + 5, 4, 2, 1, 2, 3, 1, 7, + 4, 5, 3, 3, 1, 2, 3, 1, + 8, 8, 8, 8 }; static const char _yparser_range_lengths[] = { - 0, 3, 0, 0, 3, 4, 0, 0, - 3, 3, 4, 0, 0, 3, 1, 0, - 0, 0, 1, 3, 2, 0, 0, 1, - 1, 0, 1, 1, 4, 3, 3, 3, - 3 + 0, 3, 0, 0, 4, 0, 0, 0, + 4, 0, 3, 0, 4, 0, 0, 3, + 3, 0, 0, 1, 1, 0, 1, 3, + 3, 2, 0, 0, 1, 1, 0, 1, + 3, 3, 3, 3 }; static const unsigned char _yparser_index_offsets[] = { - 0, 0, 11, 14, 16, 23, 31, 34, - 36, 44, 53, 61, 64, 68, 79, 83, - 87, 92, 95, 98, 106, 114, 118, 122, - 125, 129, 133, 136, 139, 147, 158, 169, - 180 + 0, 0, 12, 15, 17, 25, 28, 32, + 34, 42, 44, 52, 54, 62, 65, 67, + 75, 84, 89, 92, 95, 99, 103, 106, + 117, 125, 133, 137, 141, 144, 148, 152, + 155, 167, 179, 191 }; static const char _yparser_indicies[] = { - 1, 2, 3, 4, 5, 6, 6, 6, - 6, 6, 0, 1, 2, 4, 7, 0, - 7, 8, 8, 8, 8, 8, 0, 9, - 11, 10, 10, 10, 10, 10, 0, 12, - 13, 0, 14, 0, 14, 15, 16, 17, - 15, 15, 15, 0, 18, 19, 20, 21, - 22, 21, 21, 21, 0, 23, 25, 24, - 24, 24, 24, 24, 0, 26, 27, 0, - 28, 29, 30, 0, 28, 29, 30, 16, - 31, 32, 17, 15, 15, 15, 0, 34, - 35, 33, 0, 18, 19, 20, 0, 28, - 29, 36, 31, 0, 28, 29, 31, 37, - 33, 0, 32, 38, 39, 40, 38, 38, - 38, 0, 41, 42, 43, 44, 45, 42, - 42, 0, 46, 32, 47, 0, 28, 29, - 36, 0, 48, 42, 0, 50, 51, 49, - 0, 41, 43, 45, 0, 52, 49, 0, - 53, 21, 0, 54, 56, 55, 55, 55, - 55, 55, 0, 1, 2, 3, 4, 5, - 57, 57, 57, 57, 57, 0, 59, 60, - 61, 62, 63, 64, 64, 64, 64, 64, - 58, 65, 66, 67, 68, 69, 70, 70, - 70, 70, 70, 0, 71, 72, 73, 74, - 75, 76, 76, 76, 76, 76, 58, 0 + 1, 2, 3, 4, 5, 6, 7, 7, + 7, 7, 7, 0, 1, 2, 4, 8, + 0, 9, 10, 8, 8, 8, 8, 8, + 0, 11, 12, 0, 13, 14, 15, 0, + 16, 0, 17, 18, 16, 16, 16, 16, + 16, 0, 19, 0, 19, 20, 21, 21, + 21, 21, 21, 0, 22, 0, 23, 24, + 22, 22, 22, 22, 22, 0, 25, 26, + 0, 27, 0, 27, 28, 29, 30, 28, + 28, 28, 0, 31, 32, 33, 34, 35, + 34, 34, 34, 0, 13, 14, 36, 37, + 0, 13, 14, 37, 38, 34, 0, 40, + 41, 39, 0, 31, 32, 33, 0, 42, + 39, 0, 13, 14, 15, 29, 37, 43, + 30, 28, 28, 28, 0, 43, 44, 45, + 46, 44, 44, 44, 0, 47, 48, 49, + 50, 51, 48, 48, 0, 52, 43, 53, + 0, 13, 14, 36, 0, 54, 48, 0, + 56, 57, 55, 0, 47, 49, 51, 0, + 58, 55, 0, 1, 2, 3, 4, 59, + 6, 60, 60, 60, 60, 60, 0, 62, + 63, 64, 65, 66, 67, 68, 68, 68, + 68, 68, 61, 69, 70, 71, 72, 73, + 74, 75, 75, 75, 75, 75, 0, 76, + 77, 78, 79, 80, 81, 82, 82, 82, + 82, 82, 61, 0 }; static const char _yparser_trans_targs[] = { - 0, 30, 31, 1, 2, 3, 28, 4, - 5, 6, 5, 7, 6, 7, 8, 9, - 14, 27, 32, 29, 16, 9, 27, 11, - 10, 12, 11, 12, 32, 29, 13, 17, - 19, 14, 15, 18, 16, 14, 20, 24, - 23, 21, 20, 19, 23, 22, 21, 22, - 20, 24, 25, 26, 24, 9, 11, 28, - 12, 10, 0, 30, 31, 1, 2, 3, - 10, 30, 31, 1, 2, 3, 10, 30, - 31, 1, 2, 3, 10 + 0, 33, 34, 1, 2, 3, 9, 4, + 4, 5, 6, 5, 6, 35, 32, 23, + 8, 5, 6, 10, 11, 12, 12, 13, + 14, 13, 14, 15, 16, 20, 19, 35, + 32, 17, 16, 19, 17, 18, 16, 20, + 21, 22, 20, 24, 25, 29, 28, 26, + 25, 24, 28, 27, 26, 27, 25, 29, + 30, 31, 29, 7, 8, 0, 33, 34, + 1, 2, 7, 9, 8, 33, 34, 1, + 2, 7, 9, 8, 33, 34, 1, 2, + 7, 9, 8 }; static const char _yparser_trans_actions[] = { - 23, 1, 0, 49, 0, 52, 46, 21, - 46, 19, 13, 19, 0, 0, 0, 37, - 7, 37, 43, 11, 11, 9, 9, 15, - 13, 15, 0, 0, 1, 0, 0, 0, - 0, 9, 0, 9, 0, 40, 37, 7, - 37, 11, 9, 11, 9, 11, 0, 0, - 40, 9, 0, 9, 40, 40, 17, 13, - 17, 46, 31, 55, 28, 88, 28, 93, - 83, 34, 5, 75, 5, 79, 71, 25, - 3, 63, 3, 67, 59 + 23, 1, 0, 49, 0, 46, 52, 46, + 13, 17, 17, 0, 0, 1, 0, 0, + 13, 15, 15, 21, 46, 46, 13, 19, + 19, 0, 0, 0, 37, 7, 37, 43, + 11, 11, 9, 9, 0, 0, 40, 9, + 0, 9, 40, 0, 37, 7, 37, 11, + 9, 11, 9, 11, 0, 0, 40, 9, + 0, 9, 40, 46, 46, 31, 55, 28, + 88, 28, 83, 93, 83, 34, 5, 75, + 5, 71, 79, 71, 25, 3, 63, 3, + 59, 67, 59 }; static const char _yparser_eof_actions[] = { 0, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 0, 28, 5, - 3 + 23, 23, 23, 23, 23, 23, 23, 23, + 0, 28, 5, 3 }; -int _yp_start_state = 29; +int _yp_start_state = 32; int _yp_parse( yp_parser_t *parser) diff --git a/src/libknot/yparser/ypbody.rl b/src/libknot/yparser/ypbody.rl index 3af2b7248..074e1e3c3 100644 --- a/src/libknot/yparser/ypbody.rl +++ b/src/libknot/yparser/ypbody.rl @@ -141,7 +141,7 @@ } parser->indent = 0; } - key_name = ((alnum | [\\.]) . (alnum | [\\.\-])*) >_key_init $_key; + key_name = ((alnum | [\\.] | "*." ) . (alnum | [\\.\-])*) >_key_init $_key; key0 = key_name %_key0_exit; key1 = sep $_indent . key_name %_key1_exit; id = ((sep $_id)? . '-' >_dash_init . sep) $_indent . key_name %_id_exit; |