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 7064337
Show file tree
Hide file tree
Showing 4 changed files with 507 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --tests --examples -- -D warnings
args: --tests --examples -- -D warnings -A clippy::large-enum-variant
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
Loading

0 comments on commit 7064337

Please sign in to comment.