/* offs: current offset within tvb header_length: length of meta header  */
static gint32 evaluate_meta_items(guint16 schema, tvbuff_t *tvb, packet_info *pinfo, proto_tree *meta_tree, guint16 offs, gint32 header_length, struct atm_phdr *atm_info)
/* offs: current offset within tvb header_length: length of meta header  */
static gint32 evaluate_meta_items(guint16 schema, tvbuff_t *tvb, packet_info *pinfo, proto_tree *meta_tree, guint16 offs, gint32 header_length, struct atm_phdr *atm_info)
{
    gint16 item_len;
    gint32 total_len = 0;
    while (total_len < header_length) {
        switch (schema) {
            case META_SCHEMA_DXT:
                item_len = evaluate_meta_item_dxt(meta_tree, tvb, pinfo, offs + total_len, atm_info);
                break;
            case META_SCHEMA_PCAP:
                item_len = evaluate_meta_item_pcap(meta_tree, tvb, pinfo, offs + total_len);
                break;
            default:
                item_len = skip_item(meta_tree, tvb, pinfo, offs + total_len);
        }
        if (item_len < 4) {
            expert_add_info_format(pinfo, meta_tree, &ei_meta_malformed,
                "Malformed Packet %s (wrong item encoding)", pinfo->current_proto);
            return -1;
        }
        total_len += item_len;
    }
    return total_len;
}