Class PacketFu::UDPHeader
In: lib/packetfu/udp.rb
Parent: Struct.new(:udp_src, :udp_dst, :udp_len, :udp_sum, :body)

UDPHeader is a complete UDP struct, used in UDPPacket. Many Internet-critical protocols rely on UDP, such as DNS and World of Warcraft.

For more on UDP packets, see www.networksorcery.com/enp/protocol/udp.htm

Header Definition

 Int16   :udp_src
 Int16   :udp_dst
 Int16   :udp_len  Default: calculated
 Int16   :udp_sum  Default: 0. Often calculated.
 String  :body

Methods

Included Modules

StructFu

Public Class methods

Public Instance methods

Reads a string to populate the object.

Returns the object in string form.

Returns the true length of the UDP packet.

Equivalent to udp_dst

Getter for the UDP destination port.

Setter for the UDP destination port.

Getter for the length field.

Setter for the length field. Usually should be recalc()’ed instead.

Recalculates calculated fields for UDP.

Equivalent to udp_src.to_i

Getter for the UDP source port.

Setter for the UDP source port.

Getter for the checksum.

Setter for the checksum. Usually should be recalc()’ed instad.

[Validate]