Author: hrs
Date: Sun Oct  5 02:37:01 2014
New Revision: 272548
URL: https://svnweb.freebsd.org/changeset/base/272548

Log:
  Use printb() for boolean flags in ro_opts and actor_state for LACP.

Modified:
  head/sbin/ifconfig/iflagg.c
  head/sys/net/ieee8023ad_lacp.h

Modified: head/sbin/ifconfig/iflagg.c
==============================================================================
--- head/sbin/ifconfig/iflagg.c Sun Oct  5 02:34:21 2014        (r272547)
+++ head/sbin/ifconfig/iflagg.c Sun Oct  5 02:37:01 2014        (r272548)
@@ -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",

Modified: head/sys/net/ieee8023ad_lacp.h
==============================================================================
--- head/sys/net/ieee8023ad_lacp.h      Sun Oct  5 02:34:21 2014        
(r272547)
+++ head/sys/net/ieee8023ad_lacp.h      Sun Oct  5 02:37:01 2014        
(r272548)
@@ -75,6 +75,7 @@
        "\007DEFAULTED"         \
        "\010EXPIRED"
 
+#ifdef _KERNEL
 /*
  * IEEE802.3 slow protocols
  *
@@ -336,3 +337,4 @@ lacp_isdistributing(struct lagg_port *lg
 #define        LACP_LAGIDSTR_MAX       \
        (1 + LACP_PARTNERSTR_MAX + 1 + LACP_PARTNERSTR_MAX + 1)
 #define        LACP_STATESTR_MAX       (255) /* XXX */
+#endif /* _KERNEL */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to