pub fn new(sn: Sn, seed: u64, mac: Eui48Addr, hostname: Hostname<'a>) -> Self {
        let mut rand: rand::Rand = rand::Rand::new(seed);

        Self {
            sn,
            state: State::Init,
            state_timeout: None,
            timeout: 5,
            t1: 0,
            t2: 0,
            lease: 0,
            lease_monotonic_secs: 0,
            xid: rand.next_u32(),
            rand,
            mac,
            ip: Ipv4Addr::UNSPECIFIED,
            hostname,
            dns: None,
            ntp: None,
            broadcast_addr: SocketAddrV4::new(Ipv4Addr::BROADCAST, DST_PORT),
            src_port: SRC_PORT,
        }
    }
/// Create a new DHCP client storage structure.
///
/// The DHCP client can be reset by re-creating this structure.
///
/// # Example
///
/// ```
/// use rand_core::RngCore;
/// use w5500_dhcp::{
///     ll::{net::Eui48Addr, Sn},
///     Client, Hostname,
/// };
/// # let mut rng = rand_core::OsRng;
///
/// const DHCP_SN: Sn = Sn::Sn0;
/// // locally administered MAC address
/// const MAC_ADDRESS: Eui48Addr = Eui48Addr::new(0x02, 0x00, 0x11, 0x22, 0x33, 0x44);
/// const HOSTNAME: Hostname = Hostname::new_unwrapped("example");
/// let seed: u64 = rng.next_u64();
///
/// let dhcp: Client = Client::new(DHCP_SN, seed, MAC_ADDRESS, HOSTNAME);
/// ```
Create a new DHCP client storage structure.
The DHCP client can be reset by re-creating this structure.
Create a new DHCP client storage structure . The DHCP client can be reset by re - creating this structure .
pub fn new(sn: Sn, seed: u64, mac: Eui48Addr, hostname: Hostname<'a>) -> Self {
        let mut rand: rand::Rand = rand::Rand::new(seed);
        Self {
            sn,
            state: State::Init,
            state_timeout: None,
            timeout: 5,
            t1: 0,
            t2: 0,
            lease: 0,
            lease_monotonic_secs: 0,
            xid: rand.next_u32(),
            rand,
            mac,
            ip: Ipv4Addr::UNSPECIFIED,
            hostname,
            dns: None,
            ntp: None,
            broadcast_addr: SocketAddrV4::new(Ipv4Addr::BROADCAST, DST_PORT),
            src_port: SRC_PORT,
        }
    }
pub fn new ( sn : Sn , seed : u64 , mac : Eui48Addr , hostname : Hostname < ' a > ) -> Self { let mut rand : rand :: Rand = rand :: Rand :: new ( seed ) ; Self { sn , state : State :: Init , state_timeout : None , timeout : 5 , t1 : 0 , t2 : 0 , lease : 0 , lease_monotonic_secs : 0 , xid : rand . next_u32 ( ) , rand , mac , ip : Ipv4Addr :: UNSPECIFIED , hostname , dns : None , ntp : None , broadcast_addr : SocketAddrV4 :: new ( Ipv4Addr :: BROADCAST , DST_PORT ) , src_port : SRC_PORT , } }
Create a new DHCP client storage structure.
Create a new DHCP client storage structure .
sn
Sn
seed
u64
mac
Eui48Addr
hostname
Hostname<'a>
sn
Sn
seed
u64
mac
Eui48Addr
hostname
Hostname<'a>
example
```
use rand_core::RngCore;
use w5500_dhcp::{
ll::{net::Eui48Addr, Sn},
Client, Hostname,
}.
` ` ` use rand_core :: RngCore ; use w5500_dhcp :: { ll :: { net :: Eui48Addr Sn } Client Hostname } .
let mut rng = rand_core::osrng;
const DHCP_SN: Sn = Sn::Sn0;
locally administered MAC address
const MAC_ADDRESS: Eui48Addr = Eui48Addr::new(0x02, 0x00, 0x11, 0x22, 0x33, 0x44);
const HOSTNAME: Hostname = Hostname::new_unwrapped("example");
let seed: u64 = rng.next_u64().

let dhcp: Client = Client::new(DHCP_SN, seed, MAC_ADDRESS, HOSTNAME);
```
const DHCP_SN : Sn = Sn :: Sn0 ; locally administered MAC address const MAC_ADDRESS : Eui48Addr = Eui48Addr :: new ( 0x02 0x00 0x11 0x22 0x33 0x44 ) ; const HOSTNAME : Hostname = Hostname :: new_unwrapped ( " example " ) ; let seed : u64 = rng . next_u64 () . let dhcp : Client = Client :: new ( DHCP_SN seed MAC_ADDRESS HOSTNAME ) ; ` ` `