#!/usr/bin/env ruby # # $Id: arp-send 153 2009-12-13 06:29:10Z jhart $ # # Example that just writes a simple arp packet to eth0 require 'rubygems' require 'racket' include Racket unless (ARGV.size == 2) puts "Usage: #{$0} " exit end n = Racket::Racket.new n.iface = ARGV[0] n.l2 = L2::Ethernet.new(Misc.randstring(14)) n.l2.ethertype = 0x0806 n.l3 = L3::ARP.new n.l3.opcode = ARGV[1].to_i n.sendpacket