aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am7
-rw-r--r--packet-ascend.c6
-rw-r--r--packet-ascend.h30
-rw-r--r--packet-atm.c11
-rw-r--r--packet-atm.h30
-rw-r--r--packet-clip.c5
-rw-r--r--packet-clip.h3
-rw-r--r--packet-eth.c8
-rw-r--r--packet-fddi.c25
-rw-r--r--packet-fddi.h3
-rw-r--r--packet-frame.c83
-rw-r--r--packet-ieee80211.c8
-rw-r--r--packet-ieee80211.h3
-rw-r--r--packet-lapb.c11
-rw-r--r--packet-lapb.h30
-rw-r--r--packet-lapd.c11
-rw-r--r--packet-lapd.h30
-rw-r--r--packet-llc.c3
-rw-r--r--packet-null.c5
-rw-r--r--packet-null.h3
-rw-r--r--packet-ppp.c9
-rw-r--r--packet-ppp.h3
-rw-r--r--packet-raw.c5
-rw-r--r--packet-raw.h3
-rw-r--r--packet-tr.c7
-rw-r--r--packet-v120.c11
-rw-r--r--packet-v120.h30
27 files changed, 117 insertions, 266 deletions
diff --git a/Makefile.am b/Makefile.am
index 98a78dcdfd..ded19b43c9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
# Makefile.am
# Automake file for Ethereal
#
-# $Id: Makefile.am,v 1.252 2000/11/22 04:03:22 gram Exp $
+# $Id: Makefile.am,v 1.253 2000/11/29 05:16:14 gram Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@zing.org>
@@ -184,9 +184,7 @@ noinst_HEADERS = \
packet-afs-register-info.h \
packet-afs-defs.h \
packet-arp.h \
- packet-ascend.h\
packet-atalk.h \
- packet-atm.h \
packet-bgp.h \
packet-bootparams.h \
packet-cdp.h \
@@ -214,8 +212,6 @@ noinst_HEADERS = \
packet-isis-snp.h \
packet-isl.h \
packet-kerberos.h \
- packet-lapb.h \
- packet-lapd.h \
packet-ldap.h \
packet-llc.h \
packet-mount.h \
@@ -252,7 +248,6 @@ noinst_HEADERS = \
packet-tr.h \
packet-trmac.h \
packet-udp.h \
- packet-v120.h \
packet-vines.h \
packet-vlan.h \
packet-vtp.h \
diff --git a/packet-ascend.c b/packet-ascend.c
index 2efc22061c..8a5a7e0d8b 100644
--- a/packet-ascend.c
+++ b/packet-ascend.c
@@ -1,7 +1,7 @@
/* packet-ascend.c
* Routines for decoding Lucent/Ascend packet traces
*
- * $Id: packet-ascend.c,v 1.20 2000/11/19 08:53:54 guy Exp $
+ * $Id: packet-ascend.c,v 1.21 2000/11/29 05:16:14 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -32,7 +32,6 @@
#include <glib.h>
#include <string.h>
#include "packet.h"
-#include "packet-ascend.h"
static int proto_ascend = -1;
static int hf_link_type = -1;
@@ -53,7 +52,7 @@ static const value_string encaps_vals[] = {
static dissector_handle_t eth_handle;
static dissector_handle_t ppp_handle;
-void
+static void
dissect_ascend(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *fh_tree;
@@ -157,4 +156,5 @@ proto_reg_handoff_ascend(void)
*/
eth_handle = find_dissector("eth");
ppp_handle = find_dissector("ppp");
+ dissector_add("wtap_encap", WTAP_ENCAP_ASCEND, dissect_ascend);
}
diff --git a/packet-ascend.h b/packet-ascend.h
deleted file mode 100644
index 165f5f8bc1..0000000000
--- a/packet-ascend.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* packet-ascend.h
- *
- * $Id: packet-ascend.h,v 1.5 2000/08/11 13:34:18 deniel Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
- * Copyright 1998 Gerald Combs
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __PACKET_ASCEND_H__
-#define __PACKET_ASCEND_H__
-
-void dissect_ascend(tvbuff_t *, packet_info *, proto_tree *);
-
-#endif
diff --git a/packet-atm.c b/packet-atm.c
index 223cb1543d..8ce586b955 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.27 2000/11/19 08:53:55 guy Exp $
+ * $Id: packet-atm.c,v 1.28 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -37,7 +37,6 @@
#include "oui.h"
#include "resolv.h"
-#include "packet-atm.h"
#include "packet-eth.h"
#include "packet-llc.h"
#include "packet-snmp.h"
@@ -556,7 +555,7 @@ atm_guess_content(tvbuff_t *tvb, packet_info *pinfo)
}
}
-void
+static void
dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *atm_tree;
@@ -790,3 +789,9 @@ proto_register_atm(void)
proto_atm_lane = proto_register_protocol("ATM LANE", "lane");
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_atm(void)
+{
+ dissector_add("wtap_encap", WTAP_ENCAP_ATM_SNIFFER, dissect_atm);
+}
diff --git a/packet-atm.h b/packet-atm.h
deleted file mode 100644
index cd312d04ba..0000000000
--- a/packet-atm.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* packet-atm.h
- *
- * $Id: packet-atm.h,v 1.5 2000/08/11 13:34:17 deniel Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
- * Copyright 1998 Gerald Combs
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __PACKET_ATM_H__
-#define __PACKET_ATM_H__
-
-void dissect_atm(tvbuff_t *, packet_info *, proto_tree *);
-
-#endif
diff --git a/packet-clip.c b/packet-clip.c
index ced6962878..750bd576b3 100644
--- a/packet-clip.c
+++ b/packet-clip.c
@@ -1,7 +1,7 @@
/* packet-clip.c
* Routines for clip packet disassembly
*
- * $Id: packet-clip.c,v 1.12 2000/11/19 08:53:56 guy Exp $
+ * $Id: packet-clip.c,v 1.13 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -48,7 +48,7 @@ capture_clip( const u_char *pd, packet_counts *ld ) {
capture_ip(pd, 0, ld);
}
-void
+static void
dissect_clip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *fh_tree;
@@ -102,4 +102,5 @@ proto_reg_handoff_clip(void)
* Get a handle for the IP dissector.
*/
ip_handle = find_dissector("ip");
+ dissector_add("wtap_encap", WTAP_ENCAP_LINUX_ATM_CLIP, dissect_clip);
}
diff --git a/packet-clip.h b/packet-clip.h
index eb87f51deb..11190b0cc5 100644
--- a/packet-clip.h
+++ b/packet-clip.h
@@ -1,6 +1,6 @@
/* packet-clip.h
*
- * $Id: packet-clip.h,v 1.3 2000/08/11 13:34:15 deniel Exp $
+ * $Id: packet-clip.h,v 1.4 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -26,6 +26,5 @@
#define __PACKET_CLIP_H__
void capture_clip(const u_char *, packet_counts *);
-void dissect_clip(tvbuff_t *, packet_info *, proto_tree *);
#endif
diff --git a/packet-eth.c b/packet-eth.c
index cbf297e2c5..8e2b802a76 100644
--- a/packet-eth.c
+++ b/packet-eth.c
@@ -1,7 +1,7 @@
/* packet-eth.c
* Routines for ethernet packet disassembly
*
- * $Id: packet-eth.c,v 1.49 2000/11/19 08:53:57 guy Exp $
+ * $Id: packet-eth.c,v 1.50 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -376,3 +376,9 @@ proto_register_eth(void)
register_dissector("eth", dissect_eth);
}
+
+void
+proto_reg_handoff_eth(void)
+{
+ dissector_add("wtap_encap", WTAP_ENCAP_ETHERNET, dissect_eth);
+}
diff --git a/packet-fddi.c b/packet-fddi.c
index ae3737e6f9..72351bc4b4 100644
--- a/packet-fddi.c
+++ b/packet-fddi.c
@@ -3,7 +3,7 @@
*
* Laurent Deniel <deniel@worldnet.fr>
*
- * $Id: packet-fddi.c,v 1.42 2000/11/19 08:53:57 guy Exp $
+ * $Id: packet-fddi.c,v 1.43 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -219,7 +219,8 @@ fddifc_to_str(int fc)
}
}
-void
+
+static void
dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gboolean bitswapped)
{
@@ -324,6 +325,19 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} /* fc */
} /* dissect_fddi */
+
+static void
+dissect_fddi_bitswapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ dissect_fddi(tvb, pinfo, tree, TRUE);
+}
+
+static void
+dissect_fddi_not_bitswapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ dissect_fddi(tvb, pinfo, tree, FALSE);
+}
+
void
proto_register_fddi(void)
{
@@ -359,3 +373,10 @@ proto_register_fddi(void)
proto_register_field_array(proto_fddi, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_fddi(void)
+{
+ dissector_add("wtap_encap", WTAP_ENCAP_FDDI, dissect_fddi_not_bitswapped);
+ dissector_add("wtap_encap", WTAP_ENCAP_FDDI_BITSWAPPED, dissect_fddi_bitswapped);
+}
diff --git a/packet-fddi.h b/packet-fddi.h
index 4f48f5c157..d66dda91d0 100644
--- a/packet-fddi.h
+++ b/packet-fddi.h
@@ -1,6 +1,6 @@
/* packet-fddi.h
*
- * $Id: packet-fddi.h,v 1.3 2000/08/11 13:34:13 deniel Exp $
+ * $Id: packet-fddi.h,v 1.4 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -26,6 +26,5 @@
#define __PACKET_FDDI_H__
void capture_fddi(const u_char *, packet_counts *);
-void dissect_fddi(tvbuff_t*, packet_info*, proto_tree*, gboolean bitswapped);
#endif
diff --git a/packet-frame.c b/packet-frame.c
index ac44f81d5c..4b3620527f 100644
--- a/packet-frame.c
+++ b/packet-frame.c
@@ -2,7 +2,7 @@
*
* Top-most dissector. Decides dissector based on Wiretap Encapsulation Type.
*
- * $Id: packet-frame.c,v 1.2 2000/11/15 05:41:42 guy Exp $
+ * $Id: packet-frame.c,v 1.3 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -34,25 +34,6 @@
#include "tvbuff.h"
#include "packet-frame.h"
-#include "packet-ascend.h"
-#include "packet-atalk.h"
-#include "packet-atm.h"
-#include "packet-clip.h"
-#include "packet-eth.h"
-#include "packet-fddi.h"
-#include "packet-ipv6.h"
-#include "packet-lapb.h"
-#include "packet-lapd.h"
-#include "packet-llc.h"
-#include "packet-null.h"
-#include "packet-ppp.h"
-#include "packet-raw.h"
-#include "packet-sna.h"
-#include "packet-tr.h"
-#include "packet-v120.h"
-#include "packet-vines.h"
-#include "packet-ieee80211.h"
-
static int proto_frame = -1;
static int hf_frame_arrival_time = -1;
static int hf_frame_time_delta = -1;
@@ -70,6 +51,8 @@ static const value_string p2p_dirs[] = {
{ P2P_DIR_RECV, "Received" },
{ 0, NULL }
};
+
+static dissector_table_t wtap_encap_dissector_table;
void
dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -130,56 +113,14 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
TRY {
- switch (pinfo->fd->lnk_t) {
- case WTAP_ENCAP_ETHERNET :
- dissect_eth(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_FDDI :
- dissect_fddi(tvb, pinfo, tree, FALSE);
- break;
- case WTAP_ENCAP_FDDI_BITSWAPPED :
- dissect_fddi(tvb, pinfo, tree, TRUE);
- break;
- case WTAP_ENCAP_TOKEN_RING :
- dissect_tr(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_NULL :
- dissect_null(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_PPP :
- case WTAP_ENCAP_PPP_WITH_PHDR :
- dissect_ppp(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_LAPB :
- dissect_lapb(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_RAW_IP :
- dissect_raw(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_LINUX_ATM_CLIP :
- dissect_clip(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_ATM_SNIFFER :
- dissect_atm(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_ASCEND :
- dissect_ascend(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_LAPD :
- dissect_lapd(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_V120 :
- dissect_v120(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_ATM_RFC1483:
- dissect_llc(tvb, pinfo, tree);
- break;
- case WTAP_ENCAP_IEEE_802_11 :
- dissect_ieee80211(tvb,pinfo,tree);
- break;
- default:
- g_assert_not_reached();
- break;
+ if (!dissector_try_port(wtap_encap_dissector_table, pinfo->fd->lnk_t,
+ tvb, pinfo, tree)) {
+
+ if (check_col(pinfo->fd, COL_PROTOCOL))
+ col_set_str(pinfo->fd, COL_PROTOCOL, "UNKNOWN");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_add_fstr(pinfo->fd, COL_INFO, "WTAP_ENCAP = 0x%x", pinfo->fd->lnk_t);
+ dissect_data(tvb, 0, pinfo, tree);
}
}
CATCH(BoundsError) {
@@ -226,6 +167,8 @@ proto_register_frame(void)
&ett_frame,
};
+ wtap_encap_dissector_table = register_dissector_table("wtap_encap");
+
proto_frame = proto_register_protocol("Frame", "frame");
proto_register_field_array(proto_frame, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
diff --git a/packet-ieee80211.c b/packet-ieee80211.c
index cef385c824..14666661af 100644
--- a/packet-ieee80211.c
+++ b/packet-ieee80211.c
@@ -3,7 +3,7 @@
* Copyright 2000, Axis Communications AB
* Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
*
- * $Id: packet-ieee80211.c,v 1.3 2000/11/19 08:53:58 guy Exp $
+ * $Id: packet-ieee80211.c,v 1.4 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -1737,3 +1737,9 @@ proto_register_wlan (void)
proto_register_field_array (proto_wlan, hf, array_length (hf));
proto_register_subtree_array (tree_array, array_length (tree_array));
}
+
+void
+proto_reg_handoff_iee380211(void)
+{
+ dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11, dissect_ieee80211);
+}
diff --git a/packet-ieee80211.h b/packet-ieee80211.h
index 7f50ab0c09..0db900e014 100644
--- a/packet-ieee80211.h
+++ b/packet-ieee80211.h
@@ -4,7 +4,7 @@
* Copyright 2000, Axis Communications AB
* Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
*
- * $Id: packet-ieee80211.h,v 1.1 2000/11/15 05:41:42 guy Exp $
+ * $Id: packet-ieee80211.h,v 1.2 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -28,4 +28,3 @@
*/
void capture_ieee80211 (const u_char *, int, packet_counts *);
-void dissect_ieee80211 (tvbuff_t *, packet_info *, proto_tree *);
diff --git a/packet-lapb.c b/packet-lapb.c
index 732b5833dc..b817095d73 100644
--- a/packet-lapb.c
+++ b/packet-lapb.c
@@ -2,7 +2,7 @@
* Routines for lapb frame disassembly
* Olivier Abad <oabad@cybercable.fr>
*
- * $Id: packet-lapb.c,v 1.23 2000/11/19 08:53:59 guy Exp $
+ * $Id: packet-lapb.c,v 1.24 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -36,7 +36,6 @@
#include <glib.h>
#include <string.h>
#include "packet.h"
-#include "packet-lapb.h"
#include "packet-x25.h"
#include "xdlc.h"
@@ -49,7 +48,7 @@ static int hf_lapb_control = -1;
static gint ett_lapb = -1;
static gint ett_lapb_control = -1;
-void
+static void
dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *lapb_tree, *ti;
@@ -136,3 +135,9 @@ proto_register_lapb(void)
proto_register_field_array (proto_lapb, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_lapb(void)
+{
+ dissector_add("wtap_encap", WTAP_ENCAP_LAPB, dissect_lapb);
+}
diff --git a/packet-lapb.h b/packet-lapb.h
deleted file mode 100644
index 300aba328a..0000000000
--- a/packet-lapb.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* packet-lapb.h
- *
- * $Id: packet-lapb.h,v 1.5 2000/08/11 13:34:10 deniel Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
- * Copyright 1998 Gerald Combs
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __PACKET_LAPB_H__
-#define __PACKET_LAPB_H__
-
-void dissect_lapb(tvbuff_t *, packet_info *, proto_tree *);
-
-#endif
diff --git a/packet-lapd.c b/packet-lapd.c
index 592c8f5ed6..7941c6c090 100644
--- a/packet-lapd.c
+++ b/packet-lapd.c
@@ -2,7 +2,7 @@
* Routines for LAPD frame disassembly
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-lapd.c,v 1.16 2000/11/19 08:53:59 guy Exp $
+ * $Id: packet-lapd.c,v 1.17 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -36,7 +36,6 @@
#include <glib.h>
#include <string.h>
#include "packet.h"
-#include "packet-lapd.h"
#include "packet-q931.h"
#include "xdlc.h"
@@ -83,7 +82,7 @@ static const value_string lapd_sapi_vals[] = {
{ 0, NULL }
};
-void
+static void
dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *lapd_tree, *addr_tree;
@@ -202,3 +201,9 @@ proto_register_lapd(void)
proto_register_field_array (proto_lapd, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_lapd(void)
+{
+ dissector_add("wtap_encap", WTAP_ENCAP_LAPD, dissect_lapd);
+}
diff --git a/packet-lapd.h b/packet-lapd.h
deleted file mode 100644
index 0ff949d123..0000000000
--- a/packet-lapd.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* packet-lapd.h
- *
- * $Id: packet-lapd.h,v 1.5 2000/08/11 13:33:59 deniel Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
- * Copyright 1998 Gerald Combs
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __PACKET_LAPD_H__
-#define __PACKET_LAPD_H__
-
-void dissect_lapd(tvbuff_t *, packet_info *, proto_tree *);
-
-#endif
diff --git a/packet-llc.c b/packet-llc.c
index e1dba55387..3a98eb0d6d 100644
--- a/packet-llc.c
+++ b/packet-llc.c
@@ -2,7 +2,7 @@
* Routines for IEEE 802.2 LLC layer
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-llc.c,v 1.71 2000/11/19 08:53:59 guy Exp $
+ * $Id: packet-llc.c,v 1.72 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -504,4 +504,5 @@ proto_reg_handoff_llc(void)
* Get a handle for the BPDU dissector.
*/
bpdu_handle = find_dissector("bpdu");
+ dissector_add("wtap_encap", WTAP_ENCAP_ATM_RFC1483, dissect_llc);
}
diff --git a/packet-null.c b/packet-null.c
index b86401e5dd..ed90101684 100644
--- a/packet-null.c
+++ b/packet-null.c
@@ -1,7 +1,7 @@
/* packet-null.c
* Routines for null packet disassembly
*
- * $Id: packet-null.c,v 1.34 2000/11/19 08:54:00 guy Exp $
+ * $Id: packet-null.c,v 1.35 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -209,7 +209,7 @@ capture_null( const u_char *pd, packet_counts *ld )
}
}
-void
+static void
dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint32 null_header;
@@ -320,4 +320,5 @@ proto_reg_handoff_null(void)
* Get a handle for the PPP dissector.
*/
ppp_handle = find_dissector("ppp");
+ dissector_add("wtap_encap", WTAP_ENCAP_NULL, dissect_null);
}
diff --git a/packet-null.h b/packet-null.h
index 4323c409ad..1962f560f5 100644
--- a/packet-null.h
+++ b/packet-null.h
@@ -1,6 +1,6 @@
/* packet-null.h
*
- * $Id: packet-null.h,v 1.3 2000/08/11 13:34:05 deniel Exp $
+ * $Id: packet-null.h,v 1.4 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -26,6 +26,5 @@
#define __PACKET_NULL_H__
void capture_null(const u_char *, packet_counts *);
-void dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
#endif
diff --git a/packet-ppp.c b/packet-ppp.c
index a96e6cf55c..031cfacee1 100644
--- a/packet-ppp.c
+++ b/packet-ppp.c
@@ -1,7 +1,7 @@
/* packet-ppp.c
* Routines for ppp packet disassembly
*
- * $Id: packet-ppp.c,v 1.44 2000/11/19 08:54:01 guy Exp $
+ * $Id: packet-ppp.c,v 1.45 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1224,3 +1224,10 @@ proto_register_mp(void)
proto_register_field_array(proto_mp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_ppp(void)
+{
+ dissector_add("wtap_encap", WTAP_ENCAP_PPP, dissect_ppp);
+ dissector_add("wtap_encap", WTAP_ENCAP_PPP_WITH_PHDR, dissect_ppp);
+}
diff --git a/packet-ppp.h b/packet-ppp.h
index 0badd03a99..d8c2e86e0d 100644
--- a/packet-ppp.h
+++ b/packet-ppp.h
@@ -1,6 +1,6 @@
/* packet-ppp.h
*
- * $Id: packet-ppp.h,v 1.5 2000/11/19 02:00:03 guy Exp $
+ * $Id: packet-ppp.h,v 1.6 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -26,6 +26,5 @@
#define __PACKET_PPP_H__
void capture_ppp(const u_char *, int, packet_counts *);
-void dissect_ppp(tvbuff_t *, packet_info *, proto_tree *);
#endif
diff --git a/packet-raw.c b/packet-raw.c
index 41b815c6e8..077b78555a 100644
--- a/packet-raw.c
+++ b/packet-raw.c
@@ -1,7 +1,7 @@
/* packet-raw.c
* Routines for raw packet disassembly
*
- * $Id: packet-raw.c,v 1.22 2000/11/19 08:54:04 guy Exp $
+ * $Id: packet-raw.c,v 1.23 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -79,7 +79,7 @@ capture_raw(const u_char *pd, packet_counts *ld)
}
}
-void
+static void
dissect_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *fh_tree;
@@ -163,4 +163,5 @@ proto_reg_handoff_raw(void)
*/
ip_handle = find_dissector("ip");
ppp_handle = find_dissector("ppp");
+ dissector_add("wtap_encap", WTAP_ENCAP_RAW_IP, dissect_raw);
}
diff --git a/packet-raw.h b/packet-raw.h
index fab2607db0..3bfba25c4e 100644
--- a/packet-raw.h
+++ b/packet-raw.h
@@ -1,6 +1,6 @@
/* packet-raw.h
*
- * $Id: packet-raw.h,v 1.3 2000/08/11 13:34:02 deniel Exp $
+ * $Id: packet-raw.h,v 1.4 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -26,6 +26,5 @@
#define __PACKET_RAW_H__
void capture_raw(const u_char *, packet_counts *);
-void dissect_raw(tvbuff_t *, packet_info *, proto_tree *);
#endif
diff --git a/packet-tr.c b/packet-tr.c
index 16060cfad0..3e383303dd 100644
--- a/packet-tr.c
+++ b/packet-tr.c
@@ -2,7 +2,7 @@
* Routines for Token-Ring packet disassembly
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-tr.c,v 1.51 2000/11/19 08:54:10 guy Exp $
+ * $Id: packet-tr.c,v 1.52 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -671,3 +671,8 @@ proto_register_tr(void)
proto_register_subtree_array(ett, array_length(ett));
}
+void
+proto_reg_handoff_tr(void)
+{
+ dissector_add("wtap_encap", WTAP_ENCAP_TOKEN_RING, dissect_tr);
+}
diff --git a/packet-v120.c b/packet-v120.c
index 3847180bb5..c0a1223aa1 100644
--- a/packet-v120.c
+++ b/packet-v120.c
@@ -2,7 +2,7 @@
* Routines for v120 frame disassembly
* Bert Driehuis <driehuis@playbeing.org>
*
- * $Id: packet-v120.c,v 1.14 2000/11/19 08:54:10 guy Exp $
+ * $Id: packet-v120.c,v 1.15 2000/11/29 05:16:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -36,7 +36,6 @@
#include <glib.h>
#include <string.h>
#include "packet.h"
-#include "packet-v120.h"
#include "xdlc.h"
#define FROM_DCE 0x80
@@ -53,7 +52,7 @@ static gint ett_v120_header = -1;
static int dissect_v120_header(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
-void
+static void
dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *v120_tree, *tc, *address_tree;
@@ -231,3 +230,9 @@ proto_register_v120(void)
proto_register_field_array (proto_v120, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_v120(void)
+{
+ dissector_add("wtap_encap", WTAP_ENCAP_V120, dissect_v120);
+}
diff --git a/packet-v120.h b/packet-v120.h
deleted file mode 100644
index 2bc49e3548..0000000000
--- a/packet-v120.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* packet-v120.h
- *
- * $Id: packet-v120.h,v 1.5 2000/08/11 13:33:57 deniel Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
- * Copyright 1998 Gerald Combs
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __PACKET_V120_H__
-#define __PACKET_V120_H__
-
-void dissect_v120(tvbuff_t *, packet_info *, proto_tree *);
-
-#endif