From owner-freebsd-net@FreeBSD.ORG Tue Jan 22 08:57:32 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 962F9E5C; Tue, 22 Jan 2013 08:57:32 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 5E633FF1; Tue, 22 Jan 2013 08:57:32 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 3CC5E7E824; Tue, 22 Jan 2013 19:57:24 +1100 (EST) Message-ID: <50FE5473.7000807@freebsd.org> Date: Tue, 22 Jan 2013 19:57:23 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: [PATCH] Don't imply TCP and UDP socket options are bitmasks References: <201301141550.13577.jhb@freebsd.org> <50F5181D.6020508@freebsd.org> <201301151416.07231.jhb@freebsd.org> In-Reply-To: <201301151416.07231.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2013 08:57:32 -0000 On 01/16/13 06:16, John Baldwin wrote: > On Tuesday, January 15, 2013 3:49:33 am Lawrence Stewart wrote: >> On 01/15/13 07:50, John Baldwin wrote: >>> The constants used for TCP and UDP socket options (TCP_NODELAY, etc.) are >>> currently defined as hex values that are individual bits. However, socket >>> options are never masked together, they are used as a simple enumeration of >>> discrete values. Using a bitmask forces us to run out of bits and makes it >>> harder for vendors to try to use a high range of values for local custom >>> options (hoping that they never conflict with a new option value added in >>> stock FreeBSD). >> >> Yup. Should we be explicitly #defining the boundary between "bits >> reserved for FreeBSD" and "bits for private vendor use"? > > Oh, we could if you wanted. I'm using 0x1000 locally for both TCP and UDP, > but those are completely arbitrary values. Saner ones might be 0x8000000 if > we want to do that explicitly. We could perhaps just say that is true for all > socket option levels (that is, just define one SO_VENDOR constant or some such > but say it applies to all levels)? A single SO_VENDOR applied to all levels sounds good to me. Cheers, Lawrence