diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-06-14 16:36:17 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-07-23 23:31:23 +0900 |
commit | 13c026ca83ea857cb74a9fb5250cd7ae15956280 (patch) | |
tree | 59affa6edd246745d8b6cd1e36c10c6c841a7765 | |
parent | 5e81e84c86c00cb83b80c955682d038199c541fe (diff) | |
download | systemd-13c026ca83ea857cb74a9fb5250cd7ae15956280.tar.gz |
sd-netlink: move rtnl_message_type_is_*() to netlink-message-rtnl.c
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-message-rtnl.c | 40 | ||||
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-util.h | 40 |
2 files changed, 40 insertions, 40 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-message-rtnl.c b/src/libsystemd/sd-netlink/netlink-message-rtnl.c index 289eb41ca9..0ff25f8e6c 100644 --- a/src/libsystemd/sd-netlink/netlink-message-rtnl.c +++ b/src/libsystemd/sd-netlink/netlink-message-rtnl.c @@ -17,6 +17,46 @@ #include "socket-util.h" #include "util.h" +static bool rtnl_message_type_is_neigh(uint16_t type) { + return IN_SET(type, RTM_NEWNEIGH, RTM_GETNEIGH, RTM_DELNEIGH); +} + +static bool rtnl_message_type_is_route(uint16_t type) { + return IN_SET(type, RTM_NEWROUTE, RTM_GETROUTE, RTM_DELROUTE); +} + +static bool rtnl_message_type_is_nexthop(uint16_t type) { + return IN_SET(type, RTM_NEWNEXTHOP, RTM_GETNEXTHOP, RTM_DELNEXTHOP); +} + +static bool rtnl_message_type_is_link(uint16_t type) { + return IN_SET(type, + RTM_NEWLINK, RTM_SETLINK, RTM_GETLINK, RTM_DELLINK, + RTM_NEWLINKPROP, RTM_DELLINKPROP, RTM_GETLINKPROP); +} + +static bool rtnl_message_type_is_addr(uint16_t type) { + return IN_SET(type, RTM_NEWADDR, RTM_GETADDR, RTM_DELADDR); +} + +static bool rtnl_message_type_is_addrlabel(uint16_t type) { + return IN_SET(type, RTM_NEWADDRLABEL, RTM_DELADDRLABEL, RTM_GETADDRLABEL); +} + +static bool rtnl_message_type_is_routing_policy_rule(uint16_t type) { + return IN_SET(type, RTM_NEWRULE, RTM_DELRULE, RTM_GETRULE); +} + +static bool rtnl_message_type_is_traffic_control(uint16_t type) { + return IN_SET(type, + RTM_NEWQDISC, RTM_DELQDISC, RTM_GETQDISC, + RTM_NEWTCLASS, RTM_DELTCLASS, RTM_GETTCLASS); +} + +static bool rtnl_message_type_is_mdb(uint16_t type) { + return IN_SET(type, RTM_NEWMDB, RTM_DELMDB, RTM_GETMDB); +} + _public_ int sd_rtnl_message_route_set_dst_prefixlen(sd_netlink_message *m, unsigned char prefixlen) { struct rtmsg *rtm; diff --git a/src/libsystemd/sd-netlink/netlink-util.h b/src/libsystemd/sd-netlink/netlink-util.h index 606d14eeaf..9473e15700 100644 --- a/src/libsystemd/sd-netlink/netlink-util.h +++ b/src/libsystemd/sd-netlink/netlink-util.h @@ -29,46 +29,6 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(MultipathRoute*, multipath_route_free); int multipath_route_dup(const MultipathRoute *m, MultipathRoute **ret); -static inline bool rtnl_message_type_is_neigh(uint16_t type) { - return IN_SET(type, RTM_NEWNEIGH, RTM_GETNEIGH, RTM_DELNEIGH); -} - -static inline bool rtnl_message_type_is_route(uint16_t type) { - return IN_SET(type, RTM_NEWROUTE, RTM_GETROUTE, RTM_DELROUTE); -} - -static inline bool rtnl_message_type_is_nexthop(uint16_t type) { - return IN_SET(type, RTM_NEWNEXTHOP, RTM_GETNEXTHOP, RTM_DELNEXTHOP); -} - -static inline bool rtnl_message_type_is_link(uint16_t type) { - return IN_SET(type, - RTM_NEWLINK, RTM_SETLINK, RTM_GETLINK, RTM_DELLINK, - RTM_NEWLINKPROP, RTM_DELLINKPROP, RTM_GETLINKPROP); -} - -static inline bool rtnl_message_type_is_addr(uint16_t type) { - return IN_SET(type, RTM_NEWADDR, RTM_GETADDR, RTM_DELADDR); -} - -static inline bool rtnl_message_type_is_addrlabel(uint16_t type) { - return IN_SET(type, RTM_NEWADDRLABEL, RTM_DELADDRLABEL, RTM_GETADDRLABEL); -} - -static inline bool rtnl_message_type_is_routing_policy_rule(uint16_t type) { - return IN_SET(type, RTM_NEWRULE, RTM_DELRULE, RTM_GETRULE); -} - -static inline bool rtnl_message_type_is_traffic_control(uint16_t type) { - return IN_SET(type, - RTM_NEWQDISC, RTM_DELQDISC, RTM_GETQDISC, - RTM_NEWTCLASS, RTM_DELTCLASS, RTM_GETTCLASS); -} - -static inline bool rtnl_message_type_is_mdb(uint16_t type) { - return IN_SET(type, RTM_NEWMDB, RTM_DELMDB, RTM_GETMDB); -} - int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name); int rtnl_set_link_properties( sd_netlink **rtnl, |