History log of /freebsd-head/lib/libifconfig/libifconfig.h
Revision Date Author Comments
7577abf444f6f1c6c44273bafab457f2457668e5 09-Aug-2020 freqlabs <freqlabs@FreeBSD.org> Move ifconfig SFP status functionality into libifconfig

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
251424cb6aad1b60397384346f1faa1a6f36241d 01-Jul-2020 freqlabs <freqlabs@FreeBSD.org> libifconfig: Add function to get bridge status

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
0d688befe378e232b49870c2b110fba4b6bbc7fb 23-Feb-2018 asomers <asomers@FreeBSD.org> libifconfig: multiple feature additions

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
ef389b0fa2f74610c8108a9707c73f06877d8b6a 16-Oct-2017 avos <avos@FreeBSD.org> libifconfig: allow to get original interface name via ifconfig_get_orig_name()

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
9d1a10ce4d87dd4be881842750837da03cdf755b 04-Sep-2016 dim <dim@FreeBSD.org> Merge ^/head r305394 through r305396.
072565371371d18a83c9ef57aaed59d0c97eec5b 04-Sep-2016 kp <kp@FreeBSD.org> libifconfig: style(9) fixes

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
e5074fa18e1026973d644cd128dcf5a9e4b415fa 02-Sep-2016 kp <kp@FreeBSD.org> Renaming libifc to libifconfig in response to feedback on initial commit of
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