aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-10-17 11:04:28 +0000
committerGuy Harris <guy@alum.mit.edu>2004-10-17 11:04:28 +0000
commit8566564c59c7969b006284970705b3f18a4698f3 (patch)
treee3893d7bb398e1a094efa2726388708198d35018
parent88982558b000737d56a22bf1932a5869105774bd (diff)
From Rene Pilz: add a preference to ignore the cipher bit, in case
captures have unciphered data with the cipher bit set. svn path=/trunk/; revision=12329
-rw-r--r--AUTHORS1
-rw-r--r--epan/dissectors/packet-gprs-llc.c23
2 files changed, 22 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index 0ad63f4a56..8cc103b629 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2299,6 +2299,7 @@ Thomas Boehne <TBoehne [AT] ADwin.de>
Steve Sommars <sommars [AT] lucent.com>
Olivier Jacques <olivier.jacques [AT] hp.com>
Kestutis Kupciunas <kesha [AT] soften.ktu.lt>
+René Pilz <rene.pilz [AT] ftw.at>
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
give his permission to use his version of snprintf.c.
diff --git a/epan/dissectors/packet-gprs-llc.c b/epan/dissectors/packet-gprs-llc.c
index a3837a9221..2c76526cb0 100644
--- a/epan/dissectors/packet-gprs-llc.c
+++ b/epan/dissectors/packet-gprs-llc.c
@@ -38,6 +38,7 @@
#endif
#include <epan/packet.h>
+#include "prefs.h"
/*
#include "packet-llcgprs.h"
*/
@@ -81,6 +82,9 @@ static gint ett_ui = -1;
static gint ett_llcgprs_sframe = -1;
static dissector_handle_t data_handle;
+
+static gboolean ignore_cipher_bit = FALSE;
+
static dissector_table_t llcgprs_subdissector_table;
static const value_string sapi_t[] = {
{ 0, "Reserved"},
@@ -264,7 +268,15 @@ dissect_llcgprs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
next_tvb = tvb_new_subset(tvb, offset,crc_start-3, -1 );
- if (epm < 2){
+ if (ignore_cipher_bit || !(epm & 0x2)){
+ /*
+ * Either we're ignoring the cipher bit
+ * (because the bit is set but the
+ * data is unciphered), or the cipher
+ * bit isn't set (indicating that the
+ * data is unciphered). Try dissecting
+ * it with a subdissector.
+ */
if (!dissector_try_port(llcgprs_subdissector_table,sapi, next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo, tree);
}
@@ -359,6 +371,8 @@ proto_register_llcgprs(void)
&ett_llcgprs_sframe,
};
+ module_t *llcgprs_module;
+
/* Register the protocol name and description */
proto_llcgprs = proto_register_protocol("Logical Link Control GPRS",
"GPRS-LLC", "llcgprs");
@@ -367,6 +381,12 @@ proto_register_llcgprs(void)
proto_register_field_array(proto_llcgprs, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_dissector( "llcgprs", dissect_llcgprs, proto_llcgprs);
+
+ llcgprs_module = prefs_register_protocol ( proto_llcgprs, NULL );
+ prefs_register_bool_preference ( llcgprs_module, "ignore_cipher_bit",
+ "Ignore cipher bit",
+ "Whether to ignore the cipher bit (because it might be set on unciphered data)",
+ &ignore_cipher_bit );
}
@@ -385,4 +405,3 @@ proto_reg_handoff_llcgprs(void)
*/
data_handle = find_dissector("data");
}
-