Skip to content

Commit 353aab7

Browse files
committed
add accociated constant for dhcp magic cookie
1 parent 322491d commit 353aab7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/proto/network/pxe.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,9 @@ pub struct DhcpV4Packet {
976976
}
977977

978978
impl DhcpV4Packet {
979+
/// The expected value for [`Self::dhcp_magik`].
980+
pub const DHCP_MAGIK: u32 = 0x63825363;
981+
979982
/// Transaction ID, a random number, used to match this boot request with the responses it generates.
980983
pub fn bootp_ident(&self) -> u32 {
981984
u32::from_be(self.bootp_ident)
@@ -991,7 +994,7 @@ impl DhcpV4Packet {
991994
DhcpV4Flags::from_bits_truncate(u16::from_be(self.bootp_flags))
992995
}
993996

994-
/// A magic cookie, should be `0x63825363`.
997+
/// A magic cookie, should be [`Self::DHCP_MAGIK`].
995998
pub fn dhcp_magik(&self) -> u32 {
996999
u32::from_be(self.dhcp_magik)
9971000
}

0 commit comments

Comments
 (0)