User's Guide
Reference Manual
Release Notes
PDF
Top

Simple Network Management Protocol (SNMP)
User's Guide
Version 4.22

Expand All
Contract All

Chapters

- SNMP Introduction
  - Top of chapter
  - Scope and Purpose
  - Prerequisites
  - Definitions
  - About This Manual
  - Where to Find More Information
- Agent Functional Description
  - Top of chapter
  - Features
  - SNMPv1, SNMPv2 and SNMPv3
  - Operation
  - Sub-agents and MIB Loading
  - Contexts and Communities
  - Management of the Agent
  - Notifications
  - Discovery
- Manager Functional Description
  - Top of chapter
  - Features
  - Operation
  - MIB loading
- The MIB Compiler
  - Top of chapter
  - Operation
  - Importing MIBs
  - MIB Consistency Checking
  - .hrl File Generation
  - Emacs Integration
  - Compiling from a Shell or a Makefile
  - Deviations from the Standard
- Running the application
  - Top of chapter
  - Configuring the application
  - Modifying the Configuration Files
  - Starting the application
  - Debugging the application
- Definition of Agent Configuration Files
  - Top of chapter
  - Agent Information
  - Contexts
  - System Information
  - Communities
  - MIB Views for VACM
  - Security data for USM
  - Notify Definitions
  - Target Address Definitions
  - Target Parameters Definitions
- Definition of Manager Configuration Files
  - Top of chapter
  - Manager Information
  - Users
  - Agents
  - Security data for USM
- Agent Implementation Example
  - Top of chapter
  - MIB
  - Default Implementation
  - Manual Implementation
- Manager Implementation Example
  - Top of chapter
  - The example manager
  - A simple standard test
- Instrumentation Functions
  - Top of chapter
  - Instrumentation Functions
  - Using the ExtraArgument
  - Default Instrumentation
  - Atomic Set
- Definition of Instrumentation Functions
  - Top of chapter
  - Variable Instrumentation
  - Table Instrumentation
- Definition of Agent Net if
  - Top of chapter
  - Mandatory Functions
  - Messages
- Definition of Manager Net if
  - Top of chapter
  - Mandatory Functions
  - Messages
- Audit Trail Log
  - Top of chapter
  - Agent Logging
  - Manager Logging
- Advanced Agent Topics
  - Top of chapter
  - When to use a Sub-agent
  - Agent Semantics
  - Sub-agents and Dependencies
  - Distributed Tables
  - Fault Tolerance
  - Using Mnesia Tables as SNMP Tables
  - Deviations from the Standard
- SNMP Appendix A
  - Top of chapter
  - Appendix A
- SNMP Appendix B
  - Top of chapter
  - Appendix B

# 13 Definition of Manager Net if

Figure 13.1: The Purpose of Manager Net if

The Network Interface (Net if) process delivers SNMP PDUs to the manager server, and receives SNMP PDUs from the manager server. The most common behaviour of a Net if process is that is receives request PDU from the manager server, encodes the PDU into bytes and transmits the bytes onto the network to an agent. When the reply from the agent is received by the Net if process, which it decodes into an SNMP PDU, which it sends to the manager server.

However, that 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.

The snmp application provides two different modules, snmpm_net_if (the default) and snmpm_net_if_mt, both uses the UDP as the transport protocol. The difference between the two modules is that the latter is "multi-threaded", i.e. for each message/request a new process is created that process the message/request and then exits.

It is also possible to write your own Net if process, this section describes how to write a Net if processdo that.

### 13.1 Mandatory Functions

A Net if process must implement the SNMP manager network interface behaviour.

### 13.2 Messages

The section Messages describes mandatory messages, which Net if must send to the manager server process.

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

    Server ! {snmp_pdu, Pdu, Addr, Port}

- Pdu is an SNMP PDU record, as defined in snmp_types.hrl, with the SNMP request.

- Addr is the source address.

- Port is port number of the sender.

    Server ! {snmp_trap, Trap, Addr, Port}

- Trap is either an SNMP pdu record or an trappdu record, as defined in snmp_types.hrl, with the SNMP request.

- Addr is the source address.

- Port is port number of the sender.

    Server ! {snmp_inform, Ref, Pdu, PduMS, Addr, Port}

- Ref is either the atom ignore or something that can be used to identify the inform-request (e.g. request-id). ignore is used if the response (acknowledgment) to the inform-request has already been sent (this means that the server will not make the call to the inform_response function). See the inform request behaviour configuration option for more info.

- Pdu is an SNMP PDU record, as defined in snmp_types.hrl, with the SNMP request.

- Addr is the source address.

- Port is port number of the sender.

    Server ! {snmp_report, Data, Addr, Port}

- Data is either {ok, Pdu} or {error, ReqId, ReasonInfo, Pdu}. Which one is used depends on the return value from the MPD process_msg function. If the MsgData is ok, the first is used, and if it is {error, ReqId, Reason} the latter is used.

- Pdu is an SNMP PDU record, as defined in snmp_types.hrl, with the SNMP request.

- ReqId is an integer.

- ReasonInfo is a term().

- Addr is the source address.

- Port is port number of the sender.

#### Notes

Since 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 snmpm_mpd for this purpose (refer to the Reference Manual, section snmp, module snmpm_mpd for more details).

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