From owner-freebsd-net@freebsd.org Sat Apr 9 13:59:41 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 1BADCB09690 for ; Sat, 9 Apr 2016 13:59:41 +0000 (UTC) (envelope-from marieheleneka@gmail.com) Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) (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 9C6B21184 for ; Sat, 9 Apr 2016 13:59:40 +0000 (UTC) (envelope-from marieheleneka@gmail.com) Received: by mail-lf0-x22a.google.com with SMTP id j11so107518091lfb.1 for ; Sat, 09 Apr 2016 06:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=BFQphtVbJadEOjDlfcN3RX4+00LKck7Jg+6cLkv33i8=; b=WtdpgoN1m04rszFzVR6xMmgtT2NyeH9iGlWgNW75bVotUHHbxpnCQY1ZyA076SCirG nIT1xcfgdGqwvUa4LbUmKNekYpo1RBwJRM3lTFKJvCAvVzuuNvvsXAiwHX2PgRZYtMDw hu+aznAeEJJnKkZXtwb2jo3b5QWmTscJ7694szAl2+TY/AyD3CDkl+JmwdB8k1NiYr68 +E7/RujWzRTqCxzpIzGXZRdiQmJjIMHeTviTPl1jLaDeTedjlYaAawT5H0mVlcOyYWpj nJil10BHJINbPFTvJf4XO3y4IRfpgsi1Yv0PbVF5Us2upcsonfrikJFKJaaSWCBE3m3t WHxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BFQphtVbJadEOjDlfcN3RX4+00LKck7Jg+6cLkv33i8=; b=UrPQ6t4xpHjmWmdI0J1FTH7crrGDN/7TOCOL5PM7GcDYdBbNRP2709BEamQLoQwayu 7ZeP3Xo7eVgzzTEK2zs0Bg1XnCcoNT5AZxkMRKIAA+BB34oTS2Aorbjbi2bQSgo0JXss gPKPEdOLvjUq9rsVIQ/Tz5x/i60ByfozmiHAoVRSHtvAinH1SmoXMRMoDa34m42rVCTT ZfXPQebHAJvgVGcjiYStF86M5kN9YvMdJVR+WQXA1D4ieMfjmtmKXpz61yeSlCMBnos/ N3ddGZ1NYNcw9gBD42Gl0Tnx9mTX4+FRfKe29h+ySVbqgxL+7tUdATm/y7ae0BiZ8YWX V1wQ== X-Gm-Message-State: AD7BkJLgrtkI2hNCX+ah4q261cL9ZPNM0BfT3g2ltyinHxnd1Fh/21QTZTTvEDe580wqyQIxkHYUDvsT8rTERg== X-Received: by 10.25.85.145 with SMTP id j139mr5358883lfb.131.1460210378907; Sat, 09 Apr 2016 06:59:38 -0700 (PDT) MIME-Version: 1.0 From: Marie Helene Kvello-Aune Date: Sat, 09 Apr 2016 13:59:29 +0000 Message-ID: Subject: libifconfig: Initial code available, looking for feedback To: 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, 09 Apr 2016 13:59:41 -0000 Hey! Please see previous thread[1] for context on what libifconfig is. 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. Expect the API to break frequently/often for the time being, as it is still in very early stages of development. Next, I'll be working on improving libifconfig_get_capability() to properly communicate all relevant information, as it currently doesn't provide all the information it should. This will allow libifconfig_set_capability() (and applications) to use the aforementioned function instead of duplicating code. After this, I'll be adding new features to the API, which I'll post an update about when the time comes. Example usage: // Start example #include // ... int main (void) { char *desc; if (libifconfig_get_description("em0", &desc) == 0) printf("old description: %s\n", desc); if (libifconfig_unset_description("em0") == 0) printf("Successfully unset description."); else printf("Couldn't unset description. Lazy example writer is lazy, and instructs reader to imagine using libifconfig_errstate to create useful error messages."); } // End example Links: [1] libifconfig: A C API for ifconfig: https://lists.freebsd.org/pipermail/freebsd-net/2016-March/044837.html [2] libifconfig github repo: https://github.com/Savagedlight/libifconfig Thanks, Marie Helene Kvello-Aune