Logo Search packages:      
Sourcecode: avahi version File versions

int avahi_is_valid_host_name ( const char *  t  ) 

Return 1 when the specified string contains a valid non-FQDN host name (i.e. without dots), 0 otherwise

Definition at line 407 of file domain.c.

References AVAHI_DOMAIN_NAME_MAX, and AVAHI_LABEL_MAX.

                                            {
    char label[AVAHI_LABEL_MAX];
    assert(t);

    if (strlen(t) >= AVAHI_DOMAIN_NAME_MAX || !*t)
        return 0;

    if (!(avahi_unescape_label(&t, label, sizeof(label))))
        return 0;

    if (strlen(label) < 1)
        return 0;

    if (*t)
        return 0;

    return 1;
}


Generated by  Doxygen 1.6.0   Back to index