diff options
author | Laurent Deniel <laurent.deniel@free.fr> | 2000-08-06 15:54:42 +0000 |
---|---|---|
committer | Laurent Deniel <laurent.deniel@free.fr> | 2000-08-06 15:54:42 +0000 |
commit | a60203b3c6656798f1be051910a997091b734c2d (patch) | |
tree | c4b5c1dd6c614eaae7597fe233fbeff7c01b7242 | |
parent | a056a4d4469a97fed144343020231083889aa987 (diff) | |
download | wireshark-a60203b3c6656798f1be051910a997091b734c2d.tar.gz wireshark-a60203b3c6656798f1be051910a997091b734c2d.tar.bz2 wireshark-a60203b3c6656798f1be051910a997091b734c2d.zip |
Add some preferences in OSI CLNP/COTP/CLTP module to allow the user to:
- specify the NSAP selector for OSI transport decoding (default is still 0x21
which is valid for DECNet-OSI at least).
- force the OSI C{L,O}TP decoding whatever the NSAP is (option disabled by default).
svn path=/trunk/; revision=2217
-rw-r--r-- | packet-clnp.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/packet-clnp.c b/packet-clnp.c index d7aecddb55..ed5aa0a82b 100644 --- a/packet-clnp.c +++ b/packet-clnp.c @@ -1,7 +1,7 @@ /* packet-clnp.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-clnp.c,v 1.10 2000/07/10 06:52:29 guy Exp $ + * $Id: packet-clnp.c,v 1.11 2000/08/06 15:54:42 deniel Exp $ * Laurent Deniel <deniel@worldnet.fr> * Ralf Schneider <Ralf.Schneider@t-online.de> * @@ -38,6 +38,7 @@ #include <string.h> #include <ctype.h> #include <glib.h> +#include "prefs.h" #include "packet.h" #include "packet-osi.h" #include "packet-osi-options.h" @@ -254,6 +255,10 @@ static u_short dst_ref; Subset of CLNP. */ static heur_dissector_list_t cotp_is_heur_subdissector_list; +/* options */ +static guint tp_nsap_selector = NSEL_TP; +static gboolean always_decode_transport = FALSE; + /* function definitions */ #define MAX_TSAP_LEN 32 @@ -1717,7 +1722,7 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd, XXX - if this isn't the first Derived PDU of a segmented Initial PDU, skip that? */ - if (nsel == NSEL_TP) { /* just guessing here - valid for DECNet-OSI */ + if (nsel == (char)tp_nsap_selector || always_decode_transport) { if (dissect_ositp_internal(pd, offset, fd, tree, FALSE)) return; /* yes, it appears to be COTP or CLTP */ } @@ -1785,9 +1790,22 @@ void proto_register_clnp(void) &ett_clnp, }; + module_t *clnp_module; + proto_clnp = proto_register_protocol(PROTO_STRING_CLNP, "clnp"); proto_register_field_array(proto_clnp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + clnp_module = prefs_register_module("clnp", "CLNP", NULL); + prefs_register_uint_preference(clnp_module, "tp_nsap_selector", + "NSAP selector for Transport Protocol (last byte in hexa)", + "NSAP selector for Transport Protocol (last byte in hexa)", + 16, &tp_nsap_selector); + prefs_register_bool_preference(clnp_module, "always_decode_transport", + "Always try to decode NSDU as transport PDUs", + "Always try to decode NSDU as transport PDUs", + &always_decode_transport); + } void proto_register_cotp(void) |