shared: export systemd dns and hostname validation functions

(cherry picked from commit 38f942e038)
This commit is contained in:
Beniamino Galvani 2019-10-17 17:39:56 +02:00
parent fddc57d60a
commit 7a08b29a3d
2 changed files with 16 additions and 2 deletions

View file

@ -22,9 +22,10 @@
#include "nm-sd-adapt-shared.h"
#include "path-util.h"
#include "hexdecoct.h"
#include "dns-domain.h"
#include "hexdecoct.h"
#include "hostname-util.h"
#include "path-util.h"
/*****************************************************************************/
@ -96,3 +97,13 @@ int nm_sd_dns_name_to_wire_format (const char *domain,
{
return dns_name_to_wire_format (domain, buffer, len, canonical);
}
int nm_sd_dns_name_is_valid (const char *s)
{
return dns_name_is_valid (s);
}
gboolean nm_sd_hostname_is_valid (const char *s, bool allow_trailing_dot)
{
return hostname_is_valid (s, allow_trailing_dot);
}

View file

@ -44,4 +44,7 @@ int nm_sd_dns_name_to_wire_format (const char *domain,
size_t len,
gboolean canonical);
int nm_sd_dns_name_is_valid (const char *s);
gboolean nm_sd_hostname_is_valid(const char *s, bool allow_trailing_dot);
#endif /* __NM_SD_UTILS_SHARED_H__ */