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
25 26 27 |
# File 'lib/pio/dhcp/common_options.rb', line 25 def destination_mac Mac.new(@options[:destination_mac] || BROADCAST_MAC_ADDRESS) end |
#dhcp_data ⇒ Object
13 14 15 |
# File 'lib/pio/dhcp/common_options.rb', line 13 def dhcp_data Dhcp::DhcpField.new(dhcp_field_values) end |
#ip_address_lease_time ⇒ Object
60 61 62 |
# File 'lib/pio/dhcp/common_options.rb', line 60 def ip_address_lease_time @options[:ip_address_lease_time] end |
#ip_destination_address ⇒ Object
33 34 35 |
# File 'lib/pio/dhcp/common_options.rb', line 33 def ip_destination_address IPv4Address.new(@options[:ip_destination_address]) end |
#ip_source_address ⇒ Object
29 30 31 |
# File 'lib/pio/dhcp/common_options.rb', line 29 def ip_source_address IPv4Address.new(@options[:ip_source_address]) end |
#rebinding_time_value ⇒ Object
56 57 58 |
# File 'lib/pio/dhcp/common_options.rb', line 56 def rebinding_time_value @options[:rebinding_time_value] end |
#renewal_time_value ⇒ Object
52 53 54 |
# File 'lib/pio/dhcp/common_options.rb', line 52 def renewal_time_value @options[:renewal_time_value] end |
#requested_ip_address ⇒ Object
64 65 66 67 68 |
# File 'lib/pio/dhcp/common_options.rb', line 64 def requested_ip_address IPv4Address.new( @options[:requested_ip_address] || QUAD_ZERO_IP_ADDRESS ) end |
#server_identifier ⇒ Object
37 38 39 40 41 |
# File 'lib/pio/dhcp/common_options.rb', line 37 def server_identifier IPv4Address.new( @options[:server_identifier] || ip_source_address ) end |
#source_mac ⇒ Object
21 22 23 |
# File 'lib/pio/dhcp/common_options.rb', line 21 def source_mac Mac.new(@options[:source_mac]) end |
#subnet_mask ⇒ Object
43 44 45 46 |
# File 'lib/pio/dhcp/common_options.rb', line 43 def subnet_mask subnet = @options[:subnet_mask] IPv4Address.new(subnet) if subnet end |
#transaction_id ⇒ Object
48 49 50 |
# File 'lib/pio/dhcp/common_options.rb', line 48 def transaction_id @options[:transaction_id] end |
#type ⇒ Object
17 18 19 |
# File 'lib/pio/dhcp/common_options.rb', line 17 def type @options[:type] end |