version 1.5.4.1, 2008/02/22 23:13:52
|
version 1.8, 2008/05/12 09:14:52
|
|
|
| |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
|
#include <Pegasus/Common/HostAddress.h> |
#include <Pegasus/Common/PegasusVersion.h> | #include <Pegasus/Common/PegasusVersion.h> |
| |
#include <cctype> | #include <cctype> |
|
|
sprintf(buffer, "%u", portNumberHttp); | sprintf(buffer, "%u", portNumberHttp); |
httpPort.assign(buffer); | httpPort.assign(buffer); |
} | } |
CIMInstance instance = |
CIMInstance instance; |
|
Array<String> ips; |
|
#ifdef PEGASUS_ENABLE_IPV6 |
|
ips = System::getInterfaceAddrs(); |
|
for (Uint32 i = 0; i < ips.size() ; ++i) |
|
{ |
|
String addr = ips[i]; |
|
if (HostAddress::isValidIPV6Address(ips[i])) |
|
{ |
|
addr = "[" + addr + "]"; |
|
} |
|
addr.append(":"); |
|
addr.append(httpPort); |
|
|
|
instance = |
buildCIMXMLCommunicationMechanismInstance( | buildCIMXMLCommunicationMechanismInstance( |
namespaceType, | namespaceType, |
namespaceAccessProtocol, | namespaceAccessProtocol, |
|
addr, |
|
commMechClass); |
|
instances.append(instance); |
|
} |
|
#endif |
|
// If System::getInterfaceAddrs() fails add ip4 addr here. |
|
if (!ips.size()) |
|
{ |
|
instance = buildCIMXMLCommunicationMechanismInstance( |
|
namespaceType, |
|
namespaceAccessProtocol, |
getHostAddress(hostName, namespaceAccessProtocol, httpPort), | getHostAddress(hostName, namespaceAccessProtocol, httpPort), |
commMechClass); | commMechClass); |
instances.append(instance); | instances.append(instance); |
} | } |
|
} |
| |
if (enableHttpsConnection) | if (enableHttpsConnection) |
{ | { |
|
|
sprintf(buffer, "%u", portNumberHttps); | sprintf(buffer, "%u", portNumberHttps); |
httpsPort.assign(buffer); | httpsPort.assign(buffer); |
} | } |
CIMInstance instance = |
CIMInstance instance; |
|
Array<String> ips; |
|
#ifdef PEGASUS_ENABLE_IPV6 |
|
ips = System::getInterfaceAddrs(); |
|
for (Uint32 i = 0; i < ips.size() ; ++i) |
|
{ |
|
String addr = ips[i]; |
|
if (HostAddress::isValidIPV6Address(ips[i])) |
|
{ |
|
addr = "[" + addr + "]"; |
|
} |
|
addr.append(":"); |
|
addr.append(httpsPort); |
|
instance = |
buildCIMXMLCommunicationMechanismInstance( | buildCIMXMLCommunicationMechanismInstance( |
namespaceType, | namespaceType, |
namespaceAccessProtocol, | namespaceAccessProtocol, |
|
addr, |
|
commMechClass); |
|
instances.append(instance); |
|
} |
|
#endif |
|
// If System::getInterfaceAddrs() fails add ip4 addr here. |
|
if (!ips.size()) |
|
{ |
|
instance = buildCIMXMLCommunicationMechanismInstance( |
|
namespaceType, |
|
namespaceAccessProtocol, |
getHostAddress(hostName, namespaceAccessProtocol, httpsPort), | getHostAddress(hostName, namespaceAccessProtocol, httpsPort), |
commMechClass); | commMechClass); |
|
|
instances.append(instance); | instances.append(instance); |
} | } |
|
} |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return instances; | return instances; |
|
|
// Modify the instance on disk | // Modify the instance on disk |
repository->modifyInstance(instanceReference.getNameSpace(), | repository->modifyInstance(instanceReference.getNameSpace(), |
omInstance, false, propertyList); | omInstance, false, propertyList); |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
PEG_TRACE(( |
"Interop Provider Set Statistics gathering in CIM_ObjectManager: $0", |
TRC_CONTROLPROVIDER, |
(statisticsFlag? "true" : "false")); |
Tracer::LEVEL3, |
|
"Interop Provider Set Statistics gathering in CIM_ObjectManager: %s", |
|
(statisticsFlag? "true" : "false"))); |
StatisticalData* sd = StatisticalData::current(); | StatisticalData* sd = StatisticalData::current(); |
sd->setCopyGSD(statisticsFlag); | sd->setCopyGSD(statisticsFlag); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |