This repository has been archived by the owner on Feb 22, 2019. It is now read-only.
/
snmp_lib_ucd_compat.c
140 lines (118 loc) · 2.27 KB
/
snmp_lib_ucd_compat.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
* 16.07.02 Ported to VMS
*/
/*
* For compatibility with applications built using
* previous versions of the UCD library only.
*/
#ifdef __vms
#include "net-snmp-config.h"
#include "snmp_types.h"
#include "snmp_session_api.h"
#include "snmp_config_api.h"
#else
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/types.h>
#include <net-snmp/session_api.h>
#include <net-snmp/config_api.h>
#endif
/*
* use <netsnmp_session *)->s_snmp_errno instead
*/
int
snmp_get_errno(void)
{
return SNMPERR_SUCCESS;
}
/*
* synch_reset and synch_setup are no longer used.
*/
void
snmp_synch_reset(netsnmp_session * notused)
{
}
void
snmp_synch_setup(netsnmp_session * notused)
{
}
void
snmp_set_dump_packet(int x)
{
ds_set_boolean(DS_LIBRARY_ID, DS_LIB_DUMP_PACKET, x);
}
int
snmp_get_dump_packet(void)
{
return ds_get_boolean(DS_LIBRARY_ID, DS_LIB_DUMP_PACKET);
}
void
snmp_set_quick_print(int x)
{
ds_set_boolean(DS_LIBRARY_ID, DS_LIB_QUICK_PRINT, x);
}
int
snmp_get_quick_print(void)
{
return ds_get_boolean(DS_LIBRARY_ID, DS_LIB_QUICK_PRINT);
}
void
snmp_set_suffix_only(int x)
{
ds_set_int(DS_LIBRARY_ID, DS_LIB_PRINT_SUFFIX_ONLY, x);
}
int
snmp_get_suffix_only(void)
{
return ds_get_int(DS_LIBRARY_ID, DS_LIB_PRINT_SUFFIX_ONLY);
}
void
snmp_set_full_objid(int x)
{
ds_set_boolean(DS_LIBRARY_ID, DS_LIB_PRINT_FULL_OID, x);
}
int
snmp_get_full_objid(void)
{
return ds_get_boolean(DS_LIBRARY_ID, DS_LIB_PRINT_FULL_OID);
}
void
snmp_set_random_access(int x)
{
ds_set_boolean(DS_LIBRARY_ID, DS_LIB_RANDOM_ACCESS, x);
}
int
snmp_get_random_access(void)
{
return ds_get_boolean(DS_LIBRARY_ID, DS_LIB_RANDOM_ACCESS);
}
void
snmp_set_mib_errors(int err)
{
ds_set_boolean(DS_LIBRARY_ID, DS_LIB_MIB_ERRORS, err);
}
void
snmp_set_mib_warnings(int warn)
{
ds_set_int(DS_LIBRARY_ID, DS_LIB_MIB_WARNINGS, warn);
}
void
snmp_set_save_descriptions(int save)
{
ds_set_boolean(DS_LIBRARY_ID, DS_LIB_SAVE_MIB_DESCRS, save);
}
void
snmp_set_mib_comment_term(int save)
{
/*
* 0=strict, 1=EOL terminated
*/
ds_set_boolean(DS_LIBRARY_ID, DS_LIB_MIB_COMMENT_TERM, save);
}
void
snmp_set_mib_parse_label(int save)
{
/*
* 0=strict, 1=underscore OK in label
*/
ds_set_boolean(DS_LIBRARY_ID, DS_LIB_MIB_PARSE_LABEL, save);
}