(file) Return to snmpIndicationHandler.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Handler / snmpIndicationHandler

Diff for /pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpIndicationHandler.cpp between version 1.3 and 1.12

version 1.3, 2002/03/14 00:07:48 version 1.12, 2002/09/13 21:40:42
Line 1 
Line 1 
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001 BMC Software, Hewlett Packard, IBM, The Open Group,  // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
 // Tivoli Systems  // The Open Group, Tivoli Systems
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 23 
Line 23 
 // //
 // Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) // Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
 // //
 // Modified By:  // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
   //                (carolann_graves@hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
   #include <Pegasus/Common/PegasusVersion.h>
   
 #include <iostream> #include <iostream>
 #include <Pegasus/Handler/CIMHandler.h> #include <Pegasus/Handler/CIMHandler.h>
 #include <Pegasus/Repository/CIMRepository.h> #include <Pegasus/Repository/CIMRepository.h>
Line 79 
Line 82 
     {     {
         prop = indication.getProperty(i);         prop = indication.getProperty(i);
  
         if (prop)          if (!prop.isUninitialized())
         {         {
             String propName = prop.getName();              CIMName propName = prop.getName();
             Uint32 propPos = indicationClass.findProperty(propName);             Uint32 propPos = indicationClass.findProperty(propName);
               if (propPos != PEG_NOT_FOUND)
               {
             CIMProperty trapProp = indicationClass.getProperty(propPos);             CIMProperty trapProp = indicationClass.getProperty(propPos);
  
             if (trapProp.existsQualifier("MappingStrings"))              qualifierPos = trapProp.findQualifier(CIMName ("MappingStrings"));
               if (qualifierPos != PEG_NOT_FOUND)
             {             {
                 qualifierPos = trapProp.findQualifier("MappingStrings");  
                 trapQualifier = trapProp.getQualifier(qualifierPos);                 trapQualifier = trapProp.getQualifier(qualifierPos);
  
                 mapstr1.clear();                 mapstr1.clear();
Line 104 
Line 109 
                             mapstr2.clear();                             mapstr2.clear();
                             mapstr2 = mapstr1.subString(0,                             mapstr2 = mapstr1.subString(0,
                                 mapstr1.find("DataType.IETF")-1);                                 mapstr1.find("DataType.IETF")-1);
   
                             propOIDs.append(mapstr2);                             propOIDs.append(mapstr2);
  
                             propValue.clear();                             propValue.clear();
Line 112 
Line 116 
                             propVALUEs.append(propValue);                             propVALUEs.append(propValue);
  
                             mapstr2 = mapstr1.subString(mapstr1.find("|")+2);                             mapstr2 = mapstr1.subString(mapstr1.find("|")+2);
                               mapstr2 = mapstr2.subString(0, mapstr2.size()-1);
                             // ATTN: There is a problem with mof compiler in                              propTYPEs.append(mapstr2);
                             // loading mof with MappingString                          }
   
                             // << 12-03-2002 : NU (HP) >>  
   
                             // MappingString{}. It loads if one additional  
                             // array is specified as follows:  
   
                             // [MappingStrings {  
                             // "OID.IETF | SNMP.1.3.6.1.4.1.11.2.3.1.6.3.1.1.4.1.1.2",  
                             // "DataType.IETF | OctetString",  
                             // "Junk"}]  
   
                             // where "Junk" is not required in actual definition.  
   
                             propTYPEs.append(mapstr2.subString(0, mapstr2.find("Junk")-1));  
                         }                         }
                     }                     }
                 }                 }
Line 146 
Line 136 
         snmpDeliverTrap_stub emanateTrap;         snmpDeliverTrap_stub emanateTrap;
 #endif #endif
  
     if ((handler.findProperty("TrapDestination") != PEG_NOT_FOUND) &&      if ((handler.findProperty(CIMName ("TrapDestination")) != PEG_NOT_FOUND) &&
         (handler.findProperty("SNMPVersion") != PEG_NOT_FOUND) &&          (handler.findProperty(CIMName ("SNMPVersion")) != PEG_NOT_FOUND) &&
         (indication.findQualifier("TrapOid") != PEG_NOT_FOUND))          (indicationClass.findQualifier(CIMName ("MappingStrings")) !=
               PEG_NOT_FOUND))
     {     {
         String community, trapType, destination;   // from handler instance         String community, trapType, destination;   // from handler instance
         String trapOid;     // from indication instance          String trapOid;     // from indication Class
   
           trapOid = indicationClass.getQualifier(
               indicationClass.findQualifier
                   (CIMName ("MappingStrings"))).getValue().toString();
  
         trapOid = indication.getQualifier(          trapOid = trapOid.subString(trapOid.find("OID.IETF | SNMP.")+16);
             indication.findQualifier("TrapOid")).getValue().toString();  
  
         community = handler.getProperty(         community = handler.getProperty(
             handler.findProperty("SNMPCommunityName")).getValue().toString();              handler.findProperty
                   (CIMName ("SNMPCommunityName"))).getValue().toString();
  
         destination = handler.getProperty(         destination = handler.getProperty(
             handler.findProperty("TrapDestination")).getValue().toString();              handler.findProperty
                   (CIMName ("TrapDestination"))).getValue().toString();
  
         trapType = handler.getProperty(         trapType = handler.getProperty(
             handler.findProperty("SNMPVersion")).getValue().toString();              handler.findProperty
                   (CIMName ("SNMPVersion"))).getValue().toString();
  
         emanateTrap.deliverTrap(         emanateTrap.deliverTrap(
             trapOid,             trapOid,
Line 174 
Line 171 
             propTYPEs,             propTYPEs,
             propVALUEs);             propVALUEs);
     }     }
       else
           cout << "Invalid Indication" << endl;
 } }
  
 // This is the dynamic entry point into this dynamic module. The name of // This is the dynamic entry point into this dynamic module. The name of


Legend:
Removed from v.1.3  
changed lines
  Added in v.1.12

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2