#!/usr/bin/env ruby # # $Id: ipv6 172 2010-03-16 07:07:04Z jhart $ # require 'rubygems' require 'racket' include Racket unless (ARGV.size == 2) puts "Usage: #{$0} " exit end n = Racket::Racket.new n.iface = "eth0" n.l2 = L2::Ethernet.new(Misc.randstring(14)) n.l2.ethertype = 0x86DD n.l3 = L3::IPv6.new n.l3.src_ip = L3::Misc.ipv62long(ARGV[0]) n.l3.dst_ip = L3::Misc.ipv62long(ARGV[1]) n.l3.nhead = 17 n.l4 = L4::UDP.new n.l4.src_port = 12345 n.l4.dst_port = 123 n.l4.fix!(n.l3.src_ip, n.l3.dst_ip) f = n.sendpacket n.layers.compact.each do |l| puts l.pretty end #puts "Sent #{f}"