15

I am looking at the Connection Manager (ConnMan) source code, which is a tool for Linux(-like) systems to manage networks. One of the (undocumented) source files has the vague naming rtnl.c. Does anybody know, what is meant with RTNL? Googling for it was not very effective. Every site that really is connected to networks and RTNL seems to be written by and for people who already know what it means.

Because in one answer there is some discussion about some different ConnMan sources, I am using the one available from:

git://git.kernel.org/pub/scm/network/connman/connman.git

pevik
  • 4,523
  • 3
  • 33
  • 44
erikbstack
  • 12,878
  • 21
  • 81
  • 115
  • 1
    It's a collection of utility functions for [libnl](http://www.infradead.org/~tgr/libnl/) – fvu Jul 16 '12 at 15:18
  • I know it means "rt net lock" ... and I think r is route so maybe routing table net lock? maybe just RouTe(ing) Net Lock? not sure really... does it happen to say in that source file? – Kasapo Jul 16 '12 at 15:19
  • 3
    I believe RTNL means "Routing Netlink". – Eitan T Jul 16 '12 at 15:20
  • Yep, especially [Routing Netlink](http://www.kernel.org/doc/man-pages/online/pages/man7/rtnetlink.7.html) seems [to match](https://forum.openwrt.org/viewtopic.php?pid=132841#p132841) somehow. – erikbstack Jul 16 '12 at 15:29

1 Answers1

10

If you look at the source it says it's for "Routing Netlink". The netlink manpage says " Netlink is used to transfer information between kernel and userspace processes."

The source for rtnl.c is only like 50 lines and it seems pretty obvious from reading it what it's for...

Rick Mangi
  • 3,761
  • 1
  • 14
  • 17
  • 1
    It's the first time I read C, it's the first time I read Kernel code and it's the first time I read how networks are configured. So for me nothing is obvious, and you read probably another file then I do. In my rtnl.c VIM doesn't find any `/routing.netlink/i` in any of the 1676 lines. – erikbstack Jul 16 '12 at 15:26
  • 3
    @erikb: I'd think you'd want to mess with some simpler examples before you dive right into established networking code. The people who look at that stuff typically already know what they're doing, and i'd wager some percentage of those are *still* confused half the time. :) Why bother looking at the code if you can't figure out what it does, anyway? – cHao Jul 16 '12 at 15:33
  • Ah, that is a different rtnl.c, I just looked at the one for ConnMan, it's still just a facade for working with netlink, setting up and managing routes. – Rick Mangi Jul 16 '12 at 15:33
  • @cHao nice idea, just my boss has a different opinion. :) – erikbstack Jul 16 '12 at 15:38
  • 1
    Ouch... your boss should send you to a c class then :) – Rick Mangi Jul 16 '12 at 15:41
  • @RickMangi I added the repository from where I take my sources: git://git.kernel.org/pub/scm/network/connman/connman.git maybe we are using different sources? – erikbstack Jul 16 '12 at 15:44
  • 1
    I agree with cHao, if you're expected to understand this source without knowing anything about C or kernel programming you're going to be completely lost. – Rick Mangi Jul 16 '12 at 16:18