libnl3

236 views
Skip to first unread message

Daniel Borkmann

unread,
Oct 18, 2012, 12:57:17 PM10/18/12
to netsn...@googlegroups.com
Hi together,

the latest version has now been ported from libnl1.1 to libnl3.
(https://github.com/gnumaniacs/netsniff-ng)

If not in your OS distribution, you can get it via
http://www.infradead.org/~tgr/libnl/ .

Cheers,

Daniel

Markus Amend

unread,
Oct 24, 2012, 9:46:21 AM10/24/12
to netsn...@googlegroups.com
Hi Daniel,

I have load http://www.infradead.org/~tgr/libnl/files/libnl-3.2.14.tar.gz
extract it and give the following commands as root:

$ ./configure
$ make
$ make install

All works fine and netsniff-ng's cmake recognize the new libnl (I haven't
delete the old libnl1). I've pulled the latest version of netsniff-ng from
git and tried to compile, but get the following errors:

[ 3%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_80211_mac_hdr.c.o
[ 6%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/xmalloc.c.o
[ 6%] Building C object netsniff-ng/CMakeFiles/netsniff-ng.dir/__/oui.c.o
[ 9%] Building C object netsniff-ng/CMakeFiles/netsniff-ng.dir/__/xio.c.o
[ 12%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/xutils.c.o
[ 12%] Building C object netsniff-ng/CMakeFiles/netsniff-ng.dir/__/bpf.c.o
[ 16%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/mac80211.c.o
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_nl_socket_xalloc’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:70: error:
implicit declaration of function ‘nl_socket_alloc’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:70: warning:
initialization makes pointer from integer without a cast
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_init’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:82: warning:
passing argument 1 of ‘genl_connect’ from incompatible pointer type
/usr/local/include/libnl3/netlink/genl/genl.h:23: note: expected ‘struct
nl_sock *’ but argument is of type ‘struct nl_sock *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:86: warning:
passing argument 1 of ‘genl_ctrl_alloc_cache’ from incompatible pointer type
/usr/local/include/libnl3/netlink/genl/ctrl.h:25: note: expected ‘struct
nl_sock *’ but argument is of type ‘struct nl_sock *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:89: error: too
many arguments to function ‘nl_geterror’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_cleanup’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:101: error:
implicit declaration of function ‘nl_socket_free’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_add_mon_if’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:121: warning:
passing argument 1 of ‘nl_send_auto_complete’ from incompatible pointer type
/usr/include/netlink/netlink.h:48: note: expected ‘struct nl_handle *’ but
argument is of type ‘struct nl_sock *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:131: warning:
passing argument 1 of ‘nl_wait_for_ack’ from incompatible pointer type
/usr/include/netlink/netlink.h:63: note: expected ‘struct nl_handle *’ but
argument is of type ‘struct nl_sock *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_del_mon_if’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:164: warning:
passing argument 1 of ‘nl_send_auto_complete’ from incompatible pointer type
/usr/include/netlink/netlink.h:48: note: expected ‘struct nl_handle *’ but
argument is of type ‘struct nl_sock *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:168: warning:
passing argument 1 of ‘nl_wait_for_ack’ from incompatible pointer type
/usr/include/netlink/netlink.h:63: note: expected ‘struct nl_handle *’ but
argument is of type ‘struct nl_sock *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: At top level:
/usr/include/netlink/object.h:58: warning: inline function ‘nl_object_priv’
declared but never defined
make[2]: *** [netsniff-ng/CMakeFiles/netsniff-ng.dir/__/mac80211.c.o] Error
1
make[1]: *** [netsniff-ng/CMakeFiles/netsniff-ng.dir/all] Error 2
make: *** [all] Error 2

Greetings



-----Ursprüngliche Nachricht-----
Von: netsn...@googlegroups.com [mailto:netsn...@googlegroups.com] Im
Auftrag von Daniel Borkmann
Gesendet: Donnerstag, 18. Oktober 2012 18:57
An: netsn...@googlegroups.com
Betreff: [netsniff-ng] libnl3
--



Daniel Borkmann

unread,
Oct 24, 2012, 10:34:02 AM10/24/12
to netsn...@googlegroups.com
On Wed, Oct 24, 2012 at 3:46 PM, Markus Amend <mar...@netsniff-ng.org> wrote:
> I have load http://www.infradead.org/~tgr/libnl/files/libnl-3.2.14.tar.gz
> extract it and give the following commands as root:
>
> $ ./configure
> $ make
> $ make install
>
> All works fine and netsniff-ng's cmake recognize the new libnl (I haven't
> delete the old libnl1). I've pulled the latest version of netsniff-ng from
> git and tried to compile, but get the following errors:

I also still have libnl1 installed on my machine, but I removed
libnl1-dev headers. Maybe that causes the problem? Can you try to
purge the libnl1-dev (but not the libnl1 library itself)?
> --
>
>

Markus Amend

unread,
Oct 24, 2012, 3:28:20 PM10/24/12
to netsn...@googlegroups.com


> On Wed, Oct 24, 2012 at 3:46 PM, Markus Amend <mar...@netsniff-ng.org> wrote:
>> I have load http://www.infradead.org/~tgr/libnl/files/libnl-3.2.14.tar.gz
>> extract it and give the following commands as root:
>>
>> $ ./configure
>> $ make
>> $ make install
>>
>> All works fine and netsniff-ng's cmake recognize the new libnl (I haven't
>> delete the old libnl1). I've pulled the latest version of netsniff-ng from
>> git and tried to compile, but get the following errors:
>
> I also still have libnl1 installed on my machine, but I removed
> libnl1-dev headers. Maybe that causes the problem? Can you try to
> purge the libnl1-dev (but not the libnl1 library itself)?

Ok, I have uninstalled libnl1-dev with the Ubuntu paketmanager, but it doesn't help.
> --
>
>

Daniel Borkmann

unread,
Oct 24, 2012, 3:41:13 PM10/24/12
to netsn...@googlegroups.com
On Wed, Oct 24, 2012 at 9:28 PM, Markus Amend <mar...@netsniff-ng.org> wrote:
>> On Wed, Oct 24, 2012 at 3:46 PM, Markus Amend <mar...@netsniff-ng.org> wrote:
>>> I have load http://www.infradead.org/~tgr/libnl/files/libnl-3.2.14.tar.gz
>>> extract it and give the following commands as root:
>>>
>>> $ ./configure
>>> $ make
>>> $ make install
>>>
>>> All works fine and netsniff-ng's cmake recognize the new libnl (I haven't
>>> delete the old libnl1). I've pulled the latest version of netsniff-ng from
>>> git and tried to compile, but get the following errors:
>>
>> I also still have libnl1 installed on my machine, but I removed
>> libnl1-dev headers. Maybe that causes the problem? Can you try to
>> purge the libnl1-dev (but not the libnl1 library itself)?
>
> Ok, I have uninstalled libnl1-dev with the Ubuntu paketmanager, but it doesn't help.

Ok, here are a few other possibilities:

* Remove and recreate the build dir, so that cmake has to create new Makefiles
* My include dir is located at /usr/include/libnl3/netlink/
* My lib is located at /usr/lib/libnl-3.so resp. /usr/lib/libnl-genl-3.so
* In case yours is not, exec the configure script with --prefix=/usr/
> --
>
>

Markus Amend

unread,
Oct 29, 2012, 11:42:49 AM10/29/12
to netsn...@googlegroups.com
Hi Daniel,

I will try it at thursday or at the weekend.

Mit freundlichen Grüßen

Markus Amend
> --
>
>

Markus Amend

unread,
Nov 1, 2012, 4:54:36 AM11/1/12
to netsn...@googlegroups.com


-----Ursprüngliche Nachricht-----
Von: netsn...@googlegroups.com [mailto:netsn...@googlegroups.com] Im
Auftrag von Markus Amend
Gesendet: Montag, 29. Oktober 2012 16:43
An: netsn...@googlegroups.com
Betreff: Re: [netsniff-ng] libnl3
Hi, without "--prefix=/usr/" the path is "usr/local/lib". I have change
this. Cmake find libnl3 in both cases (/usr/lib and /usr/local/lib, always
tried with cleaned netsniff-ng build dir).
With files located in "/usr/lib" the new error during compilation:

[ 3%] Building C object netsniff-ng/CMakeFiles/netsniff-ng.dir/__/hash.c.o
[ 6%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/dissector.c.o
[ 9%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/dissector_eth.c.o
[ 9%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/dissector_80211.c.o
[ 12%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_arp.c.o
[ 16%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ethernet.c.o
[ 16%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_icmpv4.c.o
[ 19%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_icmpv6.c.o
[ 22%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_igmp.c.o
[ 25%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ip_authentication_hdr.c.o
[ 25%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ip_esp.c.o
[ 29%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ipv4.c.o
[ 32%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ipv6.c.o
[ 32%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ipv6_dest_opts.c.o
[ 35%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ipv6_fragm.c.o
[ 38%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ipv6_hop_by_hop.c.o
[ 41%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ipv6_in_ipv4.c.o
[ 41%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ipv6_mobility_hdr.c.o
[ 45%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ipv6_no_nxt_hdr.c.o
[ 48%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_ipv6_routing.c.o
[ 48%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_none.c.o
[ 51%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_tcp.c.o
[ 54%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_udp.c.o
[ 58%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_vlan.c.o
[ 58%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_vlan_q_in_q.c.o
[ 61%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_mpls_unicast.c.o
[ 64%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/proto_80211_mac_hdr.c.o
[ 67%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/xmalloc.c.o
[ 67%] Building C object netsniff-ng/CMakeFiles/netsniff-ng.dir/__/oui.c.o
[ 70%] Building C object netsniff-ng/CMakeFiles/netsniff-ng.dir/__/xio.c.o
[ 74%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/xutils.c.o
[ 74%] Building C object netsniff-ng/CMakeFiles/netsniff-ng.dir/__/bpf.c.o
[ 77%] Building C object
netsniff-ng/CMakeFiles/netsniff-ng.dir/__/mac80211.c.o
In file included from
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:20:
/usr/include/libnl3/netlink/genl/genl.h:15:29: error: netlink/netlink.h: No
such file or directory
/usr/include/libnl3/netlink/genl/genl.h:16:25: error: netlink/msg.h: No such
file or directory
/usr/include/libnl3/netlink/genl/genl.h:17:26: error: netlink/attr.h: No
such file or directory
In file included from
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:20:
/usr/include/libnl3/netlink/genl/genl.h:27: error: expected declaration
specifiers or ‘...’ before ‘uint32_t’
/usr/include/libnl3/netlink/genl/genl.h:27: error: expected declaration
specifiers or ‘...’ before ‘uint32_t’
/usr/include/libnl3/netlink/genl/genl.h:28: error: expected declaration
specifiers or ‘...’ before ‘uint8_t’
/usr/include/libnl3/netlink/genl/genl.h:28: error: expected declaration
specifiers or ‘...’ before ‘uint8_t’
In file included from
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:21:
/usr/include/libnl3/netlink/genl/family.h:16:27: error: netlink/cache.h: No
such file or directory
In file included from
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:21:
/usr/include/libnl3/netlink/genl/family.h:31: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘genl_family_get_version’
/usr/include/libnl3/netlink/genl/family.h:32: error: expected declaration
specifiers or ‘...’ before ‘uint8_t’
/usr/include/libnl3/netlink/genl/family.h:33: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘genl_family_get_hdrsize’
/usr/include/libnl3/netlink/genl/family.h:34: error: expected declaration
specifiers or ‘...’ before ‘uint32_t’
/usr/include/libnl3/netlink/genl/family.h:35: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘genl_family_get_maxattr’
/usr/include/libnl3/netlink/genl/family.h:36: error: expected declaration
specifiers or ‘...’ before ‘uint32_t’
/usr/include/libnl3/netlink/genl/family.h:39: error: expected declaration
specifiers or ‘...’ before ‘uint32_t’
In file included from
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:22:
/usr/include/libnl3/netlink/genl/ctrl.h:17:26: error: netlink/addr.h: No
such file or directory
In file included from
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:23:
/usr/include/libnl3/netlink/msg.h:16:28: error: netlink/object.h: No such
file or directory
In file included from
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:23:
/usr/include/libnl3/netlink/msg.h:82: error: expected declaration specifiers
or ‘...’ before ‘uint32_t’
/usr/include/libnl3/netlink/msg.h:82: error: expected declaration specifiers
or ‘...’ before ‘uint32_t’
In file included from
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:24:
/usr/include/libnl3/netlink/attr.h:18:26: error: netlink/data.h: No such
file or directory
In file included from
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:24:
/usr/include/libnl3/netlink/attr.h:62: error: expected
specifier-qualifier-list before ‘uint16_t’
/usr/include/libnl3/netlink/attr.h:101: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘nla_get_u8’
/usr/include/libnl3/netlink/attr.h:102: error: expected declaration
specifiers or ‘...’ before ‘uint8_t’
/usr/include/libnl3/netlink/attr.h:103: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘nla_get_u16’
/usr/include/libnl3/netlink/attr.h:104: error: expected declaration
specifiers or ‘...’ before ‘uint16_t’
/usr/include/libnl3/netlink/attr.h:105: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘nla_get_u32’
/usr/include/libnl3/netlink/attr.h:106: error: expected declaration
specifiers or ‘...’ before ‘uint32_t’
/usr/include/libnl3/netlink/attr.h:107: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘nla_get_u64’
/usr/include/libnl3/netlink/attr.h:108: error: expected declaration
specifiers or ‘...’ before ‘uint64_t’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_nl_socket_xalloc’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:70: error:
implicit declaration of function ‘nl_socket_alloc’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:70: warning:
initialization makes pointer from integer without a cast
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_init’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:82: warning:
passing argument 1 of ‘genl_connect’ from incompatible pointer type
/usr/include/libnl3/netlink/genl/genl.h:23: note: expected ‘struct nl_sock
*’ but argument is of type ‘struct nl_sock *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:86: warning:
passing argument 1 of ‘genl_ctrl_alloc_cache’ from incompatible pointer type
/usr/include/libnl3/netlink/genl/ctrl.h:25: note: expected ‘struct nl_sock
*’ but argument is of type ‘struct nl_sock *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:86: warning:
passing argument 2 of ‘genl_ctrl_alloc_cache’ from incompatible pointer type
/usr/include/libnl3/netlink/genl/ctrl.h:25: note: expected ‘struct nl_cache
**’ but argument is of type ‘struct nl_cache **’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:89: error:
implicit declaration of function ‘nl_geterror’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:89: warning:
format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:91: warning:
passing argument 1 of ‘genl_ctrl_search_by_name’ from incompatible pointer
type
/usr/include/libnl3/netlink/genl/ctrl.h:28: note: expected ‘struct nl_cache
*’ but argument is of type ‘struct nl_cache *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_cleanup’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:100: error:
implicit declaration of function ‘nl_cache_free’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:101: error:
implicit declaration of function ‘nl_socket_free’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_add_mon_if’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:115: warning:
passing argument 1 of ‘genlmsg_put’ from incompatible pointer type
/usr/include/libnl3/netlink/genl/genl.h:27: note: expected ‘struct nl_msg *’
but argument is of type ‘struct nl_msg *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:115: error: too
many arguments to function ‘genlmsg_put’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:121: error:
implicit declaration of function ‘nl_send_auto_complete’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:131: error:
implicit declaration of function ‘nl_wait_for_ack’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c: In function
‘nl80211_del_mon_if’:
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:160: warning:
passing argument 1 of ‘genlmsg_put’ from incompatible pointer type
/usr/include/libnl3/netlink/genl/genl.h:27: note: expected ‘struct nl_msg *’
but argument is of type ‘struct nl_msg *’
/home/markus/Desktop/git_netsniff/netsniff-ng/src/mac80211.c:160: error: too
many arguments to function ‘genlmsg_put’

Markus Amend

unread,
Nov 1, 2012, 5:13:44 AM11/1/12
to netsn...@googlegroups.com
Hi,

it should be a linking problem. The header files in the netlink dir could
not find each other. If I manually set
#include <libnl3/netlink/msg.h>
#include <libnl3/netlink/attr.h>
to the top of mac80211.c the current error
(/usr/include/libnl3/netlink/genl/genl.h:16:25: error: netlink/msg.h: No
such file or directory
/usr/include/libnl3/netlink/genl/genl.h:17:26: error: netlink/attr.h: No
such file or directory In file included from) is eliminated, but than other
files are missing.

Greetings

Markus

-----Ursprüngliche Nachricht-----
Von: netsn...@googlegroups.com [mailto:netsn...@googlegroups.com] Im
Auftrag von Markus Amend
Gesendet: Donnerstag, 1. November 2012 09:55
An: netsn...@googlegroups.com
Betreff: AW: [netsniff-ng] libnl3
--



Reply all
Reply to author
Forward
0 new messages