IPWorks SNMP 2020 Python Edition

Questions / Feedback?

on_bad_packet Event

Fired for erroneous and/or malformed messages.

Syntax

class SNMPTCPMgrBadPacketEventParams(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 SNMPTCPMgr:
@property
def on_bad_packet() -> Callable[[SNMPTCPMgrBadPacketEventParams], None]: ...
@on_bad_packet.setter
def on_bad_packet(event_hook: Callable[[SNMPTCPMgrBadPacketEventParams], 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.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks SNMP 2020 Python Edition - Version 20.0 [Build 8202]