* Re: of ethernet names (was [PATCH] Futex Asynchronous
@ 2002-06-09 18:22 Dr. David Alan Gilbert
2002-06-09 18:33 ` Linus Torvalds
0 siblings, 1 reply; 16+ messages in thread
From: Dr. David Alan Gilbert @ 2002-06-09 18:22 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Kai Henningsen, linux-kernel
Interface)
Reply-To:
In-Reply-To: <Pine.LNX.4.44.0206091056550.13459-100000@home.transmeta.com>
X-Chocolate: 70 percent or better cocoa solids preferably
X-Operating-System: Linux/2.4.18 (i686)
X-Uptime: 19:19:16 up 1 day, 6:46, 5 users, load average: 2.00, 2.00, 2.00
* Linus Torvalds (torvalds@transmeta.com) wrote:
> On 9 Jun 2002, Kai Henningsen wrote:
> >
> > However, I don't think that's all that important. What I'd rather see is
> > making the network devices into namespace nodes. The situation of eth0 and
> > friends, from a Unix perspective, is utterly unnatural.
>
> But what would you _do_ with them? What would be the advantage as compared
> to the current situation?
Personally I would do away with ifconfig and replace it with
cat in and out of device nodes; ifconfig seems to suffer about having to
know about every protocol on every device type and the kernel has to
provide interfaces for it that only it uses.
Dave
---------------- Have a happy GNU millennium! ----------------------
/ Dr. David Alan Gilbert | Running GNU/Linux on Alpha,68K| Happy \
\ gro.gilbert @ treblig.org | MIPS,x86,ARM, SPARC and HP-PA | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-09 18:22 Dr. David Alan Gilbert
@ 2002-06-09 18:33 ` Linus Torvalds
2002-06-10 20:53 ` Kai Henningsen
0 siblings, 1 reply; 16+ messages in thread
From: Linus Torvalds @ 2002-06-09 18:33 UTC (permalink / raw)
To: Dr. David Alan Gilbert; +Cc: Kai Henningsen, linux-kernel
On Sun, 9 Jun 2002, Dr. David Alan Gilbert wrote:
>
> Personally I would do away with ifconfig and replace it with
> cat in and out of device nodes; ifconfig seems to suffer about having to
> know about every protocol on every device type and the kernel has to
> provide interfaces for it that only it uses.
Well, the kernel would have to provide the same interfaces for "cat" if
you did it that way, and it would probably take up more space and cause
more kernel bloat.
And we'd still have to have the old interfaces for backwards compatibility
for ifconfig.
Is the "magic ioctl" approach ugly? Sure. But it's fairly well contained
to just one program (ifconfig), and everybody else just uses that. I think
it's less horrible than the alternatives right now.
Linus
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-09 18:33 ` Linus Torvalds
@ 2002-06-10 20:53 ` Kai Henningsen
2002-06-10 21:44 ` Jeff Garzik
0 siblings, 1 reply; 16+ messages in thread
From: Kai Henningsen @ 2002-06-10 20:53 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
torvalds@transmeta.com (Linus Torvalds) wrote on 09.06.02 in <Pine.LNX.4.44.0206091130490.13751-100000@home.transmeta.com>:
> Is the "magic ioctl" approach ugly? Sure. But it's fairly well contained
> to just one program (ifconfig), and everybody else just uses that. I think
> it's less horrible than the alternatives right now.
If it *were* all contained in ifconfig, you'd be right, but that isn't
even remotely true.
There are a *huge* number of programs that know about network interfaces.
Apart from ifconfig, we have route, routed, iptables, ip, bootloads of
admin scripts for device configuration, for firewalling, pppd anmd
scripts, arp, dhcpd, portsentry, and I haven't even really scratched the
surface here.
Sure, in the old times, when you could get Unix(tm) with or without the
"networking option" for extra money, there wasn't much. But that has
dramatically changed in these Internet times.
MfG Kai
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-10 20:53 ` Kai Henningsen
@ 2002-06-10 21:44 ` Jeff Garzik
2002-06-10 22:52 ` Brad Hards
2002-06-10 23:46 ` David Ford
0 siblings, 2 replies; 16+ messages in thread
From: Jeff Garzik @ 2002-06-10 21:44 UTC (permalink / raw)
To: Kai Henningsen; +Cc: torvalds, linux-kernel
Actually, networking is moving in the direction described --
yes, as Linus points out, we will need the magic ioctl stuff for back
compat.
But the main way to communicate with a net device is netlink, already a
chardev. ifconfig actually should be updated to use netlink.
Jeff
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-10 21:44 ` Jeff Garzik
@ 2002-06-10 22:52 ` Brad Hards
2002-06-10 23:02 ` Jeff Garzik
2002-06-10 23:46 ` David Ford
1 sibling, 1 reply; 16+ messages in thread
From: Brad Hards @ 2002-06-10 22:52 UTC (permalink / raw)
To: Jeff Garzik, Kai Henningsen; +Cc: torvalds, linux-kernel
On Tue, 11 Jun 2002 07:44, Jeff Garzik wrote:
> Actually, networking is moving in the direction described --
> yes, as Linus points out, we will need the magic ioctl stuff for back
> compat.
> But the main way to communicate with a net device is netlink, already a
> chardev. ifconfig actually should be updated to use netlink.
Is there any documentation on the netlink API, beyond UTSL(iproute)?
Reference would be good, but a tutorial would be ideal.
Brad
--
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-10 22:52 ` Brad Hards
@ 2002-06-10 23:02 ` Jeff Garzik
0 siblings, 0 replies; 16+ messages in thread
From: Jeff Garzik @ 2002-06-10 23:02 UTC (permalink / raw)
To: Brad Hards; +Cc: Kai Henningsen, torvalds, linux-kernel
Brad Hards wrote:
> On Tue, 11 Jun 2002 07:44, Jeff Garzik wrote:
>
>>Actually, networking is moving in the direction described --
>>yes, as Linus points out, we will need the magic ioctl stuff for back
>>compat.
>>But the main way to communicate with a net device is netlink, already a
>>chardev. ifconfig actually should be updated to use netlink.
>
> Is there any documentation on the netlink API, beyond UTSL(iproute)?
> Reference would be good, but a tutorial would be ideal.
I don't know of any... Alexey/DaveM/Jamal are probably the best people
to ask.
Jeff
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
[not found] <0C01A29FBAE24448A792F5C68F5EA47D29DD32@nasdaq.ms.ensim.com>
@ 2002-06-10 23:20 ` Paul Menage
2002-06-10 23:32 ` Brad Hards
0 siblings, 1 reply; 16+ messages in thread
From: Paul Menage @ 2002-06-10 23:20 UTC (permalink / raw)
To: Brad Hards; +Cc: linux-kernel, pmenage
In article <0C01A29FBAE24448A792F5C68F5EA47D29DD32@nasdaq.ms.ensim.com>,
you write:
>Is there any documentation on the netlink API, beyond UTSL(iproute)?
>Reference would be good, but a tutorial would be ideal.
The man pages for netlink(3), netlink(7), rtnetlink(3) and rtnetlink(7)
give a basic reference.
Paul
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-10 23:20 ` of ethernet names (was [PATCH] Futex Asynchronous Paul Menage
@ 2002-06-10 23:32 ` Brad Hards
2002-06-10 23:36 ` Randy.Dunlap
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Brad Hards @ 2002-06-10 23:32 UTC (permalink / raw)
To: Paul Menage; +Cc: linux-kernel, pmenage
On Tue, 11 Jun 2002 09:20, Paul Menage wrote:
> In article <0C01A29FBAE24448A792F5C68F5EA47D29DD32@nasdaq.ms.ensim.com>,
>
> you write:
> >Is there any documentation on the netlink API, beyond UTSL(iproute)?
> >Reference would be good, but a tutorial would be ideal.
>
> The man pages for netlink(3), netlink(7), rtnetlink(3) and rtnetlink(7)
> give a basic reference.
Unfortunately my brain is not on the same level and scope as Alexey or davem.
I simply don't grok those pages. I also note caveats about incompleteness, and
recommendation to use libnetlink, which is also not documented much.
I sometimes hack on zcip (see ftp://ftp.kernel.org/pub/software/network/zcip
for an out of date version), and it could really use some netlink-ification.
But I can't even follow enough of iproute (or zebra, which also uses netlink,
AFAICT) to figure out how to do basic stuff like a list of configured
networking devices, or set the default route.
Brad
--
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-10 23:32 ` Brad Hards
@ 2002-06-10 23:36 ` Randy.Dunlap
2002-06-11 0:11 ` Brad Hards
2002-06-11 0:06 ` netlink documentation (was: of ethernet names) Paul Menage
2002-06-11 2:25 ` of ethernet names (was [PATCH] Futex Asynchronous Andi Kleen
2 siblings, 1 reply; 16+ messages in thread
From: Randy.Dunlap @ 2002-06-10 23:36 UTC (permalink / raw)
To: Brad Hards; +Cc: Paul Menage, linux-kernel
On Tue, 11 Jun 2002, Brad Hards wrote:
| On Tue, 11 Jun 2002 09:20, Paul Menage wrote:
| > In article <0C01A29FBAE24448A792F5C68F5EA47D29DD32@nasdaq.ms.ensim.com>,
| >
| > you write:
| > >Is there any documentation on the netlink API, beyond UTSL(iproute)?
| > >Reference would be good, but a tutorial would be ideal.
| >
| > The man pages for netlink(3), netlink(7), rtnetlink(3) and rtnetlink(7)
| > give a basic reference.
| Unfortunately my brain is not on the same level and scope as Alexey or davem.
|
| I simply don't grok those pages. I also note caveats about incompleteness, and
| recommendation to use libnetlink, which is also not documented much.
Hi Brad,
There was an announcement earlier today of some networking
documentation. I think that it's still in its early stages, though.
>From the 'netdev' list:
Hi,
I am working on a doc on "Networking Subsystem" in the Linux kernel.
This
is part of the "Linux Kernel documentation project" (www.lkdp.tk).
Chapter 2 of this doc is almost complete. I was hoping for some feedback
on this doc. Its available at
www.corewars.org/~radical/lkdp
Only Chapter 2 has been started as of now, its nearing completion.
I am looking for feedback on the contents, the general feel of the book,
flow.. etc. Any kind of feedback actually.
Thank you
-Anks
--
~Randy
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-10 21:44 ` Jeff Garzik
2002-06-10 22:52 ` Brad Hards
@ 2002-06-10 23:46 ` David Ford
1 sibling, 0 replies; 16+ messages in thread
From: David Ford @ 2002-06-10 23:46 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Kai Henningsen, torvalds, linux-kernel
ifconfig is "so yesterday" as it is, ip is incredibly more capable. I
would gently push ifconfig into the dungeons of time.
-d
Jeff Garzik wrote:
> Actually, networking is moving in the direction described --
> yes, as Linus points out, we will need the magic ioctl stuff for back
> compat.
> But the main way to communicate with a net device is netlink, already
> a chardev. ifconfig actually should be updated to use netlink.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: netlink documentation (was: of ethernet names)
2002-06-10 23:32 ` Brad Hards
2002-06-10 23:36 ` Randy.Dunlap
@ 2002-06-11 0:06 ` Paul Menage
2002-06-11 0:16 ` Brad Hards
2002-06-11 2:25 ` of ethernet names (was [PATCH] Futex Asynchronous Andi Kleen
2 siblings, 1 reply; 16+ messages in thread
From: Paul Menage @ 2002-06-11 0:06 UTC (permalink / raw)
To: Brad Hards; +Cc: Paul Menage, linux-kernel
>But I can't even follow enough of iproute (or zebra, which also uses netlink,
>AFAICT) to figure out how to do basic stuff like a list of configured
>networking devices, or set the default route.
E.g. to get the list of devices (untested, lacking error checking, etc),
use something like:
struct {
struct nlmsghdr hdr;
struct ifinfomsg info;
} msg;
struct sockaddr_nl addr;
/* Create and bind the netlink socket */
netlink_sk = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
memset(&addr, 0, sizeof(addr));
addr.nl_family = AF_NETLINK;
addr.nl_pid = getpid();
addr.nl_groups = RTMGRP_IPV4_IFADDR;
bind(netlink_sk, (struct sockaddr *)&addr, sizeof(addr)));
/* Build the netlink request */
memset(&msg, 0, sizeof(msg));
msg.hdr.nlmsg_len = sizeof(msg);
msg.hdr.nlmsg_type = RTM_GETLINK;
msg.hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_MATCH;
msg.hdr.nlmsg_pid = getpid();
msg.hdr.nlmsg_seq = 0;
msg.info.ifi_family = AF_UNSPEC;
msg.info.ifi_type = 0;
msg.info.ifi_index = 0;
msg.info.ifi_change = -1;
/* Send the message */
send(netlink_sk, &msg, msg.hdr.nlmsg_len, 0);
/* Loop, as we might get replies spread over several packets */
while((bytes = recv(netlink_sk, replybuf, sizeof(replybuf), 0))) {
struct nlmsghdr *hdr = (struct nlmsghdr *)replybuf;
if(hdr->nlmsg_type == NLMSG_DONE) {
break;
}
/* Loop over the messages in this packet */
while(bytes) {
int len = hdr->nlmsg_len;
struct ifinfomsg *info = NLMSG_DATA(hdr);
struct rtattr *rta = IFLA_RTA(info);
len -= NLMSG_LENGTH(sizeof(*info));
/* Loop over the attributes in this message */
while(RTA_OK(rta, len)) {
switch(rta->rta_type) {
case IFLA_IFNAME:
printf("Found device %s - %u\n",
RTA_DATA(rta), info->ifi_index);
break;
}
rta = RTA_NEXT(rta, len);
}
bytes -= hdr->nlmsg_len;
((void *)hdr) += hdr->nlmsg_len;
}
}
Paul
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-10 23:36 ` Randy.Dunlap
@ 2002-06-11 0:11 ` Brad Hards
0 siblings, 0 replies; 16+ messages in thread
From: Brad Hards @ 2002-06-11 0:11 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: linux-kernel
On Tue, 11 Jun 2002 09:36, Randy.Dunlap wrote:
> On Tue, 11 Jun 2002, Brad Hards wrote:
> | On Tue, 11 Jun 2002 09:20, Paul Menage wrote:
> | > In article
> | > <0C01A29FBAE24448A792F5C68F5EA47D29DD32@nasdaq.ms.ensim.com>,
> | >
> | > you write:
> | > >Is there any documentation on the netlink API, beyond UTSL(iproute)?
> | > >Reference would be good, but a tutorial would be ideal.
> | >
> | > The man pages for netlink(3), netlink(7), rtnetlink(3) and rtnetlink(7)
> | > give a basic reference.
> |
> | Unfortunately my brain is not on the same level and scope as Alexey or
> | davem.
> |
> | I simply don't grok those pages. I also note caveats about
> | incompleteness, and recommendation to use libnetlink, which is also not
> | documented much.
>
> Hi Brad,
>
> There was an announcement earlier today of some networking
> documentation. I think that it's still in its early stages, though.
Very early, from my review :)
> From the 'netdev' list:
>
> Hi,
>
> I am working on a doc on "Networking Subsystem" in the Linux kernel.
> This
> is part of the "Linux Kernel documentation project" (www.lkdp.tk).
And this is the wrong focus (for me). I need documentation from the userspace
view. The documentation I need shouldn't try to explain how the kernel works,
except as needed to understand what to do in userspace. My concept is
something like the tutorial I am working on for Linux HID programming
(explaination of the various interfaces and options - see
http://www.frogmouth.net/hid-doco/linux-hid.html for an early draft).
Not to suggest we shouldn't document the kernel mechanics - this is important
too.
But kernel programmers need to remember that user space programmers will take
the path of least resistance when trying to interact with the kernel. Good
documentation and easy-to-copy examples beats a slightly more powerful API
(where slightly depends on being able to accomplish task in both APIs, even
if it gets ugly) every time. If you want people to switch over to your new
API/ABI, its got to be easy.
--
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: netlink documentation (was: of ethernet names)
2002-06-11 0:06 ` netlink documentation (was: of ethernet names) Paul Menage
@ 2002-06-11 0:16 ` Brad Hards
2002-06-11 0:40 ` Paul Menage
0 siblings, 1 reply; 16+ messages in thread
From: Brad Hards @ 2002-06-11 0:16 UTC (permalink / raw)
To: Paul Menage; +Cc: Paul Menage, linux-kernel
On Tue, 11 Jun 2002 10:06, Paul Menage wrote:
> >But I can't even follow enough of iproute (or zebra, which also uses
> > netlink, AFAICT) to figure out how to do basic stuff like a list of
> > configured networking devices, or set the default route.
>
> E.g. to get the list of devices (untested, lacking error checking, etc),
> use something like:
Bingo! I think I see what is happening, just by inspection. Beverage of choice
when we meet up!
Now, how did you get this? Just familarity with the API built up over time,
pure zen, or copied from some other app?
A couple of days of playing with this, I might even be able to write the
tutorial myself :)
Brad
--
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: netlink documentation (was: of ethernet names)
2002-06-11 0:16 ` Brad Hards
@ 2002-06-11 0:40 ` Paul Menage
0 siblings, 0 replies; 16+ messages in thread
From: Paul Menage @ 2002-06-11 0:40 UTC (permalink / raw)
To: Brad Hards; +Cc: Paul Menage, linux-kernel
>Now, how did you get this? Just familarity with the API built up over time,
>pure zen, or copied from some other app?
A combination of the man pages, the iproute source, and the kernel
source. It's all pretty straightforward once you get a working skeleton.
Paul
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-10 23:32 ` Brad Hards
2002-06-10 23:36 ` Randy.Dunlap
2002-06-11 0:06 ` netlink documentation (was: of ethernet names) Paul Menage
@ 2002-06-11 2:25 ` Andi Kleen
2002-06-11 2:34 ` Brad Hards
2 siblings, 1 reply; 16+ messages in thread
From: Andi Kleen @ 2002-06-11 2:25 UTC (permalink / raw)
To: Brad Hards; +Cc: linux-kernel
Brad Hards <bhards@bigpond.net.au> writes:
> I simply don't grok those pages. I also note caveats about incompleteness, and
> recommendation to use libnetlink, which is also not documented much.
I'm sorry you don't like my manpages.
I also wrote some manpages on libnetlink, but for some reason they were never
merged in the main distribution so you can only find them in the SuSE rpm
or at http://www.firstfloor.org/~andi/man/libnetlink.3.gz (source)
or http://www.firstfloor.org/~andi/man/libnetlink.3.txt (formatted manpage)
Jamal Hadi wrote a ietf draft on netlink. I don't know if it's publicly
available (if yes probably somewhere on ftp.ietf.org) it describes quite
a lot of basic concepts in netlink/rtnetlink although in a bit foreign
to linux terminology.
I also did a presentation on netlink and related topics at previous to
last year's Ottawa Linux symposium which may be also helpful. The slides
are at http://www.firstfloor.org/~andi/ols/OLSpres.htm
-Andi
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: of ethernet names (was [PATCH] Futex Asynchronous
2002-06-11 2:25 ` of ethernet names (was [PATCH] Futex Asynchronous Andi Kleen
@ 2002-06-11 2:34 ` Brad Hards
0 siblings, 0 replies; 16+ messages in thread
From: Brad Hards @ 2002-06-11 2:34 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-kernel
On Tue, 11 Jun 2002 12:25, Andi Kleen wrote:
> Brad Hards <bhards@bigpond.net.au> writes:
> > I simply don't grok those pages. I also note caveats about
> > incompleteness, and recommendation to use libnetlink, which is also not
> > documented much.
>
> I'm sorry you don't like my manpages.
Make no mistake. I do like them. I am relying on them now. I just need more
explanation and examples.
> I also wrote some manpages on libnetlink, but for some reason they were
> never merged in the main distribution so you can only find them in the SuSE
> rpm or at http://www.firstfloor.org/~andi/man/libnetlink.3.gz (source) or
> http://www.firstfloor.org/~andi/man/libnetlink.3.txt (formatted manpage)
Thanks.
> Jamal Hadi wrote a ietf draft on netlink. I don't know if it's publicly
> available (if yes probably somewhere on ftp.ietf.org) it describes quite
> a lot of basic concepts in netlink/rtnetlink although in a bit foreign
> to linux terminology.
Thanks again. Found it at
ftp://ftp.isi.edu/in-notes/search.ietf.org/internet-drafts/draft-ietf-forces-netlink-03.txt
> I also did a presentation on netlink and related topics at previous to
> last year's Ottawa Linux symposium which may be also helpful. The slides
> are at http://www.firstfloor.org/~andi/ols/OLSpres.htm
Its all coming together. Thanks again.
--
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2002-06-11 2:37 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <0C01A29FBAE24448A792F5C68F5EA47D29DD32@nasdaq.ms.ensim.com>
2002-06-10 23:20 ` of ethernet names (was [PATCH] Futex Asynchronous Paul Menage
2002-06-10 23:32 ` Brad Hards
2002-06-10 23:36 ` Randy.Dunlap
2002-06-11 0:11 ` Brad Hards
2002-06-11 0:06 ` netlink documentation (was: of ethernet names) Paul Menage
2002-06-11 0:16 ` Brad Hards
2002-06-11 0:40 ` Paul Menage
2002-06-11 2:25 ` of ethernet names (was [PATCH] Futex Asynchronous Andi Kleen
2002-06-11 2:34 ` Brad Hards
2002-06-09 18:22 Dr. David Alan Gilbert
2002-06-09 18:33 ` Linus Torvalds
2002-06-10 20:53 ` Kai Henningsen
2002-06-10 21:44 ` Jeff Garzik
2002-06-10 22:52 ` Brad Hards
2002-06-10 23:02 ` Jeff Garzik
2002-06-10 23:46 ` David Ford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox