version 1.6, 2002/04/17 22:46:33
|
version 1.12, 2002/09/13 21:40:42
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// | // |
// 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 |
|
|
// | // |
// 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> |
|
|
{ | { |
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) | 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(); |
|
|
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) && |
(indicationClass.findQualifier("MappingStrings") != 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 Class | String trapOid; // from indication Class |
| |
trapOid = indicationClass.getQualifier( | trapOid = indicationClass.getQualifier( |
indicationClass.findQualifier("MappingStrings")).getValue().toString(); |
indicationClass.findQualifier |
|
(CIMName ("MappingStrings"))).getValue().toString(); |
| |
trapOid = trapOid.subString(trapOid.find("OID.IETF | SNMP.")+16); | trapOid = trapOid.subString(trapOid.find("OID.IETF | SNMP.")+16); |
| |
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, |