version 1.18, 2003/08/22 14:49:49
|
version 1.39, 2008/08/28 17:24:42
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// 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 |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) |
|
// |
|
// Modified By: Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
|
// : Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.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> |
|
#include <Pegasus/Common/Tracer.h> |
| |
#include "snmpIndicationHandler.h" | #include "snmpIndicationHandler.h" |
| |
#ifdef HPUX_EMANATE | #ifdef HPUX_EMANATE |
#include "snmpDeliverTrap_emanate.h" | #include "snmpDeliverTrap_emanate.h" |
|
#elif defined (PEGASUS_USE_NET_SNMP) |
|
# include "snmpDeliverTrap_netsnmp.h" |
#else | #else |
#include "snmpDeliverTrap_stub.h" | #include "snmpDeliverTrap_stub.h" |
#endif | #endif |
| |
// l10n |
|
#include <Pegasus/Common/MessageLoader.h> | #include <Pegasus/Common/MessageLoader.h> |
| |
|
PEGASUS_USING_STD; |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
PEGASUS_USING_STD; |
snmpIndicationHandler::snmpIndicationHandler() |
|
{ |
|
PEG_METHOD_ENTER (TRC_IND_HANDLER, |
|
"snmpIndicationHandler::snmpIndicationHandler"); |
|
|
|
#ifdef HPUX_EMANATE |
|
_snmpTrapSender = new snmpDeliverTrap_emanate(); |
|
#elif defined (PEGASUS_USE_NET_SNMP) |
|
_snmpTrapSender = new snmpDeliverTrap_netsnmp(); |
|
#else |
|
_snmpTrapSender = new snmpDeliverTrap_stub(); |
|
#endif |
|
|
|
PEG_METHOD_EXIT(); |
|
} |
| |
void snmpIndicationHandler::initialize(CIMRepository* repository) | void snmpIndicationHandler::initialize(CIMRepository* repository) |
{ | { |
|
PEG_METHOD_ENTER (TRC_IND_HANDLER, |
|
"snmpIndicationHandler::initialize"); |
|
|
_repository = repository; | _repository = repository; |
|
|
|
_snmpTrapSender->initialize(); |
|
|
|
PEG_METHOD_EXIT(); |
|
} |
|
|
|
void snmpIndicationHandler::terminate() |
|
{ |
|
PEG_METHOD_ENTER(TRC_IND_HANDLER, |
|
"snmpIndicationHandler::terminate"); |
|
|
|
_snmpTrapSender->terminate(); |
|
|
|
PEG_METHOD_EXIT(); |
|
} |
|
|
|
snmpIndicationHandler::~snmpIndicationHandler() |
|
{ |
|
PEG_METHOD_ENTER(TRC_IND_HANDLER, |
|
"snmpIndicationHandler::~snmpIndicationHandler"); |
|
|
|
delete _snmpTrapSender; |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
// l10n - note: ignoring indication language | // l10n - note: ignoring indication language |
void snmpIndicationHandler::handleIndication( | void snmpIndicationHandler::handleIndication( |
const OperationContext& context, | const OperationContext& context, |
|
const String nameSpace, |
|
CIMInstance& indication, |
CIMInstance& handler, | CIMInstance& handler, |
CIMInstance& indication, String nameSpace, |
CIMInstance& subscription, |
ContentLanguages & contentLanguages) |
ContentLanguageList & contentLanguages) |
{ | { |
Array<String> propOIDs; | Array<String> propOIDs; |
Array<String> propTYPEs; | Array<String> propTYPEs; |
Array<String> propVALUEs; | Array<String> propVALUEs; |
| |
CIMProperty prop; |
Array<String> mapStr; |
CIMQualifier trapQualifier; |
|
| |
Uint32 qualifierPos; |
PEG_METHOD_ENTER(TRC_IND_HANDLER, |
|
"snmpIndicationHandler::handleIndication"); |
String propValue; |
|
|
|
String mapstr1; |
|
String mapstr2; |
|
| |
|
try |
|
{ |
|
PEG_TRACE ((TRC_INDICATION_GENERATION, Tracer::LEVEL4, |
|
"snmpIndicationHandler %s:%s.%s processing %s Indication", |
|
(const char*)(nameSpace.getCString()), |
|
(const char*)(handler.getClassName().getString().getCString()), |
|
(const char*)(handler.getProperty( |
|
handler.findProperty(PEGASUS_PROPERTYNAME_NAME)). |
|
getValue().toString().getCString()), |
|
(const char*)(indication.getClassName().getString(). |
|
getCString()))); |
CIMClass indicationClass = _repository->getClass( | CIMClass indicationClass = _repository->getClass( |
nameSpace, indication.getClassName(), false); |
nameSpace, indication.getClassName(), false, true, |
|
false, CIMPropertyList()); |
| |
Uint32 propertyCount = indication.getPropertyCount(); | Uint32 propertyCount = indication.getPropertyCount(); |
| |
for (Uint32 i=0; i < propertyCount; i++) | for (Uint32 i=0; i < propertyCount; i++) |
{ | { |
prop = indication.getProperty(i); |
CIMProperty prop = indication.getProperty(i); |
| |
if (!prop.isUninitialized()) |
Uint32 propDeclPos = indicationClass.findProperty(prop.getName()); |
{ |
if (propDeclPos != PEG_NOT_FOUND) |
CIMName propName = prop.getName(); |
|
Uint32 propPos = indicationClass.findProperty(propName); |
|
if (propPos != PEG_NOT_FOUND) |
|
{ | { |
CIMProperty trapProp = indicationClass.getProperty(propPos); |
CIMProperty propDecl = indicationClass.getProperty(propDeclPos); |
| |
qualifierPos = trapProp.findQualifier(CIMName ("MappingStrings")); |
Uint32 qualifierPos = |
|
propDecl.findQualifier(CIMName("MappingStrings")); |
if (qualifierPos != PEG_NOT_FOUND) | if (qualifierPos != PEG_NOT_FOUND) |
{ | { |
trapQualifier = trapProp.getQualifier(qualifierPos); |
// |
|
// We are looking for following fields: |
|
// MappingStrings {"OID.IETF | SNMP." oidStr, |
|
// "DataType.IETF |" dataType} |
|
// oidStr is the object identifier (e.g. "1.3.6.1.2.1.5..." |
|
// dataType is either Integer, or OctetString, |
|
// or OID |
|
// Following is one example: |
|
// MappingStrings {"OID.IETF | SNMP.1.3.6.6.3.1.1.5.2", |
|
// "DataType.IETF | Integer"} |
|
// |
| |
mapstr1.clear(); |
propDecl.getQualifier(qualifierPos).getValue().get( |
mapstr1 = trapQualifier.getValue().toString(); |
mapStr); |
| |
if ((mapstr1.find("OID.IETF") != PEG_NOT_FOUND) && |
String oidStr, dataType; |
(mapstr1.find("DataType.IETF") != PEG_NOT_FOUND)) |
String mapStr1, mapStr2; |
{ |
Boolean isValidAuthority = false; |
if (mapstr1.subString(0, 8) == "OID.IETF") |
Boolean isValidDataType = false; |
|
|
|
for (Uint32 j=0; j < mapStr.size(); j++) |
{ | { |
mapstr1 = mapstr1.subString(mapstr1.find("SNMP.")+5); |
Uint32 barPos = mapStr[j].find("|"); |
if (mapstr1.find("|") != PEG_NOT_FOUND) |
|
|
if (barPos != PEG_NOT_FOUND) |
{ | { |
mapstr2.clear(); |
mapStr1 = mapStr[j].subString(0, barPos); |
mapstr2 = mapstr1.subString(0, |
mapStr2 = mapStr[j].subString(barPos + 1); |
mapstr1.find("DataType.IETF")-1); |
|
propOIDs.append(mapstr2); |
|
| |
propValue.clear(); |
_trimWhitespace(mapStr1); |
propValue = prop.getValue().toString(); |
_trimWhitespace(mapStr2); |
propVALUEs.append(propValue); |
|
| |
mapstr2 = mapstr1.subString(mapstr1.find("|")+2); |
if ((mapStr1 == "OID.IETF") && |
mapstr2 = mapstr2.subString(0, mapstr2.size()-1); |
(String::compare(mapStr2, |
propTYPEs.append(mapstr2); |
String("SNMP."), 5) == 0)) |
|
{ |
|
isValidAuthority = true; |
|
oidStr = mapStr2.subString(5); |
} | } |
|
else if (mapStr1 == "DataType.IETF") |
|
{ |
|
isValidDataType = true; |
|
dataType = mapStr2; |
|
} |
|
|
|
if (isValidAuthority && isValidDataType) |
|
{ |
|
propOIDs.append(oidStr); |
|
propTYPEs.append(dataType); |
|
propVALUEs.append(prop.getValue().toString()); |
|
|
|
break; |
} | } |
} | } |
} | } |
|
|
// trap destination and SNMP type are defined in handlerInstance | // trap destination and SNMP type are defined in handlerInstance |
// and passing this instance as it is to deliverTrap() call | // and passing this instance as it is to deliverTrap() call |
| |
#ifdef HPUX_EMANATE |
|
snmpDeliverTrap_emanate emanateTrap; |
|
#else |
|
snmpDeliverTrap_stub emanateTrap; |
|
#endif |
|
|
|
Uint32 targetHostPos = handler.findProperty(CIMName ("TargetHost")); | Uint32 targetHostPos = handler.findProperty(CIMName ("TargetHost")); |
Uint32 targetHostFormatPos = handler.findProperty(CIMName ("TargetHostFormat")); |
Uint32 targetHostFormatPos = |
Uint32 otherTargetHostFormatPos = handler.findProperty(CIMName ( |
handler.findProperty(CIMName("TargetHostFormat")); |
"OtherTargetHostFormat")); |
Uint32 otherTargetHostFormatPos = |
|
handler.findProperty(CIMName("OtherTargetHostFormat")); |
Uint32 portNumberPos = handler.findProperty(CIMName ("PortNumber")); | Uint32 portNumberPos = handler.findProperty(CIMName ("PortNumber")); |
Uint32 snmpVersionPos = handler.findProperty(CIMName ("SNMPVersion")); | Uint32 snmpVersionPos = handler.findProperty(CIMName ("SNMPVersion")); |
Uint32 securityNamePos = handler.findProperty(CIMName ("SNMPSecurityName")); |
Uint32 securityNamePos = |
|
handler.findProperty(CIMName("SNMPSecurityName")); |
Uint32 engineIDPos = handler.findProperty(CIMName ("SNMPEngineID")); | Uint32 engineIDPos = handler.findProperty(CIMName ("SNMPEngineID")); |
| |
if ((targetHostPos != PEG_NOT_FOUND) && |
if (targetHostPos == PEG_NOT_FOUND) |
(targetHostFormatPos != PEG_NOT_FOUND) && |
{ |
(snmpVersionPos != PEG_NOT_FOUND) && |
PEG_TRACE((TRC_DISCARDED_DATA, Tracer::LEVEL1, |
(indicationClass.findQualifier(CIMName ("MappingStrings")) != |
"Target host is not set for IndicationHandlerSNMPMapper %s" |
PEG_NOT_FOUND)) |
" Indication.", |
|
(const char*)(indication.getClassName().getString(). |
|
getCString()))); |
|
PEG_METHOD_EXIT(); |
|
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms( |
|
"Handler.snmpIndicationHandler.snmpIndicationHandler." |
|
"INVALID_SNMP_INSTANCE", |
|
"Invalid IndicationHandlerSNMPMapper instance")); |
|
} |
|
if (targetHostFormatPos == PEG_NOT_FOUND) |
|
{ |
|
PEG_TRACE((TRC_DISCARDED_DATA, Tracer::LEVEL1, |
|
"Target host format is not set for IndicationHandlerSNMPMapper" |
|
" %s Indication.", |
|
(const char*)(indication.getClassName().getString(). |
|
getCString()))); |
|
PEG_METHOD_EXIT(); |
|
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms( |
|
"Handler.snmpIndicationHandler.snmpIndicationHandler." |
|
"INVALID_SNMP_INSTANCE", |
|
"Invalid IndicationHandlerSNMPMapper instance")); |
|
} |
|
if (snmpVersionPos == PEG_NOT_FOUND) |
|
{ |
|
PEG_TRACE((TRC_DISCARDED_DATA, Tracer::LEVEL1, |
|
"SNMP Version is not set for IndicationHandlerSNMPMapper %s" |
|
" Indication.", |
|
(const char*)(indication.getClassName().getString(). |
|
getCString()))); |
|
PEG_METHOD_EXIT(); |
|
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms( |
|
"Handler.snmpIndicationHandler.snmpIndicationHandler." |
|
"INVALID_SNMP_INSTANCE", |
|
"Invalid IndicationHandlerSNMPMapper instance")); |
|
} |
|
else |
{ | { |
// properties from the handler instance | // properties from the handler instance |
String targetHost, otherTargetHostFormat; |
String targetHost; |
String securityName, engineID; |
String otherTargetHostFormat = String(); |
Uint16 targetHostFormat, snmpVersion; |
String securityName = String(); |
|
String engineID = String(); |
|
Uint16 targetHostFormat = 0; |
|
Uint16 snmpVersion = 0; |
Uint32 portNumber; | Uint32 portNumber; |
| |
String trapOid; | String trapOid; |
|
Boolean trapOidAvailable = false; |
// | // |
// Get snmpTrapOid from context | // Get snmpTrapOid from context |
// | // |
try |
if (context.contains(SnmpTrapOidContainer::NAME)) |
{ | { |
SnmpTrapOidContainer trapContainer = context.get |
SnmpTrapOidContainer trapContainer = |
(SnmpTrapOidContainer::NAME); |
context.get(SnmpTrapOidContainer::NAME); |
| |
trapOid = trapContainer.getSnmpTrapOid(); | trapOid = trapContainer.getSnmpTrapOid(); |
|
trapOidAvailable = true; |
} | } |
catch (Exception& e) |
else |
{ | { |
// get trapOid from indication Class | // get trapOid from indication Class |
| |
Uint32 pos = indicationClass.findQualifier(CIMName ("MappingStrings")); |
Uint32 pos = |
|
indicationClass.findQualifier(CIMName("MappingStrings")); |
if (pos != PEG_NOT_FOUND) | if (pos != PEG_NOT_FOUND) |
{ | { |
trapOid = indicationClass.getQualifier(pos).getValue().toString(); |
Array<String> classMapStr; |
|
indicationClass.getQualifier(pos).getValue(). |
|
get(classMapStr); |
|
|
|
for (Uint32 i=0; i < classMapStr.size(); i++) |
|
{ |
|
Uint32 barPos = classMapStr[i].find("|"); |
|
|
|
if (barPos != PEG_NOT_FOUND) |
|
{ |
|
String authorityName = |
|
classMapStr[i].subString(0, barPos); |
|
String oidStr = classMapStr[i].subString( |
|
barPos+1, PEG_NOT_FOUND); |
| |
trapOid = trapOid.subString(11, PEG_NOT_FOUND); |
_trimWhitespace(authorityName); |
|
_trimWhitespace(oidStr); |
| |
if ((String::compare(trapOid, "SNMP.", 5)) == 0) |
if ((authorityName == "OID.IETF") && |
|
(String::compare(oidStr, |
|
String("SNMP."), 5) == 0)) |
{ | { |
trapOid = trapOid.subString(5, (trapOid.size()-6)); |
trapOid = oidStr.subString(5); |
|
trapOidAvailable = true; |
|
break; |
} | } |
else |
} |
|
} |
|
|
|
if (!trapOidAvailable) |
{ | { |
// l10n |
PEG_TRACE(( |
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Invalid MappingStrings Value"); |
TRC_IND_HANDLER, |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
Tracer::LEVEL1, |
MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.INVALID_MS_VALUE", |
"No MappingStrings for snmp trap is specified " |
"Invalid MappingStrings Value")); |
"for class: %s", |
|
(const char*) |
|
indication.getClassName().getString().getCString() |
|
)); |
|
|
|
PEG_METHOD_EXIT(); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L( |
|
CIM_ERR_FAILED, |
|
MessageLoaderParms( |
|
"Handler.snmpIndicationHandler." |
|
"snmpIndicationHandler.NO_MS_FOR_SNMP_TRAP", |
|
"No MappingStrings for snmp trap is specified " |
|
"for class: $0", |
|
indication.getClassName().getString())); |
} | } |
} | } |
else | else |
{ | { |
//L10N_ TODO DONE |
PEG_TRACE_CSTRING(TRC_IND_HANDLER, Tracer::LEVEL1, |
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Qualifier MappingStrings can not be found"); |
"Qualifier MappingStrings can not be found."); |
MessageLoaderParms parms("Handler.snmpIndicationHandler.snmpIndicationHandler.QUALIFIER_MAPPINGS_NOT_FOUND", |
PEG_METHOD_EXIT(); |
|
MessageLoaderParms parms( |
|
"Handler.snmpIndicationHandler.snmpIndicationHandler." |
|
"QUALIFIER_MAPPINGS_NOT_FOUND", |
"Qualifier MappingStrings can not be found"); | "Qualifier MappingStrings can not be found"); |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms); | throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms); |
} | } |
} | } |
| |
handler.getProperty(targetHostPos).getValue().get(targetHost); | handler.getProperty(targetHostPos).getValue().get(targetHost); |
handler.getProperty(targetHostFormatPos).getValue().get(targetHostFormat); |
handler.getProperty(targetHostFormatPos).getValue().get( |
handler.getProperty(otherTargetHostFormatPos).getValue().get |
targetHostFormat); |
(otherTargetHostFormat); |
if (otherTargetHostFormatPos != PEG_NOT_FOUND) |
|
{ |
|
handler.getProperty(otherTargetHostFormatPos).getValue().get( |
|
otherTargetHostFormat); |
|
} |
|
if (portNumberPos != PEG_NOT_FOUND) |
|
{ |
handler.getProperty(portNumberPos).getValue().get(portNumber); | handler.getProperty(portNumberPos).getValue().get(portNumber); |
|
} |
|
else |
|
{ |
|
// default port |
|
portNumber = SNMP_TRAP_DEFAULT_PORT; |
|
} |
|
|
handler.getProperty(snmpVersionPos).getValue().get(snmpVersion); | handler.getProperty(snmpVersionPos).getValue().get(snmpVersion); |
handler.getProperty(securityNamePos).getValue().get(securityName); |
if (securityNamePos != PEG_NOT_FOUND) |
|
{ |
|
handler.getProperty(securityNamePos).getValue().get( |
|
securityName); |
|
} |
|
if (engineIDPos != PEG_NOT_FOUND) |
|
{ |
handler.getProperty(engineIDPos).getValue().get(engineID); | handler.getProperty(engineIDPos).getValue().get(engineID); |
|
} |
| |
emanateTrap.deliverTrap( |
PEG_TRACE ((TRC_INDICATION_GENERATION, Tracer::LEVEL4, |
|
"snmpIndicationHandler sending %s Indication trap %s to target" |
|
" host %s target port %d", |
|
(const char*)(indication.getClassName().getString(). |
|
getCString()), |
|
(const char*)(trapOid.getCString()), |
|
(const char*)(targetHost.getCString()),portNumber)); |
|
_snmpTrapSender->deliverTrap( |
trapOid, | trapOid, |
securityName, | securityName, |
targetHost, | targetHost, |
|
|
propOIDs, | propOIDs, |
propTYPEs, | propTYPEs, |
propVALUEs); | propVALUEs); |
|
|
|
PEG_TRACE ((TRC_INDICATION_GENERATION, Tracer::LEVEL4, |
|
"%s Indication trap %s sent to target host %s target port %d " |
|
"successfully", |
|
(const char*)(indication.getClassName().getString().getCString()), |
|
(const char*)(trapOid.getCString()), |
|
(const char*)(targetHost.getCString()),portNumber)); |
} | } |
else |
} |
|
catch (CIMException& c) |
|
{ |
|
PEG_TRACE((TRC_IND_HANDLER, Tracer::LEVEL1, "CIMException %s", |
|
(const char*)c.getMessage().getCString())); |
|
PEG_METHOD_EXIT(); |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, c.getMessage()); |
|
} |
|
catch (Exception& e) |
|
{ |
|
PEG_TRACE((TRC_IND_HANDLER, Tracer::LEVEL1, "Exception %s", |
|
(const char*)e.getMessage().getCString())); |
|
PEG_METHOD_EXIT(); |
|
|
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage()); |
|
} |
|
catch (...) |
{ | { |
// l10n |
PEG_TRACE_CSTRING(TRC_IND_HANDLER, Tracer::LEVEL1, |
|
"Failed to deliver trap."); |
|
PEG_METHOD_EXIT(); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms( |
|
"Handler.snmpIndicationHandler.snmpIndicationHandler." |
|
"FAILED_TO_DELIVER_TRAP", |
|
"Failed to deliver trap.")); |
|
} |
|
PEG_METHOD_EXIT(); |
|
} |
| |
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
void snmpIndicationHandler::_trimWhitespace( |
// "Invalid IndicationHandlerSNMPMapper instance"); |
String & nameStr) |
|
{ |
|
PEG_METHOD_ENTER(TRC_IND_HANDLER, |
|
"snmpIndicationHandler::_trimWhitespace"); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
Uint32 ps = 0; |
MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.INVALID_SNMP_INSTANCE", |
// skip begining whitespace |
"Invalid IndicationHandlerSNMPMapper instance")); |
for (ps = 0; ps < nameStr.size(); ps++) |
|
{ |
|
if (nameStr[ps] != ' ') |
|
{ |
|
break; |
} | } |
} | } |
| |
// This is the dynamic entry point into this dynamic module. The name of |
if (ps != 0) |
// this handler is "snmpIndicationHandler" which is appended to "PegasusCreateHandler_" |
{ |
// to form a symbol name. This function is called by the HandlerTable |
nameStr.remove(0, ps); |
// to load this handler. |
} |
| |
extern "C" PEGASUS_EXPORT CIMHandler* |
// skip the appended whitespace |
PegasusCreateHandler_snmpIndicationHandler() { |
for (ps = nameStr.size(); ps != 0; ps--) |
return new snmpIndicationHandler; |
{ |
|
if (nameStr[ps-1] != ' ') |
|
{ |
|
break; |
|
} |
|
} |
|
|
|
if (ps != nameStr.size()) |
|
{ |
|
nameStr.remove(ps); |
|
} |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
|
|
|
PEGASUS_USING_PEGASUS; |
|
|
|
// This is the entry point into this dynamic module. |
|
|
|
extern "C" PEGASUS_EXPORT CIMHandler* PegasusCreateHandler( |
|
const String& handlerName) |
|
{ |
|
if (handlerName == "snmpIndicationHandler") |
|
{ |
|
return new snmpIndicationHandler; |
|
} |
|
|
|
return 0; |
|
} |