Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2008 21:22:06 +1100
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        "Heiko Wundram (Beenic)" <wundram@beenic.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: OT: getting the protocol family of a file descriptor
Message-ID:  <20080201102205.GN15719@server.vk2pj.dyndns.org>
In-Reply-To: <200801311947.42545.wundram@beenic.net>
References:  <200801310923.16029.wundram@beenic.net> <200801311701.49792.wundram@beenic.net> <86myqmvt0z.fsf@ds4.des.no> <200801311947.42545.wundram@beenic.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080201102205.GN15719>