packetgen 3.1.3 → 3.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/bin/pgconsole +1 -0
- data/lib/packetgen.rb +33 -4
- data/lib/packetgen/capture.rb +51 -28
- data/lib/packetgen/config.rb +17 -11
- data/lib/packetgen/deprecation.rb +33 -7
- data/lib/packetgen/header.rb +2 -9
- data/lib/packetgen/header/arp.rb +2 -2
- data/lib/packetgen/header/asn1_base.rb +2 -2
- data/lib/packetgen/header/base.rb +70 -74
- data/lib/packetgen/header/bootp.rb +3 -3
- data/lib/packetgen/header/dhcp.rb +2 -2
- data/lib/packetgen/header/dhcp/option.rb +2 -2
- data/lib/packetgen/header/dhcp/options.rb +2 -2
- data/lib/packetgen/header/dhcpv6.rb +12 -12
- data/lib/packetgen/header/dhcpv6/duid.rb +11 -5
- data/lib/packetgen/header/dhcpv6/option.rb +8 -16
- data/lib/packetgen/header/dhcpv6/options.rb +2 -2
- data/lib/packetgen/header/dhcpv6/relay.rb +2 -2
- data/lib/packetgen/header/dns.rb +9 -9
- data/lib/packetgen/header/dns/name.rb +20 -9
- data/lib/packetgen/header/dns/opt.rb +2 -2
- data/lib/packetgen/header/dns/option.rb +2 -2
- data/lib/packetgen/header/dns/qdsection.rb +3 -3
- data/lib/packetgen/header/dns/question.rb +37 -35
- data/lib/packetgen/header/dns/rr.rb +3 -3
- data/lib/packetgen/header/dns/rrsection.rb +2 -2
- data/lib/packetgen/header/dot11.rb +30 -51
- data/lib/packetgen/header/dot11/control.rb +5 -5
- data/lib/packetgen/header/dot11/data.rb +11 -7
- data/lib/packetgen/header/dot11/element.rb +16 -16
- data/lib/packetgen/header/dot11/management.rb +2 -2
- data/lib/packetgen/header/dot11/sub_mngt.rb +2 -12
- data/lib/packetgen/header/dot1q.rb +2 -2
- data/lib/packetgen/header/dot1x.rb +7 -20
- data/lib/packetgen/header/eap.rb +30 -33
- data/lib/packetgen/header/eap/fast.rb +2 -2
- data/lib/packetgen/header/eap/md5.rb +2 -2
- data/lib/packetgen/header/eap/tls.rb +2 -2
- data/lib/packetgen/header/eap/ttls.rb +2 -2
- data/lib/packetgen/header/eth.rb +13 -11
- data/lib/packetgen/header/gre.rb +2 -2
- data/lib/packetgen/header/http.rb +2 -0
- data/lib/packetgen/header/http/headers.rb +6 -4
- data/lib/packetgen/header/http/request.rb +36 -21
- data/lib/packetgen/header/http/response.rb +7 -7
- data/lib/packetgen/header/http/verbs.rb +3 -3
- data/lib/packetgen/header/icmp.rb +2 -2
- data/lib/packetgen/header/icmpv6.rb +2 -2
- data/lib/packetgen/header/igmp.rb +4 -4
- data/lib/packetgen/header/igmpv3.rb +3 -3
- data/lib/packetgen/header/igmpv3/group_record.rb +8 -6
- data/lib/packetgen/header/igmpv3/mq.rb +2 -2
- data/lib/packetgen/header/igmpv3/mr.rb +2 -2
- data/lib/packetgen/header/ip.rb +30 -31
- data/lib/packetgen/header/ip/addr.rb +10 -3
- data/lib/packetgen/header/ip/option.rb +8 -10
- data/lib/packetgen/header/ip/options.rb +3 -5
- data/lib/packetgen/header/ipv6.rb +2 -2
- data/lib/packetgen/header/ipv6/addr.rb +9 -2
- data/lib/packetgen/header/ipv6/extension.rb +2 -2
- data/lib/packetgen/header/ipv6/hop_by_hop.rb +3 -3
- data/lib/packetgen/header/llc.rb +2 -2
- data/lib/packetgen/header/mdns.rb +2 -2
- data/lib/packetgen/header/mld.rb +2 -2
- data/lib/packetgen/header/mldv2.rb +2 -2
- data/lib/packetgen/header/mldv2/mcast_address_record.rb +4 -2
- data/lib/packetgen/header/mldv2/mlq.rb +2 -2
- data/lib/packetgen/header/mldv2/mlr.rb +2 -2
- data/lib/packetgen/header/ospfv2.rb +9 -9
- data/lib/packetgen/header/ospfv2/db_description.rb +2 -2
- data/lib/packetgen/header/ospfv2/hello.rb +2 -2
- data/lib/packetgen/header/ospfv2/ls_ack.rb +2 -2
- data/lib/packetgen/header/ospfv2/ls_request.rb +4 -2
- data/lib/packetgen/header/ospfv2/ls_update.rb +2 -2
- data/lib/packetgen/header/ospfv2/lsa.rb +9 -5
- data/lib/packetgen/header/ospfv2/lsa_header.rb +8 -7
- data/lib/packetgen/header/ospfv3.rb +2 -2
- data/lib/packetgen/header/ospfv3/db_description.rb +2 -2
- data/lib/packetgen/header/ospfv3/hello.rb +2 -2
- data/lib/packetgen/header/ospfv3/ipv6_prefix.rb +4 -2
- data/lib/packetgen/header/ospfv3/ls_ack.rb +2 -2
- data/lib/packetgen/header/ospfv3/ls_request.rb +4 -2
- data/lib/packetgen/header/ospfv3/ls_update.rb +2 -2
- data/lib/packetgen/header/ospfv3/lsa.rb +5 -5
- data/lib/packetgen/header/ospfv3/lsa_header.rb +9 -8
- data/lib/packetgen/header/snmp.rb +33 -29
- data/lib/packetgen/header/tcp.rb +4 -23
- data/lib/packetgen/header/tcp/option.rb +11 -11
- data/lib/packetgen/header/tcp/options.rb +2 -2
- data/lib/packetgen/header/tftp.rb +6 -6
- data/lib/packetgen/header/udp.rb +3 -3
- data/lib/packetgen/headerable.rb +5 -4
- data/lib/packetgen/inject.rb +23 -0
- data/lib/packetgen/inspect.rb +23 -20
- data/lib/packetgen/packet.rb +82 -53
- data/lib/packetgen/pcap.rb +29 -0
- data/lib/packetgen/pcapng.rb +13 -13
- data/lib/packetgen/pcapng/block.rb +26 -13
- data/lib/packetgen/pcapng/epb.rb +25 -22
- data/lib/packetgen/pcapng/file.rb +260 -138
- data/lib/packetgen/pcapng/idb.rb +36 -38
- data/lib/packetgen/pcapng/shb.rb +51 -53
- data/lib/packetgen/pcapng/spb.rb +19 -19
- data/lib/packetgen/pcapng/unknown_block.rb +5 -13
- data/lib/packetgen/pcaprub_wrapper.rb +81 -0
- data/lib/packetgen/proto.rb +2 -2
- data/lib/packetgen/types.rb +3 -0
- data/lib/packetgen/types/abstract_tlv.rb +27 -7
- data/lib/packetgen/types/array.rb +22 -15
- data/lib/packetgen/types/cstring.rb +57 -20
- data/lib/packetgen/types/enum.rb +7 -2
- data/lib/packetgen/types/fieldable.rb +65 -0
- data/lib/packetgen/types/fields.rb +182 -117
- data/lib/packetgen/types/int.rb +18 -6
- data/lib/packetgen/types/int_string.rb +10 -2
- data/lib/packetgen/types/length_from.rb +20 -12
- data/lib/packetgen/types/oui.rb +4 -2
- data/lib/packetgen/types/string.rb +59 -8
- data/lib/packetgen/types/tlv.rb +4 -2
- data/lib/packetgen/utils.rb +4 -4
- data/lib/packetgen/utils/arp_spoofer.rb +2 -2
- data/lib/packetgen/version.rb +3 -3
- metadata +39 -61
- data/.gitignore +0 -13
- data/.rubocop.yml +0 -30
- data/.travis.yml +0 -19
- data/Gemfile +0 -4
- data/Rakefile +0 -21
- data/packetgen.gemspec +0 -36
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
TargetRubyVersion: '2.3'
|
3
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
4
|
-
EnforcedStyle: no_space
|
5
|
-
Lint/EmptyWhen:
|
6
|
-
Enabled: false
|
7
|
-
Lint/Void:
|
8
|
-
Enabled: false
|
9
|
-
Metrics:
|
10
|
-
Enabled: false
|
11
|
-
Style/AsciiComments:
|
12
|
-
Enabled: false
|
13
|
-
Style/Encoding:
|
14
|
-
Enabled: false
|
15
|
-
Style/EvalWithLocation:
|
16
|
-
Enabled: false
|
17
|
-
Style/FormatString:
|
18
|
-
EnforcedStyle: percent
|
19
|
-
Style/FormatStringToken:
|
20
|
-
EnforcedStyle: unannotated
|
21
|
-
Style/PerlBackrefs:
|
22
|
-
Enabled: false
|
23
|
-
Style/RedundantSelf:
|
24
|
-
Enabled: false
|
25
|
-
Style/StructInheritance:
|
26
|
-
Enabled: false
|
27
|
-
Style/TrailingCommaInArrayLiteral:
|
28
|
-
Enabled: false
|
29
|
-
Style/TrailingCommaInHashLiteral:
|
30
|
-
Enabled: false
|
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: required
|
3
|
-
rvm:
|
4
|
-
- 2.3
|
5
|
-
- 2.4
|
6
|
-
- 2.5
|
7
|
-
- 2.6
|
8
|
-
|
9
|
-
install:
|
10
|
-
- sudo apt-get update -qq
|
11
|
-
- sudo apt-get install libpcap-dev -qq
|
12
|
-
- gem install bundler --version "~>1.17.3"
|
13
|
-
- bundle install --path vendor/bundle --jobs=3 --retry=3
|
14
|
-
before_script:
|
15
|
-
- openssl version
|
16
|
-
- ruby -ropenssl -e 'puts OpenSSL::VERSION'
|
17
|
-
script:
|
18
|
-
- bundle exec rake
|
19
|
-
- rvmsudo bundle exec rake spec:sudo
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
require 'yard'
|
4
|
-
|
5
|
-
task default: :spec
|
6
|
-
|
7
|
-
RSpec::Core::RakeTask.new do |t|
|
8
|
-
t.rspec_opts = '-t ~sudo'
|
9
|
-
end
|
10
|
-
RSpec::Core::RakeTask.new('spec:sudo') do |t|
|
11
|
-
t.rspec_opts = if ENV['TRAVIS']
|
12
|
-
'-t sudo -t ~notravis'
|
13
|
-
else
|
14
|
-
'-t sudo'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
YARD::Rake::YardocTask.new do |t|
|
19
|
-
t.options = ['--no-private']
|
20
|
-
t.files = ['lib/**/*.rb', '-', 'LICENSE']
|
21
|
-
end
|
data/packetgen.gemspec
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
lib = File.expand_path('lib', __dir__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require 'packetgen/version'
|
6
|
-
|
7
|
-
Gem::Specification.new do |spec|
|
8
|
-
spec.name = 'packetgen'
|
9
|
-
spec.version = PacketGen::VERSION
|
10
|
-
spec.license = 'MIT'
|
11
|
-
spec.authors = ['Sylvain Daubert']
|
12
|
-
spec.email = ['sylvain.daubert@laposte.net']
|
13
|
-
|
14
|
-
spec.summary = 'Network packet generator and dissector'
|
15
|
-
# spec.description = %q{TODO: Write a longer description or delete this line.}
|
16
|
-
spec.homepage = 'https://github.com/sdaubert/packetgen'
|
17
|
-
|
18
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
-
f.match(%r{^(test|spec|features)/})
|
20
|
-
end
|
21
|
-
spec.bindir = 'bin'
|
22
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = ['lib']
|
24
|
-
|
25
|
-
spec.required_ruby_version = '>= 2.3.0'
|
26
|
-
|
27
|
-
spec.add_dependency 'interfacez', '~>1.0'
|
28
|
-
spec.add_dependency 'pcaprub', '~>0.12.4'
|
29
|
-
spec.add_dependency 'rasn1', '~>0.5', '>= 0.6.6'
|
30
|
-
|
31
|
-
spec.add_development_dependency 'bundler', '>=1.7', '<3'
|
32
|
-
spec.add_development_dependency 'rake', '~> 12.3'
|
33
|
-
spec.add_development_dependency 'rspec', '~> 3.7'
|
34
|
-
spec.add_development_dependency 'simplecov', '~> 0.16'
|
35
|
-
spec.add_development_dependency 'yard', '~> 0.9'
|
36
|
-
end
|