OpenVAS Scanner  21.4.1
Functions
nasl-lint.c File Reference

Source of the NASL linter of OpenVAS. More...

#include "nasl.h"
#include <gio/gio.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>

Functions

static GDataInputStream * get_DIS_from_filename (const gchar *filename)
 Returns a GDataInputStream* for a given filepath. More...
 
static int process_file (const gchar *filepath, int mode, struct script_infos *script_args)
 Process a file through the linter. More...
 
static int process_file_list (const gchar *list_file, int mode, struct script_infos *script_args)
 Process each files in the list_file through the linter. More...
 
static int process_files (const gchar **files, int mode, struct script_infos *script_args)
 Process each given files through the linter. More...
 
static void custom_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
 custom log handler More...
 
int main (int argc, char **argv)
 Main of the nasl QA linter. More...
 

Detailed Description

Source of the NASL linter of OpenVAS.

Function Documentation

◆ custom_log_handler()

static void custom_log_handler ( const gchar *  log_domain,
GLogLevelFlags  log_level,
const gchar *  message,
gpointer  user_data 
)
static

custom log handler

This handler absorb each log_level not present in the log_mask, and forward the other ones to the default handler.

◆ get_DIS_from_filename()

static GDataInputStream* get_DIS_from_filename ( const gchar *  filename)
static

Returns a GDataInputStream* for a given filepath.

Parameters
filenamethe path to the file to open
Returns
a GDataInputStream corresponding to the filepath

◆ main()

int main ( int  argc,
char **  argv 
)

Main of the nasl QA linter.

Returns
0 on success

◆ process_file()

static int process_file ( const gchar *  filepath,
int  mode,
struct script_infos script_args 
)
static

Process a file through the linter.

Parameters
filepaththe path of the file to be processed
mode,script_argsThe parameters to be given to the linter
Returns
Number of errors in script

◆ process_file_list()

static int process_file_list ( const gchar *  list_file,
int  mode,
struct script_infos script_args 
)
static

Process each files in the list_file through the linter.

Parameters
list_filethe path to a text file containing path to the files to process, one per line
mode,script_argsParameters for the linter
Returns
The amount of errors found in the given scripts

◆ process_files()

static int process_files ( const gchar **  files,
int  mode,
struct script_infos script_args 
)
static

Process each given files through the linter.

Parameters
filesThe path to the files to be processed
mode,script_argsParameters to be given to the linter
Returns
The amount of errors found in the given scripts