#include <stdlib.h>
#include <pulse/xmalloc.h>
-#include <pulse/util.h>
#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
+#include <pulsecore/arpa-inet.h>
#include "parseaddr.h"
return 0;
}
+
+bool pa_is_ip_address(const char *a) {
+ char buf[INET6_ADDRSTRLEN];
+
+ pa_assert(a);
+
+ if (inet_pton(AF_INET6, a, buf) >= 1)
+ return true;
+
+ if (inet_pton(AF_INET, a, buf) >= 1)
+ return true;
+
+ return false;
+}