shared: add nm_sd_dns_name_to_wire_format()

Add nm_sd_dns_name_to_wire_format() based on systemd utilities to
convert a name into its wire format according to RFC 1035 section
3.1. It will be used to build the content of the DHCP FQDN option.
This commit is contained in:
Beniamino Galvani 2019-06-25 13:53:35 +02:00
parent 7d3098ff90
commit 0280fd1a80
2 changed files with 14 additions and 0 deletions

View file

@ -24,6 +24,7 @@
#include "path-util.h"
#include "hexdecoct.h"
#include "dns-domain.h"
/*****************************************************************************/
@ -83,3 +84,11 @@ nm_sd_utils_unbase64mem (const char *p,
{
return unbase64mem_full (p, l, secure, (void **) mem, len);
}
int nm_sd_dns_name_to_wire_format (const char *domain,
guint8 *buffer,
size_t len,
gboolean canonical)
{
return dns_name_to_wire_format (domain, buffer, len, canonical);
}

View file

@ -39,4 +39,9 @@ int nm_sd_utils_unbase64mem (const char *p,
/*****************************************************************************/
int nm_sd_dns_name_to_wire_format (const char *domain,
guint8 *buffer,
size_t len,
gboolean canonical);
#endif /* __NM_SD_UTILS_SHARED_H__ */