Coder Social home page Coder Social logo

netmap_sys's Issues

NIOCGREGIF is invalid

The original NIOCGREGIF is defined in netmap_legacy.h as the following:

/*
 * FreeBSD uses the size value embedded in the _IOWR to determine
 * how much to copy in/out. So we need it to match the actual
 * data structure we pass. We put some spares in the structure
 * to ease compatibility with other versions
 */
#define NIOCGINFO	_IOWR('i', 145, struct nmreq) /* return IF info */
#define NIOCREGIF	_IOWR('i', 146, struct nmreq) /* interface register */
#define NIOCCONFIG	_IOWR('i',150, struct nm_ifreq) /* for ext. modules */

The Rust's NIOCREGIF is defined here:

#[cfg(target_os = "linux")]
pub const NIOCREGIF: c_ulong = 3225184658;
#[cfg(target_os = "freebsd")]
pub const NIOCREGIF: c_ulong = 3225184658;

They are different on Linux and libc::ioctl(fd, NIOCREGIF, &mut nmr as *mut nmreq) results in Operation bot supported. Valid NIOCREGIF for Linux is 3225446802, isn't it?

Release, please!

It would be great if you published current version on crates.io as it would make compiling libpnet with netmap feature enabled possible on more systems (like mine).

Include LICENSE in the crate

I'm packaging netmap_sys for Fedora. I found that the LICENSE was not included in the crate. It would be good to have the LICENSE in the crate, so that it would be distributed along with the RPM package.

error: unresolved name `netmap::nm_open`

OK, next issue. I may be too much of a rust newbie here; feel free to tell me.

My main.rs is simply:

extern crate "rust-netmap" as netmap;

fn main() {
    println!("Hello, world!");

    let n = netmap::nm_open("eth1", 0, 0, 0);
}

cargo build fails with

[lars@tux: ~/rustcore] cargo build -v
       Fresh rust-netmap v0.0.4 (https://github.com/libpnet/rust-netmap.git#ab947ee2)
   Compiling rustcore v0.0.1 (file:///mnt/home/vmhome/rustcore)
     Running `rustc src/main.rs --crate-name rustcore --crate-type bin -g --out-dir /mnt/home/vmhome/rustcore/target --emit=dep-info,link -L dependency=/mnt/home/vmhome/rustcore/target -L dependency=/mnt/home/vmhome/rustcore/target/deps --extern rust-netmap=/mnt/home/vmhome/rustcore/target/deps/librust-netmap-10a85511dfe14665.so --extern rust-netmap=/mnt/home/vmhome/rustcore/target/deps/librust-netmap-10a85511dfe14665.rlib -L native=/mnt/home/vmhome/rustcore/target/build/rust-netmap-10a85511dfe14665/out`
src/main.rs:6:10: 6:25 error: unresolved name `netmap::nm_open`
src/main.rs:6   let n = netmap::nm_open("eth1", 0, 0, 0);
                        ^~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `rustcore`.

Caused by:
  Process didn't exit successfully: `rustc src/main.rs --crate-name rustcore --crate-type bin -g --out-dir /mnt/home/vmhome/rustcore/target --emit=dep-info,link -L dependency=/mnt/home/vmhome/rustcore/target -L dependency=/mnt/home/vmhome/rustcore/target/deps --extern rust-netmap=/mnt/home/vmhome/rustcore/target/deps/librust-netmap-10a85511dfe14665.so --extern rust-netmap=/mnt/home/vmhome/rustcore/target/deps/librust-netmap-10a85511dfe14665.rlib -L native=/mnt/home/vmhome/rustcore/target/build/rust-netmap-10a85511dfe14665/out` (exit code: 101)

I do have features = ["netmap_with_libs"] in my Cargo.toml, per your README. What am I missing?

build.rs not working

I'm trying to build this on my local Linux box, and the stuff in build.rs seems to be failing.

First, I think I needed to install clang, which wasn't super-obvious. But even with that done, I still hit this error:

[lars@tux: ~/rustcore] cargo build -v
   Compiling rust-netmap v0.0.4 (https://github.com/libpnet/rust-netmap.git#ab947ee2)
     Running `rustc /tmp/git/checkouts/rust-netmap-2baeba280d3ef56f/master/src/lib.rs --crate-name rust-netmap --crate-type rlib --crate-type dylib -C prefer-dynamic -g --cfg feature="default" --cfg feature="netmap_with_libs" -C metadata=10a85511dfe14665 -C extra-filename=-10a85511dfe14665 --out-dir /mnt/home/vmhome/rustcore/target/deps --emit=dep-info,link -L dependency=/mnt/home/vmhome/rustcore/target/deps -L dependency=/mnt/home/vmhome/rustcore/target/deps -Awarnings -L native=/mnt/home/vmhome/rustcore/target/build/rust-netmap-10a85511dfe14665/out -l static=rust_netmap_user`
error: could not find native static library `rust_netmap_user`, perhaps an -L flag is missing?
Could not compile `rust-netmap`.

Caused by:
  Process didn't exit successfully: `rustc /tmp/git/checkouts/rust-netmap-2baeba280d3ef56f/master/src/lib.rs --crate-name rust-netmap --crate-type rlib --crate-type dylib -C prefer-dynamic -g --cfg feature="default" --cfg feature="netmap_with_libs" -C metadata=10a85511dfe14665 -C extra-filename=-10a85511dfe14665 --out-dir /mnt/home/vmhome/rustcore/target/deps --emit=dep-info,link -L dependency=/mnt/home/vmhome/rustcore/target/deps -L dependency=/mnt/home/vmhome/rustcore/target/deps -Awarnings -L native=/mnt/home/vmhome/rustcore/target/build/rust-netmap-10a85511dfe14665/out -l static=rust_netmap_user` (exit code: 101)

Looking at build.rs, I noticed that /usr/include/net/netmap_user.h does not exist on my netmap-enabled system, but even after making this a symlink to my netmap_user.h, I see this failure.

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.