Giter Site home page Giter Site logo

Header/Packet Equality about libpnet HOT 3 OPEN

libpnet avatar libpnet commented on May 20, 2024
Header/Packet Equality

from libpnet.

Comments (3)

mattlknight avatar mattlknight commented on May 20, 2024

This is an interesting question. I think something that may help answer this question, is laying out a few scenarios of why you would want to compare two packets or two headers for equality.

If we are talking about tracing a conversation across multiple hops, then selected parts of the headers would be the way to go. If we are trying to see if a packet has been altered, I would think the entire packet start-to-finish would need to be perfect match, including CRC if available.

Since there are several scenarios with different goals for equality comparison, would it make since to expose methods that offer these variations in comparisons? Maybe through traits?

from libpnet.

pvinci avatar pvinci commented on May 20, 2024

Until the dissector matures, I would suggest that equality be defined as a comparison of a vector of slices.
Case 1 would be self[..] == other[..]
Case 2 would be self[..14] == other[..14]
Case 3 would be vec! (self[13..14], self[15..16]) == vec! (other[13..14], other[15..16])

Where is the ip header, for example? The location is dependent on the previous layers. Is it from an untagged packet, a tagged packet, a q-in-q packet, a gre packet, ipip? Is the first ip header of self being compared to the first or second ip header of other?

Is it proper to simply compare two structs, or should that be delegated to a dissector that can properly determine layers?

from libpnet.

infosechoudini avatar infosechoudini commented on May 20, 2024

I think the dissectors themselves should determine the layers. There are instances tho, where a layer later in the dissector chain needs acces to a ealier layer.

from libpnet.

Related Issues (20)

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.