aboutsummaryrefslogtreecommitdiff
path: root/lib/libifconfig
Commit message (Collapse)AuthorAgeFilesLines
* Move list_cloners to libifconfigRyan Moeller2020-10-212-0/+42
| | | | | | | | | | | Move list_cloners() from ifconfig(8) to libifconfig(3) where it can be reused by other consumers. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D26858 Notes: svn path=/head/; revision=366906
* libifconfig now depends on libm due to usage of log10().John Baldwin2020-09-021-0/+2
| | | | | | | | | | | ld.bfd in particular requires -lm to come after libifconfig on the command line when linking rescue. Reviewed by: freqlabs, adrian Differential Revision: https://reviews.freebsd.org/D26258 Notes: svn path=/head/; revision=365282
* Move ifconfig SFP status functionality into libifconfigRyan Moeller2020-08-098-3/+1520
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libifconfig_sfp.h provides an API in libifconfig for querying SFP module properties, operational status, and vendor strings, as well as descriptions of the various fields, string conversions, and other useful helpers for implementing user interfaces. SFP module status is obtained by reading registers via an I2C interface. Descriptions of these registers and the values therein have been collected in a Lua table which is used to generate all the boilerplace C headers and source files for accessing these values, their names, and descriptions. The generated code is fully commented and readable. This is the first use of libifconfig in ifconfig itself. For now, the scope remains very limited. Over time, more of ifconfig will be replaced with libifconfig. Some minor changes to the formatting of ifconfig output have been made: - Module memory hex dumps are indented one extra space as a result of using hexdump(3) instead of a bespoke hex dump function. - Media descriptions have an added two-character short-name in parenthesis. - QSFP modules were incorrectly displaying TX bias current as power. Now TX channels display bias current, and this change has been made for both SFP and QSFP modules for consistency. A Lua binding for libifconfig including this functionality is implemented but has not been included in this commit. The plan is for it to be committed after dynamic module loading has been enabled in flua. Reviewed by: kp, melifaro Relnotes: yes Differential Revision: https://reviews.freebsd.org/D25494 Notes: svn path=/head/; revision=364058
* libifconfig: Add function to get bridge statusRyan Moeller2020-07-013-5/+173
| | | | | | | | | | | | | | | | | | The new function operates similarly to ifconfig_lagg_get_lagg_status and likewise is accompanied by a function to free the bridge status data structure. I have included in this patch the relocation of some strings describing STP parameters and the PV2ID macro from ifconfig into net/if_bridgevar.h as they are useful for consumers of libifconfig. Reviewed by: kp, melifaro, mmacy Approved by: mmacy (mentor) MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D25460 Notes: svn path=/head/; revision=362824
* libifconfig: remove redundant NULL checkEric van Gyzen2020-05-271-1/+1
| | | | | | | | | Submitted by: Puneeth_kumar.Jothaiah@emc.com Reported by: Coverity Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=361559
* wlandebug: Add include path for libifconfig as it is a internallibEmmanuel Vadot2020-03-251-2/+3
| | | | | | | | Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D24172 Notes: svn path=/head/; revision=359291
* Make libifconfig INTERNALLIBEd Maste2019-02-251-3/+1
| | | | | | | | | | | | | | | Instead of PRIVATELIB + NO_PIC. This avoids the need for the wlandebug PIE special case added in r344211, and provides a stronger guarantee against 3rd party software coming to depend on the API or ABI. If / when we declare the API/ABI to be stable we can make it a normal library. Discussed with: bapt Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=344530
* Finish removing FDDI and tokenring media support.Brooks Davis2018-04-231-27/+0
| | | | | | | | | | | | | | | | | This fixes media display for 802.11 wireless devices. Software outside the base system that uses these media types and defines should use #ifdef IFM_FDDI or IFM_TOKEN to include or remove support. Reported by: zeising Reviewed by: emaste, kib, zeising Tested by: zeising Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15170 Notes: svn path=/head/; revision=332895
* Remove support for FDDI and token ring media types in userland utilities.Brooks Davis2018-04-161-9/+0
| | | | | | | | | Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15077 Notes: svn path=/head/; revision=332630
* Remove support for FDDI networks.Brooks Davis2018-04-111-27/+0
| | | | | | | | | | | | Defines in net/if_media.h remain in case code copied from ifconfig is in use elsewere (supporting non-existant media type is harmless). Reviewed by: kib, jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15017 Notes: svn path=/head/; revision=332412
* libifconfig: multiple feature additionsAlan Somers2018-02-2310-150/+1249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the ability to: * Create virtual interfaces * Create vlan interfaces * Get interface fib * Get interface groups * Get interface status * Get nd6 info * Get media status * Get additional ifaddr info in a convenient struct * Get vhids * Get carp info * Get lagg and laggport status * Iterate over all interfaces and ifaddrs And add more examples, too. Note that this is a backwards-incompatible change. But that's ok, because it's a private library. MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D14463 Notes: svn path=/head/; revision=329853
* libifconfig: fix ifconfig_set_metricAlan Somers2018-02-211-2/+2
| | | | | | | | | | | | | Due to a copy/paste error, ifconfig_set_metric actually set the mtu, not the metric. See Also: https://github.com/Savagedlight/libifconfig/issues/48 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=329750
* libifconfig: allow to get original interface name via ifconfig_get_orig_name()Andriy Voskoboinyk2017-10-162-0/+97
| | | | | | | | | | | | Uses the same method as in tools/tools/ifinfo/ifinfo.c (via net.link.generic sysctl). Tested with modified wlandebug(8). Differential Revision: https://reviews.freebsd.org/D12554 Notes: svn path=/head/; revision=324656
* DIRDEPS_BUILD: Connect more libraries.Bryan Drewery2017-07-111-0/+13
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=320884
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Mark libifconfig as private until the API/ABI is stableAllan Jude2016-09-111-0/+1
| | | | | | | | | | | libifconfig is still experimental and under active development. To avoid making any ABI promises, mark the library as private Suggested by: bapt Reviewed by: kp Notes: svn path=/head/; revision=305700
* libifconfig: style(9) fixesKristof Provost2016-09-044-89/+102
| | | | | | | | | | | | Also switch from BSD 3-clause to 2-clause license where possible, and consolidate duplicate 3-clause license into one. Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com> Reviewed by: cem, kp Differential Revision: https://reviews.freebsd.org/D7764 Notes: svn path=/head/; revision=305395
* Renaming libifc to libifconfig in response to feedback on initial commit ofKristof Provost2016-09-025-0/+715
this library. Sticking to 'libifconfig' (and 'ifconfig_' as function prefix) should reduce chances of namespace collisions, make it more clear what the library does, and be more in line with existing libraries. Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com> Differential Revision: https://reviews.freebsd.org/D7742 Reviewed by: cem, kp Notes: svn path=/head/; revision=305290