Class PacketFu::Config
In: lib/packetfu/config.rb
Parent: Object

The Config class holds various bits of useful default information for packet creation. If initialized without arguments, the @iface and @pcapfile instance variables are set to the (pcaprub-believed) default interface and "/tmp/out.pcap", respectively.

Any number of instance variables can be passed in to the intialize function (as a hash), though only the expected network-related variables will be readable and writeable directly.

Examples

  PacketFu::Config.new(:ip_saddr => "1.2.3.4").ip_saddr #=> "1.2.3.4"
  PacketFu::Config.new(:foo=>"bar").foo #=> NomethodError: undefined method `foo'...

The config() function, however, does provide access to custom variables:

  PacketFu::Config.new(:foo=>"bar").config[:foo] #=> "bar"
  obj = PacketFu::Config.new(:foo=>"bar")
  obj.config(:baz => "bat")
  obj.config #=> {:iface=>"eth0", :baz=>"bat", :pcapfile=>"/tmp/out.pcap", :foo=>"bar"}

Methods

config   new  

Attributes

eth_daddr  [RW] 
eth_dst  [RW] 
eth_saddr  [RW] 
eth_src  [RW] 
iface  [RW] 
ip_saddr  [RW] 
ip_src  [RW] 
pcapfile  [RW] 

Public Class methods

Public Instance methods

Returns all instance variables as a hash (including custom variables set at initialization).

[Validate]