OpenVAS Scanner  6.0.1
Data Structures | Macros | Functions
nasl_builtin_openvas_tcp_scanner.c File Reference
#include "../misc/network.h"
#include "../misc/plugutils.h"
#include "nasl_lex_ctxt.h"
#include <errno.h>
#include <fcntl.h>
#include <glib.h>
#include <gvm/base/logging.h>
#include <gvm/base/prefs.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <limits.h>
#include <math.h>

Data Structures

struct  grab_socket_t
 

Macros

#define GRAB_MAX_SOCK   1024
 
#define GRAB_MIN_SOCK   32
 
#define GRAB_MAX_SOCK_SAFE   128
 
#define MAX_PASS_NB   16
 
#define MAXINT   0x7fffffffL
 
#define G_LOG_DOMAIN   "lib nasl"
 GLib logging domain. More...
 
#define DIFFTV(t1, t2)   (t1.tv_sec - t2.tv_sec + (t1.tv_usec - t2.tv_usec) / 1000000)
 
#define DIFFTVu(t1, t2)   ((t1.tv_sec - t2.tv_sec) * 1000000.0 + (t1.tv_usec - t2.tv_usec))
 
#define GRAB_SOCKET_UNUSED   0
 
#define GRAB_SOCKET_OPENING   1
 
#define GRAB_SOCKET_OPEN   2
 
#define GRAB_PORT_UNKNOWN   0
 
#define GRAB_PORT_CLOSED   1
 
#define GRAB_PORT_OPEN   2
 
#define GRAB_PORT_SILENT   3
 
#define GRAB_PORT_REJECTED   4
 
#define GRAB_PORT_NOT_TESTED   254
 
#define GRAB_PORT_TESTING   255
 
#define COMPUTE_RTT
 
#define MAX_SANE_RTT   2000000 /* micro-seconds */
 

Functions

static int my_socket_close (int s)
 
static int std_port (int port)
 
static int double_check_std_ports (unsigned char *ports_states)
 
static int banner_grab (const struct in6_addr *pia, const char *portrange, const int read_timeout, int min_cnx, int max_cnx, struct script_infos *desc)
 
tree_cellplugin_run_openvas_tcp_scanner (lex_ctxt *lexic)
 

Macro Definition Documentation

◆ COMPUTE_RTT

#define COMPUTE_RTT

◆ DIFFTV

#define DIFFTV (   t1,
  t2 
)    (t1.tv_sec - t2.tv_sec + (t1.tv_usec - t2.tv_usec) / 1000000)

◆ DIFFTVu

#define DIFFTVu (   t1,
  t2 
)    ((t1.tv_sec - t2.tv_sec) * 1000000.0 + (t1.tv_usec - t2.tv_usec))

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "lib nasl"

GLib logging domain.

◆ GRAB_MAX_SOCK

#define GRAB_MAX_SOCK   1024

◆ GRAB_MAX_SOCK_SAFE

#define GRAB_MAX_SOCK_SAFE   128

◆ GRAB_MIN_SOCK

#define GRAB_MIN_SOCK   32

◆ GRAB_PORT_CLOSED

#define GRAB_PORT_CLOSED   1

◆ GRAB_PORT_NOT_TESTED

#define GRAB_PORT_NOT_TESTED   254

◆ GRAB_PORT_OPEN

#define GRAB_PORT_OPEN   2

◆ GRAB_PORT_REJECTED

#define GRAB_PORT_REJECTED   4

◆ GRAB_PORT_SILENT

#define GRAB_PORT_SILENT   3

◆ GRAB_PORT_TESTING

#define GRAB_PORT_TESTING   255

◆ GRAB_PORT_UNKNOWN

#define GRAB_PORT_UNKNOWN   0

◆ GRAB_SOCKET_OPEN

#define GRAB_SOCKET_OPEN   2

◆ GRAB_SOCKET_OPENING

#define GRAB_SOCKET_OPENING   1

◆ GRAB_SOCKET_UNUSED

#define GRAB_SOCKET_UNUSED   0

◆ MAX_PASS_NB

#define MAX_PASS_NB   16

◆ MAX_SANE_RTT

#define MAX_SANE_RTT   2000000 /* micro-seconds */

◆ MAXINT

#define MAXINT   0x7fffffffL

Function Documentation

◆ banner_grab()

static int banner_grab ( const struct in6_addr *  pia,
const char *  portrange,
const int  read_timeout,
int  min_cnx,
int  max_cnx,
struct script_infos desc 
)
static

◆ double_check_std_ports()

static int double_check_std_ports ( unsigned char *  ports_states)
static

◆ my_socket_close()

static int my_socket_close ( int  s)
static

◆ plugin_run_openvas_tcp_scanner()

tree_cell* plugin_run_openvas_tcp_scanner ( lex_ctxt lexic)

◆ std_port()

static int std_port ( int  port)
static
Todo:
: We are not able anymore to judge whether a port is a standard port. Previously a port was believed to be a standard port when it occurred in the currently configured list of ports. This needs to be resolved.