Ethereal-dev: Re: [Ethereal-dev] Path for session dissector(packet-ses.c/packet-ses.h).

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Sid Sid" <ysidelnikov@xxxxxxxxxxx>
Date: Mon, 12 Jan 2004 13:41:18 +0000
As well it does not work correctly for user information data.
Data dissector does not need type of session pdu at all but presentation dissector need it.

In my post it was:
			/* do we have OSI presentation packet dissector ? */
			if(!pres_handle)
			{
				call_dissector(data_handle, next_tvb, pinfo,
				    tree);
			}
			else
			{
				/*   save type of session pdu. We'll need it in the presentation
dissector  */
				pinfo->private_data = &session;
				call_dissector(pres_handle, next_tvb, pinfo,
				    tree);
				pinfo->private_data = NULL;
			}

but it has been changed to :
			/* do we have OSI presentation packet dissector ? */
			if(!pres_handle)
			{
/* save type of session pdu. We'll need it in the presentation dissector */
				save_private_data = pinfo->private_data;
				pinfo->private_data = &session;
				call_dissector(data_handle, next_tvb, pinfo,
				    tree);
				pinfo->private_data = save_private_data;
			}
			else
			{
				call_dissector(pres_handle, next_tvb, pinfo,
				    tree);
			}
Could you please explain me for what purpose ?

I've attached patch which includes my last message too.


From: "Sid Sid" <ysidelnikov@xxxxxxxxxxx>
To: guy@xxxxxxxxxxxx
CC: ethereal-dev@xxxxxxxxxxxx
Subject: Re: [Ethereal-dev] Path for session dissector(packet-ses.c/packet-ses.h).
Date: Mon, 12 Jan 2004 11:50:04 +0000

I think it will not work correctly in call_pres_dissector routine because in case of local "session" we have address of address in call_pres_dissector routine.
Have a look :

call_pres_dissector(tvbuff_t *tvb, int offset, guint16 param_len,
   packet_info *pinfo, proto_tree *tree, proto_tree *param_tree,
struct SESSION_DATA_STRUCTURE *session) <- it is already address of structure

....
/* save type of session pdu. We'll need it in the presentation dissector */
   saved_private_data = pinfo->private_data;
pinfo->private_data = &session; address of address.Really, we don't need this.

But this line has to be :

  pinfo->private_data = session;

I've attached patch.

From: Guy Harris <guy@xxxxxxxxxxxx>
To: Sid Sid <ysidelnikov@xxxxxxxxxxx>
CC: ethereal-dev@xxxxxxxxxxxx
Subject: Re: [Ethereal-dev] Path for session dissector (packet-ses.c/packet-ses.h).
Date: Fri, 9 Jan 2004 15:19:25 -0800


On Jan 9, 2004, at 12:06 AM, Sid Sid wrote:

Patch for session dissector:

Checked in, with "session" made local to "dissect_ses()" and passed by reference to subroutines, and with "pinfo->private_data" restored rather than set to null when the presentation dissector returns.


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
<< packet-ses.c.diff >>
_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
--- packet-ses_1_6.c	2004-01-12 14:15:50.420004000 -0300
+++ packet-ses.c	2004-01-12 15:43:45.580008000 -0300
@@ -292,7 +292,7 @@
		{
/* save type of session pdu. We'll need it in the presentation dissector */
			saved_private_data = pinfo->private_data;
-			pinfo->private_data = &session;
+			pinfo->private_data = session;
			call_dissector(pres_handle, next_tvb, pinfo, tree);
			pinfo->private_data = saved_private_data;
		}
@@ -1019,17 +1019,17 @@
			/* do we have OSI presentation packet dissector ? */
			if(!pres_handle)
			{
- /* save type of session pdu. We'll need it in the presentation dissector */
-				save_private_data = pinfo->private_data;
-				pinfo->private_data = &session;
				call_dissector(data_handle, next_tvb, pinfo,
				    tree);
-				pinfo->private_data = save_private_data;
			}
			else
			{
+ /* save type of session pdu. We'll need it in the presentation dissector */
+				save_private_data = pinfo->private_data;
+				pinfo->private_data = &session;
				call_dissector(pres_handle, next_tvb, pinfo,
				    tree);
+				pinfo->private_data = save_private_data;
			}

			/*