snmpm_netw...ace_filter(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– snmpm_network_interface_filter β€” the vibe πŸ’–

okay bestie, welcome to the manual page for snmpm_network_interface_filter</p>, a whole behaviour module for the SNMP manager network-interface filter. yes it's giving big Erlang energy, and yes we're gonna get through it together 🫢


✨ NAME ✨

snmpm_network_interface_filter β€” a behaviour module for the SNMP manager network-interface filter, iykyk πŸ’…


🌸 DESCRIPTION 🌸

So. This module defines the behaviour of the manager network interface filter. That means if you wanna make a snmpm_network_interface_filter-compliant module (emphasis on compliant, no shortcuts bestie), it must export these four functions:

  • accept_recv/2
  • accept_send/2
  • accept_recv_pdu/3
  • accept_send_pdu/3

What they actually mean and what their exact signatures look like? Explained below, don't worry, we're getting there πŸ¦‹

The whole point of the network interface filter is letting you filter messages β€” accept them or reject them β€” on receive and on send. And it happens on two levels, periodt:

  • Level one: the UDP entry / exit point. That's immediately after a message gets received, before any message processing happens (accept_recv), and immediately before a message is sent, after all message processing is done (accept_send).
  • Level two: the MPD entry / exit point. That's immediately after the basic message processing (accept_recv_pdu), or immediately before the basic message processing (accept_send_pdu).
lowkey important: the network interface filter is a thing that gets used by the network interface implementation provided by the application β€” that's snmpm_net_if and snmpm_net_if_mt. And the default filter? It accepts everything. every single message. no cap.

So what's a network interface filter even for? Honestly, it can be used during testing, or for load regulation. very useful, very demure ✨

Okay and now the legacy tea 🍡 Legacy network interface filter modules used arguments on the form (IpAddr, PortNumber,...) instead of (Domain, Addr, ...). And if the SNMP manager is run without changing the configuration to use transport domains, the network interface filter will still get the old arguments and work as before. so like, no breaking changes, we love that for them πŸ’–


πŸŽ€ DATA TYPES πŸŽ€

  • pdu_type() :: snmpm:pdu_type().
  • transportAddressWithPort() :: snmpa_conf:transportAddressWithPort().
  • transportDomain() :: snmpa_conf:transportDomain().

⭐ FUNCTIONS ⭐

πŸ‘‘ CALLBACKS πŸ‘‘

  • accept_recv(Domain, Addr) β€” Called at the reception of a message, before any processing has been done. For the message to be rejected, the function must return false.
  • accept_recv_pdu(Domain, Addr, PduType) β€” Called after the basic message processing (MPD) has been done, but before the pdu is handed over to the server for primary processing. For the pdu to be rejected, the function must return false.
  • accept_send(Domain, Addr) β€” Called before the sending of a message, after all processing has been done. For the message to be rejected, the function must return false.
  • accept_send_pdu(Domain, Addr, PduType) β€” Called before the basic message processing (MPD) is done, when a pdu has been received from the master-agent. For the message to be rejected, the function must return false.

and that's the whole page bestie!! bestie check passed, vibes immaculate, behaviour module understood πŸ’œ

this absolute icon of a page was brought to you by Ericsson AB, from the snmp release 5.20.5 β€” mwah, love that for us πŸ’…βœ¨

πŸ“¦ where this page comes from