Documentation
¶
Index ¶
- func ForEachParams(params *NaslBuildInMethodParam, handle func(value *yakvm.Value))
- type Executor
- func (e *Executor) Compile(code string) error
- func (engine *Executor) Debug(bool2 ...bool)
- func (e *Executor) EvalInclude(name string) error
- func (e *Executor) Exec(code, fileName string) error
- func (e *Executor) GetCompiler() *visitors.Compiler
- func (e *Executor) IsDebug() bool
- func (e *Executor) RunFile(path string) error
- func (e *Executor) SafeEval(code string) (err error)
- func (e *Executor) SafeRunFile(path string) (err error)
- func (engine *Executor) SetIncludePath(path string)
- func (e *Executor) SetLib(lib map[string]func(param *NaslBuildInMethodParam) any)
- type NaslBuildInMethodParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForEachParams ¶
func ForEachParams(params *NaslBuildInMethodParam, handle func(value *yakvm.Value))
Types ¶
type Executor ¶
type Executor struct { *yakvm.VirtualMachine Compiler *visitors.Compiler // contains filtered or unexported fields }
func NewNaslExecutor ¶
func NewNaslExecutor() *Executor
func NewWithContext ¶
func NewWithContext() *Executor
func (*Executor) EvalInclude ¶
func (*Executor) GetCompiler ¶
func (*Executor) RunFile ¶
func (e *Executor) LoadScript(path string) (*NaslScriptInfo, error) { e.SetDescription(true) oldIns := e.GetScriptObject() defer func() { e.SetDescription(false) e.scriptObj = oldIns }() e.scriptObj = NewNaslScriptObject() e.scriptObj.OriginFileName = filepath.Base(path) code, err := os.ReadFile(path) if err != nil { script, err := NewNaslScriptObjectFromDb(e.scriptObj.OriginFileName, e.dbcache) if err != nil { return nil, utils.Errorf("not found script file: %s", path) } return script, err } else { err = e.safeEvalWithFileName(string(code), e.scriptObj.OriginFileName) return e.scriptObj, err } }
func (*Executor) SafeRunFile ¶
func (*Executor) SetIncludePath ¶
type NaslBuildInMethodParam ¶
func NewNaslBuildInMethodParam ¶
func NewNaslBuildInMethodParam() *NaslBuildInMethodParam
func (*NaslBuildInMethodParam) GetParamByName ¶
func (n *NaslBuildInMethodParam) GetParamByName(name string, defaultValue ...interface{}) *yakvm.Value
func (*NaslBuildInMethodParam) GetParamByNumber ¶
func (n *NaslBuildInMethodParam) GetParamByNumber(index int, defaultValue ...interface{}) *yakvm.Value
Click to show internal directories.
Click to hide internal directories.