From owner-freebsd-net@freebsd.org Mon Apr 11 20:31:56 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B60E9AEC4A8 for ; Mon, 11 Apr 2016 20:31:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DDEA111B for ; Mon, 11 Apr 2016 20:31:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2a02:1811:2419:4e02:4030:c8ed:a23e:5044] (unknown [IPv6:2a02:1811:2419:4e02:4030:c8ed:a23e:5044]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 0D3FE76C7; Mon, 11 Apr 2016 22:31:54 +0200 (CEST) Subject: Re: libifconfig: Initial code available, looking for feedback Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=utf-8 From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: Date: Mon, 11 Apr 2016 22:31:52 +0200 Cc: freebsd-net@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Marie Helene Kvello-Aune X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 20:31:56 -0000 > On 09 Apr 2016, at 15:59, Marie Helene Kvello-Aune = wrote: > I've just pushed an initial version of libifconfig to the github > repository[2]. I would appreciate feedback, in particular on the API = design > and usage, and especially on how it communicates error state to the > application. >=20 Awesome. This is important work. I can=E2=80=99t be the only one who=E2=80= =99s tired of writing ioctl() calls to set an IP address. Is it still your intention to re-implement/refactor/re-whatever ifconfig = to use this library? It seems like it=E2=80=99d be both a good test-case and a good = way to ensure the library stays up to date, and grows new capabilities as features are = added to the network stack. > Expect the API to break frequently/often for the time being, as it is = still > in very early stages of development. I=E2=80=99ve had a quick look at the library so far, and have a few = remarks. It might be better to have an explicit (opaque to the library user) = handle to contain both the error state (libifconfig_errstate) and the open = sockets (sdkeys). This would go a long way in making the library thread-safe (because = users can now rely on their error state not getting clobbered by another thread). Bikeshedding: - libifconfig_ seems quite long for a prefix. Perhaps libifc_ or lifc_ = ? - if (foo !=3D NULL) free(foo); can be safely written as free(foo); Regards, Kristof=