!29 Add the libnl source file

Merge pull request !29 from jiachanglin/master
This commit is contained in:
openharmony_ci
2022-03-07 09:22:39 +00:00
committed by Gitee
12 changed files with 11230 additions and 79 deletions
+4 -77
View File
@@ -9,74 +9,9 @@ if (!defined(ohos_lite)) {
import("//build/ohos.gni")
}
action("build_grammar") {
script = "/usr/bin/env"
outputs = [ "$target_out_dir/gen/lib/route/pktloc_grammar.c" ]
grammer_hh = rebase_path("$target_out_dir/gen/lib/route/pktloc_grammar.h")
args = [
"flex",
"--header-file=$grammer_hh",
"-o",
rebase_path("$target_out_dir/gen/lib/route/pktloc_grammar.c"),
rebase_path("lib/route/pktloc_grammar.l"),
]
}
action("pktloc_syntax") {
script = "/usr/bin/env"
outputs = [ "$target_out_dir/gen/lib/route/pktloc_syntax.c" ]
args = [
"bison",
"-y",
"-d",
"-o",
rebase_path("$target_out_dir/gen/lib/route/pktloc_syntax.c"),
rebase_path("lib/route/pktloc_syntax.y"),
]
}
action("ematch_grammar") {
script = "/usr/bin/env"
outputs = [ "$target_out_dir/gen/lib/route/cls/ematch_grammar.c" ]
grammer_hh = rebase_path("$target_out_dir/gen/lib/route/cls/ematch_grammar.h")
args = [
"flex",
"--header-file=$grammer_hh",
"-o",
rebase_path("$target_out_dir/gen/lib/route/cls/ematch_grammar.c"),
rebase_path("lib/route/cls/ematch_grammar.l"),
]
}
action("ematch_syntax") {
script = "/usr/bin/env"
outputs = [ "$target_out_dir/gen/lib/route/cls/ematch_syntax.c" ]
args = [
"bison",
"-y",
"-d",
"-o",
rebase_path("$target_out_dir/gen/lib/route/cls/ematch_syntax.c"),
rebase_path("lib/route/cls/ematch_syntax.y"),
]
}
if (!defined(ohos_lite)) {
grammer_outputs = get_target_outputs(":build_grammar")
grammer_path = get_path_info(grammer_outputs[0], "dir")
pktloc_outputs = get_target_outputs(":pktloc_syntax")
pktloc_path = get_path_info(pktloc_outputs[0], "dir")
ematch_outputs = get_target_outputs(":ematch_grammar")
ematch_path = get_path_info(ematch_outputs[0], "dir")
syntax_outputs = get_target_outputs(":ematch_syntax")
syntax_path = get_path_info(syntax_outputs[0], "dir")
config("libnl_config") {
include_dirs = [
rebase_path("$grammer_path"),
rebase_path("$pktloc_path"),
rebase_path("$ematch_path"),
rebase_path("$syntax_path"),
"include",
"lib",
"lib/route/cls",
@@ -153,6 +88,8 @@ if (!defined(ohos_lite)) {
"lib/route/cls/ematch/meta.c",
"lib/route/cls/ematch/nbyte.c",
"lib/route/cls/ematch/text.c",
"lib/route/cls/ematch_grammar.c",
"lib/route/cls/ematch_syntax.c",
"lib/route/cls/fw.c",
"lib/route/cls/mall.c",
"lib/route/cls/police.c",
@@ -189,6 +126,8 @@ if (!defined(ohos_lite)) {
"lib/route/nexthop_encap.c",
"lib/route/nh_encap_mpls.c",
"lib/route/pktloc.c",
"lib/route/pktloc_grammar.c",
"lib/route/pktloc_syntax.c",
"lib/route/qdisc.c",
"lib/route/qdisc/blackhole.c",
"lib/route/qdisc/cbq.c",
@@ -233,12 +172,6 @@ if (!defined(ohos_lite)) {
"src/lib/tc.c",
"src/lib/utils.c",
]
sources += [
rebase_path("$grammer_path/pktloc_grammar.c"),
rebase_path("$pktloc_path/pktloc_syntax.c"),
rebase_path("$ematch_path/ematch_grammar.c"),
rebase_path("$syntax_path/ematch_syntax.c"),
]
defines = [ "NL_DEBUG" ]
cflags = [
"-Wno-error",
@@ -249,12 +182,6 @@ if (!defined(ohos_lite)) {
#"-UNDEBUG",
"-DSYSCONFDIR=\"\\\"/etc/libnl\\\"\"",
]
deps = [
":build_grammar",
":ematch_grammar",
":ematch_syntax",
":pktloc_syntax",
]
subsystem_name = "wpa_supplicant-2.9"
install_images = [ "system" ]
}
+1 -1
View File
@@ -15,7 +15,7 @@ In this warehouse include/netlink/version.h and lib/defs.h file is generated thr
```
bash install_tool.sh
```
Note:The preceding script performs following operations:Install the autoconf,libtool and pkg-config tools,execute the autogen.sh file in the libnl root directory,generate the configure,defs.h.in and defs.h.in~ files,and then execute the configure command,The version.h file is generated in the include/netlink directory and defs.h file is generated in the lib directory.
Note:The preceding script performs following operations:Install the autoconf,libtool and pkg-config tools,execute the autogen.sh file in the libnl root directory,generate the configure,defs.h.in and defs.h.in~ files,and then execute the configure command,The version.h file is generated in the include/netlink directory,defs.h file is generated in the lib directory and Makefile is generated in libnl root directory.and then execute the make command,The ematch_grammar.c、ematch_grammar.h、ematch_syntax.c、ematch_syntax.h file is generated in the lib/route/cls directory,pktloc_grammar.c、pktloc_grammar.h、pktloc_syntax.c、pktloc_syntax.h file is generated in the lib/route directory
#### Contribution
[How to involve](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/参与贡献.md)
+1 -1
View File
@@ -16,7 +16,7 @@
```
bash install_tool.sh
```
注:上述脚本进行了如下操作,首先安装了autoconf、libtool、pkg-config工具,然后执行libnl根目录autogen.sh,生成configure、defs.h.in和defs.h.in~文件。后执行configure,会在include/netlink目录下生成version.hlib目录下生成defs.h文件
注:上述脚本进行了如下操作,首先安装了autoconf、libtool、pkg-config工具,其次执行libnl根目录autogen.sh,生成configure、defs.h.in和defs.h.in~文件。后执行configure,会在include/netlink目录下生成version.hlib目录下生成defs.h文件libnl根目录下生成Makefile文件。最后执行make,会在lib/route/cls目录下生成ematch_grammar.c、ematch_grammar.h、ematch_syntax.c、ematch_syntax.hlib/route目录下生成pktloc_grammar.c、pktloc_grammar.h、pktloc_syntax.c、pktloc_syntax.h文件。
#### 参与贡献
+1
View File
@@ -17,5 +17,6 @@ sudo apt-get install libtool
sudo apt-get install pkg-config
./autogen.sh
./configure
make
exit 0
File diff suppressed because it is too large Load Diff
+718
View File
@@ -0,0 +1,718 @@
#ifndef ematch_HEADER_H
#define ematch_HEADER_H 1
#define ematch_IN_HEADER 1
#line 6 "lib/route/cls/ematch_grammar.h"
#line 8 "lib/route/cls/ematch_grammar.h"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
#ifdef yy_create_buffer
#define ematch__create_buffer_ALREADY_DEFINED
#else
#define yy_create_buffer ematch__create_buffer
#endif
#ifdef yy_delete_buffer
#define ematch__delete_buffer_ALREADY_DEFINED
#else
#define yy_delete_buffer ematch__delete_buffer
#endif
#ifdef yy_scan_buffer
#define ematch__scan_buffer_ALREADY_DEFINED
#else
#define yy_scan_buffer ematch__scan_buffer
#endif
#ifdef yy_scan_string
#define ematch__scan_string_ALREADY_DEFINED
#else
#define yy_scan_string ematch__scan_string
#endif
#ifdef yy_scan_bytes
#define ematch__scan_bytes_ALREADY_DEFINED
#else
#define yy_scan_bytes ematch__scan_bytes
#endif
#ifdef yy_init_buffer
#define ematch__init_buffer_ALREADY_DEFINED
#else
#define yy_init_buffer ematch__init_buffer
#endif
#ifdef yy_flush_buffer
#define ematch__flush_buffer_ALREADY_DEFINED
#else
#define yy_flush_buffer ematch__flush_buffer
#endif
#ifdef yy_load_buffer_state
#define ematch__load_buffer_state_ALREADY_DEFINED
#else
#define yy_load_buffer_state ematch__load_buffer_state
#endif
#ifdef yy_switch_to_buffer
#define ematch__switch_to_buffer_ALREADY_DEFINED
#else
#define yy_switch_to_buffer ematch__switch_to_buffer
#endif
#ifdef yypush_buffer_state
#define ematch_push_buffer_state_ALREADY_DEFINED
#else
#define yypush_buffer_state ematch_push_buffer_state
#endif
#ifdef yypop_buffer_state
#define ematch_pop_buffer_state_ALREADY_DEFINED
#else
#define yypop_buffer_state ematch_pop_buffer_state
#endif
#ifdef yyensure_buffer_stack
#define ematch_ensure_buffer_stack_ALREADY_DEFINED
#else
#define yyensure_buffer_stack ematch_ensure_buffer_stack
#endif
#ifdef yylex
#define ematch_lex_ALREADY_DEFINED
#else
#define yylex ematch_lex
#endif
#ifdef yyrestart
#define ematch_restart_ALREADY_DEFINED
#else
#define yyrestart ematch_restart
#endif
#ifdef yylex_init
#define ematch_lex_init_ALREADY_DEFINED
#else
#define yylex_init ematch_lex_init
#endif
#ifdef yylex_init_extra
#define ematch_lex_init_extra_ALREADY_DEFINED
#else
#define yylex_init_extra ematch_lex_init_extra
#endif
#ifdef yylex_destroy
#define ematch_lex_destroy_ALREADY_DEFINED
#else
#define yylex_destroy ematch_lex_destroy
#endif
#ifdef yyget_debug
#define ematch_get_debug_ALREADY_DEFINED
#else
#define yyget_debug ematch_get_debug
#endif
#ifdef yyset_debug
#define ematch_set_debug_ALREADY_DEFINED
#else
#define yyset_debug ematch_set_debug
#endif
#ifdef yyget_extra
#define ematch_get_extra_ALREADY_DEFINED
#else
#define yyget_extra ematch_get_extra
#endif
#ifdef yyset_extra
#define ematch_set_extra_ALREADY_DEFINED
#else
#define yyset_extra ematch_set_extra
#endif
#ifdef yyget_in
#define ematch_get_in_ALREADY_DEFINED
#else
#define yyget_in ematch_get_in
#endif
#ifdef yyset_in
#define ematch_set_in_ALREADY_DEFINED
#else
#define yyset_in ematch_set_in
#endif
#ifdef yyget_out
#define ematch_get_out_ALREADY_DEFINED
#else
#define yyget_out ematch_get_out
#endif
#ifdef yyset_out
#define ematch_set_out_ALREADY_DEFINED
#else
#define yyset_out ematch_set_out
#endif
#ifdef yyget_leng
#define ematch_get_leng_ALREADY_DEFINED
#else
#define yyget_leng ematch_get_leng
#endif
#ifdef yyget_text
#define ematch_get_text_ALREADY_DEFINED
#else
#define yyget_text ematch_get_text
#endif
#ifdef yyget_lineno
#define ematch_get_lineno_ALREADY_DEFINED
#else
#define yyget_lineno ematch_get_lineno
#endif
#ifdef yyset_lineno
#define ematch_set_lineno_ALREADY_DEFINED
#else
#define yyset_lineno ematch_set_lineno
#endif
#ifdef yyget_column
#define ematch_get_column_ALREADY_DEFINED
#else
#define yyget_column ematch_get_column
#endif
#ifdef yyset_column
#define ematch_set_column_ALREADY_DEFINED
#else
#define yyset_column ematch_set_column
#endif
#ifdef yywrap
#define ematch_wrap_ALREADY_DEFINED
#else
#define yywrap ematch_wrap
#endif
#ifdef yyget_lval
#define ematch_get_lval_ALREADY_DEFINED
#else
#define yyget_lval ematch_get_lval
#endif
#ifdef yyset_lval
#define ematch_set_lval_ALREADY_DEFINED
#else
#define yyset_lval ematch_set_lval
#endif
#ifdef yyalloc
#define ematch_alloc_ALREADY_DEFINED
#else
#define yyalloc ematch_alloc
#endif
#ifdef yyrealloc
#define ematch_realloc_ALREADY_DEFINED
#else
#define yyrealloc ematch_realloc
#endif
#ifdef yyfree
#define ematch_free_ALREADY_DEFINED
#else
#define yyfree ematch_free
#endif
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* end standard C headers. */
/* flex integer type definitions */
#ifndef FLEXINT_H
#define FLEXINT_H
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
#ifndef SIZE_MAX
#define SIZE_MAX (~(size_t)0)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
/* begin standard C++ headers. */
/* TODO: this is always defined, so inline it */
#define yyconst const
#if defined(__GNUC__) && __GNUC__ >= 3
#define yynoreturn __attribute__((__noreturn__))
#else
#define yynoreturn
#endif
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
typedef void* yyscan_t;
#endif
/* For convenience, these vars (plus the bison vars far below)
are macros in the reentrant scanner. */
#define yyin yyg->yyin_r
#define yyout yyg->yyout_r
#define yyextra yyg->yyextra_r
#define yyleng yyg->yyleng_r
#define yytext yyg->yytext_r
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
void yyrestart ( FILE *input_file , yyscan_t yyscanner );
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
void yypop_buffer_state ( yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
void yyfree ( void * , yyscan_t yyscanner );
#define ematch_wrap(yyscanner) (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
#define yytext_ptr yytext_r
#ifdef YY_HEADER_EXPORT_START_CONDITIONS
#define INITIAL 0
#define QUOTE 1
#endif
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#include <unistd.h>
#endif
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
int yylex_init (yyscan_t* scanner);
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int yylex_destroy ( yyscan_t yyscanner );
int yyget_debug ( yyscan_t yyscanner );
void yyset_debug ( int debug_flag , yyscan_t yyscanner );
YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
FILE *yyget_in ( yyscan_t yyscanner );
void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
FILE *yyget_out ( yyscan_t yyscanner );
void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
int yyget_leng ( yyscan_t yyscanner );
char *yyget_text ( yyscan_t yyscanner );
int yyget_lineno ( yyscan_t yyscanner );
void yyset_lineno ( int _line_number , yyscan_t yyscanner );
int yyget_column ( yyscan_t yyscanner );
void yyset_column ( int _column_no , yyscan_t yyscanner );
YYSTYPE * yyget_lval ( yyscan_t yyscanner );
void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap ( yyscan_t yyscanner );
#else
extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef yytext_ptr
static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
extern int yylex \
(YYSTYPE * yylval_param , yyscan_t yyscanner);
#define YY_DECL int yylex \
(YYSTYPE * yylval_param , yyscan_t yyscanner)
#endif /* !YY_DECL */
/* yy_get_previous_state - get the state just before the EOB char was reached */
#undef YY_NEW_FILE
#undef YY_FLUSH_BUFFER
#undef yy_set_bol
#undef yy_new_buffer
#undef yy_set_interactive
#undef YY_DO_BEFORE_ACTION
#ifdef YY_DECL_IS_OURS
#undef YY_DECL_IS_OURS
#undef YY_DECL
#endif
#ifndef ematch__create_buffer_ALREADY_DEFINED
#undef yy_create_buffer
#endif
#ifndef ematch__delete_buffer_ALREADY_DEFINED
#undef yy_delete_buffer
#endif
#ifndef ematch__scan_buffer_ALREADY_DEFINED
#undef yy_scan_buffer
#endif
#ifndef ematch__scan_string_ALREADY_DEFINED
#undef yy_scan_string
#endif
#ifndef ematch__scan_bytes_ALREADY_DEFINED
#undef yy_scan_bytes
#endif
#ifndef ematch__init_buffer_ALREADY_DEFINED
#undef yy_init_buffer
#endif
#ifndef ematch__flush_buffer_ALREADY_DEFINED
#undef yy_flush_buffer
#endif
#ifndef ematch__load_buffer_state_ALREADY_DEFINED
#undef yy_load_buffer_state
#endif
#ifndef ematch__switch_to_buffer_ALREADY_DEFINED
#undef yy_switch_to_buffer
#endif
#ifndef ematch_push_buffer_state_ALREADY_DEFINED
#undef yypush_buffer_state
#endif
#ifndef ematch_pop_buffer_state_ALREADY_DEFINED
#undef yypop_buffer_state
#endif
#ifndef ematch_ensure_buffer_stack_ALREADY_DEFINED
#undef yyensure_buffer_stack
#endif
#ifndef ematch_lex_ALREADY_DEFINED
#undef yylex
#endif
#ifndef ematch_restart_ALREADY_DEFINED
#undef yyrestart
#endif
#ifndef ematch_lex_init_ALREADY_DEFINED
#undef yylex_init
#endif
#ifndef ematch_lex_init_extra_ALREADY_DEFINED
#undef yylex_init_extra
#endif
#ifndef ematch_lex_destroy_ALREADY_DEFINED
#undef yylex_destroy
#endif
#ifndef ematch_get_debug_ALREADY_DEFINED
#undef yyget_debug
#endif
#ifndef ematch_set_debug_ALREADY_DEFINED
#undef yyset_debug
#endif
#ifndef ematch_get_extra_ALREADY_DEFINED
#undef yyget_extra
#endif
#ifndef ematch_set_extra_ALREADY_DEFINED
#undef yyset_extra
#endif
#ifndef ematch_get_in_ALREADY_DEFINED
#undef yyget_in
#endif
#ifndef ematch_set_in_ALREADY_DEFINED
#undef yyset_in
#endif
#ifndef ematch_get_out_ALREADY_DEFINED
#undef yyget_out
#endif
#ifndef ematch_set_out_ALREADY_DEFINED
#undef yyset_out
#endif
#ifndef ematch_get_leng_ALREADY_DEFINED
#undef yyget_leng
#endif
#ifndef ematch_get_text_ALREADY_DEFINED
#undef yyget_text
#endif
#ifndef ematch_get_lineno_ALREADY_DEFINED
#undef yyget_lineno
#endif
#ifndef ematch_set_lineno_ALREADY_DEFINED
#undef yyset_lineno
#endif
#ifndef ematch_get_column_ALREADY_DEFINED
#undef yyget_column
#endif
#ifndef ematch_set_column_ALREADY_DEFINED
#undef yyset_column
#endif
#ifndef ematch_wrap_ALREADY_DEFINED
#undef yywrap
#endif
#ifndef ematch_get_lval_ALREADY_DEFINED
#undef yyget_lval
#endif
#ifndef ematch_set_lval_ALREADY_DEFINED
#undef yyset_lval
#endif
#ifndef ematch_get_lloc_ALREADY_DEFINED
#undef yyget_lloc
#endif
#ifndef ematch_set_lloc_ALREADY_DEFINED
#undef yyset_lloc
#endif
#ifndef ematch_alloc_ALREADY_DEFINED
#undef yyalloc
#endif
#ifndef ematch_realloc_ALREADY_DEFINED
#undef yyrealloc
#endif
#ifndef ematch_free_ALREADY_DEFINED
#undef yyfree
#endif
#ifndef ematch_text_ALREADY_DEFINED
#undef yytext
#endif
#ifndef ematch_leng_ALREADY_DEFINED
#undef yyleng
#endif
#ifndef ematch_in_ALREADY_DEFINED
#undef yyin
#endif
#ifndef ematch_out_ALREADY_DEFINED
#undef yyout
#endif
#ifndef ematch__flex_debug_ALREADY_DEFINED
#undef yy_flex_debug
#endif
#ifndef ematch_lineno_ALREADY_DEFINED
#undef yylineno
#endif
#ifndef ematch_tables_fload_ALREADY_DEFINED
#undef yytables_fload
#endif
#ifndef ematch_tables_destroy_ALREADY_DEFINED
#undef yytables_destroy
#endif
#ifndef ematch_TABLES_NAME_ALREADY_DEFINED
#undef yyTABLES_NAME
#endif
#line 167 "lib/route/cls/ematch_grammar.l"
#line 717 "lib/route/cls/ematch_grammar.h"
#undef ematch_IN_HEADER
#endif /* ematch_HEADER_H */
File diff suppressed because it is too large Load Diff
+225
View File
@@ -0,0 +1,225 @@
/* A Bison parser, made by GNU Bison 3.5.1. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Undocumented macros, especially those whose name start with YY_,
are private implementation details. Do not rely on them. */
#ifndef YY_EMATCH_LIB_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED
# define YY_EMATCH_LIB_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int ematch_debug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
ERROR = 258,
LOGIC = 259,
NOT = 260,
OPERAND = 261,
NUMBER = 262,
ALIGN = 263,
LAYER = 264,
KW_OPEN = 265,
KW_CLOSE = 266,
KW_PLUS = 267,
KW_MASK = 268,
KW_SHIFT = 269,
KW_AT = 270,
EMATCH_CMP = 271,
EMATCH_NBYTE = 272,
EMATCH_TEXT = 273,
EMATCH_META = 274,
KW_EQ = 275,
KW_GT = 276,
KW_LT = 277,
KW_FROM = 278,
KW_TO = 279,
META_RANDOM = 280,
META_LOADAVG_0 = 281,
META_LOADAVG_1 = 282,
META_LOADAVG_2 = 283,
META_DEV = 284,
META_PRIO = 285,
META_PROTO = 286,
META_PKTTYPE = 287,
META_PKTLEN = 288,
META_DATALEN = 289,
META_MACLEN = 290,
META_MARK = 291,
META_TCINDEX = 292,
META_RTCLASSID = 293,
META_RTIIF = 294,
META_SK_FAMILY = 295,
META_SK_STATE = 296,
META_SK_REUSE = 297,
META_SK_REFCNT = 298,
META_SK_RCVBUF = 299,
META_SK_SNDBUF = 300,
META_SK_SHUTDOWN = 301,
META_SK_PROTO = 302,
META_SK_TYPE = 303,
META_SK_RMEM_ALLOC = 304,
META_SK_WMEM_ALLOC = 305,
META_SK_WMEM_QUEUED = 306,
META_SK_RCV_QLEN = 307,
META_SK_SND_QLEN = 308,
META_SK_ERR_QLEN = 309,
META_SK_FORWARD_ALLOCS = 310,
META_SK_ALLOCS = 311,
META_SK_ROUTE_CAPS = 312,
META_SK_HASH = 313,
META_SK_LINGERTIME = 314,
META_SK_ACK_BACKLOG = 315,
META_SK_MAX_ACK_BACKLOG = 316,
META_SK_PRIO = 317,
META_SK_RCVLOWAT = 318,
META_SK_RCVTIMEO = 319,
META_SK_SNDTIMEO = 320,
META_SK_SENDMSG_OFF = 321,
META_SK_WRITE_PENDING = 322,
META_VLAN = 323,
META_RXHASH = 324,
META_DEVNAME = 325,
META_SK_BOUND_IF = 326,
STR = 327,
QUOTED = 328
};
#endif
/* Tokens. */
#define ERROR 258
#define LOGIC 259
#define NOT 260
#define OPERAND 261
#define NUMBER 262
#define ALIGN 263
#define LAYER 264
#define KW_OPEN 265
#define KW_CLOSE 266
#define KW_PLUS 267
#define KW_MASK 268
#define KW_SHIFT 269
#define KW_AT 270
#define EMATCH_CMP 271
#define EMATCH_NBYTE 272
#define EMATCH_TEXT 273
#define EMATCH_META 274
#define KW_EQ 275
#define KW_GT 276
#define KW_LT 277
#define KW_FROM 278
#define KW_TO 279
#define META_RANDOM 280
#define META_LOADAVG_0 281
#define META_LOADAVG_1 282
#define META_LOADAVG_2 283
#define META_DEV 284
#define META_PRIO 285
#define META_PROTO 286
#define META_PKTTYPE 287
#define META_PKTLEN 288
#define META_DATALEN 289
#define META_MACLEN 290
#define META_MARK 291
#define META_TCINDEX 292
#define META_RTCLASSID 293
#define META_RTIIF 294
#define META_SK_FAMILY 295
#define META_SK_STATE 296
#define META_SK_REUSE 297
#define META_SK_REFCNT 298
#define META_SK_RCVBUF 299
#define META_SK_SNDBUF 300
#define META_SK_SHUTDOWN 301
#define META_SK_PROTO 302
#define META_SK_TYPE 303
#define META_SK_RMEM_ALLOC 304
#define META_SK_WMEM_ALLOC 305
#define META_SK_WMEM_QUEUED 306
#define META_SK_RCV_QLEN 307
#define META_SK_SND_QLEN 308
#define META_SK_ERR_QLEN 309
#define META_SK_FORWARD_ALLOCS 310
#define META_SK_ALLOCS 311
#define META_SK_ROUTE_CAPS 312
#define META_SK_HASH 313
#define META_SK_LINGERTIME 314
#define META_SK_ACK_BACKLOG 315
#define META_SK_MAX_ACK_BACKLOG 316
#define META_SK_PRIO 317
#define META_SK_RCVLOWAT 318
#define META_SK_RCVTIMEO 319
#define META_SK_SNDTIMEO 320
#define META_SK_SENDMSG_OFF 321
#define META_SK_WRITE_PENDING 322
#define META_VLAN 323
#define META_RXHASH 324
#define META_DEVNAME 325
#define META_SK_BOUND_IF 326
#define STR 327
#define QUOTED 328
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 41 "lib/route/cls/ematch_syntax.y"
struct tcf_em_cmp cmp;
struct ematch_quoted q;
struct rtnl_ematch * e;
struct rtnl_pktloc * loc;
struct rtnl_meta_value *mv;
uint32_t i;
uint64_t i64;
char * s;
#line 214 "lib/route/cls/ematch_syntax.h"
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
int ematch_parse (void *scanner, char **errp, struct nl_list_head *root);
#endif /* !YY_EMATCH_LIB_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED */
File diff suppressed because it is too large Load Diff
+733
View File
@@ -0,0 +1,733 @@
#ifndef pktloc_HEADER_H
#define pktloc_HEADER_H 1
#define pktloc_IN_HEADER 1
#line 6 "lib/route/pktloc_grammar.h"
#line 8 "lib/route/pktloc_grammar.h"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
#ifdef yy_create_buffer
#define pktloc__create_buffer_ALREADY_DEFINED
#else
#define yy_create_buffer pktloc__create_buffer
#endif
#ifdef yy_delete_buffer
#define pktloc__delete_buffer_ALREADY_DEFINED
#else
#define yy_delete_buffer pktloc__delete_buffer
#endif
#ifdef yy_scan_buffer
#define pktloc__scan_buffer_ALREADY_DEFINED
#else
#define yy_scan_buffer pktloc__scan_buffer
#endif
#ifdef yy_scan_string
#define pktloc__scan_string_ALREADY_DEFINED
#else
#define yy_scan_string pktloc__scan_string
#endif
#ifdef yy_scan_bytes
#define pktloc__scan_bytes_ALREADY_DEFINED
#else
#define yy_scan_bytes pktloc__scan_bytes
#endif
#ifdef yy_init_buffer
#define pktloc__init_buffer_ALREADY_DEFINED
#else
#define yy_init_buffer pktloc__init_buffer
#endif
#ifdef yy_flush_buffer
#define pktloc__flush_buffer_ALREADY_DEFINED
#else
#define yy_flush_buffer pktloc__flush_buffer
#endif
#ifdef yy_load_buffer_state
#define pktloc__load_buffer_state_ALREADY_DEFINED
#else
#define yy_load_buffer_state pktloc__load_buffer_state
#endif
#ifdef yy_switch_to_buffer
#define pktloc__switch_to_buffer_ALREADY_DEFINED
#else
#define yy_switch_to_buffer pktloc__switch_to_buffer
#endif
#ifdef yypush_buffer_state
#define pktloc_push_buffer_state_ALREADY_DEFINED
#else
#define yypush_buffer_state pktloc_push_buffer_state
#endif
#ifdef yypop_buffer_state
#define pktloc_pop_buffer_state_ALREADY_DEFINED
#else
#define yypop_buffer_state pktloc_pop_buffer_state
#endif
#ifdef yyensure_buffer_stack
#define pktloc_ensure_buffer_stack_ALREADY_DEFINED
#else
#define yyensure_buffer_stack pktloc_ensure_buffer_stack
#endif
#ifdef yylex
#define pktloc_lex_ALREADY_DEFINED
#else
#define yylex pktloc_lex
#endif
#ifdef yyrestart
#define pktloc_restart_ALREADY_DEFINED
#else
#define yyrestart pktloc_restart
#endif
#ifdef yylex_init
#define pktloc_lex_init_ALREADY_DEFINED
#else
#define yylex_init pktloc_lex_init
#endif
#ifdef yylex_init_extra
#define pktloc_lex_init_extra_ALREADY_DEFINED
#else
#define yylex_init_extra pktloc_lex_init_extra
#endif
#ifdef yylex_destroy
#define pktloc_lex_destroy_ALREADY_DEFINED
#else
#define yylex_destroy pktloc_lex_destroy
#endif
#ifdef yyget_debug
#define pktloc_get_debug_ALREADY_DEFINED
#else
#define yyget_debug pktloc_get_debug
#endif
#ifdef yyset_debug
#define pktloc_set_debug_ALREADY_DEFINED
#else
#define yyset_debug pktloc_set_debug
#endif
#ifdef yyget_extra
#define pktloc_get_extra_ALREADY_DEFINED
#else
#define yyget_extra pktloc_get_extra
#endif
#ifdef yyset_extra
#define pktloc_set_extra_ALREADY_DEFINED
#else
#define yyset_extra pktloc_set_extra
#endif
#ifdef yyget_in
#define pktloc_get_in_ALREADY_DEFINED
#else
#define yyget_in pktloc_get_in
#endif
#ifdef yyset_in
#define pktloc_set_in_ALREADY_DEFINED
#else
#define yyset_in pktloc_set_in
#endif
#ifdef yyget_out
#define pktloc_get_out_ALREADY_DEFINED
#else
#define yyget_out pktloc_get_out
#endif
#ifdef yyset_out
#define pktloc_set_out_ALREADY_DEFINED
#else
#define yyset_out pktloc_set_out
#endif
#ifdef yyget_leng
#define pktloc_get_leng_ALREADY_DEFINED
#else
#define yyget_leng pktloc_get_leng
#endif
#ifdef yyget_text
#define pktloc_get_text_ALREADY_DEFINED
#else
#define yyget_text pktloc_get_text
#endif
#ifdef yyget_lineno
#define pktloc_get_lineno_ALREADY_DEFINED
#else
#define yyget_lineno pktloc_get_lineno
#endif
#ifdef yyset_lineno
#define pktloc_set_lineno_ALREADY_DEFINED
#else
#define yyset_lineno pktloc_set_lineno
#endif
#ifdef yyget_column
#define pktloc_get_column_ALREADY_DEFINED
#else
#define yyget_column pktloc_get_column
#endif
#ifdef yyset_column
#define pktloc_set_column_ALREADY_DEFINED
#else
#define yyset_column pktloc_set_column
#endif
#ifdef yywrap
#define pktloc_wrap_ALREADY_DEFINED
#else
#define yywrap pktloc_wrap
#endif
#ifdef yyget_lval
#define pktloc_get_lval_ALREADY_DEFINED
#else
#define yyget_lval pktloc_get_lval
#endif
#ifdef yyset_lval
#define pktloc_set_lval_ALREADY_DEFINED
#else
#define yyset_lval pktloc_set_lval
#endif
#ifdef yyget_lloc
#define pktloc_get_lloc_ALREADY_DEFINED
#else
#define yyget_lloc pktloc_get_lloc
#endif
#ifdef yyset_lloc
#define pktloc_set_lloc_ALREADY_DEFINED
#else
#define yyset_lloc pktloc_set_lloc
#endif
#ifdef yyalloc
#define pktloc_alloc_ALREADY_DEFINED
#else
#define yyalloc pktloc_alloc
#endif
#ifdef yyrealloc
#define pktloc_realloc_ALREADY_DEFINED
#else
#define yyrealloc pktloc_realloc
#endif
#ifdef yyfree
#define pktloc_free_ALREADY_DEFINED
#else
#define yyfree pktloc_free
#endif
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* end standard C headers. */
/* flex integer type definitions */
#ifndef FLEXINT_H
#define FLEXINT_H
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
#ifndef SIZE_MAX
#define SIZE_MAX (~(size_t)0)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
/* begin standard C++ headers. */
/* TODO: this is always defined, so inline it */
#define yyconst const
#if defined(__GNUC__) && __GNUC__ >= 3
#define yynoreturn __attribute__((__noreturn__))
#else
#define yynoreturn
#endif
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
typedef void* yyscan_t;
#endif
/* For convenience, these vars (plus the bison vars far below)
are macros in the reentrant scanner. */
#define yyin yyg->yyin_r
#define yyout yyg->yyout_r
#define yyextra yyg->yyextra_r
#define yyleng yyg->yyleng_r
#define yytext yyg->yytext_r
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
void yyrestart ( FILE *input_file , yyscan_t yyscanner );
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
void yypop_buffer_state ( yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
void yyfree ( void * , yyscan_t yyscanner );
#define pktloc_wrap(yyscanner) (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
#define yytext_ptr yytext_r
#ifdef YY_HEADER_EXPORT_START_CONDITIONS
#define INITIAL 0
#endif
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#include <unistd.h>
#endif
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
int yylex_init (yyscan_t* scanner);
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int yylex_destroy ( yyscan_t yyscanner );
int yyget_debug ( yyscan_t yyscanner );
void yyset_debug ( int debug_flag , yyscan_t yyscanner );
YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
FILE *yyget_in ( yyscan_t yyscanner );
void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
FILE *yyget_out ( yyscan_t yyscanner );
void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
int yyget_leng ( yyscan_t yyscanner );
char *yyget_text ( yyscan_t yyscanner );
int yyget_lineno ( yyscan_t yyscanner );
void yyset_lineno ( int _line_number , yyscan_t yyscanner );
int yyget_column ( yyscan_t yyscanner );
void yyset_column ( int _column_no , yyscan_t yyscanner );
YYSTYPE * yyget_lval ( yyscan_t yyscanner );
void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap ( yyscan_t yyscanner );
#else
extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef yytext_ptr
static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
extern int yylex \
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
#define YY_DECL int yylex \
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
#endif /* !YY_DECL */
/* yy_get_previous_state - get the state just before the EOB char was reached */
#undef YY_NEW_FILE
#undef YY_FLUSH_BUFFER
#undef yy_set_bol
#undef yy_new_buffer
#undef yy_set_interactive
#undef YY_DO_BEFORE_ACTION
#ifdef YY_DECL_IS_OURS
#undef YY_DECL_IS_OURS
#undef YY_DECL
#endif
#ifndef pktloc__create_buffer_ALREADY_DEFINED
#undef yy_create_buffer
#endif
#ifndef pktloc__delete_buffer_ALREADY_DEFINED
#undef yy_delete_buffer
#endif
#ifndef pktloc__scan_buffer_ALREADY_DEFINED
#undef yy_scan_buffer
#endif
#ifndef pktloc__scan_string_ALREADY_DEFINED
#undef yy_scan_string
#endif
#ifndef pktloc__scan_bytes_ALREADY_DEFINED
#undef yy_scan_bytes
#endif
#ifndef pktloc__init_buffer_ALREADY_DEFINED
#undef yy_init_buffer
#endif
#ifndef pktloc__flush_buffer_ALREADY_DEFINED
#undef yy_flush_buffer
#endif
#ifndef pktloc__load_buffer_state_ALREADY_DEFINED
#undef yy_load_buffer_state
#endif
#ifndef pktloc__switch_to_buffer_ALREADY_DEFINED
#undef yy_switch_to_buffer
#endif
#ifndef pktloc_push_buffer_state_ALREADY_DEFINED
#undef yypush_buffer_state
#endif
#ifndef pktloc_pop_buffer_state_ALREADY_DEFINED
#undef yypop_buffer_state
#endif
#ifndef pktloc_ensure_buffer_stack_ALREADY_DEFINED
#undef yyensure_buffer_stack
#endif
#ifndef pktloc_lex_ALREADY_DEFINED
#undef yylex
#endif
#ifndef pktloc_restart_ALREADY_DEFINED
#undef yyrestart
#endif
#ifndef pktloc_lex_init_ALREADY_DEFINED
#undef yylex_init
#endif
#ifndef pktloc_lex_init_extra_ALREADY_DEFINED
#undef yylex_init_extra
#endif
#ifndef pktloc_lex_destroy_ALREADY_DEFINED
#undef yylex_destroy
#endif
#ifndef pktloc_get_debug_ALREADY_DEFINED
#undef yyget_debug
#endif
#ifndef pktloc_set_debug_ALREADY_DEFINED
#undef yyset_debug
#endif
#ifndef pktloc_get_extra_ALREADY_DEFINED
#undef yyget_extra
#endif
#ifndef pktloc_set_extra_ALREADY_DEFINED
#undef yyset_extra
#endif
#ifndef pktloc_get_in_ALREADY_DEFINED
#undef yyget_in
#endif
#ifndef pktloc_set_in_ALREADY_DEFINED
#undef yyset_in
#endif
#ifndef pktloc_get_out_ALREADY_DEFINED
#undef yyget_out
#endif
#ifndef pktloc_set_out_ALREADY_DEFINED
#undef yyset_out
#endif
#ifndef pktloc_get_leng_ALREADY_DEFINED
#undef yyget_leng
#endif
#ifndef pktloc_get_text_ALREADY_DEFINED
#undef yyget_text
#endif
#ifndef pktloc_get_lineno_ALREADY_DEFINED
#undef yyget_lineno
#endif
#ifndef pktloc_set_lineno_ALREADY_DEFINED
#undef yyset_lineno
#endif
#ifndef pktloc_get_column_ALREADY_DEFINED
#undef yyget_column
#endif
#ifndef pktloc_set_column_ALREADY_DEFINED
#undef yyset_column
#endif
#ifndef pktloc_wrap_ALREADY_DEFINED
#undef yywrap
#endif
#ifndef pktloc_get_lval_ALREADY_DEFINED
#undef yyget_lval
#endif
#ifndef pktloc_set_lval_ALREADY_DEFINED
#undef yyset_lval
#endif
#ifndef pktloc_get_lloc_ALREADY_DEFINED
#undef yyget_lloc
#endif
#ifndef pktloc_set_lloc_ALREADY_DEFINED
#undef yyset_lloc
#endif
#ifndef pktloc_alloc_ALREADY_DEFINED
#undef yyalloc
#endif
#ifndef pktloc_realloc_ALREADY_DEFINED
#undef yyrealloc
#endif
#ifndef pktloc_free_ALREADY_DEFINED
#undef yyfree
#endif
#ifndef pktloc_text_ALREADY_DEFINED
#undef yytext
#endif
#ifndef pktloc_leng_ALREADY_DEFINED
#undef yyleng
#endif
#ifndef pktloc_in_ALREADY_DEFINED
#undef yyin
#endif
#ifndef pktloc_out_ALREADY_DEFINED
#undef yyout
#endif
#ifndef pktloc__flex_debug_ALREADY_DEFINED
#undef yy_flex_debug
#endif
#ifndef pktloc_lineno_ALREADY_DEFINED
#undef yylineno
#endif
#ifndef pktloc_tables_fload_ALREADY_DEFINED
#undef yytables_fload
#endif
#ifndef pktloc_tables_destroy_ALREADY_DEFINED
#undef yytables_destroy
#endif
#ifndef pktloc_TABLES_NAME_ALREADY_DEFINED
#undef yyTABLES_NAME
#endif
#line 56 "lib/route/pktloc_grammar.l"
#line 732 "lib/route/pktloc_grammar.h"
#undef pktloc_IN_HEADER
#endif /* pktloc_HEADER_H */
File diff suppressed because it is too large Load Diff
+102
View File
@@ -0,0 +1,102 @@
/* A Bison parser, made by GNU Bison 3.5.1. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Undocumented macros, especially those whose name start with YY_,
are private implementation details. Do not rely on them. */
#ifndef YY_PKTLOC_LIB_ROUTE_PKTLOC_SYNTAX_H_INCLUDED
# define YY_PKTLOC_LIB_ROUTE_PKTLOC_SYNTAX_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int pktloc_debug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
ERROR = 258,
NUMBER = 259,
LAYER = 260,
ALIGN = 261,
NAME = 262
};
#endif
/* Tokens. */
#define ERROR 258
#define NUMBER 259
#define LAYER 260
#define ALIGN 261
#define NAME 262
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 18 "lib/route/pktloc_syntax.y"
struct rtnl_pktloc *l;
uint32_t i;
char *s;
#line 77 "lib/route/pktloc_syntax.h"
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
/* Location type. */
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE YYLTYPE;
struct YYLTYPE
{
int first_line;
int first_column;
int last_line;
int last_column;
};
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
#endif
int pktloc_parse (void *scanner);
#endif /* !YY_PKTLOC_LIB_ROUTE_PKTLOC_SYNTAX_H_INCLUDED */