- (agent/agent_registry.c agent/snmp_vars.c agent/snmpd.c
   apps/snmp_parse_args.c apps/snmptest.c apps/snmptrap.c
   apps/snmptrapd.c apps/snmpnetstat/main.c snmplib/snmp_api.c
   snmplib/snmp_api.h snmplib/snmp_client.c
   agent/mibgroup/v2party.c agent/mibgroup/v2party.h):
   -  Removed last traces of v2p support


git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@2929 06827809-a52a-0410-b366-d66718629ded
diff --git a/agent/agent_registry.c b/agent/agent_registry.c
index 3e94746..325600e 100644
--- a/agent/agent_registry.c
+++ b/agent/agent_registry.c
@@ -25,9 +25,6 @@
 
 #include "m2m.h"
 #include "snmp_vars_m2m.h"
-#define SNMPV2                  1, 3, 6, 1, 6
-#define PARTYMIB        SNMPV2, 3, 3
-#define SNMPV2M2M       SNMPV2, 3, 3
 
 #include "snmpd.h"
 #include "mibgroup/struct.h"
@@ -359,10 +356,6 @@
    cvp          IN - relevant auth info re mib module
 */
 
-#ifdef USING_V2PARTY_VIEW_VARS_MODULE
-extern int in_view (oid *, int, int);
-#endif
-
 int
 in_a_view(oid		  *name,      /* IN - name of var, OUT - name matched */
           size_t	  *namelen,   /* IN -number of sub-ids in name*/
@@ -384,12 +377,6 @@
 #else
     return 1;
 #endif
-  case SNMP_VERSION_2p:
-#ifdef USING_V2PARTY_VIEW_VARS_MODULE
-    return in_view(name, *namelen, 0 /* XXX: pi->cxp->contextViewIndex */);
-#else
-    return 1;
-#endif
   }
   return 0;
 }
diff --git a/agent/mibgroup/v2party.c b/agent/mibgroup/v2party.c
deleted file mode 100644
index 8055865..0000000
--- a/agent/mibgroup/v2party.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include<config.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
-#include "mibincl.h"
-#ifdef USING_MIBII_SYSORTABLE_MODULE
-#include "mibII/sysORTable.h"
-#endif
-
-void
-init_v2party (void) 
-{
-#ifdef USING_MIBII_SYSORTABLE_MODULE
-  static oid reg[] = {1,3,6,1,6,3,2};
-  register_sysORTable(reg,7,"The Manager-to-Manager MIB module.");
-#endif
-}
diff --git a/agent/mibgroup/v2party.h b/agent/mibgroup/v2party.h
deleted file mode 100644
index 0421127..0000000
--- a/agent/mibgroup/v2party.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* module to include the modules relavent to the party mib(s) */
-config_require(v2party/acl_vars)
-config_require(v2party/party_vars)
-config_require(v2party/view_vars)
-config_require(v2party/context_vars)
-config_require(v2party/alarm)
-config_require(v2party/event)
-config_add_mib(SNMPv2-PARTY-MIB SNMPv2-M2M-MIB)
-
-void init_v2party (void);
diff --git a/agent/snmp_vars.c b/agent/snmp_vars.c
index c27f5bb..2bf4adb 100644
--- a/agent/snmp_vars.c
+++ b/agent/snmp_vars.c
@@ -181,73 +181,11 @@
 }  /* end init_agent() */
 
 
-#define CMUMIB 1, 3, 6, 1, 4, 1, 3
-#define       CMUUNIXMIB  CMUMIB, 2, 2
-
-#define SNMPV2 			1, 3, 6, 1, 6
-#define SNMPV2M2M		SNMPV2, 3, 2
-
-#define SNMPV2ALARMEVENTS	SNMPV2M2M, 1, 1, 3
-
-#define RMONMIB 1, 3, 6, 1, 2, 1, 16
-
-#define HOST                    RMONMIB, 4
-#define HOSTCONTROL             HOST, 1, 1                      /* hostControlEntry */
-#define HOSTTAB                 HOST, 2, 1                      /* hostEntry */
-#define HOSTTIMETAB             HOST, 3, 1                      /* hostTimeEntry */
-#define HOSTTOPN                RMONMIB, 5
-#define HOSTTOPNCONTROL HOSTTOPN, 1, 1          /* hostTopNControlEntry */
-#define HOSTTOPNTAB             HOSTTOPN, 2, 1          /* hostTopNEntry */
-#define HOSTTIMETABADDRESS                                      1
-#define HOSTTIMETABCREATIONORDER                        2
-#define HOSTTIMETABINDEX                                        3
-#define HOSTTIMETABINPKTS                                       4
-#define HOSTTIMETABOUTPKTS                                      5
-#define HOSTTIMETABINOCTETS                                     6
-#define HOSTTIMETABOUTOCTETS                            7
-#define HOSTTIMETABOUTERRORS                            8
-#define HOSTTIMETABOUTBCASTPKTS                         9
-#define HOSTTIMETABOUTMCASTPKTS                         10
-
-#if 0
-#define RMONMIB 1, 3, 6, 1, 2, 1, 16
-
-#define ALARM                   RMONMIB, 3
-#define ALARMTAB                ALARM, 1, 1                 /* alarmEntry */
-#define EVENT                   RMONMIB, 9
-#define EVENTTAB                EVENT, 1, 1                 /* eventEntry */
-#endif
-
-
-/* various OIDs that are needed throughout the agent */
-#ifdef USING_V2PARTY_ALARM_MODULE
-Export oid alarmVariableOid[] = {SNMPV2ALARMENTRY, ALARMTABVARIABLE};
-Export int alarmVariableOidLen = sizeof(alarmVariableOid) / sizeof(oid);
-Export oid alarmSampleTypeOid[] = {SNMPV2ALARMENTRY, ALARMTABSAMPLETYPE};
-Export int alarmSampleTypeOidLen = sizeof(alarmSampleTypeOid) / sizeof(oid);
-Export oid alarmValueOid[] = {SNMPV2ALARMENTRY, ALARMTABVALUE};
-Export int alarmValueOidLen = sizeof(alarmValueOid) / sizeof(oid);
-Export oid alarmFallingThreshOid[] = {SNMPV2ALARMENTRY, ALARMTABFALLINGTHRESH};
-Export int alarmFallingThreshOidLen = sizeof(alarmFallingThreshOid)/sizeof(oid);
-Export oid alarmRisingThreshOid[] = {SNMPV2ALARMENTRY, ALARMTABRISINGTHRESH};
-Export int alarmRisingThreshOidLen = sizeof(alarmRisingThreshOid)/sizeof(oid);
-#endif
 
 Export oid nullOid[] = {0,0};
 Export int nullOidLen = sizeof(nullOid)/sizeof(oid);
 Export oid sysUpTimeOid[] = {1,3,6,1,2,1,1,3,0};
 Export int sysUpTimeOidLen = sizeof(sysUpTimeOid)/sizeof(oid);
-#ifdef USING_V2PARTY_EVENT_MODULE
-Export oid eventIdOid[] = {SNMPV2EVENTENTRY, EVENTTABID};
-Export int eventIdOidLen = sizeof(eventIdOid)/sizeof(oid);
-Export oid trapRisingAlarmOid[] = {SNMPV2ALARMEVENTS, 1};
-Export int trapRisingAlarmOidLen = sizeof(trapRisingAlarmOid)/sizeof(oid);
-Export oid trapFallingAlarmOid[] = {SNMPV2ALARMEVENTS, 2};
-Export int trapFallingAlarmOidLen = sizeof(trapFallingAlarmOid)/sizeof(oid);
-Export oid trapObjUnavailAlarmOid[] = {SNMPV2ALARMEVENTS, 3};
-Export int trapObjUnavailAlarmOidLen = sizeof(trapObjUnavailAlarmOid)/sizeof(oid);
-#endif
-
 
 /*
  * getStatPtr - return a pointer to the named variable, as well as it's
diff --git a/agent/snmpd.c b/agent/snmpd.c
index f3ba111..7a7ff92 100644
--- a/agent/snmpd.c
+++ b/agent/snmpd.c
@@ -109,13 +109,6 @@
 #include "mibgroup/snmpv3/usmUser.h"
 #endif
 
-#ifdef USING_V2PARTY_ALARM_MODULE
-#include "mibgroup/v2party/alarm.h"
-#endif
-#ifdef USING_V2PARTY_EVENT_MODULE
-#include "mibgroup/v2party/event.h"
-#endif
-
 #include "snmp_client.h"
 #include "snmpd.h"
 #include "var_struct.h"
@@ -991,12 +984,6 @@
 
 	if (nvp->tv_sec > svp->tv_sec
 	    || (nvp->tv_sec == svp->tv_sec && nvp->tv_usec > svp->tv_usec)){
-#ifdef USING_V2PARTY_ALARM_MODULE
-	    alarmTimer(nvp);
-#endif
-#ifdef USING_V2PARTY_EVENT_MODULE
-	    eventTimer(nvp);
-#endif
             svp->tv_usec = nvp->tv_usec + TIMETICK;
             svp->tv_sec = nvp->tv_sec;
     
@@ -1148,16 +1135,11 @@
 		/* this is just the ack to our inform pdu */
 		return 1;
 	    }
-#ifdef USING_V2PARTY_ALARM_MODULE
-	    return alarmGetResponse(pdu, state, op, session);
-#endif
 	}
     }
     else if (op == TIMED_OUT) {
 	if (state->type == ALARM_GET_REQ) {
-#ifdef USING_V2PARTY_ALARM_MODULE
-	    return alarmGetResponse(pdu, state, op, session);
-#endif
+		/* Need a mechanism to replace obsolete SNMPv2p alarm */
 	}
     }
     return 1;
diff --git a/apps/snmp_parse_args.c b/apps/snmp_parse_args.c
index 929aada..24160a9 100644
--- a/apps/snmp_parse_args.c
+++ b/apps/snmp_parse_args.c
@@ -82,14 +82,14 @@
 void
 snmp_parse_args_usage(FILE *outf)
 {
-  fprintf(outf, "[-v 1|2c|2p|3] [-h] [-H] [-d] [-q] [-R] [-D] [-m <MIBS>] [-M <MIDDIRS>] [-p <P>] [-t <T>] [-r <R>] ");
-  fprintf(outf, "[-T <B> <T>] [-e <E>] [-E <E>] [-n <N>] [-u <U>] [-l <L>] [-a <A>] [-A <P>] [-x <X>] [-X <P>] <hostname> {<community>|{<srcParty> <dstParty> <context>|}");
+  fprintf(outf, "[-v 1|2c|3] [-h] [-H] [-d] [-q] [-R] [-D] [-m <MIBS>] [-M <MIDDIRS>] [-p <P>] [-t <T>] [-r <R>] ");
+  fprintf(outf, "[-T <B> <T>] [-e <E>] [-E <E>] [-n <N>] [-u <U>] [-l <L>] [-a <A>] [-A <P>] [-x <X>] [-X <P>] <hostname> {<community>}");
 }
 
 void
 snmp_parse_args_descriptions(FILE *outf)
 {
-  fprintf(outf, "  -v 1|2c|2p|3\tspecifies snmp version to use.\n");
+  fprintf(outf, "  -v 1|2c|3\tspecifies snmp version to use.\n");
   fprintf(outf, "  -h\t\tthis help message.\n");
   fprintf(outf, "  -H\t\tDisplay configuration file directives understood.\n");
   fprintf(outf, "  -V\t\tdisplay version number.\n");
@@ -265,8 +265,6 @@
           session->version = SNMP_VERSION_1;
         } else if (!strcasecmp(psz,"2c")) {
           session->version = SNMP_VERSION_2c;
-        } else if (!strcasecmp(psz,"2p")) {
-          session->version = SNMP_VERSION_2p;
         } else if (!strcasecmp(psz,"3")) {
           session->version = SNMP_VERSION_3;
         } else {
@@ -514,7 +512,7 @@
   }
   session->peername = argv[arg++];     /* hostname */
 
-  /* get community or party */
+  /* get community */
   if ((session->version == SNMP_VERSION_1) ||
       (session->version == SNMP_VERSION_2c)) {
     /* v1 and v2c - so get community string */
diff --git a/apps/snmpnetstat/main.c b/apps/snmpnetstat/main.c
index 5492939..ba02e9c 100644
--- a/apps/snmpnetstat/main.c
+++ b/apps/snmpnetstat/main.c
@@ -134,8 +134,7 @@
 void usage(void)
 {
     fprintf(stderr, "Usage: snmpnetstat [-v 1 | -v 2c] [-q] [-D] hostname community [-ainrs] [-P proto] [-I interface] [interval]      or:\n");
-    fprintf(stderr, "Usage: snmpnetstat [-v 2p] [-q] [-D] hostname noAuth [-ainrs] [-P proto] [-I interface] [interval]       or:\n");
-    fprintf(stderr, "Usage: snmpnetstat [-v 2p] [-q] [-D] hostname srcParty dstParty context [-ainrs] [-P proto] [-I interface] [interval]\n");
+    fprintf(stderr, "Usage: snmpnetstat [-q] [-D] hostname noAuth [-ainrs] [-P proto] [-I interface] [interval]\n");
 }
 
 int main(int argc, char *argv[])
@@ -153,14 +152,6 @@
     size_t srclen = 0, dstlen = 0, contextlen = 0;
     int trivialSNMPv2 = FALSE;
     int arg;
-#ifdef USE_V2PARTY_PROTOCOL
-    char ctmp[128];
-    struct partyEntry *pp;
-    struct contextEntry *cxp;
-    oid src[MAX_OID_LEN], dst[MAX_OID_LEN], context[MAX_OID_LEN];
-    struct hostent *hp;
-    in_addr_t destAddr;
-#endif
 
 #ifdef _DEBUG_MALLOC_INC
     unsigned long histid1, histid2, orig_size, current_size;
@@ -169,8 +160,7 @@
     init_mib();
     /*
      * Usage: snmpnetstatwalk -v 1 [-q] hostname community ...      or:
-     * Usage: snmpnetstat [-v 2 ] [-q] hostname noAuth     ...      or:
-     * Usage: snmpnetstat [-v 2 ] [-q] hostname srcParty dstParty context ...
+     * Usage: snmpnetstat [-v 2 ] [-q] hostname noAuth     ...
      */
     for(arg = 1; arg < argc; arg++){
 	if (argv[arg][0] == '-'){
@@ -294,9 +284,7 @@
     }
     
     if (!hostname ||
-	((version == SNMP_VERSION_1 || version == SNMP_VERSION_2c) && !community)
-	|| (version == SNMP_VERSION_2p && (!srclen || !dstlen || !contextlen)
-	    && !trivialSNMPv2)){
+	((version == SNMP_VERSION_1 || version == SNMP_VERSION_2c) && !community)) {
 	usage();
 	exit(1);
     }
diff --git a/apps/snmptest.c b/apps/snmptest.c
index 762cf73..12c7cc2 100644
--- a/apps/snmptest.c
+++ b/apps/snmptest.c
@@ -101,9 +101,7 @@
     char	input[128];
     int varcount, nonRepeaters = -1, maxRepetitions;
 
-    /* Usage: snmptest -v 1 [-q] hostname community [objectID]      or:
-     * Usage: snmptest [-v 2] [-q] hostname noAuth [objectID]       or:
-     * Usage: snmptest [-v 2] [-q] hostname srcParty dstParty context [objectID]
+    /* Usage: snmptest -v 1 [-q] hostname community [objectID]
      */
 
     snmp_parse_args(argc, argv, &session);
diff --git a/apps/snmptrap.c b/apps/snmptrap.c
index 3f7c208..31c4296 100644
--- a/apps/snmptrap.c
+++ b/apps/snmptrap.c
@@ -136,7 +136,7 @@
 #endif
 
     /*
-     * usage: snmptrap gateway-name srcParty dstParty trap-type specific-type device-description [ -a agent-addr ]
+     * usage: snmptrap gateway-name trap-type specific-type device-description [ -a agent-addr ]
      */
     arg = snmp_parse_args(argc, argv, &session);
 
diff --git a/apps/snmptrapd.c b/apps/snmptrapd.c
index b2402ac..bf5eb09 100644
--- a/apps/snmptrapd.c
+++ b/apps/snmptrapd.c
@@ -775,10 +775,6 @@
     session->peername = SNMP_DEFAULT_PEERNAME; /* Original code had NULL here */
     session->version = SNMP_DEFAULT_VERSION;
 
-    session->srcPartyLen = 0;
-    session->dstPartyLen = 0;
-    session->contextLen = 0; 
-
     session->community_len = SNMP_DEFAULT_COMMUNITY_LEN;
 
     session->retries = SNMP_DEFAULT_RETRIES;
diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c
index c6507e6..9681582 100644
--- a/snmplib/snmp_api.c
+++ b/snmplib/snmp_api.c
@@ -800,42 +800,6 @@
       }
     }
 
-    if (session->srcPartyLen > 0){
-	op = (oid *)malloc((unsigned)session->srcPartyLen * sizeof(oid));
-	if (op == NULL) {
-	    snmp_sess_close(slp);
-	    return(NULL);
-	}
-	memmove(op, session->srcParty, session->srcPartyLen * sizeof(oid));
-	session->srcParty = op;
-    } else {
-	session->srcParty = 0;
-    }
-
-    if (session->dstPartyLen > 0){
-	op = (oid *)malloc((unsigned)session->dstPartyLen * sizeof(oid));
-	if (op == NULL) {
-	    snmp_sess_close(slp);
-	    return(NULL);
-	}
-	memmove(op, session->dstParty, session->dstPartyLen * sizeof(oid));
-	session->dstParty = op;
-    } else {
-	session->dstParty = 0;
-    }
-
-    if (session->contextLen > 0){
-	op = (oid *)malloc((unsigned)session->contextLen * sizeof(oid));
-	if (op == NULL) {
-	    snmp_sess_close(slp);
-	    return(NULL);
-	}
-	memmove(op, session->context, session->contextLen * sizeof(oid));
-	session->context = op;
-    } else {
-	session->context = 0;
-    }
-
     if (session->retries == SNMP_DEFAULT_RETRIES)
 	session->retries = DEFAULT_RETRIES;
     if (session->timeout == SNMP_DEFAULT_TIMEOUT)
@@ -1267,9 +1231,6 @@
 
     sesp = slp->session; slp->session = 0;
     if (sesp) {
-        SNMP_FREE(sesp->context);
-        SNMP_FREE(sesp->dstParty);
-        SNMP_FREE(sesp->srcParty);
         SNMP_FREE(sesp->peername);
         SNMP_FREE(sesp->community);
         SNMP_FREE(sesp->contextEngineID);
@@ -3139,12 +3100,6 @@
     SNMP_FREE(pdu->securityEngineID);
     SNMP_FREE(pdu->contextName);
     SNMP_FREE(pdu->securityName);
-    if (pdu->srcParty != pdu->srcPartyBuf) 
-      SNMP_FREE(pdu->srcParty);
-    if (pdu->dstParty != pdu->dstPartyBuf) 
-      SNMP_FREE(pdu->dstParty);
-    if (pdu->context != pdu->contextBuf) 
-      SNMP_FREE(pdu->context);
     free((char *)pdu);
 }
 
diff --git a/snmplib/snmp_api.h b/snmplib/snmp_api.h
index 1aa966a..df4397f 100644
--- a/snmplib/snmp_api.h
+++ b/snmplib/snmp_api.h
@@ -114,21 +114,6 @@
     long    specific_type;	/* specific type */
 
 	/*
-	 * SNMPv2party fields
-	 */
-    oid	    *srcParty;
-    size_t  srcPartyLen;
-    oid	    *dstParty;
-    size_t  dstPartyLen;
-    oid	    *context;
-    size_t  contextLen;
-    struct partyEntry *srcp, *dstp;
-    struct contextEntry *cxp;
-    oid srcPartyBuf[MAX_OID_LEN];
-    oid dstPartyBuf[MAX_OID_LEN];
-    oid contextBuf[MAX_OID_LEN];
-
-	/*
 	 * SNMPv3 fields
 	 */
     u_char  *contextEngineID;	/* context snmpEngineID */
@@ -184,16 +169,6 @@
     size_t  community_len;      /* Length of community name. */
 
 	/*
-	 * SNMPv2party fields
-	 */
-    oid	    *srcParty;
-    size_t  srcPartyLen;
-    oid	    *dstParty;
-    size_t  dstPartyLen;
-    oid	    *context;
-    size_t  contextLen;
-
-	/*
 	 * SNMPv3 fields
 	 */
     u_char  *contextEngineID;	/* authoritative snmpEngineID */
diff --git a/snmplib/snmp_client.c b/snmplib/snmp_client.c
index 0b79185..621e1f4 100644
--- a/snmplib/snmp_client.c
+++ b/snmplib/snmp_client.c
@@ -263,7 +263,6 @@
 
     /* reset copied pointers if copy fails */
     newpdu->variables = 0; newpdu->enterprise = 0; newpdu->community = 0;
-    newpdu->srcParty  = 0; newpdu->dstParty   = 0; newpdu->context   = 0;
     newpdu->securityEngineID = 0; newpdu->securityName = 0;
     newpdu->contextEngineID  = 0; newpdu->contextName  = 0;
 
@@ -280,12 +279,6 @@
                                     pdu->contextNameLen)
      ||  snmp_clone_mem((void **)&newpdu->securityName, pdu->securityName,
                                     pdu->securityNameLen)
-     ||  snmp_clone_mem((void **)&newpdu->srcParty, pdu->srcParty,
-                                    sizeof(oid)*pdu->srcPartyLen)
-     ||  snmp_clone_mem((void **)&newpdu->dstParty, pdu->dstParty,
-                                    sizeof(oid)*pdu->dstPartyLen)
-     ||  snmp_clone_mem((void **)&newpdu->context, pdu->context,
-                                    sizeof(oid)*pdu->contextLen)
        )
     {
         snmp_free_pdu(newpdu); return 0;