Class: Pio::Dhcp
- Inherits:
-
Object
- Object
- Pio::Dhcp
- Defined in:
- lib/pio/dhcp.rb,
lib/pio/dhcp.rb,
lib/pio/dhcp/ack.rb,
lib/pio/dhcp/frame.rb,
lib/pio/dhcp/offer.rb,
lib/pio/dhcp/message.rb,
lib/pio/dhcp/request.rb,
lib/pio/dhcp/discover.rb,
lib/pio/dhcp/client_id.rb,
lib/pio/dhcp/csum_util.rb,
lib/pio/dhcp/boot_reply.rb,
lib/pio/dhcp/dhcp_field.rb,
lib/pio/dhcp/field_util.rb,
lib/pio/dhcp/boot_request.rb,
lib/pio/dhcp/optional_tlv.rb,
lib/pio/dhcp/common_options.rb,
lib/pio/dhcp/parameter_list.rb,
lib/pio/dhcp/dhcp_tlv_options.rb,
lib/pio/dhcp/boot_reply_options.rb,
lib/pio/dhcp/boot_request_options.rb
Overview
Dhcp parser and generator.
Defined Under Namespace
Modules: CommonOptions, CsumUtil, DhcpTlvOptions, FieldUtil Classes: Ack, BootReply, BootReplyOptions, BootRequest, BootRequestOptions, ClientId, DhcpField, Discover, Frame, Message, Offer, OptionalTlv, ParameterList, Request
Constant Summary collapse
- MESSAGE_TYPE_TLV =
53
- SERVER_IDENTIFIER_TLV =
54
- CLIENT_IDENTIFIER_TLV =
61
- RENEWAL_TIME_VALUE_TLV =
58
- REBINDING_TIME_VALUE_TLV =
59
- REQUESTED_IP_ADDRESS_TLV =
50
- PARAMETERS_LIST_TLV =
55
- IP_ADDRESS_LEASE_TIME_TLV =
51
- SUBNET_MASK_TLV =
1
- ROUTER_TLV =
3
- NTP_SERVERS_TLV =
42
- DNS_TLV =
6
- END_OF_TLV =
255
- PARAMETER_REQUEST_LIST =
[ SUBNET_MASK_TLV, ROUTER_TLV, DNS_TLV, NTP_SERVERS_TLV ]
- MESSAGE_TYPE =
{ Discover::TYPE => Discover, Offer::TYPE => Offer, Request::TYPE => Request, Ack::TYPE => Ack }
Class Method Summary collapse
Class Method Details
.read(raw_data) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/pio/dhcp.rb', line 48 def self.read(raw_data) begin frame = const_get('Frame').read(raw_data) rescue raise Pio::ParseError, $ERROR_INFO. end const_get('MESSAGE_TYPE')[frame.].create_from(frame) end |