From: Roman Mashak <mrv@mojatatu.com>
To: dsahern@gmail.com
Cc: stephen@networkplumber.org, netdev@vger.kernel.org,
kernel@mojatatu.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
jiri@resnulli.us, Roman Mashak <mrv@mojatatu.com>
Subject: [PATCH iproute2-next 1/1] tc: jsonify connmark action
Date: Tue, 3 Apr 2018 09:09:55 -0400 [thread overview]
Message-ID: <1522760995-12441-1-git-send-email-mrv@mojatatu.com> (raw)
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
next reply other threads:[~2018-04-03 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-03 13:09 Roman Mashak [this message]
2018-04-08 17:54 ` [PATCH iproute2-next 1/1] tc: jsonify connmark action David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1522760995-12441-1-git-send-email-mrv@mojatatu.com \
--to=mrv@mojatatu.com \
--cc=dsahern@gmail.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kernel@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox