Commit Graph

123 Commits

Author SHA1 Message Date
Guy Harris 500eb99cd9 Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
date as YYYY/DDD, where DDD is a 1-origin day of year.  Move the formats
to a "time_fmt.h" file, included by the headers that use it.  Have
abs_time_to_str() and abs_time_secs_to_str() take the date format value,
rather than a Boolean "show this as UTC" flag, as an argument.  Document
the ABSOLUTE_TIME_ formats a bit better.  Use that format in the CCSDS
and VCDU dissectors, rather than having those dissectors do the
formatting themselves.

svn path=/trunk/; revision=32034
2010-02-27 19:01:27 +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
Guy Harris 4fde145bd2 Add an argument to abs_time_to_str() and abs_time_secs_to_str()
indicating whether the time should be shown as local time or UTC.  For
now, always pass FALSE, meaning "show as local time".

Clean up some stuff in the SNMP dissector, use abs_time_secs_to_str()
for times with one-second resolution, and update a comment in various
macros in the WSP dissector, while we're at it.

svn path=/trunk/; revision=31227
2009-12-10 22:19:29 +00:00
Bill Meier f3c1957f7c Fix Bug 4316: Crash when using custom RADIUS dictionary.
(The bug was caused by a variable not being initialized).
See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4316

svn path=/trunk/; revision=31221
2009-12-10 18:13:38 +00:00
Guy Harris 6e478c4f6b Initialize radius_call, so it's null if we don't pass through the code
path that sets it.

svn path=/trunk/; revision=30524
2009-10-12 00:32:34 +00:00
Bill Meier dd44270387 Replace use of GMemChunks by se_alloc();
@include <stdlib.h> not req'd;
Use consistent indentation.

svn path=/trunk/; revision=30522
2009-10-12 00:01:59 +00:00
Bill Meier 94f28dd8f9 (FWIW) One step towards including stdio.h & stdlib.h only when req'd.
svn path=/trunk/; revision=29568
2009-08-26 19:27:49 +00:00
Stig Bjørlykke a1fc889259 From Thierry Andry via bug 3941:
Added preference to set radius request TTL.

svn path=/trunk/; revision=29561
2009-08-26 07:26:17 +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 b249ff0487 Remove a couple of unused variables.
svn path=/trunk/; revision=29245
2009-07-30 17:22:00 +00:00
Stig Bjørlykke 6d472a50fc From Kovarththanan Rajaratnam via bug 3548:
Minor hf cleanup.

svn path=/trunk/; revision=28968
2009-07-07 07:46:57 +00:00
Bill Meier 60e658e132 Radius: Additional attribute handling:
- implement "ether" attribute; 
 - parse "abinary" attribute [uses existing radius_abinary()]
Also: add a comment in packet-radius.h about the meaning of the encrypt flag.

svn path=/trunk/; revision=28952
2009-07-06 14:05:37 +00:00
Bill Meier d36f35f28b From: Tobias Witek: Fix processing of radius 'vendor specific attributes'
In the RADIUS dissector, the function radius_register_avp_dissector() registers
vendors that are not already present in the dictionary hash-table. As far as I
can see, there are two problems with this:

1. The function does not set the number of type/length octets and the has_flags
 variable for that AVP, which is required to correctly decode AVP/VSA values
2. In some situations, the function is called _before_ radius_load_dictionary()
is called (for example for the vendor 3GPP (ID: 10415))

Therefore, all vendor entries that are created by calling
radius_register_avp_dissector() leave their type_octets and length_octets un-initialized,
which causes incorrect decoding.

[Result: Radius dissector displays messages such as:
 "Malformed Packet: RADIUS" and "Error/Malformed: Malformed Packet(Exception occurred)"]

The attached patch fixes this problem by assuming that the dictionary knows the
'ground truth' about the type/length octet and the has_flags information and allows it to
overwrite these values even for vendors that have already been loaded.

Also: (from Bill Meier): set the type/length octet and the has_flags variables to default
"standard" values (1,1,FALSE) in radius_register_avp_dissector().

Fixes Bug #3651 (and Bug #3635).
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3651
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3635

svn path=/trunk/; revision=28937
2009-07-03 16:03:02 +00:00
Bill Meier 92446c8005 packet-radius: Fix exception CLEANUP handling when malformed attribute list/pair seen;
Fixes crash reported in Bug #3578. [https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3578]
Essentially: CLEANUP_CALL_AND_POP wasn't being executed for certain error exits from
 dissect_attribute_pairs() thus leaving a CLEANUP entry on the exception stack.
Also: vsa_buffer_table wasn't being destroyed if an exception occurred in dissect_attribute_pairs.

svn path=/trunk/; revision=28891
2009-06-30 13:57:26 +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
Jaap Keuter a78d986bd1 Prevent duplicate header field registrations.
svn path=/trunk/; revision=28720
2009-06-14 05:35:35 +00:00
Jörg Mayer 7856eef821 RFC3576 states, that some messages will use port 3799 instead
of the "standard" radius ports. Register radius to that port
as well.

svn path=/trunk/; revision=28672
2009-06-09 10:52:28 +00:00
Anders Broman c91a384702 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
2009-05-13 19:46:11 +00:00
Anders Broman 83d1303053 From Naoyoshi Ueda:
Radius dissector enhancement to support WiMAX vendor specific attributes.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3176

svn path=/trunk/; revision=27937
2009-04-02 19:05:52 +00:00
Anders Broman b666a7942e More size_t casts.
svn path=/trunk/; revision=27887
2009-03-29 18:26:06 +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
Anders Broman 85b8227311 From Bjørn Mork:
Decode ipv6prefix attributes in packet-radius.

svn path=/trunk/; revision=27769
2009-03-18 07:31:35 +00:00
Anders Broman 421acac3db From Florian Lohoff:
Decode binary "Ascend-Data-Filter" vendor specific attribute in packet-radius
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2975

svn path=/trunk/; revision=27127
2008-12-29 15:24:08 +00:00
Anders Broman 11fbea953e From Florian Lohoff:
packet-radius.c - avp specific dissectors broken
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2974

svn path=/trunk/; revision=27126
2008-12-29 15:16:41 +00:00
Bill Meier 09bef39f3d Minor cleanup related to proto_register, proto_reg_handoff
svn path=/trunk/; revision=26307
2008-09-30 14:46:48 +00:00
Anders Broman f08f558eea Work around a problem with custom columns.
svn path=/trunk/; revision=26178
2008-09-11 19:34:29 +00:00
Luis Ontanon 42c3239a1a luis.ontanon@gmail.com => luis@ontanon.org
svn path=/trunk/; revision=25937
2008-08-05 21:03:46 +00:00
Bill Meier 44af6ef887 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25290
2008-05-14 01:47:41 +00:00
Luis Ontanon 906d2f3cbb http://www.wireshark.org/lists/wireshark-dev/200803/msg00308.html
proto.[hc]
    define new APIs to allow delayed registration of protocol fields,
	so that dissectors with "flexible" fields  like xml, radius, diameter,
	snmp do not have to load their files at startup but can do so as late as possible.

gtk/dfilter_expr_dlg.c :
	have the expression dialog registering all prefixes so that all fileds appear in the dialog

tshark.c
	register all prefixes when called with -G

epan/radius_dict.l
epan/dissectors/packet-radius.c
epan/dissectors/packet-radius.h
	refactor registration to delay dictionary loading as long as possible



svn path=/trunk/; revision=24762
2008-04-03 22:13:52 +00:00
Jörg Mayer a9e61881b9 Fix for http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2257
svn path=/trunk/; revision=24533
2008-03-03 18:07:47 +00:00
Stig Bjørlykke a2d1e9005d This patch adds support for configuration profiles, which can be used to
configure and use more than one set of preferences and configuration files.

This can be found in the "Configuration Profiles..." menu item from the Edit
menu, or by pressing Shift-Ctrl-A.  It's also possible to start wireshark
and tshark with a named profile by using the "-C ProfileName" option.
A new status pane in the main window will show the current profile.

The configuration files currently stored in the Profiles are:
- Preferences
- Capture Filters
- Display Filters
- Coloring Rules
- Disabled Protocols
- User Accessible Tables

The recent data are by design not added to the profile.

Planned future enhancements:
- make a more convenient function to switch between profiles
- add a "clone profile" button to copy an existing profile
- make the profiles list active and accept return as OK
- save users "Decode as" in the profile
- make new, clone and deletion of profiles more secure
- make some of the recent values available in the profile

This patch also fixes:
- setting default status pane sizes
- a bug setting status pane for packets when not having main lower pane.

svn path=/trunk/; revision=24089
2008-01-14 16:40:23 +00:00
Tomas Kukosa b19d4c9e42 use g_strconcat() which should be faster instead of g_strdup_printf()
svn path=/trunk/; revision=23681
2007-11-30 11:46:13 +00:00
Ronnie Sahlberg b8d35143d8 change dissect_radius() to become a new-style dissector that can reject
packets that doesnt look like valid radius.

verify that a packet is radius by checking that the command code is 
known and also that the length is between 20 and 4096 bytes

move the tap data to be ep_allocated instead of a static global variable

dont use tvb_memcpy() to read a structure off the wiredata
use tvb_get_...    to unmarshall the fields explicitely



this fixes bug 1634

svn path=/trunk/; revision=23039
2007-09-30 23:14:18 +00:00
Anders Broman b2b6df139c Fix bug
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1640 change "Change-Filter-Request (43)" to "CoA-Request (43)"

svn path=/trunk/; revision=22301
2007-07-13 20:00:38 +00:00
Guy Harris 5a43799a17 Use G_GINT64_MODIFIER, rather than the PRI[douxX]64 macros, for GLib
routines and routines using those routines.  GLib might use different
modifiers for 64-bit quantities than the platform's C library does.

svn path=/trunk/; revision=21990
2007-05-29 18:52:42 +00:00
Guy Harris 1d73cea470 Add a header that redefines g_array_index() to throw in a "void *" cast
to work around the "data" field of a GArray being a guint8 *, and
defines a g_array_data() macro to extract that field and cast it to void
*.

Use that header where needed.

svn path=/trunk/; revision=21627
2007-04-30 19:24:25 +00:00
Guy Harris 9772732adc The data in a GArray is guaranteed to be properly aligned; add a cast to
squelch compiler warnings.

svn path=/trunk/; revision=21617
2007-04-28 22:31:04 +00:00
Jeff Morriss 4d21c49929 Get rid of some more g_assert*()'s in the dissectors. There are a few
remaining that I'm not sure exactly what to do with at the moment:
the one in packet-frame probably should be there, the others probably
shouldn't but they also should never fail unless there's a compile or build
problem (AFAICS).


svn path=/trunk/; revision=21367
2007-04-10 14:48:06 +00:00
Ulf Lamping 7994794ad9 fix a lot more warnings
svn path=/trunk/; revision=21142
2007-03-23 01:29:52 +00:00
Gerald Combs 063621f11b Fix potential buffer overruns in address_to_str_buf() found by Andrej
Mikus.  Add a buf_len parameter to ip_to_str_buf(), and make sure it's 
enforced.  Copy the release notes over from the 0.99.5 trunk and add a
note about the ISUP dissector (which is affected by the overrun).

svn path=/trunk/; revision=20607
2007-01-29 20:25:26 +00:00
Gerald Combs 53689800e6 Move epan/crypt-md5.[ch] to epan/crypt. Remove
epan/crypt/airpdcap_md5.[ch].  Fix up whitespace.

svn path=/trunk/; revision=20277
2007-01-02 22:49:57 +00:00
Anders Broman d61e373bb4 As ponted out by Stig Bjørlykke change a whole bunch of dissector_handle_t to static.
svn path=/trunk/; revision=20062
2006-12-07 20:34:08 +00:00
Jörg Mayer dd26a7021b nikai@nikai.net:
Remaining fixes from:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1225

svn path=/trunk/; revision=19895
2006-11-14 20:32:29 +00:00
Anders Broman c881dacb48 From Alejandro Vaquero:
For the Radius dissector to add statistics 
 in the "Service Response Time" menu and the tshark stats.

svn path=/trunk/; revision=19668
2006-10-24 05:21:00 +00:00
Martin Mathieson 26285e4b2f Make smrse & radius dissectors findable by name
svn path=/trunk/; revision=19157
2006-09-05 16:06:41 +00:00
Ulf Lamping 36d80b8c8b squelch some compiler warnings
svn path=/trunk/; revision=19052
2006-08-27 11:27:47 +00:00
Ronnie Sahlberg ff22d9d066 fix a tiny memory leak where wireshark would lose a few kb once upon startup if there was no radius directory
svn path=/trunk/; revision=18580
2006-06-27 12:12:31 +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