[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191120124245.3516-3-roid@mellanox.com>
Date: Wed, 20 Nov 2019 14:42:44 +0200
From: Roi Dayan <roid@...lanox.com>
To: netdev@...r.kernel.org
Cc: David Ahern <dsahern@...il.com>,
Stephen Hemminger <stephen@...workplumber.org>,
Jiri Pirko <jiri@...lanox.com>,
Eli Britstein <elibr@...lanox.com>,
Roi Dayan <roid@...lanox.com>
Subject: [PATCH iproute2-next 2/3] tc_util: add functions for big endian masked numbers
From: Eli Britstein <elibr@...lanox.com>
Add functions for big endian masked numbers as a pre-step towards masked
port numbers.
Signed-off-by: Eli Britstein <elibr@...lanox.com>
Reviewed-by: Roi Dayan <roid@...lanox.com>
Acked-by: Jiri Pirko <jiri@...lanox.com>
---
tc/tc_util.c | 12 ++++++++++++
tc/tc_util.h | 2 ++
2 files changed, 14 insertions(+)
diff --git a/tc/tc_util.c b/tc/tc_util.c
index 393721e33bf0..afdfc78f2e5b 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -985,3 +985,15 @@ void print_masked_u8(const char *name, struct rtattr *attr,
print_masked_type(UINT8_MAX, __rta_getattr_u8_u32, name, attr,
mask_attr, newline);
}
+
+static __u32 __rta_getattr_be16_u32(const struct rtattr *attr)
+{
+ return rta_getattr_be16(attr);
+}
+
+void print_masked_be16(const char *name, struct rtattr *attr,
+ struct rtattr *mask_attr, bool newline)
+{
+ print_masked_type(UINT16_MAX, __rta_getattr_be16_u32, name, attr,
+ mask_attr, newline);
+}
diff --git a/tc/tc_util.h b/tc/tc_util.h
index 9adf2ab42138..edc3913889b9 100644
--- a/tc/tc_util.h
+++ b/tc/tc_util.h
@@ -133,4 +133,6 @@ void print_masked_u16(const char *name, struct rtattr *attr,
struct rtattr *mask_attr, bool newline);
void print_masked_u8(const char *name, struct rtattr *attr,
struct rtattr *mask_attr, bool newline);
+void print_masked_be16(const char *name, struct rtattr *attr,
+ struct rtattr *mask_attr, bool newline);
#endif
--
2.8.4
Powered by blists - more mailing lists