6 * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 * Routines to use with ATM capture file types that don't include information
31 * about the *type* of ATM traffic (or, at least, where we haven't found
34 * We assume the traffic is AAL5, unless it's VPI 0/VCI 5, in which case
35 * we assume it's the signalling AAL.
39 atm_guess_traffic_type(const guint8 *pd, guint32 len,
40 union wtap_pseudo_header *pseudo_header)
43 * Start out assuming nothing other than that it's AAL5.
45 pseudo_header->atm.aal = AAL_5;
46 pseudo_header->atm.type = TRAF_UNKNOWN;
47 pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
49 if (pseudo_header->atm.vpi == 0) {
51 * Traffic on some PVCs with a VPI of 0 and certain
52 * VCIs is of particular types.
54 switch (pseudo_header->atm.vci) {
60 pseudo_header->atm.aal = AAL_SIGNALLING;
67 pseudo_header->atm.type = TRAF_ILMI;
73 * OK, we can't tell what it is based on the VPI/VCI; try
74 * guessing based on the contents, if we have enough data
79 if (pd[0] == 0xaa && pd[1] == 0xaa && pd[2] == 0x03) {
81 * Looks like a SNAP header; assume it's LLC
82 * multiplexed RFC 1483 traffic.
84 pseudo_header->atm.type = TRAF_LLCMX;
85 } else if ((pseudo_header->atm.aal5t_len &&
86 pseudo_header->atm.aal5t_len < 16) || len<16) {
88 * As this cannot be a LANE Ethernet frame (less
89 * than 2 bytes of LANE header + 14 bytes of
90 * Ethernet header) we can try it as a SSCOP frame.
92 pseudo_header->atm.aal = AAL_SIGNALLING;
93 } else if (pd[0] == 0x83 || pd[0] == 0x81) {
95 * MTP3b headers often encapsulate
96 * a SCCP or MTN in the 3G network.
97 * This should cause 0x83 or 0x81
100 pseudo_header->atm.aal = AAL_SIGNALLING;
105 pseudo_header->atm.type = TRAF_LANE;
106 atm_guess_lane_type(pd, len, pseudo_header);
110 * Not only VCI 5 is used for signaling. It might be
113 pseudo_header->atm.aal = AAL_SIGNALLING;
118 atm_guess_lane_type(const guint8 *pd, guint32 len,
119 union wtap_pseudo_header *pseudo_header)
122 if (pd[0] == 0xff && pd[1] == 0x00) {
124 * Looks like LE Control traffic.
126 pseudo_header->atm.subtype = TRAF_ST_LANE_LE_CTRL;
129 * XXX - Ethernet, or Token Ring?
130 * Assume Ethernet for now; if we see earlier
131 * LANE traffic, we may be able to figure out
132 * the traffic type from that, but there may
133 * still be situations where the user has to
136 pseudo_header->atm.subtype = TRAF_ST_LANE_802_3;