OpenVAS Libraries  8.0.3
Macros | Functions | Variables
exec.c File Reference
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <glib.h>
#include <glib/gstdio.h>
#include "regex.h"
#include "../misc/openvas_logging.h"
#include "../misc/prefs.h"
#include "nasl.h"
#include "nasl_tree.h"
#include "nasl_global_ctxt.h"
#include "nasl_func.h"
#include "nasl_var.h"
#include "nasl_lex_ctxt.h"
#include "exec.h"
#include "nasl_debug.h"
#include "nasl_init.h"

Macros

#define _GNU_SOURCE
 
#define NASL_DEBUG   0
 

Functions

int naslparse (naslctxt *)
 
tree_cellcell2atom (lex_ctxt *lexic, tree_cell *c1)
 
int cell_cmp (lex_ctxt *lexic, tree_cell *c1, tree_cell *c2)
 
tree_cellnasl_exec (lex_ctxt *lexic, tree_cell *st)
 Execute a parse tree. More...
 
tree_cellnasl_lint (lex_ctxt *, tree_cell *)
 
int exec_nasl_script (struct arglist *script_infos, const char *name, const char *oid, int mode)
 Execute a NASL script. More...
 

Variables

FILE * nasl_trace_fp = NULL
 
lex_ctxttruc = NULL
 

Macro Definition Documentation

#define _GNU_SOURCE
#define NASL_DEBUG   0

Function Documentation

tree_cell* cell2atom ( lex_ctxt lexic,
tree_cell c1 
)
Returns
A 'referenced' cell.
int cell_cmp ( lex_ctxt lexic,
tree_cell c1,
tree_cell c2 
)
int exec_nasl_script ( struct arglist script_infos,
const char *  name,
const char *  oid,
int  mode 
)

Execute a NASL script.

"mode" is a bit field: bit #0 (1) is "description" Bit #1 (2) is "parse only"

Parameters
script_infosThe plugin as arglist. Has to be allocated.
nameFilename.
modeBit field describing launch mode (description, parse always signed).
Returns
0 if the script was executed successfully, negative values if an error occurred.
Todo:
Initialization of the library seems intuitively be necessary only once (involves "linking" the nasl functions to c code). Consider a "prototype" context that has to be created only once and of which copies are made when needed.
tree_cell* nasl_exec ( lex_ctxt lexic,
tree_cell st 
)

Execute a parse tree.

Todo:
There is a lot of duplicated code in following cases, could be refactored.
tree_cell* nasl_lint ( lex_ctxt ,
tree_cell  
)
int naslparse ( naslctxt )

Variable Documentation

FILE* nasl_trace_fp = NULL
lex_ctxt* truc = NULL