OpenVAS Scanner
21.4.1
|
#include <ctype.h>
#include <pcap.h>
#include <string.h>
#include <sys/stat.h>
#include <glib.h>
#include "nasl_tree.h"
#include "nasl_global_ctxt.h"
#include "nasl_func.h"
#include "nasl_var.h"
#include "nasl_lex_ctxt.h"
#include "nasl_debug.h"
#include "nasl_signature.h"
#include "nasl_grammar.tab.h"
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <gvm/base/logging.h>
#include <gvm/base/prefs.h>
#include <libgen.h>
#include <gcrypt.h>
Data Structures | |
union | yyalloc |
Macros | |
#define | YYBISON 30704 |
#define | YYBISON_VERSION "3.7.4" |
#define | YYSKELETON_NAME "yacc.c" |
#define | YYPURE 1 |
#define | YYPUSH 0 |
#define | YYPULL 1 |
#define | yyparse naslparse |
#define | yylex nasllex |
#define | yyerror naslerror |
#define | yydebug nasldebug |
#define | yynerrs naslnerrs |
#define | YYPARSE_PARAM parm |
#define | YYLEX_PARAM parm |
#define | LNB (((naslctxt*)parm)->line_nb) |
#define | G_LOG_DOMAIN "lib nasl" |
GLib logging domain. More... | |
#define | YYERROR_VERBOSE |
#define | YY_CAST(Type, Val) ((Type) (Val)) |
#define | YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) |
#define | YY_NULLPTR ((void*)0) |
#define | YYPTRDIFF_T long |
#define | YYPTRDIFF_MAXIMUM LONG_MAX |
#define | YYSIZE_T unsigned |
#define | YYSIZE_MAXIMUM |
#define | YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) |
#define | YY_(Msgid) Msgid |
#define | YY_ATTRIBUTE_PURE |
#define | YY_ATTRIBUTE_UNUSED |
#define | YYUSE(E) ((void) (E)) |
#define | YY_INITIAL_VALUE(Value) Value |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_END |
#define | YY_IGNORE_USELESS_CAST_BEGIN |
#define | YY_IGNORE_USELESS_CAST_END |
#define | YY_ASSERT(E) ((void) (0 && (E))) |
#define | YYSTACK_ALLOC YYMALLOC |
#define | YYSTACK_FREE YYFREE |
#define | YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define | YYMALLOC malloc |
#define | YYFREE free |
#define | YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) |
#define | YYSTACK_BYTES(N) |
#define | YYCOPY_NEEDED 1 |
#define | YYSTACK_RELOCATE(Stack_alloc, Stack) |
#define | YYCOPY(Dst, Src, Count) |
#define | YYFINAL 78 |
#define | YYLAST 1029 |
#define | YYNTOKENS 73 |
#define | YYNNTS 43 |
#define | YYNRULES 126 |
#define | YYNSTATES 227 |
#define | YYMAXUTOK 304 |
#define | YYTRANSLATE(YYX) |
#define | YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) |
#define | YYPACT_NINF (-91) |
#define | yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF) |
#define | YYTABLE_NINF (-69) |
#define | yytable_value_is_error(Yyn) ((Yyn) == YYTABLE_NINF) |
#define | yyerrok (yyerrstatus = 0) |
#define | yyclearin (yychar = YYEMPTY) |
#define | YYACCEPT goto yyacceptlab |
#define | YYABORT goto yyabortlab |
#define | YYERROR goto yyerrorlab |
#define | YYRECOVERING() (!!yyerrstatus) |
#define | YYBACKUP(Token, Value) |
#define | YYERRCODE YYUNDEF |
#define | YYFPRINTF fprintf |
#define | YYDPRINTF(Args) |
#define | YY_LOCATION_PRINT(File, Loc) ((void) 0) |
#define | YY_SYMBOL_PRINT(Title, Kind, Value, Location) |
#define | YY_STACK_PRINT(Bottom, Top) |
#define | YY_REDUCE_PRINT(Rule) |
#define | YYINITDEPTH 200 |
#define | YYMAXDEPTH 10000 |
#define | YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
Typedefs | |
typedef enum yysymbol_kind_t | yysymbol_kind_t |
typedef signed char | yytype_int8 |
typedef short | yytype_int16 |
typedef unsigned char | yytype_uint8 |
typedef unsigned short | yytype_uint16 |
typedef yytype_uint8 | yy_state_t |
typedef int | yy_state_fast_t |
Functions | |
static void | naslerror (naslctxt *, const char *) |
static int | nasllex (YYSTYPE *lvalp, void *parm) |
void * | malloc (YYSIZE_T) |
void | free (void *) |
static const char * | yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED |
static void | yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, naslctxt *parm) |
static void | yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, naslctxt *parm) |
static void | yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) |
static void | yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, naslctxt *parm) |
static void | yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, naslctxt *parm) |
int | yyparse (naslctxt *parm) |
int | add_nasl_inc_dir (const char *dir) |
Adds the given string as directory for searching for includes. More... | |
static void | load_checksums (kb_t kb) |
static char * | file_checksum (const char *filename, int algorithm) |
Get the checksum of a file. More... | |
int | init_nasl_ctx (naslctxt *pc, const char *name) |
Initialize a NASL context for a NASL file. More... | |
void | nasl_clean_ctx (naslctxt *c) |
void | nasl_clean_inc (void) |
static int | mylex (YYSTYPE *lvalp, void *parm) |
Variables | |
static char * | parse_buffer = NULL |
static int | parse_len = 0 |
GHashTable * | includes_hash = NULL |
static const yytype_int8 | yytranslate [] |
static const yytype_int16 | yyrline [] |
static const char *const | yytname [] |
static const yytype_int16 | yypact [] |
static const yytype_int8 | yydefact [] |
static const yytype_int16 | yypgoto [] |
static const yytype_int16 | yydefgoto [] |
static const yytype_int16 | yytable [] |
static const yytype_int16 | yycheck [] |
static const yytype_int8 | yystos [] |
static const yytype_int8 | yyr1 [] |
static const yytype_int8 | yyr2 [] |
int | yydebug |
static GSList * | inc_dirs = NULL |
static int | checksum_algorithm = GCRY_MD_NONE |
#define G_LOG_DOMAIN "lib nasl" |
GLib logging domain.
#define LNB (((naslctxt*)parm)->line_nb) |
#define YY_ | ( | Msgid | ) | Msgid |
#define YY_ACCESSING_SYMBOL | ( | State | ) | YY_CAST (yysymbol_kind_t, yystos[State]) |
Accessing symbol of state STATE.
#define YY_ASSERT | ( | E | ) | ((void) (0 && (E))) |
#define YY_ATTRIBUTE_PURE |
#define YY_ATTRIBUTE_UNUSED |
#define YY_CAST | ( | Type, | |
Val | |||
) | ((Type) (Val)) |
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
#define YY_IGNORE_MAYBE_UNINITIALIZED_END |
#define YY_IGNORE_USELESS_CAST_BEGIN |
#define YY_IGNORE_USELESS_CAST_END |
#define YY_INITIAL_VALUE | ( | Value | ) | Value |
#define YY_LOCATION_PRINT | ( | File, | |
Loc | |||
) | ((void) 0) |
#define YY_NULLPTR ((void*)0) |
#define YY_REDUCE_PRINT | ( | Rule | ) |
#define YY_REINTERPRET_CAST | ( | Type, | |
Val | |||
) | ((Type) (Val)) |
#define YY_STACK_PRINT | ( | Bottom, | |
Top | |||
) |
#define YY_SYMBOL_PRINT | ( | Title, | |
Kind, | |||
Value, | |||
Location | |||
) |
#define YYABORT goto yyabortlab |
#define YYACCEPT goto yyacceptlab |
#define YYBACKUP | ( | Token, | |
Value | |||
) |
#define YYBISON 30704 |
#define YYBISON_VERSION "3.7.4" |
#define yyclearin (yychar = YYEMPTY) |
#define YYCOPY | ( | Dst, | |
Src, | |||
Count | |||
) |
#define YYCOPY_NEEDED 1 |
#define yydebug nasldebug |
#define YYDPRINTF | ( | Args | ) |
#define YYERRCODE YYUNDEF |
#define yyerrok (yyerrstatus = 0) |
#define yyerror naslerror |
#define YYERROR goto yyerrorlab |
#define YYERROR_VERBOSE |
#define YYFINAL 78 |
#define YYFPRINTF fprintf |
#define YYFREE free |
#define YYINITDEPTH 200 |
#define YYLAST 1029 |
#define yylex nasllex |
#define YYLEX_PARAM parm |
#define YYMALLOC malloc |
#define YYMAXDEPTH 10000 |
#define YYMAXUTOK 304 |
#define yynerrs naslnerrs |
#define YYNNTS 43 |
#define YYNRULES 126 |
#define YYNSTATES 227 |
#define YYNTOKENS 73 |
#define YYPACT_NINF (-91) |
#define yypact_value_is_default | ( | Yyn | ) | ((Yyn) == YYPACT_NINF) |
#define yyparse naslparse |
#define YYPARSE_PARAM parm |
#define YYPOPSTACK | ( | N | ) | (yyvsp -= (N), yyssp -= (N)) |
#define YYPTRDIFF_MAXIMUM LONG_MAX |
#define YYPTRDIFF_T long |
#define YYPULL 1 |
#define YYPURE 1 |
#define YYPUSH 0 |
#define YYRECOVERING | ( | ) | (!!yyerrstatus) |
#define YYSIZE_MAXIMUM |
#define YYSIZE_T unsigned |
#define YYSIZEOF | ( | X | ) | YY_CAST (YYPTRDIFF_T, sizeof (X)) |
#define YYSKELETON_NAME "yacc.c" |
#define YYSTACK_ALLOC YYMALLOC |
#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define YYSTACK_BYTES | ( | N | ) |
#define YYSTACK_FREE YYFREE |
#define YYSTACK_RELOCATE | ( | Stack_alloc, | |
Stack | |||
) |
#define YYTABLE_NINF (-69) |
#define yytable_value_is_error | ( | Yyn | ) | ((Yyn) == YYTABLE_NINF) |
#define YYTRANSLATE | ( | YYX | ) |
#define YYUSE | ( | E | ) | ((void) (E)) |
typedef int yy_state_fast_t |
typedef yytype_uint8 yy_state_t |
typedef enum yysymbol_kind_t yysymbol_kind_t |
typedef short yytype_int16 |
typedef signed char yytype_int8 |
typedef unsigned short yytype_uint16 |
typedef unsigned char yytype_uint8 |
enum lex_state |
enum yysymbol_kind_t |
int add_nasl_inc_dir | ( | const char * | dir | ) |
Adds the given string as directory for searching for includes.
dir | A directory path. This function will add a copy of this parameter to the list of include folders. This means the parameter can be freed elsewhere without affecting the list. |
|
static |
Get the checksum of a file.
[in] | filename | Path to file. |
[in] | algorithm | Libgcrypt hash algorithm to use for generating the checksum. |
void free | ( | void * | ) |
int init_nasl_ctx | ( | naslctxt * | pc, |
const char * | name | ||
) |
Initialize a NASL context for a NASL file.
pc | The NASL context handler. |
name | The filename of the NASL script. |
|
static |
void* malloc | ( | YYSIZE_T | ) |
|
static |
void nasl_clean_ctx | ( | naslctxt * | c | ) |
void nasl_clean_inc | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int yyparse | ( | naslctxt * | parm | ) |
|
static |
|
static |
|
static |
GHashTable* includes_hash = NULL |
|
static |
|
static |
|
static |
int yydebug |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |