package mopsa

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Hooks are modules that can observe the execution of the transfer functions without modifying their output. They can be used however to enrich the analysis by adding information to the context.

module type HOOK = sig ... end

Signature of a hook

module type STATELESS_HOOK = sig ... end

Signature of a stateless hook

val register_hook : (module HOOK) -> unit

Register a new hook

val register_stateless_hook : (module STATELESS_HOOK) -> unit

Register a new stateless hook

val activate_hook : string -> unit

Activate a registered hook

val find_hook : string -> (module HOOK)

Find a registered hook

val mem_hook : string -> bool

Check whether a hook exits

val list_hooks : unit -> (module HOOK) list

List all existing hooks

val deactivate_hook : string -> ('a, 'a) Manager.man -> 'a Flow.flow -> unit

Deactivate an active hook

val init : unit -> unit

Initialize hooks manager

val init_hook : string -> 'a Context.ctx -> 'a Context.ctx

Initialize an active hook

val is_hook_active : string -> bool

Check wether a hook is active

val init_active_hooks : 'a Context.ctx -> 'a Context.ctx

Initialize all active hooks

val on_before_exec : Route.route -> Ast.Stmt.stmt -> ('a, 'a) Manager.man -> 'a Flow.flow -> 'a Context.ctx option

Call on_before_exec on all active hooks

val on_after_exec : Route.route -> Ast.Stmt.stmt -> ('a, 'a) Manager.man -> 'a Flow.flow -> 'a Post.post -> 'a Context.ctx option

Call on_after_exec on all active hooks

val on_before_eval : Route.route -> Ast.Semantic.semantic -> Ast.Expr.expr -> ('a, 'a) Manager.man -> 'a Flow.flow -> 'a Context.ctx option

Call on_before_eval on all active hooks

val on_after_eval : Route.route -> Ast.Semantic.semantic -> Ast.Expr.expr -> ('a, 'a) Manager.man -> 'a Flow.flow -> 'a Eval.eval -> 'a Context.ctx option

Call on_after_eval on all active hooks

val on_finish : ('a, 'a) Manager.man -> 'a Flow.flow -> unit

Call on_finish on all active hooks

OCaml

Innovation. Community. Security.