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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
$NetBSD: patch-ab,v 1.2 2004/02/13 17:46:22 seb Exp $
--- SNMP/SNMP.xs.orig Fri Jul 25 01:14:48 2003
+++ SNMP/SNMP.xs
@@ -119,15 +119,15 @@ static int __snprint_value _((char *, si
netsnmp_variable_list*, struct tree *,
int, int));
static int __sprint_num_objid _((char *, oid *, int));
-static int __scan_num_objid _((char *, oid *, int *));
+static int __scan_num_objid _((char *, oid *, size_t *));
static int __get_type_str _((int, char *));
static int __get_label_iid _((char *, char **, char **, int));
static int __oid_cmp _((oid *, int, oid *, int));
static int __tp_sprint_num_objid _((char*,SnmpMibNode *));
static SnmpMibNode * __get_next_mib_node _((SnmpMibNode *));
static struct tree * __oid2tp _((oid*, int, struct tree *, int*));
-static struct tree * __tag2oid _((char *, char *, oid *, int *, int *, int));
-static int __concat_oid_str _((oid *, int *, char *));
+static struct tree * __tag2oid _((char *, char *, oid *, size_t *, int *, int));
+static int __concat_oid_str _((oid *, size_t *, char *));
static int __add_var_val_str _((netsnmp_pdu *, oid *, int, char *,
int, int));
static int __send_sync_pdu _((netsnmp_session *, netsnmp_pdu *,
@@ -565,7 +565,7 @@ static int
__scan_num_objid (buf, objid, len)
char *buf;
oid *objid;
-int *len;
+size_t *len;
{
char *cp;
*len = 0;
@@ -818,7 +818,7 @@ __tag2oid(tag, iid, oid_arr, oid_arr_len
char * tag;
char * iid;
oid * oid_arr;
-int * oid_arr_len;
+size_t * oid_arr_len;
int * type;
int best_guess;
{
@@ -826,7 +826,7 @@ int best_guess;
struct tree *rtp = NULL;
DLL_IMPORT extern struct tree *tree_head;
oid newname[MAX_OID_LEN], *op;
- int newname_len = 0;
+ size_t newname_len = 0;
if (type) *type = TYPE_UNKNOWN;
if (oid_arr_len) *oid_arr_len = 0;
@@ -926,7 +926,7 @@ found:
static int
__concat_oid_str(doid_arr, doid_arr_len, soid_str)
oid *doid_arr;
-int *doid_arr_len;
+size_t *doid_arr_len;
char * soid_str;
{
char soid_buf[STR_BUF_SIZE];
@@ -2794,7 +2794,10 @@ snmp_read_mib(mib_file, force=0)
if (verbose) warn("failed\n");
}
}
- RETVAL = (I32)Mib;
+ if (Mib)
+ RETVAL = (I32)1;
+ else
+ RETVAL = (I32)0;
}
OUTPUT:
RETVAL
@@ -2817,7 +2820,10 @@ snmp_read_module(module)
} else {
if (verbose) warn("Failed reading %s\n", module);
}
- RETVAL = (I32)Mib;
+ if (Mib)
+ RETVAL = (I32)1;
+ else
+ RETVAL = (I32)0;
}
OUTPUT:
RETVAL
@@ -2840,7 +2846,7 @@ snmp_set(sess_ref, varlist_ref, perl_cal
netsnmp_pdu *pdu, *response;
struct tree *tp;
oid *oid_arr;
- int oid_arr_len = MAX_OID_LEN;
+ size_t oid_arr_len = MAX_OID_LEN;
char *tag_pv;
snmp_xs_cb_data *xs_cb_data;
SV **sess_ptr_sv;
@@ -3035,7 +3041,7 @@ snmp_get(sess_ref, retry_nosuch, varlist
struct tree *tp;
int len;
oid *oid_arr = NULL;
- int oid_arr_len = MAX_OID_LEN;
+ size_t oid_arr_len = MAX_OID_LEN;
SV *tmp_sv;
char *tag_pv;
int type;
@@ -3188,7 +3194,7 @@ snmp_getnext(sess_ref, varlist_ref, perl
struct tree *tp;
int len;
oid *oid_arr;
- int oid_arr_len = MAX_OID_LEN;
+ size_t oid_arr_len = MAX_OID_LEN;
SV *tmp_sv;
int type;
char tmp_type_str[MAX_TYPE_NAME_LEN];
@@ -3394,7 +3400,7 @@ snmp_getbulk(sess_ref, nonrepeaters, max
struct tree *tp;
int len;
oid *oid_arr;
- int oid_arr_len = MAX_OID_LEN;
+ size_t oid_arr_len = MAX_OID_LEN;
SV *tmp_sv;
int type;
char tmp_type_str[MAX_TYPE_NAME_LEN];
@@ -3599,7 +3605,7 @@ snmp_bulkwalk(sess_ref, nonrepeaters, ma
netsnmp_session *ss;
netsnmp_pdu *pdu = NULL;
oid oid_arr[MAX_OID_LEN];
- int oid_arr_len;
+ size_t oid_arr_len;
SV **sess_ptr_sv;
SV **err_str_svp;
SV **err_num_svp;
@@ -3813,9 +3819,9 @@ snmp_bulkwalk(sess_ref, nonrepeaters, ma
}
/* Sent okay... Return the request ID in 'pdu' as an SvIV. */
- DBPRT(1,( "Okay, request id is %d\n", (int)pdu));
+/* DBPRT(1,( "Okay, request id is %d\n", (int)pdu)); */
/* XSRETURN_IV((int)pdu); */
- XPUSHs(sv_2mortal(newSViv((int)pdu)));
+ XPUSHs(sv_2mortal(newSViv((IV)pdu)));
XSRETURN(1);
}
@@ -3908,7 +3914,7 @@ snmp_trapV1(sess_ref,enterprise,agent,ge
netsnmp_pdu *pdu = NULL;
struct tree *tp;
oid *oid_arr;
- int oid_arr_len = MAX_OID_LEN;
+ size_t oid_arr_len = MAX_OID_LEN;
SV **sess_ptr_sv;
SV **err_str_svp;
SV **err_num_svp;
@@ -4045,7 +4051,7 @@ snmp_trapV2(sess_ref,uptime,trap_oid,var
netsnmp_pdu *pdu = NULL;
struct tree *tp;
oid *oid_arr;
- int oid_arr_len = MAX_OID_LEN;
+ size_t oid_arr_len = MAX_OID_LEN;
SV **sess_ptr_sv;
SV **err_str_svp;
SV **err_num_svp;
@@ -4180,7 +4186,7 @@ snmp_inform(sess_ref,uptime,trap_oid,var
netsnmp_pdu *response;
struct tree *tp;
oid *oid_arr;
- int oid_arr_len = MAX_OID_LEN;
+ size_t oid_arr_len = MAX_OID_LEN;
snmp_xs_cb_data *xs_cb_data;
SV **sess_ptr_sv;
SV **err_str_svp;
@@ -4405,7 +4411,7 @@ snmp_translate_obj(var,mode,use_long,aut
{
char str_buf[STR_BUF_SIZE];
oid oid_arr[MAX_OID_LEN];
- int oid_arr_len = MAX_OID_LEN;
+ size_t oid_arr_len = MAX_OID_LEN;
char * label;
char * iid;
int status = FAILURE;
|