Logo Search packages:      
Sourcecode: pulseaudio version File versions

char* pa_get_fqdn ( char *  s,
size_t  l 
)

Return the fully qualified domain name in s

Definition at line 228 of file util.c.

                                     {
    char hn[256];
#ifdef HAVE_GETADDRINFO
    struct addrinfo *a, hints;
#endif

    pa_assert(s);
    pa_assert(l > 0);

    if (!pa_get_host_name(hn, sizeof(hn)))
        return NULL;

#ifdef HAVE_GETADDRINFO
    memset(&hints, 0, sizeof(hints));
    hints.ai_family = AF_UNSPEC;
    hints.ai_flags = AI_CANONNAME;

    if (getaddrinfo(hn, NULL, &hints, &a) < 0 || !a || !a->ai_canonname || !*a->ai_canonname)
        return pa_strlcpy(s, hn, l);

    pa_strlcpy(s, a->ai_canonname, l);
    freeaddrinfo(a);
    return s;
#else
    return pa_strlcpy(s, hn, l);
#endif
}


Generated by  Doxygen 1.6.0   Back to index