GithubHelp home page GithubHelp logo

netlink-packet-sock-diag's People

Contributors

anisse avatar cathay4t avatar gabrik avatar george-hopkins avatar johntitor avatar little-dude avatar owtaylor avatar stbuehler avatar svart avatar wllenyj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

netlink-packet-sock-diag's Issues

`rich_nlas` feature is non-additive (and makes nla docs confusing)

I tried writing some code using the netlink-packet-sock-diag crate, using docs.rs to understand the Nla enum. According to those docs, the TcpInfo variant contains a Vec<u8>, which I took to mean that decoding isn't available for this data structure.

I was surprised when I looked at the source code and discovered that decoding was present but required a feature flag. Perhaps the docs for this enum should contain a note that decoding requires a feature flag to be enabled?

I also notice that enabling the feature flag makes incompatible changes to the enum contents, making code no longer compile. This is a non-additive feature; it would be better to follow Cargo's guidance and ensure that enabling features doesn't break the existing public API.

cargo run --example dump_ipv4?

Sorry, trying to run the example "cargo run --example dump_ipv4"

das@t:~/Downloads$ mkdir test_netlink
das@t:~/Downloads$ cd test_netlink/
das@t:~/Downloads/test_netlink$ git clone https://github.com/rust-netlink/netlink-packet-sock-diag.git
Cloning into 'netlink-packet-sock-diag'...
remote: Enumerating objects: 306, done.
remote: Counting objects: 100% (306/306), done.
remote: Compressing objects: 100% (142/142), done.
remote: Total 306 (delta 169), reused 274 (delta 147), pack-reused 0
Receiving objects: 100% (306/306), 66.00 KiB | 1.22 MiB/s, done.
Resolving deltas: 100% (169/169), done.
das@t:~/Downloads/test_netlink$ cd netlink-packet-sock-diag/
das@t:~/Downloads/test_netlink/netlink-packet-sock-diag$ cargo run --example dump_ipv4
    Updating crates.io index
  Downloaded thiserror-impl v1.0.47
  Downloaded quote v1.0.33
  Downloaded thiserror v1.0.47
  Downloaded anyhow v1.0.75
  Downloaded syn v2.0.29
  Downloaded 5 crates (347.5 KB) in 0.44s
   Compiling proc-macro2 v1.0.66
   Compiling unicode-ident v1.0.11
   Compiling anyhow v1.0.75
   Compiling paste v1.0.14
   Compiling thiserror v1.0.47
   Compiling libc v0.2.147
   Compiling byteorder v1.4.3
   Compiling log v0.4.20
   Compiling smallvec v1.11.0
   Compiling bytes v1.4.0
   Compiling bitflags v1.3.2
   Compiling lazy_static v1.4.0
   Compiling quote v1.0.33
   Compiling netlink-sys v0.8.5
   Compiling syn v2.0.29
   Compiling thiserror-impl v1.0.47
   Compiling netlink-packet-utils v0.5.2
   Compiling netlink-packet-core v0.7.0
   Compiling netlink-packet-sock-diag v0.4.2 (/home/das/Downloads/test_netlink/netlink-packet-sock-diag)
error[E0532]: expected unit struct, unit variant or constant, found tuple variant `NetlinkPayload::Done`
  --> examples/dump_ipv4.rs:65:17
   |
65 |                 NetlinkPayload::Done => {
   |                 ^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/das/.cargo/registry/src/index.crates.io-6f17d22bba15001f/netlink-packet-core-0.7.0/src/payload.rs:21:5
   |
21 |     Done(DoneMessage),
   |     ---- `NetlinkPayload::Done` defined here
   |
help: use the tuple variant pattern syntax instead
   |
65 |                 NetlinkPayload::Done(_) => {
   |                 ~~~~~~~~~~~~~~~~~~~~~~~
help: consider importing one of these items instead
   |
3  + use core::str::pattern::SearchStep::Done;
   |
3  + use std::str::pattern::SearchStep::Done;
   |
help: if you import `Done`, refer to it directly
   |
65 -                 NetlinkPayload::Done => {
65 +                 Done => {
   |

error[E0599]: no variant or associated item named `Ack` found for enum `NetlinkPayload` in the current scope
  --> examples/dump_ipv4.rs:59:56
   |
59 |                 NetlinkPayload::Noop | NetlinkPayload::Ack(_) => {}
   |                                                        ^^^ variant or associated item not found in `NetlinkPayload<_>`

Some errors have detailed explanations: E0532, E0599.
For more information about an error, try `rustc --explain E0532`.
error: could not compile `netlink-packet-sock-diag` (example "dump_ipv4") due to 2 previous errors

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.