Class: Libnet::IPv6

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

Overview

IPv6

Class to represent a version 6 RFC 2460 Internet Protocol (IP) header.

Example

i = Libnet::IPv6.new

i.traffic_class = 0x22
i.flow_label    = 0xdbeef
i.length        = Libnet::HL_IPV6 + payload.length
i.next_header   = Libnet::IPPROTO_UDP
i.hop_limit     = 24
i.src_ip        = [
  0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
  0xcc, 0xdd, 0xee, 0xff
].pack("C*")
i.dst_ip        = "aabb:aabb:ccdd:ccdd:eeff:eeff:2233:2233"
i.payload       = "this is the message"

Public Class Methods

decode(string) -> new IPv6 object

Decode a packed IPv6 packet.

Public Instance Methods

version, version?

Get/query the IP version.

traffic_class, traffic_class=, traffic_class?

Get/set/query the traffic class.

flow_label, flow_label=, flow_label?

Get/set/query the flow label.

length, length=, length?

Get/set/query the length of the IPv6 packet minus the 40 byte IPv6 header.

next_header, next_header=, next_header?

Get/set/query the next header.

hop_limit, hop_limit=, hop_limit?

Get/set/query the hop limit.

src_ip, src_ip=, src_ip?

Get/set/query the source IPv6 address.

dst_ip, dst_ip=, dst_ip?

Get/set/query the destination IPv6 address.

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