version 1.11.12.3, 2003/08/14 11:55:42
|
version 1.14, 2003/08/12 21:34:04
|
|
|
| |
} | } |
| |
switch (targetHostFormat) |
|
{ |
|
case _HOST_NAME: |
|
{ |
|
char * ipAddr = _getIPAddress(trap_dest); |
|
|
|
if (ipAddr == NULL) |
|
{ |
|
|
|
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
// _MSG_DESTINATION_NOT_FOUND); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
|
MessageLoaderParms(_MSG_DESTINATION_NOT_FOUND_KEY, |
|
_MSG_DESTINATION_NOT_FOUND)); |
|
|
|
} |
|
global_ti.t_ipAddr = inet_addr(trap_dest); |
|
break; |
|
} |
|
case _IPV4_ADDRESS: |
|
{ |
|
global_ti.t_ipAddr = inet_addr(trap_dest); |
|
break; |
|
} |
|
default: |
|
{ |
|
|
|
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
// _MSG_TARGETHOSTFORMAT_NOT_SUPPORTED); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms(_MSG_TARGETHOSTFORMAT_NOT_SUPPORTED_KEY, |
|
_MSG_TARGETHOSTFORMAT_NOT_SUPPORTED, |
|
_MSG_HOSTNAME, |
|
_MSG_IPV4, |
|
_MSG_TARGETHOSTFORMAT)); |
|
|
|
break; |
|
} |
|
} |
|
|
|
global_ti.t_ipPort = htons((unsigned short)portNumber); |
|
|
|
// Community Name, default is public |
|
CString _community; |
|
if (securityName.size() == 0) |
|
{ |
|
String community; |
|
community.assign("public"); |
|
_community = community.getCString(); |
|
} |
|
else |
|
{ |
|
_community = securityName.getCString(); |
|
} |
|
|
|
OctetString* community_name = MakeOctetStringFromText(_community); |
|
|
|
if (community_name == NULL) |
|
{ |
|
|
|
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
// _MSG_INVALID_SECURITY_NAME); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, |
|
MessageLoaderParms(_MSG_INVALID_SECURITY_NAME_KEY, |
|
_MSG_INVALID_SECURITY_NAME, |
|
_MSG_SECURITY_NAME)); |
|
|
|
} |
|
// getting IP address of the host | // getting IP address of the host |
| |
CString hostname = System::getHostName().getCString(); | CString hostname = System::getHostName().getCString(); |