#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include <net-snmp/agent/agent_trap.h>
#include <net-snmp/library/snmp_jnx_ext.h>
#include <jnx/netsnmp_trap.h>
#include <agent/snmpd.h>
#include <isc/eventlib.h>
#include <snmp/snmp_pathnames.h>
#include <sync/common.h>
#include "ped_snmp.h"
#include "ped_daemon_name.h"
#include "ped_policy_table.h"
#include "ped_services.h"
#include "ped_kcom.h"
Go to the source code of this file.
Functions | |
static void | init_netsnmp_ds (void) |
static int | get_route_count (ped_policy_route_t *route) |
static netsnmp_variable_list * | table_get_next_data_point (void **loop_context, void **data_context, netsnmp_variable_list *put_index_data, netsnmp_iterator_info *data __unused) |
static netsnmp_variable_list * | table_get_first_data_point (void **loop_context, void **data_context, netsnmp_variable_list *put_index_data, netsnmp_iterator_info *data) |
static int | handler_if_table (netsnmp_mib_handler *handler __unused, netsnmp_handler_registration *reginfo __unused, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) |
static int | handler_snmp_ver (netsnmp_mib_handler *handler __unused, netsnmp_handler_registration *reginfo __unused, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) |
static int | handler_if_count (netsnmp_mib_handler *handler __unused, netsnmp_handler_registration *reginfo __unused, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) |
static int | handler_if_total (netsnmp_mib_handler *handler __unused, netsnmp_handler_registration *reginfo __unused, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) |
static int | handler_psd_state (netsnmp_mib_handler *handler __unused, netsnmp_handler_registration *reginfo __unused, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) |
static int | handler_psd_time (netsnmp_mib_handler *handler __unused, netsnmp_handler_registration *reginfo __unused, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) |
static void | init_mib_policy_table (void) |
static void | ped_init_mib (void) |
void | netsnmp_subagent_init (void) |
void | ped_notify_psd_state (boolean state) |
Variables | |
evContext | ped_ctx |
event context for ped | |
static oid | if_total_oid [] = {PE_MIB_IF_TOTAL_OID} |
OID of the number of total interfaces. | |
static oid | if_table_oid [] = {PE_MIB_IF_TABLE_OID} |
OID of the policy table. | |
static oid | if_count_oid [] = {PE_MIB_IF_COUNT_OID} |
OID of the number of interfaces under management. | |
static oid | snmp_ver_oid [] = {PE_MIB_SNMP_VER_OID} |
OID of the net-snmp version. | |
static oid | psd_state_oid [] = {PE_MIB_PSD_STATE_OID} |
OID of the state of PSD connection. | |
static oid | psd_time_oid [] = {PE_MIB_PSD_TIME_OID} |
OID of the up time of PSD connection. | |
static oid | notify_psd_state_oid [] = {PE_MIB_NOTIFY_PSD_STATE_OID} |
OID of notification of the state of PSD connection. |
Functions to intialize snmp sub-agent and process snmp requests.
Definition in file ped_snmp.c.
static int get_route_count | ( | ped_policy_route_t * | route | ) | [static] |
Get the number of routes.
[in] | route | Pointer to route data in policy table. |
Definition at line 87 of file ped_snmp.c.
References ped_policy_route_s::next.
Referenced by handler_if_table().
static int handler_if_count | ( | netsnmp_mib_handler *handler | __unused, | |
netsnmp_handler_registration *reginfo | __unused, | |||
netsnmp_agent_request_info * | reqinfo, | |||
netsnmp_request_info * | requests | |||
) | [static] |
Handler to process the requests of the number of managed interfaces.
[in] | handler | Pointer to mib handler. |
[in] | reginfo | Pointer to handler registration info. |
[in] | reqinfo | Pointer to agent request info. |
[in,out] | requests | Pointer to requests. |
Definition at line 341 of file ped_snmp.c.
References policy_table_entry_count().
Referenced by ped_init_mib().
static int handler_if_table | ( | netsnmp_mib_handler *handler | __unused, | |
netsnmp_handler_registration *reginfo | __unused, | |||
netsnmp_agent_request_info * | reqinfo, | |||
netsnmp_request_info * | requests | |||
) | [static] |
Handler to process interface table requests.
[in] | handler | Pointer to mib handler. |
[in] | reginfo | Pointer to handler registration info. |
[in] | reqinfo | Pointer to agent request info. |
[in,out] | requests | Pointer to requests. |
Definition at line 198 of file ped_snmp.c.
References policy_table_entry_s::af, policy_table_entry_s::filter, ped_policy_filter_s::filter_data, get_route_count(), policy_table_entry_s::ifname, policy_filter_msg_s::input_filter, policy_filter_msg_s::output_filter, and policy_table_entry_s::route.
Referenced by init_mib_policy_table().
static int handler_if_total | ( | netsnmp_mib_handler *handler | __unused, | |
netsnmp_handler_registration *reginfo | __unused, | |||
netsnmp_agent_request_info * | reqinfo, | |||
netsnmp_request_info * | requests | |||
) | [static] |
Handler to process the request of total number of interfaces.
[in] | handler | Pointer to mib handler. |
[in] | reginfo | Pointer to handler registration info. |
[in] | reqinfo | Pointer to agent request info. |
[in,out] | requests | Pointer to requests. |
Definition at line 384 of file ped_snmp.c.
References get_interface_total().
Referenced by ped_init_mib().
static int handler_psd_state | ( | netsnmp_mib_handler *handler | __unused, | |
netsnmp_handler_registration *reginfo | __unused, | |||
netsnmp_agent_request_info * | reqinfo, | |||
netsnmp_request_info * | requests | |||
) | [static] |
Handler to process the request of PSD connection status.
[in] | handler | Pointer to mib handler. |
[in] | reginfo | Pointer to handler registration info. |
[in] | reqinfo | Pointer to agent request info. |
[in,out] | requests | Pointer to requests. |
Definition at line 427 of file ped_snmp.c.
References psd_conn_state().
Referenced by ped_init_mib().
static int handler_psd_time | ( | netsnmp_mib_handler *handler | __unused, | |
netsnmp_handler_registration *reginfo | __unused, | |||
netsnmp_agent_request_info * | reqinfo, | |||
netsnmp_request_info * | requests | |||
) | [static] |
Handler to process the request of PSD connection time.
[in] | handler | Pointer to mib handler. |
[in] | reginfo | Pointer to handler registration info. |
[in] | reqinfo | Pointer to agent request info. |
[in,out] | requests | Pointer to requests. |
Definition at line 470 of file ped_snmp.c.
References get_psd_conn_time().
Referenced by ped_init_mib().
static int handler_snmp_ver | ( | netsnmp_mib_handler *handler | __unused, | |
netsnmp_handler_registration *reginfo | __unused, | |||
netsnmp_agent_request_info * | reqinfo, | |||
netsnmp_request_info * | requests | |||
) | [static] |
Handler to process snmp version requests.
[in] | handler | Pointer to mib handler. |
[in] | reginfo | Pointer to handler registration info. |
[in] | reqinfo | Pointer to agent request info. |
[in,out] | requests | Pointer to requests. |
Definition at line 298 of file ped_snmp.c.
Referenced by ped_init_mib().
static void init_mib_policy_table | ( | void | ) | [static] |
Initialize MIB policy table.
Definition at line 501 of file ped_snmp.c.
References handler_if_table(), if_table_oid, table_get_first_data_point(), and table_get_next_data_point().
Referenced by ped_init_mib().
static void init_netsnmp_ds | ( | void | ) | [static] |
Set SNMP default storage (configuration).
Definition at line 63 of file ped_snmp.c.
References DNAME_PED.
Referenced by netsnmp_subagent_init().
void netsnmp_subagent_init | ( | void | ) |
Initialze snmp sub-agent.
Definition at line 573 of file ped_snmp.c.
References DNAME_PED, init_netsnmp_ds(), ped_ctx, and ped_init_mib().
Referenced by ped_init().
static void ped_init_mib | ( | void | ) | [static] |
Initialize mib varables and register handlers.
Definition at line 533 of file ped_snmp.c.
References handler_if_count(), handler_if_total(), handler_psd_state(), handler_psd_time(), handler_snmp_ver(), if_count_oid, if_total_oid, init_mib_policy_table(), psd_state_oid, psd_time_oid, and snmp_ver_oid.
Referenced by netsnmp_subagent_init().
void ped_notify_psd_state | ( | boolean | state | ) |
Send notification of PSD connection status.
[in] | state | The state of PSD connection. |
Definition at line 599 of file ped_snmp.c.
References notify_psd_state_oid, and psd_state_oid.
Referenced by disconnect_psd(), and psd_ipc_read().
static netsnmp_variable_list* table_get_first_data_point | ( | void ** | loop_context, | |
void ** | data_context, | |||
netsnmp_variable_list * | put_index_data, | |||
netsnmp_iterator_info * | data | |||
) | [static] |
Get the first entry in the interface table.
[in] | loop_context | Pointer to loop context pointer. |
[in] | data_context | Pointer to data context pointer. |
[out] | put_index_data | Pointer to index data. |
[in] | data | Pointer to iterator info. |
Definition at line 165 of file ped_snmp.c.
References policy_table_iterator_reset(), and table_get_next_data_point().
Referenced by init_mib_policy_table().
static netsnmp_variable_list* table_get_next_data_point | ( | void ** | loop_context, | |
void ** | data_context, | |||
netsnmp_variable_list * | put_index_data, | |||
netsnmp_iterator_info *data | __unused | |||
) | [static] |
Get next entry in the interface table.
[in] | loop_context | Pointer to loop context pointer. |
[in] | data_context | Pointer to data context pointer. |
[out] | put_index_data | Pointer to index data. |
[in] | data | Pointer to iterator info. |
Definition at line 119 of file ped_snmp.c.
References policy_table_entry_s::ifname, and policy_table_next().
Referenced by init_mib_policy_table(), and table_get_first_data_point().