1998-11-18 03:04:25 +00:00
|
|
|
/* packet-giop.c
|
|
|
|
* Routines for CORBA GIOP/IIOP packet disassembly
|
|
|
|
*
|
|
|
|
* Laurent Deniel <deniel@worldnet.fr>
|
|
|
|
*
|
2000-09-01 16:02:36 +00:00
|
|
|
* $Id: packet-giop.c,v 1.18 2000/09/01 16:02:36 gram Exp $
|
1998-11-18 03:04:25 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@zing.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
# include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
|
1999-03-23 03:14:46 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <glib.h>
|
1998-11-18 03:04:25 +00:00
|
|
|
#include "packet.h"
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
static int proto_giop = -1;
|
1999-10-09 13:31:30 +00:00
|
|
|
static int hf_giop_message_type = -1;
|
|
|
|
static int hf_giop_message_size = -1;
|
1999-07-29 05:47:07 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_giop = -1;
|
|
|
|
|
1998-11-18 03:04:25 +00:00
|
|
|
/*
|
|
|
|
* GIOP / IIOP types definition - OMG CORBA 2.x / GIOP 1.[01]
|
|
|
|
* See OMG WEB site <http://www.omg.org> - CORBA+IIOP 2.2 (98-02-01.ps)
|
|
|
|
*
|
|
|
|
* Notes on mapping:
|
|
|
|
*
|
|
|
|
* <sequence> : unsigned int (# elts) + elements
|
|
|
|
* <string> : unsigned int (string length) + length characters (with '\0')
|
|
|
|
* <enum> : unsigned int (from 0 to n)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define GIOP_MAGIC "GIOP"
|
|
|
|
#define GIOP_MAJOR 1
|
|
|
|
#define GIOP_MINOR 1
|
|
|
|
|
|
|
|
#define GIOP_HEADER_SIZE 12
|
|
|
|
|
|
|
|
typedef struct OctetSequence{
|
|
|
|
u_int sequence_length;
|
|
|
|
u_char sequence_data[1]; /* of length bytes */
|
|
|
|
} OctetSequence;
|
|
|
|
|
|
|
|
typedef OctetSequence Principal;
|
|
|
|
typedef OctetSequence String;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Some structures that contain sequences can not be directly used
|
|
|
|
* (alignment problem on 64 bit architectures)
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct ServiceContext {
|
|
|
|
u_int context_id;
|
|
|
|
OctetSequence context_data;
|
|
|
|
} ServiceContext;
|
|
|
|
|
|
|
|
typedef struct ServiceContextList{
|
|
|
|
u_int nr_context;
|
|
|
|
ServiceContext service_context[1]; /* nr_context elements */
|
|
|
|
} ServiceContextList;
|
|
|
|
|
|
|
|
typedef enum MsgType {
|
|
|
|
Request,
|
|
|
|
Reply,
|
|
|
|
CancelRequest,
|
|
|
|
LocateRequest,
|
|
|
|
LocateReply,
|
|
|
|
CloseConnection,
|
|
|
|
MessageError,
|
|
|
|
Fragment /* GIOP 1.1 only */
|
|
|
|
} MsgType;
|
|
|
|
|
|
|
|
typedef struct Version {
|
|
|
|
u_char major;
|
|
|
|
u_char minor;
|
|
|
|
} Version;
|
|
|
|
|
|
|
|
typedef struct MessageHeader {
|
|
|
|
char magic[4];
|
|
|
|
Version GIOP_version;
|
|
|
|
u_char flags; /* byte_order in 1.0 */
|
|
|
|
u_char message_type;
|
|
|
|
u_int message_size;
|
|
|
|
} MessageHeader;
|
|
|
|
|
|
|
|
typedef struct RequestHeader_1_0 {
|
|
|
|
/* ServiceContextList service_context;*/
|
|
|
|
u_int request_id;
|
|
|
|
u_char response_expected;
|
|
|
|
OctetSequence object_key;
|
|
|
|
/* String operation; */
|
|
|
|
/* Principal requesting_principal; */
|
|
|
|
} RequestHeader_1_0;
|
|
|
|
|
|
|
|
typedef struct RequestHeader_1_1 {
|
|
|
|
/* ServiceContextList service_context;*/
|
|
|
|
u_int request_id;
|
|
|
|
u_char response_expected;
|
|
|
|
u_char reserved[3];
|
|
|
|
OctetSequence object_key;
|
|
|
|
/* String operation; */
|
|
|
|
/* Principal requesting_principal; */
|
|
|
|
} RequestHeader_1_1;
|
|
|
|
|
|
|
|
typedef enum ReplyStatusType {
|
|
|
|
NO_EXCEPTION,
|
|
|
|
USER_EXCEPTION,
|
|
|
|
SYSTEM_EXCEPTION,
|
|
|
|
LOCATION_FORWARD
|
|
|
|
} ReplyStatusType;
|
|
|
|
|
|
|
|
typedef struct ReplyHeader {
|
|
|
|
/* ServiceContext service_context; */
|
|
|
|
u_int request_id;
|
|
|
|
u_int reply_status;
|
|
|
|
} ReplyHeader;
|
|
|
|
|
|
|
|
typedef struct SystemExceptionReplyBody {
|
|
|
|
String exception_id;
|
|
|
|
u_int minor_code_value;
|
|
|
|
u_int completion_status;
|
|
|
|
} SystemExceptionReplyBody;
|
|
|
|
|
|
|
|
typedef struct CancelRequestHeader {
|
|
|
|
u_int request_id;
|
|
|
|
} CancelRequestHeader;
|
|
|
|
|
|
|
|
typedef struct LocateRequestHeader {
|
|
|
|
u_int request_id;
|
|
|
|
OctetSequence object_key;
|
|
|
|
} LocateRequestHeader;
|
|
|
|
|
|
|
|
typedef enum LocateStatusType {
|
|
|
|
UNKNOWN_OBJECT,
|
|
|
|
OBJECT_HERE,
|
|
|
|
OBJECT_FORWARD
|
|
|
|
} LocateStatusType;
|
|
|
|
|
|
|
|
typedef struct LocateReplyHeader {
|
|
|
|
u_int request_id;
|
|
|
|
u_int locate_status;
|
|
|
|
} LocateReplyHeader;
|
|
|
|
|
|
|
|
|
1999-10-16 19:50:19 +00:00
|
|
|
static u_char *print_object_key(int length, u_char *from)
|
1998-11-18 03:04:25 +00:00
|
|
|
{
|
|
|
|
#define MAX_OBJECT_KEY_LENGTH 64
|
|
|
|
static u_char buffer[MAX_OBJECT_KEY_LENGTH];
|
|
|
|
u_char *to = buffer;
|
|
|
|
int i = 0;
|
|
|
|
length = MIN(MAX_OBJECT_KEY_LENGTH - 3, length);
|
|
|
|
*to++ = '"';
|
|
|
|
while(i++ < length) {
|
|
|
|
*to = (isprint(*from)) ? *from : '.';
|
|
|
|
to++;
|
|
|
|
from++;
|
|
|
|
}
|
|
|
|
*to++ = '"';
|
|
|
|
*to = '\0';
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* main entry point */
|
|
|
|
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
static gboolean
|
|
|
|
dissect_giop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
|
1998-11-18 03:04:25 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
MessageHeader header;
|
1999-03-23 03:14:46 +00:00
|
|
|
proto_tree *clnp_tree = NULL;
|
|
|
|
proto_item *ti;
|
1998-11-18 03:04:25 +00:00
|
|
|
u_char response_expected = 0;
|
|
|
|
u_int first_offset = offset;
|
|
|
|
u_int big_endian = FALSE;
|
|
|
|
u_int request_id = 0;
|
|
|
|
u_int message_size;
|
|
|
|
u_int minor_version;
|
|
|
|
u_int context_id;
|
|
|
|
u_int reply_status;
|
|
|
|
u_int locate_status;
|
|
|
|
u_int sequence_length;
|
|
|
|
u_int nr_seq;
|
|
|
|
RequestHeader_1_1 request_1_1;
|
|
|
|
RequestHeader_1_0 request_1_0;
|
|
|
|
ReplyHeader reply;
|
|
|
|
LocateReplyHeader locate_rep;
|
|
|
|
LocateRequestHeader locate_req;
|
|
|
|
int i;
|
|
|
|
|
Add the "Edit:Protocols..." feature which currently only implements
the following:
It is now possible to enable/disable a particular protocol decoding
(i.e. the protocol dissector is void or not). When a protocol
is disabled, it is displayed as Data and of course, all linked
sub-protocols are disabled as well.
Disabling a protocol could be interesting:
- in case of buggy dissectors
- in case of wrong heuristics
- for performance reasons
- to decode the data as another protocol (TODO)
Currently (if I am not wrong), all dissectors but NFS can be disabled
(and dissectors that do not register protocols :-)
I do not like the way the RPC sub-dissectors are disabled (in the
sub-dissectors) since this could be done in the RPC dissector itself,
knowing the sub-protocol hfinfo entry (this is why, I've not modified
the NFS one yet).
Two functions are added in proto.c :
gboolean proto_is_protocol_enabled(int n);
void proto_set_decoding(int n, gboolean enabled);
and two MACROs which can be used in dissectors:
OLD_CHECK_DISPLAY_AS_DATA(index, pd, offset, fd, tree)
CHECK_DISPLAY_AS_DATA(index, tvb, pinfo, tree)
See also the XXX in proto_dlg.c and proto.c around the new functions.
svn path=/trunk/; revision=2267
2000-08-13 14:09:15 +00:00
|
|
|
if (!proto_is_protocol_enabled(proto_giop))
|
|
|
|
return FALSE;
|
|
|
|
|
1998-11-18 03:04:25 +00:00
|
|
|
#define END_OF_GIOP_MESSAGE (offset - first_offset - GIOP_HEADER_SIZE)
|
|
|
|
|
1999-09-17 05:56:58 +00:00
|
|
|
if (!BYTES_ARE_IN_FRAME(offset, GIOP_HEADER_SIZE)) {
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
/* Not enough data, or not enough captured data; perhaps it was
|
|
|
|
a GIOP message, but we can't tell. */
|
|
|
|
return FALSE;
|
1998-11-18 03:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* avoid alignment problem */
|
|
|
|
|
|
|
|
memcpy(&header, &pd[offset], sizeof(header));
|
|
|
|
|
|
|
|
/* check magic number and version */
|
|
|
|
|
|
|
|
if (memcmp(header.magic, GIOP_MAGIC, sizeof(header.magic)) != 0) {
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
/* Not a GIOP message. */
|
|
|
|
return FALSE;
|
1998-11-18 03:04:25 +00:00
|
|
|
}
|
|
|
|
|
2000-07-27 17:11:44 +00:00
|
|
|
if (check_col(fd, COL_PROTOCOL)) {
|
|
|
|
col_add_str(fd, COL_PROTOCOL, "GIOP");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-11-18 03:04:25 +00:00
|
|
|
if (header.GIOP_version.major != GIOP_MAJOR ||
|
|
|
|
((minor_version = header.GIOP_version.minor) > GIOP_MINOR)) {
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
/* Bad version number; should we note that and dissect the rest
|
|
|
|
as data, or should we return FALSE on the theory that it
|
|
|
|
might have been some other packet that happened to begin with
|
|
|
|
"GIOP"? */
|
2000-07-27 17:11:44 +00:00
|
|
|
if (check_col(fd, COL_INFO)) {
|
|
|
|
col_add_fstr(fd, COL_INFO, "Version %d.%d",
|
|
|
|
header.GIOP_version.major, header.GIOP_version.minor);
|
|
|
|
}
|
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_giop, NullTVB, offset,
|
|
|
|
GIOP_HEADER_SIZE, FALSE);
|
|
|
|
clnp_tree = proto_item_add_subtree(ti, ett_giop);
|
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, GIOP_HEADER_SIZE,
|
|
|
|
"Version %d.%d not supported",
|
|
|
|
header.GIOP_version.major, header.GIOP_version.minor);
|
|
|
|
}
|
Allow either old-style (pre-tvbuff) or new-style (tvbuffified)
dissectors to be registered as dissectors for particular ports,
registered as heuristic dissectors, and registered as dissectors for
conversations, and have routines to be used both by old-style and
new-style dissectors to call registered dissectors.
Have the code that calls those dissectors translate the arguments as
necessary. (For conversation dissectors, replace
"find_conversation_dissector()", which just returns a pointer to the
dissector, with "old_try_conversation_dissector()" and
"try_conversation_dissector()", which actually call the dissector, so
that there's a single place at which we can do that translation. Also
make "dissector_lookup()" static and, instead of calling it and, if it
returns a non-null pointer, calling that dissector, just use
"old_dissector_try_port()" or "dissector_try_port()", for the same
reason.)
This allows some dissectors that took old-style arguments and
immediately translated them to new-style arguments to just take
new-style arguments; make them do so. It also allows some new-style
dissectors not to have to translate arguments before calling routines to
look up and call dissectors; make them not do so.
Get rid of checks for too-short frames in new-style dissectors - the
tvbuff code does those checks for you.
Give the routines to register old-style dissectors, and to call
dissectors from old-style dissectors, names beginning with "old_", with
the routines for new-style dissectors not having the "old_". Update the
dissectors that use those routines appropriately.
Rename "dissect_data()" to "old_dissect_data()", and
"dissect_data_tvb()" to "dissect_data()".
svn path=/trunk/; revision=2218
2000-08-07 03:21:25 +00:00
|
|
|
old_dissect_data(pd, offset + GIOP_HEADER_SIZE, fd, tree);
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
return TRUE;
|
1998-11-18 03:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch(minor_version) {
|
|
|
|
case 1 :
|
|
|
|
if (header.flags & 0x01)
|
|
|
|
big_endian = FALSE;
|
|
|
|
else
|
|
|
|
big_endian = TRUE;
|
|
|
|
break;
|
|
|
|
case 0 :
|
|
|
|
if (header.flags)
|
|
|
|
big_endian = FALSE;
|
|
|
|
else
|
|
|
|
big_endian = TRUE;
|
|
|
|
break;
|
|
|
|
default :
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (big_endian)
|
|
|
|
message_size = pntohl(&header.message_size);
|
|
|
|
else
|
|
|
|
message_size = pletohl(&header.message_size);
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_giop, NullTVB, offset,
|
2000-05-31 05:09:07 +00:00
|
|
|
GIOP_HEADER_SIZE + message_size, FALSE);
|
1999-11-16 11:44:20 +00:00
|
|
|
clnp_tree = proto_item_add_subtree(ti, ett_giop);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, 4,
|
1998-11-18 03:04:25 +00:00
|
|
|
"Magic number: %s", GIOP_MAGIC);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + 4, 2,
|
1998-11-18 03:04:25 +00:00
|
|
|
"Version: %d.%d",
|
|
|
|
header.GIOP_version.major,
|
|
|
|
header.GIOP_version.minor);
|
|
|
|
switch(minor_version) {
|
|
|
|
case 1 :
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + 6, 1,
|
1998-11-18 03:04:25 +00:00
|
|
|
"Flags: 0x%02x (%s%s)",
|
|
|
|
header.flags,
|
2000-09-01 16:02:36 +00:00
|
|
|
(big_endian) ? "big" : "little",
|
1998-11-18 03:04:25 +00:00
|
|
|
(header.flags & 0x02) ? " fragment" : "");
|
|
|
|
break;
|
|
|
|
case 0 :
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + 6, 1,
|
1998-11-18 03:04:25 +00:00
|
|
|
"Byte ordering: %s endian",
|
2000-09-01 16:02:36 +00:00
|
|
|
(big_endian) ? "big" : "little");
|
1998-11-18 03:04:25 +00:00
|
|
|
break;
|
|
|
|
default :
|
|
|
|
break;
|
|
|
|
} /* minor_version */
|
|
|
|
|
2000-03-12 04:48:32 +00:00
|
|
|
proto_tree_add_uint_format(clnp_tree,
|
1999-10-09 13:31:30 +00:00
|
|
|
hf_giop_message_type,
|
2000-05-11 08:18:09 +00:00
|
|
|
NullTVB, offset + 7, 1,
|
1999-10-09 13:31:30 +00:00
|
|
|
header.message_type,
|
|
|
|
"Message type: %s",
|
|
|
|
(header.message_type == Request) ? "Request" :
|
|
|
|
(header.message_type == Reply) ? "Reply" :
|
|
|
|
(header.message_type == CancelRequest) ? "CancelRequest" :
|
|
|
|
(header.message_type == LocateRequest) ? "LocateRequest" :
|
|
|
|
(header.message_type == LocateReply) ? "LocateReply" :
|
|
|
|
(header.message_type == CloseConnection) ? "CloseConnection" :
|
|
|
|
(header.message_type == MessageError) ? "MessageError" :
|
|
|
|
(header.message_type == Fragment) ? "Fragment" : "?");
|
|
|
|
|
2000-05-31 05:09:07 +00:00
|
|
|
proto_tree_add_uint(clnp_tree,
|
1999-10-09 13:31:30 +00:00
|
|
|
hf_giop_message_size,
|
2000-05-11 08:18:09 +00:00
|
|
|
NullTVB, offset + 8, 4,
|
1999-10-09 13:31:30 +00:00
|
|
|
message_size);
|
1998-11-18 03:04:25 +00:00
|
|
|
|
|
|
|
} /* tree */
|
|
|
|
|
|
|
|
offset += GIOP_HEADER_SIZE;
|
|
|
|
|
1999-09-17 05:56:58 +00:00
|
|
|
if (!BYTES_ARE_IN_FRAME(offset, message_size)) {
|
Allow either old-style (pre-tvbuff) or new-style (tvbuffified)
dissectors to be registered as dissectors for particular ports,
registered as heuristic dissectors, and registered as dissectors for
conversations, and have routines to be used both by old-style and
new-style dissectors to call registered dissectors.
Have the code that calls those dissectors translate the arguments as
necessary. (For conversation dissectors, replace
"find_conversation_dissector()", which just returns a pointer to the
dissector, with "old_try_conversation_dissector()" and
"try_conversation_dissector()", which actually call the dissector, so
that there's a single place at which we can do that translation. Also
make "dissector_lookup()" static and, instead of calling it and, if it
returns a non-null pointer, calling that dissector, just use
"old_dissector_try_port()" or "dissector_try_port()", for the same
reason.)
This allows some dissectors that took old-style arguments and
immediately translated them to new-style arguments to just take
new-style arguments; make them do so. It also allows some new-style
dissectors not to have to translate arguments before calling routines to
look up and call dissectors; make them not do so.
Get rid of checks for too-short frames in new-style dissectors - the
tvbuff code does those checks for you.
Give the routines to register old-style dissectors, and to call
dissectors from old-style dissectors, names beginning with "old_", with
the routines for new-style dissectors not having the "old_". Update the
dissectors that use those routines appropriately.
Rename "dissect_data()" to "old_dissect_data()", and
"dissect_data_tvb()" to "dissect_data()".
svn path=/trunk/; revision=2218
2000-08-07 03:21:25 +00:00
|
|
|
old_dissect_data(pd, offset, fd, tree);
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
return TRUE;
|
1998-11-18 03:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* skip service_context in Request/Reply messages */
|
|
|
|
|
|
|
|
switch(header.message_type) {
|
|
|
|
|
|
|
|
case Request:
|
|
|
|
case Reply :
|
|
|
|
|
|
|
|
nr_seq = (big_endian) ? pntohl(&pd[offset]) : pletohl(&pd[offset]);
|
|
|
|
|
|
|
|
offset += sizeof(nr_seq);
|
|
|
|
|
|
|
|
for (i = 0 ; i < nr_seq ; i++) {
|
|
|
|
|
|
|
|
if (big_endian) {
|
|
|
|
context_id = pntohl(&pd[offset]);
|
|
|
|
sequence_length = pntohl(&pd[offset + sizeof(context_id)]);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
context_id = pletohl(&pd[offset]);
|
|
|
|
sequence_length = pletohl(&pd[offset + sizeof(context_id)]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(context_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Context id: %d", context_id);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(context_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
sizeof(sequence_length),
|
|
|
|
"Sequence length: %d", sequence_length);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB,
|
1998-11-18 03:04:25 +00:00
|
|
|
offset +
|
|
|
|
sizeof(context_id) + sizeof(sequence_length),
|
|
|
|
sequence_length,
|
|
|
|
"Sequence data: <not shown>");
|
|
|
|
}
|
|
|
|
|
|
|
|
offset += sizeof(context_id) + sizeof(sequence_length) + sequence_length;
|
|
|
|
offset += (sequence_length %4) ? 4 - (sequence_length%4) : 0 ;
|
|
|
|
|
|
|
|
} /* for */
|
|
|
|
|
|
|
|
default :
|
|
|
|
break;
|
|
|
|
|
|
|
|
} /* switch message_type */
|
|
|
|
|
|
|
|
/* decode next parts according to message type */
|
|
|
|
|
|
|
|
switch(header.message_type) {
|
|
|
|
|
|
|
|
case Request:
|
|
|
|
|
|
|
|
switch(minor_version) {
|
|
|
|
case 1 :
|
|
|
|
memcpy(&request_1_1, &pd[offset], sizeof(request_1_1));
|
|
|
|
response_expected = request_1_1.response_expected;
|
|
|
|
request_id = (big_endian)? pntohl(&request_1_1.request_id) :
|
|
|
|
pletohl(&request_1_1.request_id);
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Request id: %d", request_id);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
sizeof(request_1_1.response_expected),
|
|
|
|
"Response expected: %d",
|
|
|
|
response_expected);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(request_id) +
|
1998-11-18 03:04:25 +00:00
|
|
|
sizeof(request_1_1.response_expected),
|
|
|
|
3,
|
|
|
|
"Reserved");
|
|
|
|
}
|
|
|
|
offset += sizeof(request_id) +
|
|
|
|
sizeof(request_1_1.response_expected) + 3;
|
|
|
|
break;
|
|
|
|
case 0 :
|
|
|
|
memcpy(&request_1_0, &pd[offset], sizeof(request_1_0));
|
|
|
|
response_expected = request_1_0.response_expected;
|
|
|
|
request_id = (big_endian)? pntohl(&request_1_0.request_id) :
|
|
|
|
pletohl(&request_1_0.request_id);
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Request id: %d", request_id);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
sizeof(request_1_0.response_expected),
|
|
|
|
"Response expected: %d",
|
|
|
|
response_expected);
|
|
|
|
}
|
|
|
|
|
|
|
|
offset += sizeof(request_id) +
|
|
|
|
sizeof(request_1_0.response_expected);
|
|
|
|
break;
|
|
|
|
default :
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* strange thing here with some ORBs/IIOP1.0 ? */
|
|
|
|
if ((offset - first_offset) % 4)
|
|
|
|
offset += 4 - (offset - first_offset)%4;
|
|
|
|
|
|
|
|
/* object_key */
|
|
|
|
|
|
|
|
sequence_length = (big_endian) ?
|
|
|
|
pntohl(&pd[offset]) : pletohl(&pd[offset]);
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Object key length: %d", sequence_length);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
sequence_length,
|
|
|
|
"Object key: %s",
|
|
|
|
print_object_key(sequence_length,
|
|
|
|
(u_char *)&pd[offset + sizeof(sequence_length)]));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* operation & requesting_principal */
|
|
|
|
|
|
|
|
offset += sizeof(sequence_length) + sequence_length;
|
|
|
|
offset += (sequence_length %4) ? 4 - (sequence_length%4) : 0 ;
|
|
|
|
|
|
|
|
sequence_length = (big_endian) ?
|
|
|
|
pntohl(&pd[offset]) : pletohl(&pd[offset]);
|
|
|
|
|
|
|
|
if (sequence_length > message_size) {
|
Allow either old-style (pre-tvbuff) or new-style (tvbuffified)
dissectors to be registered as dissectors for particular ports,
registered as heuristic dissectors, and registered as dissectors for
conversations, and have routines to be used both by old-style and
new-style dissectors to call registered dissectors.
Have the code that calls those dissectors translate the arguments as
necessary. (For conversation dissectors, replace
"find_conversation_dissector()", which just returns a pointer to the
dissector, with "old_try_conversation_dissector()" and
"try_conversation_dissector()", which actually call the dissector, so
that there's a single place at which we can do that translation. Also
make "dissector_lookup()" static and, instead of calling it and, if it
returns a non-null pointer, calling that dissector, just use
"old_dissector_try_port()" or "dissector_try_port()", for the same
reason.)
This allows some dissectors that took old-style arguments and
immediately translated them to new-style arguments to just take
new-style arguments; make them do so. It also allows some new-style
dissectors not to have to translate arguments before calling routines to
look up and call dissectors; make them not do so.
Get rid of checks for too-short frames in new-style dissectors - the
tvbuff code does those checks for you.
Give the routines to register old-style dissectors, and to call
dissectors from old-style dissectors, names beginning with "old_", with
the routines for new-style dissectors not having the "old_". Update the
dissectors that use those routines appropriately.
Rename "dissect_data()" to "old_dissect_data()", and
"dissect_data_tvb()" to "dissect_data()".
svn path=/trunk/; revision=2218
2000-08-07 03:21:25 +00:00
|
|
|
old_dissect_data(pd, offset, fd, tree);
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
return TRUE;
|
1998-11-18 03:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Operation length: %d", sequence_length);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
sequence_length,
|
|
|
|
"Operation: %s",
|
|
|
|
&pd[offset+sizeof(sequence_length)]);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset +
|
1998-11-18 03:04:25 +00:00
|
|
|
sizeof(sequence_length)+ sequence_length,
|
|
|
|
message_size - END_OF_GIOP_MESSAGE -
|
|
|
|
sizeof(sequence_length) - sequence_length,
|
|
|
|
"Requesting principal: <not shown>");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (check_col(fd, COL_INFO)) {
|
|
|
|
col_add_fstr(fd, COL_INFO, "Request %s %d: %s",
|
|
|
|
response_expected ? "two-way" : "one-way" ,
|
|
|
|
request_id,
|
|
|
|
&pd[offset+sizeof(sequence_length)]);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Reply :
|
|
|
|
|
|
|
|
memcpy(&reply, &pd[offset], sizeof(reply));
|
|
|
|
request_id = (big_endian) ?
|
|
|
|
pntohl(&reply.request_id) : pletohl(&reply.request_id);
|
|
|
|
reply_status = (big_endian) ?
|
|
|
|
pntohl(&reply.reply_status) : pletohl(&reply.reply_status);
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Request id: %d", request_id);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
sizeof(reply_status),
|
|
|
|
"Reply status: %s",
|
|
|
|
reply_status == NO_EXCEPTION ? "no exception" :
|
|
|
|
reply_status == USER_EXCEPTION ? "user exception" :
|
|
|
|
reply_status == SYSTEM_EXCEPTION ? "system exception" :
|
|
|
|
reply_status == LOCATION_FORWARD ? "location forward" :
|
|
|
|
"?");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (check_col(fd, COL_INFO)) {
|
|
|
|
col_add_fstr(fd, COL_INFO, "Reply %d: %s",
|
|
|
|
request_id,
|
|
|
|
reply_status == NO_EXCEPTION ? "no exception" :
|
|
|
|
reply_status == USER_EXCEPTION ? "user exception" :
|
|
|
|
reply_status == SYSTEM_EXCEPTION ? "system exception" :
|
|
|
|
reply_status == LOCATION_FORWARD ? "location forward" :
|
|
|
|
"?");
|
|
|
|
}
|
|
|
|
|
|
|
|
offset += sizeof(request_id) + sizeof(reply_status);
|
|
|
|
|
|
|
|
if (reply_status == SYSTEM_EXCEPTION) {
|
|
|
|
|
|
|
|
u_int minor_code_value;
|
|
|
|
u_int completion_status;
|
|
|
|
|
|
|
|
sequence_length = (big_endian) ?
|
|
|
|
pntohl(&pd[offset]) : pletohl(&pd[offset]);
|
|
|
|
|
|
|
|
if (sequence_length > message_size) {
|
Allow either old-style (pre-tvbuff) or new-style (tvbuffified)
dissectors to be registered as dissectors for particular ports,
registered as heuristic dissectors, and registered as dissectors for
conversations, and have routines to be used both by old-style and
new-style dissectors to call registered dissectors.
Have the code that calls those dissectors translate the arguments as
necessary. (For conversation dissectors, replace
"find_conversation_dissector()", which just returns a pointer to the
dissector, with "old_try_conversation_dissector()" and
"try_conversation_dissector()", which actually call the dissector, so
that there's a single place at which we can do that translation. Also
make "dissector_lookup()" static and, instead of calling it and, if it
returns a non-null pointer, calling that dissector, just use
"old_dissector_try_port()" or "dissector_try_port()", for the same
reason.)
This allows some dissectors that took old-style arguments and
immediately translated them to new-style arguments to just take
new-style arguments; make them do so. It also allows some new-style
dissectors not to have to translate arguments before calling routines to
look up and call dissectors; make them not do so.
Get rid of checks for too-short frames in new-style dissectors - the
tvbuff code does those checks for you.
Give the routines to register old-style dissectors, and to call
dissectors from old-style dissectors, names beginning with "old_", with
the routines for new-style dissectors not having the "old_". Update the
dissectors that use those routines appropriately.
Rename "dissect_data()" to "old_dissect_data()", and
"dissect_data_tvb()" to "dissect_data()".
svn path=/trunk/; revision=2218
2000-08-07 03:21:25 +00:00
|
|
|
old_dissect_data(pd, offset, fd, tree);
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
return TRUE;
|
1998-11-18 03:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Exception length: %d", sequence_length);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
sequence_length,
|
|
|
|
"Exception id: %s",
|
|
|
|
&pd[offset+sizeof(sequence_length)]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
offset += sizeof(sequence_length) + sequence_length;
|
|
|
|
|
|
|
|
minor_code_value = (big_endian) ?
|
|
|
|
pntohl(&pd[offset]) : pletohl(&pd[offset]);
|
|
|
|
completion_status = (big_endian) ?
|
|
|
|
pntohl(&pd[offset+sizeof(minor_code_value)]) :
|
|
|
|
pletohl(&pd[offset+sizeof(minor_code_value)]);
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(minor_code_value),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Minor code value: %d", minor_code_value);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(minor_code_value),
|
1998-11-18 03:04:25 +00:00
|
|
|
sizeof(completion_status),
|
|
|
|
"Completion Status: %d",
|
|
|
|
completion_status);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (reply_status == USER_EXCEPTION) {
|
|
|
|
|
|
|
|
sequence_length = (big_endian) ?
|
|
|
|
pntohl(&pd[offset]) : pletohl(&pd[offset]);
|
|
|
|
|
|
|
|
if (sequence_length > message_size) {
|
Allow either old-style (pre-tvbuff) or new-style (tvbuffified)
dissectors to be registered as dissectors for particular ports,
registered as heuristic dissectors, and registered as dissectors for
conversations, and have routines to be used both by old-style and
new-style dissectors to call registered dissectors.
Have the code that calls those dissectors translate the arguments as
necessary. (For conversation dissectors, replace
"find_conversation_dissector()", which just returns a pointer to the
dissector, with "old_try_conversation_dissector()" and
"try_conversation_dissector()", which actually call the dissector, so
that there's a single place at which we can do that translation. Also
make "dissector_lookup()" static and, instead of calling it and, if it
returns a non-null pointer, calling that dissector, just use
"old_dissector_try_port()" or "dissector_try_port()", for the same
reason.)
This allows some dissectors that took old-style arguments and
immediately translated them to new-style arguments to just take
new-style arguments; make them do so. It also allows some new-style
dissectors not to have to translate arguments before calling routines to
look up and call dissectors; make them not do so.
Get rid of checks for too-short frames in new-style dissectors - the
tvbuff code does those checks for you.
Give the routines to register old-style dissectors, and to call
dissectors from old-style dissectors, names beginning with "old_", with
the routines for new-style dissectors not having the "old_". Update the
dissectors that use those routines appropriately.
Rename "dissect_data()" to "old_dissect_data()", and
"dissect_data_tvb()" to "dissect_data()".
svn path=/trunk/; revision=2218
2000-08-07 03:21:25 +00:00
|
|
|
old_dissect_data(pd, offset, fd, tree);
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
return TRUE;
|
1998-11-18 03:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Exception length: %d", sequence_length);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
sequence_length,
|
|
|
|
"Exception id: %s",
|
|
|
|
&pd[offset+sizeof(sequence_length)]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
offset += sizeof(sequence_length) + sequence_length;
|
|
|
|
|
|
|
|
sequence_length = (big_endian) ?
|
|
|
|
pntohl(&pd[offset]) : pletohl(&pd[offset]);
|
|
|
|
|
|
|
|
if (sequence_length > message_size) {
|
Allow either old-style (pre-tvbuff) or new-style (tvbuffified)
dissectors to be registered as dissectors for particular ports,
registered as heuristic dissectors, and registered as dissectors for
conversations, and have routines to be used both by old-style and
new-style dissectors to call registered dissectors.
Have the code that calls those dissectors translate the arguments as
necessary. (For conversation dissectors, replace
"find_conversation_dissector()", which just returns a pointer to the
dissector, with "old_try_conversation_dissector()" and
"try_conversation_dissector()", which actually call the dissector, so
that there's a single place at which we can do that translation. Also
make "dissector_lookup()" static and, instead of calling it and, if it
returns a non-null pointer, calling that dissector, just use
"old_dissector_try_port()" or "dissector_try_port()", for the same
reason.)
This allows some dissectors that took old-style arguments and
immediately translated them to new-style arguments to just take
new-style arguments; make them do so. It also allows some new-style
dissectors not to have to translate arguments before calling routines to
look up and call dissectors; make them not do so.
Get rid of checks for too-short frames in new-style dissectors - the
tvbuff code does those checks for you.
Give the routines to register old-style dissectors, and to call
dissectors from old-style dissectors, names beginning with "old_", with
the routines for new-style dissectors not having the "old_". Update the
dissectors that use those routines appropriately.
Rename "dissect_data()" to "old_dissect_data()", and
"dissect_data_tvb()" to "dissect_data()".
svn path=/trunk/; revision=2218
2000-08-07 03:21:25 +00:00
|
|
|
old_dissect_data(pd, offset, fd, tree);
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
return TRUE;
|
1998-11-18 03:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tree && sequence_length) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Exception member length: %d", sequence_length);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(sequence_length),
|
1998-11-18 03:04:25 +00:00
|
|
|
sequence_length,
|
|
|
|
"Exception member: %s",
|
|
|
|
&pd[offset+sizeof(sequence_length)]);
|
|
|
|
}
|
|
|
|
|
|
|
|
offset += sizeof(sequence_length) + sequence_length;
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset,
|
1998-11-18 03:04:25 +00:00
|
|
|
message_size - END_OF_GIOP_MESSAGE,
|
|
|
|
"Reply body: <not shown>");
|
|
|
|
}
|
|
|
|
|
|
|
|
} /* reply_status */
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LocateRequest :
|
|
|
|
|
|
|
|
memcpy(&locate_req, &pd[offset], sizeof(locate_req));
|
|
|
|
request_id = (big_endian) ?
|
|
|
|
pntohl(&locate_req.request_id) : pletohl(&locate_req.request_id);
|
|
|
|
|
|
|
|
sequence_length = (big_endian) ?
|
|
|
|
pntohl(&pd[offset+sizeof(request_id)]) :
|
|
|
|
pletohl(&pd[offset+sizeof(request_id)]);
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Request id: %d", request_id);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
sizeof(sequence_length),
|
|
|
|
"Object key length: %d", sequence_length);
|
|
|
|
offset += sizeof(request_id) + sizeof(sequence_length);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB,
|
1998-11-18 03:04:25 +00:00
|
|
|
offset,
|
|
|
|
sequence_length,
|
|
|
|
"Object key: %s",
|
|
|
|
print_object_key(sequence_length,
|
|
|
|
(u_char *)&pd[offset]));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (check_col(fd, COL_INFO)) {
|
|
|
|
col_add_fstr(fd, COL_INFO, "LocateRequest %d", request_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LocateReply :
|
|
|
|
|
|
|
|
memcpy(&locate_rep, &pd[offset], sizeof(locate_rep));
|
|
|
|
request_id = (big_endian) ?
|
|
|
|
pntohl(&locate_rep.request_id) : pletohl(&locate_rep.request_id);
|
|
|
|
locate_status = (big_endian) ?
|
|
|
|
pntohl(&locate_rep.locate_status) : pletohl(&locate_rep.locate_status);
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Request id: %d", request_id);
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset + sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
sizeof(locate_status),
|
|
|
|
"Locate status: %d", locate_status);
|
|
|
|
offset += sizeof(request_id) + sizeof(locate_status);
|
|
|
|
if (locate_status == OBJECT_FORWARD) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset,
|
1998-11-18 03:04:25 +00:00
|
|
|
message_size - END_OF_GIOP_MESSAGE,
|
|
|
|
"Locate reply body: <not shown>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (check_col(fd, COL_INFO)) {
|
|
|
|
col_add_fstr(fd, COL_INFO, "LocateReply %d: %s",
|
|
|
|
request_id,
|
|
|
|
(locate_status == UNKNOWN_OBJECT) ? "Unknown object" :
|
|
|
|
(locate_status == OBJECT_HERE) ? "Object here" :
|
|
|
|
(locate_status == OBJECT_FORWARD) ? "Object forward" : "?");
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CancelRequest :
|
|
|
|
|
|
|
|
request_id = (big_endian) ?
|
|
|
|
pntohl(&pd[offset]) : pletohl(&pd[offset]);
|
|
|
|
|
|
|
|
if (tree) {
|
2000-05-11 08:18:09 +00:00
|
|
|
proto_tree_add_text(clnp_tree, NullTVB, offset, sizeof(request_id),
|
1998-11-18 03:04:25 +00:00
|
|
|
"Request id: %d", request_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (check_col(fd, COL_INFO)) {
|
|
|
|
col_add_fstr(fd, COL_INFO, "CancelRequest %d", request_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CloseConnection :
|
|
|
|
if (check_col(fd, COL_INFO)) {
|
|
|
|
col_add_str(fd, COL_INFO, "CloseConnection");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MessageError :
|
|
|
|
if (check_col(fd, COL_INFO)) {
|
|
|
|
col_add_str(fd, COL_INFO, "MessageError");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Fragment :
|
|
|
|
if (check_col(fd, COL_INFO)) {
|
|
|
|
col_add_str(fd, COL_INFO, "Fragment");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default :
|
|
|
|
break;
|
|
|
|
|
|
|
|
} /* switch message_type */
|
|
|
|
|
|
|
|
|
|
|
|
offset = first_offset + GIOP_HEADER_SIZE + message_size;
|
|
|
|
|
1999-09-17 05:56:58 +00:00
|
|
|
if (IS_DATA_IN_FRAME(offset)) {
|
Allow either old-style (pre-tvbuff) or new-style (tvbuffified)
dissectors to be registered as dissectors for particular ports,
registered as heuristic dissectors, and registered as dissectors for
conversations, and have routines to be used both by old-style and
new-style dissectors to call registered dissectors.
Have the code that calls those dissectors translate the arguments as
necessary. (For conversation dissectors, replace
"find_conversation_dissector()", which just returns a pointer to the
dissector, with "old_try_conversation_dissector()" and
"try_conversation_dissector()", which actually call the dissector, so
that there's a single place at which we can do that translation. Also
make "dissector_lookup()" static and, instead of calling it and, if it
returns a non-null pointer, calling that dissector, just use
"old_dissector_try_port()" or "dissector_try_port()", for the same
reason.)
This allows some dissectors that took old-style arguments and
immediately translated them to new-style arguments to just take
new-style arguments; make them do so. It also allows some new-style
dissectors not to have to translate arguments before calling routines to
look up and call dissectors; make them not do so.
Get rid of checks for too-short frames in new-style dissectors - the
tvbuff code does those checks for you.
Give the routines to register old-style dissectors, and to call
dissectors from old-style dissectors, names beginning with "old_", with
the routines for new-style dissectors not having the "old_". Update the
dissectors that use those routines appropriately.
Rename "dissect_data()" to "old_dissect_data()", and
"dissect_data_tvb()" to "dissect_data()".
svn path=/trunk/; revision=2218
2000-08-07 03:21:25 +00:00
|
|
|
old_dissect_data(pd, offset, fd, tree);
|
1998-11-18 03:04:25 +00:00
|
|
|
}
|
|
|
|
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
return TRUE;
|
1998-11-18 03:04:25 +00:00
|
|
|
} /* dissect_giop */
|
|
|
|
|
1999-10-09 13:31:30 +00:00
|
|
|
void
|
1999-07-29 05:47:07 +00:00
|
|
|
proto_register_giop(void)
|
|
|
|
{
|
1999-10-09 13:31:30 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_giop_message_type,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Message type", "giop.type", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"" }},
|
1999-10-09 13:31:30 +00:00
|
|
|
{ &hf_giop_message_size,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Message size", "giop.len", FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"" }},
|
1999-10-09 13:31:30 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_giop,
|
|
|
|
};
|
1999-10-09 13:31:30 +00:00
|
|
|
|
|
|
|
proto_giop = proto_register_protocol("General Inter-ORB Protocol", "giop");
|
|
|
|
proto_register_field_array(proto_giop, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
1999-07-29 05:47:07 +00:00
|
|
|
}
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_giop(void)
|
|
|
|
{
|
Allow either old-style (pre-tvbuff) or new-style (tvbuffified)
dissectors to be registered as dissectors for particular ports,
registered as heuristic dissectors, and registered as dissectors for
conversations, and have routines to be used both by old-style and
new-style dissectors to call registered dissectors.
Have the code that calls those dissectors translate the arguments as
necessary. (For conversation dissectors, replace
"find_conversation_dissector()", which just returns a pointer to the
dissector, with "old_try_conversation_dissector()" and
"try_conversation_dissector()", which actually call the dissector, so
that there's a single place at which we can do that translation. Also
make "dissector_lookup()" static and, instead of calling it and, if it
returns a non-null pointer, calling that dissector, just use
"old_dissector_try_port()" or "dissector_try_port()", for the same
reason.)
This allows some dissectors that took old-style arguments and
immediately translated them to new-style arguments to just take
new-style arguments; make them do so. It also allows some new-style
dissectors not to have to translate arguments before calling routines to
look up and call dissectors; make them not do so.
Get rid of checks for too-short frames in new-style dissectors - the
tvbuff code does those checks for you.
Give the routines to register old-style dissectors, and to call
dissectors from old-style dissectors, names beginning with "old_", with
the routines for new-style dissectors not having the "old_". Update the
dissectors that use those routines appropriately.
Rename "dissect_data()" to "old_dissect_data()", and
"dissect_data_tvb()" to "dissect_data()".
svn path=/trunk/; revision=2218
2000-08-07 03:21:25 +00:00
|
|
|
old_heur_dissector_add("tcp", dissect_giop);
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
}
|