void printField(FieldInfo fi, byte* data) { data = data + fi.offset; if (fi.type == IPFIX_Type_protocolIdentifier) { if (*data == IPFIX_protocolIdentifier_TCP) debugs("Proto is TCP"); else if (*data == IPFIX_protocolIdentifier_UDP) debugs("Proto is UDP"); else debugs("Proto is unknown"); } if (fi.type == IPFIX_Type_sourceAddressV4) { debug("From %d", ntohl(*(uint32*)data)); } if (fi.type == IPFIX_Type_destinationAddressV4) { debug("To %d", ntohl(*(uint32*)data)); } if (fi.type == IPFIX_Type_deltaOctetCount) { debug("%d Bytes", ntohl(*(uint32*)data)); } if (fi.type == IPFIX_Type_deltaPacketCount) { debug("%d Packets", ntohl(*(uint32*)data)); } if (fi.type == IPFIX_Type_transportSourcePort) { debug("Source Port is %d", ntoh(*(uint16*)data)); } if (fi.type == IPFIX_Type_transportDestinationPort) { debug("Dest Port is %d", ntoh(*(uint16*)data)); }
void printField(FieldInfo fi, FieldData* data) { printFieldData(fi.typeX, data+fi.offset); printf("\n");
void printField(FieldInfo fi, byte* data) {	data = data + fi.offset;	if (fi.type == IPFIX_Type_protocolIdentifier) {		if (*data == IPFIX_protocolIdentifier_TCP) debugs("Proto is TCP"); else		if (*data == IPFIX_protocolIdentifier_UDP) debugs("Proto is UDP"); else		debugs("Proto is unknown");		}	if (fi.type == IPFIX_Type_sourceAddressV4) {		debug("From %d", ntohl(*(uint32*)data));		}	if (fi.type == IPFIX_Type_destinationAddressV4) {		debug("To %d", ntohl(*(uint32*)data));		}	if (fi.type == IPFIX_Type_deltaOctetCount) {		debug("%d Bytes", ntohl(*(uint32*)data));		}	if (fi.type == IPFIX_Type_deltaPacketCount) {		debug("%d Packets", ntohl(*(uint32*)data));		}	if (fi.type == IPFIX_Type_transportSourcePort) {		debug("Source Port is %d", ntoh(*(uint16*)data));		}	if (fi.type == IPFIX_Type_transportDestinationPort) {		debug("Dest Port is %d", ntoh(*(uint16*)data));		}	}