OpenVAS Libraries
7.0.7
Main Page
Related Pages
Data Structures
Files
File List
Globals
nasl
nasl_lex_ctxt.h
Go to the documentation of this file.
1
/* Nessus Attack Scripting Language
2
*
3
* Copyright (C) 2002 - 2003 Michel Arboi and Renaud Deraison
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2,
7
* as published by the Free Software Foundation
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
*/
18
19
#ifndef _NASL_LEX_CTXT_H
20
#define _NASL_LEX_CTXT_H
21
22
/* for tree_cell */
23
#include "
nasl_tree.h
"
24
25
/* for nasl_array */
26
#include "
nasl_var.h
"
27
28
/* for nasl_func */
29
#include "
nasl_func.h
"
30
31
typedef
struct
struct_lex_ctxt
32
{
33
struct
struct_lex_ctxt
*
up_ctxt
;
34
tree_cell
*
ret_val
;
/* return value or exit flag */
35
unsigned
fct_ctxt
:1;
/* This is a function context */
36
unsigned
break_flag
:1;
/* Break from loop */
37
unsigned
cont_flag
:1;
/* Next iteration in loop */
38
unsigned
always_authenticated
:1;
39
struct
arglist
*
script_infos
;
40
int
recv_timeout
;
41
int
line_nb
;
42
/* Named variables hash set + anonymous variables array */
43
nasl_array
ctx_vars
;
44
/* Functions hash set */
45
nasl_func
*
functions
[
FUNC_NAME_HASH
];
46
}
lex_ctxt
;
47
48
#define NASL_COMPAT_LEX_CTXT "NASL compat lex context"
49
50
lex_ctxt
*
init_empty_lex_ctxt
(
void
);
51
void
free_lex_ctxt
(
lex_ctxt
*);
52
53
void
dump_ctxt
(
lex_ctxt
*);
54
55
nasl_func
*
get_func_ref_by_name
(
lex_ctxt
*,
const
char
*);
56
tree_cell
*
decl_nasl_func
(
lex_ctxt
*,
tree_cell
*);
57
nasl_func
*
insert_nasl_func
(
lex_ctxt
*,
const
char
*,
tree_cell
*);
58
tree_cell
*
nasl_func_call
(
lex_ctxt
*,
const
nasl_func
*,
tree_cell
*);
59
60
tree_cell
*
get_variable_by_name
(
lex_ctxt
*,
const
char
*);
61
tree_cell
*
get_array_elem
(
lex_ctxt
*,
const
char
*
/*array name */
,
62
tree_cell
*);
63
anon_nasl_var
*
add_numbered_var_to_ctxt
(
lex_ctxt
*,
int
,
tree_cell
*);
64
named_nasl_var
*
add_named_var_to_ctxt
(
lex_ctxt
*,
const
char
*,
tree_cell
*);
65
tree_cell
*
nasl_read_var_ref
(
lex_ctxt
*,
tree_cell
*);
66
tree_cell
*
nasl_incr_variable
(
lex_ctxt
*,
tree_cell
*,
int
,
int
);
67
tree_cell
*
nasl_return
(
lex_ctxt
*,
tree_cell
*);
68
69
tree_cell
*
decl_local_variables
(
lex_ctxt
*,
tree_cell
*);
70
tree_cell
*
decl_global_variables
(
lex_ctxt
*,
tree_cell
*);
71
72
tree_cell
*
cell2atom
(
lex_ctxt
*,
tree_cell
*);
73
74
75
int
get_int_var_by_num
(
lex_ctxt
*,
int
,
int
);
76
char
*
get_str_var_by_num
(
lex_ctxt
*,
int
);
77
int
get_int_var_by_name
(
lex_ctxt
*,
const
char
*,
int
);
78
int
get_int_local_var_by_name
(
lex_ctxt
*,
const
char
*,
int
);
79
char
*
get_str_var_by_name
(
lex_ctxt
*,
const
char
*);
80
char
*
get_str_local_var_by_name
(
lex_ctxt
*,
const
char
*);
81
82
int
get_var_size_by_name
(
lex_ctxt
*,
const
char
*);
83
int
get_local_var_size_by_name
(
lex_ctxt
*,
const
char
*);
84
int
get_local_var_type_by_name
(
lex_ctxt
*,
const
char
*);
85
86
87
int
get_var_size_by_num
(
lex_ctxt
*,
int
);
88
int
get_var_type_by_num
(
lex_ctxt
*,
int
);
89
#endif
Generated by
1.8.3.1