檢視原始碼 snmpa_notification_filter 行為 (snmp v5.18)

SNMP 代理程式通知過濾器的行為模組。

此模組定義了代理程式通知過濾器的行為。一個符合 snmpa_notification_filter 的模組必須匯出以下函數:

  • handle_notification/2

它們的語意及其確切簽名將在下面解釋。

通知過濾器的目的是允許修改和/或抑制通知。

行為不當的過濾器將被移除。

摘要

回呼

處理要傳送的通知。過濾器可以接受通知原樣,返回 send,修改通知,返回 {send, NewNotif},或抑制通知,返回 dont_send

類型

連結到此類型

notification()

檢視原始碼 (未匯出)
-type notification() :: term().
-type trap() :: term().

回呼

連結到此回呼

handle_notification(Notif, Data)

檢視原始碼
-callback handle_notification(Notif, Data) -> Reply
                                 when
                                     Notif :: notification() | trap(),
                                     Data :: term(),
                                     Reply :: send | {send, NewNotif} | dont_send,
                                     NewNotif :: notification() | trap().

處理要傳送的通知。過濾器可以接受通知原樣,返回 send,修改通知,返回 {send, NewNotif},或抑制通知,返回 dont_send

Data 在過濾器註冊時提供,請參閱 snmpa:register_notification_filter/5