0

I am creating and sending an SNMP packet manually using pcap.net, the reason for this is that I need to be able to change the sender details of the SNMP packet to one other than the application hosts NIC and which wouldn't be possible with the library unless I somehow intercepted the outgoing packet and changed the details on the fly. My issue is that I can send out my packet and receive it using pcap.net as well but I need a way to decode the BER encoded packet, can I directly decode a received packet without using the rest of the library? If so what function could I call so I can read the oid values directly from a recieved packet?

Lex Li
  • 60,503
  • 9
  • 116
  • 147
user1632018
  • 2,485
  • 10
  • 52
  • 87
  • Thank you to whoever downvoted me. This question was not intended for you, it was actually intended for the sharpsnmp developers/LexLi. They are getting rid of their codeplex discussion forum and are using only SO for support, hence the sharp-snmp tag. Maybe I shouldn't of added a C# tag although it was appropriate. Some of you people need to get a grip. How about you get off your high horse and stop down-voting questions that you have no knowledge of. – user1632018 Mar 23 '14 at 00:31

1 Answers1

1

When you first asked this question I read it but could not provide much insight.

What #SNMP offers are the two set of functions below,

  • MessageFactory.ParseMessage, a few functions that parse raw bytes to ISnmpMessage.
  • ISnmpMessage.ToBytes, a method that generates raw bytes.

If you can write adapters to bridge #SNMP and Pcap.NET, you should be able to achieve what you want.

Next time, make sure you avoid C# tag, as yes you might be down voted due to that.

References:

http://help.sharpsnmp.com/html/Overload_Lextm_SharpSnmpLib_Messaging_MessageFactory_ParseMessages.htm

http://help.sharpsnmp.com/html/M_Lextm_SharpSnmpLib_Messaging_ISnmpMessage_ToBytes.htm

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Thank you for replying. I really appreciate the help. It seems my issue is that the packets are fragmented therefore I can't actually decode the packets until I figure out how to re assemble them. – user1632018 Mar 25 '14 at 07:57