Commit Graph

46 Commits

Author SHA1 Message Date
Guy Harris f862fc40ba Don't cast away constness.
svn path=/trunk/; revision=54800
2014-01-14 18:35:36 +00:00
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
Pascal Quantin 02b7064a87 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7372 :
tcap.otid and tcap.dtid can be used as display filters

svn path=/trunk/; revision=43288
2012-06-16 19:13:48 +00:00
Anders Broman 42b44648c8 Get rid of Warnings.
svn path=/trunk/; revision=39954
2011-11-20 08:59:19 +00:00
Anders Broman 24a011d8db Let subdissectors have a stab at the packet even if it's cut short.
svn path=/trunk/; revision=39472
2011-10-19 17:59:47 +00:00
Anders Broman 0f2e6c6cc5 Get rid of check_col, while at it set ENC.
svn path=/trunk/; revision=39164
2011-09-27 12:05:32 +00:00
Stig Bjørlykke 8b156ecfc8 Removed some "statement not reached" warnings.
svn path=/trunk/; revision=27827
2009-03-23 13:03:18 +00:00
Stig Bjørlykke 783fd3b199 Corrected oid names.
svn path=/trunk/; revision=27673
2009-03-09 13:26:47 +00:00
Anders Broman d7c62b2db5 Use the unmodified DialoguePDUs ASN1 file.
svn path=/trunk/; revision=26192
2008-09-14 14:42:39 +00:00
Anders Broman 14f76023b3 Remove the rest of the ANSI TCAP stuff.
svn path=/trunk/; revision=26191
2008-09-14 14:33:01 +00:00
Anders Broman eb9dc794b2 Start to get rid of the "old" ANSI TCAP stuff.
svn path=/trunk/; revision=26189
2008-09-13 16:38:21 +00:00
Anders Broman 16512c7b8c Use original UnidialoguePDUs.
svn path=/trunk/; revision=26188
2008-09-13 15:32:59 +00:00
Anders Broman 228b16850c Get rid of some unused code warnings.
svn path=/trunk/; revision=25843
2008-07-26 22:39:32 +00:00
Anders Broman 524db0a082 From Florent DROUIN:
Since the use of the function 'dissect_ber_tagged_type' for DialoguePortion,
the file tcap.cnf must be updated to remove the decoding of the tag and length.
This decoding is now done in the new function 'dissect_ber_tagged_type'.

The file tcap.cnf has been updated to take into account this change. 
But this leads to a change in tcap.asn too, for the definition of the
ExternalPDU.
I think this part of the ASN1 file is specific to Wireshark and can be
modified.

In the meantime, I did update the DEBUG part for packet_ber.c  for the function
(dissect_ber_tagged_type)

svn path=/trunk/; revision=23442
2007-11-13 21:59:53 +00:00
Anders Broman 079e1446f9 Update to use the -X and -T asn2wrs flags.
svn path=/trunk/; revision=23394
2007-11-07 21:22:25 +00:00
Anders Broman 1950ffc214 Apply the small performance enhancment patches for:
- if offset is 0, tvb_length is the same as tvb_length_remaining, just faster.
Replace 
- col_append_fstr() with faster  col_append_str() 
- col_add_str() with col_set_str()
when it's safe

svn path=/trunk/; revision=23252
2007-10-23 05:50:00 +00:00
Jeff Morriss 7c4cca3e63 From Florent Drouin:
Correct bug in TCAP statistics when read filter is used.
Rename the TCAP decoding functions to show which are ITU vs. ANSI.
Don't unregister an ITU SSN if it's used by an ANSI subdissector.

svn path=/trunk/; revision=22421
2007-07-30 17:10:20 +00:00
Jeff Morriss 29facf8ff9 From Florent Drouin:
- add support of session management for tcap ANSI.
   (In fact, this support already exist for ANSI MAP subdissector, but as our
   simulators can reuse the tcap transaction Id, the decoding of the response
   may be wrong)
- move the code related to asn1 in tcap.cnf, and update tcap.cnf
- move the code related to the session management in tcap-persistentdata
- add a compilation option to free the entry in the hashtable for a closed
  transaction. This is used only for tshark statistics generation, with huge file.
- cleanup and add some comments

Add Id tags to epan/tcap-persistentdata.{c,h}

svn path=/trunk/; revision=22415
2007-07-27 19:24:40 +00:00
Tomas Kukosa e5922df225 - use #.FN_HDR where #.FN_BODY is not necessary
- modify subtypes for individual TCMessage/ansi... fields instead of switching based on hf_index inside common TransactionPDU type

svn path=/trunk/; revision=22411
2007-07-27 06:23:45 +00:00
Jeff Morriss 45ee7230cc Change a bunch of calls to col_append_*() to col_add_*() in places where we
_want_ what's currently in the INFO column (usually a more generic message
type from a lower level dissector) replaced (usually with a more
specific--higher level--message type from the currect dissector).  Add a
comment there not to change it back and to explain the use of col_set_fence()
in case someone finds data there that they _don't_ want replaced.

svn path=/trunk/; revision=22409
2007-07-26 20:05:54 +00:00
Jeff Morriss 10dcbaa760 From Florent Drouin: fix for bug http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1681 : initialize the variable containing the OID so the dialog portion gets decoded properly
svn path=/trunk/; revision=22298
2007-07-13 13:45:11 +00:00
Tomas Kukosa 1dcf2aaef0 use ASN.1 type names in #.FN_BODY (instead of Wireshark type names)
svn path=/trunk/; revision=22054
2007-06-06 08:12:27 +00:00
Anders Broman dca634c4de Prepare for the use of the new -X parameter for BER encoded protocols.
svn path=/trunk/; revision=21889
2007-05-22 16:17:54 +00:00
Anders Broman f08cd1e5e3 actx in the rest of dissect_ber..()l
svn path=/trunk/; revision=21773
2007-05-15 05:49:43 +00:00
Anders Broman c01f382974 Second step in introducing asn context to BER dissectors just like in PER.
svn path=/trunk/; revision=21753
2007-05-13 20:58:29 +00:00
Anders Broman c0dc340d5d From Florent DROUIN:
I have made some changes to the final patch to have the operation code decoded
as ForwardSM. A change for TCAP is included too, to be sure that the
application context is not overwritten by the User Info OID (this was the case,
when a MAP open dialog was included in the request).
Fix bug:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1498

svn path=/trunk/; revision=21543
2007-04-23 21:26:27 +00:00
Anders Broman d07a92f8bc TCAP: Fix up indentation a bit.
GSM MAP: Add returnResultNotLast from TCAP to the included ROS stuff.

svn path=/trunk/; revision=21537
2007-04-23 20:20:46 +00:00
Anders Broman 117eaaf948 and the missing files ...
svn path=/trunk/; revision=21522
2007-04-23 06:50:07 +00:00
Anders Broman 4960e68578 EXPORT DialoguePDU UniDialoguePDU and make them callable by OID.
svn path=/trunk/; revision=21487
2007-04-21 20:53:35 +00:00
Anders Broman eab3eb5c68 Put some missing TAG:s in the tree if internal BER fields shown.
svn path=/trunk/; revision=21486
2007-04-21 20:27:05 +00:00
Anders Broman 9375e27794 Use TransactionId to match ansi map responses to requests and fix
some bugs in the asn2wrs generated ansi map dissector.

svn path=/trunk/; revision=20257
2007-01-01 22:03:01 +00:00
Anders Broman ad9a9a6a9d From Florent Drouin:
Here are some patches and a new module to introduce the notion of Tcap context for a Tcap transaction. For each Tcap transaction, several parameters, like session identifier, start time or OID, will be saved in a hash table, to keep these informations available for the next messages. This context is then given to the upper layer, and can be used, for example, to generate transaction-associated statistics.

Moreover, the Upper protocol, detected in the Begin of the TCAP transaction ( according to the OID ), is saved in the context, and will be reused for the next messages of the transaction. This help the decoding of SS7 messages, without any SSN configuration in the "wireshark preferences".

You will have too, the possibility to apply a filter to see only the messages related to a TCAP transaction. (tcap.srt.session_id=XXX)

To enable the use of the Tcap context, you have 2 new parameters in the preferences,
- SRT, enable search for a Tcap context for any TCAP messages
- persistentSRT, keep the Tcap context, even after the transaction has been closed. This is mandatory with Wireshark, to have a clean display of the stats.

There is 2 new timers  in the preferences for the statistics, to tune the retransmission timeout, and messages lost timeout.

svn path=/trunk/; revision=19341
2006-09-27 20:06:06 +00:00
Guy Harris 384f0fb6bb Update tcap.cnf to generate the current packet-tcap.c
svn path=/trunk/; revision=16841
2005-12-18 11:08:38 +00:00
Tomas Kukosa 3b770d5c7c - dissect_ber_object_identifier() returns value as tvb
- new dissect_ber_object_identifier_str() function
 - BER dissectors adapted and regenerated

svn path=/trunk/; revision=16501
2005-11-14 10:02:31 +00:00
Anders Broman 1e1df99990 From Tim Endean:
Small patch to ber.c

The tcap dissector has been updated to use this length. I have not tested other asn.1 dissectors to ensure that they correctly use the indefinite encoding flag instead of the length value returning zero. 

There may also be some problems when re-assembly is needed, but the ability to deal with indefinite length is much more useful.

For developers the get_ber_length now returns the length of the pdu including the EOC, where you have dissectors that use packet-ber.c the eoc may need to be dealt with separately.

The tcap dissector has had numerous changes to make it less cluttered, and the useful feature of the previous version where a dialogue could be filtered out by selecting either the source or destination transaction ID has been incorporated into this version.

svn path=/trunk/; revision=15414
2005-08-18 21:36:59 +00:00
Tomas Kukosa 5344edee04 fix for new asn2eth
svn path=/trunk/; revision=14990
2005-07-22 10:38:22 +00:00
Ronnie Sahlberg 0ca30abe65 change the symbol dissect_ber_CHOICE back into dissect_ber_choice
svn path=/trunk/; revision=14980
2005-07-21 21:12:09 +00:00
Guy Harris 2fcce4b6c4 Fix some more signed vs. unsigned warnings.
svn path=/trunk/; revision=14903
2005-07-12 01:01:19 +00:00
Ronnie Sahlberg 3a51ba4293 make dissect_ber_choice take a guint* that will return the
index of the branch taken or -1  to make prettifications easier to implement.


change the signature of dissect_ber_choice and rename it to dissect_ber_CHOICE to catch all
occurences of the use of this function

update asn2eth to use the new name/signature

update all occurences of this function to the new name and new signature.



svn path=/trunk/; revision=14758
2005-06-26 05:48:50 +00:00
Ronnie Sahlberg 33f4400f83 the maximum ASN OID length is 256 bytes and there is a define to control this.
fix bug251 and all other occurances where an oid string  passed to packet_ber_object_identifier()
is not defined as foo[MAX_OID_STR_LEN]

svn path=/trunk/; revision=14720
2005-06-21 09:38:59 +00:00
Guy Harris ddbee0ffd0 Clean up white space.
Register "standard" and "lock_info_col" as obsolete preferences, so
they're silently ignored rather than triggering warnings.

Propagate changes to check for "dissect_ber_octet_string()" supplying a
null tvbuff pointer from the checkins to the generated dissector ("Do
not modify this file" means "Do not modify this file"!) to the tcap.cnf
file, so that they're not lost if the dissector is regenerated.  (Don't
propagate the checks for "tvb_new_subset()" returning null - it never
returns null.)

Pass -1 to "tvb_new_subset()" when appropriate.

When looping over packet data, check against the reported length, not
the captured length, so we indicate a short frame if we get stopped by
the snapshot length.

Get rid of unused variables.

svn path=/trunk/; revision=14658
2005-06-16 07:46:03 +00:00
Anders Broman e92c34b0f9 From Olivier Jacques,
- beautify TCAP decoding without upper dissector associated.
With a couple of if (parameter_tvb) trown in to hopfully fix a Buildbot crash output

svn path=/trunk/; revision=14591
2005-06-08 18:53:11 +00:00
Anders Broman 58f30b265f Some fixes from Tim Endean
svn path=/trunk/; revision=14579
2005-06-07 20:30:04 +00:00
Anders Broman bdf3f907e9 From Tim Endean:
- I have had to make some changes to packet-ber to allow for PRIVATE and APPLICATION tags.
- Both ANSI and ITU variants supported without configuration.
- Asn.1 dissectors can now register using an OID value as well as an SSN, the oid it tried first.

svn path=/trunk/; revision=14574
2005-06-07 05:50:28 +00:00
Anders Broman 75ab9e7ad2 Let the sub dissector use the top tree.
svn path=/trunk/; revision=14571
2005-06-06 20:42:18 +00:00
Anders Broman e490b40a24 Add the asn2eth generated TCAP dissector made by Tim Endean to the SVN tree.
svn path=/trunk/; revision=14561
2005-06-06 15:39:20 +00:00