OpenVAS Libraries  9.0.1
Functions
nasl_host.c File Reference

Remote host helper functions. More...

#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <unistd.h>
#include "../misc/network.h"
#include "../base/openvas_networking.h"
#include "../misc/plugutils.h"
#include "../misc/pcap_openvas.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_host.h"

Functions

tree_cellget_hostname (lex_ctxt *lexic)
 
tree_cellget_host_ip (lex_ctxt *lexic)
 
tree_cellget_host_open_port (lex_ctxt *lexic)
 
tree_cellget_port_state (lex_ctxt *lexic)
 
tree_cellget_udp_port_state (lex_ctxt *lexic)
 
tree_cellnasl_islocalhost (lex_ctxt *lexic)
 
tree_cellnasl_islocalnet (lex_ctxt *lexic)
 
tree_cellnasl_this_host (lex_ctxt *lexic)
 
tree_cellnasl_this_host_name (lex_ctxt *lexic)
 
tree_cellget_port_transport (lex_ctxt *lexic)
 Return the encapsulation mode of a port. More...
 
tree_cellnasl_same_host (lex_ctxt *lexic)
 
tree_cellnasl_target_is_ipv6 (lex_ctxt *lexic)
 

Detailed Description

Remote host helper functions.

This file contains all the functions which deal with the remote host: which ports are open, what is its IP, what is our IP, what transport is on the remote port, and so on...

Function Documentation

◆ get_host_ip()

tree_cell* get_host_ip ( lex_ctxt lexic)

◆ get_host_open_port()

tree_cell* get_host_open_port ( lex_ctxt lexic)

◆ get_hostname()

tree_cell* get_hostname ( lex_ctxt lexic)

◆ get_port_state()

tree_cell* get_port_state ( lex_ctxt lexic)

◆ get_port_transport()

tree_cell* get_port_transport ( lex_ctxt lexic)

Return the encapsulation mode of a port.

NASL Function: get_port_transport

Takes a port number and returns its encapsulation mode (ENCAPS_*) The defined encapsulation modes are:

  • ENCAPS_AUTO Automatic encapsulation detection.
  • ENCAPS_IP No encapsulation
  • ENCAPS_SSLv23 Request compatibility options
  • ENCAPS_SSLv2 SSL version 2
  • ENCAPS_SSLv3 SSL version 3
  • ENCAPS_TLSv1 TLS version 1.0
  • ENCAPS_TLSv11 TLS version 1.1
  • ENCAPS_TLSv12 TLS version 1.2
  • ENCAPS_TLScustom SSL or TLS with custom priorities
NASL Unnamed Parameters:
  • An integer with the port number.
NASL Named Parameters:

-asstring If not 0 return a human readabale string instead of an integer.

NASL Returns:
An integer or a string with the encapsulation mode or NULL on error.
Parameters
[in]lexicLexical context of the NASL interpreter.
Returns
A tree cell.

◆ get_udp_port_state()

tree_cell* get_udp_port_state ( lex_ctxt lexic)

◆ nasl_islocalhost()

tree_cell* nasl_islocalhost ( lex_ctxt lexic)

◆ nasl_islocalnet()

tree_cell* nasl_islocalnet ( lex_ctxt lexic)

◆ nasl_same_host()

tree_cell* nasl_same_host ( lex_ctxt lexic)

◆ nasl_target_is_ipv6()

tree_cell* nasl_target_is_ipv6 ( lex_ctxt lexic)

◆ nasl_this_host()

tree_cell* nasl_this_host ( lex_ctxt lexic)

◆ nasl_this_host_name()

tree_cell* nasl_this_host_name ( lex_ctxt lexic)