]> git.samba.org - obnox/wireshark/wip.git/commitdiff
The Sniffer file formats include a file to identify raw cells; export
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 10 Jan 2003 04:04:42 +0000 (04:04 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 10 Jan 2003 04:04:42 +0000 (04:04 +0000)
that flag in the ATM pseudo-header, and use it to determine whether a
frame is a raw cell or a reassembled frame, rather than using the AAL,
as you can have raw AAL5 cells in a capture.

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

packet-atm.c
wiretap/iptrace.c
wiretap/libpcap.c
wiretap/netmon.c
wiretap/netxray.c
wiretap/ngsniffer.c
wiretap/snoop.c
wiretap/wtap.h

index 51df856d56a2c3124bf845329df00c254f2079dd..bdd57d9b9b573be0e17c46bdaaafe2426c14801d 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-atm.c
  * Routines for ATM packet disassembly
  *
- * $Id: packet-atm.c,v 1.56 2003/01/09 04:11:08 guy Exp $
+ * $Id: packet-atm.c,v 1.57 2003/01/10 04:04:39 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1511,14 +1511,13 @@ dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        val_to_str(pinfo->pseudo_header->atm.aal, aal_vals,
          "Unknown AAL (%u)"));
   }
-  if (pinfo->pseudo_header->atm.aal == AAL_5 ||
-      pinfo->pseudo_header->atm.aal == AAL_SIGNALLING) {
-    /* This is a reassembled PDU. */
-    dissect_reassembled_pdu(tvb, pinfo, tree, atm_tree, truncated);
-  } else {
-    /* Assume this is a single cell, with the cell header at the beginning. */
+  if (pinfo->pseudo_header->atm.flags & ATM_IS_CELL) {
+    /* This is a single cell, with the cell header at the beginning. */
     proto_item_set_len(ti, 5);
     dissect_atm_cell(tvb, pinfo, tree, atm_tree);
+  } else {
+    /* This is a reassembled PDU. */
+    dissect_reassembled_pdu(tvb, pinfo, tree, atm_tree, truncated);
   }
 }
 
index 9bb1a7aef757d1eb1241e19eaea047c46c4f5173..8f5d2a9775e119fb605f424c62dcb9e39b102511 100644 (file)
@@ -1,6 +1,6 @@
 /* iptrace.c
  *
- * $Id: iptrace.c,v 1.46 2003/01/03 06:45:45 guy Exp $
+ * $Id: iptrace.c,v 1.47 2003/01/10 04:04:41 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -531,6 +531,7 @@ get_atm_pseudo_header(const guint8 *pd, guint32 len,
        atm_guess_traffic_type(pd, len, pseudo_header);
 
        /* We don't have this information */
+       pseudo_header->atm.flags = 0;
        pseudo_header->atm.cells = 0;
        pseudo_header->atm.aal5t_u2u = 0;
        pseudo_header->atm.aal5t_len = 0;
index 59054904fc471fe81e897edd142d503cc590098b..a9c7d8ac9eab6feb9af168e640f62c44d3de79a1 100644 (file)
@@ -1,6 +1,6 @@
 /* libpcap.c
  *
- * $Id: libpcap.c,v 1.89 2003/01/09 01:55:12 guy Exp $
+ * $Id: libpcap.c,v 1.90 2003/01/10 04:04:41 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -1161,6 +1161,7 @@ libpcap_get_atm_pseudoheader(const struct sunatm_hdr *atm_phdr,
        pseudo_header->atm.channel = (atm_phdr->flags & 0x80) ? 0 : 1;
 
        /* We don't have this information */
+       pseudo_header->atm.flags = 0;
        pseudo_header->atm.cells = 0;
        pseudo_header->atm.aal5t_u2u = 0;
        pseudo_header->atm.aal5t_len = 0;
index ba86b5090279fe8648176e083fcd64ce0ea20232..d760f590547af5c950f578f432d4686bd7f99603 100644 (file)
@@ -1,6 +1,6 @@
 /* netmon.c
  *
- * $Id: netmon.c,v 1.63 2003/01/06 20:30:38 guy Exp $
+ * $Id: netmon.c,v 1.64 2003/01/10 04:04:41 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -508,6 +508,7 @@ netmon_read_atm_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header,
        pseudo_header->atm.vci = vci;
 
        /* We don't have this information */
+       pseudo_header->atm.flags = 0;
        pseudo_header->atm.channel = 0;
        pseudo_header->atm.cells = 0;
        pseudo_header->atm.aal5t_u2u = 0;
index 3ee0267dc84b523f06b993fd6f785a73824dfd7f..0d69f2f002d1dcbd4beb54b3af9fadcd77e30515 100644 (file)
@@ -1,6 +1,6 @@
 /* netxray.c
  *
- * $Id: netxray.c,v 1.73 2003/01/09 01:55:12 guy Exp $
+ * $Id: netxray.c,v 1.74 2003/01/10 04:04:41 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -645,6 +645,12 @@ netxray_set_pseudo_header(wtap *wth, const guint8 *pd, int len,
                        break;
 
                case WTAP_ENCAP_ATM_PDUS_UNTRUNCATED:
+                       pseudo_header->atm.flags = 0;
+                       /*
+                        * XXX - is 0x08 an "OAM cell" flag?
+                        */
+                       if (hdr->hdr_2_x.xxx[9] & 0x04)
+                               pseudo_header->atm.flags |= ATM_RAW_CELL;
                        pseudo_header->atm.vpi = hdr->hdr_2_x.xxx[11];
                        pseudo_header->atm.vci = pletohs(&hdr->hdr_2_x.xxx[12]);
                        pseudo_header->atm.channel =
index bebca85ba71691eb4aff199a1d1acbcdaa17d8d2..62b44ddf7d091bd4dbae82221590d370ef36e960 100644 (file)
@@ -1,6 +1,6 @@
 /* ngsniffer.c
  *
- * $Id: ngsniffer.c,v 1.103 2003/01/09 04:36:26 guy Exp $
+ * $Id: ngsniffer.c,v 1.104 2003/01/10 04:04:41 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -1254,9 +1254,18 @@ static gboolean ngsniffer_read_frame4(wtap *wth, gboolean is_random,
 static void set_pseudo_header_frame4(union wtap_pseudo_header *pseudo_header,
     struct frame4_rec *frame4)
 {
+       guint32 StatusWord;
        guint8 aal_type, hl_type;
        guint16 vpi, vci;
 
+       /*
+        * Map flags from frame4.atm_info.StatusWord.
+        */
+       pseudo_header->atm.flags = 0;
+       StatusWord = pletohl(&frame4->atm_info.StatusWord);
+       if (StatusWord & SW_RAW_CELL)
+               pseudo_header->atm.flags |= ATM_RAW_CELL;
+
        aal_type = frame4->atm_info.AppTrafType & ATT_AALTYPE;
        hl_type = frame4->atm_info.AppTrafType & ATT_HLTYPE;
        vpi = pletohs(&frame4->atm_info.Vpi);
index cac30feba5622c9c6afeaba990416b0a60748075..7a702c393cf37bd834ac34508709328e7a5fba4f 100644 (file)
@@ -1,6 +1,6 @@
 /* snoop.c
  *
- * $Id: snoop.c,v 1.60 2003/01/09 01:55:12 guy Exp $
+ * $Id: snoop.c,v 1.61 2003/01/10 04:04:42 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -589,6 +589,7 @@ snoop_read_atm_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header,
        pseudo_header->atm.channel = (atm_phdr.flags & 0x80) ? 0 : 1;
 
        /* We don't have this information */
+       pseudo_header->atm.flags = 0;
        pseudo_header->atm.cells = 0;
        pseudo_header->atm.aal5t_u2u = 0;
        pseudo_header->atm.aal5t_len = 0;
index 8aea9d0e68d02cebb83c98ee5ee1f38d0166bb37..06fabbe77d327ff4eb85dfff20bf3850ade8e2f5 100644 (file)
@@ -1,6 +1,6 @@
 /* wtap.h
  *
- * $Id: wtap.h,v 1.131 2003/01/09 01:55:13 guy Exp $
+ * $Id: wtap.h,v 1.132 2003/01/10 04:04:42 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -207,6 +207,11 @@ struct isdn_phdr {
 /* Packet "pseudo-header" for ATM capture files.
    Not all of this information is supplied by all capture types. */
 
+/*
+ * Status bits.
+ */
+#define ATM_RAW_CELL   0x01    /* TRUE if the packet is a single cell */
+
 /*
  * AAL types.
  */
@@ -269,6 +274,7 @@ struct isdn_phdr {
 #define        TRAF_ST_IPSILON_FT2     3       /* Ipsilon: Flow Type 2 */
 
 struct atm_phdr {
+       guint32 flags;          /* status flags */
        guint8  aal;            /* AAL of the traffic */
        guint8  type;           /* traffic type */
        guint8  subtype;        /* traffic subtype */