Skip to content

Commit

Permalink
Added PXE support
Browse files Browse the repository at this point in the history
  • Loading branch information
Qubasa committed Oct 26, 2021
1 parent c8141bb commit e41c8ec
Show file tree
Hide file tree
Showing 3 changed files with 499 additions and 4 deletions.
14 changes: 14 additions & 0 deletions src/socket/dhcpv4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ impl Dhcpv4Socket {
let mut dhcp_repr = DhcpRepr {
message_type: DhcpMessageType::Discover,
transaction_id: next_transaction_id,
sname: None,
boot_file: None,
client_hardware_address: ethernet_addr,
client_ip: Ipv4Address::UNSPECIFIED,
your_ip: Ipv4Address::UNSPECIFIED,
Expand All @@ -420,6 +422,11 @@ impl Dhcpv4Socket {
max_size: Some((cx.caps.ip_mtu() - MAX_IPV4_HEADER_LEN - UDP_HEADER_LEN) as u16),
lease_duration: None,
dns_servers: None,
time_offset: None,
client_arch_list: None,
client_interface_id: None,
client_machine_id: None,
vendor_class_id: None,
};

let udp_repr = UdpRepr {
Expand Down Expand Up @@ -735,6 +742,8 @@ mod test {
const DHCP_DEFAULT: DhcpRepr = DhcpRepr {
message_type: DhcpMessageType::Unknown(99),
transaction_id: TXID,
sname: None,
boot_file: None,
client_hardware_address: MY_MAC,
client_ip: Ipv4Address::UNSPECIFIED,
your_ip: Ipv4Address::UNSPECIFIED,
Expand All @@ -750,6 +759,11 @@ mod test {
dns_servers: None,
max_size: None,
lease_duration: None,
time_offset: None,
client_arch_list: None,
client_interface_id: None,
client_machine_id: None,
vendor_class_id: None,
};

const DHCP_DISCOVER: DhcpRepr = DhcpRepr {
Expand Down

0 comments on commit e41c8ec

Please sign in to comment.