Does variable of data type ASN_OCTET_STR null terminated?

Pushpa Thimmaiah <[email protected]> Tue, 21 Jan 2025 15:53:29 +0530
Newsgroups gmane.network.net-snmp.devel
Message-ID <CAASqVJV2bWmpV2bzzVYt7QoLhfi=2rPYQi275fN=3r3eZr2fTQ@mail.gmail.com>
--===============1626922549563145964==
Content-Type: multipart/alternative; boundary="000000000000d1c1bf062c349545"

--000000000000d1c1bf062c349545
Content-Type: text/plain; charset="UTF-8"

Hi All,


I am adding SNMPGET support for a MIB object and have created a MIB
implementation file. Some sites say the datatype ASN_OCTET_STR is not
null-terminated as in a C-style string. I did see that snmp_set_var_value()
appends '\0' at the end of the ASN_OCTET_STR type.

Kindly confirm whether I have to terminate the string with a null character
and set the length to include the null character before calling
snmp_set_var_value().



Thanks,
Pushpa.T

--000000000000d1c1bf062c349545
Content-Type: text/html; charset="UTF-8"

<div dir="ltr"><div>Hi All,</div><div><br></div><br><div class="gmail-col-12">
                        <div style="min-height:250px" class="gmail-mt-1 gmail-form-control gmail-rounded gmail-shadow" id="gmail-BotResponse"><p>I
 am adding SNMPGET support for a MIB object and have created a MIB 
implementation file. Some sites say the datatype ASN_OCTET_STR is not 
null-terminated as in a C-style string. I did see that 
snmp_set_var_value() appends &#39;\0&#39; at the end of the ASN_OCTET_STR type. </p>
<p>Kindly confirm whether I have to terminate the string with a null 
character and set the length to include the null character before 
calling snmp_set_var_value().<br></p><p><br></p><p><br></p><p>Thanks,</p></div></div><div>Pushpa.T<br></div></div>

--000000000000d1c1bf062c349545--


--===============1626922549563145964==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1626922549563145964==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

--===============1626922549563145964==--