Commit Graph

74 Commits

Author SHA1 Message Date
Guy Harris a4317c1099 The extension ID field in a Private Extension IU is 2 bytes, so the
length of the IU must be at least 2 bytes in order to dissect the
contents.

Just use "proto_tree_add_item()" to add the value of the private
extension, and do so only if it's not zero-length.

svn path=/trunk/; revision=10518
2004-03-30 18:14:22 +00:00
Guy Harris fe0af69f9f Fix up the previous checkin.
svn path=/trunk/; revision=10248
2004-02-27 09:25:27 +00:00
Guy Harris 857318d3b7 Use "tvb_get_string()" instead of allocating a (len+1)-sized buffer,
"tvb_memcpy()"ing to it, and putting in a null terminator;
"tvb_get_string()" will check whether all bytes of the string are
present before allocating the buffer, so that you don't leak memory if
the copy throws an exception, and don't crash if the length is absurdly
large.

Use "tvb_memdup()" instead of allocating a buffer and "tvb_memcpy()"ing
to it, so that an exception is thrown before you try to allocate the
buffer (for the same reasons as listed above).

Before allocating a buffer used when processing a chunk of data from a
packet, get a pointer to the chunk with "tvb_get_ptr()", or check that
the data is all there with "tvb_ensure_bytes_exist()", so that an
exception is thrown before you try to allocate the buffer (for the same
reasons as listed above).

Fix up the lengths of the tvbuff used when dissecting ONC RPC opaque data
with a particular dissector.

svn path=/trunk/; revision=10236
2004-02-25 09:31:07 +00:00
Guy Harris 5e7f6fbdb9 In "decode_qos_umts()", "length" can get assigned a 2-byte value, so
make it a "guint", not just a "guint8".

svn path=/trunk/; revision=9569
2004-01-06 02:38:03 +00:00
Ulf Lamping 0d9679de8d removed some MSVC warnings (level 3)
svn path=/trunk/; revision=9561
2004-01-05 19:31:44 +00:00
Guy Harris c344289260 From melerski [AT] poczta.onet.pl: fix a problem with unknown IEs.
svn path=/trunk/; revision=9115
2003-11-29 03:55:32 +00:00
Guy Harris 17ec0f5d19 Get rid of C++ comment.
svn path=/trunk/; revision=8749
2003-10-22 02:24:14 +00:00
Guy Harris 4dcd60a3c2 From Michal Melerowicz:
merge gtpv0 and gtpv1 dissectors into one;

	fix up XXX_to_str routines.

svn path=/trunk/; revision=8715
2003-10-16 09:55:10 +00:00
Guy Harris cf44670068 Get rid of a value_string table that was used by now-deleted code.
svn path=/trunk/; revision=8714
2003-10-16 06:47:47 +00:00
Guy Harris 201ccdbd6d Fix the XXX_to_str routines
1) not to rely on their static buffers being initialized;

	2) not to bother checking whether a BCD digit is a valid digit
	   or not (index into a 16-element array, instead);

	3) to work correctly, in the case of "id_to_str()".

svn path=/trunk/; revision=8705
2003-10-15 09:18:33 +00:00
Guy Harris 7db1cbf4fc From Michal Melerowicz: remove obsolete GTP'v0 CDR dissection.
svn path=/trunk/; revision=8665
2003-10-10 10:25:24 +00:00
Gerald Combs d47426ec58 Remove a bunch of duplicate semicolons.
svn path=/trunk/; revision=8509
2003-09-21 20:06:02 +00:00
Guy Harris 45a0dab92b You can't safely return from a routine a pointer to an automatic
variable.

svn path=/trunk/; revision=8504
2003-09-20 08:56:28 +00:00
Gerald Combs 1e05de2162 Make the string variables in the *_to_str() functions non-static.
svn path=/trunk/; revision=8492
2003-09-18 21:42:45 +00:00
Gerald Combs c5156be836 From Michal Melerowicz: Properly terminate the return string in
msisdn_to_str().

Do the same for imsi_to_str().

svn path=/trunk/; revision=8491
2003-09-18 21:38:44 +00:00
Guy Harris 19a1589e9c Use "int"s as array indices - it squelches a
signed-vs-unsigned-comparison complaint in one case, and it's a
generally good habit.

svn path=/trunk/; revision=8469
2003-09-15 18:31:17 +00:00
Gerald Combs a8f9d8211d Fix a buffer overflow in msisdn_to_str(). Clean up string pointer handling
in it, imsi_to_str(), and id_to_str() a bit.

svn path=/trunk/; revision=8468
2003-09-14 21:28:13 +00:00
Jörg Mayer 0c4c9462c8 Fix warning: guint8 is always <= 255
svn path=/trunk/; revision=8467
2003-09-14 20:59:31 +00:00
Guy Harris f7e3062867 From Jesper Peterson:
Extract the FCS decoding section of the PPP_HDLC dissector to
	allow the CHDLC dissector to use the same routine.

	The ppp_options used for preferences has been renamed to
	fcs_options and exported via packet-ppp.h so CHDLC gets a
	separate (but identical) FCS preference.

	This means prefs.h has to be included before packet-ppp.h so a
	couple of ppp related files (packet-{gtp,null,raw,vj}.c) had
	their includes slightly re-arranged.

From me: make the PPP/CHDLC FCS code use "crc32()" to check the 32-bit
FCS.

svn path=/trunk/; revision=8266
2003-08-26 05:52:53 +00:00
Guy Harris e8b5b4fec2 Decode a bit more of the mobility management context message, and use
"mm_sec_modep[]" to decode the security type.

svn path=/trunk/; revision=8005
2003-07-09 07:12:23 +00:00
Guy Harris daeac95d4a Don't export "osinl_subdissector_table" or "ppp_subdissector_table" -
have other dissectors that use them fetch them with
"find_dissector_table()".

svn path=/trunk/; revision=7601
2003-04-29 17:56:49 +00:00
Guy Harris e708872638 Thou Shalt Not Ever Make An Offset An 8-bit Quantity If Thou Art
Comparing It Against An 8-bit Or Longer Length To Make Sure It Doesn't
Go Past The Length, because if the length is 255, it can't ever go past
it as it'll overflow if it does.

svn path=/trunk/; revision=7093
2003-02-07 19:57:19 +00:00
Guy Harris 608e8c31f5 From Pasi Kovanen: display flow label IE in GTP v0 in hex.
svn path=/trunk/; revision=7066
2003-01-31 18:45:06 +00:00
Guy Harris 231f28ce08 Panic if a preference starts with the name of the module to which it
belongs, as that's redundant.

Fix a bunch of cases where that was done, and map the old name to the
new name.

Instead of marking "mtp3.mtp3_standard" as obsolete, map it to
"mtp3.standard".

svn path=/trunk/; revision=7030
2003-01-28 23:56:40 +00:00
Guy Harris 6664e10070 From Flavio Poletti: handle the hyphen in QoS inside RADIUS client
messages, as recommended by recent 3GPP recommendations.

svn path=/trunk/; revision=6836
2003-01-02 20:33:45 +00:00
Guy Harris 8480cf347a From Michal Melerowicz: fix the display of IMSI for operators having a
mobile network code greater than 9.

svn path=/trunk/; revision=6775
2002-12-10 19:05:29 +00:00
Guy Harris 6b72decb11 From Fritz Budiyanto: add a missing g_ntohs() for flow_label in the
gtpv0 decoder.

svn path=/trunk/; revision=6749
2002-12-05 22:31:13 +00:00
Guy Harris 4943cc7e76 From Andreas Trauer:
- more typos corrected
	- changed "Teardown indication" to "Teardown Indicator"
	  The official name is Teardown Ind, but 3GPP TS 29.060 also
	  refers to it as Teardown Indicator
	- bugfix: I had moved the call to col_append_str_gtp() one bracket
	  too far resulting in display of "GTP <GTP>" or "GTP-U <GTP-C>".

svn path=/trunk/; revision=6619
2002-11-13 09:01:08 +00:00
Guy Harris 5ae19d6256 Instead of tweaking a "Protocol configuration options" extension header
item to look more-or-less like a PPP packet, just dissect it in place
and hand off to the appropriate subdissector using the PPP dissector's
handoff table (which we export, along with its value_string table for
protocol IDs, which we use to report the protocol ID symbolically).

This means there's no point in having a configurable option to control
whether to do that tweaking; make it an obsolete option.

Bring "col_get_writable()" back from the dead, and have the GTP
dissector save the current "writable" flag for columns, mark the columns
non-writable before calling the subdissector for the PPP configuration
protocol, and restore the state of the writable flag, rather than
putting the columns back after the PPP configuration protocol's
dissector is done.

Fix some more typos in comments.

Don't register the IP dissector in the "ppp.protocol" table in the GTP
dissector's handoff registration routine - it's already being done in
the IP dissector's handoff routine.

Fix the name for CHAP to match what RFC 1994 calls it (if the name
changed, it should be changed in all places, but, at least according to
this message, a while ago, from Bob Sutterfield, "since the RFC defines
the protocol, the RFC defines the name":

	http://mail-index.netbsd.org/netbsd-help/1996/05/16/0011.html

and the RFC defines the name as "PPP Challenge Handshake Authentication
Protocol (CHAP)").

svn path=/trunk/; revision=6617
2002-11-11 19:23:14 +00:00
Guy Harris d30c672c9d From Andreas Trauer:
- correct typos in comments
	- remove obsoleted definition of GTP_PPP_0x00, ...
	- remove distinction between GTP and PPP for col_append_str_gtp(),
		because this layer is GTP (or GTP-U), but never PPP

svn path=/trunk/; revision=6614
2002-11-11 17:41:37 +00:00
Guy Harris eab13a03f3 From Andreas Trauer:
Replace the handling of PPP packets over GTPv1 and also
	establish the handling of PPP packet over GTPv0.  Additionally
	IPv6 packets are handled in GTPv0 and GTPv1.

	Explanation:

	- old solution: examining the known PPP protocols is a tough
	  task, because there might be more in the future -> the list
	  must be extended more and more (the octet 0x00 has already
	  been added for PPP network layer protocols, but for protocol
	  field compression a lot of protocols must be inserted for
	  IPv4(0x21), IPv6(0x57), maybe IPX (0x2b) or AppleTalk (0x29),
	  ...)

	- new solution: It is easier the other way: the most significant
	  nibble of the first octet must be 4 for IPv4 and 6 for IPv6.
	  All other values are assumed to be PPP packets, including
	  packets beginning with values 0x40-0x44 (header too short for
	  IPv4 packet) and value 0x4f (PPP protocol type (IPv6 header
	  compression protocol) taking precedence over IPv4 packets with
	  header length of 60 octets).

svn path=/trunk/; revision=6568
2002-11-06 22:59:23 +00:00
Guy Harris d4e632c5ea Get rid of a trailing blank.
svn path=/trunk/; revision=6565
2002-11-05 23:00:11 +00:00
Guy Harris 205d13ca35 Get rid of some trailing blanks in strings.
svn path=/trunk/; revision=6537
2002-11-01 08:21:57 +00:00
Guy Harris 1522cd2994 From Fritz Budiyanto: the command in the Packet Transfer Command IE is
one byte, so fetch it with "tvb_get_guint8()", not "tvb_get_ntohl()".

Put in the location in the GPRS standard where that's defined, while
we're at it.

svn path=/trunk/; revision=6533
2002-11-01 05:30:48 +00:00
Guy Harris 45ed05190c Fix up some more byte-string displays.
svn path=/trunk/; revision=6512
2002-10-26 06:30:41 +00:00
Guy Harris 54117349d4 Show the elements of authentication triplets as byte strings (as that's
what they are - well, bit strings, really, but...).  Doing so also fixes
a bug, as "decode_gtp_auth_tri()" was copying 16 bytes to an array that
was 8 bytes long....

Do the same for byte-string elements of a quintuplet - and show as byte
strings some elements that weren't being shown at all.

svn path=/trunk/; revision=6511
2002-10-26 06:13:33 +00:00
Guy Harris 043548c7fc From Flavio Poletti: fix a bug in "decode_qos_umts()".
svn path=/trunk/; revision=6143
2002-08-30 10:14:03 +00:00
Guy Harris 3f4397bbb0 From Ulf Lamping: change some #define names to avoid name collisions on
Windows that cause compiler warnings.

svn path=/trunk/; revision=6129
2002-08-29 19:05:41 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris 320621f2f4 From Flavio Poletti: handle 3GPP QoS in RADIUS messages.
svn path=/trunk/; revision=6091
2002-08-26 20:22:31 +00:00
Guy Harris 1e1bbe5215 From Marcus Haebler: handle a sub-protocol field of 0x00 as PPP.
Merge all the cases for handling PPP together.

svn path=/trunk/; revision=6078
2002-08-24 10:12:45 +00:00
Guy Harris 9ff9891c02 From Flavio Poletti: fix bug in decoding of maximum uplink and downlink
rate in GTP v1 (they were swapped).

svn path=/trunk/; revision=6070
2002-08-23 20:03:15 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Guy Harris 77fa06b899 From Joerg Mayer:
dftest.c:
	     Remove #if-0-ed includes

	packet-ieee80211.c, packet-wtls.c, packet-afp.c, packet-wsp.c,
        packet-wtp.c, ethereal_gen.py:
	     Remove redundant include varargs (already in snprintf.h,
	     and required only for snprintf.h)

	Remove unused include of snprintf.h from files not using
	"snprintf()".

svn path=/trunk/; revision=5889
2002-07-17 00:43:03 +00:00
Guy Harris 20a92d3ffc From Michal Melerowicz:
Fixed TFT decoding and processing PPP payload inside of GTP
	protocol conf options

That change also put all GTP preferences under a "gtp" heading; put in
another hack so that your old "gtpv0" and "gtpv1" settings are recognized.

svn path=/trunk/; revision=5588
2002-05-29 07:35:55 +00:00
Gerald Combs ee0bdc5751 From Olivier Dreux: Add PPP support to GTP.
svn path=/trunk/; revision=5586
2002-05-29 03:07:02 +00:00
Guy Harris ae88c45ef0 From Joerg Mayer: make a pile of stuff not used outside one source file
static, and add a new "packet-data.h" to declare "proto_data".

Display escape sequences in octal in the IAPP dissector, as is now done
in the RADIUS dissector.

svn path=/trunk/; revision=5441
2002-05-10 23:20:38 +00:00
Guy Harris 8245e425ff From Joerg Mayer: flag unused arguments as such.
svn path=/trunk/; revision=5361
2002-05-02 11:05:44 +00:00
Guy Harris 9a80f0a521 Removal (or, at least, #ifdeffing out) of unused variables and
functions, from David Frascone.

svn path=/trunk/; revision=5288
2002-04-29 08:20:18 +00:00
Gilbert Ramirez 5c10ad55a8 More static-ization.
svn path=/trunk/; revision=5131
2002-04-08 20:30:56 +00:00