int j; if (strlen(buf) < flen) for (j = 0; j < flen-strlen(buf); j++) fprintf(myIpfixPrinter->stream, " ");
}
int printDataTemplate(void* ipfixPrinter_, SourceID sourceID, DataTemplateInfo* dataTemplateInfo) {	int i;	int j;	int lineLen;	char buf[40];	IpfixPrinter* myIpfixPrinter = (IpfixPrinter*)ipfixPrinter_;	myIpfixPrinter->lastTemplate = dataTemplateInfo;	fprintf(myIpfixPrinter->stream, "\n\n");	fprintf(myIpfixPrinter->stream, "Data Template\n");	lineLen = 0;	for (i = 0; i < dataTemplateInfo->dataCount; i++) {		if (i > 0) { fprintf(myIpfixPrinter->stream, "|"); lineLen++; }		FieldType ftype = dataTemplateInfo->dataInfo[i].type;		int flen = fieldTypeToStringLength(ftype); lineLen+=flen;		if (fieldTypeToString(ftype, buf, 40) == -1) {			error("Error converting fieldType");			continue;			}		if (strlen(buf) < flen) for (j = 0; j < flen-strlen(buf); j++) fprintf(myIpfixPrinter->stream, " ");		fprintf(myIpfixPrinter->stream, "%s", buf);		}	fprintf(myIpfixPrinter->stream, "\n");	for (j = 0; j < lineLen; j++) fprintf(myIpfixPrinter->stream, "-");	fprintf(myIpfixPrinter->stream, "\n");	for (i = 0; i < dataTemplateInfo->dataCount; i++) {		if (i > 0) fprintf(myIpfixPrinter->stream, "|");		FieldType ftype = dataTemplateInfo->dataInfo[i].type;		FieldData* fdata = dataTemplateInfo->data + dataTemplateInfo->dataInfo[i].offset;		int flen = fieldTypeToStringLength(ftype);		if (fieldToString(ftype, fdata, buf, 40) == -1) {			error("Error converting field");			continue;			}		int j;		if (strlen(buf) < flen) for (j = 0; j < flen-strlen(buf); j++) fprintf(myIpfixPrinter->stream, " ");		fprintf(myIpfixPrinter->stream, "%s", buf);		}	fprintf(myIpfixPrinter->stream, "\n");	fprintf(myIpfixPrinter->stream, "\n");	lineLen = 0;	for (i = 0; i < dataTemplateInfo->fieldCount; i++) {		if (i > 0) { fprintf(myIpfixPrinter->stream, "|"); lineLen++; }		FieldType ftype = dataTemplateInfo->fieldInfo[i].type;		int flen = fieldTypeToStringLength(ftype); lineLen+=flen;		if (fieldTypeToString(ftype, buf, 40) == -1) {			error("Error converting fieldType");			continue;			}		if (strlen(buf) < flen) for (j = 0; j < flen-strlen(buf); j++) fprintf(myIpfixPrinter->stream, " ");		fprintf(myIpfixPrinter->stream, "%s", buf);		}	fprintf(myIpfixPrinter->stream, "\n");	for (j = 0; j < lineLen; j++) fprintf(myIpfixPrinter->stream, "=");	fprintf(myIpfixPrinter->stream, "\n");	return 0;	}