Sha256: def477d5685352bb5b9b8be88beeff3f76be6188b74b52834ff38a771a7e4389

Contents?: true

Size: 1.53 KB

Versions: 3

Compression:

Stored size: 1.53 KB

Contents

#require "bundler/gem_tasks"
require 'rake'
require 'ipaddr'
require 'bundler'
require 'pxnx_jruby'

namespace :pxnx do
  task :default => :simulate
  # TODO. (!) Read the parameters from arg/config/env/etc.
  desc 'Authenticate and connect through Radius'
  task :simulate, [:ip] => [:authenticate, :connect] do |t, args|
    puts 'Sent Radius packets. Check log file.'
  end

  desc 'Authenticate to Radius'
  task :authenticate, :ip do |t, args|
    args.with_defaults(ip: PxnxJruby.random_ip)
    @ip = args[:ip]
    sh "java -cp #{File.expand_path File.dirname(__FILE__)}/RadiusSimulator.jar -DUSERNAME=dfinol -DPASSWORD=Nexpose4lyfe -DCALLING_STATION_ID=11:22:33:44:55:66 -DAUDIT_SESSION_ID=1001 -DFRAMED_IP_ADDRESS=#{@ip} -DRADIUS_SECRET=nxadmin -DFRAMED_IP_MASK=255.255.255.255 RadiusAuthentication 10.4.91.100"
  end

  desc 'Start accounting'
  task :connect, :ip  do |t, args|
    sh "java -cp #{File.expand_path File.dirname(__FILE__)}/RadiusSimulator.jar -DUSERNAME=dfinol -DPASSWORD=Nexpose4lyfe -DCALLING_STATION_ID=11:22:33:44:55:66 -DAUDIT_SESSION_ID=1001 -DFRAMED_IP_ADDRESS=#{@ip} -DRADIUS_SECRET=nxadmin -DFRAMED_IP_MASK=255.255.255.255 RadiusAccountingStart 10.4.91.100"
  end

  desc 'Stop accounting'
  task :stop, :ip  do |t, args|
    sh "java -cp #{File.expand_path File.dirname(__FILE__)}/RadiusSimulator.jar -DUSERNAME=dfinol -DPASSWORD=Nexpose4lyfe -DCALLING_STATION_ID=11:22:33:44:55:66 -DAUDIT_SESSION_ID=1001 -DFRAMED_IP_ADDRESS=#{@ip} -DRADIUS_SECRET=nxadmin -DFRAMED_IP_MASK=255.255.255.255 RadiusAccountingStop 10.4.91.100"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nexpose_pxgrid-0.1.5-java Rakefile
nexpose_pxgrid-0.1.4-java Rakefile
nexpose_pxgrid-0.1.2-java Rakefile