Giter Club home page Giter Club logo

cdpr-3.0's Introduction

cdpr - Cisco Discovery Protocol Reporter

Copyright (c) 2002-2010 MonkeyMental.com

Copyright (c) 2015 Tim Dorssers

The default behaviour is to send a CDP/LLDP trigger packet on startup (unless -s is specified) and send a regular CDP/LLDP packet every minute. After one CDP/LLDP packet has been received, the program will quit unless -c is specified. All available Ethernet interfaces on a host are used for sending and receiving, unless -i or -d is specified. Use -l to see what adapters are available to specify using -d. After 300 seconds the program will quit, unless specified otherwise using -t. Regular TLVs are reported by default and all known TLVs are reported by specifying -v. Unknown TLVs are also reported by specifying -vv.

libpcap 0.9.1 or later required for pcap_sendpacket support.

cdpr has been compiled and tested on the following Operating Systems:

  • Windows 8.1 and 10 using Visual Studio 2015 on [x86]
  • Linux 3.10.0 and 3.19.0 using gcc 4.8 on [x86_64]
  • Mac OS X 10.11 using gcc 4.2 on [x86_64]
  • Oracle Solaris 11.3 using gcc 4.8 on [x86_64]
  • FreeBSD 10.2 using gcc 4.8 on [x86_64]
  • Linux 2.6.18 using gcc 4.1 on [sparc]
  • Linux 3.2.0 using gcc 3.6 on [armv7l] [mips64] [ppc]
  • NetBSD 7.0 using gcc 4.8 on [sparc64]

Command line options

-a: LLDP 802.1AB only mode
-o: CDP only mode
-c: Continuous capture mode; does not stop upon first reception
-s: Silent mode; do not send trigger packet
-i: Interactive mode; lets user pick a device to listen on
-l: Lists devices
-d: Specify device to use (eth0, hme0, etc.)
-h: Print usage
-t: Time in seconds to abort waiting for packets (default is 300)
-v[vv]: Set verbose mode

Compile instructions for Windows

To build it from source download the WinPcap Developers Pack unzip it into the cdpr source tree. Your directory structure should looks something like this:

\cdpr-3.0
 +-WpdPack
  +-docs
  +-Examples
  +-Include
  +-Lib

Version History

3.0.0

  • Forked MonkeyMental.com's version 2.4 code
  • Removed the functionality to report CDP data back to a centralized server
  • Added all known TLVs and CDP capabilities, supporting Nexus switches
  • Added more TLV decoding functionality to the print_cdp_packet routine
  • Added the CDP send module to send a VLAN request to a Catalyst switch to trigger a CDP advertisement
  • Added multiple interface support; send and receive on all Ethernet interfaces on a host
  • Added friendly interface name support under Win32
  • Changed behaviour to quit the application after reception of a CDP packet

3.0.1

  • Added IPv6 support to the CDP send module
  • Added support for CPU architectures that require memory alignment to the CDP send module

3.0.2

  • Added IPv6 support to the CDP send module

3.0.3

  • Added LLDP reporting support
  • Added LLDP to send module to trigger advertisements

3.0.4

  • Added Npcap compatibility

cdpr-3.0's People

Contributors

tdorssers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cdpr-3.0's Issues

Use CDPR in NetworkManager dispatcher script

Hi Tim, I'm sorry this is quite specific, but I can't wrap my head around why this is not working.

I want to use the output of your cdpr tool for some actions in a NetworkManager dispatcher script.
I wrote a test script and put it in /etc/NetworkManager/dispatcher.d/
In this script, your cdpr tool is executed with -d eth0 -t 10 and the output saved to a text file for debugging.

When I directly execute this script with sudo, everything works. When NetworkManager automatically executes the script, it seems like cdpr will finish instantly, without waiting for a CDP response:

CDP Output:
Cisco Discovery Protocol Reporter
Version 3.0.4 by Tim Dorssers

Timeout enabled for 10 seconds
Use -h option to see usage

Using device eth0

Sending on 1 interface(s)
Done

Press any key to quit or wait for timeout
Listening on 1 interface(s)

Done

This happens instantly, not waiting for 10 seconds.
Do you have any idea why this might be the case?

[Question] Does is still compile under Linux?

Hi!

I was looking at testing the Voice vlan function. I'd like to see if this triggers a full CDP update or just the VoiceVlan response.

ldumont@eyes:~/cdpr-3.0$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18+deb9u1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) 
ldumont@eyes:~/cdpr-3.0$ sudo dpkg -l | grep libpcap
ii  libpcap-dev                    1.8.1-3                           all          development library for libpcap (transitional package)
ii  libpcap0.8:amd64               1.8.1-3                           amd64        system interface for user-level packet capture
ii  libpcap0.8-dev                 1.8.1-3                           amd64        development library and header files for libpcap0.8
ldumont@eyes:~/cdpr-3.0$ make cdpr 
gcc -Wall -W -O2 -std=gnu99 cdpr.c cdps.c cdp.c os_version_info.c -lpcap -o cdpr
/tmp/cczVHrZV.o: In function `main':
cdpr.c:(.text.startup+0x522): undefined reference to `print_lldp_packet'
/tmp/ccfJcxGE.o: In function `print_cdp_packet':
cdp.c:(.text+0xf4c): undefined reference to `print_location_id'
collect2: error: ld returned 1 exit status
Makefile:25: recipe for target 'cdpr' failed
make: *** [cdpr] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.