2004-11-23 21:48:13

by Karel Kulhavy

[permalink] [raw]
Subject: description of struct sockaddr

Hello

man netdevice talks about struct sockaddr, but neither describes it,
nor provides a link to descriptio, nor the "SEE ALSO" items
(ip(7), proc(7), rnetlink(7)) provide the necessary information.

"The hardware address is specified in a struct sockaddr".

Where is struct sockaddr specified?

Cl<


2004-11-23 22:16:21

by Jan Engelhardt

[permalink] [raw]
Subject: Re: description of struct sockaddr

>Hello
>
>man netdevice talks about struct sockaddr, but neither describes it,
>nor provides a link to descriptio, nor the "SEE ALSO" items
>(ip(7), proc(7), rnetlink(7)) provide the necessary information.
>
>"The hardware address is specified in a struct sockaddr".

I don't think so. The hardware address is, well, specific to the hardware (like
Ethernet, for example). IP/TCP/UDP however is not limited to Ethernet. And
'sockaddr' clearly is something that does not deal with hardware.

>Where is struct sockaddr specified?

Somewhere in the depths of /usr/include and your linux kernel tree.
Oh yeah, be warned, glibc is a #define hell when you're looking for sockaddr
stuff.


Jan Engelhardt
--
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, http://www.gwdg.de

2004-11-23 22:20:50

by linux-os

[permalink] [raw]
Subject: Re: description of struct sockaddr

On Tue, 23 Nov 2004, Karel Kulhavy wrote:

> Hello
>
> man netdevice talks about struct sockaddr, but neither describes it,
> nor provides a link to descriptio, nor the "SEE ALSO" items
> (ip(7), proc(7), rnetlink(7)) provide the necessary information.
>
> "The hardware address is specified in a struct sockaddr".
>
> Where is struct sockaddr specified?
>

How about /usr/include/sys/socket.h (for starters). If you can
actually find all the member names by following all the
included-includes, you probably get some kind of prize.
Note that the __SOCKADDR_ALLTYPES macro is absolutely
amazing. It's possible to have the pre-processor hide
everything, making trouble-shooting pure art!

Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by John Ashcroft.
98.36% of all statistics are fiction.