From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 1 10:22:49 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97B3B16A419 for ; Fri, 1 Feb 2008 10:22:49 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 2EC5213C447 for ; Fri, 1 Feb 2008 10:22:49 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m11AMYXp030685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Feb 2008 21:22:36 +1100 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.1) with ESMTP id m11AM7LF032219; Fri, 1 Feb 2008 21:22:07 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m11AM7ni032218; Fri, 1 Feb 2008 21:22:07 +1100 (EST) (envelope-from peter) Date: Fri, 1 Feb 2008 21:22:06 +1100 From: Peter Jeremy To: "Heiko Wundram (Beenic)" Message-ID: <20080201102205.GN15719@server.vk2pj.dyndns.org> References: <200801310923.16029.wundram@beenic.net> <200801311701.49792.wundram@beenic.net> <86myqmvt0z.fsf@ds4.des.no> <200801311947.42545.wundram@beenic.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2B/JsCI69OhZNC5r" Content-Disposition: inline In-Reply-To: <200801311947.42545.wundram@beenic.net> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org Subject: Re: OT: getting the protocol family of a file descriptor X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2008 10:22:49 -0000 --2B/JsCI69OhZNC5r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 31, 2008 at 07:47:41PM +0100, Heiko Wundram (Beenic) wrote: >I personally don't find this especially beautiful, and generally, as there= is=20 >a getsockopt(SO_TYPE), I'd have thought the above should look (somewhat)= =20 >similar to the following: > >int opt; >socklen_t optlen =3D sizeof(opt); > >getsockopt(fd,SOL_SOCKET,SO_DOMAIN,&opt,&optlen); Unfortunately and unlike the socket type returned by SO_TYPE, the protocol family does not seem to be readily available within the struct socket. Having had a rummage around in the socket structure, it's not obvious how to implement this in a protocol-independent way. --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --2B/JsCI69OhZNC5r Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHovLN/opHv/APuIcRAoc9AJ0R6MweXj3aeat0TCILR+rms/7m/gCgqUqr AsNSCdt/srb3R4cKpR5pLGQ= =WuSq -----END PGP SIGNATURE----- --2B/JsCI69OhZNC5r--