Module: Ethernet
- Includes:
- Type
- Defined in:
- lib/ethernet.rb
Overview
++
Defined Under Namespace
Modules: Type Classes: Address, Frame, Socket
Constant Summary
Constants included from Type
Type::ETH_AARP, Type::ETH_ARP, Type::ETH_Ethertalk, Type::ETH_IEEE_802_1Q, Type::ETH_IPv4, Type::ETH_IPv6, Type::ETH_RARP
Class Method Summary collapse
Methods included from Type
Class Method Details
.packet_factory(frame, ether_type, time) ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/ethernet.rb', line 114 def self.packet_factory(frame, ether_type, time) s = frame.dup case ether_type when IPv4 ; puts "IPv4:" when IPv6 ; puts "IPv6:" when ARP ; puts "ARP:" when RARP ; puts "RARP:" else puts "Ether_type: #{ether_type}:" end puts s.unpack('H*') end |