fn process_ipv4_fragment<D: EventDispatcher>(
        ctx: &mut Ctx<D>,
        device: DeviceId,
        fragment_id: u16,
        fragment_offset: u8,
        fragment_count: u8,
    ) {
        assert!(fragment_offset < fragment_count);

        let m_flag = fragment_offset < (fragment_count - 1);

        let mut builder = get_ipv4_builder();
        builder.id(fragment_id);
        builder.fragment_offset(fragment_offset as u16);
        builder.mf_flag(m_flag);
        let mut body: Vec<u8> = Vec::new();
        body.extend(fragment_offset * 8..fragment_offset * 8 + 8);
        let buffer =
            Buf::new(body, ..).encapsulate(builder).serialize_vec_outer().unwrap().into_inner();
        receive_ipv4_packet(ctx, device, FrameDestination::Unicast, buffer);
    }
/// Generate and 'receive' an IPv4 fragment packet.
///
/// `fragment_offset` is the fragment offset. `fragment_count` is the number
/// of fragments for a packet. The generated packet will have a body of size
/// 8 bytes.
Generate and 'receive' an IPv4 fragment packet.
`fragment_offset` is the fragment offset. `fragment_count` is the number
of fragments for a packet. The generated packet will have a body of size
8 bytes.
Generate and ' receive ' an IPv4 fragment packet . ` fragment_offset ` is the fragment offset . ` fragment_count ` is the number of fragments for a packet . The generated packet will have a body of size 8 bytes .
fn process_ipv4_fragment<D: EventDispatcher>(
        ctx: &mut Ctx<D>,
        device: DeviceId,
        fragment_id: u16,
        fragment_offset: u8,
        fragment_count: u8,
    ) {
        assert!(fragment_offset < fragment_count);
        let m_flag = fragment_offset < (fragment_count - 1);
        let mut builder = get_ipv4_builder();
        builder.id(fragment_id);
        builder.fragment_offset(fragment_offset as u16);
        builder.mf_flag(m_flag);
        let mut body: Vec<u8> = Vec::new();
        body.extend(fragment_offset * 8..fragment_offset * 8 + 8);
        let buffer =
            Buf::new(body, ..).encapsulate(builder).serialize_vec_outer().unwrap().into_inner();
        receive_ipv4_packet(ctx, device, FrameDestination::Unicast, buffer);
    }
fn process_ipv4_fragment < D : EventDispatcher > ( ctx : & mut Ctx < D > , device : DeviceId , fragment_id : u16 , fragment_offset : u8 , fragment_count : u8 , ) { assert ! ( fragment_offset fragment_count ) ; let m_flag = fragment_offset < ( fragment_count - 1 ) ; let mut builder = get_ipv4_builder ( ) ; builder . id ( fragment_id ) ; builder . fragment_offset ( fragment_offset as u16 ) ; builder . mf_flag ( m_flag ) ; let mut body : Vec < u8 > = Vec :: new ( ) ; body . extend ( fragment_offset * 8 .. fragment_offset * 8 + 8 ) ; let buffer = Buf :: new ( body , .. ) . encapsulate ( builder ) . serialize_vec_outer ( ) . unwrap ( ) . into_inner ( ) ; receive_ipv4_packet ( ctx , device , FrameDestination :: Unicast , buffer ) ; }
Generate and 'receive' an IPv4 fragment packet.
Generate and ' receive ' an IPv4 fragment packet .
ctx
&mut Ctx<D>
device
DeviceId
fragment_id
u16
fragment_offset
u8
fragment_count
u8
ctx
&mut Ctx<D>
device
DeviceId
fragment_id
u16
fragment_offset
u8
fragment_count
u8