153
APPENDIX C: HDX2000L Library
{
case WM_TRAP_2000:
/* Retrieve the new trap */
nResult=
Hdx2000TrapRead(ghSession,
szIpAddressBuf, szTrapBuf);
if (nResult== 0)
{
/* Process the new trap */
TrapAnalyze(szIpAddressBuf,
szTrapBuf);
}
else
{
/* Error */
}
return 0;
case WM_TIMER:
/* Check rack 195.9.200.65 whose
read community */
/*is ‘public’ every 5 minutes. */
if (Hdx2000RackGet(ghSession,
“195.9.200.65”, “public”)!= 0)
{
/* Error */
}
return 0;
case WM_COMMAND:
switch(GET_WM_COMMAND_ID(wParam,
lParam))
{
case IDM_SWITCH:
/* SWITCH Button
pressed. */
/* Switch line card #10 to
position B */
/* for rack 195.9.200.65
whose write */
/*community is ‘private’.*/
if (Hdx2000SwitchSet(ghSession,
“195.9.200.65”, “private”, 10, 2)!= 0)