### Home Classes Methods

### In Files

- lib/packetfu/protos/ipv6.rb

### Parent

PacketFu::Packet

### Methods

- ::can_parse?
- ::new
- #peek
- #read

### Included Modules

- PacketFu::EthHeaderMixin
- PacketFu::IPv6HeaderMixin

### Files

- .document
- README.rdoc

### Class/Module Index

Quicksearch

- PacketFu
- PacketFu::ARPHeader
- PacketFu::ARPHeaderMixin
- PacketFu::ARPPacket
- PacketFu::AddrIpv6
- PacketFu::Capture
- PacketFu::Config
- PacketFu::EthHeader
- PacketFu::EthHeaderMixin
- PacketFu::EthMac
- PacketFu::EthNic
- PacketFu::EthOui
- PacketFu::EthPacket
- PacketFu::HSRPHeader
- PacketFu::HSRPHeaderMixin
- PacketFu::HSRPPacket
- PacketFu::ICMPHeader
- PacketFu::ICMPHeaderMixin
- PacketFu::ICMPPacket
- PacketFu::IPHeader
- PacketFu::IPHeaderMixin
- PacketFu::IPPacket
- PacketFu::IPv6Header
- PacketFu::IPv6HeaderMixin
- PacketFu::IPv6Packet
- PacketFu::Inject
- PacketFu::InvalidHeader
- PacketFu::InvalidPacket
- PacketFu::LLDPHeader
- PacketFu::LLDPHeaderMixin
- PacketFu::LLDPPacket
- PacketFu::Octets
- PacketFu::Packet
- PacketFu::PcapFile
- PacketFu::PcapHeader
- PacketFu::PcapPacket
- PacketFu::PcapPackets
- PacketFu::Read
- PacketFu::TCPHeader
- PacketFu::TCPHeaderMixin
- PacketFu::TCPPacket
- PacketFu::TcpEcn
- PacketFu::TcpFlags
- PacketFu::TcpHlen
- PacketFu::TcpOption
- PacketFu::TcpOption::ECHO
- PacketFu::TcpOption::ECHOREPLY
- PacketFu::TcpOption::EOL
- PacketFu::TcpOption::MSS
- PacketFu::TcpOption::NOP
- PacketFu::TcpOption::SACK
- PacketFu::TcpOption::SACKOK
- PacketFu::TcpOption::TS
- PacketFu::TcpOption::WS
- PacketFu::TcpOptions
- PacketFu::TcpReserved
- PacketFu::Timestamp
- PacketFu::UDPHeader
- PacketFu::UDPHeaderMixin
- PacketFu::UDPPacket
- PacketFu::Utils
- PacketFu::Write
- StructFu
- StructFu::Int
- StructFu::Int16
- StructFu::Int16be
- StructFu::Int16le
- StructFu::Int32
- StructFu::Int32be
- StructFu::Int32le
- StructFu::Int8
- StructFu::IntString
- StructFu::String
- Struct

No matching classes.

# PacketFu::IPv6Packet

IPv6Packet is used to construct IPv6 Packets. They contain an EthHeader and an IPv6Header, and in the distant, unknowable future, will take interesting IPv6ish payloads.

This mostly complete, but not very useful. It's intended primarily as an example protocol.

## Parameters

    :eth
      A pre-generated EthHeader object.
    :ip
      A pre-generated IPHeader object.
    :flavor
      TODO: Sets the "flavor" of the IPv6 packet. No idea what this will look like, haven't done much IPv6 fingerprinting.
    :config
      A hash of return address details, often the output of Utils.whoami?

### Attributes

eth_header[RW]
ipv6_header[RW]

### Public Class Methods

can_parse?(str) click to toggle source

    # File lib/packetfu/protos/ipv6.rb, line 29
    def self.can_parse?(str)
            return false unless EthPacket.can_parse? str
            return false unless str.size >= 54
            return false unless str[12,2] == "\x86\xdd"
            true
    end

new(args={}) click to toggle source

    # File lib/packetfu/protos/ipv6.rb, line 43
    def initialize(args={})
            @eth_header = (args[:eth] || EthHeader.new)
            @ipv6_header = (args[:ipv6]  || IPv6Header.new)
            @eth_header.eth_proto = 0x86dd
            @eth_header.body=@ipv6_header
            @headers = [@eth_header, @ipv6_header]
            super
    end

### Public Instance Methods

peek(args={}) click to toggle source

Peek provides summary data on packet contents.

    # File lib/packetfu/protos/ipv6.rb, line 53
    def peek(args={})
            peek_data = ["6  "]
            peek_data << "%-5d" % self.to_s.size
            peek_data << "%-31s" % self.ipv6_saddr
            peek_data << "-> "
            peek_data << "%-31s" % self.ipv6_daddr
            peek_data << "  N:"
            peek_data << self.ipv6_next.to_s(16)
            peek_data.join
    end

read(str=nil,args={}) click to toggle source

    # File lib/packetfu/protos/ipv6.rb, line 36
    def read(str=nil,args={})
            raise "Cannot parse `#{str}'" unless self.class.can_parse?(str)
            @eth_header.read(str)
            super(args)
            self
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.