227 lines
8.4 KiB
Diff
227 lines
8.4 KiB
Diff
|
--- net-snmp-5.4/agent/mibgroup/ucd-snmp/pass_persist.c.64bit 2006-10-18 04:59:10.000000000 +0200
|
||
|
+++ net-snmp-5.4/agent/mibgroup/ucd-snmp/pass_persist.c 2006-11-27 13:56:30.000000000 +0100
|
||
|
@@ -218,6 +218,7 @@
|
||
|
oid newname[MAX_OID_LEN];
|
||
|
int i, rtest, newlen;
|
||
|
static long long_ret;
|
||
|
+ static in_addr_t addr_ret;
|
||
|
char buf[SNMP_MAXBUF];
|
||
|
static char buf2[SNMP_MAXBUF];
|
||
|
static oid objid[MAX_OID_LEN];
|
||
|
@@ -366,13 +367,13 @@
|
||
|
*var_len = 0;
|
||
|
return (NULL);
|
||
|
}
|
||
|
- long_ret =
|
||
|
+ addr_ret =
|
||
|
(objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
|
||
|
(objid[2] << 8) + objid[3];
|
||
|
- long_ret = htonl(long_ret);
|
||
|
- *var_len = sizeof(long_ret);
|
||
|
+ addr_ret = htonl(addr_ret);
|
||
|
+ *var_len = sizeof(addr_ret);
|
||
|
vp->type = ASN_IPADDRESS;
|
||
|
- return ((unsigned char *) &long_ret);
|
||
|
+ return ((unsigned char *) &addr_ret);
|
||
|
}
|
||
|
}
|
||
|
*var_len = 0;
|
||
|
--- net-snmp-5.4/agent/mibgroup/ucd-snmp/pass.c.64bit 2005-08-18 02:44:02.000000000 +0200
|
||
|
+++ net-snmp-5.4/agent/mibgroup/ucd-snmp/pass.c 2006-11-27 13:56:30.000000000 +0100
|
||
|
@@ -287,6 +287,7 @@
|
||
|
oid newname[MAX_OID_LEN];
|
||
|
int i, rtest, fd, newlen;
|
||
|
static long long_ret;
|
||
|
+ static in_addr_t addr_ret;
|
||
|
char buf[SNMP_MAXBUF];
|
||
|
static char buf2[SNMP_MAXBUF];
|
||
|
static oid objid[MAX_OID_LEN];
|
||
|
@@ -412,13 +413,13 @@
|
||
|
*var_len = 0;
|
||
|
return (NULL);
|
||
|
}
|
||
|
- long_ret =
|
||
|
+ addr_ret =
|
||
|
(objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
|
||
|
(objid[2] << 8) + objid[3];
|
||
|
- long_ret = htonl(long_ret);
|
||
|
- *var_len = sizeof(long_ret);
|
||
|
+ addr_ret = htonl(addr_ret);
|
||
|
+ *var_len = sizeof(addr_ret);
|
||
|
vp->type = ASN_IPADDRESS;
|
||
|
- return ((unsigned char *) &long_ret);
|
||
|
+ return ((unsigned char *) &addr_ret);
|
||
|
}
|
||
|
}
|
||
|
*var_len = 0;
|
||
|
--- net-snmp-5.4/agent/mibgroup/mibII/at.c.64bit 2006-11-07 00:43:27.000000000 +0100
|
||
|
+++ net-snmp-5.4/agent/mibgroup/mibII/at.c 2006-11-27 13:59:46.000000000 +0100
|
||
|
@@ -126,9 +126,9 @@
|
||
|
#ifndef solaris2
|
||
|
static void ARP_Scan_Init(void);
|
||
|
#ifdef ARP_SCAN_FOUR_ARGUMENTS
|
||
|
-static int ARP_Scan_Next(u_long *, char *, u_long *, u_short *);
|
||
|
+static int ARP_Scan_Next(u_int *, char *, u_long *, u_short *);
|
||
|
#else
|
||
|
-static int ARP_Scan_Next(u_long *, char *, u_long *);
|
||
|
+static int ARP_Scan_Next(u_int *, char *, u_long *);
|
||
|
#endif
|
||
|
#endif
|
||
|
#endif
|
||
|
@@ -204,7 +204,8 @@
|
||
|
oid lowest[16];
|
||
|
oid current[16];
|
||
|
static char PhysAddr[6], LowPhysAddr[6];
|
||
|
- u_long Addr, LowAddr, foundone;
|
||
|
+ u_int Addr, LowAddr, foundone;
|
||
|
+ static int addr_ret;
|
||
|
#ifdef ARP_SCAN_FOUR_ARGUMENTS
|
||
|
u_short ifIndex, lowIfIndex = 0;
|
||
|
#endif /* ARP_SCAN_FOUR_ARGUMENTS */
|
||
|
@@ -314,9 +315,9 @@
|
||
|
*var_len = sizeof(LowPhysAddr);
|
||
|
return (u_char *) LowPhysAddr;
|
||
|
case IPMEDIANETADDRESS: /* also ATNETADDRESS */
|
||
|
- *var_len = sizeof(uint32_t);
|
||
|
+ *var_len = sizeof addr_ret;
|
||
|
long_return = LowAddr;
|
||
|
- return (u_char *) & long_return;
|
||
|
+ return (u_char *) & addr_ret;
|
||
|
case IPMEDIATYPE:
|
||
|
*var_len = sizeof long_return;
|
||
|
long_return = lowIfType;
|
||
|
@@ -707,11 +708,11 @@
|
||
|
|
||
|
#ifdef ARP_SCAN_FOUR_ARGUMENTS
|
||
|
static int
|
||
|
-ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType,
|
||
|
+ARP_Scan_Next(u_int * IPAddr, char *PhysAddr, u_long * ifType,
|
||
|
u_short * ifIndex)
|
||
|
#else
|
||
|
static int
|
||
|
-ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType)
|
||
|
+ARP_Scan_Next(u_int * IPAddr, char *PhysAddr, u_long * ifType)
|
||
|
#endif
|
||
|
{
|
||
|
#ifndef NETSNMP_CAN_USE_SYSCTL
|
||
|
--- net-snmp-5.4/agent/mibgroup/mibII/var_route.c.64bit 2006-11-07 00:43:27.000000000 +0100
|
||
|
+++ net-snmp-5.4/agent/mibgroup/mibII/var_route.c 2006-11-27 14:13:13.000000000 +0100
|
||
|
@@ -434,6 +434,7 @@
|
||
|
static oid saveName[MAX_OID_LEN], Current[MAX_OID_LEN];
|
||
|
u_char *cp;
|
||
|
oid *op;
|
||
|
+ static in_addr_t addr_ret;
|
||
|
#if NEED_KLGETSA
|
||
|
struct sockaddr_in *sa;
|
||
|
#endif
|
||
|
@@ -538,13 +539,13 @@
|
||
|
|
||
|
switch (vp->magic) {
|
||
|
case IPROUTEDEST:
|
||
|
- *var_len = sizeof(uint32_t);
|
||
|
+ *var_len = sizeof(addr_ret);
|
||
|
#if NEED_KLGETSA
|
||
|
sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_dst);
|
||
|
return (u_char *) & (sa->sin_addr.s_addr);
|
||
|
#elif defined(hpux11)
|
||
|
- long_return = rt[RtIndex].Dest;
|
||
|
- return (u_char *) & long_return;
|
||
|
+ addr_ret = rt[RtIndex].Dest;
|
||
|
+ return (u_char *) & addr_ret;
|
||
|
#else
|
||
|
return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]->
|
||
|
rt_dst)->sin_addr.s_addr;
|
||
|
@@ -597,13 +598,13 @@
|
||
|
long_return = -1;
|
||
|
return (u_char *) & long_return;
|
||
|
case IPROUTENEXTHOP:
|
||
|
- *var_len = sizeof(uint32_t);
|
||
|
+ *var_len = sizeof(addr_ret);
|
||
|
#if NEED_KLGETSA
|
||
|
sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_gateway);
|
||
|
return (u_char *) & (sa->sin_addr.s_addr);
|
||
|
#elif defined(hpux11)
|
||
|
- long_return = rt[RtIndex].NextHop;
|
||
|
- return (u_char *) & long_return;
|
||
|
+ addr_ret = rt[RtIndex].NextHop;
|
||
|
+ return (u_char *) & addr_ret;
|
||
|
#else
|
||
|
return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]->
|
||
|
rt_gateway)->sin_addr.s_addr;
|
||
|
@@ -649,14 +650,14 @@
|
||
|
#if NETSNMP_NO_DUMMY_VALUES
|
||
|
return NULL;
|
||
|
#endif
|
||
|
- long_return = 0;
|
||
|
+ addr_ret = 0;
|
||
|
#elif defined(hpux11)
|
||
|
- long_return = rt[RtIndex].Mask;
|
||
|
- return (u_char *) & long_return;
|
||
|
+ addr_ret = rt[RtIndex].Mask;
|
||
|
+ return (u_char *) & addr_ret;
|
||
|
#else /* !NEED_KLGETSA && !hpux11 */
|
||
|
if (((struct sockaddr_in *) &rthead[RtIndex]->rt_dst)->sin_addr.
|
||
|
s_addr == 0)
|
||
|
- long_return = 0; /* Default route */
|
||
|
+ addr_ret = 0; /* Default route */
|
||
|
else {
|
||
|
#ifndef linux
|
||
|
if (!NETSNMP_KLOOKUP(rthead[RtIndex]->rt_ifp,
|
||
|
@@ -681,7 +682,7 @@
|
||
|
#endif /* linux */
|
||
|
}
|
||
|
#endif /* NEED_KLGETSA */
|
||
|
- return (u_char *) & long_return;
|
||
|
+ return (u_char *) & addr_ret;
|
||
|
case IPROUTEINFO:
|
||
|
*var_len = nullOidLen;
|
||
|
return (u_char *) nullOid;
|
||
|
--- net-snmp-5.4/agent/mibgroup/mibII/ipCidrRouteTable_access.c.64bit 2003-02-22 05:19:51.000000000 +0100
|
||
|
+++ net-snmp-5.4/agent/mibgroup/mibII/ipCidrRouteTable_access.c 2006-11-27 13:56:30.000000000 +0100
|
||
|
@@ -22,6 +22,7 @@
|
||
|
/** a global static we'll make use of a lot to map to the right
|
||
|
datatype to return (which for SNMP integer's is always a long). */
|
||
|
static u_long long_ret;
|
||
|
+static in_addr_t addr_ret;
|
||
|
|
||
|
|
||
|
/*
|
||
|
@@ -32,18 +33,18 @@
|
||
|
get_ipCidrRouteDest(void *data_context, size_t * ret_len)
|
||
|
{
|
||
|
RTENTRY *ourroute = (RTENTRY *) data_context;
|
||
|
- long_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr;
|
||
|
- *ret_len = sizeof(long_ret);
|
||
|
- return &long_ret;
|
||
|
+ addr_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr;
|
||
|
+ *ret_len = sizeof(addr_ret);
|
||
|
+ return &addr_ret;
|
||
|
}
|
||
|
|
||
|
u_long *
|
||
|
get_ipCidrRouteMask(void *data_context, size_t * ret_len)
|
||
|
{
|
||
|
RTENTRY *ourroute = (RTENTRY *) data_context;
|
||
|
- long_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr;
|
||
|
- *ret_len = sizeof(long_ret);
|
||
|
- return &long_ret;
|
||
|
+ addr_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr;
|
||
|
+ *ret_len = sizeof(addr_ret);
|
||
|
+ return &addr_ret;
|
||
|
}
|
||
|
|
||
|
long *
|
||
|
@@ -59,9 +60,9 @@
|
||
|
get_ipCidrRouteNextHop(void *data_context, size_t * ret_len)
|
||
|
{
|
||
|
RTENTRY *ourroute = (RTENTRY *) data_context;
|
||
|
- long_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr;
|
||
|
- *ret_len = sizeof(long_ret);
|
||
|
- return &long_ret;
|
||
|
+ addr_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr;
|
||
|
+ *ret_len = sizeof(addr_ret);
|
||
|
+ return &addr_ret;
|
||
|
}
|
||
|
|
||
|
long *
|