.TH snmpa_network_interface_filter 3erl "snmp 5.2.4" "Ericsson AB" "Erlang Module Definition" .SH NAME snmpa_network_interface_filter \- Behaviour module for the SNMP agent network-interface filter. .SH DESCRIPTION .LP This module defines the behaviour of the agent network interface filter\&. A \fIsnmpa_network_interface_filter\fR\& compliant module must export the following functions: .RS 2 .TP 2 * \fBaccept_recv/2\fR\& .LP .TP 2 * \fBaccept_send/2\fR\& .LP .TP 2 * \fBaccept_recv_pdu/3\fR\& .LP .TP 2 * \fBaccept_send_pdu/2\fR\& .LP .RE .LP The semantics of them and their exact signatures are explained below\&. .LP The purpose of the network interface filter is to allow for filtering of messages (accept or reject) receive and send\&. This is done on two levels: .RS 2 .TP 2 * The first level is at the transport entry / exit point, i\&.e\&. 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)\&. .LP .TP 2 * The second level is at the MPD entry / exit point, i\&.e\&. immediately after the basic message processing (accept_recv_pdu) / immediately before the basic message processing (accept_send_pdu)\&. .LP .RE .LP Note that the network interface filter is something which is used by the network interface implementation provided by the application (\fIsnmpa_net_if\fR\&)\&. The default filter accepts all messages\&. .LP A network interface filter can e\&.g\&. be used during testing or for load regulation\&. If the intended use is load regulation, see also \fBreq_limit\fR\& and the function \fBregister_notification_filter\fR\&\&. .LP Legacy network interface filter modules used arguments on the form \fI(IpAddr, PortNumber,\&.\&.\&.)\fR\& instead of \fI(Domain, Addr, \&.\&.\&.)\fR\&, and if the SNMP agent is run without changing the configuration to use transport domains the network interface filter will still get the old arguments and work as before\&. .SH "DATA TYPES" .LP .nf port() = integer() > 0 pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | 'set-request' | trap | 'get-bulk-request' | 'inform-request' | report .fi .LP See also the \fB data types in \fIsnmpa_conf\fR\&\fR\&\&. .SH EXPORTS .LP .B accept_recv(Domain, Addr) -> boolean() .br .RS .LP Types: .RS 3 Domain = transportDomain() .br Addr = transportAddressWithPort() .br .RE .RE .RS .LP Called at the reception of a message (before \fIany\fR\& processing has been done)\&. .LP For the message to be discarded, the function \fImust\fR\& return \fIfalse\fR\&\&. .RE .LP .B accept_send(Domain, Addr) -> boolean() .br .RS .LP Types: .RS 3 Domain = transportDomain() .br Addr = transportAddressWithPort() .br .RE .RE .RS .LP Called before the sending of a message (after \fIall\fR\& processing has been done)\&. .LP For the message to be discarded, the function \fImust\fR\& return \fIfalse\fR\&\&. .RE .LP .B accept_recv_pdu(Domain, Addr, PduType) -> boolean() .br .RS .LP Types: .RS 3 Domain = transportDomain() .br Addr = transportAddressWithPort() .br PduType = pdu_type() .br .RE .RE .RS .LP Called after the basic message processing (MPD) has been done, but before the pdu is handed over to the master-agent for primary processing\&. .LP For the pdu to be discarded, the function \fImust\fR\& return \fIfalse\fR\&\&. .RE .LP .B accept_send_pdu(Targets, PduType) -> Reply .br .RS .LP Types: .RS 3 Targets = targets() .br targets() = [target()] .br target() = {Domain, Addr} .br Domain = transportDomain() .br Addr = transportAddressWithPort() .br PduType = pdu_type() > 0 .br Reply = boolean() | NewTargets .br NewTargets = targets() .br .RE .RE .RS .LP Called before the basic message processing (MPD) is done, when a pdu has been received from the master-agent\&. .LP For the message to be discarded all together, the function \fImust\fR\& return \fIfalse\fR\&\&. .LP Note that it is possible for this function to filter out targets (but \fInot\fR\& to add its own) by returning an updated \fITargets\fR\& list (\fINewTargets\fR\&)\&. .RE