Class: Libnet::UDP

Inherits:
Header show all
Defined in:
lib/libnet4r/header.rb

Overview

UDP

Class to represent an RFC 768 User Datagram Protocol (UDP) header.

Example

u = Libnet::UDP.new

u.src_port = 0x4321
u.dst_port = 0xabcd
u.length   = Libnet::HL_UDP + payload.length
u.checksum = 0x1111
u.payload  = payload

Public Class Methods

decode(string) -> new UDP object

Decode a packed UDP packet.

Public Instance Methods

src_port, src_port=, src_port?

Get/set/query the source port.

dst_port, dst_port=, dst_port?

Get/set/query the destination port.

length, length=, length?

Get/set/query the total length of the UDP packet.

checksum, checksum=, checksum?

Get/set/query the checksum. Set to 0 for Libnet to autofill.

payload, payload=, payload?

Get/set/query the payload.

ptag

Get the ptag value for this header object. Set by the Libnet builder method.

Constant Summary

Constants inherited from Header

Header::DEFAULT_OPTS, Header::HWADDR_RE, Header::IPADDR_RE, Header::UNIT_MULTIPLIERS

Instance Attribute Summary

Attributes inherited from Header

#ptag

Method Summary

Methods inherited from Header

assignment_filter, decode, fields, inherited, #initialize, octets_field, unsigned_field

Methods included from Helpers

#check_integer, #check_string

Constructor Details

This class inherits a constructor from Libnet::Header