version 1.2, 2006/11/03 20:15:39
|
version 1.3, 2007/02/09 18:34:46
|
|
|
// Build the CommunicationMechanism instance for the HTTP protocol | // Build the CommunicationMechanism instance for the HTTP protocol |
namespaceAccessProtocol = 2; | namespaceAccessProtocol = 2; |
namespaceType = "http"; | namespaceType = "http"; |
Uint32 portNumberHttp; |
|
String httpPort = configManager->getCurrentValue("httpPort"); | String httpPort = configManager->getCurrentValue("httpPort"); |
if (httpPort == String::EMPTY) | if (httpPort == String::EMPTY) |
{ | { |
portNumberHttp = System::lookupPort(WBEM_HTTP_SERVICE_NAME, |
Uint32 portNumberHttp = System::lookupPort( |
WBEM_DEFAULT_HTTP_PORT); |
WBEM_HTTP_SERVICE_NAME, WBEM_DEFAULT_HTTP_PORT); |
|
char buffer[32]; |
|
sprintf(buffer, "%u", portNumberHttp); |
|
httpPort.assign(buffer); |
} | } |
CIMInstance instance = | CIMInstance instance = |
buildCIMXMLCommunicationMechanismInstance( | buildCIMXMLCommunicationMechanismInstance( |
namespaceType, | namespaceType, |
namespaceAccessProtocol, | namespaceAccessProtocol, |
getHostAddress(hostName, namespaceAccessProtocol, httpPort, |
getHostAddress(hostName, namespaceAccessProtocol, httpPort), |
portNumberHttp), commMechClass); |
commMechClass); |
instances.append(instance); | instances.append(instance); |
} | } |
| |
|
|
// Build the CommunicationMechanism instance for the HTTPS protocol | // Build the CommunicationMechanism instance for the HTTPS protocol |
namespaceAccessProtocol = 3; | namespaceAccessProtocol = 3; |
namespaceType = "https"; | namespaceType = "https"; |
Uint32 portNumberHttps; |
|
String httpsPort = configManager->getCurrentValue("httpsPort"); | String httpsPort = configManager->getCurrentValue("httpsPort"); |
if (httpsPort == String::EMPTY) | if (httpsPort == String::EMPTY) |
{ | { |
portNumberHttps = System::lookupPort(WBEM_HTTPS_SERVICE_NAME, |
Uint32 portNumberHttps = System::lookupPort( |
WBEM_DEFAULT_HTTPS_PORT); |
WBEM_HTTPS_SERVICE_NAME, WBEM_DEFAULT_HTTPS_PORT); |
|
char buffer[32]; |
|
sprintf(buffer, "%u", portNumberHttps); |
|
httpsPort.assign(buffer); |
} | } |
CIMInstance instance = | CIMInstance instance = |
buildCIMXMLCommunicationMechanismInstance( | buildCIMXMLCommunicationMechanismInstance( |
namespaceType, | namespaceType, |
namespaceAccessProtocol, | namespaceAccessProtocol, |
getHostAddress(hostName, namespaceAccessProtocol, httpsPort, |
getHostAddress(hostName, namespaceAccessProtocol, httpsPort), |
portNumberHttps), commMechClass); |
commMechClass); |
| |
instances.append(instance); | instances.append(instance); |
} | } |
| |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return instances; | return instances; |
} | } |