Logo Search packages:      
Sourcecode: avahi version File versions  Download package

int avahi_is_valid_service_type_generic ( const char *  t )

Return 1 when the specified string contains a valid generic DNS-SD service type (i.e. a series of words starting with "_"), 0 otherwise

Definition at line 254 of file domain.c.

References AVAHI_DOMAIN_NAME_MAX, and AVAHI_LABEL_MAX.

                                                       {
    assert(t);

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

    do {
        char label[AVAHI_LABEL_MAX];

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

        if (strlen(label) <= 2 || label[0] != '_')
            return 0;

    } while (*t);

    return 1;
}

Generated by  Doxygen 1.6.0   Back to index