packetgen 3.3.0 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -0
  3. data/README.md +7 -7
  4. data/lib/packetgen/capture.rb +2 -1
  5. data/lib/packetgen/config.rb +2 -1
  6. data/lib/packetgen/header/arp.rb +2 -1
  7. data/lib/packetgen/header/asn1_base.rb +2 -1
  8. data/lib/packetgen/header/base.rb +4 -3
  9. data/lib/packetgen/header/bootp.rb +2 -1
  10. data/lib/packetgen/header/dhcp/option.rb +2 -1
  11. data/lib/packetgen/header/dhcp/options.rb +2 -1
  12. data/lib/packetgen/header/dhcp.rb +2 -1
  13. data/lib/packetgen/header/dhcpv6/duid.rb +2 -1
  14. data/lib/packetgen/header/dhcpv6/option.rb +2 -1
  15. data/lib/packetgen/header/dhcpv6/options.rb +2 -1
  16. data/lib/packetgen/header/dhcpv6/relay.rb +2 -1
  17. data/lib/packetgen/header/dhcpv6.rb +2 -1
  18. data/lib/packetgen/header/dns/name.rb +2 -1
  19. data/lib/packetgen/header/dns/opt.rb +3 -2
  20. data/lib/packetgen/header/dns/option.rb +3 -2
  21. data/lib/packetgen/header/dns/qdsection.rb +2 -1
  22. data/lib/packetgen/header/dns/question.rb +2 -1
  23. data/lib/packetgen/header/dns/rr.rb +2 -1
  24. data/lib/packetgen/header/dns/rrsection.rb +2 -1
  25. data/lib/packetgen/header/dns.rb +3 -2
  26. data/lib/packetgen/header/dot11/control.rb +2 -1
  27. data/lib/packetgen/header/dot11/data.rb +4 -3
  28. data/lib/packetgen/header/dot11/element.rb +2 -1
  29. data/lib/packetgen/header/dot11/management.rb +2 -1
  30. data/lib/packetgen/header/dot11/sub_mngt.rb +2 -1
  31. data/lib/packetgen/header/dot11.rb +2 -1
  32. data/lib/packetgen/header/dot1q.rb +2 -1
  33. data/lib/packetgen/header/dot1x.rb +2 -1
  34. data/lib/packetgen/header/eap/fast.rb +2 -1
  35. data/lib/packetgen/header/eap/md5.rb +2 -1
  36. data/lib/packetgen/header/eap/tls.rb +3 -2
  37. data/lib/packetgen/header/eap/ttls.rb +3 -2
  38. data/lib/packetgen/header/eap.rb +3 -2
  39. data/lib/packetgen/header/eth.rb +3 -2
  40. data/lib/packetgen/header/gre.rb +2 -1
  41. data/lib/packetgen/header/http/headers.rb +4 -3
  42. data/lib/packetgen/header/http/request.rb +2 -1
  43. data/lib/packetgen/header/http/response.rb +2 -1
  44. data/lib/packetgen/header/http/verbs.rb +2 -1
  45. data/lib/packetgen/header/http.rb +2 -1
  46. data/lib/packetgen/header/icmp.rb +2 -1
  47. data/lib/packetgen/header/icmpv6.rb +2 -1
  48. data/lib/packetgen/header/igmp.rb +2 -1
  49. data/lib/packetgen/header/igmpv3/group_record.rb +2 -1
  50. data/lib/packetgen/header/igmpv3/mq.rb +2 -1
  51. data/lib/packetgen/header/igmpv3/mr.rb +2 -1
  52. data/lib/packetgen/header/igmpv3.rb +2 -1
  53. data/lib/packetgen/header/ip/addr.rb +2 -1
  54. data/lib/packetgen/header/ip/option.rb +3 -2
  55. data/lib/packetgen/header/ip/options.rb +2 -1
  56. data/lib/packetgen/header/ip.rb +3 -2
  57. data/lib/packetgen/header/ipv6/addr.rb +2 -1
  58. data/lib/packetgen/header/ipv6/extension.rb +2 -1
  59. data/lib/packetgen/header/ipv6/hop_by_hop.rb +2 -1
  60. data/lib/packetgen/header/ipv6.rb +2 -1
  61. data/lib/packetgen/header/llc.rb +2 -1
  62. data/lib/packetgen/header/mdns.rb +2 -1
  63. data/lib/packetgen/header/mld.rb +2 -1
  64. data/lib/packetgen/header/mldv2/mcast_address_record.rb +2 -1
  65. data/lib/packetgen/header/mldv2/mlq.rb +2 -1
  66. data/lib/packetgen/header/mldv2/mlr.rb +2 -1
  67. data/lib/packetgen/header/mldv2.rb +2 -1
  68. data/lib/packetgen/header/ospfv2/db_description.rb +2 -1
  69. data/lib/packetgen/header/ospfv2/hello.rb +2 -1
  70. data/lib/packetgen/header/ospfv2/ls_ack.rb +2 -1
  71. data/lib/packetgen/header/ospfv2/ls_request.rb +2 -1
  72. data/lib/packetgen/header/ospfv2/ls_update.rb +2 -1
  73. data/lib/packetgen/header/ospfv2/lsa.rb +2 -1
  74. data/lib/packetgen/header/ospfv2/lsa_header.rb +2 -1
  75. data/lib/packetgen/header/ospfv2.rb +2 -1
  76. data/lib/packetgen/header/ospfv3/db_description.rb +2 -1
  77. data/lib/packetgen/header/ospfv3/hello.rb +2 -1
  78. data/lib/packetgen/header/ospfv3/ipv6_prefix.rb +2 -1
  79. data/lib/packetgen/header/ospfv3/ls_ack.rb +2 -1
  80. data/lib/packetgen/header/ospfv3/ls_request.rb +2 -1
  81. data/lib/packetgen/header/ospfv3/ls_update.rb +2 -1
  82. data/lib/packetgen/header/ospfv3/lsa.rb +2 -1
  83. data/lib/packetgen/header/ospfv3/lsa_header.rb +2 -1
  84. data/lib/packetgen/header/ospfv3.rb +2 -1
  85. data/lib/packetgen/header/sctp/chunk.rb +547 -0
  86. data/lib/packetgen/header/sctp/error.rb +347 -0
  87. data/lib/packetgen/header/sctp/padded32.rb +34 -0
  88. data/lib/packetgen/header/sctp/parameter.rb +229 -0
  89. data/lib/packetgen/header/sctp.rb +96 -0
  90. data/lib/packetgen/header/snmp.rb +3 -2
  91. data/lib/packetgen/header/tcp/option.rb +2 -1
  92. data/lib/packetgen/header/tcp/options.rb +2 -1
  93. data/lib/packetgen/header/tcp.rb +3 -2
  94. data/lib/packetgen/header/tftp.rb +2 -1
  95. data/lib/packetgen/header/udp.rb +2 -1
  96. data/lib/packetgen/header.rb +4 -2
  97. data/lib/packetgen/headerable.rb +2 -1
  98. data/lib/packetgen/inject.rb +2 -1
  99. data/lib/packetgen/inspect.rb +2 -1
  100. data/lib/packetgen/packet.rb +4 -3
  101. data/lib/packetgen/pcap.rb +2 -1
  102. data/lib/packetgen/pcapng/block.rb +3 -2
  103. data/lib/packetgen/pcapng/epb.rb +2 -1
  104. data/lib/packetgen/pcapng/file.rb +2 -1
  105. data/lib/packetgen/pcapng/idb.rb +2 -1
  106. data/lib/packetgen/pcapng/shb.rb +2 -1
  107. data/lib/packetgen/pcapng/spb.rb +2 -1
  108. data/lib/packetgen/pcapng/unknown_block.rb +2 -1
  109. data/lib/packetgen/pcapng.rb +2 -1
  110. data/lib/packetgen/pcaprub_wrapper.rb +2 -1
  111. data/lib/packetgen/proto.rb +2 -1
  112. data/lib/packetgen/types/abstract_tlv.rb +146 -56
  113. data/lib/packetgen/types/array.rb +20 -3
  114. data/lib/packetgen/types/cstring.rb +2 -1
  115. data/lib/packetgen/types/enum.rb +3 -2
  116. data/lib/packetgen/types/fieldable.rb +3 -2
  117. data/lib/packetgen/types/fields.rb +8 -7
  118. data/lib/packetgen/types/int.rb +114 -13
  119. data/lib/packetgen/types/int_string.rb +2 -1
  120. data/lib/packetgen/types/length_from.rb +2 -1
  121. data/lib/packetgen/types/oui.rb +2 -1
  122. data/lib/packetgen/types/string.rb +2 -1
  123. data/lib/packetgen/types/tlv.rb +2 -1
  124. data/lib/packetgen/types.rb +2 -1
  125. data/lib/packetgen/unknown_packet.rb +3 -2
  126. data/lib/packetgen/utils/arp_spoofer.rb +4 -3
  127. data/lib/packetgen/utils.rb +2 -1
  128. data/lib/packetgen/version.rb +3 -2
  129. data/lib/packetgen.rb +2 -1
  130. metadata +27 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de85a6f18ac001823cdbd0802c8946ead811be724c9069266b78c493d99feb6b
4
- data.tar.gz: ef73ca367e87bb47ca4f37ee387c7a73d0ad0f19cebaca151443560f42508559
3
+ metadata.gz: a8b6287713be7731dc7050bde9a8a568ebbd9696862807303f754a38a8d869f0
4
+ data.tar.gz: ce5542ab4acd3acc9e6e175eda8c77b1c627a24fc22def27ede0b713dcb86a84
5
5
  SHA512:
6
- metadata.gz: '01605812af7b7d53111bfdc0d4d095cb6f0df4975634db17700d7c15c6acc63ba82585e6c5a5d2d93c130d566f45bb62d9ff3709c27e0f7cf4ea0c20ba7c172f'
7
- data.tar.gz: e4a54c74e032ee12d744f94c657416591c0f056a005da4b104c017294d73819596a28ec59c71597f8d0f2398da79a8b7784809d5e30cd5da9d53fc655101e2f4
6
+ metadata.gz: e278d877f15ff1e5e33d97302d2dc2f1b086ad1a4bceb794bf081c4cdd5e37259730db720de5017942fe925df9f163f30e4e8390840e682ce2407228c56ca11e
7
+ data.tar.gz: 0103233c414436e3a661ddaf2278ea96a6865437a4978098562516e084abe71099d82f2d1bfa0ef292ac886c19ba183550be6de40e8bf7d0ecf1699e3a6b3e35
data/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
3
  Copyright (c) 2016 Sylvain Daubert
4
+ Copyright (c) 2024 LemonTree55
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  [![Gem Version](https://badge.fury.io/rb/packetgen.svg)](https://badge.fury.io/rb/packetgen)
3
- [![Action status](https://github.com/sdaubert/packetgen/workflows/ci/badge.svg?branch=master)](https://github.com/sdaubert/packetgen/actions?query=workflow%3Aci)
3
+ [![Action status](https://github.com/lemontree55/packetgen/workflows/ci/badge.svg?branch=master)](https://github.com/lemontree55/packetgen/actions?query=workflow%3Aci)
4
4
  # PacketGen
5
5
 
6
6
  PacketGen provides simple ways to generate, send and capture network packets.
@@ -158,26 +158,26 @@ If `pry` gem is installed, it is used as backend for `pgconsole`, else IRB is us
158
158
 
159
159
  ## Plugins
160
160
 
161
- PacketGen provides a plugin system (see [wiki](https://github.com/sdaubert/packetgen/wiki/Create-Custom-Protocol)).
161
+ PacketGen provides a plugin system (see [wiki](https://github.com/lemontree55/packetgen/wiki/Create-Custom-Protocol)).
162
162
 
163
163
  Available plugins (available as gem) are:
164
164
 
165
- * [packetgen-plugin-ipsec](https://github.com/sdaubert/packetgen-plugin-ipsec): add support for ESP and IKEv2 protocols. Before PacketGen3, these protocols were included in packetgen.
166
- * [packetgen-plugin-smb](https://github.com/sdaubert/packetgen-plugin-smb): add support for SMB protocol suite.
165
+ * [packetgen-plugin-ipsec](https://github.com/lemontree55/packetgen-plugin-ipsec): add support for ESP and IKEv2 protocols. Before PacketGen3, these protocols were included in packetgen.
166
+ * [packetgen-plugin-smb](https://github.com/lemontree55/packetgen-plugin-smb): add support for SMB protocol suite.
167
167
 
168
168
  ## See also
169
169
 
170
- Wiki: https://github.com/sdaubert/packetgen/wiki
170
+ Wiki: https://github.com/lemontree55/packetgen/wiki
171
171
 
172
172
  API documentation: http://www.rubydoc.info/gems/packetgen
173
173
 
174
174
  ## Contributing
175
175
 
176
- Bug reports and pull requests are welcome on GitHub at https://github.com/sdaubert/packetgen.
176
+ Bug reports and pull requests are welcome on GitHub at https://github.com/lemontree55/packetgen.
177
177
 
178
178
  ## License
179
179
 
180
- MIT License (see [LICENSE](https://github.com/sdaubert/packetgen/blob/master/LICENSE))
180
+ MIT License (see [LICENSE](https://github.com/lemontree55/packetgen/blob/master/LICENSE))
181
181
 
182
182
  ### Other sources
183
183
  All original code maintains its copyright from its original authors and licensing.
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
  require_relative 'pcaprub_wrapper'
8
9
 
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  require 'socket'
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  require 'rasn1'
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -38,14 +39,14 @@ module PacketGen
38
39
  def set(fields)
39
40
  case self[:value]
40
41
  when Proc
41
- fields.send "#{self[:key]}=", self[:value].call(nil)
42
+ fields.send(:"#{self[:key]}=", self[:value].call(nil))
42
43
  else
43
44
  attr = if self[:key].to_s.end_with?('?')
44
45
  self[:key].to_s[0..-2]
45
46
  else
46
47
  self[:key]
47
48
  end
48
- fields.send "#{attr}=", self[:value]
49
+ fields.send(:"#{attr}=", self[:value])
49
50
  end
50
51
  end
51
52
  end
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  require_relative 'option'
@@ -37,7 +38,7 @@ module PacketGen
37
38
  # @option options [String] :rdata
38
39
  def initialize(dns, options={})
39
40
  opts = { name: '.', rrclass: 512, type: 41 }.merge!(options)
40
- super dns, opts
41
+ super(dns, opts)
41
42
 
42
43
  self.udp_size = options[:udp_size] if options[:udp_size]
43
44
  self.ext_rcode = options[:ext_rcode] if options[:ext_rcode]
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -11,7 +12,7 @@ module PacketGen
11
12
  # @!parse
12
13
  # # DNS option is a TLV object:
13
14
  # # * {#code} is a {Types::Int16},
14
- # # * {#length #length} is a {Types::Int16},
15
+ # # * {#length} is a {Types::Int16},
15
16
  # # * {#data} is a {Types::String}.
16
17
  # #
17
18
  # # @since 1.3.0
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -2,8 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # This file is part of PacketGen
5
- # See https://github.com/sdaubert/packetgen for more informations
5
+ # See https://github.com/lemontree55/packetgen for more informations
6
6
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
7
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
7
8
  # This program is published under MIT license.
8
9
 
9
10
  module PacketGen
@@ -256,7 +257,7 @@ module PacketGen
256
257
  private
257
258
 
258
259
  def inspect_flags
259
- flags = %i[qr aa tc rd ra].select! { |flag| send "#{flag}?" }.map(&:to_s).join(',')
260
+ flags = %i[qr aa tc rd ra].select! { |flag| send(:"#{flag}?") }.map(&:to_s).join(',')
260
261
  str = Inspect.shift_level
261
262
  str << Inspect::FMT_ATTR % ['Flags', 'flags', flags]
262
263
  end
@@ -2,8 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # This file is part of PacketGen
5
- # See https://github.com/sdaubert/packetgen for more informations
5
+ # See https://github.com/lemontree55/packetgen for more informations
6
6
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
7
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
7
8
  # This program is published under MIT license.
8
9
 
9
10
  module PacketGen
@@ -2,8 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # This file is part of PacketGen
5
- # See https://github.com/sdaubert/packetgen for more informations
5
+ # See https://github.com/lemontree55/packetgen for more informations
6
6
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
7
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
7
8
  # This program is published under MIT license.
8
9
 
9
10
  module PacketGen
@@ -76,7 +77,7 @@ module PacketGen
76
77
  # @return [String]
77
78
  def dst=(mac)
78
79
  _src_mac, dst_mac = src_dst_from_mac
79
- self.send("#{dst_mac}=", mac)
80
+ self.send(:"#{dst_mac}=", mac)
80
81
  end
81
82
 
82
83
  # Get source MAC address
@@ -91,7 +92,7 @@ module PacketGen
91
92
  # @return [String]
92
93
  def src=(mac)
93
94
  src_mac, = src_dst_from_mac
94
- self.send("#{src_mac}=", mac)
95
+ self.send(:"#{src_mac}=", mac)
95
96
  end
96
97
 
97
98
  private
@@ -2,8 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # This file is part of PacketGen
5
- # See https://github.com/sdaubert/packetgen for more informations
5
+ # See https://github.com/lemontree55/packetgen for more informations
6
6
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
7
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
7
8
  # This program is published under MIT license.
8
9
 
9
10
  module PacketGen
@@ -2,8 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # This file is part of PacketGen
5
- # See https://github.com/sdaubert/packetgen for more informations
5
+ # See https://github.com/lemontree55/packetgen for more informations
6
6
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
7
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
7
8
  # This program is published under MIT license.
8
9
 
9
10
  module PacketGen
@@ -2,8 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # This file is part of PacketGen
5
- # See https://github.com/sdaubert/packetgen for more informations
5
+ # See https://github.com/lemontree55/packetgen for more informations
6
6
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
7
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
7
8
  # This program is published under MIT license.
8
9
 
9
10
  module PacketGen
@@ -2,8 +2,9 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # This file is part of PacketGen
5
- # See https://github.com/sdaubert/packetgen for more informations
5
+ # See https://github.com/lemontree55/packetgen for more informations
6
6
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
7
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
7
8
  # This program is published under MIT license.
8
9
 
9
10
  require 'zlib'
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -51,7 +52,7 @@ module PacketGen
51
52
  next unless attr == :flags
52
53
 
53
54
  str = Inspect.shift_level
54
- value = %i[l m s].map { |f| send("#{f}?") ? f.to_s : '.' }.join
55
+ value = %i[l m s].map { |f| send(:"#{f}?") ? f.to_s : '.' }.join
55
56
  value = '%-16s (0x%02x)' % [value, self.flags]
56
57
  str << Inspect::FMT_ATTR % [self[attr].class.to_s.sub(/.*::/, ''),
57
58
  attr, value]
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -56,7 +57,7 @@ module PacketGen
56
57
 
57
58
  shift = Inspect.shift_level
58
59
  str = shift.dup
59
- value = %i[l m s].map { |f| send("#{f}?") ? f.to_s : '.' }.join
60
+ value = %i[l m s].map { |f| send(:"#{f}?") ? f.to_s : '.' }.join
60
61
  value = '%-16s (0x%02x)' % [value, self.flags]
61
62
  str << Inspect::FMT_ATTR % [self[attr].class.to_s.sub(/.*::/, ''),
62
63
  attr, value]
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -131,7 +132,7 @@ module PacketGen
131
132
  # @return [Dot11] may return a subclass object if a more specific class
132
133
  # may be determined
133
134
  def read(str)
134
- super str
135
+ super(str)
135
136
  return self unless self.instance_of?(EAP)
136
137
  return self unless type?
137
138
 
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -64,7 +65,7 @@ module PacketGen
64
65
  raise ArgumentError, 'not a MAC address' unless bytes.size == 6
65
66
 
66
67
  6.times do |i|
67
- self["a#{i}".to_sym].read(bytes[i].to_i(16))
68
+ self[:"a#{i}"].read(bytes[i].to_i(16))
68
69
  end
69
70
  self
70
71
  end
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen
@@ -29,12 +30,12 @@ module PacketGen
29
30
  def read(s_or_h)
30
31
  case s_or_h
31
32
  when String
32
- @data = s_or_h.split("\n").map do |h|
33
+ @data = s_or_h.split("\n").filter_map do |h|
33
34
  next unless h.include?(':')
34
35
 
35
36
  k, v = h.split(':', 2)
36
37
  [k, v.strip]
37
- end.compact.to_h
38
+ end.to_h
38
39
  when Hash
39
40
  @data = s_or_h
40
41
  end
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # This file is part of PacketGen
4
- # See https://github.com/sdaubert/packetgen for more informations
4
+ # See https://github.com/lemontree55/packetgen for more informations
5
5
  # Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
6
+ # Copyright (C) 2024 LemonTree55 <lenontree@proton.me>
6
7
  # This program is published under MIT license.
7
8
 
8
9
  module PacketGen