smoltcp icon indicating copy to clipboard operation
smoltcp copied to clipboard

Creating assemblers in nostd is quite hard.

Open Dirbaio opened this issue 2 years ago • 1 comments

Currently you have to do something like this

    let mut ipv4_in1 = [0u8; 1500];
    let mut ipv4_in2 = [0u8; 1500];
    let mut ipv4_in3 = [0u8; 1500];
    let mut ipv4_in4 = [0u8; 1500];
    let mut ipv4_fragments_assemblers = [
        PacketAssembler::new(&mut ipv4_in1[..]),
        PacketAssembler::new(&mut ipv4_in2[..]),
        PacketAssembler::new(&mut ipv4_in3[..]),
        PacketAssembler::new(&mut ipv4_in4[..]),
    ];
    let mut ipv4_fragments_indexes = [None; 4];
    let ipv4_fragments_cache = FragmentsCache::new(
        &mut ipv4_fragments_assemblers[..],
        &mut ipv4_fragments_indexes[..],
    );
    buider = builder.ipv4_fragments_cache(ipv4_fragments_cache);

(unless I'm missing something?)

Dirbaio avatar Aug 06 '22 12:08 Dirbaio

That is the correct way of creating the buffers. Unfortunately this is because of Managed, and I'm not sure how to improve on that.

thvdveld avatar Aug 16 '22 09:08 thvdveld

Fixed in #726

Dirbaio avatar Jan 15 '23 23:01 Dirbaio