*
**********************************************************************/
-#include "config.h"
+#include "squid.h"
#include <stdio.h>
#if HAVE_MEMORY_H
#include <memory.h>
#endif
-#ifdef HAVE_STRING_H
+#if HAVE_STRING_H
#include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
+#if HAVE_STRINGS_H
#include <strings.h>
#endif
#if HAVE_BSTRING_H
*/
struct snmp_pdu *
- snmp_pdu_create(int command) {
+snmp_pdu_create(int command) {
struct snmp_pdu *pdu;
-#ifdef DEBUG_PDU
+#if DEBUG_PDU
snmplib_debug(8, "PDU: Creating\n");
#endif
pdu->enterprise_length = 0;
pdu->variables = NULL;
-#ifdef DEBUG_PDU
+#if DEBUG_PDU
snmplib_debug(8, "PDU: Created %x\n", (unsigned int) pdu);
#endif
/* Clone an existing PDU.
*/
struct snmp_pdu *
- snmp_pdu_clone(struct snmp_pdu *Src) {
+snmp_pdu_clone(struct snmp_pdu *Src) {
struct snmp_pdu *Dest;
-#ifdef DEBUG_PDU
+#if DEBUG_PDU
snmplib_debug(8, "PDU %x: Cloning\n", (unsigned int) Src);
#endif
snmp_set_api_error(SNMPERR_OS_ERR);
return (NULL);
}
- xmemcpy((char *) Dest, (char *) Src, sizeof(struct snmp_pdu));
+ memcpy((char *) Dest, (char *) Src, sizeof(struct snmp_pdu));
-#ifdef DEBUG_PDU
+#if DEBUG_PDU
snmplib_debug(8, "PDU %x: Created %x\n", (unsigned int) Src, (unsigned int) Dest);
#endif
return (Dest);
* be returned.
*/
struct snmp_pdu *
- snmp_pdu_fix(struct snmp_pdu *pdu, int command) {
+snmp_pdu_fix(struct snmp_pdu *pdu, int command) {
return (snmp_fix_pdu(pdu, command));
}
struct snmp_pdu *
- snmp_fix_pdu(struct snmp_pdu *pdu, int command) {
+snmp_fix_pdu(struct snmp_pdu *pdu, int command) {
struct variable_list *var, *newvar;
struct snmp_pdu *newpdu;
int i;
int copied = 0;
-#ifdef DEBUG_PDU
+#if DEBUG_PDU
snmplib_debug(8, "PDU %x: Fixing. Err index is %d\n",
(unsigned int) pdu, (unsigned int) pdu->errindex);
#endif
snmp_set_api_error(SNMPERR_UNABLE_TO_FIX);
return (NULL);
}
-#ifdef DEBUG_PDU
+#if DEBUG_PDU
snmplib_debug(8, "PDU %x: Fixed PDU is %x\n",
(unsigned int) pdu, (unsigned int) newpdu);
#endif
return (newpdu);
}
-
/**********************************************************************/
void
{
u_char *bufp;
-#ifdef DEBUG_PDU_ENCODE
+#if DEBUG_PDU_ENCODE
snmplib_debug(8, "PDU: Encoding %d\n", PDU->command);
#endif
switch (PDU->command) {
/**********************************************************************/
-#ifdef TRP_REQ_MSG
+#if TRP_REQ_MSG
case TRP_REQ_MSG:
/* SNMPv1 Trap */
/* Normal PDU Encoding */
/* request id */
-#ifdef DEBUG_PDU_ENCODE
+#if DEBUG_PDU_ENCODE
snmplib_debug(8, "PDU: Request ID %d (0x%x)\n", PDU->reqid, DestBuf);
#endif
bufp = asn_build_int(DestBuf, DestBufLen,
return (NULL);
/* error status */
-#ifdef DEBUG_PDU_ENCODE
+#if DEBUG_PDU_ENCODE
snmplib_debug(8, "PDU: Error Status %d (0x%x)\n", PDU->errstat, bufp);
#endif
bufp = asn_build_int(bufp, DestBufLen,
return (NULL);
/* error index */
-#ifdef DEBUG_PDU_ENCODE
+#if DEBUG_PDU_ENCODE
snmplib_debug(8, "PDU: Error index %d (0x%x)\n", PDU->errindex, bufp);
#endif
bufp = asn_build_int(bufp, DestBufLen,
u_char *bufp;
u_char PDUType;
u_char ASNType;
-#ifdef UNUSED_CODE
+#if UNUSED_CODE
int four;
oid objid[MAX_NAME_LEN];
#endif
if (bufp == NULL)
ASN_PARSE_ERROR(NULL);
-#ifdef DEBUG_PDU_DECODE
+#if DEBUG_PDU_DECODE
snmplib_debug(8, "PDU Type: %d\n", PDUType);
#endif
PDU->command = PDUType;
switch (PDUType) {
-#ifdef TRP_REQ_MSG
+#if TRP_REQ_MSG
case TRP_REQ_MSG:
/* SNMPv1 Trap Message */
snmp_set_api_error(SNMPERR_OS_ERR);
return (NULL);
}
- xmemcpy((char *) PDU->enterprise, (char *) objid,
- PDU->enterprise_length * sizeof(oid));
+ memcpy((char *) PDU->enterprise, (char *) objid,
+ PDU->enterprise_length * sizeof(oid));
/* Agent-addr */
four = 4;
if (bufp == NULL)
ASN_PARSE_ERROR(NULL);
-#ifdef DEBUG_PDU_DECODE
+#if DEBUG_PDU_DECODE
snmplib_debug(8, "PDU Request ID: %d\n", PDU->reqid);
#endif
if (bufp == NULL)
ASN_PARSE_ERROR(NULL);
-#ifdef DEBUG_PDU_DECODE
+#if DEBUG_PDU_DECODE
snmplib_debug(8, "PDU Error Status: %d\n", PDU->errstat);
#endif
if (bufp == NULL)
ASN_PARSE_ERROR(NULL);
-#ifdef DEBUG_PDU_DECODE
+#if DEBUG_PDU_DECODE
snmplib_debug(8, "PDU Error Index: %d\n", PDU->errindex);
#endif