| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright (c) 2007-2008 Patrick McHardy <kaber@trash.net> | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * Development of this code funded by Astaro AG (http://www.astaro.com/) | ||
| 9 | */ | ||
| 10 | |||
| 11 | %{ | ||
| 12 | |||
| 13 | #include <nft.h> | ||
| 14 | |||
| 15 | #include <limits.h> | ||
| 16 | #include <glob.h> | ||
| 17 | #include <netinet/in.h> | ||
| 18 | #include <arpa/inet.h> | ||
| 19 | #include <linux/types.h> | ||
| 20 | #include <linux/netfilter.h> | ||
| 21 | #include <sys/stat.h> | ||
| 22 | |||
| 23 | #include <nftables.h> | ||
| 24 | #include <erec.h> | ||
| 25 | #include <rule.h> | ||
| 26 | #include <parser.h> | ||
| 27 | #include "parser_bison.h" | ||
| 28 | |||
| 29 | #define YY_NO_INPUT | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Work around flex behaviour when reaching the end of buffer: normally, flex | ||
| 33 | * regexes are greedy, when reaching the end of buffer however it tries to | ||
| 34 | * match whatever is left in the buffer and only backs up in case it doesn't | ||
| 35 | * match *any* pattern. Since we accept unquoted strings, this means any partial | ||
| 36 | * token will be recognized as string. | ||
| 37 | * | ||
| 38 | * Make sure to only pass input to flex linewise to avoid this. | ||
| 39 | */ | ||
| 40 | #define YY_INPUT(buf,result,max_size) \ | ||
| 41 | { \ | ||
| 42 | result = 0; \ | ||
| 43 | errno = 0; \ | ||
| 44 | \ | ||
| 45 | while (result < max_size) { \ | ||
| 46 | int chr = fgetc(yyin); \ | ||
| 47 | \ | ||
| 48 | if (chr != EOF) { \ | ||
| 49 | buf[result++] = chr; \ | ||
| 50 | if (chr == '\n' || chr == ' ') \ | ||
| 51 | break; \ | ||
| 52 | continue; \ | ||
| 53 | } \ | ||
| 54 | \ | ||
| 55 | if (ferror(yyin)) { \ | ||
| 56 | if (errno != EINTR) { \ | ||
| 57 | YY_FATAL_ERROR("input in flex scanner failed"); \ | ||
| 58 | break; \ | ||
| 59 | } \ | ||
| 60 | errno = 0; \ | ||
| 61 | clearerr(yyin); \ | ||
| 62 | } \ | ||
| 63 | break; \ | ||
| 64 | } \ | ||
| 65 | } | ||
| 66 | |||
| 67 | static void scanner_pop_buffer(yyscan_t scanner); | ||
| 68 | |||
| 69 | |||
| 70 | 49577 | static void init_pos(struct input_descriptor *indesc) | |
| 71 | { | ||
| 72 | 49577 | indesc->lineno = 1; | |
| 73 | 49577 | indesc->column = 1; | |
| 74 | 49577 | indesc->token_offset = 0; | |
| 75 | 49577 | indesc->line_offset = 0; | |
| 76 | 49577 | } | |
| 77 | |||
| 78 | 7208901 | static void update_pos(struct parser_state *state, struct location *loc, | |
| 79 | int len) | ||
| 80 | { | ||
| 81 | 7208901 | loc->indesc = state->indesc; | |
| 82 | 7208901 | loc->first_line = state->indesc->lineno; | |
| 83 | 7208901 | loc->first_column = state->indesc->column; | |
| 84 | 7208901 | loc->last_column = state->indesc->column + len - 1; | |
| 85 | 7208901 | state->indesc->column += len; | |
| 86 | 7208901 | } | |
| 87 | |||
| 88 | 7159325 | static void update_offset(struct parser_state *state, struct location *loc, | |
| 89 | unsigned int len) | ||
| 90 | { | ||
| 91 | uint32_t line_offset; | ||
| 92 | |||
| 93 | 7159325 | state->indesc->token_offset += len; | |
| 94 |
1/2✗ Branch 0 (2→3) not taken.
✓ Branch 1 (2→4) taken 7159325 times.
|
7159325 | if (state->indesc->line_offset > UINT32_MAX) |
| 95 | ✗ | line_offset = UINT32_MAX; | |
| 96 | else | ||
| 97 | 7159325 | line_offset = state->indesc->line_offset; | |
| 98 | |||
| 99 | 7159325 | loc->line_offset = line_offset; | |
| 100 | 7159325 | } | |
| 101 | |||
| 102 | 342891 | static void reset_pos(struct parser_state *state, struct location *loc) | |
| 103 | { | ||
| 104 | 342891 | state->indesc->line_offset = state->indesc->token_offset; | |
| 105 | 342891 | state->indesc->lineno += 1; | |
| 106 | 342891 | state->indesc->column = 1; | |
| 107 | 342891 | } | |
| 108 | |||
| 109 | static void scanner_push_start_cond(void *scanner, enum startcond_type type); | ||
| 110 | |||
| 111 | #define YY_USER_ACTION { \ | ||
| 112 | update_pos(yyget_extra(yyscanner), yylloc, yyleng); \ | ||
| 113 | update_offset(yyget_extra(yyscanner), yylloc, yyleng); \ | ||
| 114 | } | ||
| 115 | |||
| 116 | /* avoid warnings with -Wmissing-prototypes */ | ||
| 117 | extern int yyget_column(yyscan_t); | ||
| 118 | extern void yyset_column(int, yyscan_t); | ||
| 119 | |||
| 120 | %} | ||
| 121 | |||
| 122 | space [ ] | ||
| 123 | tab \t | ||
| 124 | newline_crlf \r\n | ||
| 125 | newline \n | ||
| 126 | digit [0-9] | ||
| 127 | hexdigit [0-9a-fA-F] | ||
| 128 | decstring {digit}+ | ||
| 129 | hexstring 0[xX]{hexdigit}+ | ||
| 130 | letter [a-zA-Z] | ||
| 131 | string ({letter}|[_.])({letter}|{digit}|[/\-_\.])* | ||
| 132 | quotedstring \"[^"]*\" | ||
| 133 | asteriskstring ({string}\*|{string}\\\*|\\\*|{string}\\\*{string}) | ||
| 134 | comment #.*$ | ||
| 135 | comment_line ^[ \t]*#.*\n | ||
| 136 | slash \/ | ||
| 137 | |||
| 138 | timestring ([0-9]+d)?([0-9]+h)?([0-9]+m)?([0-9]+s)?([0-9]+ms)? | ||
| 139 | |||
| 140 | hex4 ([[:xdigit:]]{1,4}) | ||
| 141 | rfc4291_broader (((:{hex4}){2})|(:{ip4addr})) | ||
| 142 | v680 (({hex4}:){7}{hex4}) | ||
| 143 | v670 ((:)((:{hex4}){5}){rfc4291_broader}) | ||
| 144 | v671 ((({hex4}:){1})((:{hex4}){4}){rfc4291_broader}) | ||
| 145 | v672 ((({hex4}:){2})((:{hex4}){3}){rfc4291_broader}) | ||
| 146 | v673 ((({hex4}:){3})((:{hex4}){2}){rfc4291_broader}) | ||
| 147 | v674 ((({hex4}:){4})((:{hex4}){1}){rfc4291_broader}) | ||
| 148 | v675 ((({hex4}:){5}){rfc4291_broader}) | ||
| 149 | v676 ((({hex4}:){6})(:{hex4}{1})) | ||
| 150 | v677 ((({hex4}:){7})(:)) | ||
| 151 | v67 ({v670}|{v671}|{v672}|{v673}|{v674}|{v675}|{v676}|{v677}) | ||
| 152 | v660 ((:)((:{hex4}){4}){rfc4291_broader}) | ||
| 153 | v661 ((({hex4}:){1})((:{hex4}){3}){rfc4291_broader}) | ||
| 154 | v662 ((({hex4}:){2})((:{hex4}){2}){rfc4291_broader}) | ||
| 155 | v663 ((({hex4}:){3})((:{hex4}){1}){rfc4291_broader}) | ||
| 156 | v664 ((({hex4}:){4}){rfc4291_broader}) | ||
| 157 | v665 ((({hex4}:){5})((:{hex4}){1})) | ||
| 158 | v666 ((({hex4}:){6})(:)) | ||
| 159 | v66 ({v660}|{v661}|{v662}|{v663}|{v664}|{v665}|{v666}) | ||
| 160 | v650 ((:)((:{hex4}){3}){rfc4291_broader}) | ||
| 161 | v651 ((({hex4}:){1})((:{hex4}){2}){rfc4291_broader}) | ||
| 162 | v652 ((({hex4}:){2})((:{hex4}){1}){rfc4291_broader}) | ||
| 163 | v653 ((({hex4}:){3}){rfc4291_broader}) | ||
| 164 | v654 ((({hex4}:){4})(:{hex4}{1})) | ||
| 165 | v655 ((({hex4}:){5})(:)) | ||
| 166 | v65 ({v650}|{v651}|{v652}|{v653}|{v654}|{v655}) | ||
| 167 | v640 ((:)((:{hex4}){2}){rfc4291_broader}) | ||
| 168 | v641 ((({hex4}:){1})((:{hex4}){1}){rfc4291_broader}) | ||
| 169 | v642 ((({hex4}:){2}){rfc4291_broader}) | ||
| 170 | v643 ((({hex4}:){3})((:{hex4}){1})) | ||
| 171 | v644 ((({hex4}:){4})(:)) | ||
| 172 | v64 ({v640}|{v641}|{v642}|{v643}|{v644}) | ||
| 173 | v630 ((:)((:{hex4}){1}){rfc4291_broader}) | ||
| 174 | v631 ((({hex4}:){1}){rfc4291_broader}) | ||
| 175 | v632 ((({hex4}:){2})((:{hex4}){1})) | ||
| 176 | v633 ((({hex4}:){3})(:)) | ||
| 177 | v63 ({v630}|{v631}|{v632}|{v633}) | ||
| 178 | v620 ((:){rfc4291_broader}) | ||
| 179 | v621 ((({hex4}:){1})((:{hex4}){1})) | ||
| 180 | v622 ((({hex4}:){2})(:)) | ||
| 181 | v62 ({v620}|{v621}|{v622}) | ||
| 182 | v610 ((:)(:{hex4}{1})) | ||
| 183 | v611 ((({hex4}:){1})(:)) | ||
| 184 | v61 ({v610}|{v611}) | ||
| 185 | v60 (::) | ||
| 186 | |||
| 187 | macaddr (([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}) | ||
| 188 | ip4addr (([[:digit:]]{1,3}"."){3}([[:digit:]]{1,3})) | ||
| 189 | ip6addr ({v680}|{v67}|{v66}|{v65}|{v64}|{v63}|{v62}|{v61}|{v60}) | ||
| 190 | ip6addr_rfc2732 (\[{ip6addr}\]) | ||
| 191 | |||
| 192 | classid ({hexdigit}{1,4}:{hexdigit}{1,4}) | ||
| 193 | addrstring ({macaddr}|{ip4addr}|{ip6addr}) | ||
| 194 | |||
| 195 | %option prefix="nft_" | ||
| 196 | %option outfile="lex.yy.c" | ||
| 197 | %option reentrant | ||
| 198 | %option noyywrap | ||
| 199 | %option nounput | ||
| 200 | %option bison-bridge | ||
| 201 | %option bison-locations | ||
| 202 | %option debug | ||
| 203 | %option yylineno | ||
| 204 | %option nodefault | ||
| 205 | %option warn | ||
| 206 | %option stack | ||
| 207 | %s SCANSTATE_ARP | ||
| 208 | %s SCANSTATE_AT | ||
| 209 | %s SCANSTATE_CT | ||
| 210 | %s SCANSTATE_COUNTER | ||
| 211 | %s SCANSTATE_ETH | ||
| 212 | %s SCANSTATE_GRE | ||
| 213 | %s SCANSTATE_ICMP | ||
| 214 | %s SCANSTATE_IGMP | ||
| 215 | %s SCANSTATE_IP | ||
| 216 | %s SCANSTATE_IP6 | ||
| 217 | %s SCANSTATE_LAST | ||
| 218 | %s SCANSTATE_LIMIT | ||
| 219 | %s SCANSTATE_META | ||
| 220 | %s SCANSTATE_POLICY | ||
| 221 | %s SCANSTATE_QUOTA | ||
| 222 | %x SCANSTATE_RATE | ||
| 223 | %s SCANSTATE_SCTP | ||
| 224 | %s SCANSTATE_SECMARK | ||
| 225 | %s SCANSTATE_TCP | ||
| 226 | %s SCANSTATE_TYPE | ||
| 227 | %s SCANSTATE_TUNNEL | ||
| 228 | %s SCANSTATE_VLAN | ||
| 229 | %s SCANSTATE_XT | ||
| 230 | %s SCANSTATE_CMD_DESTROY | ||
| 231 | %s SCANSTATE_CMD_EXPORT | ||
| 232 | %s SCANSTATE_CMD_IMPORT | ||
| 233 | %s SCANSTATE_CMD_LIST | ||
| 234 | %s SCANSTATE_CMD_MONITOR | ||
| 235 | %s SCANSTATE_CMD_RESET | ||
| 236 | %s SCANSTATE_EXPR_AH | ||
| 237 | %s SCANSTATE_EXPR_COMP | ||
| 238 | %s SCANSTATE_EXPR_DCCP | ||
| 239 | %s SCANSTATE_EXPR_DST | ||
| 240 | %s SCANSTATE_EXPR_ESP | ||
| 241 | %s SCANSTATE_EXPR_FIB | ||
| 242 | %s SCANSTATE_EXPR_FRAG | ||
| 243 | %s SCANSTATE_EXPR_HASH | ||
| 244 | %s SCANSTATE_EXPR_HBH | ||
| 245 | %s SCANSTATE_EXPR_IPSEC | ||
| 246 | %s SCANSTATE_EXPR_MH | ||
| 247 | %s SCANSTATE_EXPR_NUMGEN | ||
| 248 | %s SCANSTATE_EXPR_OSF | ||
| 249 | %s SCANSTATE_EXPR_QUEUE | ||
| 250 | %s SCANSTATE_EXPR_RT | ||
| 251 | %s SCANSTATE_EXPR_SCTP_CHUNK | ||
| 252 | %s SCANSTATE_EXPR_SOCKET | ||
| 253 | %s SCANSTATE_EXPR_TH | ||
| 254 | %s SCANSTATE_EXPR_UDP | ||
| 255 | %s SCANSTATE_EXPR_UDPLITE | ||
| 256 | |||
| 257 | %s SCANSTATE_STMT_DUP | ||
| 258 | %s SCANSTATE_STMT_FWD | ||
| 259 | %s SCANSTATE_STMT_LOG | ||
| 260 | %s SCANSTATE_STMT_NAT | ||
| 261 | %s SCANSTATE_STMT_REJECT | ||
| 262 | %s SCANSTATE_STMT_SYNPROXY | ||
| 263 | %s SCANSTATE_STMT_TPROXY | ||
| 264 | |||
| 265 | %% | ||
| 266 | |||
| 267 | 196 | "==" { return EQ; } | |
| 268 | 22 | "eq" { return EQ; } | |
| 269 | 1684 | "!=" { return NEQ; } | |
| 270 |
1/2✓ Branch 0 (62→63) taken 22 times.
✗ Branch 1 (62→64) not taken.
|
25 | "ne" { return NEQ; } |
| 271 |
1/2✓ Branch 0 (69→70) taken 1684 times.
✗ Branch 1 (69→71) not taken.
|
1684 | "<=" { return LTE; } |
| 272 |
1/2✓ Branch 0 (76→77) taken 3 times.
✗ Branch 1 (76→78) not taken.
|
3 | "le" { return LTE; } |
| 273 |
0/2✗ Branch 0 (83→84) not taken.
✗ Branch 1 (83→85) not taken.
|
51 | "<" { return LT; } |
| 274 |
0/2✗ Branch 0 (90→91) not taken.
✗ Branch 1 (90→92) not taken.
|
14 | "lt" { return LT; } |
| 275 |
1/2✓ Branch 0 (97→98) taken 51 times.
✗ Branch 1 (97→99) not taken.
|
53 | ">=" { return GTE; } |
| 276 |
1/2✓ Branch 0 (104→105) taken 14 times.
✗ Branch 1 (104→106) not taken.
|
16 | "ge" { return GTE; } |
| 277 |
1/2✓ Branch 0 (111→112) taken 2 times.
✗ Branch 1 (111→113) not taken.
|
67 | ">" { return GT; } |
| 278 |
1/2✓ Branch 0 (118→119) taken 2 times.
✗ Branch 1 (118→120) not taken.
|
28 | "gt" { return GT; } |
| 279 |
1/2✓ Branch 0 (125→126) taken 65 times.
✗ Branch 1 (125→127) not taken.
|
868317 | <*>"," { return COMMA; } |
| 280 |
1/2✓ Branch 0 (132→133) taken 26 times.
✗ Branch 1 (132→134) not taken.
|
89340 | "." { return DOT; } |
| 281 |
1/2✓ Branch 0 (139→140) taken 868252 times.
✗ Branch 1 (139→141) not taken.
|
1033308 | ":" { return COLON; } |
| 282 |
1/2✓ Branch 0 (146→147) taken 89314 times.
✗ Branch 1 (146→148) not taken.
|
98974 | <*>";" { return SEMICOLON; } |
| 283 |
1/2✓ Branch 0 (153→154) taken 165056 times.
✗ Branch 1 (153→155) not taken.
|
214841 | "{" { return '{'; } |
| 284 |
1/2✓ Branch 0 (160→161) taken 9660 times.
✗ Branch 1 (160→162) not taken.
|
59428 | <*>"}" { return '}'; } |
| 285 |
1/2✓ Branch 0 (167→168) taken 49785 times.
✗ Branch 1 (167→169) not taken.
|
49787 | "[" { return '['; } |
| 286 |
1/2✓ Branch 0 (174→175) taken 49768 times.
✗ Branch 1 (174→176) not taken.
|
49770 | "]" { return ']'; } |
| 287 |
1/2✓ Branch 0 (181→182) taken 2 times.
✗ Branch 1 (181→183) not taken.
|
156 | "(" { return '('; } |
| 288 |
1/2✓ Branch 0 (188→189) taken 2 times.
✗ Branch 1 (188→190) not taken.
|
158 | ")" { return ')'; } |
| 289 |
1/2✓ Branch 0 (195→196) taken 154 times.
✗ Branch 1 (195→197) not taken.
|
186 | "<<" { return LSHIFT; } |
| 290 |
1/2✓ Branch 0 (202→203) taken 156 times.
✗ Branch 1 (202→204) not taken.
|
164 | "lshift" { return LSHIFT; } |
| 291 |
1/2✓ Branch 0 (209→210) taken 32 times.
✗ Branch 1 (209→211) not taken.
|
40 | ">>" { return RSHIFT; } |
| 292 |
1/2✓ Branch 0 (216→217) taken 8 times.
✗ Branch 1 (216→218) not taken.
|
8 | "rshift" { return RSHIFT; } |
| 293 |
1/2✓ Branch 0 (223→224) taken 8 times.
✗ Branch 1 (223→225) not taken.
|
80 | "^" { return CARET; } |
| 294 |
0/2✗ Branch 0 (230→231) not taken.
✗ Branch 1 (230→232) not taken.
|
37 | "xor" { return CARET; } |
| 295 |
1/2✓ Branch 0 (237→238) taken 72 times.
✗ Branch 1 (237→239) not taken.
|
363 | "&" { return AMPERSAND; } |
| 296 |
1/2✓ Branch 0 (244→245) taken 37 times.
✗ Branch 1 (244→246) not taken.
|
92 | "and" { return AMPERSAND; } |
| 297 |
1/2✓ Branch 0 (251→252) taken 291 times.
✗ Branch 1 (251→253) not taken.
|
1032 | "|" { return '|'; } |
| 298 |
1/2✓ Branch 0 (258→259) taken 55 times.
✗ Branch 1 (258→260) not taken.
|
137 | "or" { return '|'; } |
| 299 |
1/2✓ Branch 0 (265→266) taken 741 times.
✗ Branch 1 (265→267) not taken.
|
764 | "!" { return NOT; } |
| 300 |
1/2✓ Branch 0 (272→273) taken 82 times.
✗ Branch 1 (272→274) not taken.
|
82 | "not" { return NOT; } |
| 301 |
1/2✓ Branch 0 (279→280) taken 23 times.
✗ Branch 1 (279→281) not taken.
|
144085 | <*>"/" { return SLASH; } |
| 302 |
0/2✗ Branch 0 (286→287) not taken.
✗ Branch 1 (286→288) not taken.
|
19583 | "-" { return DASH; } |
| 303 |
1/2✓ Branch 0 (293→294) taken 144062 times.
✗ Branch 1 (293→295) not taken.
|
144124 | "*" { return ASTERISK; } |
| 304 |
1/2✓ Branch 0 (300→301) taken 19583 times.
✗ Branch 1 (300→302) not taken.
|
22707 | "@" { scanner_push_start_cond(yyscanner, SCANSTATE_AT); return AT; } |
| 305 |
1/2✓ Branch 0 (307→308) taken 62 times.
✗ Branch 1 (307→309) not taken.
|
20283 | "$" { return '$'; } |
| 306 |
1/2✓ Branch 0 (314→315) taken 3124 times.
✗ Branch 1 (314→316) not taken.
|
25101 | "=" { return '='; } |
| 307 |
1/2✓ Branch 0 (322→323) taken 20221 times.
✗ Branch 1 (322→324) not taken.
|
20700 | "vmap" { return VMAP; } |
| 308 |
1/2✓ Branch 0 (329→330) taken 21977 times.
✗ Branch 1 (329→331) not taken.
|
21977 | |
| 309 |
1/2✓ Branch 0 (336→337) taken 479 times.
✗ Branch 1 (336→338) not taken.
|
742 | "+" { return PLUS; } |
| 310 |
1/2✓ Branch 0 (343→344) taken 263 times.
✗ Branch 1 (343→345) not taken.
|
263 | |
| 311 | 45 | "include" { return INCLUDE; } | |
| 312 |
1/2✓ Branch 0 (350→351) taken 45 times.
✗ Branch 1 (350→352) not taken.
|
20167 | "define" { return DEFINE; } |
| 313 | 2 | "redefine" { return REDEFINE; } | |
| 314 |
1/2✓ Branch 0 (357→358) taken 20122 times.
✗ Branch 1 (357→359) not taken.
|
20124 | "undefine" { return UNDEFINE; } |
| 315 |
1/2✓ Branch 0 (364→365) taken 2 times.
✗ Branch 1 (364→366) not taken.
|
2 | |
| 316 |
1/2✓ Branch 0 (371→372) taken 2 times.
✗ Branch 1 (371→373) not taken.
|
3 | "describe" { return DESCRIBE; } |
| 317 |
1/2✓ Branch 0 (378→379) taken 1 times.
✗ Branch 1 (378→380) not taken.
|
1 | |
| 318 | <SCANSTATE_CMD_LIST,SCANSTATE_CMD_MONITOR>{ | ||
| 319 | 1 | "chains" { return CHAINS; } | |
| 320 |
1/2✓ Branch 0 (385→386) taken 1 times.
✗ Branch 1 (385→387) not taken.
|
5 | "sets" { return SETS; } |
| 321 | 2 | "tables" { return TABLES; } | |
| 322 |
1/2✓ Branch 0 (392→393) taken 4 times.
✗ Branch 1 (392→394) not taken.
|
4 | } |
| 323 |
1/2✓ Branch 0 (399→400) taken 2 times.
✗ Branch 1 (399→401) not taken.
|
2 | <SCANSTATE_CMD_MONITOR>{ |
| 324 | ✗ | "rules" { return RULES; } | |
| 325 | ✗ | "trace" { return TRACE; } | |
| 326 | ✗ | "new" { return NEW; } | |
| 327 | ✗ | "destroy" { return DESTROY; } | |
| 328 | ✗ | } | |
| 329 |
0/2✗ Branch 0 (427→428) not taken.
✗ Branch 1 (427→429) not taken.
|
3006 | "hook" { return HOOK; } |
| 330 | 160 | "device" { return DEVICE; } | |
| 331 |
1/2✓ Branch 0 (434→435) taken 3006 times.
✗ Branch 1 (434→436) not taken.
|
4126 | "devices" { return DEVICES; } |
| 332 |
1/2✓ Branch 0 (441→442) taken 160 times.
✗ Branch 1 (441→443) not taken.
|
29282 | "table" { return TABLE; } |
| 333 |
1/2✓ Branch 0 (448→449) taken 1120 times.
✗ Branch 1 (448→450) not taken.
|
8266 | "chain" { return CHAIN; } |
| 334 |
1/2✓ Branch 0 (455→456) taken 29122 times.
✗ Branch 1 (455→457) not taken.
|
44338 | "rule" { return RULE; } |
| 335 |
1/2✓ Branch 0 (462→463) taken 7146 times.
✗ Branch 1 (462→464) not taken.
|
10967 | "set" { return SET; } |
| 336 |
1/2✓ Branch 0 (469→470) taken 15216 times.
✗ Branch 1 (469→471) not taken.
|
49572 | "element" { return ELEMENT; } |
| 337 |
1/2✓ Branch 0 (476→477) taken 3821 times.
✗ Branch 1 (476→478) not taken.
|
5011 | "map" { return MAP; } |
| 338 |
1/2✓ Branch 0 (483→484) taken 34356 times.
✗ Branch 1 (483→485) not taken.
|
34468 | "flowtable" { return FLOWTABLE; } |
| 339 |
1/2✓ Branch 0 (490→491) taken 1190 times.
✗ Branch 1 (490→492) not taken.
|
1238 | "handle" { return HANDLE; } |
| 340 |
1/2✓ Branch 0 (497→498) taken 112 times.
✗ Branch 1 (497→499) not taken.
|
2641 | "ruleset" { return RULESET; } |
| 341 |
1/2✓ Branch 0 (504→505) taken 48 times.
✗ Branch 1 (504→506) not taken.
|
48 | |
| 342 |
1/2✓ Branch 0 (511→512) taken 2529 times.
✗ Branch 1 (511→513) not taken.
|
2551 | "socket" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_SOCKET); return SOCKET; } |
| 343 |
1/2✓ Branch 0 (518→519) taken 22 times.
✗ Branch 1 (518→520) not taken.
|
22 | <SCANSTATE_EXPR_SOCKET>{ |
| 344 | 9 | "transparent" { return TRANSPARENT; } | |
| 345 | 9 | "wildcard" { return WILDCARD; } | |
| 346 |
1/2✓ Branch 0 (526→527) taken 9 times.
✗ Branch 1 (526→528) not taken.
|
10 | "cgroupv2" { return CGROUPV2; } |
| 347 |
1/2✓ Branch 0 (533→534) taken 9 times.
✗ Branch 1 (533→535) not taken.
|
10 | "level" { return LEVEL; } |
| 348 |
1/2✓ Branch 0 (540→541) taken 1 times.
✗ Branch 1 (540→542) not taken.
|
1 | } |
| 349 |
1/2✓ Branch 0 (547→548) taken 1 times.
✗ Branch 1 (547→549) not taken.
|
49 | "tproxy" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_TPROXY); return TPROXY; } |
| 350 | 48 | ||
| 351 |
1/2✓ Branch 0 (554→555) taken 48 times.
✗ Branch 1 (554→556) not taken.
|
6892 | "accept" { return ACCEPT; } |
| 352 |
1/2✓ Branch 0 (562→563) taken 6844 times.
✗ Branch 1 (562→564) not taken.
|
9190 | "drop" { return DROP; } |
| 353 | 16 | "continue" { return CONTINUE; } | |
| 354 |
1/2✓ Branch 0 (569→570) taken 2346 times.
✗ Branch 1 (569→571) not taken.
|
137512 | "jump" { return JUMP; } |
| 355 |
1/2✓ Branch 0 (576→577) taken 16 times.
✗ Branch 1 (576→578) not taken.
|
5006 | "goto" { return GOTO; } |
| 356 |
1/2✓ Branch 0 (583→584) taken 135166 times.
✗ Branch 1 (583→585) not taken.
|
136583 | "return" { return RETURN; } |
| 357 |
1/2✓ Branch 0 (590→591) taken 4990 times.
✗ Branch 1 (590→592) not taken.
|
5455 | <SCANSTATE_EXPR_QUEUE,SCANSTATE_STMT_DUP,SCANSTATE_STMT_FWD,SCANSTATE_STMT_NAT,SCANSTATE_STMT_TPROXY,SCANSTATE_IP,SCANSTATE_IP6>"to" { return TO; } /* XXX: SCANSTATE_IP is a workaround */ |
| 358 |
1/2✓ Branch 0 (597→598) taken 1417 times.
✗ Branch 1 (597→599) not taken.
|
1417 | |
| 359 |
1/2✓ Branch 0 (604→605) taken 465 times.
✗ Branch 1 (604→606) not taken.
|
45183 | "inet" { return INET; } |
| 360 |
1/2✓ Branch 0 (611→612) taken 44718 times.
✗ Branch 1 (611→613) not taken.
|
60056 | "netdev" { return NETDEV; } |
| 361 | 15338 | ||
| 362 |
1/2✓ Branch 0 (618→619) taken 15338 times.
✗ Branch 1 (618→620) not taken.
|
65931 | "add" { return ADD; } |
| 363 |
1/2✓ Branch 0 (625→626) taken 50593 times.
✗ Branch 1 (625→627) not taken.
|
50604 | "replace" { return REPLACE; } |
| 364 | 1049 | "update" { return UPDATE; } | |
| 365 |
1/2✓ Branch 0 (632→633) taken 11 times.
✗ Branch 1 (632→634) not taken.
|
236 | "create" { return CREATE; } |
| 366 |
1/2✓ Branch 0 (639→640) taken 1049 times.
✗ Branch 1 (639→641) not taken.
|
1199 | "insert" { return INSERT; } |
| 367 |
1/2✓ Branch 0 (646→647) taken 225 times.
✗ Branch 1 (646→648) not taken.
|
3074 | "delete" { return DELETE; } |
| 368 |
1/2✓ Branch 0 (653→654) taken 150 times.
✗ Branch 1 (653→655) not taken.
|
1214 | "get" { return GET; } |
| 369 |
1/2✓ Branch 0 (660→661) taken 2849 times.
✗ Branch 1 (660→662) not taken.
|
19258 | "list" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_LIST); return LIST; } |
| 370 |
1/2✓ Branch 0 (667→668) taken 1064 times.
✗ Branch 1 (667→669) not taken.
|
2047 | "reset" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_RESET); return RESET; } |
| 371 |
1/2✓ Branch 0 (674→675) taken 16409 times.
✗ Branch 1 (674→676) not taken.
|
32105 | "flush" { return FLUSH; } |
| 372 |
1/2✓ Branch 0 (682→683) taken 983 times.
✗ Branch 1 (682→684) not taken.
|
987 | "rename" { return RENAME; } |
| 373 |
1/2✓ Branch 0 (690→691) taken 15696 times.
✗ Branch 1 (690→692) not taken.
|
15696 | "import" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_IMPORT); return IMPORT; } |
| 374 |
1/2✓ Branch 0 (697→698) taken 4 times.
✗ Branch 1 (697→699) not taken.
|
4 | "export" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_EXPORT); return EXPORT; } |
| 375 | ✗ | "monitor" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_MONITOR); return MONITOR; } | |
| 376 |
0/2✗ Branch 0 (712→713) not taken.
✗ Branch 1 (712→714) not taken.
|
30 | "destroy" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_DESTROY); return DESTROY; } |
| 377 | ✗ | ||
| 378 |
1/2✓ Branch 0 (728→729) taken 30 times.
✗ Branch 1 (728→730) not taken.
|
30 | |
| 379 |
1/2✓ Branch 0 (736→737) taken 8 times.
✗ Branch 1 (736→738) not taken.
|
8 | "position" { return POSITION; } |
| 380 | 24 | "index" { return INDEX; } | |
| 381 | 3891 | "comment" { return COMMENT; } | |
| 382 |
1/2✓ Branch 0 (743→744) taken 24 times.
✗ Branch 1 (743→745) not taken.
|
24 | |
| 383 |
1/2✓ Branch 0 (750→751) taken 3891 times.
✗ Branch 1 (750→752) not taken.
|
3951 | "constant" { return CONSTANT; } |
| 384 |
1/2✓ Branch 0 (757→758) taken 60 times.
✗ Branch 1 (757→759) not taken.
|
649 | "interval" { return INTERVAL; } |
| 385 | 1090 | "dynamic" { return DYNAMIC; } | |
| 386 |
1/2✓ Branch 0 (764→765) taken 589 times.
✗ Branch 1 (764→766) not taken.
|
606 | "auto-merge" { return AUTOMERGE; } |
| 387 |
1/2✓ Branch 0 (771→772) taken 1090 times.
✗ Branch 1 (771→773) not taken.
|
141933 | "timeout" { return TIMEOUT; } |
| 388 |
1/2✓ Branch 0 (778→779) taken 17 times.
✗ Branch 1 (778→780) not taken.
|
26 | "gc-interval" { return GC_INTERVAL; } |
| 389 |
1/2✓ Branch 0 (785→786) taken 140843 times.
✗ Branch 1 (785→787) not taken.
|
141559 | "elements" { return ELEMENTS; } |
| 390 |
1/2✓ Branch 0 (792→793) taken 9 times.
✗ Branch 1 (792→794) not taken.
|
74296 | "expires" { return EXPIRES; } |
| 391 |
1/2✓ Branch 0 (799→800) taken 716 times.
✗ Branch 1 (799→801) not taken.
|
716 | |
| 392 |
1/2✓ Branch 0 (806→807) taken 74287 times.
✗ Branch 1 (806→808) not taken.
|
76335 | "policy" { scanner_push_start_cond(yyscanner, SCANSTATE_POLICY); return POLICY; } |
| 393 |
1/2✓ Branch 0 (813→814) taken 2048 times.
✗ Branch 1 (813→815) not taken.
|
3240 | "size" { return SIZE; } |
| 394 | 1192 | <SCANSTATE_POLICY>{ | |
| 395 |
1/2✓ Branch 0 (821→822) taken 1192 times.
✗ Branch 1 (821→823) not taken.
|
1192 | "performance" { return PERFORMANCE; } |
| 396 | ✗ | "memory" { return MEMORY; } | |
| 397 | ✗ | } | |
| 398 | ✗ | ||
| 399 | 12 | "flow" { return FLOW; } | |
| 400 |
1/2✓ Branch 0 (842→843) taken 12 times.
✗ Branch 1 (842→844) not taken.
|
12 | "offload" { return OFFLOAD; } |
| 401 | 9 | "meter" { return METER; } | |
| 402 | ✗ | ||
| 403 |
1/2✓ Branch 0 (856→857) taken 9 times.
✗ Branch 1 (856→858) not taken.
|
9 | <SCANSTATE_CMD_LIST>{ |
| 404 | 2 | "meters" { return METERS; } | |
| 405 |
1/2✓ Branch 0 (863→864) taken 2 times.
✗ Branch 1 (863→865) not taken.
|
3 | "flowtables" { return FLOWTABLES; } |
| 406 | ✗ | "limits" { return LIMITS; } | |
| 407 |
1/2✓ Branch 0 (870→871) taken 1 times.
✗ Branch 1 (870→872) not taken.
|
1 | "maps" { return MAPS; } |
| 408 | ✗ | "secmarks" { return SECMARKS; } | |
| 409 | ✗ | "synproxys" { return SYNPROXYS; } | |
| 410 | ✗ | "tunnels" { return TUNNELS; } | |
| 411 |
0/2✗ Branch 0 (898→899) not taken.
✗ Branch 1 (898→900) not taken.
|
15 | "hooks" { return HOOKS; } |
| 412 | ✗ | } | |
| 413 |
1/2✓ Branch 0 (912→913) taken 15 times.
✗ Branch 1 (912→914) not taken.
|
15 | |
| 414 | 3016 | <*>"counter" { scanner_push_start_cond(yyscanner, SCANSTATE_COUNTER); return COUNTER; } | |
| 415 |
1/2✓ Branch 0 (919→920) taken 3016 times.
✗ Branch 1 (919→921) not taken.
|
3249 | <SCANSTATE_COUNTER,SCANSTATE_LIMIT,SCANSTATE_QUOTA,SCANSTATE_STMT_SYNPROXY,SCANSTATE_EXPR_OSF,SCANSTATE_TUNNEL>"name" { return NAME; } |
| 416 | 426 | <SCANSTATE_COUNTER,SCANSTATE_CT,SCANSTATE_LIMIT,SCANSTATE_RATE>"packets" { return PACKETS; } | |
| 417 |
1/2✓ Branch 0 (927→928) taken 233 times.
✗ Branch 1 (927→929) not taken.
|
805 | <SCANSTATE_COUNTER,SCANSTATE_CT,SCANSTATE_LIMIT,SCANSTATE_QUOTA,SCANSTATE_RATE>"bytes" { return BYTES; } |
| 418 |
1/2✓ Branch 0 (934→935) taken 426 times.
✗ Branch 1 (934→936) not taken.
|
580 | <SCANSTATE_LIMIT,SCANSTATE_QUOTA,SCANSTATE_RATE>"kbytes" { return KBYTES; } |
| 419 |
1/2✓ Branch 0 (941→942) taken 572 times.
✗ Branch 1 (941→943) not taken.
|
710 | <SCANSTATE_LIMIT,SCANSTATE_QUOTA,SCANSTATE_RATE>"mbytes" { return MBYTES; } |
| 420 |
1/2✓ Branch 0 (948→949) taken 154 times.
✗ Branch 1 (948→950) not taken.
|
154 | |
| 421 |
1/2✓ Branch 0 (955→956) taken 138 times.
✗ Branch 1 (955→957) not taken.
|
171 | "last" { scanner_push_start_cond(yyscanner, SCANSTATE_LAST); return LAST; } |
| 422 |
1/2✓ Branch 0 (962→963) taken 33 times.
✗ Branch 1 (962→964) not taken.
|
33 | <SCANSTATE_LAST>{ |
| 423 | 4 | "never" { return NEVER; } | |
| 424 | 4 | } | |
| 425 |
1/2✓ Branch 0 (970→971) taken 4 times.
✗ Branch 1 (970→972) not taken.
|
4 | |
| 426 | <SCANSTATE_CMD_LIST,SCANSTATE_CMD_RESET>{ | ||
| 427 | 6 | "counters" { return COUNTERS; } | |
| 428 |
1/2✓ Branch 0 (977→978) taken 6 times.
✗ Branch 1 (977→979) not taken.
|
12 | "quotas" { return QUOTAS; } |
| 429 | 8 | "rules" { return RULES; } | |
| 430 |
1/2✓ Branch 0 (984→985) taken 6 times.
✗ Branch 1 (984→986) not taken.
|
6 | } |
| 431 |
1/2✓ Branch 0 (991→992) taken 8 times.
✗ Branch 1 (991→993) not taken.
|
8 | |
| 432 | 192 | <*>"log" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_LOG); return LOG; } | |
| 433 |
1/2✓ Branch 0 (998→999) taken 192 times.
✗ Branch 1 (998→1000) not taken.
|
245 | <SCANSTATE_STMT_LOG,SCANSTATE_STMT_NAT,SCANSTATE_IP,SCANSTATE_IP6>"prefix" { return PREFIX; } |
| 434 | 53 | <SCANSTATE_STMT_LOG>{ | |
| 435 |
1/2✓ Branch 0 (1006→1007) taken 53 times.
✗ Branch 1 (1006→1008) not taken.
|
73 | "snaplen" { return SNAPLEN; } |
| 436 | 10 | "queue-threshold" { return QUEUE_THRESHOLD; } | |
| 437 |
1/2✓ Branch 0 (1013→1014) taken 20 times.
✗ Branch 1 (1013→1015) not taken.
|
106 | "level" { return LEVEL; } |
| 438 |
1/2✓ Branch 0 (1020→1021) taken 10 times.
✗ Branch 1 (1020→1022) not taken.
|
60 | "group" { return GROUP; } |
| 439 |
1/2✓ Branch 0 (1027→1028) taken 86 times.
✗ Branch 1 (1027→1029) not taken.
|
96 | "emerg" { return EMERG; } |
| 440 |
1/2✓ Branch 0 (1034→1035) taken 50 times.
✗ Branch 1 (1034→1036) not taken.
|
60 | "alert" { return ALERT; } |
| 441 |
1/2✓ Branch 0 (1041→1042) taken 10 times.
✗ Branch 1 (1041→1043) not taken.
|
15 | "crit" { return CRIT; } |
| 442 |
1/2✓ Branch 0 (1048→1049) taken 10 times.
✗ Branch 1 (1048→1050) not taken.
|
15 | "err" { return ERR; } |
| 443 |
1/2✓ Branch 0 (1055→1056) taken 5 times.
✗ Branch 1 (1055→1057) not taken.
|
10 | "warn" { return WARN; } |
| 444 |
1/2✓ Branch 0 (1062→1063) taken 5 times.
✗ Branch 1 (1062→1064) not taken.
|
10 | "notice" { return NOTICE; } |
| 445 |
1/2✓ Branch 0 (1069→1070) taken 5 times.
✗ Branch 1 (1069→1071) not taken.
|
10 | "info" { return INFO; } |
| 446 |
1/2✓ Branch 0 (1076→1077) taken 5 times.
✗ Branch 1 (1076→1078) not taken.
|
16 | "debug" { return DEBUG_TOKEN; } |
| 447 |
1/2✓ Branch 0 (1083→1084) taken 5 times.
✗ Branch 1 (1083→1085) not taken.
|
35 | "audit" { return AUDIT; } |
| 448 |
1/2✓ Branch 0 (1090→1091) taken 11 times.
✗ Branch 1 (1090→1092) not taken.
|
11 | } |
| 449 |
1/2✓ Branch 0 (1097→1098) taken 30 times.
✗ Branch 1 (1097→1099) not taken.
|
30 | |
| 450 | 149 | "queue" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_QUEUE); return QUEUE;} | |
| 451 |
1/2✓ Branch 0 (1104→1105) taken 149 times.
✗ Branch 1 (1104→1106) not taken.
|
149 | <SCANSTATE_EXPR_QUEUE>{ |
| 452 | 43 | "num" { return QUEUENUM;} | |
| 453 | 51 | "bypass" { return BYPASS;} | |
| 454 |
1/2✓ Branch 0 (1112→1113) taken 43 times.
✗ Branch 1 (1112→1114) not taken.
|
75 | "fanout" { return FANOUT;} |
| 455 |
1/2✓ Branch 0 (1119→1120) taken 51 times.
✗ Branch 1 (1119→1121) not taken.
|
51 | } |
| 456 |
1/2✓ Branch 0 (1126→1127) taken 32 times.
✗ Branch 1 (1126→1128) not taken.
|
531 | "limit" { scanner_push_start_cond(yyscanner, SCANSTATE_LIMIT); return LIMIT; } |
| 457 | 499 | <SCANSTATE_LIMIT,SCANSTATE_RATE>{ | |
| 458 |
1/2✓ Branch 0 (1133→1134) taken 499 times.
✗ Branch 1 (1133→1135) not taken.
|
973 | "rate" { scanner_push_start_cond(yyscanner, SCANSTATE_RATE); return RATE; } |
| 459 | 243 | "burst" { return BURST; } | |
| 460 |
1/2✓ Branch 0 (1141→1142) taken 474 times.
✗ Branch 1 (1141→1143) not taken.
|
474 | |
| 461 |
1/2✓ Branch 0 (1149→1150) taken 243 times.
✗ Branch 1 (1149→1151) not taken.
|
243 | /* time_unit */ |
| 462 | 351 | "second" { return SECOND; } | |
| 463 |
1/2✓ Branch 0 (1156→1157) taken 351 times.
✗ Branch 1 (1156→1158) not taken.
|
387 | "minute" { return MINUTE; } |
| 464 | 28 | "week" { return WEEK; } | |
| 465 |
1/2✓ Branch 0 (1163→1164) taken 36 times.
✗ Branch 1 (1163→1165) not taken.
|
36 | } |
| 466 |
1/2✓ Branch 0 (1170→1171) taken 28 times.
✗ Branch 1 (1170→1172) not taken.
|
325 | <SCANSTATE_CT,SCANSTATE_LIMIT,SCANSTATE_QUOTA,SCANSTATE_RATE>"over" { return OVER; } |
| 467 | 297 | ||
| 468 |
1/2✓ Branch 0 (1177→1178) taken 297 times.
✗ Branch 1 (1177→1179) not taken.
|
481 | "quota" { scanner_push_start_cond(yyscanner, SCANSTATE_QUOTA); return QUOTA; } |
| 469 |
1/2✓ Branch 0 (1184→1185) taken 184 times.
✗ Branch 1 (1184→1186) not taken.
|
184 | <SCANSTATE_QUOTA,SCANSTATE_RATE>{ |
| 470 | ✗ | "until" { return UNTIL; } | |
| 471 | ✗ | } | |
| 472 | ✗ | ||
| 473 | 30 | <SCANSTATE_QUOTA,SCANSTATE_LAST>"used" { return USED; } | |
| 474 |
1/2✓ Branch 0 (1199→1200) taken 30 times.
✗ Branch 1 (1199→1201) not taken.
|
30 | |
| 475 | 188 | <*>"hour" { return HOUR; } | |
| 476 |
1/2✓ Branch 0 (1206→1207) taken 188 times.
✗ Branch 1 (1206→1208) not taken.
|
257 | <*>"day" { return DAY; } |
| 477 | 69 | ||
| 478 |
1/2✓ Branch 0 (1213→1214) taken 69 times.
✗ Branch 1 (1213→1215) not taken.
|
270 | "reject" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_REJECT); return _REJECT; } |
| 479 |
1/2✓ Branch 0 (1220→1221) taken 201 times.
✗ Branch 1 (1220→1222) not taken.
|
201 | <SCANSTATE_STMT_REJECT>{ |
| 480 | 154 | "with" { return WITH; } | |
| 481 | 31 | "icmpx" { return ICMPX; } | |
| 482 |
1/2✓ Branch 0 (1228→1229) taken 154 times.
✗ Branch 1 (1228→1230) not taken.
|
154 | } |
| 483 |
1/2✓ Branch 0 (1235→1236) taken 31 times.
✗ Branch 1 (1235→1237) not taken.
|
31 | |
| 484 | 81 | "snat" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_NAT); return SNAT; } | |
| 485 |
1/2✓ Branch 0 (1242→1243) taken 81 times.
✗ Branch 1 (1242→1244) not taken.
|
278 | "dnat" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_NAT); return DNAT; } |
| 486 | 80 | "masquerade" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_NAT); return MASQUERADE; } | |
| 487 |
1/2✓ Branch 0 (1250→1251) taken 197 times.
✗ Branch 1 (1250→1252) not taken.
|
306 | "redirect" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_NAT); return REDIRECT; } |
| 488 |
1/2✓ Branch 0 (1258→1259) taken 80 times.
✗ Branch 1 (1258→1260) not taken.
|
163 | "random" { return RANDOM; } |
| 489 |
1/2✓ Branch 0 (1266→1267) taken 109 times.
✗ Branch 1 (1266→1268) not taken.
|
109 | <SCANSTATE_STMT_NAT>{ |
| 490 |
1/2✓ Branch 0 (1274→1275) taken 83 times.
✗ Branch 1 (1274→1276) not taken.
|
128 | "fully-random" { return FULLY_RANDOM; } |
| 491 | 60 | "persistent" { return PERSISTENT; } | |
| 492 |
1/2✓ Branch 0 (1281→1282) taken 45 times.
✗ Branch 1 (1281→1283) not taken.
|
58 | "port" { return PORT; } |
| 493 |
1/2✓ Branch 0 (1288→1289) taken 60 times.
✗ Branch 1 (1288→1290) not taken.
|
60 | } |
| 494 |
1/2✓ Branch 0 (1295→1296) taken 13 times.
✗ Branch 1 (1295→1297) not taken.
|
13 | |
| 495 | <SCANSTATE_AT>{ | ||
| 496 | 21 | "ll" { return LL_HDR; } | |
| 497 |
1/2✓ Branch 0 (1302→1303) taken 21 times.
✗ Branch 1 (1302→1304) not taken.
|
46 | "nh" { return NETWORK_HDR; } |
| 498 | 25 | } | |
| 499 |
1/2✓ Branch 0 (1309→1310) taken 25 times.
✗ Branch 1 (1309→1311) not taken.
|
134 | "th" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_TH); return TRANSPORT_HDR; } |
| 500 | 109 | ||
| 501 |
1/2✓ Branch 0 (1316→1317) taken 109 times.
✗ Branch 1 (1316→1318) not taken.
|
3321 | "bridge" { return BRIDGE; } |
| 502 |
1/2✓ Branch 0 (1324→1325) taken 3212 times.
✗ Branch 1 (1324→1326) not taken.
|
3212 | |
| 503 | 3941 | "ether" { scanner_push_start_cond(yyscanner, SCANSTATE_ETH); return ETHER; } | |
| 504 |
1/2✓ Branch 0 (1331→1332) taken 3941 times.
✗ Branch 1 (1331→1333) not taken.
|
3941 | <SCANSTATE_ARP,SCANSTATE_CT,SCANSTATE_ETH,SCANSTATE_IP,SCANSTATE_IP6,SCANSTATE_EXPR_FIB,SCANSTATE_EXPR_IPSEC>{ |
| 505 | 4963 | "saddr" { return SADDR; } | |
| 506 | 905 | "daddr" { return DADDR; } | |
| 507 |
1/2✓ Branch 0 (1339→1340) taken 4963 times.
✗ Branch 1 (1339→1341) not taken.
|
4963 | } |
| 508 |
1/2✓ Branch 0 (1346→1347) taken 905 times.
✗ Branch 1 (1346→1348) not taken.
|
5754 | "type" { scanner_push_start_cond(yyscanner, SCANSTATE_TYPE); return TYPE; } |
| 509 | 1421 | "typeof" { return TYPEOF; } | |
| 510 |
1/2✓ Branch 0 (1353→1354) taken 4849 times.
✗ Branch 1 (1353→1355) not taken.
|
4849 | |
| 511 |
1/2✓ Branch 0 (1361→1362) taken 1421 times.
✗ Branch 1 (1361→1363) not taken.
|
3290 | "vlan" { scanner_push_start_cond(yyscanner, SCANSTATE_VLAN); return VLAN; } |
| 512 |
1/2✓ Branch 0 (1368→1369) taken 1869 times.
✗ Branch 1 (1368→1370) not taken.
|
3713 | <SCANSTATE_CT,SCANSTATE_EXPR_FRAG,SCANSTATE_VLAN,SCANSTATE_IP,SCANSTATE_ICMP>"id" { return ID; } |
| 513 | 1844 | <SCANSTATE_VLAN>{ | |
| 514 |
1/2✓ Branch 0 (1376→1377) taken 1844 times.
✗ Branch 1 (1376→1378) not taken.
|
1847 | "cfi" { return CFI; } |
| 515 | 39 | "dei" { return DEI; } | |
| 516 |
1/2✓ Branch 0 (1383→1384) taken 3 times.
✗ Branch 1 (1383→1385) not taken.
|
19 | "pcp" { return PCP; } |
| 517 |
1/2✓ Branch 0 (1390→1391) taken 39 times.
✗ Branch 1 (1390→1392) not taken.
|
39 | } |
| 518 |
1/2✓ Branch 0 (1397→1398) taken 16 times.
✗ Branch 1 (1397→1399) not taken.
|
30 | "8021ad" { yylval->string = xstrdup(yytext); return STRING; } |
| 519 | 540 | "8021q" { yylval->string = xstrdup(yytext); return STRING; } | |
| 520 |
1/2✓ Branch 0 (1404→1405) taken 14 times.
✗ Branch 1 (1404→1406) not taken.
|
14 | |
| 521 |
1/2✓ Branch 0 (1412→1413) taken 540 times.
✗ Branch 1 (1412→1414) not taken.
|
2730 | "arp" { scanner_push_start_cond(yyscanner, SCANSTATE_ARP); return ARP; } |
| 522 |
1/2✓ Branch 0 (1420→1421) taken 2190 times.
✗ Branch 1 (1420→1422) not taken.
|
2190 | <SCANSTATE_ARP>{ |
| 523 | 30 | "htype" { return HTYPE; } | |
| 524 | 12 | "ptype" { return PTYPE; } | |
| 525 |
1/2✓ Branch 0 (1428→1429) taken 30 times.
✗ Branch 1 (1428→1430) not taken.
|
54 | "hlen" { return HLEN; } |
| 526 |
1/2✓ Branch 0 (1435→1436) taken 12 times.
✗ Branch 1 (1435→1437) not taken.
|
36 | "plen" { return PLEN; } |
| 527 |
1/2✓ Branch 0 (1442→1443) taken 24 times.
✗ Branch 1 (1442→1444) not taken.
|
75 | "operation" { return OPERATION; } |
| 528 |
1/2✓ Branch 0 (1449→1450) taken 24 times.
✗ Branch 1 (1449→1451) not taken.
|
24 | } |
| 529 |
1/2✓ Branch 0 (1456→1457) taken 51 times.
✗ Branch 1 (1456→1458) not taken.
|
51 | |
| 530 | 13795 | "ip" { scanner_push_start_cond(yyscanner, SCANSTATE_IP); return IP; } | |
| 531 |
1/2✓ Branch 0 (1463→1464) taken 13795 times.
✗ Branch 1 (1463→1465) not taken.
|
13795 | <SCANSTATE_IP,SCANSTATE_IP6,SCANSTATE_EXPR_OSF,SCANSTATE_GRE>{ |
| 532 | 61 | "version" { return HDRVERSION; } | |
| 533 | 61 | } | |
| 534 |
1/2✓ Branch 0 (1471→1472) taken 61 times.
✗ Branch 1 (1471→1473) not taken.
|
61 | <SCANSTATE_EXPR_AH,SCANSTATE_EXPR_DST,SCANSTATE_EXPR_HBH,SCANSTATE_EXPR_MH,SCANSTATE_EXPR_RT,SCANSTATE_IP>{ |
| 535 | 133 | "hdrlength" { return HDRLENGTH; } | |
| 536 | 133 | } | |
| 537 |
1/2✓ Branch 0 (1478→1479) taken 133 times.
✗ Branch 1 (1478→1480) not taken.
|
133 | <SCANSTATE_IP,SCANSTATE_IP6,SCANSTATE_TYPE>{ |
| 538 | 220 | "dscp" { return DSCP; } | |
| 539 | 220 | } | |
| 540 |
1/2✓ Branch 0 (1485→1486) taken 220 times.
✗ Branch 1 (1485→1487) not taken.
|
306 | "ecn" { return ECN; } |
| 541 | 226 | <SCANSTATE_EXPR_UDP,SCANSTATE_IP,SCANSTATE_IP6,SCANSTATE_META,SCANSTATE_TCP,SCANSTATE_SCTP,SCANSTATE_EXPR_SCTP_CHUNK>"length" { return LENGTH; } | |
| 542 |
1/2✓ Branch 0 (1492→1493) taken 86 times.
✗ Branch 1 (1492→1494) not taken.
|
86 | <SCANSTATE_EXPR_FRAG,SCANSTATE_IP>{ |
| 543 |
1/2✓ Branch 0 (1499→1500) taken 226 times.
✗ Branch 1 (1499→1501) not taken.
|
299 | "frag-off" { return FRAG_OFF; } |
| 544 | 73 | } | |
| 545 |
1/2✓ Branch 0 (1506→1507) taken 73 times.
✗ Branch 1 (1506→1508) not taken.
|
73 | <SCANSTATE_EXPR_OSF,SCANSTATE_IP>{ |
| 546 | 50 | "ttl" { return TTL; } | |
| 547 | 50 | } | |
| 548 |
1/2✓ Branch 0 (1513→1514) taken 50 times.
✗ Branch 1 (1513→1515) not taken.
|
50 | |
| 549 | <SCANSTATE_EXPR_OSF>{ | ||
| 550 | 3 | "loose" { return LOOSE; } | |
| 551 |
1/2✓ Branch 0 (1520→1521) taken 3 times.
✗ Branch 1 (1520→1522) not taken.
|
12 | "skip" { return SKIP; } |
| 552 | 9 | } | |
| 553 |
1/2✓ Branch 0 (1527→1528) taken 9 times.
✗ Branch 1 (1527→1529) not taken.
|
9 | |
| 554 | 470 | <SCANSTATE_CT,SCANSTATE_IP,SCANSTATE_META,SCANSTATE_TYPE,SCANSTATE_GRE>"protocol" { return PROTOCOL; } | |
| 555 |
1/2✓ Branch 0 (1534→1535) taken 470 times.
✗ Branch 1 (1534→1536) not taken.
|
470 | <SCANSTATE_EXPR_MH,SCANSTATE_EXPR_UDP,SCANSTATE_EXPR_UDPLITE,SCANSTATE_ICMP,SCANSTATE_IGMP,SCANSTATE_IP,SCANSTATE_SCTP,SCANSTATE_TCP>{ |
| 556 | 251 | "checksum" { return CHECKSUM; } | |
| 557 | 251 | } | |
| 558 |
1/2✓ Branch 0 (1541→1542) taken 251 times.
✗ Branch 1 (1541→1543) not taken.
|
251 | |
| 559 | <SCANSTATE_IP>{ | ||
| 560 | ✗ | "lsrr" { return LSRR; } | |
| 561 |
0/2✗ Branch 0 (1548→1549) not taken.
✗ Branch 1 (1548→1550) not taken.
|
1 | "rr" { return RR; } |
| 562 | ✗ | "ssrr" { return SSRR; } | |
| 563 |
1/2✓ Branch 0 (1555→1556) taken 1 times.
✗ Branch 1 (1555→1557) not taken.
|
7 | "ra" { return RA; } |
| 564 | ✗ | ||
| 565 |
1/2✓ Branch 0 (1569→1570) taken 6 times.
✗ Branch 1 (1569→1571) not taken.
|
6 | "ptr" { return PTR; } |
| 566 |
0/2✗ Branch 0 (1576→1577) not taken.
✗ Branch 1 (1576→1578) not taken.
|
6 | "value" { return VALUE; } |
| 567 | 6 | ||
| 568 |
1/2✓ Branch 0 (1583→1584) taken 6 times.
✗ Branch 1 (1583→1585) not taken.
|
13 | "option" { return OPTION; } |
| 569 |
1/2✓ Branch 0 (1590→1591) taken 7 times.
✗ Branch 1 (1590→1592) not taken.
|
27 | "options" { return OPTIONS; } |
| 570 | 20 | } | |
| 571 |
1/2✓ Branch 0 (1597→1598) taken 20 times.
✗ Branch 1 (1597→1599) not taken.
|
20 | |
| 572 | <SCANSTATE_TCP>{ | ||
| 573 | /* tcp header fields */ | ||
| 574 | 35 | "ackseq" { return ACKSEQ; } | |
| 575 |
1/2✓ Branch 0 (1604→1605) taken 35 times.
✗ Branch 1 (1604→1606) not taken.
|
40 | "doff" { return DOFF; } |
| 576 | 53 | "window" { return WINDOW; } | |
| 577 |
1/2✓ Branch 0 (1611→1612) taken 5 times.
✗ Branch 1 (1611→1613) not taken.
|
40 | "urgptr" { return URGPTR; } |
| 578 |
1/2✓ Branch 0 (1618→1619) taken 53 times.
✗ Branch 1 (1618→1620) not taken.
|
53 | |
| 579 |
1/2✓ Branch 0 (1625→1626) taken 35 times.
✗ Branch 1 (1625→1627) not taken.
|
35 | /* tcp option types */ |
| 580 | ✗ | "echo" { return ECHO; } | |
| 581 |
0/2✗ Branch 0 (1632→1633) not taken.
✗ Branch 1 (1632→1634) not taken.
|
9 | "eol" { return EOL; } |
| 582 | 28 | "maxseg" { return MSS; } | |
| 583 |
1/2✓ Branch 0 (1639→1640) taken 9 times.
✗ Branch 1 (1639→1641) not taken.
|
9 | "mss" { return MSS; } |
| 584 |
1/2✓ Branch 0 (1646→1647) taken 28 times.
✗ Branch 1 (1646→1648) not taken.
|
36 | "nop" { return NOP; } |
| 585 | ✗ | "noop" { return NOP; } | |
| 586 |
1/2✓ Branch 0 (1660→1661) taken 8 times.
✗ Branch 1 (1660→1662) not taken.
|
32 | "sack" { return SACK; } |
| 587 |
0/2✗ Branch 0 (1667→1668) not taken.
✗ Branch 1 (1667→1669) not taken.
|
6 | "sack0" { return SACK0; } |
| 588 |
1/2✓ Branch 0 (1674→1675) taken 24 times.
✗ Branch 1 (1674→1676) not taken.
|
30 | "sack1" { return SACK1; } |
| 589 |
1/2✓ Branch 0 (1681→1682) taken 6 times.
✗ Branch 1 (1681→1683) not taken.
|
12 | "sack2" { return SACK2; } |
| 590 |
1/2✓ Branch 0 (1688→1689) taken 6 times.
✗ Branch 1 (1688→1690) not taken.
|
12 | "sack3" { return SACK3; } |
| 591 |
1/2✓ Branch 0 (1695→1696) taken 6 times.
✗ Branch 1 (1695→1697) not taken.
|
6 | "sack-permitted" { return SACK_PERM; } |
| 592 |
1/2✓ Branch 0 (1702→1703) taken 6 times.
✗ Branch 1 (1702→1704) not taken.
|
16 | "sack-perm" { return SACK_PERM; } |
| 593 |
0/2✗ Branch 0 (1709→1710) not taken.
✗ Branch 1 (1709→1711) not taken.
|
12 | "timestamp" { return TIMESTAMP; } |
| 594 |
1/2✓ Branch 0 (1716→1717) taken 10 times.
✗ Branch 1 (1716→1718) not taken.
|
18 | "fastopen" { return FASTOPEN; } |
| 595 |
1/2✓ Branch 0 (1723→1724) taken 12 times.
✗ Branch 1 (1723→1725) not taken.
|
41 | "mptcp" { return MPTCP; } |
| 596 |
1/2✓ Branch 0 (1730→1731) taken 8 times.
✗ Branch 1 (1730→1732) not taken.
|
11 | "md5sig" { return MD5SIG; } |
| 597 |
1/2✓ Branch 0 (1737→1738) taken 29 times.
✗ Branch 1 (1737→1739) not taken.
|
29 | |
| 598 |
1/2✓ Branch 0 (1744→1745) taken 3 times.
✗ Branch 1 (1744→1746) not taken.
|
3 | /* tcp option fields */ |
| 599 | 24 | "left" { return LEFT; } | |
| 600 |
1/2✓ Branch 0 (1751→1752) taken 24 times.
✗ Branch 1 (1751→1753) not taken.
|
42 | "right" { return RIGHT; } |
| 601 | 3 | "count" { return COUNT; } | |
| 602 |
1/2✓ Branch 0 (1758→1759) taken 18 times.
✗ Branch 1 (1758→1760) not taken.
|
21 | "tsval" { return TSVAL; } |
| 603 |
1/2✓ Branch 0 (1765→1766) taken 3 times.
✗ Branch 1 (1765→1767) not taken.
|
6 | "tsecr" { return TSECR; } |
| 604 |
1/2✓ Branch 0 (1772→1773) taken 3 times.
✗ Branch 1 (1772→1774) not taken.
|
26 | "subtype" { return SUBTYPE; } |
| 605 |
1/2✓ Branch 0 (1779→1780) taken 3 times.
✗ Branch 1 (1779→1781) not taken.
|
3 | |
| 606 |
1/2✓ Branch 0 (1786→1787) taken 23 times.
✗ Branch 1 (1786→1788) not taken.
|
34 | "options" { return OPTIONS; } |
| 607 |
1/2✓ Branch 0 (1793→1794) taken 11 times.
✗ Branch 1 (1793→1795) not taken.
|
213 | "option" { return OPTION; } |
| 608 | 202 | } | |
| 609 |
1/2✓ Branch 0 (1800→1801) taken 202 times.
✗ Branch 1 (1800→1802) not taken.
|
309 | "time" { return TIME; } |
| 610 | 107 | ||
| 611 |
1/2✓ Branch 0 (1807→1808) taken 107 times.
✗ Branch 1 (1807→1809) not taken.
|
859 | "icmp" { scanner_push_start_cond(yyscanner, SCANSTATE_ICMP); return ICMP; } |
| 612 |
1/2✓ Branch 0 (1814→1815) taken 752 times.
✗ Branch 1 (1814→1816) not taken.
|
981 | "icmpv6" { scanner_push_start_cond(yyscanner, SCANSTATE_ICMP); return ICMP6; } |
| 613 | 229 | <SCANSTATE_ICMP>{ | |
| 614 |
1/2✓ Branch 0 (1822→1823) taken 229 times.
✗ Branch 1 (1822→1824) not taken.
|
237 | "gateway" { return GATEWAY; } |
| 615 | 16 | "code" { return CODE; } | |
| 616 |
1/2✓ Branch 0 (1830→1831) taken 8 times.
✗ Branch 1 (1830→1832) not taken.
|
8 | "param-problem" { return PPTR; } |
| 617 |
1/2✓ Branch 0 (1837→1838) taken 16 times.
✗ Branch 1 (1837→1839) not taken.
|
20 | "max-delay" { return MAXDELAY; } |
| 618 |
0/2✗ Branch 0 (1844→1845) not taken.
✗ Branch 1 (1844→1846) not taken.
|
17 | "mtu" { return MTU; } |
| 619 |
1/2✓ Branch 0 (1851→1852) taken 4 times.
✗ Branch 1 (1851→1853) not taken.
|
11 | "taddr" { return TADDR; } |
| 620 |
1/2✓ Branch 0 (1858→1859) taken 17 times.
✗ Branch 1 (1858→1860) not taken.
|
20 | "daddr" { return DADDR; } |
| 621 |
1/2✓ Branch 0 (1865→1866) taken 7 times.
✗ Branch 1 (1865→1867) not taken.
|
7 | } |
| 622 |
1/2✓ Branch 0 (1872→1873) taken 3 times.
✗ Branch 1 (1872→1874) not taken.
|
3 | <SCANSTATE_EXPR_AH,SCANSTATE_EXPR_ESP,SCANSTATE_ICMP,SCANSTATE_TCP>{ |
| 623 | 144 | "sequence" { return SEQUENCE; } | |
| 624 | 144 | } | |
| 625 |
1/2✓ Branch 0 (1879→1880) taken 144 times.
✗ Branch 1 (1879→1881) not taken.
|
144 | |
| 626 | 17 | "igmp" { scanner_push_start_cond(yyscanner, SCANSTATE_IGMP); return IGMP; } | |
| 627 |
1/2✓ Branch 0 (1886→1887) taken 17 times.
✗ Branch 1 (1886→1888) not taken.
|
17 | <SCANSTATE_IGMP>{ |
| 628 | 2 | "mrt" { return MRT; } | |
| 629 | ✗ | "group" { return GROUP; } | |
| 630 |
1/2✓ Branch 0 (1894→1895) taken 2 times.
✗ Branch 1 (1894→1896) not taken.
|
2 | } |
| 631 | ✗ | ||
| 632 | 8931 | "ip6" { scanner_push_start_cond(yyscanner, SCANSTATE_IP6); return IP6; } | |
| 633 |
1/2✓ Branch 0 (1908→1909) taken 8931 times.
✗ Branch 1 (1908→1910) not taken.
|
12060 | "priority" { return PRIORITY; } |
| 634 | 3129 | <SCANSTATE_IP6>{ | |
| 635 |
1/2✓ Branch 0 (1916→1917) taken 3129 times.
✗ Branch 1 (1916→1918) not taken.
|
3149 | "flowlabel" { return FLOWLABEL; } |
| 636 | 28 | "hoplimit" { return HOPLIMIT; } | |
| 637 |
1/2✓ Branch 0 (1923→1924) taken 20 times.
✗ Branch 1 (1923→1925) not taken.
|
20 | } |
| 638 |
1/2✓ Branch 0 (1930→1931) taken 28 times.
✗ Branch 1 (1930→1932) not taken.
|
28 | <SCANSTATE_EXPR_AH,SCANSTATE_EXPR_COMP,SCANSTATE_EXPR_DST,SCANSTATE_EXPR_FRAG,SCANSTATE_EXPR_HBH,SCANSTATE_EXPR_MH,SCANSTATE_EXPR_RT,SCANSTATE_IP6>{ |
| 639 | 262 | "nexthdr" { return NEXTHDR; } | |
| 640 | 262 | } | |
| 641 |
1/2✓ Branch 0 (1937→1938) taken 262 times.
✗ Branch 1 (1937→1939) not taken.
|
262 | |
| 642 | 154 | "ah" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_AH); return AH; } | |
| 643 |
1/2✓ Branch 0 (1944→1945) taken 154 times.
✗ Branch 1 (1944→1946) not taken.
|
154 | <SCANSTATE_EXPR_AH,SCANSTATE_EXPR_FRAG,SCANSTATE_EXPR_MH,SCANSTATE_TCP>{ |
| 644 | 66 | "reserved" { return RESERVED; } | |
| 645 | 66 | } | |
| 646 |
1/2✓ Branch 0 (1952→1953) taken 66 times.
✗ Branch 1 (1952→1954) not taken.
|
129 | <SCANSTATE_EXPR_AH,SCANSTATE_EXPR_ESP,SCANSTATE_EXPR_IPSEC>"spi" { return SPI; } |
| 647 | 63 | ||
| 648 |
1/2✓ Branch 0 (1959→1960) taken 63 times.
✗ Branch 1 (1959→1961) not taken.
|
169 | "esp" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_ESP); return ESP; } |
| 649 |
1/2✓ Branch 0 (1966→1967) taken 106 times.
✗ Branch 1 (1966→1968) not taken.
|
106 | |
| 650 | 101 | "comp" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_COMP); return COMP; } | |
| 651 |
1/2✓ Branch 0 (1974→1975) taken 101 times.
✗ Branch 1 (1974→1976) not taken.
|
101 | <SCANSTATE_EXPR_COMP>{ |
| 652 | 30 | "cpi" { return CPI; } | |
| 653 | 30 | } | |
| 654 |
1/2✓ Branch 0 (1982→1983) taken 30 times.
✗ Branch 1 (1982→1984) not taken.
|
2180 | "flags" { return FLAGS; } |
| 655 | 2150 | ||
| 656 |
1/2✓ Branch 0 (1989→1990) taken 2150 times.
✗ Branch 1 (1989→1991) not taken.
|
3539 | "udp" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_UDP); return UDP; } |
| 657 |
1/2✓ Branch 0 (1996→1997) taken 1389 times.
✗ Branch 1 (1996→1998) not taken.
|
1529 | "udplite" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_UDPLITE); return UDPLITE; } |
| 658 | 140 | <SCANSTATE_EXPR_UDPLITE>{ | |
| 659 |
1/2✓ Branch 0 (2004→2005) taken 140 times.
✗ Branch 1 (2004→2006) not taken.
|
140 | "csumcov" { return CSUMCOV; } |
| 660 | ✗ | } | |
| 661 | ✗ | <SCANSTATE_EXPR_DCCP,SCANSTATE_SCTP,SCANSTATE_TCP,SCANSTATE_EXPR_TH,SCANSTATE_EXPR_UDP,SCANSTATE_EXPR_UDPLITE>{ | |
| 662 | 277 | "sport" { return SPORT; } | |
| 663 | 277 | } | |
| 664 |
1/2✓ Branch 0 (2019→2020) taken 277 times.
✗ Branch 1 (2019→2021) not taken.
|
277 | <SCANSTATE_CT,SCANSTATE_EXPR_DCCP,SCANSTATE_SCTP,SCANSTATE_TCP,SCANSTATE_EXPR_TH,SCANSTATE_EXPR_UDP,SCANSTATE_EXPR_UDPLITE>{ |
| 665 | 1703 | "dport" { return DPORT; } | |
| 666 | 1703 | } | |
| 667 |
1/2✓ Branch 0 (2026→2027) taken 1703 times.
✗ Branch 1 (2026→2028) not taken.
|
1703 | <SCANSTATE_EXPR_DCCP>{ |
| 668 | ✗ | "option" { return OPTION; } | |
| 669 | ✗ | } | |
| 670 | ✗ | ||
| 671 | 85 | "vxlan" { return VXLAN; } | |
| 672 |
1/2✓ Branch 0 (2040→2041) taken 85 times.
✗ Branch 1 (2040→2042) not taken.
|
105 | "vni" { return VNI; } |
| 673 | 20 | ||
| 674 |
1/2✓ Branch 0 (2047→2048) taken 20 times.
✗ Branch 1 (2047→2049) not taken.
|
89 | "geneve" { return GENEVE; } |
| 675 |
1/2✓ Branch 0 (2054→2055) taken 69 times.
✗ Branch 1 (2054→2056) not taken.
|
69 | |
| 676 | 60 | "gre" { scanner_push_start_cond(yyscanner, SCANSTATE_GRE); return GRE; } | |
| 677 |
1/2✓ Branch 0 (2061→2062) taken 60 times.
✗ Branch 1 (2061→2063) not taken.
|
115 | "gretap" { scanner_push_start_cond(yyscanner, SCANSTATE_GRE); return GRETAP; } |
| 678 | 55 | ||
| 679 |
1/2✓ Branch 0 (2069→2070) taken 55 times.
✗ Branch 1 (2069→2071) not taken.
|
2508 | "tcp" { scanner_push_start_cond(yyscanner, SCANSTATE_TCP); return TCP; } |
| 680 |
1/2✓ Branch 0 (2077→2078) taken 2453 times.
✗ Branch 1 (2077→2079) not taken.
|
2453 | |
| 681 | 95 | "dccp" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_DCCP); return DCCP; } | |
| 682 |
1/2✓ Branch 0 (2085→2086) taken 95 times.
✗ Branch 1 (2085→2087) not taken.
|
95 | |
| 683 | 648 | "sctp" { scanner_push_start_cond(yyscanner, SCANSTATE_SCTP); return SCTP; } | |
| 684 |
1/2✓ Branch 0 (2093→2094) taken 648 times.
✗ Branch 1 (2093→2095) not taken.
|
648 | |
| 685 | <SCANSTATE_SCTP>{ | ||
| 686 | 160 | "chunk" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_SCTP_CHUNK); return CHUNK; } | |
| 687 |
1/2✓ Branch 0 (2101→2102) taken 160 times.
✗ Branch 1 (2101→2103) not taken.
|
190 | "vtag" { return VTAG; } |
| 688 | 30 | } | |
| 689 |
1/2✓ Branch 0 (2109→2110) taken 30 times.
✗ Branch 1 (2109→2111) not taken.
|
30 | |
| 690 | <SCANSTATE_EXPR_SCTP_CHUNK>{ | ||
| 691 | 15 | "data" { return DATA; } | |
| 692 |
1/2✓ Branch 0 (2116→2117) taken 15 times.
✗ Branch 1 (2116→2118) not taken.
|
35 | "init" { return INIT; } |
| 693 | 15 | "init-ack" { return INIT_ACK; } | |
| 694 |
1/2✓ Branch 0 (2123→2124) taken 20 times.
✗ Branch 1 (2123→2125) not taken.
|
25 | "heartbeat" { return HEARTBEAT; } |
| 695 |
1/2✓ Branch 0 (2130→2131) taken 15 times.
✗ Branch 1 (2130→2132) not taken.
|
20 | "heartbeat-ack" { return HEARTBEAT_ACK; } |
| 696 |
1/2✓ Branch 0 (2137→2138) taken 5 times.
✗ Branch 1 (2137→2139) not taken.
|
10 | "abort" { return ABORT; } |
| 697 |
1/2✓ Branch 0 (2144→2145) taken 5 times.
✗ Branch 1 (2144→2146) not taken.
|
15 | "shutdown" { return SHUTDOWN; } |
| 698 |
1/2✓ Branch 0 (2151→2152) taken 5 times.
✗ Branch 1 (2151→2153) not taken.
|
10 | "shutdown-ack" { return SHUTDOWN_ACK; } |
| 699 |
1/2✓ Branch 0 (2158→2159) taken 10 times.
✗ Branch 1 (2158→2160) not taken.
|
15 | "error" { return ERROR; } |
| 700 |
1/2✓ Branch 0 (2165→2166) taken 5 times.
✗ Branch 1 (2165→2167) not taken.
|
10 | "cookie-echo" { return COOKIE_ECHO; } |
| 701 |
1/2✓ Branch 0 (2172→2173) taken 5 times.
✗ Branch 1 (2172→2174) not taken.
|
10 | "cookie-ack" { return COOKIE_ACK; } |
| 702 |
1/2✓ Branch 0 (2179→2180) taken 5 times.
✗ Branch 1 (2179→2181) not taken.
|
15 | "ecne" { return ECNE; } |
| 703 |
1/2✓ Branch 0 (2186→2187) taken 5 times.
✗ Branch 1 (2186→2188) not taken.
|
15 | "cwr" { return CWR; } |
| 704 |
1/2✓ Branch 0 (2193→2194) taken 10 times.
✗ Branch 1 (2193→2195) not taken.
|
15 | "shutdown-complete" { return SHUTDOWN_COMPLETE; } |
| 705 |
1/2✓ Branch 0 (2200→2201) taken 10 times.
✗ Branch 1 (2200→2202) not taken.
|
20 | "asconf-ack" { return ASCONF_ACK; } |
| 706 |
1/2✓ Branch 0 (2207→2208) taken 5 times.
✗ Branch 1 (2207→2209) not taken.
|
15 | "forward-tsn" { return FORWARD_TSN; } |
| 707 |
1/2✓ Branch 0 (2214→2215) taken 10 times.
✗ Branch 1 (2214→2216) not taken.
|
20 | "asconf" { return ASCONF; } |
| 708 |
1/2✓ Branch 0 (2221→2222) taken 10 times.
✗ Branch 1 (2221→2223) not taken.
|
10 | |
| 709 |
1/2✓ Branch 0 (2228→2229) taken 10 times.
✗ Branch 1 (2228→2230) not taken.
|
10 | "tsn" { return TSN; } |
| 710 |
0/2✗ Branch 0 (2235→2236) not taken.
✗ Branch 1 (2235→2237) not taken.
|
10 | "sack" { return SACK; } |
| 711 | 5 | "stream" { return STREAM; } | |
| 712 |
1/2✓ Branch 0 (2242→2243) taken 10 times.
✗ Branch 1 (2242→2244) not taken.
|
10 | "ssn" { return SSN; } |
| 713 |
1/2✓ Branch 0 (2249→2250) taken 5 times.
✗ Branch 1 (2249→2251) not taken.
|
5 | "ppid" { return PPID; } |
| 714 | ✗ | "init-tag" { return INIT_TAG; } | |
| 715 |
0/2✗ Branch 0 (2263→2264) not taken.
✗ Branch 1 (2263→2265) not taken.
|
5 | "a-rwnd" { return A_RWND; } |
| 716 |
0/2✗ Branch 0 (2270→2271) not taken.
✗ Branch 1 (2270→2272) not taken.
|
5 | "num-outbound-streams" { return NUM_OSTREAMS; } |
| 717 |
1/2✓ Branch 0 (2277→2278) taken 5 times.
✗ Branch 1 (2277→2279) not taken.
|
9 | "num-inbound-streams" { return NUM_ISTREAMS; } |
| 718 |
1/2✓ Branch 0 (2284→2285) taken 5 times.
✗ Branch 1 (2284→2286) not taken.
|
10 | "initial-tsn" { return INIT_TSN; } |
| 719 |
1/2✓ Branch 0 (2291→2292) taken 4 times.
✗ Branch 1 (2291→2293) not taken.
|
9 | "cum-tsn-ack" { return CUM_TSN_ACK; } |
| 720 |
1/2✓ Branch 0 (2298→2299) taken 5 times.
✗ Branch 1 (2298→2300) not taken.
|
5 | "num-gap-ack-blocks" { return NUM_GACK_BLOCKS; } |
| 721 |
1/2✓ Branch 0 (2305→2306) taken 5 times.
✗ Branch 1 (2305→2307) not taken.
|
5 | "num-dup-tsns" { return NUM_DUP_TSNS; } |
| 722 |
0/2✗ Branch 0 (2312→2313) not taken.
✗ Branch 1 (2312→2314) not taken.
|
10 | "lowest-tsn" { return LOWEST_TSN; } |
| 723 |
0/2✗ Branch 0 (2319→2320) not taken.
✗ Branch 1 (2319→2321) not taken.
|
10 | "seqno" { return SEQNO; } |
| 724 |
1/2✓ Branch 0 (2326→2327) taken 10 times.
✗ Branch 1 (2326→2328) not taken.
|
15 | "new-cum-tsn" { return NEW_CUM_TSN; } |
| 725 |
1/2✓ Branch 0 (2333→2334) taken 10 times.
✗ Branch 1 (2333→2335) not taken.
|
10 | } |
| 726 |
1/2✓ Branch 0 (2340→2341) taken 5 times.
✗ Branch 1 (2340→2342) not taken.
|
5 | |
| 727 | 100 | "rt" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_RT); return RT; } | |
| 728 |
1/2✓ Branch 0 (2347→2348) taken 100 times.
✗ Branch 1 (2347→2349) not taken.
|
100 | "rt0" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_RT); return RT0; } |
| 729 | ✗ | "rt2" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_RT); return RT2; } | |
| 730 |
0/2✗ Branch 0 (2355→2356) not taken.
✗ Branch 1 (2355→2357) not taken.
|
15 | "srh" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_RT); return RT4; } |
| 731 |
0/2✗ Branch 0 (2363→2364) not taken.
✗ Branch 1 (2363→2365) not taken.
|
13 | <SCANSTATE_EXPR_RT,SCANSTATE_STMT_NAT,SCANSTATE_IP,SCANSTATE_IP6>"addr" { return ADDR; } |
| 732 |
1/2✓ Branch 0 (2371→2372) taken 15 times.
✗ Branch 1 (2371→2373) not taken.
|
15 | |
| 733 |
1/2✓ Branch 0 (2379→2380) taken 13 times.
✗ Branch 1 (2379→2381) not taken.
|
65 | "hbh" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_HBH); return HBH; } |
| 734 |
1/2✓ Branch 0 (2386→2387) taken 52 times.
✗ Branch 1 (2386→2388) not taken.
|
52 | |
| 735 | 141 | "frag" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_FRAG); return FRAG; } | |
| 736 |
1/2✓ Branch 0 (2394→2395) taken 141 times.
✗ Branch 1 (2394→2396) not taken.
|
141 | <SCANSTATE_EXPR_FRAG>{ |
| 737 | 4 | "reserved2" { return RESERVED2; } | |
| 738 | 8 | "more-fragments" { return MORE_FRAGMENTS; } | |
| 739 |
1/2✓ Branch 0 (2402→2403) taken 4 times.
✗ Branch 1 (2402→2404) not taken.
|
4 | } |
| 740 |
1/2✓ Branch 0 (2409→2410) taken 8 times.
✗ Branch 1 (2409→2411) not taken.
|
8 | |
| 741 | 39 | "dst" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_DST); return DST; } | |
| 742 |
1/2✓ Branch 0 (2416→2417) taken 39 times.
✗ Branch 1 (2416→2418) not taken.
|
39 | |
| 743 | 75 | "mh" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_MH); return MH; } | |
| 744 |
1/2✓ Branch 0 (2424→2425) taken 75 times.
✗ Branch 1 (2424→2426) not taken.
|
75 | |
| 745 | 2659 | "meta" { scanner_push_start_cond(yyscanner, SCANSTATE_META); return META; } | |
| 746 |
1/2✓ Branch 0 (2432→2433) taken 2659 times.
✗ Branch 1 (2432→2434) not taken.
|
3988 | "mark" { return MARK; } |
| 747 | 246 | "iif" { return IIF; } | |
| 748 |
1/2✓ Branch 0 (2440→2441) taken 1329 times.
✗ Branch 1 (2440→2442) not taken.
|
41717 | "iifname" { return IIFNAME; } |
| 749 |
1/2✓ Branch 0 (2447→2448) taken 246 times.
✗ Branch 1 (2447→2449) not taken.
|
300 | "iiftype" { return IIFTYPE; } |
| 750 |
1/2✓ Branch 0 (2454→2455) taken 40388 times.
✗ Branch 1 (2454→2456) not taken.
|
40529 | "oif" { return OIF; } |
| 751 |
1/2✓ Branch 0 (2461→2462) taken 54 times.
✗ Branch 1 (2461→2463) not taken.
|
243 | "oifname" { return OIFNAME; } |
| 752 |
1/2✓ Branch 0 (2468→2469) taken 141 times.
✗ Branch 1 (2468→2470) not taken.
|
169 | "oiftype" { return OIFTYPE; } |
| 753 |
1/2✓ Branch 0 (2475→2476) taken 189 times.
✗ Branch 1 (2475→2477) not taken.
|
332 | "skuid" { return SKUID; } |
| 754 |
1/2✓ Branch 0 (2482→2483) taken 28 times.
✗ Branch 1 (2482→2484) not taken.
|
147 | "skgid" { return SKGID; } |
| 755 |
1/2✓ Branch 0 (2489→2490) taken 143 times.
✗ Branch 1 (2489→2491) not taken.
|
147 | "nftrace" { return NFTRACE; } |
| 756 |
1/2✓ Branch 0 (2496→2497) taken 119 times.
✗ Branch 1 (2496→2498) not taken.
|
126 | "rtclassid" { return RTCLASSID; } |
| 757 |
1/2✓ Branch 0 (2503→2504) taken 4 times.
✗ Branch 1 (2503→2505) not taken.
|
4 | "ibriport" { return IBRIPORT; } |
| 758 |
1/2✓ Branch 0 (2510→2511) taken 7 times.
✗ Branch 1 (2510→2512) not taken.
|
10 | "ibrname" { return IBRIDGENAME; } |
| 759 | ✗ | "obriport" { return OBRIPORT; } | |
| 760 |
1/2✓ Branch 0 (2524→2525) taken 3 times.
✗ Branch 1 (2524→2526) not taken.
|
6 | "obrname" { return OBRIDGENAME; } |
| 761 |
0/2✗ Branch 0 (2531→2532) not taken.
✗ Branch 1 (2531→2533) not taken.
|
76 | "pkttype" { return PKTTYPE; } |
| 762 |
1/2✓ Branch 0 (2538→2539) taken 3 times.
✗ Branch 1 (2538→2540) not taken.
|
59 | "cpu" { return CPU; } |
| 763 |
1/2✓ Branch 0 (2545→2546) taken 76 times.
✗ Branch 1 (2545→2547) not taken.
|
226 | "iifgroup" { return IIFGROUP; } |
| 764 |
1/2✓ Branch 0 (2552→2553) taken 56 times.
✗ Branch 1 (2552→2554) not taken.
|
198 | "oifgroup" { return OIFGROUP; } |
| 765 |
1/2✓ Branch 0 (2559→2560) taken 150 times.
✗ Branch 1 (2559→2561) not taken.
|
192 | "cgroup" { return CGROUP; } |
| 766 |
1/2✓ Branch 0 (2566→2567) taken 142 times.
✗ Branch 1 (2566→2568) not taken.
|
142 | |
| 767 |
1/2✓ Branch 0 (2573→2574) taken 42 times.
✗ Branch 1 (2573→2575) not taken.
|
42 | <SCANSTATE_EXPR_RT>{ |
| 768 | 13 | "nexthop" { return NEXTHOP; } | |
| 769 |
1/2✓ Branch 0 (2580→2581) taken 13 times.
✗ Branch 1 (2580→2582) not taken.
|
25 | "seg-left" { return SEG_LEFT; } |
| 770 | 5 | "mtu" { return MTU; } | |
| 771 |
1/2✓ Branch 0 (2587→2588) taken 12 times.
✗ Branch 1 (2587→2589) not taken.
|
16 | "last-entry" { return LAST_ENT; } |
| 772 |
1/2✓ Branch 0 (2594→2595) taken 5 times.
✗ Branch 1 (2594→2596) not taken.
|
10 | "tag" { return TAG; } |
| 773 |
1/2✓ Branch 0 (2601→2602) taken 4 times.
✗ Branch 1 (2601→2603) not taken.
|
6 | "sid" { return SID; } |
| 774 |
1/2✓ Branch 0 (2608→2609) taken 5 times.
✗ Branch 1 (2608→2610) not taken.
|
5 | } |
| 775 |
1/2✓ Branch 0 (2615→2616) taken 2 times.
✗ Branch 1 (2615→2617) not taken.
|
2 | <SCANSTATE_EXPR_RT,SCANSTATE_TYPE>{ |
| 776 | 7 | "classid" { return CLASSID; } | |
| 777 | 7 | } | |
| 778 |
1/2✓ Branch 0 (2622→2623) taken 7 times.
✗ Branch 1 (2622→2624) not taken.
|
7 | |
| 779 | 1005 | "ct" { scanner_push_start_cond(yyscanner, SCANSTATE_CT); return CT; } | |
| 780 |
1/2✓ Branch 0 (2629→2630) taken 1005 times.
✗ Branch 1 (2629→2631) not taken.
|
1005 | <SCANSTATE_CT>{ |
| 781 | 6 | "avgpkt" { return AVGPKT; } | |
| 782 | 44 | "l3proto" { return L3PROTOCOL; } | |
| 783 |
1/2✓ Branch 0 (2637→2638) taken 6 times.
✗ Branch 1 (2637→2639) not taken.
|
8 | "proto-src" { return PROTO_SRC; } |
| 784 |
1/2✓ Branch 0 (2644→2645) taken 44 times.
✗ Branch 1 (2644→2646) not taken.
|
51 | "proto-dst" { return PROTO_DST; } |
| 785 |
1/2✓ Branch 0 (2651→2652) taken 2 times.
✗ Branch 1 (2651→2653) not taken.
|
45 | "zone" { return ZONE; } |
| 786 |
1/2✓ Branch 0 (2658→2659) taken 7 times.
✗ Branch 1 (2658→2660) not taken.
|
64 | "original" { return ORIGINAL; } |
| 787 |
1/2✓ Branch 0 (2665→2666) taken 43 times.
✗ Branch 1 (2665→2667) not taken.
|
62 | "reply" { return REPLY; } |
| 788 |
1/2✓ Branch 0 (2672→2673) taken 57 times.
✗ Branch 1 (2672→2674) not taken.
|
81 | "direction" { return DIRECTION; } |
| 789 |
1/2✓ Branch 0 (2679→2680) taken 19 times.
✗ Branch 1 (2679→2681) not taken.
|
49 | "event" { return EVENT; } |
| 790 |
1/2✓ Branch 0 (2686→2687) taken 24 times.
✗ Branch 1 (2686→2688) not taken.
|
68 | "expectation" { return EXPECTATION; } |
| 791 |
1/2✓ Branch 0 (2693→2694) taken 30 times.
✗ Branch 1 (2693→2695) not taken.
|
93 | "expiration" { return EXPIRATION; } |
| 792 |
1/2✓ Branch 0 (2700→2701) taken 44 times.
✗ Branch 1 (2700→2702) not taken.
|
119 | "helper" { return HELPER; } |
| 793 |
1/2✓ Branch 0 (2707→2708) taken 63 times.
✗ Branch 1 (2707→2709) not taken.
|
63 | "helpers" { return HELPERS; } |
| 794 |
1/2✓ Branch 0 (2714→2715) taken 75 times.
✗ Branch 1 (2714→2716) not taken.
|
96 | "label" { return LABEL; } |
| 795 |
0/2✗ Branch 0 (2721→2722) not taken.
✗ Branch 1 (2721→2723) not taken.
|
256 | "state" { return STATE; } |
| 796 |
1/2✓ Branch 0 (2728→2729) taken 21 times.
✗ Branch 1 (2728→2730) not taken.
|
60 | "status" { return STATUS; } |
| 797 |
1/2✓ Branch 0 (2735→2736) taken 256 times.
✗ Branch 1 (2735→2737) not taken.
|
274 | "count" { return COUNT; } |
| 798 |
1/2✓ Branch 0 (2742→2743) taken 39 times.
✗ Branch 1 (2742→2744) not taken.
|
39 | } |
| 799 |
1/2✓ Branch 0 (2749→2750) taken 18 times.
✗ Branch 1 (2749→2751) not taken.
|
18 | |
| 800 | 46 | "numgen" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_NUMGEN); return NUMGEN; } | |
| 801 |
1/2✓ Branch 0 (2756→2757) taken 46 times.
✗ Branch 1 (2756→2758) not taken.
|
46 | <SCANSTATE_EXPR_NUMGEN>{ |
| 802 | 46 | "inc" { return INC; } | |
| 803 | 46 | } | |
| 804 |
1/2✓ Branch 0 (2764→2765) taken 46 times.
✗ Branch 1 (2764→2766) not taken.
|
46 | |
| 805 | 12 | "jhash" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_HASH); return JHASH; } | |
| 806 |
1/2✓ Branch 0 (2771→2772) taken 12 times.
✗ Branch 1 (2771→2773) not taken.
|
36 | "symhash" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_HASH); return SYMHASH; } |
| 807 | 24 | ||
| 808 |
1/2✓ Branch 0 (2779→2780) taken 24 times.
✗ Branch 1 (2779→2781) not taken.
|
24 | <SCANSTATE_EXPR_HASH>{ |
| 809 | 4 | "seed" { return SEED; } | |
| 810 |
1/2✓ Branch 0 (2787→2788) taken 4 times.
✗ Branch 1 (2787→2789) not taken.
|
4 | } |
| 811 | <SCANSTATE_EXPR_HASH,SCANSTATE_EXPR_NUMGEN>{ | ||
| 812 | 82 | "mod" { return MOD; } | |
| 813 | 10 | "offset" { return OFFSET; } | |
| 814 |
1/2✓ Branch 0 (2794→2795) taken 82 times.
✗ Branch 1 (2794→2796) not taken.
|
82 | } |
| 815 |
1/2✓ Branch 0 (2801→2802) taken 10 times.
✗ Branch 1 (2801→2803) not taken.
|
22 | "dup" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_DUP); return DUP; } |
| 816 | 7 | "fwd" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_FWD); return FWD; } | |
| 817 |
1/2✓ Branch 0 (2808→2809) taken 12 times.
✗ Branch 1 (2808→2810) not taken.
|
12 | |
| 818 |
1/2✓ Branch 0 (2816→2817) taken 7 times.
✗ Branch 1 (2816→2818) not taken.
|
53 | "fib" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_FIB); return FIB; } |
| 819 |
1/2✓ Branch 0 (2824→2825) taken 46 times.
✗ Branch 1 (2824→2826) not taken.
|
46 | |
| 820 | <SCANSTATE_EXPR_FIB>{ | ||
| 821 | 13 | "check" { return CHECK; } | |
| 822 |
1/2✓ Branch 0 (2832→2833) taken 13 times.
✗ Branch 1 (2832→2834) not taken.
|
13 | } |
| 823 | |||
| 824 | 45 | "osf" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_OSF); return OSF; } | |
| 825 |
1/2✓ Branch 0 (2839→2840) taken 45 times.
✗ Branch 1 (2839→2841) not taken.
|
45 | |
| 826 | 42 | "synproxy" { scanner_push_start_cond(yyscanner, SCANSTATE_STMT_SYNPROXY); return SYNPROXY; } | |
| 827 |
1/2✓ Branch 0 (2847→2848) taken 42 times.
✗ Branch 1 (2847→2849) not taken.
|
42 | <SCANSTATE_STMT_SYNPROXY>{ |
| 828 | 18 | "wscale" { return WSCALE; } | |
| 829 | ✗ | "maxseg" { return MSS; } | |
| 830 |
1/2✓ Branch 0 (2855→2856) taken 18 times.
✗ Branch 1 (2855→2857) not taken.
|
36 | "mss" { return MSS; } |
| 831 |
0/2✗ Branch 0 (2862→2863) not taken.
✗ Branch 1 (2862→2864) not taken.
|
15 | "timestamp" { return TIMESTAMP; } |
| 832 |
1/2✓ Branch 0 (2869→2870) taken 18 times.
✗ Branch 1 (2869→2871) not taken.
|
18 | "sack-permitted" { return SACK_PERM; } |
| 833 |
1/2✓ Branch 0 (2876→2877) taken 15 times.
✗ Branch 1 (2876→2878) not taken.
|
32 | "sack-perm" { return SACK_PERM; } |
| 834 | ✗ | } | |
| 835 |
1/2✓ Branch 0 (2890→2891) taken 17 times.
✗ Branch 1 (2890→2892) not taken.
|
17 | |
| 836 | 18 | "tunnel" { scanner_push_start_cond(yyscanner, SCANSTATE_TUNNEL); return TUNNEL; } | |
| 837 |
1/2✓ Branch 0 (2897→2898) taken 18 times.
✗ Branch 1 (2897→2899) not taken.
|
18 | <SCANSTATE_TUNNEL>{ |
| 838 | 12 | "id" { return ID; } | |
| 839 | 9 | "sport" { return SPORT; } | |
| 840 |
1/2✓ Branch 0 (2905→2906) taken 12 times.
✗ Branch 1 (2905→2907) not taken.
|
21 | "dport" { return DPORT; } |
| 841 |
1/2✓ Branch 0 (2912→2913) taken 9 times.
✗ Branch 1 (2912→2914) not taken.
|
18 | "ttl" { return TTL; } |
| 842 |
1/2✓ Branch 0 (2919→2920) taken 9 times.
✗ Branch 1 (2919→2921) not taken.
|
17 | "tos" { return TOS; } |
| 843 |
1/2✓ Branch 0 (2926→2927) taken 9 times.
✗ Branch 1 (2926→2928) not taken.
|
13 | "version" { return HDRVERSION; } |
| 844 |
1/2✓ Branch 0 (2933→2934) taken 8 times.
✗ Branch 1 (2933→2935) not taken.
|
10 | "direction" { return DIRECTION; } |
| 845 |
1/2✓ Branch 0 (2940→2941) taken 4 times.
✗ Branch 1 (2940→2942) not taken.
|
8 | "erspan" { return ERSPAN; } |
| 846 |
1/2✓ Branch 0 (2947→2948) taken 2 times.
✗ Branch 1 (2947→2949) not taken.
|
2 | "egress" { return EGRESS; } |
| 847 |
1/2✓ Branch 0 (2954→2955) taken 4 times.
✗ Branch 1 (2954→2956) not taken.
|
6 | "ingress" { return INGRESS; } |
| 848 |
0/2✗ Branch 0 (2961→2962) not taken.
✗ Branch 1 (2961→2963) not taken.
|
2 | "path" { return PATH; } |
| 849 |
1/2✓ Branch 0 (2968→2969) taken 2 times.
✗ Branch 1 (2968→2970) not taken.
|
5 | "gbp" { return GBP; } |
| 850 |
1/2✓ Branch 0 (2975→2976) taken 2 times.
✗ Branch 1 (2975→2977) not taken.
|
12 | "class" { return CLASS; } |
| 851 |
1/2✓ Branch 0 (2982→2983) taken 3 times.
✗ Branch 1 (2982→2984) not taken.
|
13 | "opt-type" { return OPTTYPE; } |
| 852 |
1/2✓ Branch 0 (2989→2990) taken 10 times.
✗ Branch 1 (2989→2991) not taken.
|
20 | "data" { return DATA; } |
| 853 |
1/2✓ Branch 0 (2996→2997) taken 10 times.
✗ Branch 1 (2996→2998) not taken.
|
10 | } |
| 854 |
1/2✓ Branch 0 (3003→3004) taken 10 times.
✗ Branch 1 (3003→3005) not taken.
|
10 | |
| 855 | 3 | "notrack" { return NOTRACK; } | |
| 856 |
1/2✓ Branch 0 (3010→3011) taken 3 times.
✗ Branch 1 (3010→3012) not taken.
|
3 | |
| 857 | 22 | "all" { return ALL; } | |
| 858 |
1/2✓ Branch 0 (3017→3018) taken 22 times.
✗ Branch 1 (3017→3019) not taken.
|
22 | |
| 859 | <SCANSTATE_CMD_EXPORT,SCANSTATE_CMD_IMPORT,SCANSTATE_CMD_MONITOR>{ | ||
| 860 | ✗ | "xml" { return XML; } | |
| 861 | ✗ | "json" { return JSON; } | |
| 862 | ✗ | "vm" { return VM; } | |
| 863 | ✗ | } | |
| 864 | ✗ | ||
| 865 | 155 | "exists" { return EXISTS; } | |
| 866 |
1/2✓ Branch 0 (3045→3046) taken 155 times.
✗ Branch 1 (3045→3047) not taken.
|
183 | "missing" { return MISSING; } |
| 867 | 28 | ||
| 868 |
1/2✓ Branch 0 (3052→3053) taken 28 times.
✗ Branch 1 (3052→3054) not taken.
|
44 | "exthdr" { return EXTHDR; } |
| 869 |
1/2✓ Branch 0 (3059→3060) taken 16 times.
✗ Branch 1 (3059→3061) not taken.
|
16 | |
| 870 | 70 | "ipsec" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_IPSEC); return IPSEC; } | |
| 871 |
1/2✓ Branch 0 (3066→3067) taken 70 times.
✗ Branch 1 (3066→3068) not taken.
|
70 | <SCANSTATE_EXPR_IPSEC>{ |
| 872 | 35 | "reqid" { return REQID; } | |
| 873 | 12 | "spnum" { return SPNUM; } | |
| 874 |
1/2✓ Branch 0 (3074→3075) taken 35 times.
✗ Branch 1 (3074→3076) not taken.
|
35 | |
| 875 |
1/2✓ Branch 0 (3081→3082) taken 12 times.
✗ Branch 1 (3081→3083) not taken.
|
47 | "in" { return IN; } |
| 876 |
1/2✓ Branch 0 (3088→3089) taken 35 times.
✗ Branch 1 (3088→3090) not taken.
|
53 | "out" { return OUT; } |
| 877 | 18 | } | |
| 878 |
1/2✓ Branch 0 (3095→3096) taken 18 times.
✗ Branch 1 (3095→3097) not taken.
|
18 | |
| 879 | <SCANSTATE_TYPE>{ | ||
| 880 | 2821 | "filter" { return FILTER; } | |
| 881 |
1/2✓ Branch 0 (3102→3103) taken 2821 times.
✗ Branch 1 (3102→3104) not taken.
|
2925 | "nat" { return NAT; } |
| 882 | 6 | "route" { return ROUTE; } | |
| 883 |
1/2✓ Branch 0 (3109→3110) taken 104 times.
✗ Branch 1 (3109→3111) not taken.
|
104 | } |
| 884 |
1/2✓ Branch 0 (3116→3117) taken 6 times.
✗ Branch 1 (3116→3118) not taken.
|
6 | |
| 885 | 12 | "secmark" { scanner_push_start_cond(yyscanner, SCANSTATE_SECMARK); return SECMARK; } | |
| 886 |
1/2✓ Branch 0 (3123→3124) taken 12 times.
✗ Branch 1 (3123→3125) not taken.
|
12 | |
| 887 | ✗ | "xt" { scanner_push_start_cond(yyscanner, SCANSTATE_XT); return XT; } | |
| 888 | ✗ | ||
| 889 | 797468 | {addrstring} { | |
| 890 |
1/2✓ Branch 0 (3139→3140) taken 797468 times.
✗ Branch 1 (3139→3141) not taken.
|
797468 | yylval->string = xstrdup(yytext); |
| 891 | 797468 | return STRING; | |
| 892 | } | ||
| 893 | |||
| 894 | 38 | {ip6addr_rfc2732} { | |
| 895 |
1/2✓ Branch 0 (3147→3148) taken 38 times.
✗ Branch 1 (3147→3149) not taken.
|
38 | yytext[yyleng - 1] = '\0'; |
| 896 | 38 | yylval->string = xstrdup(yytext + 1); | |
| 897 | 38 | return STRING; | |
| 898 | } | ||
| 899 | |||
| 900 | 213932 | {timestring} { | |
| 901 |
1/2✓ Branch 0 (3155→3156) taken 213932 times.
✗ Branch 1 (3155→3157) not taken.
|
213932 | yylval->string = xstrdup(yytext); |
| 902 | 213932 | return STRING; | |
| 903 | } | ||
| 904 | |||
| 905 | 4765 | <*>{hexstring} { | |
| 906 |
1/2✓ Branch 0 (3163→3164) taken 4765 times.
✗ Branch 1 (3163→3165) not taken.
|
4765 | errno = 0; |
| 907 | 4765 | yylval->val = strtoull(yytext, NULL, 16); | |
| 908 |
2/2✓ Branch 0 (3170→3171) taken 39 times.
✓ Branch 1 (3170→3173) taken 4726 times.
|
4765 | if (errno != 0) { |
| 909 | 39 | yylval->string = xstrdup(yytext); | |
| 910 | 39 | return STRING; | |
| 911 | } | ||
| 912 | 4726 | return NUM; | |
| 913 | } | ||
| 914 | |||
| 915 | 399105 | <*>{decstring} { | |
| 916 |
3/4✓ Branch 0 (3174→3175) taken 399105 times.
✗ Branch 1 (3174→3176) not taken.
✓ Branch 2 (3180→3181) taken 1675 times.
✓ Branch 3 (3180→3182) taken 397430 times.
|
399105 | int base = yytext[0] == '0' ? 8 : 10; |
| 917 | char *end; | ||
| 918 | |||
| 919 | 399105 | errno = 0; | |
| 920 | 399105 | yylval->val = strtoull(yytext, &end, base); | |
| 921 |
4/4✓ Branch 0 (3184→3185) taken 399104 times.
✓ Branch 1 (3184→3186) taken 1 times.
✓ Branch 2 (3185→3186) taken 1 times.
✓ Branch 3 (3185→3188) taken 399103 times.
|
399105 | if (errno != 0 || *end) { |
| 922 | 2 | yylval->string = xstrdup(yytext); | |
| 923 | 2 | return STRING; | |
| 924 | } | ||
| 925 | 399103 | return NUM; | |
| 926 | } | ||
| 927 | |||
| 928 | 233 | {classid}/[ \t\n:\-},] { | |
| 929 | 233 | yylval->string = xstrdup(yytext); | |
| 930 | 233 | return STRING; | |
| 931 |
4/4✓ Branch 0 (3191→3192) taken 101 times.
✓ Branch 1 (3191→3193) taken 132 times.
✓ Branch 2 (3194→3191) taken 233 times.
✓ Branch 3 (3194→3195) taken 233 times.
|
466 | } |
| 932 | 233 | ||
| 933 | 25220 | {quotedstring} { | |
| 934 |
1/2✓ Branch 0 (3195→3196) taken 233 times.
✗ Branch 1 (3195→3197) not taken.
|
233 | yytext[yyleng - 1] = '\0'; |
| 935 |
1/2✓ Branch 0 (3203→3204) taken 24987 times.
✗ Branch 1 (3203→3205) not taken.
|
24987 | yylval->string = xstrdup(yytext + 1); |
| 936 | 24987 | return QUOTED_STRING; | |
| 937 | } | ||
| 938 | |||
| 939 | 3 | {asteriskstring} { | |
| 940 |
1/2✓ Branch 0 (3211→3212) taken 3 times.
✗ Branch 1 (3211→3213) not taken.
|
3 | yylval->string = xstrdup(yytext); |
| 941 | 3 | return ASTERISK_STRING; | |
| 942 | } | ||
| 943 | |||
| 944 | 346697 | {string} { | |
| 945 |
1/2✓ Branch 0 (3219→3220) taken 346697 times.
✗ Branch 1 (3219→3221) not taken.
|
346697 | yylval->string = xstrdup(yytext); |
| 946 | 346697 | return STRING; | |
| 947 | } | ||
| 948 | |||
| 949 | ✗ | <*>{newline_crlf} { return CRLF; } | |
| 950 | |||
| 951 | ✗ | <*>\\{newline} { | |
| 952 | ✗ | reset_pos(yyget_extra(yyscanner), yylloc); | |
| 953 | ✗ | } | |
| 954 | ✗ | ||
| 955 | 342791 | <*>{newline} { | |
| 956 | 342791 | reset_pos(yyget_extra(yyscanner), yylloc); | |
| 957 |
1/2✓ Branch 0 (3242→3243) taken 342791 times.
✗ Branch 1 (3242→3244) not taken.
|
685582 | return NEWLINE; |
| 958 | } | ||
| 959 | |||
| 960 | 143479 | <*>{tab}+ | |
| 961 |
1/2✓ Branch 0 (3251→3252) taken 143479 times.
✗ Branch 1 (3251→3253) not taken.
|
143479 | <*>{space}+ |
| 962 | 2670498 | <*>{comment_line} { | |
| 963 |
1/2✓ Branch 0 (3258→3259) taken 2670498 times.
✗ Branch 1 (3258→3260) not taken.
|
2670598 | reset_pos(yyget_extra(yyscanner), yylloc); |
| 964 | } | ||
| 965 |
1/2✓ Branch 0 (3265→3266) taken 100 times.
✗ Branch 1 (3265→3267) not taken.
|
200 | <*>{comment} |
| 966 | 18 | ||
| 967 | 49594 | <*><<EOF>> { | |
| 968 | 49576 | update_pos(yyget_extra(yyscanner), yylloc, 1); | |
| 969 | 49576 | scanner_pop_buffer(yyscanner); | |
| 970 |
4/6✓ Branch 0 (3274→3275) taken 18 times.
✗ Branch 1 (3274→3276) not taken.
✓ Branch 2 (3284→3285) taken 49576 times.
✗ Branch 3 (3284→3286) not taken.
✓ Branch 4 (3285→3286) taken 49500 times.
✓ Branch 5 (3285→3287) taken 76 times.
|
49594 | if (YY_CURRENT_BUFFER == NULL) |
| 971 | 49500 | return TOKEN_EOF; | |
| 972 | } | ||
| 973 | 76 | ||
| 974 | 19 | <*>. { return JUNK; } | |
| 975 |
1/2✓ Branch 0 (3288→3289) taken 19 times.
✗ Branch 1 (3288→3290) not taken.
|
19 | |
| 976 | ✗ | %% | |
| 977 | ✗ | ||
| 978 | 49577 | static void scanner_push_indesc(struct parser_state *state, | |
| 979 | struct input_descriptor *indesc) | ||
| 980 | { | ||
| 981 |
2/2✓ Branch 0 (2→3) taken 49501 times.
✓ Branch 1 (2→4) taken 76 times.
|
49577 | if (!state->indesc) |
| 982 | 49501 | list_add_tail(&indesc->list, &state->indesc_list); | |
| 983 | else | ||
| 984 | 76 | list_add(&indesc->list, &state->indesc->list); | |
| 985 | |||
| 986 | 49577 | state->indesc = indesc; | |
| 987 | 49577 | } | |
| 988 | |||
| 989 | 49576 | static void scanner_pop_indesc(struct parser_state *state) | |
| 990 | { | ||
| 991 |
2/2✓ Branch 0 (3→4) taken 76 times.
✓ Branch 1 (3→5) taken 49500 times.
|
49576 | if (!list_is_first(&state->indesc->list, &state->indesc_list)) { |
| 992 | 76 | state->indesc = list_entry(state->indesc->list.prev, | |
| 993 | struct input_descriptor, list); | ||
| 994 | } else { | ||
| 995 | 49500 | state->indesc = NULL; | |
| 996 | } | ||
| 997 | 49576 | } | |
| 998 | |||
| 999 | 49576 | static void scanner_pop_buffer(yyscan_t scanner) | |
| 1000 | { | ||
| 1001 | 49576 | struct parser_state *state = yyget_extra(scanner); | |
| 1002 | |||
| 1003 | 49576 | yypop_buffer_state(scanner); | |
| 1004 | 49576 | scanner_pop_indesc(state); | |
| 1005 | 49576 | } | |
| 1006 | |||
| 1007 | 729 | static void scanner_push_file(struct nft_ctx *nft, void *scanner, | |
| 1008 | FILE *f, const char *filename, | ||
| 1009 | const struct location *loc, | ||
| 1010 | const struct input_descriptor *parent_indesc) | ||
| 1011 | { | ||
| 1012 | 729 | struct parser_state *state = yyget_extra(scanner); | |
| 1013 | struct input_descriptor *indesc; | ||
| 1014 | YY_BUFFER_STATE b; | ||
| 1015 | |||
| 1016 | 729 | b = yy_create_buffer(f, YY_BUF_SIZE, scanner); | |
| 1017 | 729 | yypush_buffer_state(b, scanner); | |
| 1018 | |||
| 1019 | 729 | indesc = xzalloc(sizeof(struct input_descriptor)); | |
| 1020 | |||
| 1021 |
1/2✓ Branch 0 (6→7) taken 729 times.
✗ Branch 1 (6→8) not taken.
|
729 | if (loc != NULL) |
| 1022 | 729 | indesc->location = *loc; | |
| 1023 | 729 | indesc->type = INDESC_FILE; | |
| 1024 | 729 | indesc->name = xstrdup(filename); | |
| 1025 | 729 | indesc->f = f; | |
| 1026 |
2/2✓ Branch 0 (9→10) taken 653 times.
✓ Branch 1 (9→11) taken 76 times.
|
729 | if (!parent_indesc) { |
| 1027 | 653 | indesc->depth = 1; | |
| 1028 | } else { | ||
| 1029 | 76 | indesc->depth = parent_indesc->depth + 1; | |
| 1030 | } | ||
| 1031 | 729 | init_pos(indesc); | |
| 1032 | |||
| 1033 | 729 | scanner_push_indesc(state, indesc); | |
| 1034 | 729 | } | |
| 1035 | |||
| 1036 | enum nft_include_type { | ||
| 1037 | NFT_INCLUDE, | ||
| 1038 | NFT_CMDLINE, | ||
| 1039 | }; | ||
| 1040 | |||
| 1041 | − | static bool __is_useable(unsigned int type, enum nft_include_type t) | |
| 1042 | { | ||
| 1043 | − | type &= S_IFMT; | |
| 1044 | − | switch (type) { | |
| 1045 | − | case S_IFREG: return true; | |
| 1046 | − | case S_IFIFO: | |
| 1047 | − | return t == NFT_CMDLINE; /* disallow include /path/to/fifo */ | |
| 1048 | − | default: | |
| 1049 | − | break; | |
| 1050 | } | ||
| 1051 | |||
| 1052 | − | return false; | |
| 1053 | } | ||
| 1054 | |||
| 1055 | /* need to use stat() to, fopen() will block for named fifos */ | ||
| 1056 | 77 | static bool filename_is_useable(const char *name) | |
| 1057 | { | ||
| 1058 | struct stat sb; | ||
| 1059 | int err; | ||
| 1060 | |||
| 1061 | 77 | err = stat(name, &sb); | |
| 1062 |
1/2✗ Branch 0 (3→4) not taken.
✓ Branch 1 (3→5) taken 77 times.
|
77 | if (err) |
| 1063 | ✗ | return false; | |
| 1064 | |||
| 1065 | 77 | return __is_useable(sb.st_mode, NFT_INCLUDE); | |
| 1066 | } | ||
| 1067 | |||
| 1068 | 729 | static bool fp_is_useable(FILE *fp, enum nft_include_type t) | |
| 1069 | { | ||
| 1070 | 729 | int fd = fileno(fp); | |
| 1071 | struct stat sb; | ||
| 1072 | int err; | ||
| 1073 | |||
| 1074 |
1/2✗ Branch 0 (3→4) not taken.
✓ Branch 1 (3→5) taken 729 times.
|
729 | if (fd < 0) |
| 1075 | ✗ | return false; | |
| 1076 | |||
| 1077 | 729 | err = fstat(fd, &sb); | |
| 1078 |
1/2✗ Branch 0 (6→7) not taken.
✓ Branch 1 (6→8) taken 729 times.
|
729 | if (err < 0) |
| 1079 | ✗ | return false; | |
| 1080 | |||
| 1081 | 729 | return __is_useable(sb.st_mode, t); | |
| 1082 | } | ||
| 1083 | |||
| 1084 | 731 | static int include_file(struct nft_ctx *nft, void *scanner, | |
| 1085 | const char *filename, const struct location *loc, | ||
| 1086 | const struct input_descriptor *parent_indesc, | ||
| 1087 | enum nft_include_type includetype) | ||
| 1088 | |||
| 1089 | { | ||
| 1090 | 731 | struct parser_state *state = yyget_extra(scanner); | |
| 1091 | struct error_record *erec; | ||
| 1092 | FILE *f; | ||
| 1093 | |||
| 1094 |
4/4✓ Branch 0 (3→4) taken 78 times.
✓ Branch 1 (3→7) taken 653 times.
✓ Branch 2 (4→5) taken 1 times.
✓ Branch 3 (4→7) taken 77 times.
|
731 | if (parent_indesc && parent_indesc->depth == MAX_INCLUDE_DEPTH) { |
| 1095 | 1 | erec = error(loc, "Include nested too deeply, max %u levels", | |
| 1096 | MAX_INCLUDE_DEPTH); | ||
| 1097 | 1 | goto err; | |
| 1098 | } | ||
| 1099 | |||
| 1100 |
4/4✓ Branch 0 (7→8) taken 77 times.
✓ Branch 1 (7→12) taken 653 times.
✓ Branch 2 (9→10) taken 1 times.
✓ Branch 3 (9→12) taken 76 times.
|
730 | if (includetype == NFT_INCLUDE && !filename_is_useable(filename)) { |
| 1101 | 1 | erec = error(loc, "Not a regular file: \"%s\"\n", filename); | |
| 1102 | 1 | goto err; | |
| 1103 | } | ||
| 1104 | |||
| 1105 | 729 | f = fopen(filename, "r"); | |
| 1106 |
1/2✗ Branch 0 (13→14) not taken.
✓ Branch 1 (13→17) taken 729 times.
|
729 | if (f == NULL) { |
| 1107 | ✗ | erec = error(loc, "Could not open file \"%s\": %s\n", | |
| 1108 | filename, strerror(errno)); | ||
| 1109 | ✗ | goto err; | |
| 1110 | } | ||
| 1111 | |||
| 1112 |
1/2✗ Branch 0 (18→19) not taken.
✓ Branch 1 (18→22) taken 729 times.
|
729 | if (!fp_is_useable(f, includetype)) { |
| 1113 | ✗ | fclose(f); | |
| 1114 | ✗ | erec = error(loc, "Not a regular file: \"%s\"\n", filename); | |
| 1115 | ✗ | goto err; | |
| 1116 | } | ||
| 1117 | |||
| 1118 | 729 | scanner_push_file(nft, scanner, f, filename, loc, parent_indesc); | |
| 1119 | 729 | return 0; | |
| 1120 | 2 | err: | |
| 1121 | 2 | erec_queue(erec, state->msgs); | |
| 1122 | 2 | return -1; | |
| 1123 | } | ||
| 1124 | |||
| 1125 | 47 | static int include_glob(struct nft_ctx *nft, void *scanner, const char *pattern, | |
| 1126 | const struct location *loc) | ||
| 1127 | { | ||
| 1128 | 47 | struct parser_state *state = yyget_extra(scanner); | |
| 1129 | 47 | struct input_descriptor *indesc = state->indesc; | |
| 1130 | 47 | struct error_record *erec = NULL; | |
| 1131 | 47 | bool wildcard = false; | |
| 1132 | glob_t glob_data; | ||
| 1133 | unsigned int i; | ||
| 1134 | 47 | int flags = 0; | |
| 1135 | int ret; | ||
| 1136 | char *p; | ||
| 1137 | |||
| 1138 | /* This function can return four meaningful values: | ||
| 1139 | * | ||
| 1140 | * -1 means that there was an error. | ||
| 1141 | * 0 means that a single non-wildcard match was done. | ||
| 1142 | * 1 means that there are no wildcards in the pattern and the | ||
| 1143 | * search can continue. | ||
| 1144 | * 2 means that there are wildcards in the pattern and the search | ||
| 1145 | * can continue. | ||
| 1146 | * | ||
| 1147 | * The diffrence is needed, because there is a semantic difference | ||
| 1148 | * between patterns with wildcards and no wildcards. Not finding a | ||
| 1149 | * non-wildcard file is an error but not finding any matches for a | ||
| 1150 | * wildcard pattern is not. | ||
| 1151 | */ | ||
| 1152 | |||
| 1153 | /* There shouldn't be a need to use escape characters in include paths. | ||
| 1154 | */ | ||
| 1155 | 47 | flags |= GLOB_NOESCAPE; | |
| 1156 | |||
| 1157 | /* Mark directories so we can filter them out (also links). */ | ||
| 1158 | 47 | flags |= GLOB_MARK; | |
| 1159 | |||
| 1160 | /* If there is no match, glob() doesn't set GLOB_MAGCHAR even if there | ||
| 1161 | * are wildcard characters in the pattern. We need to look for (luckily | ||
| 1162 | * well-known and not likely to change) magic characters ourselves. In a | ||
| 1163 | * perfect world, we could use glob() itself to figure out if there are | ||
| 1164 | * wildcards in the pattern. | ||
| 1165 | */ | ||
| 1166 | 47 | p = (char *)pattern; | |
| 1167 |
2/2✓ Branch 0 (9→4) taken 4960 times.
✓ Branch 1 (9→10) taken 34 times.
|
4994 | while (*p) { |
| 1168 |
4/6✓ Branch 0 (4→5) taken 4947 times.
✓ Branch 1 (4→7) taken 13 times.
✓ Branch 2 (5→6) taken 4947 times.
✗ Branch 3 (5→7) not taken.
✗ Branch 4 (6→7) not taken.
✓ Branch 5 (6→8) taken 4947 times.
|
4960 | if (*p == '*' || *p == '?' || *p == '[') { |
| 1169 | 13 | wildcard = true; | |
| 1170 | 13 | break; | |
| 1171 | } | ||
| 1172 | 4947 | p++; | |
| 1173 | } | ||
| 1174 | |||
| 1175 | 47 | ret = glob(pattern, flags, NULL, &glob_data); | |
| 1176 |
2/2✓ Branch 0 (11→12) taken 41 times.
✓ Branch 1 (11→26) taken 6 times.
|
47 | if (ret == 0) { |
| 1177 | char *path; | ||
| 1178 | size_t len; | ||
| 1179 | |||
| 1180 | /* reverse alphabetical order due to stack */ | ||
| 1181 |
2/2✓ Branch 0 (20→13) taken 79 times.
✓ Branch 1 (20→21) taken 39 times.
|
118 | for (i = glob_data.gl_pathc; i > 0; i--) { |
| 1182 | |||
| 1183 | 79 | path = glob_data.gl_pathv[i-1]; | |
| 1184 | |||
| 1185 | /* ignore directories */ | ||
| 1186 | 79 | len = strlen(path); | |
| 1187 |
3/4✓ Branch 0 (13→14) taken 79 times.
✗ Branch 1 (13→15) not taken.
✓ Branch 2 (14→15) taken 1 times.
✓ Branch 3 (14→16) taken 78 times.
|
79 | if (len == 0 || path[len - 1] == '/') |
| 1188 | 1 | continue; | |
| 1189 | |||
| 1190 | 78 | ret = include_file(nft, scanner, path, loc, indesc, NFT_INCLUDE); | |
| 1191 |
2/2✓ Branch 0 (17→18) taken 2 times.
✓ Branch 1 (17→19) taken 76 times.
|
78 | if (ret != 0) |
| 1192 | 2 | goto err; | |
| 1193 | } | ||
| 1194 | |||
| 1195 | 39 | globfree(&glob_data); | |
| 1196 | |||
| 1197 | /* If no wildcards and we found the file, stop the search (with | ||
| 1198 | * 0). In case of wildcards we need to still continue the | ||
| 1199 | * search, because other matches might be in other include | ||
| 1200 | * directories. We handled the case with a non-wildcard pattern | ||
| 1201 | * and no matches already before. | ||
| 1202 | */ | ||
| 1203 |
2/2✓ Branch 0 (22→23) taken 10 times.
✓ Branch 1 (22→24) taken 29 times.
|
39 | return wildcard ? 2 : 0; |
| 1204 |
1/2✓ Branch 0 (26→27) taken 6 times.
✗ Branch 1 (26→32) not taken.
|
6 | } else if (ret == GLOB_NOMATCH) { |
| 1205 | 6 | globfree(&glob_data); | |
| 1206 | |||
| 1207 | /* We need to tell the caller whether wildcards were used in | ||
| 1208 | * case of no match, because the semantics for handling the | ||
| 1209 | * cases are different. | ||
| 1210 | */ | ||
| 1211 |
2/2✓ Branch 0 (28→29) taken 3 times.
✓ Branch 1 (28→30) taken 3 times.
|
6 | return wildcard ? 2 : 1; |
| 1212 | } | ||
| 1213 | |||
| 1214 | ✗ | erec = error(loc, "Failed to glob the pattern %s", pattern); | |
| 1215 | |||
| 1216 | /* intentional fall through */ | ||
| 1217 | 2 | err: | |
| 1218 |
1/2✗ Branch 0 (33→34) not taken.
✓ Branch 1 (33→35) taken 2 times.
|
2 | if (erec) |
| 1219 | ✗ | erec_queue(erec, state->msgs); | |
| 1220 | 2 | globfree(&glob_data); | |
| 1221 | 2 | return -1; | |
| 1222 | } | ||
| 1223 | |||
| 1224 | 653 | int scanner_read_file(struct nft_ctx *nft, const char *filename, | |
| 1225 | const struct location *loc) | ||
| 1226 | { | ||
| 1227 | 653 | return include_file(nft, nft->scanner, filename, loc, NULL, NFT_CMDLINE); | |
| 1228 | } | ||
| 1229 | |||
| 1230 | 45 | static bool search_in_include_path(const char *filename) | |
| 1231 | { | ||
| 1232 | 89 | return (strncmp(filename, "./", strlen("./")) != 0 && | |
| 1233 |
3/4✓ Branch 0 (2→3) taken 44 times.
✓ Branch 1 (2→6) taken 1 times.
✓ Branch 2 (3→4) taken 44 times.
✗ Branch 3 (3→6) not taken.
|
89 | strncmp(filename, "../", strlen("../")) != 0 && |
| 1234 |
2/2✓ Branch 0 (4→5) taken 4 times.
✓ Branch 1 (4→6) taken 40 times.
|
44 | filename[0] != '/'); |
| 1235 | } | ||
| 1236 | |||
| 1237 | 6 | static int include_path_glob(struct nft_ctx *nft, void *scanner, | |
| 1238 | const char *include_path, const char *filename, | ||
| 1239 | const struct location *loc) | ||
| 1240 | { | ||
| 1241 | 6 | struct parser_state *state = yyget_extra(scanner); | |
| 1242 | struct error_record *erec; | ||
| 1243 | char buf[PATH_MAX]; | ||
| 1244 | int ret; | ||
| 1245 | |||
| 1246 | 6 | ret = snprintf(buf, sizeof(buf), "%s/%s", include_path, filename); | |
| 1247 |
2/4✓ Branch 0 (3→4) taken 6 times.
✗ Branch 1 (3→5) not taken.
✗ Branch 2 (4→5) not taken.
✓ Branch 3 (4→8) taken 6 times.
|
6 | if (ret < 0 || ret >= PATH_MAX) { |
| 1248 | ✗ | erec = error(loc, "Too long file path \"%s/%s\"\n", | |
| 1249 | include_path, filename); | ||
| 1250 | ✗ | erec_queue(erec, state->msgs); | |
| 1251 | ✗ | return -1; | |
| 1252 | } | ||
| 1253 | |||
| 1254 | 6 | ret = include_glob(nft, scanner, buf, loc); | |
| 1255 | |||
| 1256 | /* error was already handled */ | ||
| 1257 |
1/2✗ Branch 0 (9→10) not taken.
✓ Branch 1 (9→11) taken 6 times.
|
6 | if (ret == -1) |
| 1258 | ✗ | return -1; | |
| 1259 | /* no wildcards and file was processed: break early. */ | ||
| 1260 |
2/2✓ Branch 0 (11→12) taken 3 times.
✓ Branch 1 (11→13) taken 3 times.
|
6 | if (ret == 0) |
| 1261 | 3 | return 0; | |
| 1262 | |||
| 1263 | /* else 1 (no wildcards) or 2 (wildcards): keep | ||
| 1264 | * searching. | ||
| 1265 | */ | ||
| 1266 | 3 | return ret; | |
| 1267 | } | ||
| 1268 | |||
| 1269 | 45 | int scanner_include_file(struct nft_ctx *nft, void *scanner, | |
| 1270 | const char *filename, const struct location *loc) | ||
| 1271 | { | ||
| 1272 | 45 | struct parser_state *state = yyget_extra(scanner); | |
| 1273 | struct error_record *erec; | ||
| 1274 | unsigned int i; | ||
| 1275 | 45 | int ret = -1; | |
| 1276 | |||
| 1277 |
2/2✓ Branch 0 (4→5) taken 4 times.
✓ Branch 1 (4→14) taken 41 times.
|
45 | if (search_in_include_path(filename)) { |
| 1278 |
2/2✓ Branch 0 (10→6) taken 5 times.
✓ Branch 1 (10→11) taken 1 times.
|
6 | for (i = 0; i < nft->num_include_paths; i++) { |
| 1279 | 5 | ret = include_path_glob(nft, scanner, | |
| 1280 | 5 | nft->include_paths[i], | |
| 1281 | filename, loc); | ||
| 1282 |
2/2✓ Branch 0 (7→8) taken 3 times.
✓ Branch 1 (7→9) taken 2 times.
|
5 | if (ret <= 0) |
| 1283 | 3 | return ret; | |
| 1284 | } | ||
| 1285 | 1 | ret = include_path_glob(nft, scanner, DEFAULT_INCLUDE_PATH, | |
| 1286 | filename, loc); | ||
| 1287 |
1/2✗ Branch 0 (12→13) not taken.
✓ Branch 1 (12→15) taken 1 times.
|
1 | if (ret <= 0) |
| 1288 | ✗ | return ret; | |
| 1289 | } else { | ||
| 1290 | /* an absolute path (starts with '/') */ | ||
| 1291 | 41 | ret = include_glob(nft, scanner, filename, loc); | |
| 1292 | } | ||
| 1293 | |||
| 1294 | /* handle the case where no file was found */ | ||
| 1295 |
2/2✓ Branch 0 (15→16) taken 2 times.
✓ Branch 1 (15→17) taken 40 times.
|
42 | if (ret == -1) |
| 1296 | 2 | return -1; | |
| 1297 |
4/4✓ Branch 0 (17→18) taken 14 times.
✓ Branch 1 (17→19) taken 26 times.
✓ Branch 2 (18→19) taken 12 times.
✓ Branch 3 (18→20) taken 2 times.
|
40 | else if (ret == 0 || ret == 2) |
| 1298 | 38 | return 0; | |
| 1299 | |||
| 1300 | /* 1 means an error, because there are no more include directories to | ||
| 1301 | * search, and the pattern does not have wildcard characters. | ||
| 1302 | */ | ||
| 1303 | 2 | erec = error(loc, "File not found: %s", filename); | |
| 1304 | 2 | erec_queue(erec, state->msgs); | |
| 1305 | 2 | return -1; | |
| 1306 | } | ||
| 1307 | |||
| 1308 | 48848 | void scanner_push_buffer(void *scanner, const struct input_descriptor *indesc, | |
| 1309 | const char *buffer) | ||
| 1310 | { | ||
| 1311 | 48848 | struct parser_state *state = yyget_extra(scanner); | |
| 1312 | struct input_descriptor *new_indesc; | ||
| 1313 | YY_BUFFER_STATE b; | ||
| 1314 | |||
| 1315 | 48848 | new_indesc = xzalloc(sizeof(struct input_descriptor)); | |
| 1316 | 48848 | memcpy(new_indesc, indesc, sizeof(*new_indesc)); | |
| 1317 | 48848 | new_indesc->data = buffer; | |
| 1318 | 48848 | new_indesc->name = xstrdup(indesc->name); | |
| 1319 | 48848 | scanner_push_indesc(state, new_indesc); | |
| 1320 | |||
| 1321 | 48848 | b = yy_scan_string(buffer, scanner); | |
| 1322 |
1/2✗ Branch 0 (7→8) not taken.
✓ Branch 1 (7→9) taken 48848 times.
|
48848 | assert(b != NULL); |
| 1323 | 48848 | init_pos(state->indesc); | |
| 1324 | 48848 | } | |
| 1325 | |||
| 1326 | 49501 | void *scanner_init(struct parser_state *state) | |
| 1327 | { | ||
| 1328 | yyscan_t scanner; | ||
| 1329 | |||
| 1330 | 49501 | yylex_init_extra(state, &scanner); | |
| 1331 | 49501 | yyset_out(NULL, scanner); | |
| 1332 | |||
| 1333 | 49501 | state->startcond_active = xzalloc_array(__SC_MAX, | |
| 1334 | sizeof(*state->startcond_active)); | ||
| 1335 | 49501 | return scanner; | |
| 1336 | } | ||
| 1337 | |||
| 1338 | 49573 | static void input_descriptor_destroy(const struct input_descriptor *indesc) | |
| 1339 | { | ||
| 1340 |
1/2✓ Branch 0 (2→3) taken 49573 times.
✗ Branch 1 (2→4) not taken.
|
49573 | if (indesc->name) |
| 1341 | 49573 | free_const(indesc->name); | |
| 1342 | 49573 | free_const(indesc); | |
| 1343 | 49573 | } | |
| 1344 | |||
| 1345 | 49501 | static void input_descriptor_list_destroy(struct parser_state *state) | |
| 1346 | { | ||
| 1347 | struct input_descriptor *indesc, *next; | ||
| 1348 | |||
| 1349 |
2/2✓ Branch 0 (9→3) taken 49573 times.
✓ Branch 1 (9→10) taken 49501 times.
|
99074 | list_for_each_entry_safe(indesc, next, &state->indesc_list, list) { |
| 1350 |
2/2✓ Branch 0 (3→4) taken 729 times.
✓ Branch 1 (3→6) taken 48844 times.
|
49573 | if (indesc->f) { |
| 1351 | 729 | fclose(indesc->f); | |
| 1352 | 729 | indesc->f = NULL; | |
| 1353 | } | ||
| 1354 | 49573 | list_del(&indesc->list); | |
| 1355 | 49573 | input_descriptor_destroy(indesc); | |
| 1356 | } | ||
| 1357 | 49501 | } | |
| 1358 | |||
| 1359 | 49501 | void scanner_destroy(struct nft_ctx *nft) | |
| 1360 | { | ||
| 1361 | 49501 | struct parser_state *state = yyget_extra(nft->scanner); | |
| 1362 | |||
| 1363 | 49501 | input_descriptor_list_destroy(state); | |
| 1364 | 49501 | free(state->startcond_active); | |
| 1365 | |||
| 1366 | 49501 | yylex_destroy(nft->scanner); | |
| 1367 | 49501 | } | |
| 1368 | |||
| 1369 | 74342 | static void scanner_push_start_cond(void *scanner, enum startcond_type type) | |
| 1370 | { | ||
| 1371 | 74342 | struct parser_state *state = yyget_extra(scanner); | |
| 1372 | |||
| 1373 | 74342 | state->startcond_type = type; | |
| 1374 | 74342 | state->startcond_active[type]++; | |
| 1375 | |||
| 1376 | 74342 | yy_push_state((int)type, scanner); | |
| 1377 | 74342 | } | |
| 1378 | |||
| 1379 | 74006 | void scanner_pop_start_cond(void *scanner, enum startcond_type t) | |
| 1380 | { | ||
| 1381 | 74006 | struct parser_state *state = yyget_extra(scanner); | |
| 1382 | |||
| 1383 | 74006 | state->startcond_active[t]--; | |
| 1384 | |||
| 1385 |
2/2✓ Branch 0 (3→4) taken 506 times.
✓ Branch 1 (3→5) taken 73500 times.
|
74006 | if (state->startcond_type != t) { |
| 1386 | 506 | state->flex_state_pop++; | |
| 1387 | 506 | return; /* Can't pop just yet! */ | |
| 1388 | } | ||
| 1389 | |||
| 1390 |
2/2✓ Branch 0 (11→6) taken 423 times.
✓ Branch 1 (11→12) taken 73441 times.
|
73864 | while (state->flex_state_pop) { |
| 1391 | 423 | state->flex_state_pop--; | |
| 1392 | 423 | state->startcond_type = yy_top_state(scanner); | |
| 1393 | 423 | yy_pop_state(scanner); | |
| 1394 | |||
| 1395 | 423 | t = state->startcond_type; | |
| 1396 |
2/2✓ Branch 0 (8→9) taken 59 times.
✓ Branch 1 (8→10) taken 364 times.
|
423 | if (state->startcond_active[t]) |
| 1397 | 59 | return; | |
| 1398 | } | ||
| 1399 | |||
| 1400 | 73441 | state->startcond_type = yy_top_state(scanner); | |
| 1401 | |||
| 1402 | 73441 | yy_pop_state(scanner); | |
| 1403 | } | ||
| 1404 |