]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd/sd-netlink/netlink-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright (C) 2013 Tom Gundersen <teg@jklm.no>
10 #include "sd-netlink.h"
14 int rtnl_message_new_synthetic_error(sd_netlink
*rtnl
, int error
, uint32_t serial
, sd_netlink_message
**ret
);
15 uint32_t rtnl_message_get_serial(sd_netlink_message
*m
);
16 void rtnl_message_seal(sd_netlink_message
*m
);
18 static inline bool rtnl_message_type_is_neigh(uint16_t type
) {
19 return IN_SET(type
, RTM_NEWNEIGH
, RTM_GETNEIGH
, RTM_DELNEIGH
);
22 static inline bool rtnl_message_type_is_route(uint16_t type
) {
23 return IN_SET(type
, RTM_NEWROUTE
, RTM_GETROUTE
, RTM_DELROUTE
);
26 static inline bool rtnl_message_type_is_link(uint16_t type
) {
27 return IN_SET(type
, RTM_NEWLINK
, RTM_SETLINK
, RTM_GETLINK
, RTM_DELLINK
);
30 static inline bool rtnl_message_type_is_addr(uint16_t type
) {
31 return IN_SET(type
, RTM_NEWADDR
, RTM_GETADDR
, RTM_DELADDR
);
34 static inline bool rtnl_message_type_is_addrlabel(uint16_t type
) {
35 return IN_SET(type
, RTM_NEWADDRLABEL
, RTM_DELADDRLABEL
, RTM_GETADDRLABEL
);
38 static inline bool rtnl_message_type_is_routing_policy_rule(uint16_t type
) {
39 return IN_SET(type
, RTM_NEWRULE
, RTM_DELRULE
, RTM_GETRULE
);
42 int rtnl_set_link_name(sd_netlink
**rtnl
, int ifindex
, const char *name
);
43 int rtnl_set_link_properties(sd_netlink
**rtnl
, int ifindex
, const char *alias
, const struct ether_addr
*mac
, unsigned mtu
);
45 int rtnl_log_parse_error(int r
);
46 int rtnl_log_create_error(int r
);