From owner-freebsd-net@freebsd.org Sat Mar 5 10:55:21 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 103119DBA67 for ; Sat, 5 Mar 2016 10:55:21 +0000 (UTC) (envelope-from marieheleneka@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2919C01; Sat, 5 Mar 2016 10:55:20 +0000 (UTC) (envelope-from marieheleneka@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id p65so19293323wmp.0; Sat, 05 Mar 2016 02:55:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F0aCREzglxuakAN1ZM3s6rAwCJhLlz+4ZDSDxinZCVM=; b=PLI93+/tS1xamj4B+UC0wb/qitVIOBvqc5DrGlkqKv06cdu3P+wzC4bKlILg6OTLKj gBbpz6s+9sfdqhgvupT0Z0/JuaisMu1L9hNBz1C6O5sybCyHjGA5b2QkcOb37XuyPJaZ t/zBMNNivqLEjmtwUIm1tcZdsvbXVmMQE12vXB/62XL/CTjLe8i9/21t4ubReuOF/kGE b0HJWbdinV8a6kCu5LAaiSwXu3O57/0gNxiU4+qC5Q2Y6Upq8Lj7lP+dV5xkwR+qQsf/ VIZnDZxO5sH44Sn+O90y+h6A1gI21l0qCUZ5wD8Hm0wvjhI4hqQA8O0elA+fV1wJroNd IA1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F0aCREzglxuakAN1ZM3s6rAwCJhLlz+4ZDSDxinZCVM=; b=jj6C8sZvvAKE7VLZdglxK+VZvI0PtqK7ckVBA7Ply1fL9VBnRNyTzxMv6OAlavhLQX ncE/T/KJpSWQkutQRpY+Dh9tXZ8FNOq91FFXlO+HEJlGgjC4TQ8rRAb3ieTc/m85iJIP 2CCN8lK8B+zEL2uOV9mxBhPb5tBiVdEAyPCmmn7zvyFy1jnAdR0lY0VPoSIcuBWi1SWX WNdDAUoycmqUKMbY20IkwfwtSkNeW/8ZENz3SzE+YGf+WV2KYm4PC1N25mp3qODYWMO9 mM7SgnshKCX9x/qbU9hxQItrzVijOyc8F2bEHBWlxH5udQLSAFY3xalEspvYCI8twVol d21w== X-Gm-Message-State: AD7BkJK7U+a6KZy0kzEc+sCZKGSb8ToXjmKSz9e2BNNLhD0bgQDG82lSQV48ECJkNjJPOY1cVjFGdTmkpbVm7g== X-Received: by 10.28.147.206 with SMTP id v197mr3143304wmd.70.1457175318338; Sat, 05 Mar 2016 02:55:18 -0800 (PST) MIME-Version: 1.0 References: <56d9d113.8c21190a.dfb98.397d@mx.google.com> In-Reply-To: <56d9d113.8c21190a.dfb98.397d@mx.google.com> From: Marie Helene Kvello-Aune Date: Sat, 05 Mar 2016 10:55:08 +0000 Message-ID: Subject: Re: libifconfig: A C API for ifconfig To: Roman Bogorodskiy Cc: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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: Sat, 05 Mar 2016 10:55:21 -0000 Hey. I agree it would be useful to make libifconfig available for previous versions through ports. This is not something I'm focusing on right now, but I don't think there will be any trouble building the library outside of base. There's one potential problem I can think of right now: Kernel ABI may have changed between versions in a way that affects libifconfig, but if this is the case it should be relatively easy to deal with. I've added this concern to the list of things to consider when closer to completion. :) - Marie Helene On Fri, Mar 4, 2016 at 7:16 PM Roman Bogorodskiy wrote: > Marie Helene Kvello-Aune wrote: > > > Hey! > > > > I'm currently working on a library called 'libifconfig' which will > provide > > a C API to do the actual work that /sbin/ifconfig currently does, except > > that of lib80211. What sparked this project was a wish to simplify > > maintenance of the ifconfig program by making it primarily focus on the > > user's command line interaction, and not so much on the specifics of how > > those things are done behind the scenes. > > > > One advantage to having such a library is to reduce code duplication and > > thus improve maintainability, and another is that it would make it easier > > for third party programs to query the network stack without having to > spawn > > ifconfig and parse its output. I'm sure there's more, but those were the > > ones at the top of my head when writing this e-mail. > > Hi, > > This is a great idea. It's a bit disappointing to re-implement common > stuff like getting a list of interfaces or obtaining MAC address or IP > address of the interface over and over again in third party apps. > > One question that's interesting to me though: is it planned to provide > support for this lib outside of the base? I mean, if the lib will be > added in, say, 11.x, and I want to use it from my third-party > application, will it be possible to e.g. install it from ports for 9.x or > 10.x so I don't have to support 2 version of the code, one that uses > libifconfig and one that e.g. parses ifconfig(8) output? > > Roman Bogorodskiy >