packet_via_dmem 0.0.16 → 0.0.17

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: ea43302f0596427e5745d66068d112f8e38c444c
4
- data.tar.gz: d8f18e6fd43fa98088f252f4616a4a0179f92ed8
3
+ metadata.gz: 36975cfb09e9cebda91fdd67d5982f4120806984
4
+ data.tar.gz: 89aaa1943eecdff4f7cf46079f2f2867de66203e
5
5
  SHA512:
6
- metadata.gz: 33ec864e70993ec6f061eef31ef57ae7501a057de050de35be999c49741936074516ceae1572103686d79aba8551d220fbbdd7bbf64695be364b017ab4da1006
7
- data.tar.gz: f6fb589b1573038afc74f71df748863924b3c798e4ee9145e2db07639ad4905c42ef1e51ea54dec641b5428b6b5a7af2124a5d0a00ce3383c715b61c63763fa7
6
+ metadata.gz: e7548cfaf781d592a18ed2dfc8a640055942e38b6fa3c911a6c5cd3c2132543bf4670829ef1e1a0dfc1d3d79ec7d921f1bba74a6f78f67ad7b1cb85e40e3de2c
7
+ data.tar.gz: db6ead8d6c9436ab062f903337f0d0d27525f7f9bc58fea995be53098271e1115be9d2698c38e58d4a8c8a0f544bb4f5da1db05a5c653a5e42e3f077da98f00d
@@ -1,5 +1,6 @@
1
1
  require 'strscan'
2
2
  require 'logger'
3
+ require 'pry'
3
4
 
4
5
  class PacketViaDMEM
5
6
  PACKET = /^(Received|Sent) \d+ byte parcel:.*\n/
@@ -51,7 +52,7 @@ class PacketViaDMEM
51
52
  @sc.scan_until(/\n/) if type == :received
52
53
  pkt = ''
53
54
  while @sc.match?(/^0x/)
54
- pkt << @sc.scan_until(/\n/).strip
55
+ pkt << (@sc.scan_until(/\n/) || @sc.scan_until(/$/)).strip
55
56
  end
56
57
  pkt = parse_packet pkt
57
58
  packets.add pkt, type
@@ -93,6 +93,8 @@ class PacketViaDMEM
93
93
  when 0x20
94
94
  push = FAKE[:dmac] + FAKE[:smac] + FAKE[:etype_ipv4]
95
95
  [ 3, push ]
96
+ when 0x83
97
+ [ 2, [] ]
96
98
  else
97
99
  @log.warn "unknown port: magic: (%x/%x), type: %x, port: %x'" % [header.magic1, header.magic2, header.type, header.port]
98
100
  [ 0, [] ]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'packet_via_dmem'
3
- s.version = '0.0.16'
3
+ s.version = '0.0.17'
4
4
  s.licenses = %w( Apache-2.0 )
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = [ 'Saku Ytti' ]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packet_via_dmem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-16 00:00:00.000000000 Z
11
+ date: 2018-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  version: '0'
71
71
  requirements: []
72
72
  rubyforge_project: packet_via_dmem
73
- rubygems_version: 2.2.2
73
+ rubygems_version: 2.6.11
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: packet_via_dmem to pcap