2 * Routines for clip packet disassembly
4 * $Id: packet-clip.c,v 1.3 1999/11/16 11:42:28 guy Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@zing.org>
9 * This file created by Thierry Andry <Thierry.Andry@advalvas.be>
10 * from nearly-the-same packet-raw.c created by Mike Hall <mlh@io.com>
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #ifdef HAVE_SYS_TYPES_H
33 # include <sys/types.h>
39 static gint ett_clip = -1;
42 capture_clip( const u_char *pd, guint32 cap_len, packet_counts *ld ) {
44 capture_ip(pd, 0, cap_len, ld);
48 dissect_clip( const u_char *pd, frame_data *fd, proto_tree *tree ) {
52 /* load the top pane info. This should be overwritten by
53 the next protocol in the stack */
54 if(check_col(fd, COL_RES_DL_SRC))
55 col_add_str(fd, COL_RES_DL_SRC, "N/A" );
56 if(check_col(fd, COL_RES_DL_DST))
57 col_add_str(fd, COL_RES_DL_DST, "N/A" );
58 if(check_col(fd, COL_PROTOCOL))
59 col_add_str(fd, COL_PROTOCOL, "CLIP" );
60 if(check_col(fd, COL_INFO))
61 col_add_str(fd, COL_INFO, "Classical IP frame" );
63 /* populate a tree in the second pane with the status of the link
66 XXX - the ATM on Linux code includes a patch to "tcpdump"
67 that compares the first few bytes of the packet with the
68 LLC header that Classical IP frames may have and, if there's
69 a SNAP LLC header at the beginning of the packet, it gets
70 the packet type from that header and uses that, otherwise
71 it treats the packet as being raw IP with no link-level
74 ti = proto_tree_add_text(tree, 0, 0, "Classical IP frame" );
75 fh_tree = proto_item_add_subtree(ti, ett_clip);
76 proto_tree_add_text(fh_tree, 0, 0, "No link information available");
78 dissect_ip(pd, 0, fd, tree);
82 proto_register_clip(void)
84 static gint *ett[] = {
88 proto_register_subtree_array(ett, array_length(ett));