From owner-freebsd-net@FreeBSD.ORG Sat May 22 19:50:17 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87DE61065675 for ; Sat, 22 May 2010 19:50:17 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE018FC18 for ; Sat, 22 May 2010 19:50:16 +0000 (UTC) Received: by qyk11 with SMTP id 11so3694987qyk.13 for ; Sat, 22 May 2010 12:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dz8JPW5Yrfo1Pf0zQT1vRPAjQT+SF1HgbG3ttRihFSI=; b=TMFyzPXvbbTv59fKRBqPCVQay0vDoC3mR7WKARr9MYHvf9yp9H+RDMlzLCzptP71Vf oxm+e/yHDXBXvO0ByNCfnLZaj2Y0+KudA81eJwenULIthECFumlLBamg0zInxJq1UfYj Nql8tFVuk1EhT0g7ByDYg28pERIMK3ymdHUR0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=YgKdHH9vPSIh4oU4JVe3+WDja/WeQuKREsKm6Ame4aNR4ZVnI1cTCpE7jExYINsvFC a9ggEQ6Q9vnQZiOeNL01GwSQQdmC2+LzS++eVD+jI0vi5JqXqrK2TsFZ8jgSAv394bl6 UsMZ7MlxA4+DyhpMiEZovZXmpw24XS0i2jJuo= MIME-Version: 1.0 Received: by 10.229.213.80 with SMTP id gv16mr747816qcb.72.1274555926065; Sat, 22 May 2010 12:18:46 -0700 (PDT) Received: by 10.229.190.83 with HTTP; Sat, 22 May 2010 12:18:45 -0700 (PDT) In-Reply-To: <50B3A5560BA4D74CADEC55A48B4641B23D5119D0BA@EMBX01-HQ.jnpr.net> References: <50B3A5560BA4D74CADEC55A48B4641B23D5119D0BA@EMBX01-HQ.jnpr.net> Date: Sat, 22 May 2010 12:18:45 -0700 Message-ID: From: Garrett Cooper To: Anjali Kulkarni Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-net@freebsd.org" , "freebsd-hackers@freebsd.org" Subject: Re: Common OS/kernel code between freebsd and linux X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2010 19:50:17 -0000 On Sat, May 22, 2010 at 5:09 AM, Anjali Kulkarni wrote= : > Hi Folks, > > I am not sure the right forum to ask this question - is there any effort = done to find portable code between different OSes, particularly freebsd and= linux? > Specifically, the networking layer could be portable between the 2 and th= ere could be some set of APIs to call into the OS specific parts. This coul= d be modeled as - if I want to port the networking layer or other stuff to = userland, what set of code could reside in userspace such that that layer i= s portable between OSes ? For eg, there could be an API to access mbufs or = skbuffs in freebsd or linux respectively, but the processing to be done for= IP etc could remain the same. I don't know if this is worth thinking about= ? Please share your thoughts. Hi Anjali, About the closest that you'll probably get to portability between OSes is the POSIX layer (which is just libcalls for the most part, and thus doesn't include the scope you're requesting). Even so, there are areas that *BSD is not 100% POSIX compliant, Linux is not 100% POSIX compliant, and there are other areas beyond that where stuff doesn't meet requirements like it says in the manpage documentation under Linux [ioctl(2)'s, for instance]. While this may seem like a valiant effort, I think that trying to unify a network stack and kernel code between FreeBSD and Linux would result in a `religious' war over licensing, ownership, and style. Thanks, -Garrett