Skip to content

Commit f271002

Browse files
committed
add accociated constant for dhcp magic cookie
1 parent c7d1131 commit f271002

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/proto/network/pxe.rs

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

978978
impl DhcpV4Packet {
979+
const DHCP_MAGIK: u32 = 0x63825363;
980+
979981
/// Transaction ID, a random number, used to match this boot request with the responses it generates.
980982
pub fn bootp_ident(&self) -> u32 {
981983
u32::from_be(self.bootp_ident)
@@ -991,7 +993,7 @@ impl DhcpV4Packet {
991993
DhcpV4Flags::from_bits_truncate(u16::from_be(self.bootp_flags))
992994
}
993995

994-
/// A magic cookie, should be `0x63825363`.
996+
/// A magic cookie, should be [`Self::DHCP_MAGIK`].
995997
pub fn dhcp_magik(&self) -> u32 {
996998
u32::from_be(self.dhcp_magik)
997999
}

0 commit comments

Comments
 (0)