0

I'm following this tutorial on how to create a simple application. https://net-snmp.sourceforge.io/wiki/index.php/TUT:Simple_Application and I'm setting up to snmpv2c and using my own ip address and oid number. But I keep getting a timeout at the function call snmp_synch_response.

However, if I pack the snmp_pdu struct with version, community and community_len I'm able to create the pdu and not get a timeout. Which is leading to the confusion, because I thought the snmp_session is the struct that holds the info of the agent we want to talk to and the pdu holds the oids? or am I missing something else?

In addition, if for some reason I need to pack the snmp_pdu with the agent information how will it affect when using snmpv3. Since snmp_pdu struct does not have the fields securityAuthProto, securityName etc. Which is what I eventually would like to implement as well.

I followed the online tutorial https://net-snmp.sourceforge.io/wiki/index.php/TUT:Simple_Application

when I pack the pdu with the version, community and community_len I do not get a timeout, but the snmp_session is the struct that should contain the agent info?

pj427
  • 1
  • 1
  • I will suggest you waste no time but tailor the useful code snippets from the source code of existing command line utilities, such as `snmpget` https://github.com/net-snmp/net-snmp/blob/master/apps/snmpget.c – Lex Li Jan 04 '23 at 16:54
  • @LexLi I looked at the code you provided. However, I'm still confused as to why my code works when I pack the PDU with the data, but not when I pack the session with the exact data? since the tutorial I used as with your code both pack the session. Thanks! – pj427 Feb 13 '23 at 21:13
  • I think it is time for you to show your code. – Lex Li Feb 13 '23 at 22:39

0 Answers0