-3

I am trying to sniff a cdp packets from a cisco switch.

Because I am going to deal with a lot of switches I can't specify all models, I am asking in general is there a way to this using java?

Alexandre Fenyo
  • 4,526
  • 1
  • 17
  • 24
David8988
  • 79
  • 1
  • 1
  • 7

1 Answers1

1

CDP is a proprietary protocol by Cisco at the MAC (Ethernet) layer, it is not based on TCP/IP. So, the java.net Java API can not handle CDP frames.

So, you MUST use a third party library based on JNI native calls to access the underlying networking system interface. Typically, a PCAP Java wrapper will do the job. You could try JNetPcap, that should work on Linux and Windows. You can download it here: http://jnetpcap.com/download

Alexandre Fenyo
  • 4,526
  • 1
  • 17
  • 24