]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/tc_red.c
tc: m_action: check cookie hex string len
[mirror_iproute2.git] / tc / tc_red.c
index 178fe088f73260711e5ed1e9bc31644334918b59..88f5ff358ce5596cac86790bd9acdd2e4edc278a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * tc_red.c            RED maintanance routines.
+ * tc_red.c            RED maintenance routines.
  *
  *             This program is free software; you can redistribute it and/or
  *             modify it under the terms of the GNU General Public License
@@ -20,7 +20,9 @@
 #include <arpa/inet.h>
 #include <string.h>
 
+#include "utils.h"
 #include "tc_core.h"
+#include "tc_util.h"
 #include "tc_red.h"
 
 /*
@@ -97,3 +99,26 @@ int tc_red_eval_idle_damping(int Wlog, unsigned int avpkt, unsigned int bps, __u
        sbuf[255] = 31;
        return clog;
 }
+
+void tc_red_print_flags(__u32 flags)
+{
+       if (flags & TC_RED_ECN)
+               print_bool(PRINT_ANY, "ecn", "ecn ", true);
+       else
+               print_bool(PRINT_ANY, "ecn", NULL, false);
+
+       if (flags & TC_RED_HARDDROP)
+               print_bool(PRINT_ANY, "harddrop", "harddrop ", true);
+       else
+               print_bool(PRINT_ANY, "harddrop", NULL, false);
+
+       if (flags & TC_RED_ADAPTATIVE)
+               print_bool(PRINT_ANY, "adaptive", "adaptive ", true);
+       else
+               print_bool(PRINT_ANY, "adaptive", NULL, false);
+
+       if (flags & TC_RED_NODROP)
+               print_bool(PRINT_ANY, "nodrop", "nodrop ", true);
+       else
+               print_bool(PRINT_ANY, "nodrop", NULL, false);
+}