OpenVAS Scanner 23.23.1
nasl_grammar.tab.c File Reference
#include <ctype.h>
#include <pcap.h>
#include <string.h>
#include <sys/stat.h>
#include <glib.h>
#include "../misc/plugutils.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   30802
#define YYBISON_VERSION   "3.8.2"
#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 YYPARSE_ERRC   err_c
#define YYLEX_ERRC   err_c
#define LNB   (((naslctxt*)parm)->line_nb)
#define LN   (((naslctxt*)parm)->name)
#define ERRC   err_c
#define G_LOG_DOMAIN   "lib nasl"
 GLib logging domain.
#define YYERROR_VERBOSE
#define YY_CAST(Type, Val)
#define YY_REINTERPRET_CAST(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)
#define YY_(Msgid)
#define YY_ATTRIBUTE_PURE
#define YY_ATTRIBUTE_UNUSED
#define YY_USE(E)
#define YY_INITIAL_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)
#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   80
#define YYLAST   1009
#define YYNTOKENS   73
#define YYNNTS   43
#define YYNRULES   127
#define YYNSTATES   229
#define YYMAXUTOK   304
#define YYTRANSLATE(YYX)
#define YY_ACCESSING_SYMBOL(State)
#define YYPACT_NINF   (-77)
#define yypact_value_is_default(Yyn)
#define YYTABLE_NINF   (-70)
#define yytable_value_is_error(Yyn)
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrorlab
#define YYNOMEM   goto yyexhaustedlab
#define YYRECOVERING()
#define YYBACKUP(Token, Value)
#define YYERRCODE   YYUNDEF
#define YYFPRINTF   fprintf
#define YYDPRINTF(Args)
#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)

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

Enumerations

enum  yysymbol_kind_t {
  YYSYMBOL_YYEMPTY = -2 , YYSYMBOL_YYEOF = 0 , YYSYMBOL_YYerror = 1 , YYSYMBOL_YYUNDEF = 2 ,
  YYSYMBOL_IF = 3 , YYSYMBOL_ELSE = 4 , YYSYMBOL_EQ = 5 , YYSYMBOL_NEQ = 6 ,
  YYSYMBOL_SUPEQ = 7 , YYSYMBOL_INFEQ = 8 , YYSYMBOL_OR = 9 , YYSYMBOL_AND = 10 ,
  YYSYMBOL_MATCH = 11 , YYSYMBOL_NOMATCH = 12 , YYSYMBOL_REP = 13 , YYSYMBOL_FOR = 14 ,
  YYSYMBOL_REPEAT = 15 , YYSYMBOL_UNTIL = 16 , YYSYMBOL_FOREACH = 17 , YYSYMBOL_WHILE = 18 ,
  YYSYMBOL_BREAK = 19 , YYSYMBOL_CONTINUE = 20 , YYSYMBOL_FUNCTION = 21 , YYSYMBOL_RETURN = 22 ,
  YYSYMBOL_INCLUDE = 23 , YYSYMBOL_LOCAL = 24 , YYSYMBOL_GLOBAL = 25 , YYSYMBOL_PLUS_PLUS = 26 ,
  YYSYMBOL_MINUS_MINUS = 27 , YYSYMBOL_L_SHIFT = 28 , YYSYMBOL_R_SHIFT = 29 , YYSYMBOL_R_USHIFT = 30 ,
  YYSYMBOL_EXPO = 31 , YYSYMBOL_PLUS_EQ = 32 , YYSYMBOL_MINUS_EQ = 33 , YYSYMBOL_MULT_EQ = 34 ,
  YYSYMBOL_DIV_EQ = 35 , YYSYMBOL_MODULO_EQ = 36 , YYSYMBOL_L_SHIFT_EQ = 37 , YYSYMBOL_R_SHIFT_EQ = 38 ,
  YYSYMBOL_R_USHIFT_EQ = 39 , YYSYMBOL_RE_MATCH = 40 , YYSYMBOL_RE_NOMATCH = 41 , YYSYMBOL_ARROW = 42 ,
  YYSYMBOL_IDENT = 43 , YYSYMBOL_STRING1 = 44 , YYSYMBOL_STRING2 = 45 , YYSYMBOL_INTEGER = 46 ,
  YYSYMBOL_47_ = 47 , YYSYMBOL_48_ = 48 , YYSYMBOL_49_ = 49 , YYSYMBOL_50_ = 50 ,
  YYSYMBOL_51_ = 51 , YYSYMBOL_52_ = 52 , YYSYMBOL_53_ = 53 , YYSYMBOL_54_ = 54 ,
  YYSYMBOL_55_ = 55 , YYSYMBOL_56_ = 56 , YYSYMBOL_57_ = 57 , YYSYMBOL_NOT = 58 ,
  YYSYMBOL_UMINUS = 59 , YYSYMBOL_BIT_NOT = 60 , YYSYMBOL_61_ = 61 , YYSYMBOL_62_ = 62 ,
  YYSYMBOL_63_ = 63 , YYSYMBOL_64_ = 64 , YYSYMBOL_65_ = 65 , YYSYMBOL_66_ = 66 ,
  YYSYMBOL_67_ = 67 , YYSYMBOL_68_ = 68 , YYSYMBOL_69_ = 69 , YYSYMBOL_70_ = 70 ,
  YYSYMBOL_71_ = 71 , YYSYMBOL_72_ = 72 , YYSYMBOL_YYACCEPT = 73 , YYSYMBOL_tiptop = 74 ,
  YYSYMBOL_instr_decl_list = 75 , YYSYMBOL_instr_decl = 76 , YYSYMBOL_func_decl = 77 , YYSYMBOL_arg_decl = 78 ,
  YYSYMBOL_arg_decl_1 = 79 , YYSYMBOL_block = 80 , YYSYMBOL_instr_list = 81 , YYSYMBOL_instr = 82 ,
  YYSYMBOL_simple_instr = 83 , YYSYMBOL_ret = 84 , YYSYMBOL_if_block = 85 , YYSYMBOL_loop = 86 ,
  YYSYMBOL_for_loop = 87 , YYSYMBOL_while_loop = 88 , YYSYMBOL_repeat_loop = 89 , YYSYMBOL_foreach_loop = 90 ,
  YYSYMBOL_aff_func = 91 , YYSYMBOL_rep = 92 , YYSYMBOL_string = 93 , YYSYMBOL_inc = 94 ,
  YYSYMBOL_func_call = 95 , YYSYMBOL_arg_list = 96 , YYSYMBOL_arg_list_1 = 97 , YYSYMBOL_arg = 98 ,
  YYSYMBOL_aff = 99 , YYSYMBOL_lvalue = 100 , YYSYMBOL_identifier = 101 , YYSYMBOL_array_elem = 102 ,
  YYSYMBOL_array_index = 103 , YYSYMBOL_post_pre_incr = 104 , YYSYMBOL_expr = 105 , YYSYMBOL_const_array = 106 ,
  YYSYMBOL_list_array_data = 107 , YYSYMBOL_array_data = 108 , YYSYMBOL_atom = 109 , YYSYMBOL_simple_array_data = 110 ,
  YYSYMBOL_var = 111 , YYSYMBOL_var_name = 112 , YYSYMBOL_ipaddr = 113 , YYSYMBOL_loc = 114 ,
  YYSYMBOL_glob = 115
}
enum  { YYENOMEM = -2 }
enum  lex_state {
  ST_START = 0 , ST_SPACE , ST_IDENT , ST_ZERO ,
  ST_ZEROX , ST_OCT , ST_DEC , ST_HEX ,
  ST_COMMENT , ST_SUP , ST_INF , ST_SUP_EXCL ,
  ST_STRING1 , ST_STRING1_ESC , ST_STRING2 , ST_PLUS ,
  ST_MINUS , ST_MULT , ST_DIV , ST_MODULO ,
  ST_R_SHIFT , ST_R_USHIFT , ST_L_SHIFT , ST_NOT ,
  ST_EQ , ST_AND , ST_OR
}

Functions

static void naslerror (naslctxt *, int *, const char *)
static int nasllex (YYSTYPE *lvalp, void *parm, int *err_c)
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, int *err_c)
static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, naslctxt *parm, int *err_c)
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, int *err_c)
static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, naslctxt *parm, int *err_c)
int yyparse (naslctxt *parm, int *err_c)
int add_nasl_inc_dir (const char *dir)
 Adds the given string as directory for searching for includes.
static void load_checksums (kb_t kb)
static char * file_checksum (const char *filename, int algorithm)
 Get the checksum of a file.
int init_nasl_ctx (naslctxt *pc, const char *name)
 Initialize a NASL context for a NASL file.
void nasl_clean_ctx (naslctxt *c)
void nasl_clean_inc (void)
int nasl_get_include_order (const char *c)
static int mylex (YYSTYPE *lvalp, void *parm)

Variables

static char * parse_buffer = NULL
static int parse_len = 0
static int include_order = 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_uint8 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

Macro Definition Documentation

◆ ERRC

#define ERRC   err_c

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "lib nasl"

GLib logging domain.

◆ LN

#define LN   (((naslctxt*)parm)->name)

◆ LNB

#define LNB   (((naslctxt*)parm)->line_nb)

◆ YY_

#define YY_ ( Msgid)
Value:
Msgid

◆ YY_ACCESSING_SYMBOL

#define YY_ACCESSING_SYMBOL ( State)
Value:
yysymbol_kind_t
Definition nasl_grammar.tab.c:146
#define YY_CAST(Type, Val)
Definition nasl_grammar.tab.c:127
static const yytype_int8 yystos[]
Definition nasl_grammar.tab.c:1019

Accessing symbol of state STATE.

◆ YY_ASSERT

#define YY_ASSERT ( E)
Value:
((void) (0 && (E)))

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED

◆ YY_CAST

#define YY_CAST ( Type,
Val )
Value:
((Type) (Val))

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

◆ YY_IGNORE_USELESS_CAST_BEGIN

#define YY_IGNORE_USELESS_CAST_BEGIN

◆ YY_IGNORE_USELESS_CAST_END

#define YY_IGNORE_USELESS_CAST_END

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE ( Value)
Value:
Value

◆ YY_NULLPTR

#define YY_NULLPTR   ((void*)0)

◆ YY_REDUCE_PRINT

#define YY_REDUCE_PRINT ( Rule)
Value:
do { \
if (yydebug) \
yy_reduce_print (yyssp, yyvsp, Rule, parm, err_c); \
} while (0)
#define yydebug
Definition nasl_grammar.tab.c:71

◆ YY_REINTERPRET_CAST

#define YY_REINTERPRET_CAST ( Type,
Val )
Value:
((Type) (Val))

◆ YY_STACK_PRINT

#define YY_STACK_PRINT ( Bottom,
Top )
Value:
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
} while (0)

◆ YY_SYMBOL_PRINT

#define YY_SYMBOL_PRINT ( Title,
Kind,
Value,
Location )
Value:
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
Kind, Value, parm, err_c); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)

◆ YY_USE

#define YY_USE ( E)
Value:
((void) (E))

◆ YYABORT

#define YYABORT   goto yyabortlab

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

◆ YYBACKUP

#define YYBACKUP ( Token,
Value )
Value:
do \
if (yychar == YYEMPTY) \
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (parm, err_c, YY_("syntax error: cannot back up")); \
} \
while (0)
#define YY_(Msgid)
Definition nasl_grammar.tab.c:399
#define YYERROR
Definition nasl_grammar.tab.c:1090
@ YYEMPTY
Definition nasl_grammar.tab.h:53

◆ YYBISON

#define YYBISON   30802

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.8.2"

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

◆ YYCOPY

#define YYCOPY ( Dst,
Src,
Count )
Value:
do \
{ \
YYPTRDIFF_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
while (0)
#define YYPTRDIFF_T
Definition nasl_grammar.tab.c:358

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

◆ yydebug

#define yydebug   nasldebug

◆ YYDPRINTF

#define YYDPRINTF ( Args)
Value:
do { \
if (yydebug) \
YYFPRINTF Args; \
} while (0)
#define YYFPRINTF
Definition nasl_grammar.tab.c:1123

◆ YYERRCODE

#define YYERRCODE   YYUNDEF

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

◆ YYERROR

#define YYERROR   goto yyerrorlab

◆ yyerror

#define yyerror   naslerror

◆ YYERROR_VERBOSE

#define YYERROR_VERBOSE

◆ YYFINAL

#define YYFINAL   80

◆ YYFPRINTF

#define YYFPRINTF   fprintf

◆ YYFREE

#define YYFREE   free

◆ YYINITDEPTH

#define YYINITDEPTH   200

◆ YYLAST

#define YYLAST   1009

◆ yylex

#define yylex   nasllex

◆ YYLEX_ERRC

#define YYLEX_ERRC   err_c

◆ YYLEX_PARAM

#define YYLEX_PARAM   parm

◆ YYMALLOC

#define YYMALLOC   malloc

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

◆ YYMAXUTOK

#define YYMAXUTOK   304

◆ yynerrs

#define yynerrs   naslnerrs

◆ YYNNTS

#define YYNNTS   43

◆ YYNOMEM

#define YYNOMEM   goto yyexhaustedlab

◆ YYNRULES

#define YYNRULES   127

◆ YYNSTATES

#define YYNSTATES   229

◆ YYNTOKENS

#define YYNTOKENS   73

◆ YYPACT_NINF

#define YYPACT_NINF   (-77)

◆ yypact_value_is_default

#define yypact_value_is_default ( Yyn)
Value:
((Yyn) == YYPACT_NINF)
#define YYPACT_NINF
Definition nasl_grammar.tab.c:715

◆ yyparse

#define yyparse   naslparse

◆ YYPARSE_ERRC

#define YYPARSE_ERRC   err_c

◆ YYPARSE_PARAM

#define YYPARSE_PARAM   parm

◆ YYPOPSTACK

#define YYPOPSTACK ( N)
Value:
(yyvsp -= (N), yyssp -= (N))

◆ YYPTRDIFF_MAXIMUM

#define YYPTRDIFF_MAXIMUM   LONG_MAX

◆ YYPTRDIFF_T

#define YYPTRDIFF_T   long

◆ YYPULL

#define YYPULL   1

◆ YYPURE

#define YYPURE   1

◆ YYPUSH

#define YYPUSH   0

◆ YYRECOVERING

#define YYRECOVERING ( )
Value:
(!!yyerrstatus)

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM
Value:
: YY_CAST (YYSIZE_T, -1)))
#define YYPTRDIFF_MAXIMUM
Definition nasl_grammar.tab.c:359
#define YYSIZE_T
Definition nasl_grammar.tab.c:372

◆ YYSIZE_T

#define YYSIZE_T   unsigned

◆ YYSIZEOF

#define YYSIZEOF ( X)
Value:
YY_CAST (YYPTRDIFF_T, sizeof (X))

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   YYMALLOC

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

◆ YYSTACK_BYTES

#define YYSTACK_BYTES ( N)
Value:
yytype_uint8 yy_state_t
Definition nasl_grammar.tab.c:386
#define YYSIZEOF(X)
Definition nasl_grammar.tab.c:382
#define YYSTACK_GAP_MAXIMUM
Definition nasl_grammar.tab.c:546
Definition nasl_grammar.tab.h:111

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

◆ YYSTACK_GAP_MAXIMUM

#define YYSTACK_GAP_MAXIMUM   (YYSIZEOF (union yyalloc) - 1)

◆ YYSTACK_RELOCATE

#define YYSTACK_RELOCATE ( Stack_alloc,
Stack )
Value:
do \
{ \
YYPTRDIFF_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / YYSIZEOF (*yyptr); \
} \
while (0)

◆ YYTABLE_NINF

#define YYTABLE_NINF   (-70)

◆ yytable_value_is_error

#define yytable_value_is_error ( Yyn)
Value:
((Yyn) == YYTABLE_NINF)
#define YYTABLE_NINF
Definition nasl_grammar.tab.c:720

◆ YYTRANSLATE

#define YYTRANSLATE ( YYX)
Value:
(0 <= (YYX) && (YYX) <= YYMAXUTOK \
static const yytype_int8 yytranslate[]
Definition nasl_grammar.tab.c:621
@ YYSYMBOL_YYUNDEF
Definition nasl_grammar.tab.c:150
#define YYMAXUTOK
Definition nasl_grammar.tab.c:609

Typedef Documentation

◆ yy_state_fast_t

typedef int yy_state_fast_t

◆ yy_state_t

◆ yysymbol_kind_t

◆ yytype_int16

typedef short yytype_int16

◆ yytype_int8

typedef signed char yytype_int8

◆ yytype_uint16

typedef unsigned short yytype_uint16

◆ yytype_uint8

typedef unsigned char yytype_uint8

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
YYENOMEM 

◆ lex_state

enum lex_state
Enumerator
ST_START 
ST_SPACE 
ST_IDENT 
ST_ZERO 
ST_ZEROX 
ST_OCT 
ST_DEC 
ST_HEX 
ST_COMMENT 
ST_SUP 
ST_INF 
ST_SUP_EXCL 
ST_STRING1 
ST_STRING1_ESC 
ST_STRING2 
ST_PLUS 
ST_MINUS 
ST_MULT 
ST_DIV 
ST_MODULO 
ST_R_SHIFT 
ST_R_USHIFT 
ST_L_SHIFT 
ST_NOT 
ST_EQ 
ST_AND 
ST_OR 

◆ yysymbol_kind_t

Enumerator
YYSYMBOL_YYEMPTY 
YYSYMBOL_YYEOF 
YYSYMBOL_YYerror 
YYSYMBOL_YYUNDEF 
YYSYMBOL_IF 
YYSYMBOL_ELSE 
YYSYMBOL_EQ 
YYSYMBOL_NEQ 
YYSYMBOL_SUPEQ 
YYSYMBOL_INFEQ 
YYSYMBOL_OR 
YYSYMBOL_AND 
YYSYMBOL_MATCH 
YYSYMBOL_NOMATCH 
YYSYMBOL_REP 
YYSYMBOL_FOR 
YYSYMBOL_REPEAT 
YYSYMBOL_UNTIL 
YYSYMBOL_FOREACH 
YYSYMBOL_WHILE 
YYSYMBOL_BREAK 
YYSYMBOL_CONTINUE 
YYSYMBOL_FUNCTION 
YYSYMBOL_RETURN 
YYSYMBOL_INCLUDE 
YYSYMBOL_LOCAL 
YYSYMBOL_GLOBAL 
YYSYMBOL_PLUS_PLUS 
YYSYMBOL_MINUS_MINUS 
YYSYMBOL_L_SHIFT 
YYSYMBOL_R_SHIFT 
YYSYMBOL_R_USHIFT 
YYSYMBOL_EXPO 
YYSYMBOL_PLUS_EQ 
YYSYMBOL_MINUS_EQ 
YYSYMBOL_MULT_EQ 
YYSYMBOL_DIV_EQ 
YYSYMBOL_MODULO_EQ 
YYSYMBOL_L_SHIFT_EQ 
YYSYMBOL_R_SHIFT_EQ 
YYSYMBOL_R_USHIFT_EQ 
YYSYMBOL_RE_MATCH 
YYSYMBOL_RE_NOMATCH 
YYSYMBOL_ARROW 
YYSYMBOL_IDENT 
YYSYMBOL_STRING1 
YYSYMBOL_STRING2 
YYSYMBOL_INTEGER 
YYSYMBOL_47_ 
YYSYMBOL_48_ 
YYSYMBOL_49_ 
YYSYMBOL_50_ 
YYSYMBOL_51_ 
YYSYMBOL_52_ 
YYSYMBOL_53_ 
YYSYMBOL_54_ 
YYSYMBOL_55_ 
YYSYMBOL_56_ 
YYSYMBOL_57_ 
YYSYMBOL_NOT 
YYSYMBOL_UMINUS 
YYSYMBOL_BIT_NOT 
YYSYMBOL_61_ 
YYSYMBOL_62_ 
YYSYMBOL_63_ 
YYSYMBOL_64_ 
YYSYMBOL_65_ 
YYSYMBOL_66_ 
YYSYMBOL_67_ 
YYSYMBOL_68_ 
YYSYMBOL_69_ 
YYSYMBOL_70_ 
YYSYMBOL_71_ 
YYSYMBOL_72_ 
YYSYMBOL_YYACCEPT 
YYSYMBOL_tiptop 
YYSYMBOL_instr_decl_list 
YYSYMBOL_instr_decl 
YYSYMBOL_func_decl 
YYSYMBOL_arg_decl 
YYSYMBOL_arg_decl_1 
YYSYMBOL_block 
YYSYMBOL_instr_list 
YYSYMBOL_instr 
YYSYMBOL_simple_instr 
YYSYMBOL_ret 
YYSYMBOL_if_block 
YYSYMBOL_loop 
YYSYMBOL_for_loop 
YYSYMBOL_while_loop 
YYSYMBOL_repeat_loop 
YYSYMBOL_foreach_loop 
YYSYMBOL_aff_func 
YYSYMBOL_rep 
YYSYMBOL_string 
YYSYMBOL_inc 
YYSYMBOL_func_call 
YYSYMBOL_arg_list 
YYSYMBOL_arg_list_1 
YYSYMBOL_arg 
YYSYMBOL_aff 
YYSYMBOL_lvalue 
YYSYMBOL_identifier 
YYSYMBOL_array_elem 
YYSYMBOL_array_index 
YYSYMBOL_post_pre_incr 
YYSYMBOL_expr 
YYSYMBOL_const_array 
YYSYMBOL_list_array_data 
YYSYMBOL_array_data 
YYSYMBOL_atom 
YYSYMBOL_simple_array_data 
YYSYMBOL_var 
YYSYMBOL_var_name 
YYSYMBOL_ipaddr 
YYSYMBOL_loc 
YYSYMBOL_glob 

Function Documentation

◆ add_nasl_inc_dir()

int add_nasl_inc_dir ( const char * dir)

Adds the given string as directory for searching for includes.

Parameters
dirA 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.
Returns
0 in case of success. -1 if the stat on the given directory path was unsuccessful. -2 if the given directory path was not a directory.

◆ file_checksum()

char * file_checksum ( const char * filename,
int algorithm )
static

Get the checksum of a file.

Parameters
[in]filenamePath to file.
[in]algorithmLibgcrypt hash algorithm to use for generating the checksum.
Returns
checksum string, NULL otherwise.

◆ free()

void free ( void * )

◆ init_nasl_ctx()

int init_nasl_ctx ( naslctxt * pc,
const char * name )

Initialize a NASL context for a NASL file.

Parameters
pcThe NASL context handler.
nameThe filename of the NASL script.
Returns
0 in case of success. Then, file content is set in pc->buffer. -1 if either the filename was not found/accessible or the signature verification failed (provided signature checking is enabled. In any case, various elements of pc are modified (initialized);

◆ load_checksums()

void load_checksums ( kb_t kb)
static

◆ malloc()

void * malloc ( YYSIZE_T )

◆ mylex()

int mylex ( YYSTYPE * lvalp,
void * parm )
static

◆ nasl_clean_ctx()

void nasl_clean_ctx ( naslctxt * c)

◆ nasl_clean_inc()

void nasl_clean_inc ( void )

◆ nasl_get_include_order()

int nasl_get_include_order ( const char * c)

◆ naslerror()

void naslerror ( naslctxt * parm,
int * error_counter,
const char * s )
static

◆ nasllex()

int nasllex ( YYSTYPE * lvalp,
void * parm,
int * err_c )
static

◆ yy_reduce_print()

void yy_reduce_print ( yy_state_t * yyssp,
YYSTYPE * yyvsp,
int yyrule,
naslctxt * parm,
int * err_c )
static

◆ yy_stack_print()

void yy_stack_print ( yy_state_t * yybottom,
yy_state_t * yytop )
static

◆ yy_symbol_print()

void yy_symbol_print ( FILE * yyo,
yysymbol_kind_t yykind,
YYSTYPE const *const yyvaluep,
naslctxt * parm,
int * err_c )
static

◆ yy_symbol_value_print()

void yy_symbol_value_print ( FILE * yyo,
yysymbol_kind_t yykind,
YYSTYPE const *const yyvaluep,
naslctxt * parm,
int * err_c )
static

◆ yydestruct()

void yydestruct ( const char * yymsg,
yysymbol_kind_t yykind,
YYSTYPE * yyvaluep,
naslctxt * parm,
int * err_c )
static

◆ yyparse()

int yyparse ( naslctxt * parm,
int * err_c )

◆ yysymbol_name()

const char * yysymbol_name ( yysymbol_kind_t yysymbol)
static

Variable Documentation

◆ checksum_algorithm

int checksum_algorithm = GCRY_MD_NONE
static

◆ inc_dirs

GSList* inc_dirs = NULL
static

◆ include_order

int include_order = 0
static

◆ includes_hash

GHashTable* includes_hash = NULL

◆ parse_buffer

char* parse_buffer = NULL
static

◆ parse_len

int parse_len = 0
static

◆ yycheck

const yytype_int16 yycheck[]
static

◆ yydebug

int yydebug

◆ yydefact

const yytype_int8 yydefact[]
static
Initial value:
=
{
0, 0, 0, 71, 0, 0, 0, 0, 29, 30,
0, 33, 0, 8, 8, 0, 0, 70, 0, 0,
2, 0, 6, 17, 5, 0, 25, 18, 19, 36,
37, 38, 39, 23, 26, 24, 21, 0, 68, 69,
22, 27, 28, 20, 0, 47, 0, 0, 0, 0,
119, 118, 117, 0, 0, 0, 0, 0, 123, 108,
124, 122, 96, 32, 111, 110, 107, 121, 109, 0,
126, 9, 10, 127, 74, 68, 75, 13, 0, 0,
1, 4, 16, 0, 76, 77, 0, 0, 0, 0,
0, 0, 0, 0, 0, 54, 0, 0, 0, 46,
44, 45, 0, 0, 0, 8, 0, 84, 0, 119,
118, 117, 0, 0, 113, 120, 115, 80, 85, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 49, 50, 0, 0, 12, 15, 48,
60, 61, 62, 63, 64, 67, 65, 66, 59, 0,
53, 55, 124, 57, 0, 73, 0, 0, 0, 0,
0, 0, 0, 78, 0, 112, 0, 103, 104, 105,
106, 81, 79, 97, 98, 95, 93, 94, 87, 99,
100, 101, 102, 92, 91, 90, 82, 83, 86, 88,
89, 51, 11, 52, 0, 0, 72, 34, 0, 42,
0, 41, 0, 0, 116, 114, 56, 58, 0, 47,
43, 7, 0, 35, 0, 0, 0, 125, 40
}

◆ yydefgoto

const yytype_uint8 yydefgoto[]
static
Initial value:
=
{
0, 19, 20, 21, 22, 70, 71, 23, 78, 24,
25, 26, 27, 28, 29, 30, 31, 32, 98, 33,
112, 34, 58, 159, 160, 161, 59, 37, 60, 61,
164, 62, 163, 64, 113, 114, 65, 116, 66, 67,
68, 41, 42
}

◆ yypact

const yytype_int16 yypact[]
static
Initial value:
=
{
340, -57, -35, -77, -27, 427, -5, -15, -77, -77,
-5, 538, -13, -5, -5, -5, -5, -77, 373, 50,
-77, 111, -77, -77, -77, -12, -77, -77, -77, -77,
-77, -77, -77, -77, -77, 38, -77, 507, -39, -77,
-77, -77, -77, -77, 538, -2, 48, -8, 538, 16,
-77, -77, -16, 538, 538, 40, 538, 538, -77, -77,
124, 592, -77, 837, -77, -77, -77, -77, -77, -1,
-77, -77, 15, -77, -77, -3, -77, -77, 25, 400,
-77, -77, -77, 538, -77, -77, 538, 538, 538, 538,
538, 538, 538, 538, 538, 538, 538, 605, 26, -77,
-77, -77, 538, 538, 663, -5, 34, 65, 721, 56,
57, -77, 58, 32, 39, -77, -77, 65, 65, 538,
538, 538, 538, 538, 538, 538, 538, 538, 538, 538,
538, -1, -1, 538, 538, 538, 538, 538, 538, 538,
538, 538, 538, -77, -77, 44, -5, -77, -77, 837,
837, 837, 837, 837, 837, 837, 837, 837, 837, 45,
-77, 46, 36, 837, 49, 837, 427, 538, 466, 779,
427, 51, 47, -77, 43, -77, 40, 921, 921, 921,
921, 890, 952, 921, 921, 160, 160, 160, 65, -77,
-77, 921, 921, 404, 316, 240, 4, 4, 65, 65,
65, -77, -77, -77, 538, 538, -77, 104, 519, -77,
427, -77, 53, 69, -77, -77, -77, 837, 427, -2,
-77, -77, 55, -77, 59, 77, 427, -77, -77
}

◆ yypgoto

const yytype_int16 yypgoto[]
static
Initial value:
=
{
-77, -77, 118, -77, -77, -11, -6, -71, 63, 14,
-77, -77, -77, -77, -77, -77, -77, -77, -76, -77,
-65, -77, 2, -77, -60, -77, 31, 24, 0, 12,
-77, 37, 189, -77, -31, -77, -54, -26, -77, -77,
-77, -77, -77
}

◆ yyr1

const yytype_int8 yyr1[]
static
Initial value:
=
{
0, 73, 74, 75, 75, 76, 76, 77, 78, 78,
79, 79, 80, 80, 81, 81, 82, 82, 82, 82,
82, 83, 83, 83, 83, 83, 83, 83, 83, 83,
83, 83, 84, 84, 85, 85, 86, 86, 86, 86,
87, 88, 89, 90, 91, 91, 91, 91, 92, 93,
93, 94, 95, 96, 96, 97, 97, 98, 98, 99,
99, 99, 99, 99, 99, 99, 99, 99, 100, 100,
101, 101, 102, 103, 104, 104, 104, 104, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 106, 107, 107, 108, 108, 109, 109, 109,
110, 111, 111, 111, 112, 113, 114, 115
}

◆ yyr2

const yytype_int8 yyr2[]
static
Initial value:
=
{
0, 2, 1, 1, 2, 1, 1, 6, 0, 1,
1, 3, 3, 2, 1, 2, 2, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 2, 1, 5, 7, 1, 1, 1, 1,
9, 5, 5, 6, 1, 1, 1, 0, 3, 1,
1, 4, 4, 1, 0, 1, 3, 1, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 1, 1,
1, 1, 4, 1, 2, 2, 2, 2, 3, 3,
2, 3, 3, 3, 2, 2, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 1, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 1, 1, 1,
1, 1, 3, 1, 3, 1, 3, 1, 1, 1,
1, 1, 1, 1, 1, 7, 2, 2
}

◆ yyrline

const yytype_int16 yyrline[]
static
Initial value:
=
{
0, 152, 152, 157, 163, 170, 170, 173, 184, 184,
185, 192, 202, 202, 203, 204, 219, 219, 219, 219,
220, 224, 224, 224, 225, 225, 225, 225, 225, 226,
231, 236, 239, 246, 254, 261, 270, 270, 270, 270,
271, 282, 290, 299, 310, 310, 310, 310, 313, 322,
322, 325, 385, 394, 394, 395, 395, 401, 408, 418,
422, 423, 424, 425, 426, 427, 428, 429, 432, 436,
438, 438, 440, 448, 451, 452, 453, 454, 458, 459,
460, 461, 462, 463, 464, 465, 466, 467, 468, 469,
470, 471, 472, 473, 474, 475, 476, 477, 478, 479,
480, 481, 482, 483, 484, 485, 486, 487, 487, 487,
487, 487, 490, 492, 493, 497, 500, 506, 507, 511,
516, 518, 524, 524, 526, 528, 538, 546
}

◆ yystos

const yytype_int8 yystos[]
static
Initial value:
=
{
0, 1, 3, 13, 14, 15, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 43, 64, 74,
75, 76, 77, 80, 82, 83, 84, 85, 86, 87,
88, 89, 90, 92, 94, 95, 99, 100, 101, 102,
104, 114, 115, 66, 61, 61, 82, 101, 61, 101,
44, 45, 46, 54, 61, 68, 70, 71, 95, 99,
101, 102, 104, 105, 106, 109, 111, 112, 113, 61,
78, 79, 101, 78, 100, 101, 100, 65, 81, 82,
0, 75, 66, 13, 26, 27, 32, 33, 34, 35,
36, 37, 38, 39, 47, 61, 68, 105, 91, 95,
99, 104, 16, 61, 105, 61, 72, 105, 105, 44,
45, 46, 93, 107, 108, 109, 110, 105, 105, 5,
6, 7, 8, 9, 10, 11, 12, 28, 29, 30,
31, 40, 41, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 44, 45, 93, 63, 65, 81, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 96,
97, 98, 101, 105, 103, 105, 62, 66, 105, 105,
62, 78, 46, 62, 42, 69, 63, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 93,
93, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 62, 79, 62, 63, 67, 69, 82, 105, 66,
62, 82, 62, 72, 110, 107, 97, 105, 4, 66,
82, 80, 46, 82, 91, 72, 62, 46, 82
}

◆ yytable

const yytype_int16 yytable[]
static

◆ yytname

const char* const yytname[]
static
Initial value:
=
{
"\"end of file\"", "error", "\"invalid token\"", "IF", "ELSE", "EQ",
"NEQ", "SUPEQ", "INFEQ", "OR", "AND", "MATCH", "NOMATCH", "REP", "FOR",
"REPEAT", "UNTIL", "FOREACH", "WHILE", "BREAK", "CONTINUE", "FUNCTION",
"RETURN", "INCLUDE", "LOCAL", "GLOBAL", "PLUS_PLUS", "MINUS_MINUS",
"L_SHIFT", "R_SHIFT", "R_USHIFT", "EXPO", "PLUS_EQ", "MINUS_EQ",
"MULT_EQ", "DIV_EQ", "MODULO_EQ", "L_SHIFT_EQ", "R_SHIFT_EQ",
"R_USHIFT_EQ", "RE_MATCH", "RE_NOMATCH", "ARROW", "IDENT", "STRING1",
"STRING2", "INTEGER", "'='", "'<'", "'>'", "'|'", "'^'", "'&'", "'+'",
"'-'", "'*'", "'/'", "'%'", "NOT", "UMINUS", "BIT_NOT", "'('", "')'",
"','", "'{'", "'}'", "';'", "':'", "'['", "']'", "'!'", "'~'", "'.'",
"$accept", "tiptop", "instr_decl_list", "instr_decl", "func_decl",
"arg_decl", "arg_decl_1", "block", "instr_list", "instr", "simple_instr",
"ret", "if_block", "loop", "for_loop", "while_loop", "repeat_loop",
"foreach_loop", "aff_func", "rep", "string", "inc", "func_call",
"arg_list", "arg_list_1", "arg", "aff", "lvalue", "identifier",
"array_elem", "array_index", "post_pre_incr", "expr", "const_array",
"list_array_data", "array_data", "atom", "simple_array_data", "var",
"var_name", "ipaddr", "loc", "glob", YY_NULLPTR
}
#define YY_NULLPTR
Definition nasl_grammar.tab.c:139

◆ yytranslate

const yytype_int8 yytranslate[]
static