Skip to content

Commit 4bc28ad

Browse files
committed
Added PXE support
1 parent c8141bb commit 4bc28ad

File tree

4 files changed

+518
-9
lines changed

4 files changed

+518
-9
lines changed

src/iface/interface.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ let iface = InterfaceBuilder::new(device)
310310
#[derive(Debug, PartialEq)]
311311
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
312312
#[cfg(feature = "medium-ethernet")]
313+
#[allow(clippy::large_enum_variant)]
313314
enum EthernetPacket<'a> {
314315
#[cfg(feature = "proto-ipv4")]
315316
Arp(ArpRepr),

src/socket/dhcpv4.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ impl Dhcpv4Socket {
405405
let mut dhcp_repr = DhcpRepr {
406406
message_type: DhcpMessageType::Discover,
407407
transaction_id: next_transaction_id,
408+
secs: 0,
409+
sname: None,
410+
boot_file: None,
408411
client_hardware_address: ethernet_addr,
409412
client_ip: Ipv4Address::UNSPECIFIED,
410413
your_ip: Ipv4Address::UNSPECIFIED,
@@ -420,6 +423,11 @@ impl Dhcpv4Socket {
420423
max_size: Some((cx.caps.ip_mtu() - MAX_IPV4_HEADER_LEN - UDP_HEADER_LEN) as u16),
421424
lease_duration: None,
422425
dns_servers: None,
426+
time_offset: None,
427+
client_arch_list: None,
428+
client_interface_id: None,
429+
client_machine_id: None,
430+
vendor_class_id: None,
423431
};
424432

425433
let udp_repr = UdpRepr {
@@ -735,6 +743,9 @@ mod test {
735743
const DHCP_DEFAULT: DhcpRepr = DhcpRepr {
736744
message_type: DhcpMessageType::Unknown(99),
737745
transaction_id: TXID,
746+
secs: 0,
747+
sname: None,
748+
boot_file: None,
738749
client_hardware_address: MY_MAC,
739750
client_ip: Ipv4Address::UNSPECIFIED,
740751
your_ip: Ipv4Address::UNSPECIFIED,
@@ -750,6 +761,11 @@ mod test {
750761
dns_servers: None,
751762
max_size: None,
752763
lease_duration: None,
764+
time_offset: None,
765+
client_arch_list: None,
766+
client_interface_id: None,
767+
client_machine_id: None,
768+
vendor_class_id: None,
753769
};
754770

755771
const DHCP_DISCOVER: DhcpRepr = DhcpRepr {

0 commit comments

Comments
 (0)