From owner-freebsd-questions@FreeBSD.ORG Thu Sep 12 04:48:03 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 46FEA922 for ; Thu, 12 Sep 2013 04:48:03 +0000 (UTC) (envelope-from asou@soum.co.jp) Received: from gate.soum.co.jp (gate.soum.co.jp [IPv6:2001:240:10e:0:230:48ff:fe81:e40a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D27232E9C for ; Thu, 12 Sep 2013 04:48:02 +0000 (UTC) Received: from mail.soum.co.jp (mail.soum.co.jp [IPv6:2001:240:2000:1101:20b:5dff:fee5:6f0e]) by gate.soum.co.jp (8.14.2/8.14.2) with ESMTP id r8C4m0Qc033535 for ; Thu, 12 Sep 2013 13:48:00 +0900 (JST) (envelope-from asou@soum.co.jp) Received: from localhost (force.soum.co.jp [172.19.2.1]) by mail.soum.co.jp (8.14.4/8.14.4) with ESMTP id r8C4lwgP004011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 12 Sep 2013 13:47:58 +0900 (JST) Date: Thu, 12 Sep 2013 13:47:57 +0900 (JST) Message-Id: <20130912.134757.123817297.asou@soum.co.jp> To: freebsd-questions@freebsd.org Subject: PF_xxx or AF_xxx? comment of dom_family in sys/uipc_domain.h From: Masato Asou X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.7 at hoth.soum.co.jp X-Virus-Status: Clean X-Spam-Status: No, score=-3.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hoth.soum.co.jp X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (gate.soum.co.jp [IPv6:2001:240:2000:1101:230:48ff:fe81:e40b]); Thu, 12 Sep 2013 13:48:00 +0900 (JST) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2013 04:48:03 -0000 Hi, I have a little question. In manual SOCKET(2) describes as follows. The domain argument specifies a communications domain within which commu- nication will take place; this selects the protocol family which should be used. These families are defined in the include file . The currently understood formats are: PF_LOCAL Host-internal protocols, formerly called PF_UNIX, PF_UNIX Host-internal protocols, deprecated, use PF_LOCAL, PF_INET Internet version 4 protocols, However, comment of dom_fammily in /usr/src/sys/sys/uipc_domain.h as follows. struct domain { int dom_family; /* AF_xxx */ The dom_fammily was used in function /usr/src/sys/kern/uipc_domain.c: pffindtype() as follows. struct protosw * pffindtype(int family, int type) { struct domain *dp; struct protosw *pr; for (dp = domains; dp; dp = dp->dom_next) if (dp->dom_family == family) goto found; The argument domain of SOCKET(2) passed to the argument family of function pffindtype(). If SOCKET(2) is correct, described as /* PF_xxx */ instead /* AF_xxx */ in sys/uipc_domain.h? I know PF_xxx is equals AF_xxx defined in sys/socket.h. I don't believe this is serious mistake. Regards, -- ASOU Masato