pio 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/Gemfile +3 -2
- data/Guardfile +4 -1
- data/README.md +44 -6
- data/Rakefile +5 -23
- data/lib/pio.rb +15 -0
- data/lib/pio/arp.rb +31 -0
- data/lib/pio/arp/frame.rb +38 -0
- data/lib/pio/arp/message.rb +66 -0
- data/lib/pio/arp/reply.rb +55 -0
- data/lib/pio/arp/request.rb +55 -0
- data/lib/pio/ip.rb +90 -0
- data/lib/pio/lldp.rb +74 -12
- data/lib/pio/lldp/frame.rb +53 -4
- data/lib/pio/lldp/management-address-value.rb +7 -1
- data/lib/pio/lldp/optional-tlv.rb +3 -1
- data/lib/pio/lldp/organizationally-specific-value.rb +23 -0
- data/lib/pio/mac.rb +156 -0
- data/lib/pio/type/ethernet-header.rb +16 -0
- data/lib/pio/type/ip-address.rb +28 -0
- data/lib/pio/{lldp → type}/mac-address.rb +4 -3
- data/lib/pio/version.rb +1 -19
- data/pio.org +518 -0
- data/pio.org_archive +389 -0
- data/spec/pio/arp/reply_spec.rb +150 -0
- data/spec/pio/arp/request_spec.rb +131 -0
- data/spec/pio/arp_spec.rb +136 -0
- data/spec/pio/ip_spec.rb +38 -0
- data/spec/pio/lldp_spec.rb +195 -38
- data/spec/pio/mac_spec.rb +82 -0
- data/spec/spec_helper.rb +9 -0
- metadata +27 -17
- data/spec/pio/lldp/chassis-id-tlv_spec.rb +0 -27
- data/spec/pio/lldp/end-of-lldpdu-value_spec.rb +0 -20
- data/spec/pio/lldp/frame_spec.rb +0 -82
- data/spec/pio/lldp/mac-address_spec.rb +0 -20
- data/spec/pio/lldp/optional-tlv_spec.rb +0 -81
- data/spec/pio/lldp/port-id-tlv_spec.rb +0 -27
- data/spec/pio/lldp/ttl-tlv_spec.rb +0 -26
@@ -1,26 +0,0 @@
|
|
1
|
-
require File.join( File.dirname( __FILE__ ), "..", "..", "spec_helper" )
|
2
|
-
require "pio/lldp/ttl-tlv"
|
3
|
-
|
4
|
-
|
5
|
-
module Pio
|
6
|
-
class Lldp
|
7
|
-
describe TtlTlv do
|
8
|
-
subject { TtlTlv.read( data.pack( "C*" ) ) }
|
9
|
-
|
10
|
-
context "parsing a raw data" do
|
11
|
-
let( :data ) { [ 0x06, 0x02, 0x00, 0x78 ] }
|
12
|
-
|
13
|
-
its( :tlv_type ) { should eq 3 }
|
14
|
-
its( :tlv_info_length ) { should eq 2 }
|
15
|
-
its( :ttl ) { should eq data[ -2..-1 ].pack( "C*" ) }
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
### Local variables:
|
23
|
-
### mode: Ruby
|
24
|
-
### coding: utf-8-unix
|
25
|
-
### indent-tabs-mode: nil
|
26
|
-
### End:
|