OpenVAS Scanner 23.23.1
nasl-lint.c File Reference

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

#include "lint.h"
#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.
static int process_file (const gchar *filepath, int mode, struct script_infos *script_args)
 Process a file through the linter.
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.
static int process_files (const gchar **files, int mode, struct script_infos *script_args)
 Process each given files through the linter.
static void custom_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
 custom log handler
int main (int argc, char **argv)
 Main of the nasl QA linter.

Detailed Description

Source of the NASL linter of OpenVAS.

Function Documentation

◆ custom_log_handler()

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()

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()

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
0 if no error was found, 1 if errors were found.

◆ process_file_list()

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 scripts with errors

◆ process_files()

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 scripts with errors