dns-parser icon indicating copy to clipboard operation
dns-parser copied to clipboard

Make it suitable for editing and writing packets

Open vi opened this issue 6 years ago • 0 comments

Not tested Only briefly tested for one application; allocation-intensive.

Note sure if it belongs to "dns-parser" project, may probably be as a separate crate.

May help employing proptest/QuickCheck way of doing fuzz test for dns-parser.

Intended use style:

    let p : Packet;
    let mut pp : PacketBuf = p.deep_clone();
    // edit pp
    let mut buf2 = Vec::with_capacity(1024);
    let mut c = std::io::Cursor::new(&mut buf2);
    pp.write_to(c)?;
    s.send_to(&buf2, cla)?;

Resolves #40.

vi avatar Dec 09 '18 19:12 vi