Commit Graph

61 Commits

Author SHA1 Message Date
Gerald Combs fe6dc2f7c3 Fix for bug 4444.
svn path=/trunk/; revision=31780
2010-02-03 23:10:45 +00:00
Jeff Morriss 96044c161d From Hitoshi Irino via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4381 : restore dissection of netflow v9 packets.
svn path=/trunk/; revision=31745
2010-01-31 22:10:17 +00:00
Gerald Combs 080bbacb41 Preliminary fix for bug 4423.
svn path=/trunk/; revision=31735
2010-01-29 21:57:32 +00:00
Jeff Morriss aa5feea5b3 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4368 :
Don't use add_item() to add FT_ABSOLUTE_TIMEs. Instead either:
	- fetch the seconds (and maybe milliseconds) and use add_time()
	- (or) change the field to FT_BYTES and give the raw data to
	  ntp_fmt_ts() for presentation 

Also change BASE_NONE to ABSOLUTE_TIME_LOCAL for the remaining time fields.

svn path=/trunk/; revision=31725
2010-01-29 04:05:49 +00:00
Bill Meier 9b568ea691 Fix gcc -Wshadow warnings
svn path=/trunk/; revision=31561
2010-01-19 00:37:39 +00:00
Anders Broman dd9d463bcf From Hitoshi Irino:
Failed to decode NetFlow v9 packets including a 0 length scope field.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4381

svn path=/trunk/; revision=31488
2010-01-11 08:05:09 +00:00
Anders Broman 5e60817e81 From Hitoshi Irino:
More complete support for IPFIX Information Elements for packet-netflow.c
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4365

svn path=/trunk/; revision=31416
2010-01-03 14:23:08 +00:00
Stephen Fisher 49d7118bd2 Change two cases of FT_STRINGZ to BASE_NONE from BASE_HEX and BASE_DEC as
introduced in the last revision to this file.  This prevents an assertion
when starting tshark/wireshark.


svn path=/trunk/; revision=31359
2009-12-24 00:36:05 +00:00
Jaap Keuter 126782cfa9 From Kirby Files:
Cisco has recently released (in 15.0.1) support for integration between NBAR
and Flexible Netflow (FNF). This allows NBAR-recognized applications to be
identified in the Netflow output. To do so, 3 new template fields were added:
94: APPLICATION_DESC
95: APPLICATION_ID
96: APPLICATION_NAME

svn path=/trunk/; revision=31357
2009-12-23 20:24:41 +00:00
Guy Harris 8e236e55de For fields of type FT_ABSOLUTE_TIME, have the "display" value be one of
ABSOLUTE_TIME_LOCAL or ABSOLUTE_TIME_UTC, indicating whether to display
the date/time in local time or UTC. (int)ABSOLUTE_TIME_LOCAL ==
(int)BASE_NONE, so there's no source or binary compatiblity issue,
although we might want to eliminate BASE_NONE at some point and have the
BASE_ values used with integral types start at 0, so that you can't
specify BASE_NONE for an integral field.

svn path=/trunk/; revision=31319
2009-12-19 03:17:44 +00:00
Gerald Combs b11e3a7ea3 From Jason Rusmisel via bug 4199: Increase the maximum number of
template fields we handle from 20 to 30.

svn path=/trunk/; revision=30827
2009-11-05 01:01:01 +00:00
Jaap Keuter 8041e9732e From Jason Rusmisel:
The netflow implementation has a bug where the code exists to extract four
fields from a packet, however, the decoder for these fields has not been
registered in proto_register_netflow in the hf_register_info array. 
The fix is to include decoders for the fields in the proto_register_netflow.

svn path=/trunk/; revision=30809
2009-11-03 23:01:03 +00:00
Bill Meier c680dc89a3 Don't coerce a possibly unaligned ptr to a (guint32 *);
Also: Calculate the same template hash whether on a LE or BE machine.

svn path=/trunk/; revision=29598
2009-08-28 16:36:24 +00:00
Kovarththanan Rajaratnam 0a5b014cec Don't guard col_clear with col_check
svn path=/trunk/; revision=29344
2009-08-09 07:36:13 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Gerald Combs e951661130 Remove some unused variable assignments.
svn path=/trunk/; revision=29243
2009-07-30 16:17:46 +00:00
Gerald Combs 16c1dd1b2d Don't use tvb_memcpy to fill in a struct. (Cue Jamie Hyneman saying
"EVER!") Expand the entry/scope struct to include private enterprise
numbers instead of casting guint32s to arbritrary chunks of memory.
Limit the number of entries and scopes we allocate.  Don't allocate
memory every time we see a new template.  Don't use a C++ keyword for
variable names.

svn path=/trunk/; revision=29061
2009-07-10 23:39:23 +00:00
Stig Bjørlykke 0437f102c3 From Kovarththanan Rajaratnam:
More FT_XXX cleanup.

svn path=/trunk/; revision=28971
2009-07-07 09:02:59 +00:00
Anders Broman 3cc1acb3b1 CFLOW decoding is wrong for IPv6 fields.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3328

svn path=/trunk/; revision=28957
2009-07-06 17:37:03 +00:00
Gerald Combs 5631122d1d Try to allocate enough memory on all platforms.
svn path=/trunk/; revision=28930
2009-07-03 00:17:06 +00:00
Gerald Combs 88ba030310 From Kovarththanan Rajaratnam via bug 3567:
The template cache contains pointers that are session-scope (only freed in
netflow_reinit()) but still we use g_malloc(). This patch changes that so we
now use se_alloc(). With this patch I'm able to reproduce the crash
("Per-session memory corrupted").

svn path=/trunk/; revision=28927
2009-07-02 20:35:58 +00:00
Gerald Combs e2890d4053 Fix a couple of labels.
svn path=/trunk/; revision=28914
2009-07-01 23:36:35 +00:00
Gerald Combs a66905c3d2 Add a couple of IPFIX labels where they differ from Netflow.
svn path=/trunk/; revision=28912
2009-07-01 20:56:03 +00:00
Gerald Combs 0aaad68faf Try to fix fuzzing errors in bug 3636. When dissecting an options
template, differentiate between Netflow v9 and IPFIX, which require
different interpretations. Add other minor fixes and comments.

svn path=/trunk/; revision=28911
2009-07-01 19:36:24 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Bill Meier 548e468959 Misc dissector cleanup:
- Make some fcns & vars static
- hf[] blurbs: "" and repeated text --> NULL
- Move proto_register & proto_reg_handoff to end of source
- packet-catapult-dct2000: simplify proto_reg_handoff
- Use consistent indentation

svn path=/trunk/; revision=28488
2009-05-26 16:01:12 +00:00
Gerald Combs 9a72434b1e Add support for process flow records to IPFIX, which required adding
support for vendor-specific IEs. Fix variable-length record handling. Add
conversation tracking to the UDP dissector and add process flow
information to TCP and UDP conversations.

This lets us run process flow collectors on one or more machines and
have the process username, PID, command name, etc. show up in the TCP
and UDP protocol trees.

svn path=/trunk/; revision=28366
2009-05-14 23:33:17 +00:00
Bill Meier d6a5a7c761 P64 changes: Fix some cases for which size_t is not required
svn path=/trunk/; revision=27822
2009-03-22 20:55:31 +00:00
Gerald Combs e4892bb6c3 Make sure our offset increases, otherwise we'll go into a large loop.
svn path=/trunk/; revision=27682
2009-03-09 20:52:24 +00:00
Bill Meier c0e92cbc04 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27065
2008-12-20 00:09:02 +00:00
Bill Meier 49465bc00c Process port prefs only in prefs callback and not in registered init fcn
svn path=/trunk/; revision=26679
2008-11-03 15:15:56 +00:00
Jaap Keuter 8ddc5acb3c From Alexander Dupuy:
When dissecting an IPFIX PDU containing start and end times for both directions
of a biflow, no distinction is made between forward and reverse directions. 
This can lead to bizarre (or worse, subtly incorrect) output for the flow
durations computed from start and end times.
This patch fixes the specific problem of duration display in wireshark for
IPFIX biflow PDUs.  It does not address the general issue of tracking different
types of start/end timestamps separately - it is unlikely that the general case
will occur in practice, although it is certainly possible.

svn path=/trunk/; revision=26663
2008-10-31 23:00:57 +00:00
Stig Bjørlykke bd08ae7ee6 Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26647
2008-10-31 15:11:57 +00:00
Jaap Keuter 3934dfb936 From Alexander Dupuy:
More complete support for IPFIX RFC 5103 biflows.

svn path=/trunk/; revision=26536
2008-10-24 07:32:16 +00:00
Bill Meier 6aa5f8aa6a Minor cleanup related to proto_reg_handoff
svn path=/trunk/; revision=26246
2008-09-22 16:26:41 +00:00
Bill Meier 38eb4d6ce3 Use const with value_string array definitions
svn path=/trunk/; revision=26028
2008-08-14 23:51:52 +00:00
Guy Harris ea4fbda062 Don't fetch data until you need it.
svn path=/trunk/; revision=25907
2008-08-02 21:59:33 +00:00
Anders Broman 38ac851958 Fix packet-netflow.c:2666: warning: 'pen' may be used uninitialized in this function
and remove some C++ comments - some compilers don't allow them (at least not by default).

svn path=/trunk/; revision=25906
2008-08-02 16:13:40 +00:00
Anders Broman 7be2278d3c From Hitoshi Irino:
This patch
(1) fixes to decode IPFIX packets.
The revision 25601 warns and be not able to decodes IPFIX packets fully,
because the array "hf_register_info" does not have an entry
"hf_cflow_datarecord_length", and a length check for IPFIX packets is incorrect
in "dissect_netflow" function.
(2) is able to decode all Information Elements standardized by RFC 5102
(3) is able to decode IPFIX templates and data that contains PEN (Private
Enterprise Number) fields standardized by RFC 5101, and is able to decode
bi-directional flow standardized by RFC 5103.

svn path=/trunk/; revision=25905
2008-08-02 13:53:49 +00:00
Guy Harris 83fc9d5e09 Constify a bunch of stuff, to squelch -Wwrite-strings warnings.
epan/dissectors/packet-ncp2222.inc is a bit hard to fix, so we're not
ready to enable that warning by default yet.

Throw in some casts to handle GLib routines that take arbitrary
non-const pointers (they can later return the pointers, and some
callers might want to modify or free up those pointers in cases where
they're known to be writable or allocated).

Use ep_tvb_memdup() rather than a combination of ep_alloc() and
tvb_memcpy().

Clean up some indentation.

svn path=/trunk/; revision=25601
2008-06-25 09:12:35 +00:00
Bill Meier b3aa52f573 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25307
2008-05-15 12:54:27 +00:00
Sake Blok a4cec1cf5f From Andrew Ferren (big 2434):
While borrowing code from an other dissector I have worked on I realized I
previously "borrowed" a comment and typo.  Here's a fix.


svn path=/trunk/; revision=24928
2008-04-12 09:35:48 +00:00
Stig Bjørlykke 86358dc032 From Olivier Montanuy (bug 2198):
Fix the bug related to Option template:
- System scope (check that options scope size is == 4, not <= 4)
- Interface scope (same)
Same fix for fields BytesExported PacketsExported FlowsExported.
Also fix some tabulations in a previous patch related to IPv6 Addresses.

svn path=/trunk/; revision=24138
2008-01-19 10:46:13 +00:00
Bill Meier e4d58aa9f0 From Andrew feren; Fix typos in two comments ....
svn path=/trunk/; revision=23147
2007-10-11 16:40:12 +00:00
Jeff Morriss d3600969fb From Andrew Feren via http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1606 :
1) IPFIX port (4739) should be configurable without recompiling
2) It should be possible to specify more than one port to be dissected as
   Netflow and/or IPFIX
3) Netflow should recognize UDP ports 2055 and 9996 (Both are common)

Also (from me):
- make Netflow a "new style" dissector: return 0 if it doesn't appear to be a
  valid netflow packet
- register the old preference (cflow.udp.port) as obsolete so users don't see
  warnings about it not being valid

svn path=/trunk/; revision=23075
2007-10-05 21:25:35 +00:00
Jaap Keuter 02e0c97eed From Munenori Ohuchi:
packet-netflow.c is lack of the capability to decode ipv6 address related fields in netflow v9.

This patch enables dissecting the following fields:
 Type 27 IPV6_SRC_ADDR,
 Type 28 IPV6_DST_ADDR,
 Type 29 IPV6_SRC_MASK,
 Type 30 IPV6_DST_MASK and
 Type 62 IPV6_NEXT_HOP.

svn path=/trunk/; revision=22793
2007-09-05 06:59:24 +00:00
Jeff Morriss f8e0d53ecf Use SET_ADDRESS (instead of COPY_ADDRESS) for an address that has "ephemeral" scope. Use SE_COPY_ADDRESS when the address is copied to the template cache (with "seasonal" scope.)
svn path=/trunk/; revision=22571
2007-08-21 21:03:59 +00:00
Anders Broman 2427e6390d From Andrew Feren:
This patch collapses start and end time for each flow to a single duration item.  The duration item can, of course, be expanded to display the start and end time.

svn path=/trunk/; revision=21746
2007-05-11 06:21:18 +00:00
Anders Broman 386af8e774 From Olivier Montanuy:
Patch tested against traces obtained from Cisco IOS 12.4 Flexible Netflow,
IOS-XR 3.3, Huawei VRP 5.30.

Features:
- Decodes Netflow v9 option templates
- Decodes quite a few additional Netflow v9 types
- Packets and octets counters can be 64-bit
- Show unknown Netflow v9 fields as hexa, useful when using tshark -V with
  Netflow v9 implementations that use undocumented proprietary types.
  Enabled by:  "#define SHOW_UNKNOWN_TYPES 1"

svn path=/trunk/; revision=21672
2007-05-04 06:07:30 +00:00
Guy Harris ba3792fc78 memmove() is needed only if the source and destination might overlap.
svn path=/trunk/; revision=21590
2007-04-26 05:40:48 +00:00