Commit Graph

46 Commits

Author SHA1 Message Date
Martin Mathieson 23f8f9cf6a Show version and mode in protocol root. Now dissects details whether tree is NULL or not.
svn path=/trunk/; revision=38309
2011-08-02 10:35:22 +00:00
Stephen Fisher eec3e70821 Change descriptions of NTP Reference Identifier Codes for stratum 1
servers to match IANA assignment / RFC 5905.  A number of codes already
in Wireshark that aren't assigned were left intact.


svn path=/trunk/; revision=36136
2011-03-04 00:25:56 +00:00
Stephen Fisher 47b9a1235e Correct the usage of tvb_memeql() after r35558: it doesn't return true
if the values are the same; we have to check for "== 0" to see if they
are the same. 


svn path=/trunk/; revision=36135
2011-03-04 00:17:01 +00:00
Stephen Fisher ed9de27ba1 Change "Reference Clock ID" to "Reference ID" to match RFC5905 (also
mention this RFC in the comments).


svn path=/trunk/; revision=36134
2011-03-03 23:48:56 +00:00
Stephen Fisher 4c6e0d3604 Clarify / add explanations for the fields
svn path=/trunk/; revision=36133
2011-03-03 23:47:05 +00:00
Stephen Fisher 191f6622e1 Display the NTP version in COL_INFO so tshark output (without -V) looks
more like tcpdump.


svn path=/trunk/; revision=36097
2011-02-28 18:00:34 +00:00
Jeff Morriss 50e1634f4c Modify proto_tree_add_bytes_format() and proto_tree_add_bytes_format_value()
so that if the start_ptr is NULL the bytes are extracted from the given TVB
using the given offset and length.

Replace a bunch of:

proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, tvb_get_ptr(tvb, offset, length), [...])

with:

proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, NULL, [...])

svn path=/trunk/; revision=35896
2011-02-10 16:31:00 +00:00
Jeff Morriss 13d8e41e0f A couple of dissectors have/need an NTP-to-nstime routine, so put it in
packet-ntp and export it to the other dissectors.

Move some macros (now) only used in packet-ntp.c into that file.

svn path=/trunk/; revision=35887
2011-02-09 03:24:12 +00:00
Jeff Morriss 92cd49b4c2 Rename ntp_fmt_ts() to tvb_ntp_fmt_ts() and make it take a pointer to a TVB and
an offset instead of (generally) a pointer into the TVB. Then use the standard
accessor functions to get data out of the TVB.


svn path=/trunk/; revision=35886
2011-02-09 03:00:51 +00:00
Guy Harris 4f7ae8bf3a For FT_{ABSOLUTE,RELATIVE}_TIME, make the rest of the encoding
orthogonal to the byte order.

This means that we can't just test for a non-zero encoding to determine
whether the format is big-endian or little-endian when we set the
field's endianness flag; instead, for the types where we accept any
non-zero value as meaning "litle-endian", map it to ENC_LITTLE_ENDIAN.

When we use ENC_TIME_NTP, OR in the byte order flag.  While we're at it,
in the dissectors that used ENC_TIME_NTP, update all the other encoding
items in proto_tree_add_item() calls to use the appropriate ENC_ value.

svn path=/trunk/; revision=35841
2011-02-07 08:18:12 +00:00
Jeff Morriss 8fc6e28b6a Add support for passing NTP times to proto_tree_add_item() by specifying
an encoding of ENC_TIME_NTP.

This increases the number of decimal places shown for NTP times (from 6 to 9),
so round the value to the nearest microsecond.  (I can't tell if NTP times are
ever more precise than a microsecond--this rounding is mainly to be closer to
the old behavior.)

Use proto_tree_add_item() for some NTP times.

svn path=/trunk/; revision=35840
2011-02-07 03:31:40 +00:00
Sake Blok 6e74ad9097 Adress => Address corrections (also in comments).
(see bug 5600)


svn path=/trunk/; revision=35600
2011-01-21 00:19:03 +00:00
Jeff Morriss 705f2ede5d Roll some calls to tvb_get_ptr() into proto_tree_add_bytes_format() (instead
of going through a temporary variable).  This just makes it more obvious which
add_bytes_format() calls are or are not being given pointers into the TVB.

Use tvb_ip_to_str() and tvb_ip6_to_str() in a couple spots.

svn path=/trunk/; revision=35593
2011-01-20 03:49:44 +00:00
Jeff Morriss 8d32d2066a There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().

Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or
tvb_get_const_stringz().

Use tvb_memeql() & tvb_memcmp().

svn path=/trunk/; revision=35558
2011-01-16 20:51:21 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Bill Meier 7b85f43d0e Do some constifying [or other] based upon gcc -Wwrite-strings warnings.
svn path=/trunk/; revision=33198
2010-06-09 18:12:17 +00:00
Stig Bjørlykke f945be91f6 Rewrote to avoid "More data arguments than '%' conversions" warning.
svn path=/trunk/; revision=32908
2010-05-20 11:56:58 +00:00
Jeff Morriss 9c3d944191 Empty strings are not very useful abbreviations. Even if it seems unlikely someone would want to filter on a specific field, we should give the user the option.
svn path=/trunk/; revision=32559
2010-04-25 17:38:46 +00:00
Jaap Keuter 6f9eb5b7af From Dave Higton:
When decoding NTP where the Reference Clock ID is "MSF/0", Wireshark textifies
this as "Rugby (UK) Radio 60 kHz".  The MSF transmitter was moved several years
ago from Rugby to Anthorn.

Also updates from RFC 4330.

svn path=/trunk/; revision=32481
2010-04-15 21:12:34 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Guy Harris 1d95b0d4bf Squelch a compiler warning.
svn path=/trunk/; revision=31078
2009-11-25 22:30:41 +00:00
Jaap Keuter 1fcf44886e From Michael Speck:
This patch enhances dissection of NTP protocol's Control messages 
as described in RFC1119 and RFC1305.

svn path=/trunk/; revision=31077
2009-11-25 21:47:28 +00:00
Jeff Morriss 3b2c741db6 From Steve via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3781 :
In ntp_fmt_ts() in packet-ntp.c time stamps are displayed to 4 digits (0.1
msec).   More digits may be significant (e.g., if GPS local clocks are used).

Change time stamp format in g_snprintf() from
  %07.4f
to
  %09.6f


svn path=/trunk/; revision=29961
2009-09-17 03:01:26 +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
Stig Bjørlykke 0437f102c3 From Kovarththanan Rajaratnam:
More FT_XXX cleanup.

svn path=/trunk/; revision=28971
2009-07-07 09:02:59 +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
Gerald Combs c1e7e4b619 From Peter Hertting: Fix the maximum poll interval.
svn path=/trunk/; revision=27930
2009-04-02 03:55:37 +00:00
Jaap Keuter d4b79ec466 NTP version 1 and 2 can be used as well.
svn path=/trunk/; revision=27290
2009-01-23 19:36:48 +00:00
Gerald Combs 6d04f793f0 Back out r27047 and r27053.
svn path=/trunk/; revision=27062
2008-12-19 17:39:52 +00:00
Gerald Combs fc71188963 Update calls to proto_tree_add_bytes_format to reflect r27047.
svn path=/trunk/; revision=27053
2008-12-18 20:19:49 +00:00
Gerald Combs b65d445bf2 Fix a typo found by Don Arrowsmith.
svn path=/trunk/; revision=25056
2008-04-15 21:45:46 +00:00
Anders Broman 9d316093f6 Apply yet another set of the optimization patches:
-set_str2add_str_val_to_str

svn path=/trunk/; revision=23406
2007-11-08 22:49:03 +00:00
Jaap Keuter 0f1cdf8c1d Added functionality proposed in bug 1233.
Clean up of source code.

svn path=/trunk/; revision=20329
2007-01-05 13:42:08 +00:00
Jaap Keuter f7aa75ba22 From Xiaoguang Liu
In wireshark a NTP field is displayed as "clock dispersion". 
But should it be called "root dispersion" as per RFC 1305? 

svn path=/trunk/; revision=19705
2006-10-26 14:36:09 +00:00
Jaap Keuter cfa1bda00b From Toralf Foerster (in bug 1044):
Add new primary sources, fix typo. 

svn path=/trunk/; revision=19007
2006-08-23 15:51:15 +00:00
Gerald Combs bbc5a76517 Fix more bugs found by Ilja van Sprundel.
packet-mount.c:
  Don't allocate a huge amount of memory.

packet-ntp.c:
  Fix a possible format string bug.

packet-ndps.c:
packet-nmas.c:
  Fix an off-by-one buffer error.

svn path=/trunk/; revision=18678
2006-07-07 04:01:09 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Jörg Mayer 1900bf87fc done:
packet-ntp.c: Rather confused and incorrect use of g_snprintf return value
packet-pim.c: whitespace change
packet-icmpv6.c: g_snprintf takes trailing \0 into account, fix off by 1 error
packet-clnp.c: Fix incorrect use of g_snprintf return value
packet-isakmp.c: g_snprintf takes trailing \0 into account
packet-tr.c: Fix incorrect use of g_snprintf return value
packet-radius.c: Fix incorrect use of g_snprintf return value
packet-radius.h: constify a string variable
packet-ldap.c: The return value isn't needed, so don't use it incorrectly
packet-tcp.c: Fix incorrect use of g_snprintf return value
packet-windows-common.c: Remove unneeded DISSECTOR_ASSERT
packet-smb-sidsnooping.c: g_snprintf takes trailing \0 into account
packet-pvfs2.c: g_snprintf takes trailing \0 into account
packet-ptp.c: Remove #include snprintf
packet-ppp.c: Fix incorrect use of g_snprintf return value
packet-ospf.c: Fix incorrect use of g_snprintf return value
packet-mip6.c: snprintf -> g_snprintf
packet-bootp.c: Remove a commented out bad use of g_snprintf
packet-ber.c: snprintf -> g_snprintf, g_snprintf takes trailing \0 into account

2do:

     52 packet-ieee80211.c: 2DO
      2 packet-nfs.c: 2DO - too many side effects
     33 packet-bgp.c: 2DO
     18 packet-dns.c: 2DO
     14 packet-dcm.c: 2DO
     13 packet-x11.c: 2DO
     11 packet-kerberos.c: 2DO
     10 packet-diameter.c: 2DO
      9 packet-snmp.c: 2DO
      9 packet-pgm.c: 2DO
      7 packet-nbns.c: 2DO
      6 packet-fcswils.c: 2DO
      5 packet-wccp.c: 2DO
      5 packet-cops.c: 2DO
      4 packet-wtp.c: 2DO


svn path=/trunk/; revision=17038
2006-01-16 07:59:44 +00:00
Ronnie Sahlberg 8b32f13476 get rid of strcpy in packet-ntp.c
at the same time  change ntp_fmt_ts to return a pointer to ian ep-allocated buffer.
remove the redundant buffer parameter in the signature and change all callers.


svn path=/trunk/; revision=15939
2005-09-21 20:05:13 +00:00
Guy Harris 25c4bc9379 Replace tvb_memcpy() calls that extract IPv4 addresses into a guint32,
and that extract IPv6 addresses into a "struct e_in6_addr", with
tvb_get_ipv4() and tvb_get_ipv6() calls - except for some that we
remove, by using proto_tree_add_item(), rather than replacing.

Have epan/tvbuff.h include epan/ipv6-utils.h, to define "struct
e_in6_addr" (not necessary to declare the tvbuff routines, but including
it there means "struct e_in6_addr" is guaranteed to be defined before
those declarations, so we don't get compiler complaints if we define it
*after* those declarations).

svn path=/trunk/; revision=15758
2005-09-11 21:25:37 +00:00
Ulf Lamping 0dc9fb3d4a various code cleanup:
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants

svn path=/trunk/; revision=15264
2005-08-08 18:50:39 +00:00
Jörg Mayer 69dcb66cd9 More char -> const char warning fixes
svn path=/trunk/; revision=15218
2005-08-05 00:23:22 +00:00
Guy Harris fc96a5d5f3 Show NTP times in a fashion more similar to that used for other times.
svn path=/trunk/; revision=13561
2005-03-01 06:04:31 +00:00
Guy Harris 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +00:00