Module: Pio::Dhcp::CommonOptions
- Included in:
- BootReplyOptions, BootRequestOptions, DhcpTlvOptions
- Defined in:
- lib/pio/dhcp/common_options.rb
Overview
DHCP Common Options.
Constant Summary collapse
- BOOTPC =
68
- BOOTPS =
67
- QUAD_ZERO_IP_ADDRESS =
IPv4Address.new(0)
- BROADCAST_MAC_ADDRESS =
Mac.new(0xffffffffffff)
- BROADCAST_IP_ADDRESS =
IPv4Address.new(0xffffffff)
Instance Method Summary collapse
- #destination_mac ⇒ Object
- #dhcp_data ⇒ Object
- #ip_address_lease_time ⇒ Object
- #ip_destination_address ⇒ Object
- #ip_source_address ⇒ Object
- #rebinding_time_value ⇒ Object
- #renewal_time_value ⇒ Object
- #requested_ip_address ⇒ Object
- #server_identifier ⇒ Object
- #source_mac ⇒ Object
- #subnet_mask ⇒ Object
- #transaction_id ⇒ Object
- #type ⇒ Object
Instance Method Details
#destination_mac ⇒ Object
23 24 25 |
# File 'lib/pio/dhcp/common_options.rb', line 23 def destination_mac Mac.new(@options[:destination_mac] || BROADCAST_MAC_ADDRESS) end |
#dhcp_data ⇒ Object
11 12 13 |
# File 'lib/pio/dhcp/common_options.rb', line 11 def dhcp_data Dhcp::DhcpField.new(dhcp_field_values) end |
#ip_address_lease_time ⇒ Object
58 59 60 |
# File 'lib/pio/dhcp/common_options.rb', line 58 def ip_address_lease_time @options[:ip_address_lease_time] end |
#ip_destination_address ⇒ Object
31 32 33 |
# File 'lib/pio/dhcp/common_options.rb', line 31 def ip_destination_address IPv4Address.new(@options[:ip_destination_address]) end |
#ip_source_address ⇒ Object
27 28 29 |
# File 'lib/pio/dhcp/common_options.rb', line 27 def ip_source_address IPv4Address.new(@options[:ip_source_address]) end |
#rebinding_time_value ⇒ Object
54 55 56 |
# File 'lib/pio/dhcp/common_options.rb', line 54 def rebinding_time_value @options[:rebinding_time_value] end |
#renewal_time_value ⇒ Object
50 51 52 |
# File 'lib/pio/dhcp/common_options.rb', line 50 def renewal_time_value @options[:renewal_time_value] end |
#requested_ip_address ⇒ Object
62 63 64 65 66 |
# File 'lib/pio/dhcp/common_options.rb', line 62 def requested_ip_address IPv4Address.new( @options[:requested_ip_address] || QUAD_ZERO_IP_ADDRESS ) end |
#server_identifier ⇒ Object
35 36 37 38 39 |
# File 'lib/pio/dhcp/common_options.rb', line 35 def server_identifier IPv4Address.new( @options[:server_identifier] || ip_source_address ) end |
#source_mac ⇒ Object
19 20 21 |
# File 'lib/pio/dhcp/common_options.rb', line 19 def source_mac Mac.new(@options[:source_mac]) end |
#subnet_mask ⇒ Object
41 42 43 44 |
# File 'lib/pio/dhcp/common_options.rb', line 41 def subnet_mask subnet = @options[:subnet_mask] IPv4Address.new(subnet) if subnet end |
#transaction_id ⇒ Object
46 47 48 |
# File 'lib/pio/dhcp/common_options.rb', line 46 def transaction_id @options[:transaction_id] end |
#type ⇒ Object
15 16 17 |
# File 'lib/pio/dhcp/common_options.rb', line 15 def type @options[:type] end |