(Page 3 of 32 in this chapter) Version
oamAlertNotify
Description
- Broadcasts a specified NMS OAM alert message to all client applications registered for NMS OAM alert notification.
Prototype
- DWORD oamAlertNotify (CTAHD ctahd,
const OAM_MSG *pMsg)
- ctahd [in] Context handle
- pMsg [in] Pointer to OAM_MSG structure containing the message to broadcast:
typedef struct oam_msg_tag
{
DWORD dwMsgLen; // Message length, including appended //
// name & message strings //
DWORD dwCode; // Message code //
DWORD dwSeverity; // Message severity //
DWORD dwOfsSzName; // Offset to name string of source //
// managed object //
DWORD dwOfsSzMessage; // Offset to text message string //
// (String data is appended here) //
} OAM_MSG;
Return Values
Events
- None.
Details
- This function is not intended for normal use. An application can use this function even if it is not registered for alert notification. If registered for alert notification, the application receives the alert message that it sends. For more information, see Section 8.5.
See Also
- oamAlertRegister, oamAlertUnregister
Example
DWORD sendAlert( CTAHD ctahd, const char *pMsg, const char *pName )
{
DWORD ret;
char msgBuf[ 256 ];
OAM_MSG *pOamMsg;
int nSizeMsg, nSizeName;
char *pc;
pOamMsg = (OAM_MSG *) msgBuf;
pOamMsg->dwCode = OAMEVN_ALERT;
pOamMsg->dwSeverity = CTA_TRACE_SEVERITY_INFO;
/* point to text space after NMS OAM message information */
pc = (char*) pOamMsg + sizeof(OAM_MSG);
/* Copy object name and message into text buffer */
nSizeName = strlen( pName ) + 1;
nSizeMsg = strlen( pMsg ) + 1;
strcpy( pc, pName );
pc += nSizeName;
strcpy( pc, pMsg );
/* Set up offsets to various fields within the message */
pOamMsg->dwOfsSzName = sizeof(OAM_MSG);
pOamMsg->dwOfsSzMessage = sizeof(OAM_MSG) + nSizeName;
pOamMsg->dwMsgLen = sizeof(OAM_MSG) + nSizeName + nSizeMsg;
ret = oamAlertNotify( ctahd, pOamMsg );
if ( ret != SUCCESS )
printf( "Can't send alert message\n" );
return ret;
(Page 3 of 32 in this chapter) Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, Natural MicroSystems, Inc. All rights
reserved.