To determine the direction of the traffic, use "pinfo->p2p_dir", rather
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 31 Oct 2002 07:43:10 +0000 (07:43 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 31 Oct 2002 07:43:10 +0000 (07:43 +0000)
than the p2p pseudo-header's "sent" field, in the LAPD dissector (the
p2p pseudo-header isn't used for ISDN).

Do something similar for the V.120 dissector (which currently will only
be used in ISDN captures, but this makes it possible for it to handle
other captures as well).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6522 f5534014-38df-0310-8fa8-9805f1628bb7

packet-lapd.c
packet-v120.c

index 22b339ef8052abe7b59c5942f60e3be26c197a2b..16914bc2326759a38d6cd2db55deee390cf88ae1 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for LAPD frame disassembly
  * Gilbert Ramirez <gram@alumni.rice.edu>
  *
- * $Id: packet-lapd.c,v 1.32 2002/10/31 07:12:23 guy Exp $
+ * $Id: packet-lapd.c,v 1.33 2002/10/31 07:43:10 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -100,7 +100,7 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        sapi = (address & LAPD_SAPI) >> LAPD_SAPI_SHIFT;
        lapd_header_len = 2;    /* address */
 
-       if (pinfo->pseudo_header->p2p.sent) {
+       if (pinfo->p2p_dir == P2P_DIR_SENT) {
                is_response = cr ? TRUE : FALSE;
                if(check_col(pinfo->cinfo, COL_RES_DL_DST))
                        col_set_str(pinfo->cinfo, COL_RES_DL_DST, "Network");
@@ -108,6 +108,7 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                        col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "User");
        }
        else {
+               /* XXX - what if the direction is unknown? */
                is_response = cr ? FALSE : TRUE;
                if(check_col(pinfo->cinfo, COL_RES_DL_DST))
                    col_set_str(pinfo->cinfo, COL_RES_DL_DST, "User");
index c46acb0dbc5f9704e3350d45d173fe8950aade8b..5c6a856351f26c84cc2c3afd6a5f61ce04f03f1d 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for v120 frame disassembly
  * Bert Driehuis <driehuis@playbeing.org>
  *
- * $Id: packet-v120.c,v 1.29 2002/10/31 07:12:23 guy Exp $
+ * $Id: packet-v120.c,v 1.30 2002/10/31 07:43:10 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -82,20 +82,15 @@ dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        return;
     }
 
-    if (pinfo->pseudo_header->isdn.uton) {
-       if (!(byte0 & 0x02))
-           is_response = TRUE;
-       else
-           is_response = FALSE;
+    if (pinfo->p2p_dir == P2P_DIR_SENT) {
+       is_response = (byte0 & 0x02) ? FALSE: TRUE;
        if(check_col(pinfo->cinfo, COL_RES_DL_DST))
            col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DCE");
        if(check_col(pinfo->cinfo, COL_RES_DL_SRC))
            col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DTE");
     } else {
-       if (byte0 & 0x02)
-           is_response = TRUE;
-       else
-           is_response = FALSE;
+       /* XXX - what if the direction is unknown? */
+       is_response = (byte0 & 0x02) ? TRUE : FALSE;
        if(check_col(pinfo->cinfo, COL_RES_DL_DST))
            col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DTE");
        if(check_col(pinfo->cinfo, COL_RES_DL_SRC))