Coder Social home page Coder Social logo

scalpel's People

Contributors

aadilshabier avatar csking101 avatar gabhijit avatar hgupta12 avatar jnanan avatar siddharth178 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

scalpel's Issues

Error in building `scalpel` for `web` target

Building scalpel with the command wasm-pack build --target web throws error.

Command Output

[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
Compiling scalpel v0.4.0 (/home/harshit/code/scalpel)
error: feature "wasm" is required for "wasm32" targets.
--> src/lib.rs:45:1
|
45 | compile_error!("feature "wasm" is required for "wasm32" targets.");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0433]: failed to resolve: use of undeclared crate or module wasm_bindgen
--> src/lib.rs:87:5
|
87 | use wasm_bindgen::prelude::*;
| ^^^^^^^^^^^^ use of undeclared crate or module wasm_bindgen

error[E0432]: unresolved imports crate::Layer, crate::Packet, crate::ENCAP_TYPE_ETH, crate::Layer, crate::Layer, crate::Layer, crate::Packet, crate::ENCAP_TYPE_LINUX_SLL, crate::Layer, crate::Packet, crate::ENCAP_TYPE_LINUX_SLL2, crate::Layer, crate::Layer, crate::Layer, crate::Layer, crate::Layer, crate::Layer, crate::Layer, crate::Layer, crate::Layer, crate::Layer, crate::Layer
--> src/layers/ethernet/mod.rs:13:13
|
13 | use crate::{Layer, Packet, ENCAP_TYPE_ETH};
| ^^^^^ ^^^^^^ ^^^^^^^^^^^^^^
|
::: src/layers/ipv4.rs:12:5
|
12 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/ipv6.rs:12:5
|
12 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/linux_sll.rs:8:13
|
8 | use crate::{Layer, Packet, ENCAP_TYPE_LINUX_SLL};
| ^^^^^ ^^^^^^ ^^^^^^^^^^^^^^^^^^^^
|
::: src/layers/linux_sll2.rs:8:13
|
8 | use crate::{Layer, Packet, ENCAP_TYPE_LINUX_SLL2};
| ^^^^^ ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
|
::: src/layers/tcp.rs:11:5
|
11 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/udp.rs:10:5
|
10 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/dns.rs:11:5
|
11 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/icmp.rs:10:5
|
10 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/icmpv6.rs:10:5
|
10 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/arp.rs:10:5
|
10 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/sctp.rs:12:5
|
12 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/m3ua.rs:10:5
|
10 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/mpls.rs:10:5
|
10 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/layers/vxlan.rs:7:5
|
7 | use crate::Layer;
| ^^^^^^^^^^^^
|
::: src/packet.rs:13:5
|
13 | use crate::Layer;
| ^^^^^^^^^^^^

error: cannot find attribute wasm_bindgen in this scope
--> src/lib.rs:90:3
|
90 | #[wasm_bindgen]
| ^^^^^^^^^^^^

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try rustc --explain E0432.
error: could not compile scalpel (lib) due to 4 previous errors
Error: Compiling your crate to WebAssembly failed
Caused by: Compiling your crate to WebAssembly failed
Caused by: failed to execute cargo build: exited with exit status: 101
full command: cd "/home/harshit/code/scalpel" && "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"

System Info

OS: Ubuntu 20.04
CPU Architecture: x86_64
Rust version: 1.75.0

Error during dissection of DNS packets

During dissection of DNS packets, it appears that the packet is alright and data is also available but we get TooShort Error. Below is the dump of the Error and the data

Err: TooShort { required: 20, available: 9, data: "07080000038400093a800001518000002904d0000000000000" }, data: "000000010006001a9adead05000008004500008eee3240003611927701010101c0a8010b0035c441007a2f68f60c81a300010000000100010a6964656e7469747964620000010001000006000100014e51004001610c726f6f742d73657276657273036e657400056e73746c640c766572697369676e2d67727303636f6d007896689d000007080000038400093a800001518000002904d0000000000000"

simplify managing the features in the crate

Currently the crate supports three features python-bindings, logging and (soon) wasm. Some of these features are mutually incompatible and hence mutually exclusive as well. Handling these features has resulted in code with a large number of #[cfg(...)] types statement.

This can be perhaps simplified, or the feature level code is kept limited to a couple of files and some simple intuitive macros.

Support for TCP / UDP Parsing

We should support TCP/UDP Parsing. This should broadly support first level of support required for basic protocol parsing.

Supporting IP Options in the packet dissection

Currently we have a support for IP header parsing without IP options. It will be a good idea to support IP options. It's a good idea to support parsing the following options at-least -

  1. Record Route
  2. MTU Probe
  3. MTU Reply

Implementation of support for DHCPv4 dissector

Implement a dissection for DHCPv4. Also, the DHCP Options as specified in RFC 2131 for both DHCP Clients and Servers to be supported.

Also, during implementing - add Rust Doc comments to the code,so it is easier to reference the sections of RFC.

Support for `std` and `no_std` environments

Right now most of the scalpel code works assuming std environment. However, there is no real reason why the same code cannot be adopted for no_std environment. At least following needs to be kept in mind

  1. Use of hashbrown instead of std::collections::HashMap for no-std environments
  2. Use of lock_api in place of std::sync::
  3. Defining crate::Error compatible with no_std environment

For now for ease, let's simply restructure the use statements such that parts can be std and no_std and then add those one by one.

Support vor Linux SLL captures

If the capture is done using the any device, the packet format is not ethernet but Linux SLL, which has a different header and therefore does not parse correctly.

It would be great if scalpel would also support the Linux SLL format to parse packets captured via the any device.

Basic IPv6 handling implementation

Similar to IPv4 implementation, We should be handling parsing of IPv6 headers. For now support for IP Options can be ignored. But a basic Parsing ability needs to be implemented.

Defining our own types for IP Addresses

We already have types for Ethernet MAC Address (MACAddress) and Ether Type (EtherType) defined which work well for us for Debug and Display printing and any other custom handling. Along the similar lines, we should be defining -

  1. IPv4 and IPv6 address types.
  2. IP Options types for different IP options

Create a new `RELEASE-NOTES.md` file

Someone should go through the git log and try to create release notes of the existing releases, so that this file can be updated with new release.

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.