Git Product home page Git Product logo

packet_crafter's People

Contributors

coldfireworks avatar dns2utf8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

packet_crafter's Issues

ICMP checksum

Hey @coldFireworks, I've bump into this crate with intention to create a simple ping program.
And with a simple framework ~20 lines of code I decided to try to send a echo request where the packet is build in power of this crate. And then I found out that when we change the playground to not standart I it's not working (at least for me) :).

I piled a packet creation to the internals of this https://docs.rs/ping/0.2.0/ping/index.html library and it was fine.

I started investigation according this issue by comparing the buffers. At once I found out that the checksum is different. Then I get the internals of checksum out and made a compares with internals of the foregoing library. As I can declare the function makes its money.

The issue is in related ti calculation of checksum from its origin.

As I see we should calculate the checksum not only on header but in awareness of playground too wiki

When I did this experiment the buffers were equal.

I would create a PR if the changes haven't been going to hurt the core of the library abstractions I suppose.

Thanks.

PS: I am just a regular guy for sure not an expert (So I might am wrong somewhere). I decided to left my observations just in case :).

Example:

ICMP echo request with the playground filled with 1.

The expectation is based on remote servers responses (google.com, rust-lang.org, ...). When we use one from expected section we get response in other way not.

    let mut p = Packet::new(vec![Protocol::ICMP]);
    p.add_header(headers::IcmpHeader::new(8, 0, 0, 0));
    p.extend_payload(vec![1; 24]);

    let buf = p.into_vec();
    println!("{:?}", buf);

the result [8, 0, 247, 255, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
expected [8, 0, 235, 243, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

Sending raw IPv6 frames

Hi @coldFireworks

I am building a small utility where I send ICMP RA frames.
It looks like there is no Ipv6Header struct and headers::IpHeader is v4 only?

Is this correct?

Cheers,
Stefan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.