on_bad_packet Event
Fired for erroneous and/or malformed messages.
Syntax
class SNMPTCPTrapMgrBadPacketEventParams(object): @property def packet() -> bytes: ... @property def source_address() -> str: ... @property def source_port() -> int: ... @property def error_code() -> int: ... @property def error_description() -> str: ... @property def report() -> bool: ... @report.setter def report(value) -> None: ... # In class SNMPTCPTrapMgr: @property def on_bad_packet() -> Callable[[SNMPTCPTrapMgrBadPacketEventParams], None]: ... @on_bad_packet.setter def on_bad_packet(event_hook: Callable[[SNMPTCPTrapMgrBadPacketEventParams], None]) -> None: ...
Remarks
The full message is provided in the Packet parameter.
The on_bad_packet 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.
Please refer to the on_get_user_password event for more information concerning SNMPv3 authentication.