Unix Programming - socket question

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > January 2006 > socket question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author socket question
stathis gotsis

2006-01-15, 5:52 pm

Hello,
I wonder how AF_INET is different from PF_INET when passed as the first
parameter to socket(). My man only states PF_INET.

Thank you


Barry Margolin

2006-01-15, 5:52 pm

In article <dqej42$b6h$1@ulysses.noc.ntua.gr>,
"stathis gotsis" <stathisgotsis@hotmail.com> wrote:

> Hello,
> I wonder how AF_INET is different from PF_INET when passed as the first
> parameter to socket(). My man only states PF_INET.


The original intent was that the AF_* constants would be used when
dealing with addresses, and PF_* when dealing with protocol suites.
However, in practice there's a one-to-one correspondence -- IP protocols
always use IP addresses, Appletalk protocols always use Appletalk
addresses, etc. So AF_INET == PF_INET, and over time the distinction
between the two sets was dropped.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Lew Pitcher

2006-01-16, 2:50 am

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry Margolin wrote:
> In article <dqej42$b6h$1@ulysses.noc.ntua.gr>,
> "stathis gotsis" <stathisgotsis@hotmail.com> wrote:
>
>
>
>
> The original intent was that the AF_* constants would be used when
> dealing with addresses, and PF_* when dealing with protocol suites.
> However, in practice there's a one-to-one correspondence -- IP protocols
> always use IP addresses, Appletalk protocols always use Appletalk
> addresses, etc. So AF_INET == PF_INET, and over time the distinction
> between the two sets was dropped.
>


The late W. Richard Stevens (the author of the "TCP/IP Illustrated" series)
has a page (derived from a 1996 thread in comp.protocols.tcpip) that discusses
this.

See http://www.kohala.com/start/lanciani.96apr10.txt


- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQFDyw85agVFX4UWr64RArFiAJ9NZe+0OPD2
myiNAfNimrPd38DiuACgn8yR
JpnH5cseIVD+UVR9a5XAG/E=
=FXlO
-----END PGP SIGNATURE-----
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com