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
44
45
46
|
# File 'lib/pio/dhcp/frame.rb', line 44
def ip_len
IP_HEADER_LENGTH + udp_len
end
|
#ip_sum ⇒ Object
36
37
38
|
# File 'lib/pio/dhcp/frame.rb', line 36
def ip_sum
~((ip_csum & 0xffff) + (ip_csum >> 16)) & 0xffff
end
|
#to_binary ⇒ Object
52
53
54
|
# File 'lib/pio/dhcp/frame.rb', line 52
def to_binary
to_binary_s + trail_data
end
|
#udp_len ⇒ Object
48
49
50
|
# File 'lib/pio/dhcp/frame.rb', line 48
def udp_len
UDP_HEADER_LENGTH + dhcp_len
end
|
#udp_sum ⇒ Object
40
41
42
|
# File 'lib/pio/dhcp/frame.rb', line 40
def udp_sum
~((udp_csum & 0xffff) + (udp_csum >> 16)) & 0xffff
end
|