diff options
author | hrs <hrs@FreeBSD.org> | 2014-10-05 02:37:01 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2014-10-05 02:37:01 +0000 |
commit | d278f7c1871b2661c54f39154413b2d7e66f52f7 (patch) | |
tree | 2c61f8472105f4f2eb4acb5d4756885fa7aeef73 /sbin/ifconfig/iflagg.c | |
parent | 2edb8f7e2ff6f7d9746a208b04153ea81adb9708 (diff) | |
download | FreeBSD-src-d278f7c1871b2661c54f39154413b2d7e66f52f7.zip FreeBSD-src-d278f7c1871b2661c54f39154413b2d7e66f52f7.tar.gz |
Use printb() for boolean flags in ro_opts and actor_state for LACP.
Diffstat (limited to 'sbin/ifconfig/iflagg.c')
-rw-r--r-- | sbin/ifconfig/iflagg.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c index 9c478b3..51a6faa 100644 --- a/sbin/ifconfig/iflagg.c +++ b/sbin/ifconfig/iflagg.c @@ -17,6 +17,7 @@ static const char rcsid[] = #include <net/ethernet.h> #include <net/if.h> #include <net/if_lagg.h> +#include <net/ieee8023ad_lacp.h> #include <net/route.h> #include <ctype.h> @@ -246,18 +247,9 @@ lagg_status(int s) putchar('\n'); if (verbose) { printf("\tlagg options:\n"); - printf("\t\tuse_flowid: %d\n", - (ro.ro_opts & LAGG_OPT_USE_FLOWID) ? 1 : 0); + printb("\t\tflags", ro.ro_opts, LAGG_OPT_BITS); + putchar('\n'); printf("\t\tflowid_shift: %d\n", ro.ro_flowid_shift); - switch (ra.ra_proto) { - case LAGG_PROTO_LACP: - printf("\t\tlacp_strict: %d\n", - (ro.ro_opts & LAGG_OPT_LACP_STRICT) ? 1 : 0); - printf("\t\tlacp_rxtest: %d\n", - (ro.ro_opts & LAGG_OPT_LACP_RXTEST) ? 1 : 0); - printf("\t\tlacp_txtest: %d\n", - (ro.ro_opts & LAGG_OPT_LACP_TXTEST) ? 1 : 0); - } printf("\tlagg statistics:\n"); printf("\t\tactive ports: %d\n", ro.ro_active); printf("\t\tflapping: %u\n", ro.ro_flapping); @@ -272,7 +264,8 @@ lagg_status(int s) printf("\tlaggport: %s ", rpbuf[i].rp_portname); printb("flags", rpbuf[i].rp_flags, LAGG_PORT_BITS); if (verbose && ra.ra_proto == LAGG_PROTO_LACP) - printf(" state=%X", lp->actor_state); + printb(" state", lp->actor_state, + LACP_STATE_BITS); putchar('\n'); if (verbose && ra.ra_proto == LAGG_PROTO_LACP) printf("\t\t%s\n", |