netlink: add IPv4/IPv6 attribute writers using in[6]_addr instead of

sockaddrs.

MFC after:	2 weeks
This commit is contained in:
Alexander V. Chernikov 2023-05-19 09:44:21 +00:00
parent 6408d025cf
commit 1377eb268a

View file

@ -127,6 +127,18 @@ snl_attr_get_ipvia(struct snl_state *ss, struct nlattr *nla,
return (false);
}
static inline bool
snl_add_msg_attr_ip4(struct snl_writer *nw, int attrtype, const struct in_addr *addr)
{
return (snl_add_msg_attr(nw, attrtype, 4, addr));
}
static inline bool
snl_add_msg_attr_ip6(struct snl_writer *nw, int attrtype, const struct in6_addr *addr)
{
return (snl_add_msg_attr(nw, attrtype, 16, addr));
}
static inline bool
snl_add_msg_attr_ip(struct snl_writer *nw, int attrtype, const struct sockaddr *sa)
{