netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next 1/1] tc: jsonify connmark action
@ 2018-04-03 13:09 Roman Mashak
  2018-04-08 17:54 ` David Ahern
  0 siblings, 1 reply; 2+ messages in thread
From: Roman Mashak @ 2018-04-03 13:09 UTC (permalink / raw)
  To: dsahern; +Cc: stephen, netdev, kernel, jhs, xiyou.wangcong, jiri, Roman Mashak

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
---
 tc/m_connmark.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tc/m_connmark.c b/tc/m_connmark.c
index bcce41391398..45e2d05f1a91 100644
--- a/tc/m_connmark.c
+++ b/tc/m_connmark.c
@@ -114,16 +114,20 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
 
 	parse_rtattr_nested(tb, TCA_CONNMARK_MAX, arg);
 	if (tb[TCA_CONNMARK_PARMS] == NULL) {
-		fprintf(f, "[NULL connmark parameters]");
+		print_string(PRINT_FP, NULL, "%s", "[NULL connmark parameters]");
 		return -1;
 	}
 
 	ci = RTA_DATA(tb[TCA_CONNMARK_PARMS]);
 
-	fprintf(f, " connmark zone %d", ci->zone);
-	print_action_control(f, " ", ci->action, "\n");
-	fprintf(f, "\t index %u ref %d bind %d", ci->index,
-		ci->refcnt, ci->bindcnt);
+	print_string(PRINT_ANY, "kind", "%s ", "connmark");
+	print_uint(PRINT_ANY, "zone", "zone %u", ci->zone);
+	print_action_control(f, " ", ci->action, "");
+
+	print_string(PRINT_FP, NULL, "%s", _SL_);
+	print_uint(PRINT_ANY, "index", "\t index %u", ci->index);
+	print_int(PRINT_ANY, "ref", " ref %d", ci->refcnt);
+	print_int(PRINT_ANY, "bind", " bind %d", ci->bindcnt);
 
 	if (show_stats) {
 		if (tb[TCA_CONNMARK_TM]) {
@@ -132,7 +136,7 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
 			print_tm(f, tm);
 		}
 	}
-	fprintf(f, "\n");
+	print_string(PRINT_FP, NULL, "%s", _SL_);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2-next 1/1] tc: jsonify connmark action
  2018-04-03 13:09 [PATCH iproute2-next 1/1] tc: jsonify connmark action Roman Mashak
@ 2018-04-08 17:54 ` David Ahern
  0 siblings, 0 replies; 2+ messages in thread
From: David Ahern @ 2018-04-08 17:54 UTC (permalink / raw)
  To: Roman Mashak; +Cc: stephen, netdev, kernel, jhs, xiyou.wangcong, jiri

On 4/3/18 7:09 AM, Roman Mashak wrote:
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
> ---
>  tc/m_connmark.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)

applied to iproute2-next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-08 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 13:09 [PATCH iproute2-next 1/1] tc: jsonify connmark action Roman Mashak
2018-04-08 17:54 ` David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).