dhcp: add nm_dhcp_option_add_option_in_addr() helper

This commit is contained in:
Thomas Haller 2021-02-10 15:14:10 +01:00
parent 41634d5199
commit fc83acbd99
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 15 additions and 0 deletions

View file

@ -267,6 +267,17 @@ nm_dhcp_option_add_option_u64(GHashTable * options,
g_strdup_printf("%" G_GUINT64_FORMAT, value));
}
void
nm_dhcp_option_add_option_in_addr(GHashTable * options,
const NMDhcpOption *requests,
guint option,
in_addr_t value)
{
char sbuf[NM_UTILS_INET_ADDRSTRLEN];
nm_dhcp_option_add_option(options, requests, option, _nm_utils_inet4_ntop(value, sbuf));
}
void
nm_dhcp_option_add_requests_to_options(GHashTable *options, const NMDhcpOption *requests)
{

View file

@ -200,6 +200,10 @@ void nm_dhcp_option_add_option_utf8safe_escape(GHashTable * option
guint option,
const guint8 * data,
gsize n_data);
void nm_dhcp_option_add_option_in_addr(GHashTable * options,
const NMDhcpOption *requests,
guint option,
in_addr_t value);
void nm_dhcp_option_add_option_u64(GHashTable * options,
const NMDhcpOption *requests,
guint option,