diff options
author | Nikolay Aleksandrov <razor@blackwall.org> | 2022-04-13 13:51:52 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-04-13 14:46:25 +0300 |
commit | 2e9ea3e30f696fd438319c07836422bb0bbb4608 (patch) | |
tree | 84cc9b965e5bac0557aef733992e6c371f7f26ef /include/net/rtnetlink.h | |
parent | 12dc5c2cb7b269c5a1c6d02844f40bfce942a7a6 (diff) | |
download | linux-2e9ea3e30f696fd438319c07836422bb0bbb4608.tar.xz |
net: rtnetlink: add helper to extract msg type's kind
Add a helper which extracts the msg type's kind using the kind mask (0x3).
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/rtnetlink.h')
-rw-r--r-- | include/net/rtnetlink.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index 78712b51f3da..c51c5ff7f7e2 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h @@ -19,6 +19,12 @@ enum rtnl_kinds { RTNL_KIND_GET, RTNL_KIND_SET }; +#define RTNL_KIND_MASK 0x3 + +static inline enum rtnl_kinds rtnl_msgtype_kind(int msgtype) +{ + return msgtype & RTNL_KIND_MASK; +} void rtnl_register(int protocol, int msgtype, rtnl_doit_func, rtnl_dumpit_func, unsigned int flags); |