fn new(device: &EthernetDevice) -> IcmpPacketGenerator {
            let bcast       = MacAddr::new(0xff, 0xff, 0xff, 0xff, 0xff, 0xff);
            let mask: u32   = raw::utils::ipv4addr_to_u32(&device.netmask);
            let addr: u32   = raw::utils::ipv4addr_to_u32(&device.ip_addr);
            let mut current = addr & mask;
            let last        = current | !mask;
            
            current += 1;
            
            IcmpPacketGenerator {
                device:  device.clone(),
                bcast:   bcast,
                current: current,
                last:    last,
                buffer:  WriteBuffer::new(0)
            }
        }
/// Create a new packet generator.
Create a new packet generator.
Create a new packet generator .
fn new(device: &EthernetDevice) -> IcmpPacketGenerator {
            let bcast       = MacAddr::new(0xff, 0xff, 0xff, 0xff, 0xff, 0xff);
            let mask: u32   = raw::utils::ipv4addr_to_u32(&device.netmask);
            let addr: u32   = raw::utils::ipv4addr_to_u32(&device.ip_addr);
            let mut current = addr & mask;
            let last        = current | !mask;
            current += 1;
            IcmpPacketGenerator {
                device:  device.clone(),
                bcast:   bcast,
                current: current,
                last:    last,
                buffer:  WriteBuffer::new(0)
            }
        }
fn new ( device : & EthernetDevice ) -> IcmpPacketGenerator { let bcast = MacAddr :: new ( 0xff , 0xff , 0xff , 0xff , 0xff , 0xff ) ; let mask : u32 = raw :: utils :: ipv4addr_to_u32 ( & device . netmask ) ; let addr : u32 = raw :: utils :: ipv4addr_to_u32 ( & device . ip_addr ) ; let mut current = addr & mask ; let last = current | ! mask ; current += 1 ; IcmpPacketGenerator { device : device . clone ( ) , bcast : bcast , current : current , last : last , buffer : WriteBuffer :: new ( 0 ) } }
Create a new packet generator.
Create a new packet generator .
device
&EthernetDevice
device
&EthernetDevice