/* function checks that variable value is in array ((xmpp_array_t)data)->data  */
void xmpp_val_enum_list(packet_info *pinfo, proto_item *item, const gchar *name, const gchar *value, gconstpointer data)
/* function checks that variable value is in array ((xmpp_array_t)data)->data  */
void xmpp_val_enum_list(packet_info *pinfo, proto_item *item, const gchar *name, const gchar *value, gconstpointer data)
{
    const xmpp_array_t *enums_array = (const xmpp_array_t *)data;
    gint i;
    gboolean value_in_enums = FALSE;
    gchar **enums =  (char**)enums_array->data;
    if (value != NULL) {
        for (i = 0; i < enums_array->length; i++) {
            if (strcmp(value, enums[i]) == 0) {
                value_in_enums = TRUE;
                break;
            }
        }
        if (!value_in_enums) {
            expert_add_info_format(pinfo, item, &ei_xmpp_field_unexpected_value, "Field \"%s\" has unexpected value \"%s\"", name, value);
        }
    }
}