OpenVAS Scanner 21.4.1
|
Implementation of an API for SNMP used by NASL scripts. More...
#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>
Macros | |
#define | SNMP_VERSION_1 0 |
#define | SNMP_VERSION_2c 1 |
Functions | |
static int | proto_is_valid (const char *proto) |
static tree_cell * | array_from_snmp_result (int ret, char *result) |
static void | parse_snmp_error (char **result) |
Parse the snmp error. More... | |
static int | check_spwan_output (int fd, char **result) |
Read data from a file descriptor. More... | |
static int | snmpv1v2c_get (const char *peername, const char *community, const char *oid_str, int version, char **result) |
SNMP v1 or v2c Get query value. More... | |
static int | snmpv3_get (const char *peername, const char *username, const char *authpass, int authproto, const char *privpass, int privproto, const char *oid_str, char **result) |
SNMPv3 Get query value. More... | |
tree_cell * | nasl_snmpv1v2c_get (lex_ctxt *lexic, int version) |
tree_cell * | nasl_snmpv1_get (lex_ctxt *lexic) |
tree_cell * | nasl_snmpv2c_get (lex_ctxt *lexic) |
tree_cell * | nasl_snmpv3_get (lex_ctxt *lexic) |
Implementation of an API for SNMP used by NASL scripts.
#define SNMP_VERSION_1 0 |
#define SNMP_VERSION_2c 1 |
|
static |
|
static |
Read data from a file descriptor.
fd[in] | File descriptor to read from. |
result[out] | String to write to. |
|
static |
Parse the snmp error.
result[in,out] | The result error to be parsed. |
|
static |
|
static |
SNMP v1 or v2c Get query value.
param[in] peername Target host in [protocol:]address[:port] format. param[in] community SNMP community string. param[in] oid_str OID string of value to get. param[in] version SNMP_VERSION_1 or SNMP_VERSION_2c. param[out] result Result of query.
|
static |
SNMPv3 Get query value.
param[in] peername Target host in [protocol:]address[:port] format. param[in] username Username value. param[in] authpass Authentication password. param[in] authproto Authentication protocol. 0 for md5, 1 for sha1. param[in] privpass Privacy password. param[in] privproto Privacy protocol. 0 for des, 1 for aes. param[in] oid_str OID of value to get. param[out] result Result of query.