getifaddrs

From: Kurt Van Dijck <hidden>
Date: 2011-01-20 12:57:13

Hello,

I am in the process of adding j1939 support in the linux kernel.
J1939 is a protocol on CAN, with addressing support. Therefore,
I'm tweaking in iproute2 as well, to extend the
$ ip address
output.

I have in kernel space
	rtnl_register(PF_CAN, RTM_GETADDR, NULL, j1939_nl_dump_ifaddr);
This 'j1939_nl_dump_ifaddr' does not dump 'struct sockaddr *', but
an ad-hoc format.

After I get a basic setup working, I tried calling 'getifaddrs'.
If I do 'getifaddrs', this callback is called, but
I do not understand how glibc (or any other libc) is capable of transforming
the rtnetlink address info into proper 'struct sockaddr_can *'.

I looked at AF_INET & AF_DECnet, and it seems I'm not supposed to
dump a 'struct sockaddr_can' over rtnetlink. Is 'getifaddrs' then doomed
to only work for INET addresses only?

Any idea's?

Thanks,
Kurt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help