From: hno <> Date: Wed, 13 Feb 2002 09:23:47 +0000 (+0000) Subject: Killed more unused code, just in case.. X-Git-Tag: SQUID_3_0_PRE1~1193 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a56db080464e43ff011b9ae877b99504246ef50f;p=thirdparty%2Fsquid.git Killed more unused code, just in case.. --- diff --git a/include/snmp_pdu.h b/include/snmp_pdu.h index 517e03cb73..6c824340b4 100644 --- a/include/snmp_pdu.h +++ b/include/snmp_pdu.h @@ -25,7 +25,7 @@ * * Author: Ryan Troll * - * $Id: snmp_pdu.h,v 1.6 2001/10/17 19:05:37 hno Exp $ + * $Id: snmp_pdu.h,v 1.7 2002/02/13 02:23:47 hno Exp $ * **********************************************************************/ @@ -64,7 +64,6 @@ void snmp_pdu_free(struct snmp_pdu *); u_char *snmp_pdu_encode(u_char *, int *, struct snmp_pdu *); u_char *snmp_pdu_decode(u_char *, int *, struct snmp_pdu *); -const char *snmp_pdu_type(struct snmp_pdu *); /* Add a NULL Variable to a PDU */ void snmp_add_null_var(struct snmp_pdu *, oid *, int); @@ -78,12 +77,14 @@ void snmp_add_null_var(struct snmp_pdu *, oid *, int); #define SNMP_PDU_GET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) #define SNMP_PDU_GETNEXT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) #define SNMP_PDU_RESPONSE (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) +#ifdef UNUSED_CODE #define SNMP_PDU_SET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3) #define TRP_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4) /*Obsolete */ #define SNMP_PDU_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5) #define SNMP_PDU_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6) #define SNMP_PDU_V2TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7) #define SNMP_PDU_REPORT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8) +#endif #define MAX_BINDINGS 2147483647 /* PDU Defaults */ #define SNMP_DEFAULT_ERRSTAT -1 #define SNMP_DEFAULT_ERRINDEX -1 diff --git a/snmplib/coexistance.c b/snmplib/coexistance.c index 514ac9e9da..1257d819df 100644 --- a/snmplib/coexistance.c +++ b/snmplib/coexistance.c @@ -109,16 +109,20 @@ snmp_coexist_V2toV1(struct snmp_pdu *PDU) case SNMP_PDU_GET: case SNMP_PDU_GETNEXT: +#ifdef SNMP_PDU_SET case SNMP_PDU_SET: +#endif return (1); break; +#ifdef SNMP_PDU_GETBULK case SNMP_PDU_GETBULK: PDU->non_repeaters = 0; PDU->max_repetitions = 0; PDU->command = SNMP_PDU_GETNEXT; return (1); break; +#endif default: snmplib_debug(2, "Unable to translate PDU %d to SNMPv1!\n", PDU->command); diff --git a/snmplib/snmp_pdu.c b/snmplib/snmp_pdu.c index 3037bc4bd6..e5b8bb0def 100644 --- a/snmplib/snmp_pdu.c +++ b/snmplib/snmp_pdu.c @@ -359,7 +359,7 @@ snmp_pdu_encode(u_char * DestBuf, int *DestBufLen, switch (PDU->command) { /**********************************************************************/ - +#ifdef TRP_REQ_MSG case TRP_REQ_MSG: /* SNMPv1 Trap */ @@ -401,9 +401,11 @@ snmp_pdu_encode(u_char * DestBuf, int *DestBufLen, if (bufp == NULL) return (NULL); break; +#endif /**********************************************************************/ +#ifdef SNMP_PDU_GETBULK case SNMP_PDU_GETBULK: /* SNMPv2 Bulk Request */ @@ -432,6 +434,7 @@ snmp_pdu_encode(u_char * DestBuf, int *DestBufLen, return (NULL); break; +#endif /**********************************************************************/ default: @@ -487,9 +490,11 @@ snmp_pdu_decode(u_char * Packet, /* data */ { /* pdu */ u_char *bufp; u_char PDUType; - int four; u_char ASNType; +#ifdef UNUSED_CODE + int four; oid objid[MAX_NAME_LEN]; +#endif bufp = asn_parse_header(Packet, Length, &PDUType); if (bufp == NULL) @@ -502,6 +507,7 @@ snmp_pdu_decode(u_char * Packet, /* data */ PDU->command = PDUType; switch (PDUType) { +#ifdef TRP_REQ_MSG case TRP_REQ_MSG: /* SNMPv1 Trap Message */ @@ -553,9 +559,11 @@ snmp_pdu_decode(u_char * Packet, /* data */ if (bufp == NULL) ASN_PARSE_ERROR(NULL); break; +#endif /**********************************************************************/ +#ifdef SNMP_PDU_GETBULK case SNMP_PDU_GETBULK: /* SNMPv2 Bulk Request */ @@ -580,8 +588,9 @@ snmp_pdu_decode(u_char * Packet, /* data */ &PDU->max_repetitions, sizeof(PDU->max_repetitions)); if (bufp == NULL) ASN_PARSE_ERROR(NULL); - break; +#endif + /**********************************************************************/ default: @@ -627,45 +636,6 @@ snmp_pdu_decode(u_char * Packet, /* data */ return (bufp); } - -const char * -snmp_pdu_type(struct snmp_pdu *PDU) -{ - switch (PDU->command) { - case SNMP_PDU_GET: - return ("GET"); - break; - case SNMP_PDU_GETNEXT: - return ("GETNEXT"); - break; - case SNMP_PDU_RESPONSE: - return ("RESPONSE"); - break; - case SNMP_PDU_SET: - return ("SET"); - break; - case SNMP_PDU_GETBULK: - return ("GETBULK"); - break; - case SNMP_PDU_INFORM: - return ("INFORM"); - break; - case SNMP_PDU_V2TRAP: - return ("V2TRAP"); - break; - case SNMP_PDU_REPORT: - return ("REPORT"); - break; - - case TRP_REQ_MSG: - return ("V1TRAP"); - break; - default: - return ("Unknown"); - break; - } -} - /* * Add a null variable with the requested name to the end of the list of * variables for this pdu.