trying to get some simple code working using version 3 of the library

John Davis davisjf at gmail.com
Wed Feb 15 13:33:20 PST 2017


Hello

I found some code from the mailing list archives and I am trying to modify
it to get additional functionality working.
Specificially I am trying to get the mac address of my desired network
interface and the number of bytes transmitted.

The code I am working on is here:

https://gist.github.com/netskink/6f712a9a0a2beccc8504fdf625825762

I have two problems.
1) how to modify the code so that the qdisc structure is associated with my
specified network interface?
2) how to get the mac address of the interface?  When I try to execute
nl_addr_info() I get a failure even though the previous routines worked.

Here is the output of the code pasted above:

davis at smeagol:~/progs/netlink$
./stats
name is enp6s0
Total # of packets transmitted is 0
nl_addr_info failed with -11: Address family not supported

-- 
John F. Davis
6 Kandes Court
Durham, NC 27713
919-888-8358
Public Profilehttps://www.linkedin.com/in/netskink

独树一帜



More information about the libnl mailing list