Date: Sat, 09 Apr 2016 13:59:29 +0000 From: Marie Helene Kvello-Aune <marieheleneka@gmail.com> To: freebsd-net@freebsd.org Subject: libifconfig: Initial code available, looking for feedback Message-ID: <CALXRTbfxxf%2BbUev8sBoJEOfR41ZsLnB35i%2B4G_2Bp=j-eVVJQQ@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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 <libifconfig/libifconfig.h> // ... 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALXRTbfxxf%2BbUev8sBoJEOfR41ZsLnB35i%2B4G_2Bp=j-eVVJQQ>