smoltcp
smoltcp copied to clipboard
Creating assemblers in nostd is quite hard.
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?)
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.
Fixed in #726