BadPacket Event
Fired for erroneous and/or malformed messages.
Syntax
ANSI (Cross Platform) virtual int FireBadPacket(SNMPMgrBadPacketEventParams *e);
typedef struct {
const char *Packet; int lenPacket;
const char *SourceAddress;
int SourcePort;
int ErrorCode;
const char *ErrorDescription;
int Report; int reserved; } SNMPMgrBadPacketEventParams; Unicode (Windows) virtual INT FireBadPacket(SNMPMgrBadPacketEventParams *e);
typedef struct {
LPCSTR Packet; INT lenPacket;
LPCWSTR SourceAddress;
INT SourcePort;
INT ErrorCode;
LPCWSTR ErrorDescription;
BOOL Report; INT reserved; } SNMPMgrBadPacketEventParams;
- (void)onBadPacket:(NSData*)packet :(NSString*)sourceAddress :(int)sourcePort :(int)errorCode :(NSString*)errorDescription :(int*)report;
#define EID_SNMPMGR_BADPACKET 1 virtual INT IPWORKSSNMP_CALL FireBadPacket(LPSTR &lpPacket, INT &lenPacket, LPSTR &lpszSourceAddress, INT &iSourcePort, INT &iErrorCode, LPSTR &lpszErrorDescription, BOOL &bReport);
Remarks
The full message is provided in the Packet parameter.
The BadPacket event is also fired when authentication fails for received packets due to a bad password or other reasons.
If the Report parameter is set to True, an unauthenticated error report will be sent to the client, otherwise the packet will be silently ignored.