<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Courier New \;color\:black";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
tt
{mso-style-priority:99;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Dominik,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks very much.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I try to construct the pdu according to the my conjecture (they may has the element max_repetitions and non_repeaters),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">but I found that it was wrong…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Get bulk has reused the error_status and error_index.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">B.R<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> Dominik Pawlak [mailto:dominik_pawlak@yahoo.co.uk]
<br>
<b>Sent:</b> Wednesday, December 24, 2014 8:48 PM<br>
<b>To:</b> Andy Li J; erlang-questions@erlang.org<br>
<b>Subject:</b> Re: [erlang-questions] How to define snmp get bulk request pdu including max-repetitions and no-repeaters<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello Andy,<br>
Don't know why you try to construct the pdu yourself, but I can see that in the snmp application the code for constructing bulk request pdu is:<br>
<br>
<tt><span style="font-size:10.0pt">make_pdu(bulk, {NonRepeaters, MaxRepetitions, Oids}, MiniMIB) -></span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt> Foids = [flatten_oid(Oid, MiniMIB) || Oid <- Oids],</tt><br>
<tt> #pdu{type = 'get-bulk-request', </tt><br>
<tt> request_id = request_id(),</tt><br>
<tt><b> error_status = NonRepeaters, </b></tt><b><br>
<tt> error_index = MaxRepetitions,</tt></b><br>
<tt> varbinds = [make_vb(Foid) || Foid <- Foids]};</tt></span><br>
<br>
The standard way to perform a bulk request would be:<br>
<br>
<tt><span style="font-size:10.0pt">snmpm:sync_get_bulk("snmp_user", "snmp_agent", 0, 3, [[1,3,6,1,4,1,14817,3,12,2,10,1,5,1]]).</span></tt><br>
<br>
Best<br>
Dominik<o:p></o:p></p>
<div>
<p class="MsoNormal">On 24.12.2014 09:56, Andy Li J wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">If I want to define a snmp get request pdu, and the format as follows:<o:p></o:p></p>
<p class="MsoNormal">#pdu{ type = ‘get-request’, request_id = ReqId,<o:p></o:p></p>
<p class="MsoNormal"> error_status = noError, error_index = 0,<o:p></o:p></p>
<p class="MsoNormal"> varbinds }<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">And if I want to define a snmp get bulk pdu including max-repetitions and no-repeaters, how to define it?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I try the following, but report max_repetitions and no_repeaters undefined in record pdu.<o:p></o:p></p>
<p class="MsoNormal">#pdu{ type = ‘get-bulk-request’, request_id = ReqId,<o:p></o:p></p>
<p class="MsoNormal"> max_repetitions = MaxRepetitions, non_repeaters = NonRepeaters,<o:p></o:p></p>
<p class="MsoNormal"> varbinds }<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">But I find that in RFC3416,<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif"">BulkPDU ::= -- must be identical in</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif""> SEQUENCE { -- structure to PDU</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif""> request-id INTEGER (-214783648..214783647),</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif""> non-repeaters INTEGER (0..max-bindings),</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif""> max-repetitions INTEGER (0..max-bindings),</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif""> variable-bindings -- values are ignored</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif""> VarBindList</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif""> }</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Could you help me? Thanks very much.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">B.R<o:p></o:p></p>
<p class="MsoNormal">Andy<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>erlang-questions mailing list<o:p></o:p></pre>
<pre><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><o:p></o:p></pre>
<pre><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
</div>
</body>
</html>