packet-protocols 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a27a85186048ae13c3b0c93579424cc9cae14e5b
4
- data.tar.gz: b0e13d20586455d3346fd7aad8fe9105e3d4fc80
3
+ metadata.gz: 6b0199c78e4d88c7a93a913101a51996edd71a93
4
+ data.tar.gz: b072ef6077fd1597d7a32f971c1f60253c5bcd78
5
5
  SHA512:
6
- metadata.gz: 47b6ba39ff586bb1c66a33f66901ec981cca9a8253e0ca0516813e92f904c541c537767f7baee9e5f3a1affa11019ea5c73ddbec3245dc8d8bb9603a9c9756fb
7
- data.tar.gz: edb2f47836f18c0a8d7cd4d732566ca8365e6c61ed433f01932f1c480b1e554cedb4567fbb35f0fc037a52a83ae0343ee44b99f0866e3a9de90eb2dce036a972
6
+ metadata.gz: 42ff1521bc9116c4f75cc0da225b1f7d6d1af8e1cad61b8eceb6675f02f7cbbf3868d896fc3b8aaf7826330ebd0dca6ab77e495569fde63b8bf35d9c557145ea
7
+ data.tar.gz: 9355743bd1da87e5c2f7bb0273f89e51a0f9ce6d42b1c73cb84a9437be7956d7a8bafb9651e58bcb73e90f22c63e71c9bc3ac301745fc72430a6e975f30c0838
data/lib/arp.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  require 'bindata-contrib'
2
- require_relative 'mac_address'
3
- require_relative 'ipv4_address'
4
2
 
5
3
  class Arp < BinData::Record
6
4
  HARDWARES = { ethernet: 1 }
data/lib/ipv4.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'bindata-contrib'
2
- require_relative 'ipv4_address'
3
2
  require_relative 'icmp'
4
3
  require_relative 'tcp'
5
4
  require_relative 'udp'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packet-protocols
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémy Pagé
@@ -21,9 +21,6 @@ files:
21
21
  - lib/ethernet.rb
22
22
  - lib/icmp.rb
23
23
  - lib/ipv4.rb
24
- - lib/ipv4_address.rb
25
- - lib/ipv6_address.rb
26
- - lib/mac_address.rb
27
24
  - lib/packet-protocols.rb
28
25
  - lib/tcp.rb
29
26
  - lib/udp.rb
data/lib/ipv4_address.rb DELETED
@@ -1,14 +0,0 @@
1
- require 'bindata'
2
-
3
- class Ipv4Address < BinData::Primitive
4
- endian :big
5
- array :octets, type: :uint8, initial_length: 4
6
-
7
- def get
8
- octets.map(&:to_s).join('.')
9
- end
10
-
11
- def set(value)
12
- self.octets = value.split('.').map(&:to_i)
13
- end
14
- end
data/lib/ipv6_address.rb DELETED
@@ -1,14 +0,0 @@
1
- require 'bindata'
2
-
3
- class Ipv6Address < BinData::Primitive
4
- endian :big
5
- array :octets, type: :uint8, initial_length: 16
6
-
7
- def get
8
- octets.map { |o| o.to_s(16) }.join(':')
9
- end
10
-
11
- def set(value)
12
- self.octets = value.split(':').map { |o| o.to_i(16) }
13
- end
14
- end
data/lib/mac_address.rb DELETED
@@ -1,14 +0,0 @@
1
- require 'bindata'
2
-
3
- class MacAddress < BinData::Primitive
4
- endian :big
5
- array :octets, type: :uint8, initial_length: 6
6
-
7
- def get
8
- octets.map { |octet| format('%02x', octet) }.join(':')
9
- end
10
-
11
- def set(value)
12
- self.octets = value.split(':').map(&:hex)
13
- end
14
- end