Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: AF_INET <-> PF_INET
Home

[Freeciv-Dev] Re: AF_INET <-> PF_INET

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: strub_p@xxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: AF_INET <-> PF_INET
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 26 Aug 2001 08:40:51 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Aug 26, 2001 at 02:34:23AM +0200, strub_p@xxxxxxxxxxxxx wrote:
>       Hi,
> 
>       I'm reading the sources, and there is a point I can't
> understand. Why using AF_INET instead of PF_INET domain when creating
> a socket. (Ok, ok. Protocol families and address families have the
> same numeric values (On my Linux box and Solaris. I suppose this is
> the same for all the OS where FreeCiv runs). So, this is not really
> important. But :)

My english man page of socket dated "24 Apr 1999" mentions PF_INET. A
translated version (german) from "2. Mai 1996" mentions
AF_INET. Looking at linux/socket.h:
/* Supported address families. */
#define AF_UNSPEC       0
#define AF_UNIX         1       /* Unix domain sockets          */
#define AF_LOCAL        1       /* POSIX name for AF_UNIX       */
#define AF_INET         2       /* Internet IP Protocol         */
#define AF_AX25         3       /* Amateur Radio AX.25          */
....
/* Protocol families, same as address families. */
#define PF_UNSPEC       AF_UNSPEC
#define PF_UNIX         AF_UNIX
#define PF_LOCAL        AF_LOCAL
#define PF_INET         AF_INET
#define PF_AX25         AF_AX25
....

So AF_INET will also work on older systems. And PF_INET has no
advantage because it is the same as AF_INET.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  Windows: From the people who brought you edlin...


[Prev in Thread] Current Thread [Next in Thread]