2 * Routines for raw packet disassembly
4 * $Id: packet-raw.c,v 1.7 1998/11/17 04:29:04 gerald Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@zing.org>
9 * This file created and by Mike Hall <mlh@io.com>
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #ifdef HAVE_SYS_TYPES_H
32 # include <sys/types.h>
42 dissect_raw( const u_char *pd, frame_data *fd, GtkTree *tree ) {
43 GtkWidget *ti, *fh_tree;
45 /* load the top pane info. This should be overwritten by
46 the next protocol in the stack */
47 if(check_col(fd, COL_RES_DL_SRC))
48 col_add_str(fd, COL_RES_DL_SRC, "N/A" );
49 if(check_col(fd, COL_RES_DL_DST))
50 col_add_str(fd, COL_RES_DL_DST, "N/A" );
51 if(check_col(fd, COL_PROTOCOL))
52 col_add_str(fd, COL_PROTOCOL, "N/A" );
53 if(check_col(fd, COL_INFO))
54 col_add_str(fd, COL_INFO, "Raw packet data" );
56 /* populate a tree in the second pane with the status of the link
59 ti = add_item_to_tree( GTK_WIDGET(tree), 0, 0,
61 fh_tree = gtk_tree_new();
62 add_subtree(ti, fh_tree, ETT_RAW);
63 add_item_to_tree(fh_tree, 0, 0, "No link information available");
66 /* So far, the only time we get raw connection types are with Linux and
67 * Irix PPP connections. We can't tell what type of data is coming down
68 * the line, so our safest bet is IP. - GCC
71 /* Currently, the Linux 2.1.xxx PPP driver passes back some of the header
72 * sometimes. This check should be removed when 2.2 is out.
74 if (pd[0] == 0xff && pd[1] == 0x03)
75 dissect_ip(pd, 4, fd, tree);
77 dissect_ip(pd, 0, fd, tree);