@@ -609,11 +609,17 @@ enum {
TCA_HW_OFFLOAD,
TCA_INGRESS_BLOCK,
TCA_EGRESS_BLOCK,
+ TCA_DUMP_FLAGS,
__TCA_MAX
};
#define TCA_MAX (__TCA_MAX - 1)
+#define TCA_DUMP_FLAGS_TERSE (1 << 0) /* Means that in dump user gets only basic
+ * data necessary to identify the objects
+ * (handle, cookie, etc.) and stats.
+ */
+
#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
@@ -595,6 +595,7 @@ static int tc_filter_list(int cmd, int argc, char **argv)
.t.tcm_parent = TC_H_UNSPEC,
.t.tcm_family = AF_UNSPEC,
};
+ bool terse_dump = false;
char d[IFNAMSIZ] = {};
__u32 prio = 0;
__u32 protocol = 0;
@@ -687,6 +688,8 @@ static int tc_filter_list(int cmd, int argc, char **argv)
invarg("invalid chain index value", *argv);
filter_chain_index_set = 1;
filter_chain_index = chain_index;
+ } else if (matches(*argv, "terse") == 0) {
+ terse_dump = true;
} else if (matches(*argv, "help") == 0) {
usage();
} else {
@@ -721,6 +724,15 @@ static int tc_filter_list(int cmd, int argc, char **argv)
if (filter_chain_index_set)
addattr32(&req.n, sizeof(req), TCA_CHAIN, chain_index);
+ if (terse_dump) {
+ struct nla_bitfield32 flags = {
+ .value = TCA_DUMP_FLAGS_TERSE,
+ .selector = TCA_DUMP_FLAGS_TERSE
+ };
+
+ addattr_l(&req.n, MAX_MSG, TCA_DUMP_FLAGS, &flags, sizeof(flags));
+ }
+
if (rtnl_dump_request_n(&rth, &req.n) < 0) {
perror("Cannot send dump request");
return 1;