OpenVAS Scanner 21.4.1
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
nasl_grammar.tab.c File Reference
#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   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 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 YY_USE(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 YYNOMEM   goto yyexhaustedlab
 
#define YYRECOVERING()   (!!yyerrstatus)
 
#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)   (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
 

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 *, 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_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

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "lib nasl"

GLib logging domain.

◆ LNB

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

◆ YY_

#define YY_ (   Msgid)    Msgid

◆ YY_ACCESSING_SYMBOL

#define YY_ACCESSING_SYMBOL (   State)    YY_CAST (yysymbol_kind_t, yystos[State])

Accessing symbol of state STATE.

◆ YY_ASSERT

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

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED

◆ YY_CAST

#define YY_CAST (   Type,
  Val 
)    ((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

◆ 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); \
} while (0)
#define yydebug
Definition: nasl_grammar.tab.c:71

◆ YY_REINTERPRET_CAST

#define YY_REINTERPRET_CAST (   Type,
  Val 
)    ((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); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)

◆ YY_USE

#define YY_USE (   E)    ((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, YY_("syntax error: cannot back up")); \
} \
while (0)
#define YY_(Msgid)
Definition: nasl_grammar.tab.c:410
#define YYERROR
Definition: nasl_grammar.tab.c:1105
@ 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:369

◆ 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:1138

◆ YYERRCODE

#define YYERRCODE   YYUNDEF

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

◆ yyerror

#define yyerror   naslerror

◆ YYERROR

#define YYERROR   goto yyerrorlab

◆ YYERROR_VERBOSE

#define YYERROR_VERBOSE

◆ YYFINAL

#define YYFINAL   78

◆ YYFPRINTF

#define YYFPRINTF   fprintf

◆ YYFREE

#define YYFREE   free

◆ YYINITDEPTH

#define YYINITDEPTH   200

◆ YYLAST

#define YYLAST   1029

◆ yylex

#define yylex   nasllex

◆ 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   126

◆ YYNSTATES

#define YYNSTATES   227

◆ YYNTOKENS

#define YYNTOKENS   73

◆ YYPACT_NINF

#define YYPACT_NINF   (-91)

◆ yypact_value_is_default

#define yypact_value_is_default (   Yyn)     ((Yyn) == YYPACT_NINF)

◆ yyparse

#define yyparse   naslparse

◆ YYPARSE_PARAM

#define YYPARSE_PARAM   parm

◆ YYPOPSTACK

#define YYPOPSTACK (   N)    (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 ( )    (!!yyerrstatus)

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM
Value:
: YY_CAST (YYSIZE_T, -1)))
#define YYPTRDIFF_MAXIMUM
Definition: nasl_grammar.tab.c:370
#define YY_CAST(Type, Val)
Definition: nasl_grammar.tab.c:138
#define YYSIZE_T
Definition: nasl_grammar.tab.c:383

◆ YYSIZE_T

#define YYSIZE_T   unsigned

◆ YYSIZEOF

#define YYSIZEOF (   X)    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:397
#define YYSIZEOF(X)
Definition: nasl_grammar.tab.c:393
#define YYSTACK_GAP_MAXIMUM
Definition: nasl_grammar.tab.c:557
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   (-69)

◆ yytable_value_is_error

#define yytable_value_is_error (   Yyn)     ((Yyn) == YYTABLE_NINF)

◆ YYTRANSLATE

#define YYTRANSLATE (   YYX)
Value:
(0 <= (YYX) && (YYX) <= YYMAXUTOK \
static const yytype_int8 yytranslate[]
Definition: nasl_grammar.tab.c:632
yysymbol_kind_t
Definition: nasl_grammar.tab.c:157
@ YYSYMBOL_YYUNDEF
Definition: nasl_grammar.tab.c:161
#define YYMAXUTOK
Definition: nasl_grammar.tab.c:620

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()

static 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()

static void load_checksums ( kb_t  kb)
static

◆ malloc()

void * malloc ( YYSIZE_T  )

◆ mylex()

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

◆ nasl_clean_ctx()

void nasl_clean_ctx ( naslctxt c)

◆ nasl_clean_inc()

void nasl_clean_inc ( void  )

◆ naslerror()

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

◆ nasllex()

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

◆ yy_reduce_print()

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

◆ yy_stack_print()

static void yy_stack_print ( yy_state_t yybottom,
yy_state_t yytop 
)
static

◆ yy_symbol_print()

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

◆ yy_symbol_value_print()

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

◆ yydestruct()

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

◆ yyparse()

int yyparse ( naslctxt parm)

◆ yysymbol_name()

static 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

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

◆ yydefgoto

const yytype_uint8 yydefgoto[]
static
Initial value:
=
{
0, 18, 19, 20, 21, 68, 69, 22, 76, 23,
24, 25, 26, 27, 28, 29, 30, 31, 96, 32,
110, 33, 56, 157, 158, 159, 57, 36, 58, 59,
162, 60, 161, 62, 111, 112, 63, 114, 64, 65,
66, 40, 41
}

◆ yypact

const yytype_int16 yypact[]
static
Initial value:
=
{
464, -53, -91, -50, 491, -6, -42, -91, -91, -6,
499, -40, -6, -6, -6, -6, -91, 259, 25, -91,
91, -91, -91, -91, -39, -91, -91, -91, -91, -91,
-91, -91, -91, -91, 23, -91, 553, -13, -91, -91,
-91, -91, 499, 26, 29, -30, 499, -21, -91, -91,
-18, 499, 499, 13, 499, 499, -91, -91, 961, 611,
-91, 798, -91, -91, -91, -91, -91, 19, -91, -91,
-12, -91, -91, -26, -91, -91, -9, 123, -91, -91,
-91, 499, -91, -91, 499, 499, 499, 499, 499, 499,
499, 499, 499, 499, 499, 566, -4, -91, -91, -91,
499, 499, 624, -6, 14, 37, 682, 39, 40, -91,
42, 7, 22, -91, -91, 37, 37, 499, 499, 499,
499, 499, 499, 499, 499, 499, 499, 499, 499, 19,
19, 499, 499, 499, 499, 499, 499, 499, 499, 499,
499, -91, -91, 28, -6, -91, -91, 798, 798, 798,
798, 798, 798, 798, 798, 798, 798, 35, -91, 33,
945, 798, 17, 798, 491, 499, 347, 740, 491, 36,
16, -91, 34, -91, 13, 882, 882, 882, 882, 851,
913, 882, 882, 398, 398, 398, 37, -91, -91, 882,
882, 354, 337, 415, 15, 15, 37, 37, 37, -91,
-91, -91, 499, 499, -91, 83, 409, -91, 491, -91,
27, 53, -91, -91, -91, 798, 491, 26, -91, -91,
47, -91, 38, 56, 491, -91, -91
}

◆ yypgoto

const yytype_int16 yypgoto[]
static
Initial value:
=
{
-91, -91, 101, -91, -91, -11, -20, -87, 48, 12,
-91, -91, -91, -91, -91, -91, -91, -91, -90, -91,
-64, -91, 6, -91, -74, -91, 24, 60, 0, 18,
-91, 30, 209, -91, -45, -91, -52, -41, -91, -91,
-91, -91, -91
}

◆ 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,
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,
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, 156, 156, 161, 167, 174, 174, 177, 187, 187,
188, 194, 203, 203, 204, 205, 219, 219, 219, 219,
222, 222, 222, 223, 223, 223, 223, 223, 224, 228,
232, 235, 241, 248, 254, 262, 262, 262, 262, 263,
273, 280, 288, 298, 298, 298, 298, 301, 309, 309,
312, 362, 370, 370, 371, 371, 377, 383, 392, 396,
397, 398, 399, 400, 401, 402, 403, 406, 410, 412,
412, 414, 422, 425, 426, 427, 428, 432, 433, 434,
435, 436, 437, 438, 439, 440, 441, 442, 443, 444,
445, 446, 447, 448, 449, 450, 451, 452, 453, 454,
455, 456, 457, 458, 459, 460, 461, 461, 461, 461,
461, 464, 466, 467, 471, 474, 480, 481, 485, 490,
492, 498, 498, 500, 502, 512, 520
}

◆ yystos

const yytype_int8 yystos[]
static
Initial value:
=
{
0, 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, 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:150

◆ yytranslate

const yytype_int8 yytranslate[]
static