Making the equivalent of iproute2's "bridge mdb|fdb" commands using libnl

Laine Stump laine at redhat.com
Wed Oct 1 17:41:24 PDT 2014


In libvirt, I need to be able to get and set the unicast and multicast
tables of an interface from within libvirt. Since libvirt uses libnl, it
would be most consistent to use libnl to do this; iproute2's "bridge
mdb|fdb" command does this, so it could be used as an example, but that
is all written to directly use netlink (with help from libnetlink.c in
the iproute2 source). I see from that source that the  RTM_GETNEIGH and
RTM_GETMDB messages are used to request these tables, but I've been
unable to find any examples of using RTM_GETNEIGH or RTM_GETMDB with
libnl. Looking at neigh.c in libnl, it seems the information of
RTM_GETNEIGH might be stored in a cache by libnl, but I'm not even sure
that's the same information that bridge fdb is retrieving, and looking
for parallel use of RTM_GETMDB, I see nothing in libnl.

So can anyone unconfuse me? Is there a reasonable example of retrieving
these tables using libnl anywhere?



More information about the libnl mailing list