*
*
*/
-/***********************************************************
+/*
Copyright 1988, 1989 by Carnegie Mellon University
All Rights Reserved
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
-******************************************************************/
+*/
#ifndef SNMP_H
#define SNMP_H
extern conf_if_list *if_list;
-#ifndef SQUID_SNMP
/*extern void init_snmp(); */
extern int read_objid(char *input,
int *out_len);
extern void sprint_objid(char *buf, oid * id, int idlen);
-extern void print_objid(oid * id,
- int idlen);
-void snmp_add_null_var(struct snmp_pdu *,
- oid *,
- int);
-extern void xdump(u_char * cp,
- int length,
- char *prefix);
-
+extern void print_objid(oid * id, int idlen);
+void snmp_add_null_var(struct snmp_pdu *, oid *, int);
+extern void xdump(u_char * cp, int length, char *prefix);
extern void snmp_synch_setup(struct snmp_session *session);
-
extern int snmp_synch_response(struct snmp_session *ss,
struct snmp_pdu *pdu,
struct snmp_pdu **response);
-#endif
+
#endif
int val_len;
};
-#ifndef SQUID_SNMP
/*
* struct snmp_session *snmp_open(session)
* struct snmp_session *session;
* Any data in the pdu must be copied because it will be freed elsewhere.
* Operations are defined below:
*/
-#endif
#define RECEIVED_MESSAGE 1
#define TIMED_OUT 2
CC= @CC@
FLAGS=
-DEFS= -DBSD4_3 -DSQUID_SNMP
+DEFS= -DBSD4_3 -DSQUID_SNMP=1
INCLUDE= -I../include -I./../include -I../src -I./../src
MIBDEFS= -DMIBFILEPATH=\"$(prefix)/lib\"
# CFLAGS=-O -DDEBUG -DBSD4_3
}
void
-sprint_objid(buf, objid, objidlen)
- char *buf;
- oid *objid;
- int objidlen; /* number of subidentifiers */
+sprint_objid(char *buf, oid * objid, int objidlen)
{
char tempbuf[2048], *cp;
struct tree *subtree = Mib;
-
*tempbuf = '.'; /* this is a fully qualified name */
get_symbol(objid, objidlen, subtree, tempbuf + 1);
if (Suffix) {
cp++;
if (cp < tempbuf)
cp = tempbuf;
-
} else {
cp = tempbuf;
if ((strlen(tempbuf) > strlen((char *) RFC1213_MIB_text))
strcpy(buf, cp);
}
-
void
print_objid(objid, objidlen)
oid *objid;
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/*
- * parse.c
- */
+
+#include "config.h"
+
+#if HAVE_STDIO_H
#include <stdio.h>
+#endif
+#if HAVE_CTYPE_H
#include <ctype.h>
+#endif
+#if HAVE_SYS_TYPES_H
#include <sys/types.h>
-#ifdef linux
+#endif
+#if HAVE_STDLIB>H
#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
#include <string.h>
#endif
+#if HAVE_GNUMALLOC_H
+#include <gnumalloc.h>
+#elif HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_)
#include <malloc.h>
-
+#endif
#include "parse.h"
Malloc(num)
unsigned num;
{
-#ifndef linux
- char *calloc();
-#endif
-
/* this is to fix (what seems to be) a problem with the IBM RT C
* library malloc */
if (num < 16)