*
*/
#include "squid.h"
-#include "comm.h"
-#include "cache_snmp.h"
#include "acl/FilledChecklist.h"
-#include "ip/IpAddress.h"
+#include "cache_snmp.h"
+#include "comm.h"
#include "ipc/StartListening.h"
+#include "compat/strsep.h"
+#include "ip/Address.h"
#define SNMP_REQUEST_SIZE 4096
#define MAX_PROTOSTAT 5
-
/// dials snmpConnectionOpened call
class SnmpListeningStartedDialer: public CallDialer,
public Ipc::StartListeningCb
};
-IpAddress theOutSNMPAddr;
+Ip::Address theOutSNMPAddr;
typedef struct _mib_tree_entry mib_tree_entry;
typedef oid *(instance_Fn) (oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
snmpHandleUdp(int sock, void *not_used)
{
LOCAL_ARRAY(char, buf, SNMP_REQUEST_SIZE);
- IpAddress from;
+ Ip::Address from;
snmp_request_t *snmp_rq;
int len;
client_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn)
{
oid *instance = NULL;
- IpAddress laddr;
- IpAddress *aux;
+ Ip::Address laddr;
+ Ip::Address *aux;
int size = 0;
int newshift = 0;
}
int i, r = 1;
- while (r <= namelen) {
+ while (r < namelen) {
/* Find the child node which matches this */
for (i = 0; i < e->children && e->leaves[i]->name[r] != name[r]; i++) ; // seek-loop
*name = NULL;
*nl = 0;
char *s = xstrdup(str);
+ char *s_ = s;
/* Parse the OID string into oid bits */
- while ( (p = strsep(&s, delim)) != NULL) {
+ while ( (p = strsep(&s_, delim)) != NULL) {
*name = (oid*)xrealloc(*name, sizeof(oid) * ((*nl) + 1));
(*name)[*nl] = atoi(p);
(*nl)++;
oid == 32.1.50.239.162.33.251.20.50.0.0.0.0.0.0.0.0.0.1
*/
void
-addr2oid(IpAddress &addr, oid * Dest)
+addr2oid(Ip::Address &addr, oid * Dest)
{
u_int i ;
u_char *cp = NULL;
IPv6 adress : 20:01:32:ef:a2:21:fb:32:00:00:00:00:00:00:00:00:OO:01
*/
void
-oid2addr(oid * id, IpAddress &addr, u_int size)
+oid2addr(oid * id, Ip::Address &addr, u_int size)
{
struct in_addr iaddr;
u_int i;