|
OpenVAS Scanner 23.23.1
|
Implementation of an API for SNMP used by NASL scripts. More...
#include "nasl_snmp.h"#include "../misc/plugutils.h"#include "nasl_lex_ctxt.h"#include <assert.h>#include <errno.h>#include <gvm/base/logging.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>Data Structures | |
| struct | snmpv1v2_request |
| SNMP Request struct for snmp v1 and v2c. More... | |
| struct | snmpv3_request |
| SNMP Request struct for snmp v3. More... | |
| struct | snmp_result |
Macros | |
| #define | G_LOG_DOMAIN "lib nasl" |
| GLib logging domain. | |
| #define | SNMP_VERSION_1 0 |
| SNMP V1. | |
| #define | SNMP_VERSION_2c 1 |
| SNMP V2c. | |
| #define | FD_STDERR_FLAG 1 |
| #define | FD_STDOUT_FLAG 0 |
| #define | NASL_SNMP_GET 0 |
| #define | NASL_SNMP_GETNEXT 1 |
Typedefs | |
| typedef struct snmpv1v2_request * | snmpv1v2_request_t |
| typedef struct snmpv3_request * | snmpv3_request_t |
| typedef struct snmp_result * | snmp_result_t |
Functions | |
| static void | destroy_snmp_result (snmp_result_t result) |
| static int | proto_is_valid (const char *proto) |
| static tree_cell * | array_from_snmp_result (int ret, const snmp_result_t result) |
| static tree_cell * | array_from_snmp_error (int ret, const char *err) |
| static void | parse_snmp_error (snmp_result_t result) |
| Parse the snmp error. | |
| static int | check_spwan_output (int fd, snmp_result_t result, int fd_flag) |
| Read data from a file descriptor. | |
| static int | snmpv1v2c_get (const snmpv1v2_request_t request, snmp_result_t result) |
| SNMP v1 or v2c Get query value. snmpget cmd wrapper. | |
| static int | snmpv3_get (const snmpv3_request_t request, snmp_result_t result) |
| SNMPv3 Get query value. snmpget cmd wrapper. | |
| static tree_cell * | nasl_snmpv1v2c_get (lex_ctxt *lexic, int version, u_char action) |
| tree_cell * | nasl_snmpv1_get (lex_ctxt *lexic) |
| tree_cell * | nasl_snmpv1_getnext (lex_ctxt *lexic) |
| tree_cell * | nasl_snmpv2c_get (lex_ctxt *lexic) |
| tree_cell * | nasl_snmpv2c_getnext (lex_ctxt *lexic) |
| static tree_cell * | nasl_snmpv3_get_action (lex_ctxt *lexic, u_char action) |
| tree_cell * | nasl_snmpv3_get (lex_ctxt *lexic) |
| tree_cell * | nasl_snmpv3_getnext (lex_ctxt *lexic) |
Implementation of an API for SNMP used by NASL scripts.
| #define FD_STDERR_FLAG 1 |
| #define FD_STDOUT_FLAG 0 |
| #define G_LOG_DOMAIN "lib nasl" |
GLib logging domain.
| #define NASL_SNMP_GET 0 |
| #define NASL_SNMP_GETNEXT 1 |
| #define SNMP_VERSION_1 0 |
SNMP V1.
| #define SNMP_VERSION_2c 1 |
SNMP V2c.
| typedef struct snmp_result* snmp_result_t |
| typedef struct snmpv1v2_request* snmpv1v2_request_t |
| typedef struct snmpv3_request* snmpv3_request_t |
|
static |
|
static |
|
static |
Read data from a file descriptor.
| fd[in] | File descriptor to read from. |
| result[out] | String to write to. |
|
static |
|
static |
Parse the snmp error.
| result[in,out] | The result error to be parsed. |
|
static |
|
static |
SNMP v1 or v2c Get query value. snmpget cmd wrapper.
param[in] request Contains all necessary information for SNMPv1 or SNMPv2 query. param[out] result Result of query.
|
static |
SNMPv3 Get query value. snmpget cmd wrapper.
param[in] request Contains all necessary information for SNMPv3 query. param[out] result Result of query.