aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packet-atm.c363
-rw-r--r--wiretap/iptrace.c31
-rw-r--r--wiretap/netmon.c39
-rw-r--r--wiretap/ngsniffer.c250
-rw-r--r--wiretap/snoop.c67
-rw-r--r--wiretap/wtap.h140
6 files changed, 580 insertions, 310 deletions
diff --git a/packet-atm.c b/packet-atm.c
index 02b12cd8c3..579e2dba94 100644
--- a/packet-atm.c
+++ b/packet-atm.c
@@ -1,7 +1,7 @@
/* packet-atm.c
* Routines for ATM packet disassembly
*
- * $Id: packet-atm.c,v 1.41 2002/03/31 21:23:47 guy Exp $
+ * $Id: packet-atm.c,v 1.42 2002/04/30 08:48:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -397,14 +397,14 @@ dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM LANE");
/* Is it LE Control, 802.3, 802.5, or "none of the above"? */
- switch (pinfo->pseudo_header->ngsniffer_atm.AppHLType) {
+ switch (pinfo->pseudo_header->atm.subtype) {
- case AHLT_LANE_LE_CTRL:
+ case TRAF_ST_LANE_LE_CTRL:
dissect_le_control(tvb, pinfo, tree);
break;
- case AHLT_LANE_802_3:
- case AHLT_LANE_802_3_MC:
+ case TRAF_ST_LANE_802_3:
+ case TRAF_ST_LANE_802_3_MC:
if (check_col(pinfo->cinfo, COL_INFO))
col_set_str(pinfo->cinfo, COL_INFO, "LE Client - Ethernet/802.3");
dissect_le_client(tvb, tree);
@@ -414,8 +414,8 @@ dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(eth_handle, next_tvb_le_client, pinfo, tree);
break;
- case AHLT_LANE_802_5:
- case AHLT_LANE_802_5_MC:
+ case TRAF_ST_LANE_802_5:
+ case TRAF_ST_LANE_802_5_MC:
if (check_col(pinfo->cinfo, COL_INFO))
col_set_str(pinfo->cinfo, COL_INFO, "LE Client - 802.5");
dissect_le_client(tvb, tree);
@@ -428,8 +428,7 @@ dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
/* Dump it as raw data. */
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown LANE traffic type %x",
- pinfo->pseudo_header->ngsniffer_atm.AppHLType);
+ col_set_str(pinfo->cinfo, COL_INFO, "Unknown LANE traffic type");
next_tvb = tvb_new_subset(tvb, 0, -1, -1);
call_dissector(data_handle,next_tvb, pinfo, tree);
break;
@@ -444,187 +443,174 @@ dissect_ilmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* AAL types */
static const value_string aal_vals[] = {
- { ATT_AAL_UNKNOWN, "Unknown AAL" },
- { ATT_AAL1, "AAL1" },
- { ATT_AAL3_4, "AAL3/4" },
- { ATT_AAL5, "AAL5" },
- { ATT_AAL_USER, "User AAL" },
- { ATT_AAL_SIGNALLING, "Signalling AAL" },
- { ATT_OAMCELL, "OAM cell" },
- { 0, NULL }
+ { AAL_UNKNOWN, "Unknown AAL" },
+ { AAL_1, "AAL1" },
+ { AAL_2, "AAL2" },
+ { AAL_3_4, "AAL3/4" },
+ { AAL_5, "AAL5" },
+ { AAL_USER, "User AAL" },
+ { AAL_SIGNALLING, "Signalling AAL" },
+ { AAL_OAMCELL, "OAM cell" },
+ { 0, NULL }
};
/* AAL5 higher-level traffic types */
static const value_string aal5_hltype_vals[] = {
- { ATT_HL_UNKNOWN, "Unknown traffic type" },
- { ATT_HL_LLCMX, "LLC multiplexed" },
- { ATT_HL_VCMX, "VC multiplexed" },
- { ATT_HL_LANE, "LANE" },
- { ATT_HL_ILMI, "ILMI" },
- { ATT_HL_FRMR, "Frame Relay" },
- { ATT_HL_SPANS, "FORE SPANS" },
- { ATT_HL_IPSILON, "Ipsilon" },
+ { TRAF_UNKNOWN, "Unknown traffic type" },
+ { TRAF_LLCMX, "LLC multiplexed" },
+ { TRAF_VCMX, "VC multiplexed" },
+ { TRAF_LANE, "LANE" },
+ { TRAF_ILMI, "ILMI" },
+ { TRAF_FR, "Frame Relay" },
+ { TRAF_SPANS, "FORE SPANS" },
+ { TRAF_IPSILON, "Ipsilon" },
{ 0, NULL }
};
/* Traffic subtypes for VC multiplexed traffic */
static const value_string vcmx_type_vals[] = {
- { AHLT_UNKNOWN, "Unknown VC multiplexed traffic type" },
- { AHLT_VCMX_802_3_FCS, "802.3 FCS" },
- { AHLT_VCMX_802_4_FCS, "802.4 FCS" },
- { AHLT_VCMX_802_5_FCS, "802.5 FCS" },
- { AHLT_VCMX_FDDI_FCS, "FDDI FCS" },
- { AHLT_VCMX_802_6_FCS, "802.6 FCS" },
- { AHLT_VCMX_802_3, "802.3" },
- { AHLT_VCMX_802_4, "802.4" },
- { AHLT_VCMX_802_5, "802.5" },
- { AHLT_VCMX_FDDI, "FDDI" },
- { AHLT_VCMX_802_6, "802.6" },
- { AHLT_VCMX_FRAGMENTS, "Fragments" },
- { AHLT_VCMX_BPDU, "BPDU" },
+ { TRAF_ST_UNKNOWN, "Unknown VC multiplexed traffic type" },
+ { TRAF_ST_VCMX_802_3_FCS, "802.3 FCS" },
+ { TRAF_ST_VCMX_802_4_FCS, "802.4 FCS" },
+ { TRAF_ST_VCMX_802_5_FCS, "802.5 FCS" },
+ { TRAF_ST_VCMX_FDDI_FCS, "FDDI FCS" },
+ { TRAF_ST_VCMX_802_6_FCS, "802.6 FCS" },
+ { TRAF_ST_VCMX_802_3, "802.3" },
+ { TRAF_ST_VCMX_802_4, "802.4" },
+ { TRAF_ST_VCMX_802_5, "802.5" },
+ { TRAF_ST_VCMX_FDDI, "FDDI" },
+ { TRAF_ST_VCMX_802_6, "802.6" },
+ { TRAF_ST_VCMX_FRAGMENTS, "Fragments" },
+ { TRAF_ST_VCMX_BPDU, "BPDU" },
{ 0, NULL }
};
/* Traffic subtypes for LANE traffic */
static const value_string lane_type_vals[] = {
- { AHLT_UNKNOWN, "Unknown LANE traffic type" },
- { AHLT_LANE_LE_CTRL, "LE Control" },
- { AHLT_LANE_802_3, "802.3" },
- { AHLT_LANE_802_5, "802.5" },
- { AHLT_LANE_802_3_MC, "802.3 multicast" },
- { AHLT_LANE_802_5_MC, "802.5 multicast" },
- { 0, NULL }
+ { TRAF_ST_UNKNOWN, "Unknown LANE traffic type" },
+ { TRAF_ST_LANE_LE_CTRL, "LE Control" },
+ { TRAF_ST_LANE_802_3, "802.3" },
+ { TRAF_ST_LANE_802_5, "802.5" },
+ { TRAF_ST_LANE_802_3_MC, "802.3 multicast" },
+ { TRAF_ST_LANE_802_5_MC, "802.5 multicast" },
+ { 0, NULL }
};
/* Traffic subtypes for Ipsilon traffic */
static const value_string ipsilon_type_vals[] = {
- { AHLT_UNKNOWN, "Unknown Ipsilon traffic type" },
- { AHLT_IPSILON_FT0, "Flow type 0" },
- { AHLT_IPSILON_FT1, "Flow type 1" },
- { AHLT_IPSILON_FT2, "Flow type 2" },
+ { TRAF_ST_UNKNOWN, "Unknown Ipsilon traffic type" },
+ { TRAF_ST_IPSILON_FT0, "Flow type 0" },
+ { TRAF_ST_IPSILON_FT1, "Flow type 1" },
+ { TRAF_ST_IPSILON_FT2, "Flow type 2" },
{ 0, NULL }
};
-/*
- * We don't know what kind of traffic this is; try to guess.
- * We at least know it's AAL5....
- */
-static void
-atm_guess_content(tvbuff_t *tvb, packet_info *pinfo)
-{
- guint8 byte0, byte1, byte2;
-
- if (pinfo->pseudo_header->ngsniffer_atm.Vpi == 0) {
- /*
- * Traffic on some PVCs with a VPI of 0 and certain
- * VCIs is of particular types.
- */
- switch (pinfo->pseudo_header->ngsniffer_atm.Vci) {
-
- case 5:
- /*
- * Signalling AAL.
- */
- pinfo->pseudo_header->ngsniffer_atm.AppTrafType =
- ATT_AAL_SIGNALLING;
- return;
-
- case 16:
- /*
- * ILMI.
- */
- pinfo->pseudo_header->ngsniffer_atm.AppTrafType |=
- ATT_HL_ILMI;
- return;
- }
- }
-
- /*
- * OK, we can't tell what it is based on the VPI/VCI; try
- * guessing based on the contents.
- */
- byte0 = tvb_get_guint8(tvb, 0);
- byte1 = tvb_get_guint8(tvb, 1);
- byte2 = tvb_get_guint8(tvb, 2);
- if (byte0 == 0xaa && byte1 == 0xaa && byte2 == 0x03) {
- /*
- * Looks like a SNAP header; assume it's LLC multiplexed
- * RFC 1483 traffic.
- */
- pinfo->pseudo_header->ngsniffer_atm.AppTrafType |= ATT_HL_LLCMX;
- } else {
- /*
- * Assume it's LANE.
- */
- pinfo->pseudo_header->ngsniffer_atm.AppTrafType |= ATT_HL_LANE;
- if (byte0 == 0xff && byte1 == 0x00) {
- /*
- * Looks like LE Control traffic.
- */
- pinfo->pseudo_header->ngsniffer_atm.AppHLType =
- AHLT_LANE_LE_CTRL;
- } else {
- /*
- * XXX - Ethernet, or Token Ring?
- * Assume Ethernet for now; if we see earlier
- * LANE traffic, we may be able to figure out
- * the traffic type from that, but there may
- * still be situations where the user has to
- * tell us.
- */
- pinfo->pseudo_header->ngsniffer_atm.AppHLType =
- AHLT_LANE_802_3;
- }
- }
-}
-
static void
dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *atm_tree;
proto_item *ti;
- guint aal_type;
- guint hl_type;
-
- aal_type = pinfo->pseudo_header->ngsniffer_atm.AppTrafType & ATT_AALTYPE;
- hl_type = pinfo->pseudo_header->ngsniffer_atm.AppTrafType & ATT_HLTYPE;
- if (aal_type == ATT_AAL5) {
- if (hl_type == ATT_HL_UNKNOWN ||
- pinfo->pseudo_header->ngsniffer_atm.AppHLType == AHLT_UNKNOWN) {
+ guint8 byte0, byte1, byte2;
+
+ /*
+ * The joys of a connection-oriented link layer; the type of
+ * traffic may be implied by the connection on which it's
+ * traveling, rather than being specified in the packet itself.
+ *
+ * The program that captured the traffic might, or might not,
+ * have known the traffic type; if it didn't see the connection
+ * setup and wasn't running on one of the endpoints, and wasn't
+ * later told, e.g. by the human running it, what type of traffic
+ * was on that circuit, or was running on one of the endpoints
+ * but was using, to capture the packets, a mechanism that either
+ * doesn't have access to data saying what's going over the
+ * connection or doesn't bother providing that information, it
+ * won't have known the traffic type.
+ *
+ * If we don't know the full traffic type, we try to guess it
+ * based on the VPI/VCI and/or the packet header; at some point,
+ * we should provide a mechanism by which the user can specify
+ * what sort of traffic is on a particular circuit.
+ */
+ if (pinfo->pseudo_header->atm.aal == AAL_5) {
+ if (pinfo->pseudo_header->atm.type == TRAF_UNKNOWN) {
/*
- * The joys of a connection-oriented link layer; the type of
- * traffic may be implied by the connection on which it's
- * traveling, rather than being specified in the packet itself.
+ * We don't know the traffic type at all.
+ * Try to guess it based on the VPI and VCI.
*
- * For this packet, the program that captured the packet didn't
- * save the type of traffic, presumably because it didn't know
- * the traffic type (either it didn't see the connection setup
- * and wasn't running on one of the endpoints, and wasn't later
- * told, e.g. by the human running it, what type of traffic was
- * on that circuit, or was running on one of the endpoints but
- * was using, to capture the packets, a mechanism that either
- * doesn't have access to data saying what's going over the
- * connection or doesn't bother providing that information).
- *
- * For now, we try to guess the traffic type based on the VPI/VCI
- * or the packet header; later, we should provide a mechanism
- * by which the user can specify what sort of traffic is on a
- * particular circuit.
+ * VPI 0, VCI 5 should have been mapped to AAL_SIGNALLING
+ * by Wiretap.
+ */
+ if (pinfo->pseudo_header->atm.vpi == 0) {
+ /*
+ * Traffic on some PVCs with a VPI of 0 and certain
+ * VCIs is of particular types.
+ */
+ switch (pinfo->pseudo_header->atm.vci) {
+
+ case 16:
+ /*
+ * ILMI.
+ */
+ pinfo->pseudo_header->atm.type = TRAF_ILMI;
+ break;
+ }
+ }
+ }
+
+ if (pinfo->pseudo_header->atm.type == TRAF_UNKNOWN) {
+ /*
+ * OK, we can't tell what it is based on the VPI/VCI; try
+ * guessing based on the contents.
*/
- atm_guess_content(tvb, pinfo);
+ byte0 = tvb_get_guint8(tvb, 0);
+ byte1 = tvb_get_guint8(tvb, 1);
+ byte2 = tvb_get_guint8(tvb, 2);
+ if (byte0 == 0xaa && byte1 == 0xaa && byte2 == 0x03) {
+ /*
+ * Looks like a SNAP header; assume it's LLC multiplexed
+ * RFC 1483 traffic.
+ */
+ pinfo->pseudo_header->atm.type = TRAF_LLCMX;
+ } else {
+ /*
+ * Assume it's LANE.
+ */
+ pinfo->pseudo_header->atm.type = TRAF_LANE;
+ }
+ }
+ if (pinfo->pseudo_header->atm.type == TRAF_LANE &&
+ pinfo->pseudo_header->atm.subtype == TRAF_ST_UNKNOWN) {
/*
- * OK, now get the AAL type and high-layer type again.
+ * OK, it's LANE, but we don't know what type of LANE traffic
+ * it is. Guess based on the first two bytes.
*/
- aal_type = pinfo->pseudo_header->ngsniffer_atm.AppTrafType & ATT_AALTYPE;
- hl_type = pinfo->pseudo_header->ngsniffer_atm.AppTrafType & ATT_HLTYPE;
+ byte0 = tvb_get_guint8(tvb, 0);
+ byte1 = tvb_get_guint8(tvb, 1);
+ if (byte0 == 0xff && byte1 == 0x00) {
+ /*
+ * Looks like LE Control traffic.
+ */
+ pinfo->pseudo_header->atm.subtype = TRAF_ST_LANE_LE_CTRL;
+ } else {
+ /*
+ * XXX - Ethernet, or Token Ring?
+ * Assume Ethernet for now; if we see earlier
+ * LANE traffic, we may be able to figure out
+ * the traffic type from that, but there may
+ * still be situations where the user has to
+ * tell us.
+ */
+ pinfo->pseudo_header->atm.subtype = TRAF_ST_LANE_802_3;
+ }
}
}
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM");
- switch (pinfo->pseudo_header->ngsniffer_atm.channel) {
+ switch (pinfo->pseudo_header->atm.channel) {
case 0:
/* Traffic from DCE to DTE. */
@@ -644,13 +630,14 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (check_col(pinfo->cinfo, COL_INFO)) {
- if (aal_type == ATT_AAL5) {
+ if (pinfo->pseudo_header->atm.aal == AAL_5) {
col_add_fstr(pinfo->cinfo, COL_INFO, "AAL5 %s",
- val_to_str(hl_type, aal5_hltype_vals,
- "Unknown traffic type (%x)"));
+ val_to_str(pinfo->pseudo_header->atm.type, aal5_hltype_vals,
+ "Unknown traffic type (%u)"));
} else {
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(aal_type, aal_vals, "Unknown AAL (%x)"));
+ val_to_str(pinfo->pseudo_header->atm.aal, aal_vals,
+ "Unknown AAL (%u)"));
}
}
@@ -659,40 +646,42 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
atm_tree = proto_item_add_subtree(ti, ett_atm);
proto_tree_add_text(atm_tree, tvb, 0, 0, "AAL: %s",
- val_to_str(aal_type, aal_vals, "Unknown AAL (%x)"));
- if (aal_type == ATT_AAL5) {
+ val_to_str(pinfo->pseudo_header->atm.aal, aal_vals,
+ "Unknown AAL (%u)"));
+ if (pinfo->pseudo_header->atm.aal == AAL_5) {
proto_tree_add_text(atm_tree, tvb, 0, 0, "Traffic type: %s",
- val_to_str(hl_type, aal5_hltype_vals, "Unknown AAL5 traffic type (%x)"));
- switch (hl_type) {
+ val_to_str(pinfo->pseudo_header->atm.type, aal5_hltype_vals,
+ "Unknown AAL5 traffic type (%u)"));
+ switch (pinfo->pseudo_header->atm.type) {
- case ATT_HL_LLCMX:
+ case TRAF_LLCMX:
proto_tree_add_text(atm_tree, tvb, 0, 0, "LLC multiplexed traffic");
break;
- case ATT_HL_VCMX:
+ case TRAF_VCMX:
proto_tree_add_text(atm_tree, tvb, 0, 0, "VC multiplexed traffic type: %s",
- val_to_str(pinfo->pseudo_header->ngsniffer_atm.AppHLType,
- vcmx_type_vals, "Unknown VCMX traffic type (%x)"));
+ val_to_str(pinfo->pseudo_header->atm.subtype,
+ vcmx_type_vals, "Unknown VCMX traffic type (%u)"));
break;
- case ATT_HL_LANE:
+ case TRAF_LANE:
proto_tree_add_text(atm_tree, tvb, 0, 0, "LANE traffic type: %s",
- val_to_str(pinfo->pseudo_header->ngsniffer_atm.AppHLType,
- lane_type_vals, "Unknown LANE traffic type (%x)"));
+ val_to_str(pinfo->pseudo_header->atm.subtype,
+ lane_type_vals, "Unknown LANE traffic type (%u)"));
break;
- case ATT_HL_IPSILON:
+ case TRAF_IPSILON:
proto_tree_add_text(atm_tree, tvb, 0, 0, "Ipsilon traffic type: %s",
- val_to_str(pinfo->pseudo_header->ngsniffer_atm.AppHLType,
- ipsilon_type_vals, "Unknown Ipsilon traffic type (%x)"));
+ val_to_str(pinfo->pseudo_header->atm.subtype,
+ ipsilon_type_vals, "Unknown Ipsilon traffic type (%u)"));
break;
}
}
proto_tree_add_uint(atm_tree, hf_atm_vpi, tvb, 0, 0,
- pinfo->pseudo_header->ngsniffer_atm.Vpi);
+ pinfo->pseudo_header->atm.vpi);
proto_tree_add_uint(atm_tree, hf_atm_vci, tvb, 0, 0,
- pinfo->pseudo_header->ngsniffer_atm.Vci);
- switch (pinfo->pseudo_header->ngsniffer_atm.channel) {
+ pinfo->pseudo_header->atm.vci);
+ switch (pinfo->pseudo_header->atm.channel) {
case 0:
/* Traffic from DCE to DTE. */
@@ -707,10 +696,10 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
/* Sniffers shouldn't provide anything other than 0 or 1. */
proto_tree_add_text(atm_tree, tvb, 0, 0, "Channel: %u",
- pinfo->pseudo_header->ngsniffer_atm.channel);
+ pinfo->pseudo_header->atm.channel);
break;
}
- if (pinfo->pseudo_header->ngsniffer_atm.cells != 0) {
+ if (pinfo->pseudo_header->atm.cells != 0) {
/*
* If the cell count is 0, assume it means we don't know how
* many cells it was.
@@ -723,39 +712,39 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* information.
*/
proto_tree_add_text(atm_tree, tvb, 0, 0, "Cells: %u",
- pinfo->pseudo_header->ngsniffer_atm.cells);
- if (aal_type == ATT_AAL5) {
+ pinfo->pseudo_header->atm.cells);
+ if (pinfo->pseudo_header->atm.aal == AAL_5) {
proto_tree_add_text(atm_tree, tvb, 0, 0, "AAL5 U2U: %u",
- pinfo->pseudo_header->ngsniffer_atm.aal5t_u2u);
+ pinfo->pseudo_header->atm.aal5t_u2u);
proto_tree_add_text(atm_tree, tvb, 0, 0, "AAL5 len: %u",
- pinfo->pseudo_header->ngsniffer_atm.aal5t_len);
+ pinfo->pseudo_header->atm.aal5t_len);
proto_tree_add_text(atm_tree, tvb, 0, 0, "AAL5 checksum: 0x%08X",
- pinfo->pseudo_header->ngsniffer_atm.aal5t_chksum);
+ pinfo->pseudo_header->atm.aal5t_chksum);
}
}
}
- switch (aal_type) {
+ switch (pinfo->pseudo_header->atm.aal) {
- case ATT_AAL_SIGNALLING:
+ case AAL_SIGNALLING:
call_dissector(sscop_handle, tvb, pinfo, tree);
break;
- case ATT_AAL5:
- switch (hl_type) {
+ case AAL_5:
+ switch (pinfo->pseudo_header->atm.type) {
- case ATT_HL_LLCMX:
+ case TRAF_LLCMX:
/* Dissect as WTAP_ENCAP_ATM_RFC1483 */
/* The ATM iptrace capture that we have shows LLC at this point,
* so that's what I'm calling */
call_dissector(llc_handle, tvb, pinfo, tree);
break;
- case ATT_HL_LANE:
+ case TRAF_LANE:
call_dissector(lane_handle, tvb, pinfo, tree);
break;
- case ATT_HL_ILMI:
+ case TRAF_ILMI:
call_dissector(ilmi_handle, tvb, pinfo, tree);
break;
diff --git a/wiretap/iptrace.c b/wiretap/iptrace.c
index d6ad89b66e..9a1df684d0 100644
--- a/wiretap/iptrace.c
+++ b/wiretap/iptrace.c
@@ -1,6 +1,6 @@
/* iptrace.c
*
- * $Id: iptrace.c,v 1.38 2002/03/05 08:39:29 guy Exp $
+ * $Id: iptrace.c,v 1.39 2002/04/30 08:48:26 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -384,25 +384,30 @@ get_atm_pseudo_header(union wtap_pseudo_header *pseudo_header, guint8 *header)
decimal++;
Vci = strtoul(decimal, NULL, 10);
}
- pseudo_header->ngsniffer_atm.Vpi = Vpi;
- pseudo_header->ngsniffer_atm.Vci = Vci;
+
+ /* Assume it's AAL5, unless it's VPI 0 and VCI 5, in which case
+ assume it's AAL_SIGNALLING; we know nothing more about it. */
+ if (Vpi == 0 && Vci == 5)
+ pseudo_header->atm.aal = AAL_SIGNALLING;
+ else
+ pseudo_header->atm.aal = AAL_5;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+
+ pseudo_header->atm.vpi = Vpi;
+ pseudo_header->atm.vci = Vci;
/*
* OK, which value means "DTE->DCE" and which value means
* "DCE->DTE"?
*/
- pseudo_header->ngsniffer_atm.channel = header[29];
+ pseudo_header->atm.channel = header[29];
/* We don't have this information */
- pseudo_header->ngsniffer_atm.cells = 0;
- pseudo_header->ngsniffer_atm.aal5t_u2u = 0;
- pseudo_header->ngsniffer_atm.aal5t_len = 0;
- pseudo_header->ngsniffer_atm.aal5t_chksum = 0;
-
- /* Assume it's AAL5 traffic, but indicate that we don't know what
- it is beyond that. */
- pseudo_header->ngsniffer_atm.AppTrafType = ATT_AAL5|ATT_HL_UNKNOWN;
- pseudo_header->ngsniffer_atm.AppHLType = AHLT_UNKNOWN;
+ pseudo_header->atm.cells = 0;
+ pseudo_header->atm.aal5t_u2u = 0;
+ pseudo_header->atm.aal5t_len = 0;
+ pseudo_header->atm.aal5t_chksum = 0;
}
/* Given an RFC1573 (SNMP ifType) interface type,
diff --git a/wiretap/netmon.c b/wiretap/netmon.c
index 7a93df39a5..e76ffa93fc 100644
--- a/wiretap/netmon.c
+++ b/wiretap/netmon.c
@@ -1,6 +1,6 @@
/* netmon.c
*
- * $Id: netmon.c,v 1.51 2002/03/05 08:39:29 guy Exp $
+ * $Id: netmon.c,v 1.52 2002/04/30 08:48:27 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -475,6 +475,7 @@ netmon_read_atm_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header,
{
struct netmon_atm_hdr atm_phdr;
int bytes_read;
+ guint16 vpi, vci;
errno = WTAP_ERR_CANT_READ;
bytes_read = file_read(&atm_phdr, 1, sizeof (struct netmon_atm_hdr), fh);
@@ -485,21 +486,29 @@ netmon_read_atm_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header,
return FALSE;
}
- pseudo_header->ngsniffer_atm.Vpi = ntohs(atm_phdr.vpi);
- pseudo_header->ngsniffer_atm.Vci = ntohs(atm_phdr.vci);
-
- /* We don't have this information */
- pseudo_header->ngsniffer_atm.channel = 0;
- pseudo_header->ngsniffer_atm.cells = 0;
- pseudo_header->ngsniffer_atm.aal5t_u2u = 0;
- pseudo_header->ngsniffer_atm.aal5t_len = 0;
- pseudo_header->ngsniffer_atm.aal5t_chksum = 0;
+ vpi = ntohs(atm_phdr.vpi);
+ vci = ntohs(atm_phdr.vci);
/*
- * Assume it's AAL5; we know nothing more about it.
+ * Assume it's AAL5, unless it's VPI 0 and VCI 5, in which case
+ * assume it's AAL_SIGNALLING; we know nothing more about it.
*/
- pseudo_header->ngsniffer_atm.AppTrafType = ATT_AAL5|ATT_HL_UNKNOWN;
- pseudo_header->ngsniffer_atm.AppHLType = AHLT_UNKNOWN;
+ if (vpi == 0 && vci == 5)
+ pseudo_header->atm.aal = AAL_SIGNALLING;
+ else
+ pseudo_header->atm.aal = AAL_5;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+
+ pseudo_header->atm.vpi = vpi;
+ pseudo_header->atm.vci = vci;
+
+ /* We don't have this information */
+ pseudo_header->atm.channel = 0;
+ pseudo_header->atm.cells = 0;
+ pseudo_header->atm.aal5t_u2u = 0;
+ pseudo_header->atm.aal5t_len = 0;
+ pseudo_header->atm.aal5t_chksum = 0;
return TRUE;
}
@@ -671,8 +680,8 @@ static gboolean netmon_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
*/
memset(&atm_hdr.dest, 0, sizeof atm_hdr.dest);
memset(&atm_hdr.src, 0, sizeof atm_hdr.src);
- atm_hdr.vpi = htons(pseudo_header->ngsniffer_atm.Vpi);
- atm_hdr.vci = htons(pseudo_header->ngsniffer_atm.Vci);
+ atm_hdr.vpi = htons(pseudo_header->atm.vpi);
+ atm_hdr.vci = htons(pseudo_header->atm.vci);
nwritten = fwrite(&atm_hdr, 1, sizeof atm_hdr, wdh->fh);
if (nwritten != sizeof atm_hdr) {
if (nwritten == 0 && ferror(wdh->fh))
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
index 085119c5d0..8758fb8d9e 100644
--- a/wiretap/ngsniffer.c
+++ b/wiretap/ngsniffer.c
@@ -1,6 +1,6 @@
/* ngsniffer.c
*
- * $Id: ngsniffer.c,v 1.78 2002/04/25 22:05:39 guy Exp $
+ * $Id: ngsniffer.c,v 1.79 2002/04/30 08:48:27 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -1052,15 +1052,245 @@ 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)
{
- pseudo_header->ngsniffer_atm.AppTrafType = frame4->atm_info.AppTrafType;
- pseudo_header->ngsniffer_atm.AppHLType = frame4->atm_info.AppHLType;
- pseudo_header->ngsniffer_atm.Vpi = pletohs(&frame4->atm_info.Vpi);
- pseudo_header->ngsniffer_atm.Vci = pletohs(&frame4->atm_info.Vci);
- pseudo_header->ngsniffer_atm.channel = pletohs(&frame4->atm_info.channel);
- pseudo_header->ngsniffer_atm.cells = pletohs(&frame4->atm_info.cells);
- pseudo_header->ngsniffer_atm.aal5t_u2u = pletohs(&frame4->atm_info.Trailer.aal5t_u2u);
- pseudo_header->ngsniffer_atm.aal5t_len = pletohs(&frame4->atm_info.Trailer.aal5t_len);
- pseudo_header->ngsniffer_atm.aal5t_chksum = pletohl(&frame4->atm_info.Trailer.aal5t_chksum);
+ guint8 aal_type, hl_type;
+ guint16 vpi, vci;
+
+ aal_type = frame4->atm_info.AppTrafType & ATT_AALTYPE;
+ hl_type = frame4->atm_info.AppTrafType & ATT_HLTYPE;
+ vpi = pletohs(&frame4->atm_info.Vpi);
+ vci = pletohs(&frame4->atm_info.Vci);
+
+ switch (aal_type) {
+
+ case ATT_AAL_UNKNOWN:
+ /*
+ * Map ATT_AAL_UNKNOWN on VPI 0, VCI 5 to ATT_AAL_SIGNALLING,
+ * as that's the VPCI used for signalling.
+ *
+ * XXX - is this necessary, or will frames to 0/5 always
+ * have ATT_AAL_SIGNALLING?
+ */
+ if (vpi == 0 && vci == 5)
+ pseudo_header->atm.aal = AAL_SIGNALLING;
+ else
+ pseudo_header->atm.aal = AAL_UNKNOWN;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_AAL1:
+ pseudo_header->atm.aal = AAL_1;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_AAL3_4:
+ pseudo_header->atm.aal = AAL_3_4;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_AAL5:
+ pseudo_header->atm.aal = AAL_5;
+ switch (hl_type) {
+
+ case ATT_HL_UNKNOWN:
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_HL_LLCMX:
+ pseudo_header->atm.type = TRAF_LLCMX;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_HL_VCMX:
+ pseudo_header->atm.type = TRAF_VCMX;
+ switch (frame4->atm_info.AppHLType) {
+
+ case AHLT_UNKNOWN:
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case AHLT_VCMX_802_3_FCS:
+ pseudo_header->atm.subtype =
+ TRAF_ST_VCMX_802_3_FCS;
+ break;
+
+ case AHLT_VCMX_802_4_FCS:
+ pseudo_header->atm.subtype =
+ TRAF_ST_VCMX_802_4_FCS;
+ break;
+
+ case AHLT_VCMX_802_5_FCS:
+ pseudo_header->atm.subtype =
+ TRAF_ST_VCMX_802_5_FCS;
+ break;
+
+ case AHLT_VCMX_FDDI_FCS:
+ pseudo_header->atm.subtype =
+ TRAF_ST_VCMX_FDDI_FCS;
+ break;
+
+ case AHLT_VCMX_802_6_FCS:
+ pseudo_header->atm.subtype =
+ TRAF_ST_VCMX_802_6_FCS;
+ break;
+
+ case AHLT_VCMX_802_3:
+ pseudo_header->atm.subtype = TRAF_ST_VCMX_802_3;
+ break;
+
+ case AHLT_VCMX_802_4:
+ pseudo_header->atm.subtype = TRAF_ST_VCMX_802_4;
+ break;
+
+ case AHLT_VCMX_802_5:
+ pseudo_header->atm.subtype = TRAF_ST_VCMX_802_5;
+ break;
+
+ case AHLT_VCMX_FDDI:
+ pseudo_header->atm.subtype = TRAF_ST_VCMX_FDDI;
+ break;
+
+ case AHLT_VCMX_802_6:
+ pseudo_header->atm.subtype = TRAF_ST_VCMX_802_6;
+ break;
+
+ case AHLT_VCMX_FRAGMENTS:
+ pseudo_header->atm.subtype =
+ TRAF_ST_VCMX_FRAGMENTS;
+ break;
+
+ case AHLT_VCMX_BPDU:
+ pseudo_header->atm.subtype = TRAF_ST_VCMX_BPDU;
+ break;
+
+ default:
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+ }
+ break;
+
+ case ATT_HL_LANE:
+ pseudo_header->atm.type = TRAF_LANE;
+ switch (frame4->atm_info.AppHLType) {
+
+ case AHLT_UNKNOWN:
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case AHLT_LANE_LE_CTRL:
+ pseudo_header->atm.subtype =
+ TRAF_ST_LANE_LE_CTRL;
+ break;
+
+ case AHLT_LANE_802_3:
+ pseudo_header->atm.subtype = TRAF_ST_LANE_802_3;
+ break;
+
+ case AHLT_LANE_802_5:
+ pseudo_header->atm.subtype = TRAF_ST_LANE_802_5;
+ break;
+
+ case AHLT_LANE_802_3_MC:
+ pseudo_header->atm.subtype =
+ TRAF_ST_LANE_802_3_MC;
+ break;
+
+ case AHLT_LANE_802_5_MC:
+ pseudo_header->atm.subtype =
+ TRAF_ST_LANE_802_5_MC;
+ break;
+
+ default:
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+ }
+ break;
+
+ case ATT_HL_ILMI:
+ pseudo_header->atm.type = TRAF_ILMI;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_HL_FRMR:
+ pseudo_header->atm.type = TRAF_FR;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_HL_SPANS:
+ pseudo_header->atm.type = TRAF_SPANS;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_HL_IPSILON:
+ pseudo_header->atm.type = TRAF_IPSILON;
+ switch (frame4->atm_info.AppHLType) {
+
+ case AHLT_UNKNOWN:
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case AHLT_IPSILON_FT0:
+ pseudo_header->atm.subtype =
+ TRAF_ST_IPSILON_FT0;
+ break;
+
+ case AHLT_IPSILON_FT1:
+ pseudo_header->atm.subtype =
+ TRAF_ST_IPSILON_FT1;
+ break;
+
+ case AHLT_IPSILON_FT2:
+ pseudo_header->atm.subtype =
+ TRAF_ST_IPSILON_FT2;
+ break;
+
+ default:
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+ }
+ break;
+
+ default:
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+ }
+ break;
+
+ case ATT_AAL_USER:
+ pseudo_header->atm.aal = AAL_USER;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_AAL_SIGNALLING:
+ pseudo_header->atm.aal = AAL_SIGNALLING;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ case ATT_OAMCELL:
+ pseudo_header->atm.aal = AAL_OAMCELL;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+
+ default:
+ pseudo_header->atm.aal = AAL_UNKNOWN;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ break;
+ }
+ pseudo_header->atm.vpi = vpi;
+ pseudo_header->atm.vci = vci;
+ pseudo_header->atm.channel = pletohs(&frame4->atm_info.channel);
+ pseudo_header->atm.cells = pletohs(&frame4->atm_info.cells);
+ pseudo_header->atm.aal5t_u2u = pletohs(&frame4->atm_info.Trailer.aal5t_u2u);
+ pseudo_header->atm.aal5t_len = pletohs(&frame4->atm_info.Trailer.aal5t_len);
+ pseudo_header->atm.aal5t_chksum = pletohl(&frame4->atm_info.Trailer.aal5t_chksum);
}
static gboolean ngsniffer_read_frame6(wtap *wth, gboolean is_random,
diff --git a/wiretap/snoop.c b/wiretap/snoop.c
index b33eb6afda..992ecaab04 100644
--- a/wiretap/snoop.c
+++ b/wiretap/snoop.c
@@ -1,6 +1,6 @@
/* snoop.c
*
- * $Id: snoop.c,v 1.45 2002/04/30 06:04:33 guy Exp $
+ * $Id: snoop.c,v 1.46 2002/04/30 08:48:27 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -432,6 +432,8 @@ snoop_read_atm_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header,
{
char atm_phdr[4];
int bytes_read;
+ guint8 vpi;
+ guint16 vci;
errno = WTAP_ERR_CANT_READ;
bytes_read = file_read(atm_phdr, 1, 4, fh);
@@ -442,15 +444,8 @@ snoop_read_atm_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header,
return FALSE;
}
- pseudo_header->ngsniffer_atm.channel = (atm_phdr[0] & 0x80) ? 1 : 0;
- pseudo_header->ngsniffer_atm.Vpi = atm_phdr[1];
- pseudo_header->ngsniffer_atm.Vci = pntohs(&atm_phdr[2]);
-
- /* We don't have this information */
- pseudo_header->ngsniffer_atm.cells = 0;
- pseudo_header->ngsniffer_atm.aal5t_u2u = 0;
- pseudo_header->ngsniffer_atm.aal5t_len = 0;
- pseudo_header->ngsniffer_atm.aal5t_chksum = 0;
+ vpi = atm_phdr[1];
+ vci = pntohs(&atm_phdr[2]);
/*
* The lower 4 bits of the first byte of the header indicate
@@ -460,35 +455,65 @@ snoop_read_atm_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header,
switch (atm_phdr[0] & 0x0F) {
case 0x01: /* LANE */
- pseudo_header->ngsniffer_atm.AppTrafType = ATT_AAL5|ATT_HL_LANE;
- pseudo_header->ngsniffer_atm.AppHLType = AHLT_UNKNOWN;
+ pseudo_header->atm.aal = AAL_5;
+ pseudo_header->atm.type = TRAF_LANE;
break;
case 0x02: /* RFC 1483 LLC multiplexed traffic */
- pseudo_header->ngsniffer_atm.AppTrafType = ATT_AAL5|ATT_HL_LLCMX;
- pseudo_header->ngsniffer_atm.AppHLType = AHLT_UNKNOWN;
+ pseudo_header->atm.aal = AAL_5;
+ pseudo_header->atm.type = TRAF_LLCMX;
break;
case 0x05: /* ILMI */
- pseudo_header->ngsniffer_atm.AppTrafType = ATT_AAL5|ATT_HL_ILMI;
- pseudo_header->ngsniffer_atm.AppHLType = AHLT_UNKNOWN;
+ pseudo_header->atm.aal = AAL_5;
+ pseudo_header->atm.type = TRAF_ILMI;
break;
case 0x06: /* Q.2931 */
- pseudo_header->ngsniffer_atm.AppTrafType = ATT_AAL_SIGNALLING|ATT_HL_UNKNOWN;
- pseudo_header->ngsniffer_atm.AppHLType = AHLT_UNKNOWN;
+ pseudo_header->atm.aal = AAL_SIGNALLING;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
break;
case 0x03: /* MARS (RFC 2022) */
+ pseudo_header->atm.aal = AAL_5;
+ pseudo_header->atm.type = TRAF_ILMI;
+ break;
+
case 0x04: /* IFMP (Ipsilon Flow Management Protocol; see RFC 1954) */
+ pseudo_header->atm.aal = AAL_5;
+ pseudo_header->atm.type = TRAF_UNKNOWN; /* XXX - TRAF_IPSILON? */
+ break;
+
default:
/*
- * Assume it's AAL5; we know nothing more about it.
+ * Assume it's AAL5, unless it's VPI 0 and VCI 5, in which
+ * case assume it's AAL_SIGNALLING; we know nothing more
+ * about it.
+ *
+ * XXX - is this necessary? Or are we guaranteed that
+ * all signalling traffic has a type of 0x06?
+ *
+ * XXX - is this guaranteed to be AAL5? Or, if the type is
+ * 0x00 ("raw"), might it be non-AAL5 traffic?
*/
- pseudo_header->ngsniffer_atm.AppTrafType = ATT_AAL5|ATT_HL_UNKNOWN;
- pseudo_header->ngsniffer_atm.AppHLType = AHLT_UNKNOWN;
+ if (vpi == 0 && vci == 5)
+ pseudo_header->atm.aal = AAL_SIGNALLING;
+ else
+ pseudo_header->atm.aal = AAL_5;
+ pseudo_header->atm.type = TRAF_UNKNOWN;
break;
}
+ pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+
+ pseudo_header->atm.vpi = vpi;
+ pseudo_header->atm.vci = vci;
+ pseudo_header->atm.channel = (atm_phdr[0] & 0x80) ? 1 : 0;
+
+ /* We don't have this information */
+ pseudo_header->atm.cells = 0;
+ pseudo_header->atm.aal5t_u2u = 0;
+ pseudo_header->atm.aal5t_len = 0;
+ pseudo_header->atm.aal5t_chksum = 0;
return TRUE;
}
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 84bf02f1fc..f044bc7c3e 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -1,6 +1,6 @@
/* wtap.h
*
- * $Id: wtap.h,v 1.110 2002/04/09 08:15:04 guy Exp $
+ * $Id: wtap.h,v 1.111 2002/04/30 08:48:27 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -190,12 +190,76 @@ struct x25_phdr {
guint8 flags; /* ENCAP_LAPB, ENCAP_V120 : 1st bit means From DCE */
};
-/* Packet "pseudo-header" for ATM Sniffer capture files. */
-struct ngsniffer_atm_phdr {
- guint8 AppTrafType; /* traffic type */
- guint8 AppHLType; /* protocol type */
- guint16 Vpi; /* virtual path identifier */
- guint16 Vci; /* virtual circuit identifier */
+/* Packet "pseudo-header" for ATM capture files.
+ Not all of this information is supplied by all capture types. */
+
+/*
+ * AAL types.
+ */
+#define AAL_UNKNOWN 0 /* AAL unknown */
+#define AAL_1 1 /* AAL1 */
+#define AAL_2 2 /* AAL2 */
+#define AAL_3_4 3 /* AAL3/4 */
+#define AAL_5 4 /* AAL5 */
+#define AAL_USER 5 /* User AAL */
+#define AAL_SIGNALLING 6 /* Signaling AAL */
+#define AAL_OAMCELL 7 /* OAM cell */
+
+/*
+ * Traffic types.
+ */
+#define TRAF_UNKNOWN 0 /* Unknown */
+#define TRAF_LLCMX 1 /* LLC multiplexed (RFC 1483) */
+#define TRAF_VCMX 2 /* VC multiplexed (RFC 1483) */
+#define TRAF_LANE 3 /* LAN Emulation */
+#define TRAF_ILMI 4 /* ILMI */
+#define TRAF_FR 5 /* Frame Relay */
+#define TRAF_SPANS 6 /* FORE SPANS */
+#define TRAF_IPSILON 7 /* Ipsilon */
+
+/*
+ * Traffic subtypes.
+ */
+#define TRAF_ST_UNKNOWN 0 /* Unknown */
+
+/*
+ * For TRAF_VCMX:
+ */
+#define TRAF_ST_VCMX_802_3_FCS 1 /* 802.3 with an FCS */
+#define TRAF_ST_VCMX_802_4_FCS 2 /* 802.4 with an FCS */
+#define TRAF_ST_VCMX_802_5_FCS 3 /* 802.5 with an FCS */
+#define TRAF_ST_VCMX_FDDI_FCS 4 /* FDDI with an FCS */
+#define TRAF_ST_VCMX_802_6_FCS 5 /* 802.6 with an FCS */
+#define TRAF_ST_VCMX_802_3 7 /* 802.3 without an FCS */
+#define TRAF_ST_VCMX_802_4 8 /* 802.4 without an FCS */
+#define TRAF_ST_VCMX_802_5 9 /* 802.5 without an FCS */
+#define TRAF_ST_VCMX_FDDI 10 /* FDDI without an FCS */
+#define TRAF_ST_VCMX_802_6 11 /* 802.6 without an FCS */
+#define TRAF_ST_VCMX_FRAGMENTS 12 /* Fragments */
+#define TRAF_ST_VCMX_BPDU 13 /* BPDU */
+
+/*
+ * For TRAF_LANE:
+ */
+#define TRAF_ST_LANE_LE_CTRL 1 /* LANE: LE Ctrl */
+#define TRAF_ST_LANE_802_3 2 /* LANE: 802.3 */
+#define TRAF_ST_LANE_802_5 3 /* LANE: 802.5 */
+#define TRAF_ST_LANE_802_3_MC 4 /* LANE: 802.3 multicast */
+#define TRAF_ST_LANE_802_5_MC 5 /* LANE: 802.5 multicast */
+
+/*
+ * For TRAF_IPSILON:
+ */
+#define TRAF_ST_IPSILON_FT0 1 /* Ipsilon: Flow Type 0 */
+#define TRAF_ST_IPSILON_FT1 2 /* Ipsilon: Flow Type 1 */
+#define TRAF_ST_IPSILON_FT2 3 /* Ipsilon: Flow Type 2 */
+
+struct atm_phdr {
+ guint8 aal; /* AAL of the traffic */
+ guint8 type; /* traffic type */
+ guint8 subtype; /* traffic subtype */
+ guint16 vpi; /* virtual path identifier */
+ guint16 vci; /* virtual circuit identifier */
guint16 channel; /* link: 0 for DCE, 1 for DTE */
guint16 cells; /* number of cells */
guint16 aal5t_u2u; /* user-to-user indicator */
@@ -233,64 +297,12 @@ struct ieee_802_11_phdr {
guint8 signal_level; /* percentage */
};
-/*
- * Bits in AppTrafType.
- *
- * For AAL types other than AAL5, the packet data is presumably for a
- * single cell, not a reassembled frame, as the ATM Sniffer manual says
- * it dosn't reassemble cells other than AAL5 cells.
- */
-#define ATT_AALTYPE 0x0F /* AAL type: */
-#define ATT_AAL_UNKNOWN 0x00 /* Unknown AAL */
-#define ATT_AAL1 0x01 /* AAL1 */
-#define ATT_AAL3_4 0x02 /* AAL3/4 */
-#define ATT_AAL5 0x03 /* AAL5 */
-#define ATT_AAL_USER 0x04 /* User AAL */
-#define ATT_AAL_SIGNALLING 0x05 /* Signaling AAL */
-#define ATT_OAMCELL 0x06 /* OAM cell */
-
-#define ATT_HLTYPE 0xF0 /* Higher-layer type: */
-#define ATT_HL_UNKNOWN 0x00 /* unknown */
-#define ATT_HL_LLCMX 0x10 /* LLC multiplexed (probably RFC 1483) */
-#define ATT_HL_VCMX 0x20 /* VC multiplexed (probably RFC 1483) */
-#define ATT_HL_LANE 0x30 /* LAN Emulation */
-#define ATT_HL_ILMI 0x40 /* ILMI */
-#define ATT_HL_FRMR 0x50 /* Frame Relay */
-#define ATT_HL_SPANS 0x60 /* FORE SPANS */
-#define ATT_HL_IPSILON 0x70 /* Ipsilon */
-
-/*
- * Values for AppHLType; the interpretation depends on the ATT_HLTYPE
- * bits in AppTrafType.
- */
-#define AHLT_UNKNOWN 0x0
-#define AHLT_VCMX_802_3_FCS 0x1 /* VCMX: 802.3 FCS */
-#define AHLT_LANE_LE_CTRL 0x1 /* LANE: LE Ctrl */
-#define AHLT_IPSILON_FT0 0x1 /* Ipsilon: Flow Type 0 */
-#define AHLT_VCMX_802_4_FCS 0x2 /* VCMX: 802.4 FCS */
-#define AHLT_LANE_802_3 0x2 /* LANE: 802.3 */
-#define AHLT_IPSILON_FT1 0x2 /* Ipsilon: Flow Type 1 */
-#define AHLT_VCMX_802_5_FCS 0x3 /* VCMX: 802.5 FCS */
-#define AHLT_LANE_802_5 0x3 /* LANE: 802.5 */
-#define AHLT_IPSILON_FT2 0x3 /* Ipsilon: Flow Type 2 */
-#define AHLT_VCMX_FDDI_FCS 0x4 /* VCMX: FDDI FCS */
-#define AHLT_LANE_802_3_MC 0x4 /* LANE: 802.3 multicast */
-#define AHLT_VCMX_802_6_FCS 0x5 /* VCMX: 802.6 FCS */
-#define AHLT_LANE_802_5_MC 0x5 /* LANE: 802.5 multicast */
-#define AHLT_VCMX_802_3 0x7 /* VCMX: 802.3 */
-#define AHLT_VCMX_802_4 0x8 /* VCMX: 802.4 */
-#define AHLT_VCMX_802_5 0x9 /* VCMX: 802.5 */
-#define AHLT_VCMX_FDDI 0xa /* VCMX: FDDI */
-#define AHLT_VCMX_802_6 0xb /* VCMX: 802.6 */
-#define AHLT_VCMX_FRAGMENTS 0xc /* VCMX: Fragments */
-#define AHLT_VCMX_BPDU 0xe /* VCMX: BPDU */
-
union wtap_pseudo_header {
- struct x25_phdr x25;
- struct ngsniffer_atm_phdr ngsniffer_atm;
- struct ascend_phdr ascend;
- struct p2p_phdr p2p;
- struct ieee_802_11_phdr ieee_802_11;
+ struct x25_phdr x25;
+ struct atm_phdr atm;
+ struct ascend_phdr ascend;
+ struct p2p_phdr p2p;
+ struct ieee_802_11_phdr ieee_802_11;
};
struct wtap_pkthdr {