@@ -0,0 +1,156 @@
+--- nprobe.c.orig 2015-05-26 13:22:34.481175802 +0200
++++ nprobe.c 2015-05-26 13:23:55.760988888 +0200
+@@ -1811,13 +1811,13 @@
+ " | value is %d. Use -1 as value to dynamically\n"
+ " | set to the last two bytes of\n"
+ " | the MAC address of the flow sender.\n",
+- (int16_t)readOnlyGlobals.inputInterfaceIndex);
++ (int32_t)readOnlyGlobals.inputInterfaceIndex);
+ printf("[--out-iface-idx|-Q] <out dev idx> | Index of the output device used in the\n");
+ printf(" | emitted flows (outgoing traffic). Default\n"
+ " | value is %d. Use -1 as value to dynamically\n"
+ " | set to the last two bytes of\n"
+ " | the MAC address of the flow receiver.\n",
+- (int16_t)readOnlyGlobals.outputInterfaceIndex);
++ (int32_t)readOnlyGlobals.outputInterfaceIndex);
+ printf("[--vlanid-as-iface-idx] <mode> | Use vlanId (0 for untagged traffic)\n"
+ " | as interface index. Mode specifies with\n"
+ " | stacked VLANs which vlanId to choose. Values\n"
+@@ -3440,9 +3440,9 @@
+
+ case 'u':
+ id = atoi(optarg);
+- if(id > (u_int16_t)-1)
++ if(id > (u_int32_t)-1)
+ traceEvent(TRACE_WARNING, "The -%c value %s it out of boundaries (0...%u) and it will be truncated",
+- opt, optarg, (u_int16_t)-1);
++ opt, optarg, (u_int32_t)-1);
+ readOnlyGlobals.inputInterfaceIndex = id;
+ break;
+
+@@ -3603,10 +3603,10 @@
+
+ case 'Q':
+ id = atoi(optarg);
+- if(id > (u_int16_t)-1)
++ if(id > (u_int32_t)-1)
+ traceEvent(TRACE_WARNING, "The -%c value %s it out of boundaries and it will be truncated",
+ opt, optarg);
+- readOnlyGlobals.outputInterfaceIndex = (u_int16_t)id;
++ readOnlyGlobals.outputInterfaceIndex = (u_int32_t)id;
+ break;
+
+ case 'T':
+--- nprobe.h.orig 2015-05-26 13:24:12.824992346 +0200
++++ nprobe.h 2015-05-26 13:24:49.416807866 +0200
+@@ -1505,7 +1505,8 @@
+ char *captureDev, *netFilter, *flowDumpFormat;
+ char *addr, *port;
+ char *bindAddr, *bindPort;
+- u_int16_t inputInterfaceIndex, outputInterfaceIndex, snaplen;
++ u_int32_t inputInterfaceIndex, outputInterfaceIndex;
++ u_int16_t snaplen;
+ char *dirPath;
+ time_t flowFd_close_time;
+ u_char useNetFlow, dontSentBidirectionalV9Flows, do_not_drop_privileges;
+--- bucket.h.orig 2015-05-26 13:59:34.442495558 +0200
++++ bucket.h 2015-05-26 13:59:44.694494601 +0200
+@@ -198,7 +198,7 @@
+ typedef struct hostInfo {
+ u_char macAddress[6];
+ u_int8_t mask;
+- u_int16_t ifIdx;
++ u_int32_t ifIdx;
+ u_int32_t ifHost, asn;
+ #ifdef HAVE_GEOIP
+ GeoIPRecord *geo; /* GeoIP */
+--- util.h.orig 2015-05-26 13:59:03.570672429 +0200
++++ util.h 2015-05-26 13:59:15.754678851 +0200
+@@ -136,7 +136,7 @@
+ extern char* etheraddr_string(const u_char *ep, char *buf);
+ extern void fixTemplateToIPFIX(void);
+ extern char* getStandardFieldId(u_int id);
+-extern u_int16_t ifIdx(FlowHashBucket *theFlow, int computeInputIfIdx);
++extern u_int32_t ifIdx(FlowHashBucket *theFlow, int computeInputIfIdx);
+ extern u_int32_t _getAS(IpAddress *addr, HostInfo *bkt);
+ extern void bitmask_set(u_int32_t n, bitmask_selector* p);
+ extern void bitmask_clr(u_int32_t n, bitmask_selector* p);
+--- util.c.orig 2015-05-26 14:00:09.178495015 +0200
++++ util.c 2015-05-26 14:02:34.797975386 +0200
+@@ -442,7 +442,7 @@
+
+ /* ******************************************** */
+
+-u_int16_t ifIdx(FlowHashBucket *myBucket,
++u_int32_t ifIdx(FlowHashBucket *myBucket,
+ int inputIfIdx /* 1=if_input, 0=if_output */) {
+ u_char *mac;
+ u_int16_t idx;
+--- engine.c.orig 2015-05-26 13:56:47.715000252 +0200
++++ engine.c 2015-05-28 16:42:15.199853856 +0200
+@@ -868,7 +868,7 @@
+
+ /* ****************************************************** */
+
+-static inline void updateHost(HostInfo *host, IpAddress *addr, u_int32_t ifHost, u_int16_t ifIdx) {
++static inline void updateHost(HostInfo *host, IpAddress *addr, u_int32_t ifHost, u_int32_t ifIdx) {
+ host->ifHost = ifHost, host->ifIdx = ifIdx;
+ }
+
+@@ -1478,7 +1478,7 @@
+ u_short vlanId,
+ IpAddress *src, u_short sport,
+ IpAddress *dst, u_short dport,
+- u_int16_t if_input, u_int16_t if_output,
++ u_int32_t if_input, u_int32_t if_output,
+ struct pcap_pkthdr *h, u_char *p,
+ u_int len,
+ u_int16_t payload_shift, u_int payloadLen,
+--- engine.h.orig 2015-05-28 16:44:47.396227594 +0200
++++ engine.h 2015-05-28 16:42:06.131852799 +0200
+@@ -141,7 +141,7 @@
+ u_short vlanId,
+ IpAddress *src, u_short sport,
+ IpAddress *dst, u_short dport,
+- u_int16_t if_input, u_int16_t if_output,
++ u_int32_t if_input, u_int32_t if_output,
+ struct pcap_pkthdr *h, u_char *p,
+ u_int len,
+ u_int16_t payload_shift, u_int payloadLen,
+--- template.c.orig 2015-05-28 16:52:37.846040084 +0200
++++ template.c 2015-05-28 17:05:19.175992299 +0200
+@@ -67,14 +67,14 @@
+ { 0, BOTH_IPV4_IPV6, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, L4_SRC_PORT_MAP, STATIC_FIELD_LEN, CUSTOM_FIELD_LEN, ascii_format, dump_as_ascii, "L4_SRC_PORT_MAP", "", "Layer 4 source port symbolic name" },
+ { 0, ONLY_IPV4, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, IPV4_SRC_ADDR, STATIC_FIELD_LEN, 4, numeric_format, dump_as_ipv4_address, "IPV4_SRC_ADDR", "sourceIPv4Address", "IPv4 source address" },
+ { 0, ONLY_IPV4, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, IPV4_SRC_MASK, STATIC_FIELD_LEN, 1, numeric_format, dump_as_uint, "IPV4_SRC_MASK", "sourceIPv4PrefixLength", "IPv4 source subnet mask (/<bits>)" },
+- { 0, BOTH_IPV4_IPV6, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, INPUT_SNMP, STATIC_FIELD_LEN, 2, numeric_format, dump_as_uint, "INPUT_SNMP", "ingressInterface", "Input interface SNMP idx" },
++ { 0, BOTH_IPV4_IPV6, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, INPUT_SNMP, STATIC_FIELD_LEN, 4, numeric_format, dump_as_uint, "INPUT_SNMP", "ingressInterface", "Input interface SNMP idx" },
+ { 0, BOTH_IPV4_IPV6, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, L4_DST_PORT, STATIC_FIELD_LEN, 2, numeric_format, dump_as_uint, "L4_DST_PORT", "destinationTransportPort", "IPv4 destination port" },
+ { 0, BOTH_IPV4_IPV6, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, L4_DST_PORT_MAP, STATIC_FIELD_LEN, CUSTOM_FIELD_LEN, ascii_format, dump_as_ascii, "L4_DST_PORT_MAP", "", "Layer 4 destination port symbolic name" },
+ { 0, BOTH_IPV4_IPV6, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, L4_SRV_PORT, STATIC_FIELD_LEN, 2, numeric_format, dump_as_uint, "L4_SRV_PORT", "", "Layer 4 server port" },
+ { 0, BOTH_IPV4_IPV6, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, L4_SRV_PORT_MAP, STATIC_FIELD_LEN, CUSTOM_FIELD_LEN, ascii_format, dump_as_ascii, "L4_SRV_PORT_MAP", "", "Layer 4 server port symbolic name" },
+ { 0, ONLY_IPV4, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, IPV4_DST_ADDR, STATIC_FIELD_LEN, 4, numeric_format, dump_as_ipv4_address, "IPV4_DST_ADDR", "destinationIPv4Address", "IPv4 destination address" },
+ { 0, ONLY_IPV4, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, IPV4_DST_MASK, STATIC_FIELD_LEN, 1, numeric_format, dump_as_uint, "IPV4_DST_MASK", "destinationIPv4PrefixLength", "IPv4 dest subnet mask (/<bits>)" },
+- { 0, BOTH_IPV4_IPV6, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, OUTPUT_SNMP, STATIC_FIELD_LEN, 2, numeric_format, dump_as_uint, "OUTPUT_SNMP", "egressInterface", "Output interface SNMP idx" },
++ { 0, BOTH_IPV4_IPV6, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, OUTPUT_SNMP, STATIC_FIELD_LEN, 4, numeric_format, dump_as_uint, "OUTPUT_SNMP", "egressInterface", "Output interface SNMP idx" },
+ { 0, ONLY_IPV4, FLOW_TEMPLATE, SHORT_SNAPLEN, STANDARD_ENTERPRISE_ID, IPV4_NEXT_HOP, STATIC_FIELD_LEN, 4, numeric_format, dump_as_ipv4_address, "IPV4_NEXT_HOP", "ipNextHopIPv4Address", "IPv4 next hop address" },
+
+ /* In earlier versions AS were 16 bit in 'modern' NetFlow v9 and later, they are 32 bit */
+@@ -553,7 +553,7 @@
+ outBuffer, outBufferBegin, outBufferMax);
+ break;
+ case INPUT_SNMP:
+- if(readOnlyGlobals.netFlowVersion == 10)
++ if((readOnlyGlobals.netFlowVersion == 10) || (readOnlyGlobals.netFlowVersion == 9))
+ copyInt32((theFlow->ext == NULL) ? 0 : ((direction == src2dst_direction) ? theFlow->ext->if_input : theFlow->ext->if_output), outBuffer, outBufferBegin, outBufferMax);
+ else
+ copyInt16((theFlow->ext == NULL) ? 0 : ((direction == src2dst_direction) ? theFlow->ext->if_input : theFlow->ext->if_output), outBuffer, outBufferBegin, outBufferMax);
+@@ -577,7 +577,7 @@
+ outBuffer, outBufferBegin, outBufferMax);
+ break;
+ case OUTPUT_SNMP:
+- if(readOnlyGlobals.netFlowVersion == 10)
++ if((readOnlyGlobals.netFlowVersion == 10) || (readOnlyGlobals.netFlowVersion == 9))
+ copyInt32((theFlow->ext == NULL) ? 0 : ((direction != src2dst_direction) ? theFlow->ext->if_input : theFlow->ext->if_output), outBuffer, outBufferBegin, outBufferMax);
+ else
+ copyInt16((theFlow->ext == NULL) ? 0 : ((direction != src2dst_direction) ? theFlow->ext->if_input : theFlow->ext->if_output), outBuffer, outBufferBegin, outBufferMax);
|