diff options
author | Ryan Moeller <freqlabs@FreeBSD.org> | 2020-07-01 02:32:41 +0000 |
---|---|---|
committer | Ryan Moeller <freqlabs@FreeBSD.org> | 2020-07-01 02:32:41 +0000 |
commit | e5539fb618cc73fa5a00fc82e35b2803dd1403b3 (patch) | |
tree | ac939cd5eab92b9d18fe6930af825f82b0a64014 /sbin/ifconfig | |
parent | 64612d4e44289285a5cbdd26544421cdfd0a51b2 (diff) | |
download | src-e5539fb618cc73fa5a00fc82e35b2803dd1403b3.tar.gz src-e5539fb618cc73fa5a00fc82e35b2803dd1403b3.zip |
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
Notes
Notes:
svn path=/head/; revision=362824
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/ifbridge.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index 8ccbd622dff4..f4c51632bc98 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -63,36 +63,9 @@ static const char rcsid[] = #include "ifconfig.h" -#define PV2ID(pv, epri, eaddr) do { \ - epri = pv >> 48; \ - eaddr[0] = pv >> 40; \ - eaddr[1] = pv >> 32; \ - eaddr[2] = pv >> 24; \ - eaddr[3] = pv >> 16; \ - eaddr[4] = pv >> 8; \ - eaddr[5] = pv >> 0; \ -} while (0) - -static const char *stpstates[] = { - "disabled", - "listening", - "learning", - "forwarding", - "blocking", - "discarding" -}; -static const char *stpproto[] = { - "stp", - "-", - "rstp" -}; -static const char *stproles[] = { - "disabled", - "root", - "designated", - "alternate", - "backup" -}; +static const char *stpstates[] = { STP_STATES }; +static const char *stpproto[] = { STP_PROTOS }; +static const char *stproles[] = { STP_ROLES }; static int get_val(const char *cp, u_long *valp) |