Class: Pio::Dhcp::Frame
Overview
Constant Summary
collapse
- ETHER_TYPE_IP =
0x0800
- IP_PROTOCOL_UDP =
17
20
8
- DHCP_OPTION_FIELD_LENGTH =
60
Instance Method Summary
collapse
ethernet_header
ipv4_header
udp_header
Methods included from FieldUtil
#bootp_flags, #client_identifier, #client_ip_address, #client_mac_address, #hops, #hw_addr_len, #hw_addr_type, #ip_address_lease_time, #message_type, #next_server_ip_address, #parameters_list, #rebinding_time_value, #relay_agent_ip_address, #renewal_time_value, #requested_ip_address, #seconds, #server_identifier, #subnet_mask, #transaction_id, #your_ip_address
Instance Method Details
#ip_len ⇒ Object
42
43
44
|
# File 'lib/pio/dhcp/frame.rb', line 42
def ip_len
+ udp_len
end
|
#ip_sum ⇒ Object
34
35
36
|
# File 'lib/pio/dhcp/frame.rb', line 34
def ip_sum
~((ip_csum & 0xffff) + (ip_csum >> 16)) & 0xffff
end
|
#to_binary ⇒ Object
50
51
52
|
# File 'lib/pio/dhcp/frame.rb', line 50
def to_binary
to_binary_s + trail_data
end
|
#udp_len ⇒ Object
46
47
48
|
# File 'lib/pio/dhcp/frame.rb', line 46
def udp_len
+ dhcp_len
end
|
#udp_sum ⇒ Object
38
39
40
|
# File 'lib/pio/dhcp/frame.rb', line 38
def udp_sum
~((udp_csum & 0xffff) + (udp_csum >> 16)) & 0xffff
end
|