[Erlang Systems]

10 Definition of Net if

netif-1-image-1
The Purpose of Net if

The Network Interface (Net if) process delivers SNMP PDUs to a master agent, and receives SNMP PDUs from the master agent. The most common behaviour of a Net if process is that is receives bytes from a network, decodes them into an SNMP PDU which it sends to a master agent. When the master agent has processed the PDU, it sends a response PDU to the Net if process, which encodes the PDU into bytes and transmits the bytes onto the network.

However, this simple behaviour can be modified in numerous ways. For example, the Net if process can apply some kind of encrypting/decrypting scheme on the bytes, or the Net if process can act as a proxy filter which sends some packets to a proxy agent and some packets to the master agent.

It is also possible to write your own Net if process. The default Net if process is implemented in the module snmp_net_if and it uses UDP as the transport protocol.

This section describes how to write a Net if process.

10.1 Mandatory Functions

A Net if process must be implemented in a module which exports the Module:start_link/1 function. This function starts a new Net if process. The name of the Net if module is passed as a start argument to the snmp_agent process.

10.1.1 Function

Module:start_link(MasterAgent)

10.1.2 Arguments

MasterAgent is a Pid.

10.1.3 Return values

The return values are:

10.2 Messages

This section describes mandatory messages which Net if must send and be able to receive.

10.2.1 Outgoing Messages

Net if must send the following message when it receives an SNMP PDU from the network which is aimed for the MasterAgent:

MasterAgent ! {snmp_pdu, Vsn, Pdu, PduMS, ACMData, From, Extra}
      

The following message is used to report that a response to a request has been received. The only request an agent can send is an Inform-Request.

Pid ! {snmp_response_received, Vsn, Pdu, From}
      

10.2.2 Incoming Messages

This section describes the incoming messages which a Net if process must be able to receive.

10.2.3 Notes

As the Net if process is responsible for encoding and decoding of SNMP messages, it must also update the relevant counters in the SNMP group in MIB-II. It can use the functions in the module snmp_mpc for this purpose.

There are also some useful functions for encoding and decoding of SNMP messages in the module snmp_pdus.


Copyright © 1991-98 Ericsson Telecom AB