#!/usr/bin/env ruby # # $Id: cdp-spew 9 2008-03-02 04:44:32Z warchild $ # # Spew CDP packets to all Cisco devices on the network # # Jon Hart require 'rubygems' require 'racket' unless (ARGV.size >= 1) puts "Usage: $0 [num fields per CDP packet]" exit end def tick @it += 1 @it = 0 if @it >= @ticks.size print "\r#{@ticks[@it]}" STDOUT.flush end def randcdp @n.layers[2] = EightOTwoDotThree.new(Misc.randstring(14)) @n.layers[2].dst_mac = "01:00:0c:cc:cc:cc" @n.layers[2].length = 0 @n.layers[3] = LLC.new