Class: PacketGen::Header::DHCPv6
- Defined in:
- lib/packetgen/header/dhcpv6.rb,
lib/packetgen/header/dhcpv6.rb,
lib/packetgen/header/dhcpv6/duid.rb,
lib/packetgen/header/dhcpv6/relay.rb,
lib/packetgen/header/dhcpv6/option.rb,
lib/packetgen/header/dhcpv6/options.rb more...
Overview
Dynamic Host Configuration Protocol for IPv6, RFC 3315
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| msg-type | transaction-id |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. options .
. (variable) .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A DHCPv6 header is made of:
-
a #msg_type field (
BinStruct::Int8Enum
), -
a #transaction_id field (
BinStruct::Int24
), -
and an #options field (Options). This field is a container for Option objects.
Defined Under Namespace
Classes: ClientID, DUID, DUID_EN, DUID_LL, DUID_LLT, ElapsedTime, IAAddr, IANA, IATA, ORO, Option, Options, Preference, RapidCommit, Relay, RelayMessage, ServerID, ServerUnicast, StatusCode
Constant Summary collapse
- UDP_CLIENT_PORT =
DHCPv6 UDP client port
546
- UDP_SERVER_PORT =
DHCPv6 UDP client port
547
- MESSAGE_TYPES =
DHCPv6 message types
{ 'SOLLICIT' => 1, 'ADVERTISE' => 2, 'REQUEST' => 3, 'CONFIRM' => 4, 'RENEW' => 5, 'REBIND' => 6, 'REPLY' => 7, 'RELEASE' => 8, 'DECLINE' => 9, 'RECONFIGURE' => 10, 'INFORMATION-REQUEST' => 11 }.freeze
Instance Attribute Summary collapse
-
#data ⇒ String
variable length option data.
-
#msg_type ⇒ Integer
8-bit message type.
-
#options ⇒ DHCPv6::Options
Set of Options.
-
#transaction_id ⇒ Integer
24-bit transaction ID.
Instance Method Summary collapse
-
#human_msg_type ⇒ String
Get human readable message type.
-
#read(str) ⇒ DHCPv6, DHCPv6::Relay
Populate object from string.
Methods inherited from Base
bind, calculate_and_set_length, #header_id, inherited, #initialize, #ip_header, #ll_header
Methods included from PacketGen::Headerable
#added_to_packet, included, #method_name, #packet, #packet=, #parse?, #protocol_name, #to_s
Constructor Details
This class inherits a constructor from PacketGen::Header::Base
Instance Attribute Details
permalink #data ⇒ String
variable length option data.
|
# File 'lib/packetgen/header/dhcpv6/option.rb', line 279
|
permalink #msg_type ⇒ Integer
8-bit message type
73 |
# File 'lib/packetgen/header/dhcpv6.rb', line 73 define_attr :msg_type, BinStruct::Int8Enum, enum: MESSAGE_TYPES |
permalink #options ⇒ DHCPv6::Options
Set of Options
81 |
# File 'lib/packetgen/header/dhcpv6.rb', line 81 define_attr :options, DHCPv6::Options |
permalink #transaction_id ⇒ Integer
24-bit transaction ID
77 |
# File 'lib/packetgen/header/dhcpv6.rb', line 77 define_attr :transaction_id, BinStruct::Int24 |
Instance Method Details
permalink #human_msg_type ⇒ String
Get human readable message type
99 100 101 |
# File 'lib/packetgen/header/dhcpv6.rb', line 99 def human_msg_type self[:msg_type].to_human end |
permalink #read(str) ⇒ DHCPv6, DHCPv6::Relay
Populate object from string
86 87 88 89 90 91 92 93 94 95 |
# File 'lib/packetgen/header/dhcpv6.rb', line 86 def read(str) msg_type = BinStruct::Int8.new.read(str) case msg_type when 12, 13 DHCPv6::Relay.new.read(str) else super end end |