}
int templateDataMatchesRule(TemplateInfo* info, FieldData* data, Rule* rule) {	int i;	FieldInfo* fieldInfo;	for (i = 0; i < rule->fieldCount; i++) {		RuleField* ruleField = rule->field[i];				/* for all patterns of this rule, check if they are matched */		if (rule->field[i]->pattern) {			fieldInfo = getTemplateFieldInfo(info, &ruleField->type);			if (fieldInfo) {				/* corresponding data field found, check if it matches. If it doesn't the whole rule cannot be matched */				if (!matchesPattern(&fieldInfo->type, (data + fieldInfo->offset), &ruleField->type, ruleField->pattern)) return 0;				if (!checkAssociatedMask(info, data, ruleField)) return 0;				continue;							}			/* no corresponding data field found, this flow cannot match */			debugf("No corresponding DataRecord field for RuleField of type %s", typeid2string(ruleField->type.id));			return 0;			}		/* if a non-discarding rule field specifies no pattern, check at least if the data field exists */		else if (rule->field[i]->modifier != FIELD_MODIFIER_DISCARD) {			fieldInfo = getTemplateFieldInfo(info, &ruleField->type);			if (fieldInfo) continue;			debugf("No corresponding DataRecord field for RuleField of type %s", typeid2string(ruleField->type.id));			return 0;			}		}		/* all rule fields were matched */	return 1;	}	