version 1.27, 2005/11/16 18:48:38
|
version 1.29.2.1, 2006/04/19 22:33:44
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // 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 |
|
|
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
| |
|
#ifdef HPUX_EMANATE |
|
static snmpDeliverTrap_emanate snmpTrap; |
|
#elif defined (PEGASUS_USE_NET_SNMP) |
|
static snmpDeliverTrap_netsnmp snmpTrap; |
|
#else |
|
static snmpDeliverTrap_stub snmpTrap; |
|
#endif |
|
|
|
snmpIndicationHandler::snmpIndicationHandler() |
|
{ |
|
PEG_METHOD_ENTER (TRC_IND_HANDLER, |
|
"snmpIndicationHandler::snmpIndicationHandler"); |
|
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; |
|
|
|
#ifdef PEGASUS_USE_NET_SNMP |
|
snmpTrap.initialize(); |
|
#endif |
|
|
|
PEG_METHOD_EXIT(); |
|
} |
|
|
|
void snmpIndicationHandler::terminate() |
|
{ |
|
PEG_METHOD_ENTER (TRC_IND_HANDLER, |
|
"snmpIndicationHandler::terminate"); |
|
|
|
#ifdef PEGASUS_USE_NET_SNMP |
|
snmpTrap.terminate(); |
|
#endif |
|
|
|
PEG_METHOD_EXIT(); |
|
} |
|
|
|
snmpIndicationHandler::~snmpIndicationHandler() |
|
{ |
|
PEG_METHOD_ENTER (TRC_IND_HANDLER, |
|
"snmpIndicationHandler::~snmpIndicationHandler"); |
|
|
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
// l10n - note: ignoring indication language | // l10n - note: ignoring indication language |
|
|
CIMInstance& indication, | CIMInstance& indication, |
CIMInstance& handler, | CIMInstance& handler, |
CIMInstance& subscription, | CIMInstance& subscription, |
ContentLanguages & contentLanguages) |
ContentLanguageList & contentLanguages) |
{ | { |
Array<String> propOIDs; | Array<String> propOIDs; |
Array<String> propTYPEs; | Array<String> propTYPEs; |
|
|
// 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 |
|
static snmpDeliverTrap_emanate emanateTrap; |
|
#elif defined (PEGASUS_USE_NET_SNMP) |
|
static snmpDeliverTrap_netsnmp emanateTrap; |
|
#else |
|
static snmpDeliverTrap_stub emanateTrap; |
|
#endif |
|
|
|
Uint32 targetHostPos = handler.findProperty(CIMName ("TargetHost")); | Uint32 targetHostPos = handler.findProperty(CIMName ("TargetHost")); |
Uint32 targetHostFormatPos = handler.findProperty(CIMName ("TargetHostFormat")); | Uint32 targetHostFormatPos = handler.findProperty(CIMName ("TargetHostFormat")); |
Uint32 otherTargetHostFormatPos = handler.findProperty(CIMName ( | Uint32 otherTargetHostFormatPos = handler.findProperty(CIMName ( |
|
|
handler.getProperty(engineIDPos).getValue().get(engineID); | handler.getProperty(engineIDPos).getValue().get(engineID); |
} | } |
| |
emanateTrap.deliverTrap( |
snmpTrap.deliverTrap( |
trapOid, | trapOid, |
securityName, | securityName, |
targetHost, | targetHost, |
|
|
MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.FAILED_TO_DELIVER_TRAP", | MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.FAILED_TO_DELIVER_TRAP", |
"Failed to deliver trap.")); | "Failed to deliver trap.")); |
} | } |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
// 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 |