version 1.11.12.2, 2003/08/13 19:39:51
|
version 1.11.12.3, 2003/08/14 11:55:42
|
|
|
TransportInfo global_ti; | TransportInfo global_ti; |
global_ti.type = SR_IP_TRANSPORT; | global_ti.type = SR_IP_TRANSPORT; |
| |
|
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)); |
|
|
|
} |
| |
switch (targetHostFormat) | switch (targetHostFormat) |
{ | { |
|
|
| |
if (value == NULL) | if (value == NULL) |
{ | { |
|
|
// l10n | // l10n |
| |
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, | // throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
|
INTEGER_TYPE, | INTEGER_TYPE, |
value)) == NULL) | value)) == NULL) |
{ | { |
|
|
// l10n | // l10n |
| |
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, | // throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
|
SR_SECURITY_MODEL_V2C, // securityModel | SR_SECURITY_MODEL_V2C, // securityModel |
&global_ti, // TransportInfo | &global_ti, // TransportInfo |
0); // cfg_chk | 0); // cfg_chk |
|
|
break; | break; |
} | } |
default: | default: |