aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-04-30 08:48:27 +0000
committerGuy Harris <guy@alum.mit.edu>2002-04-30 08:48:27 +0000
commitecb2a3939e04415ce80090a8e0431a57621a1e9c (patch)
tree04505b1415d7970b203d0b221bd3418d0495343c /wiretap
parentd4154681533af39707692aa01179798e7529139d (diff)
Replace the "ngsniffer_atm" with an "atm" pseudo-header, which isn't
just an image of the ATM Sniffer data. This means that Ethereal doesn't have to know any ATM Sniffer-specific details (that's all hidden in Wiretap), and allows us to add to that pseudo-header fields, traffic types, etc. unknown to ATM Sniffers. Have Wiretap map VPI 0/VCI 5 to the signalling AAL - for some capture files, this might not be necessary, as they may mark all signalling traffic as such, but, on other platforms, we don't know the AAL, so we assume AAL5 except for 0/5 traffic. Doing it in Wiretap lets us hide those details from Ethereal (and lets Ethereal interpret 0/5 traffic as non-signalling traffic, in case that happens to be what it is). We may know that traffic is LANE, but not whether it's LE Control or emulated 802.3/802.5; handle that case. svn path=/trunk/; revision=5302
Diffstat (limited to 'wiretap')
-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
5 files changed, 404 insertions, 123 deletions
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 {