SNMPM_NETWORK_INTERFACE_FILTER(3erl)

πŸ“¦
version 25.3.2.8 Β· 4 versions
, in ubuntu noble

πŸ’… snmpm_network_interface_filter β€” the Erlang module definition, bestie πŸŽ€

okay so real talk, this is the man page for snmpm_network_interface_filter(3erl) β€” it's an Erlang module definition straight out of the snmp 5.13.5 docs, and I'm gonna walk you through it like we're texting at 2am. no cap, it's actually kinda iconic once it clicks. πŸ¦‹


✨ NAME ✨

snmpm_network_interface_filter β€” the behaviour module for the SNMP manager network-interface filter. that's it, that's the whole name, slay. πŸ‘‘


🌸 DESCRIPTION 🌸

so this module defines the behaviour</> of the manager network interface filter. and listen β€” a module that's snmpm_network_interface_filter compliant must export these functions, no skipping, periodt:

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

the semantics of them and their exact signatures? explained right below, bestie, keep scrolling. πŸ’–

the whole purpose of the network interface filter is to let you filter messages β€” accept or reject them β€” on receive and send. and it happens on two levels, like a two-tier cake πŸŽ‚:

  • level one is at the UDP entry / exit point β€” like, immediately after the receipt of the message, before any message processing is done (accept_recv), and immediately before sending the message, after all message processing is done (accept_send).
  • level two is at the MPD entry / exit point β€” immediately after the basic message processing (accept_recv_pdu) / immediately before the basic message processing (accept_send_pdu).
ngl this next bit matters: the network interface filter is something that's used by the network interface implementation provided by the application (snmpm_net_if and snmpm_net_if_mt). the default filter accepts all messages. all of them. zero notes. 🫢

and why would you even want one? a network interface filter can e.g. be used during testing or for load regulation. very main character energy honestly.

okay and here's the legacy lore you need, iykyk: 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. no breaks, no drama. πŸ’€


🧚 DATA TYPES 🧚

port() = integer() > 0
pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
             'set-request' | trap | 'get-bulk-request' | 'inform-request' |
             report | trappdu

also go see the data types in snmpa_conf β€” they're right there waiting for you. 🌈


πŸ”₯ EXPORTS πŸ”₯

accept_recv(Domain, Addr) -> boolean()

Types:

Domain = transportDomain()
Addr = transportAddressWithPort()

called at the reception of a message (before any processing has been done). ✨

for the message to be rejected, the function must return false. that's the vibe check, fr fr.


accept_send(Domain, Addr) -> boolean()

Types:

Domain = transportDomain()
Addr = transportAddressWithPort()

called before the sending of a message (after all processing has been done). πŸ’Œ

for the message to be rejected, the function must return false. periodt.


accept_recv_pdu(Domain, Addr, PduType) -> boolean()

Types:

Domain = transportDomain()
Addr = transportAddressWithPort()
PduType = pdu_type()

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. (yes, pdu here, not message β€” keep that distinction, bestie, it's giving attention to detail.)


accept_send_pdu(Domain, Addr, PduType) -> boolean()

Types:

Domain = transportDomain()
Addr = transportAddressWithPort()
PduType = pdu_type() > 0

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. literally the whole rule. πŸ”₯


ok that's the page!! every option, every type, every false, every single last one. no skips, no summaries, we ate and left no crumbs. πŸ’…

Ericsson AB made this, it's from snmp 5.13.5, and the page header says snmpm_net...ce_filter(3erl) β€” so yeah, that's the whole ✨sourcing situation✨. mwah, bye bestie, go filter some messages πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from