]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc_util: add functions for big endian masked numbers
authorEli Britstein <elibr@mellanox.com>
Wed, 20 Nov 2019 12:42:44 +0000 (14:42 +0200)
committerDavid Ahern <dsahern@gmail.com>
Mon, 25 Nov 2019 21:37:01 +0000 (21:37 +0000)
Add functions for big endian masked numbers as a pre-step towards masked
port numbers.

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
tc/tc_util.c
tc/tc_util.h

index 393721e33bf0e533dbe33775be3885e229423453..afdfc78f2e5b11af178bdf1db540d917b1f457f3 100644 (file)
@@ -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);
+}
index 9adf2ab42138c6c937349a2d0fdfd69faa8dcaf6..edc3913889b9a9326ee67ed53b5ba6de881a58f6 100644 (file)
@@ -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