Tuntap::IpPacket
Inherits Struct / Value / Object
Provides easy access to the IP header and its payload.
Constructors
new(frame : Bytes, has_pi : Bool = true, has_ethernet : Bool = false)
Encapsulates frame as a IPv4 packet with or without the PI header
(has_pi). has_ethernet commonly refers to the source being a
TUN (= false) or TAP (= true) device.
Instance methods
[](*args, **options)
Source[](*args, **options, &)
Sourceethernet
Returns the ethernet header. If this packet does not have it, the returned header will contain junk data.
ipv4
Returns the IPv4 header from the packet. No check is done if the packet really contains IPv4 data.
pi
Returns the PI header. If this packet does not have it, the returned header will contain junk data.
size(*args, **options)
Sourcesize(*args, **options, &)
Source