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?
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?
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