-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnstAgentPluginObject.c
66 lines (55 loc) · 2.19 KB
/
nstAgentPluginObject.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Note: this file originally auto-generated by mib2c using
* : mib2c.int_watch.conf,v 5.0 2002/04/20 07:30:13 hardaker Exp $
*/
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include "nstAgentPluginObject.h"
/*
* the variable we want to tie an OID to. The agent will handle all
* * GET and SET requests to this variable changing it's value as needed.
*/
static int nstAgentPluginObject = 3;
static oid nstAgentPluginObject_oid[] =
{ 1, 3, 6, 1, 4, 1, 8072, 2, 4, 1, 1, 3, 0 };
/*
* our initialization routine, automatically called by the agent
* (to get called, the function name must match init_FILENAME())
*/
void
init_nstAgentPluginObject(void)
{
/*
* a debugging statement. Run the agent with -DnstAgentPluginObject to see
* the output of this debugging statement.
*/
DEBUGMSGTL(("nstAgentPluginObject",
"Initializing the nstAgentPluginObject module\n"));
/*
* the line below registers our variables defined above as
* accessible and makes it writable. A read only version of any
* of these registration would merely call
* register_read_only_int_instance() instead. The functions
* called below should be consistent with your MIB, however.
*
* If we wanted a callback when the value was retrieved or set
* (even though the details of doing this are handled for you),
* you could change the NULL pointer below to a valid handler
* function.
*/
DEBUGMSGTL(("nstAgentPluginObject",
"Initalizing nstAgentPluginObject scalar integer. Default value = %d\n",
nstAgentPluginObject));
netsnmp_register_int_instance("nstAgentPluginObject",
nstAgentPluginObject_oid,
OID_LENGTH(nstAgentPluginObject_oid),
&nstAgentPluginObject, NULL);
DEBUGMSGTL(("nstAgentPluginObject",
"Done initalizing nstAgentPluginObject module\n"));
}
void
deinit_nstAgentPluginObject(void)
{
unregister_mib(nstAgentPluginObject_oid,OID_LENGTH(nstAgentPluginObject_oid));
}