From: Mathieu Schroeter <mathieu@schroetersa.ch>
To: netdev@vger.kernel.org
Cc: Mathieu Schroeter <mathieu@schroetersa.ch>
Subject: [PATCH iproute2-next 2/4] Add utility to convert an unsigned int to string
Date: Tue, 8 Aug 2023 23:42:56 +0200 [thread overview]
Message-ID: <20230808214258.975440-2-mathieu@schroetersa.ch> (raw)
In-Reply-To: <20230808214258.975440-1-mathieu@schroetersa.ch>
Signed-off-by: Mathieu Schroeter <mathieu@schroetersa.ch>
---
include/utils.h | 1 +
lib/utils.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/include/utils.h b/include/utils.h
index cf11174d..f26ed822 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -309,6 +309,7 @@ unsigned int print_name_and_link(const char *fmt,
extern int cmdlineno;
char *int_to_str(int val, char *buf);
+char *uint_to_str(unsigned int val, char *buf);
int get_guid(__u64 *guid, const char *arg);
int get_real_family(int rtm_type, int rtm_family);
diff --git a/lib/utils.c b/lib/utils.c
index 68f44303..efa01668 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -1409,6 +1409,12 @@ char *int_to_str(int val, char *buf)
return buf;
}
+char *uint_to_str(unsigned int val, char *buf)
+{
+ sprintf(buf, "%u", val);
+ return buf;
+}
+
int get_guid(__u64 *guid, const char *arg)
{
unsigned long tmp;
--
2.39.2
next prev parent reply other threads:[~2023-08-08 21:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 21:42 [PATCH iproute2-next 1/4] Add get_long utility and adapt get_integer accordingly Mathieu Schroeter
2023-08-08 21:42 ` Mathieu Schroeter [this message]
2023-08-08 21:42 ` [PATCH iproute2-next 3/4] ss: change aafilter port from int to long (inode support) Mathieu Schroeter
2023-08-08 21:42 ` [PATCH iproute2-next 4/4] ss: print unix socket "ports" as unsigned int (inode) Mathieu Schroeter
2023-08-13 16:30 ` [PATCH iproute2-next 1/4] Add get_long utility and adapt get_integer accordingly patchwork-bot+netdevbpf
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=20230808214258.975440-2-mathieu@schroetersa.ch \
--to=mathieu@schroetersa.ch \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).