int string2typelength(char*s) { if (strcmp(s, "ipVersion"                   ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "sourceIPv4Address"           ) == 0) return IPFIX_LENGTH_ipv4Address; if (strcmp(s, "sourceIPv6Address"           ) == 0) return IPFIX_LENGTH_ipv6Address; if (strcmp(s, "sourceIPv4Mask"              ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "sourceIPv6Mask"              ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "sourceIPv4Prefix"            ) == 0) return IPFIX_LENGTH_ipv4Address; if (strcmp(s, "destinationIPv4Address"      ) == 0) return IPFIX_LENGTH_ipv4Address; if (strcmp(s, "destinationIPv6Address"      ) == 0) return IPFIX_LENGTH_ipv6Address; if (strcmp(s, "destinationIPv4Mask"         ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "destinationIPv6Mask"         ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "destinationIPv4Prefix"       ) == 0) return IPFIX_LENGTH_ipv4Address; if (strcmp(s, "classOfServiceIPv4"          ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "classOfServiceV6"            ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "flowLabelV6"                 ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "identificationV4"            ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "protocolIdentifier"          ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "sourceTransportPort"         ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "destinationtransportPort"    ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "icmpTypeCode"                ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "igmpType"                    ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "sourceMacAddress"            ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "mplsLabelStackEntry1"        ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "mplsLabelStackEntry2"        ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "mplsLabelStackEntry3"        ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "mplsLabelStackEntry4"        ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "mplsLabelStackEntry5"        ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "mplsLabelStackEntry6"        ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "mplsLabelStackEntry7"        ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "mplsLabelStackEntry8"        ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "mplsLabelStackEntry9"        ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "mplsLabelStackEntry10"       ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "ipNextHopIPv4Address"        ) == 0) return IPFIX_LENGTH_ipv4Address; if (strcmp(s, "ipNextHopIPv6Address"        ) == 0) return IPFIX_LENGTH_ipv6Address; if (strcmp(s, "ingressInterface"            ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "egressInterface"             ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "ipNextHopAsNumber"           ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "bgpSourceAsNumber"           ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "bgpDestinationAsNumber"      ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "bgpNextHopAsNumber"          ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "bgpNextHopIPv4Address"       ) == 0) return IPFIX_LENGTH_ipv4Address; if (strcmp(s, "bgpNextHopIPv6Address"       ) == 0) return IPFIX_LENGTH_ipv6Address; if (strcmp(s, "mplsTopLabelType"            ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "mplsTopLabelIPv4Address"     ) == 0) return IPFIX_LENGTH_ipv4Address; if (strcmp(s, "mplsTopLabelIPv6Address"     ) == 0) return IPFIX_LENGTH_ipv4Address; if (strcmp(s, "exporterIPv4Address"         ) == 0) return IPFIX_LENGTH_ipv4Address; if (strcmp(s, "exporterIPv6Address"         ) == 0) return IPFIX_LENGTH_ipv6Address; if (strcmp(s, "minPacketLength"             ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "maxPacketLength"             ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "minimumTTL"                  ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "maximumTTL"                  ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "ipv6OptionHeaders"           ) == 0) return IPFIX_LENGTH_unsigned32; if (strcmp(s, "tcpControlBits"              ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "flowCreationTime"            ) == 0) return IPFIX_LENGTH_dateTimeSeconds; if (strcmp(s, "flowEndTime"                 ) == 0) return IPFIX_LENGTH_dateTimeSeconds; if (strcmp(s, "flowActiveTimeOut"           ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "flowInactiveTimeout"         ) == 0) return IPFIX_LENGTH_unsigned16; if (strcmp(s, "flowEndReason"               ) == 0) return IPFIX_LENGTH_octet; if (strcmp(s, "inOctetDeltaCount"           ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "outOctetDeltaCount"          ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "octetDeltaCount"             ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "octetTotalCount"             ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "inPacketDeltaCount"          ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "outPacketDeltaCount"         ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "packetDeltaCount"            ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "packetTotalCount"            ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "droppedOctetDeltaCount"      ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "droppedOctetTotalCount"      ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "droppedPacketDeltaCount"     ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "droppedPacketTotalCount"     ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "outMulticastPacketCount"     ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "outMulticastOctetCount"      ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "observedFlowTotalCount"      ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "exportedOctetTotalCount"     ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "exportedPacketTotalCount"    ) == 0) return IPFIX_LENGTH_unsigned64; if (strcmp(s, "exportedFlowTotalCount"      ) == 0) return IPFIX_LENGTH_unsigned64; return 0;
int string2typelength(char *s) { const struct ipfix_identifier *ix;  ix=ipfix_id_lookup(ipfix_name_lookup(s));  if(!ix) { return 0;
int string2typelength(char*s) {	if (strcmp(s, "ipVersion"                   ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "sourceIPv4Address"           ) == 0) return IPFIX_LENGTH_ipv4Address; 	if (strcmp(s, "sourceIPv6Address"           ) == 0) return IPFIX_LENGTH_ipv6Address; 	if (strcmp(s, "sourceIPv4Mask"              ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "sourceIPv6Mask"              ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "sourceIPv4Prefix"            ) == 0) return IPFIX_LENGTH_ipv4Address; 	if (strcmp(s, "destinationIPv4Address"      ) == 0) return IPFIX_LENGTH_ipv4Address; 	if (strcmp(s, "destinationIPv6Address"      ) == 0) return IPFIX_LENGTH_ipv6Address; 	if (strcmp(s, "destinationIPv4Mask"         ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "destinationIPv6Mask"         ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "destinationIPv4Prefix"       ) == 0) return IPFIX_LENGTH_ipv4Address; 	if (strcmp(s, "classOfServiceIPv4"          ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "classOfServiceV6"            ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "flowLabelV6"                 ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "identificationV4"            ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "protocolIdentifier"          ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "sourceTransportPort"         ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "destinationtransportPort"    ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "icmpTypeCode"                ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "igmpType"                    ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "sourceMacAddress"            ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "mplsLabelStackEntry1"        ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "mplsLabelStackEntry2"        ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "mplsLabelStackEntry3"        ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "mplsLabelStackEntry4"        ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "mplsLabelStackEntry5"        ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "mplsLabelStackEntry6"        ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "mplsLabelStackEntry7"        ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "mplsLabelStackEntry8"        ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "mplsLabelStackEntry9"        ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "mplsLabelStackEntry10"       ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "ipNextHopIPv4Address"        ) == 0) return IPFIX_LENGTH_ipv4Address; 	if (strcmp(s, "ipNextHopIPv6Address"        ) == 0) return IPFIX_LENGTH_ipv6Address; 	if (strcmp(s, "ingressInterface"            ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "egressInterface"             ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "ipNextHopAsNumber"           ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "bgpSourceAsNumber"           ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "bgpDestinationAsNumber"      ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "bgpNextHopAsNumber"          ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "bgpNextHopIPv4Address"       ) == 0) return IPFIX_LENGTH_ipv4Address; 	if (strcmp(s, "bgpNextHopIPv6Address"       ) == 0) return IPFIX_LENGTH_ipv6Address; 	if (strcmp(s, "mplsTopLabelType"            ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "mplsTopLabelIPv4Address"     ) == 0) return IPFIX_LENGTH_ipv4Address; 	if (strcmp(s, "mplsTopLabelIPv6Address"     ) == 0) return IPFIX_LENGTH_ipv4Address; 	if (strcmp(s, "exporterIPv4Address"         ) == 0) return IPFIX_LENGTH_ipv4Address; 	if (strcmp(s, "exporterIPv6Address"         ) == 0) return IPFIX_LENGTH_ipv6Address; 	if (strcmp(s, "minPacketLength"             ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "maxPacketLength"             ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "minimumTTL"                  ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "maximumTTL"                  ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "ipv6OptionHeaders"           ) == 0) return IPFIX_LENGTH_unsigned32; 	if (strcmp(s, "tcpControlBits"              ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "flowCreationTime"            ) == 0) return IPFIX_LENGTH_dateTimeSeconds; 	if (strcmp(s, "flowEndTime"                 ) == 0) return IPFIX_LENGTH_dateTimeSeconds; 	if (strcmp(s, "flowActiveTimeOut"           ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "flowInactiveTimeout"         ) == 0) return IPFIX_LENGTH_unsigned16; 	if (strcmp(s, "flowEndReason"               ) == 0) return IPFIX_LENGTH_octet; 	if (strcmp(s, "inOctetDeltaCount"           ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "outOctetDeltaCount"          ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "octetDeltaCount"             ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "octetTotalCount"             ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "inPacketDeltaCount"          ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "outPacketDeltaCount"         ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "packetDeltaCount"            ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "packetTotalCount"            ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "droppedOctetDeltaCount"      ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "droppedOctetTotalCount"      ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "droppedPacketDeltaCount"     ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "droppedPacketTotalCount"     ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "outMulticastPacketCount"     ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "outMulticastOctetCount"      ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "observedFlowTotalCount"      ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "exportedOctetTotalCount"     ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "exportedPacketTotalCount"    ) == 0) return IPFIX_LENGTH_unsigned64; 	if (strcmp(s, "exportedFlowTotalCount"      ) == 0) return IPFIX_LENGTH_unsigned64; 	return 0;	}