1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

sd-netlink: introduce sd_rtnl_message_route_set_tos()

We already have the getter for the parameter, but forgot to introduce the setter.
This commit is contained in:
Yu Watanabe 2024-01-03 04:21:51 +09:00
parent 8f8b39c86b
commit ef4e0b7e4f
2 changed files with 15 additions and 0 deletions

View File

@ -92,6 +92,20 @@ int sd_rtnl_message_route_set_src_prefixlen(sd_netlink_message *m, unsigned char
return 0;
}
int sd_rtnl_message_route_set_tos(sd_netlink_message *m, unsigned char tos) {
struct rtmsg *rtm;
assert_return(m, -EINVAL);
assert_return(m->hdr, -EINVAL);
assert_return(rtnl_message_type_is_route(m->hdr->nlmsg_type), -EINVAL);
rtm = NLMSG_DATA(m->hdr);
rtm->rtm_tos = tos;
return 0;
}
int sd_rtnl_message_route_set_scope(sd_netlink_message *m, unsigned char scope) {
struct rtmsg *rtm;

View File

@ -162,6 +162,7 @@ int sd_rtnl_message_link_get_type(sd_netlink_message *m, unsigned short *type);
int sd_rtnl_message_new_route(sd_netlink *nl, sd_netlink_message **ret, uint16_t nlmsg_type, int rtm_family, unsigned char rtm_protocol);
int sd_rtnl_message_route_set_dst_prefixlen(sd_netlink_message *m, unsigned char prefixlen);
int sd_rtnl_message_route_set_src_prefixlen(sd_netlink_message *m, unsigned char prefixlen);
int sd_rtnl_message_route_set_tos(sd_netlink_message *m, unsigned char tos);
int sd_rtnl_message_route_set_scope(sd_netlink_message *m, unsigned char scope);
int sd_rtnl_message_route_set_flags(sd_netlink_message *m, unsigned flags);
int sd_rtnl_message_route_set_table(sd_netlink_message *m, unsigned char table);