Module: Pio::Dhcp::DhcpTlvOptions

Includes:
CommonOptions
Included in:
BootReplyOptions, BootRequestOptions
Defined in:
lib/pio/dhcp/dhcp_tlv_options.rb

Overview

DHCP TLV Methods.

Constant Summary

Constants included from CommonOptions

CommonOptions::BOOTPC, CommonOptions::BOOTPS, CommonOptions::BROADCAST_IP_ADDRESS, CommonOptions::BROADCAST_MAC_ADDRESS, CommonOptions::QUAD_ZERO_IP_ADDRESS

Instance Method Summary collapse

Methods included from CommonOptions

#destination_mac, #dhcp_data, #ip_address_lease_time, #ip_destination_address, #ip_source_address, #rebinding_time_value, #renewal_time_value, #requested_ip_address, #server_identifier, #source_mac, #subnet_mask, #transaction_id, #type

Instance Method Details

#client_identifier_hashObject



17
18
19
20
21
22
23
# File 'lib/pio/dhcp/dhcp_tlv_options.rb', line 17

def client_identifier_hash
  {
    tlv_type: Dhcp::CLIENT_IDENTIFIER_TLV,
    tlv_info_length: 7,
    tlv_value: source_mac
  }
end

#dhcp_server_identifier_hashObject



33
34
35
36
37
38
39
# File 'lib/pio/dhcp/dhcp_tlv_options.rb', line 33

def dhcp_server_identifier_hash
  {
    tlv_type: Dhcp::SERVER_IDENTIFIER_TLV,
    tlv_info_length: 4,
    tlv_value: server_identifier
  } if server_identifier
end

#ip_address_lease_time_hashObject



65
66
67
68
69
70
71
# File 'lib/pio/dhcp/dhcp_tlv_options.rb', line 65

def ip_address_lease_time_hash
  {
    tlv_type: Dhcp::IP_ADDRESS_LEASE_TIME_TLV,
    tlv_info_length: 4,
    tlv_value: ip_address_lease_time
  }
end

#message_type_hashObject



9
10
11
12
13
14
15
# File 'lib/pio/dhcp/dhcp_tlv_options.rb', line 9

def message_type_hash
  {
    tlv_type: Dhcp::MESSAGE_TYPE_TLV,
    tlv_info_length: 1,
    tlv_value: type
  }
end

#parameters_list_hashObject



41
42
43
44
45
46
47
# File 'lib/pio/dhcp/dhcp_tlv_options.rb', line 41

def parameters_list_hash
  {
    tlv_type: Dhcp::PARAMETERS_LIST_TLV,
    tlv_info_length: Dhcp::PARAMETER_REQUEST_LIST.length,
    tlv_value: Dhcp::PARAMETER_REQUEST_LIST
  }
end

#rebinding_time_value_hashObject



57
58
59
60
61
62
63
# File 'lib/pio/dhcp/dhcp_tlv_options.rb', line 57

def rebinding_time_value_hash
  {
    tlv_type: Dhcp::REBINDING_TIME_VALUE_TLV,
    tlv_info_length: 4,
    tlv_value: rebinding_time_value
  } if rebinding_time_value
end

#renewal_time_value_hashObject



49
50
51
52
53
54
55
# File 'lib/pio/dhcp/dhcp_tlv_options.rb', line 49

def renewal_time_value_hash
  {
    tlv_type: Dhcp::RENEWAL_TIME_VALUE_TLV,
    tlv_info_length: 4,
    tlv_value: renewal_time_value
  } if renewal_time_value
end

#requested_ip_address_hashObject



25
26
27
28
29
30
31
# File 'lib/pio/dhcp/dhcp_tlv_options.rb', line 25

def requested_ip_address_hash
  {
    tlv_type: Dhcp::REQUESTED_IP_ADDRESS_TLV,
    tlv_info_length: 4,
    tlv_value: requested_ip_address
  }
end

#subnet_mask_hashObject



73
74
75
76
77
78
79
# File 'lib/pio/dhcp/dhcp_tlv_options.rb', line 73

def subnet_mask_hash
  {
    tlv_type: Dhcp::SUBNET_MASK_TLV,
    tlv_info_length: 4,
    tlv_value: subnet_mask
  } if subnet_mask
end