1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
<TITLE>snmpa_mpd</TITLE>
<SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
<STYLE TYPE="text/css">
<!--
.REFBODY { margin-left: 13mm }
.REFTYPES { margin-left: 8mm }
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
<IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>snmpa_mpd</H1>
</CENTER>
<H3>MODULE</H3>
<DIV CLASS=REFBODY>
snmpa_mpd
</DIV>
<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
Message Processing and Dispatch module for the SNMP agent
</DIV>
<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>
<P>The module <CODE>snmpa_mpd</CODE> implements the version independent
Message Processing and Dispatch functionality in SNMP for the agent.
It is supposed to be used from a Network Interface process
(<A HREF="snmp_agent_netif.html"> Definition of Agent Net if</A>).
</DIV>
<H3>EXPORTS</H3>
<P><A NAME="init/1"><STRONG><CODE>init(Vsns) -> mpd_state()</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Vsns = [Vsn]</CODE></STRONG><BR>
<STRONG><CODE>Vsn = v1 | v2 | v3</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>This function can be called from the net_if process at startup.
The options list defines which versions to use.
<P>It also initializes some SNMP counters.
</DIV>
<P><A NAME="process_packet/4"><STRONG><CODE>process_packet(Packet, TDomain, TAddress, State) ->
{ok, Vsn, Pdu, PduMS, ACMData} | {discarded, Reason}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Packet = binary()</CODE></STRONG><BR>
<STRONG><CODE>TDomain = snmpUDPDomain</CODE></STRONG><BR>
<STRONG><CODE>TAddress = {Ip, Udp}</CODE></STRONG><BR>
<STRONG><CODE>Ip = {integer(), integer(), integer(), integer()}</CODE></STRONG><BR>
<STRONG><CODE>Udp = integer()</CODE></STRONG><BR>
<STRONG><CODE>State = mpd_state()</CODE></STRONG><BR>
<STRONG><CODE>Vsn = 'version-1' | 'version-2' | 'version-3'</CODE></STRONG><BR>
<STRONG><CODE>Pdu = #pdu</CODE></STRONG><BR>
<STRONG><CODE>PduMs = integer()</CODE></STRONG><BR>
<STRONG><CODE>ACMData = acm_data()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Processes an incoming packet. Performs authentication and
decryption as necessary. The return values should be passed the
agent.
</DIV>
<P><A NAME="generate_response_msg/4"><STRONG><CODE>generate_response_msg(Vsn, RePdu, Type, ACMData) ->
{ok, Packet} | {discarded, Reason}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Vsn = 'version-1' | 'version-2' | 'version-3'</CODE></STRONG><BR>
<STRONG><CODE>RePdu = #pdu</CODE></STRONG><BR>
<STRONG><CODE>Type = atom()</CODE></STRONG><BR>
<STRONG><CODE>ACMData = acm_data()</CODE></STRONG><BR>
<STRONG><CODE>Packet = binary()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Generates a possibly encrypted response packet to be sent to the
network. <CODE>Type</CODE> is the <CODE>#pdu.type</CODE> of the original
request.
</DIV>
<P><A NAME="generate_msg/4"><STRONG><CODE>generate_msg(Vsn, Pdu, MsgData, To) ->
{ok, PacketsAndAddresses} | {discarded, Reason}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Vsn = 'version-1' | 'version-2' | 'version-3'</CODE></STRONG><BR>
<STRONG><CODE>Pdu = #pdu</CODE></STRONG><BR>
<STRONG><CODE>MsgData = msg_data()</CODE></STRONG><BR>
<STRONG><CODE>To = [dest_addrs()]</CODE></STRONG><BR>
<STRONG><CODE>PacketsAndAddresses = [{TDomain, TAddress, Packet}]</CODE></STRONG><BR>
<STRONG><CODE>TDomain = snmpUDPDomain</CODE></STRONG><BR>
<STRONG><CODE>TAddress = {Ip, Udp}</CODE></STRONG><BR>
<STRONG><CODE>Ip = {integer(), integer(), integer(), integer()}</CODE></STRONG><BR>
<STRONG><CODE>Udp = integer()</CODE></STRONG><BR>
<STRONG><CODE>Packet = binary()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Generates a possibly encrypted request packet to be sent to the
network.
<P><CODE>MsgData</CODE> is the message specific data used in
the SNMP message. This value is received in a <CODE>send_pdu</CODE>
or <CODE>send_pdu_req</CODE> message from the agent. In SNMPv1 and
SNMPv2c, this message data is the community string. In
SNMPv3, it is the context information.
<CODE>To</CODE> is a list of the destination addresses and
their corresponding security parameters. This value is
also received from the requests mentioned above.
</DIV>
<P><A NAME="discarded_pdu/1"><STRONG><CODE>discarded_pdu(Variable) -> void()</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Variable = atom()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Increments the variable associated with a discarded pdu.
This function can be used when the net_if process receives a
<CODE>discarded_pdu</CODE> message from the agent.
</DIV>
<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Martin Bjrklund - support@erlang.ericsson.se<BR>
</DIV>
<CENTER>
<HR>
<SMALL>snmp 4.8.2<BR>
Copyright © 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>
|