freebsd-skq/lib/libifconfig
Ryan Moeller 94cba8034b 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
2020-08-09 16:27:28 +00:00
..
libifconfig_bridge.c libifconfig: Add function to get bridge status 2020-07-01 02:32:41 +00:00
libifconfig_carp.c libifconfig: multiple feature additions 2018-02-23 03:11:43 +00:00
libifconfig_inet6.c libifconfig: remove redundant NULL check 2020-05-27 18:26:10 +00:00
libifconfig_inet.c libifconfig: multiple feature additions 2018-02-23 03:11:43 +00:00
libifconfig_internal.c libifconfig: multiple feature additions 2018-02-23 03:11:43 +00:00
libifconfig_internal.h libifconfig: multiple feature additions 2018-02-23 03:11:43 +00:00
libifconfig_lagg.c libifconfig: multiple feature additions 2018-02-23 03:11:43 +00:00
libifconfig_media.c Finish removing FDDI and tokenring media support. 2018-04-23 21:10:33 +00:00
libifconfig_sfp_tables_internal.tpl.h Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig_sfp_tables.tpl.c Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig_sfp_tables.tpl.h Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig_sfp.c Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig_sfp.h Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig.c libifconfig: multiple feature additions 2018-02-23 03:11:43 +00:00
libifconfig.h Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
Makefile Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
Makefile.depend DIRDEPS_BUILD: Connect more libraries. 2017-07-11 00:32:48 +00:00
sfp.lua Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00