Add some dlg_set_cancel().
[obnox/wireshark/wip.git] / packet.h
index 378a4003a7a0ae222a2c29eb6c635a3b45f187f2..b5a2bb8175c986b63a166d137b6ae62d0c635618 100644 (file)
--- a/packet.h
+++ b/packet.h
@@ -1,7 +1,7 @@
 /* packet.h
  * Definitions for packet disassembly structures and routines
  *
- * $Id: packet.h,v 1.127 1999/11/06 03:08:34 guy Exp $
+ * $Id: packet.h,v 1.198 2000/08/22 08:19:40 itojun Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
 #ifndef __PACKET_H__
 #define __PACKET_H__
 
-#ifndef __WTAP_H__
 #include "wiretap/wtap.h"
-#endif
-
-#ifndef __PROTO_H__
 #include "proto.h"
-#endif
+#include "tvbuff.h"
 
 /* Pointer versions of ntohs and ntohl.  Given a pointer to a member of a
  * byte array, returns the value of the two or four bytes at the pointer.
  * The pletoh[sl] versions return the little-endian representation.
+ *
+ * If G_HAVE_GINT64 is defined, so we can use "gint64" and "guint64" to
+ * refer to 64-bit integral quantities, we also provide pntohll and
+ * phtolell, which extract 64-bit integral quantities.
  */
 
-#define pntohs(p)  ((guint16)                       \
-                    ((guint16)*((guint8 *)p+0)<<8|  \
-                     (guint16)*((guint8 *)p+1)<<0))
-
-#define pntohl(p)  ((guint32)*((guint8 *)p+0)<<24|  \
-                    (guint32)*((guint8 *)p+1)<<16|  \
-                    (guint32)*((guint8 *)p+2)<<8|   \
-                    (guint32)*((guint8 *)p+3)<<0)
-
-#define pletohs(p) ((guint16)                       \
-                    ((guint16)*((guint8 *)p+1)<<8|  \
-                     (guint16)*((guint8 *)p+0)<<0))
-
-#define pletohl(p) ((guint32)*((guint8 *)p+3)<<24|  \
-                    (guint32)*((guint8 *)p+2)<<16|  \
-                    (guint32)*((guint8 *)p+1)<<8|   \
-                    (guint32)*((guint8 *)p+0)<<0)
+#define pntohs(p)   ((guint16)                       \
+                     ((guint16)*((guint8 *)(p)+0)<<8|  \
+                      (guint16)*((guint8 *)(p)+1)<<0))
+
+#define pntohl(p)   ((guint32)*((guint8 *)(p)+0)<<24|  \
+                     (guint32)*((guint8 *)(p)+1)<<16|  \
+                     (guint32)*((guint8 *)(p)+2)<<8|   \
+                     (guint32)*((guint8 *)(p)+3)<<0)
+
+#ifdef G_HAVE_GINT64
+#define pntohll(p)  ((guint64)*((guint8 *)(p)+0)<<56|  \
+                     (guint64)*((guint8 *)(p)+1)<<48|  \
+                     (guint64)*((guint8 *)(p)+2)<<40|  \
+                     (guint64)*((guint8 *)(p)+3)<<32|  \
+                     (guint64)*((guint8 *)(p)+4)<<24|  \
+                     (guint64)*((guint8 *)(p)+5)<<16|  \
+                     (guint64)*((guint8 *)(p)+6)<<8|   \
+                     (guint64)*((guint8 *)(p)+7)<<0)
+#endif
 
+#define pletohs(p)  ((guint16)                       \
+                     ((guint16)*((guint8 *)(p)+1)<<8|  \
+                      (guint16)*((guint8 *)(p)+0)<<0))
+
+#define pletohl(p)  ((guint32)*((guint8 *)(p)+3)<<24|  \
+                     (guint32)*((guint8 *)(p)+2)<<16|  \
+                     (guint32)*((guint8 *)(p)+1)<<8|   \
+                     (guint32)*((guint8 *)(p)+0)<<0)
+
+#ifdef G_HAVE_GINT64
+#define pletohll(p) ((guint64)*((guint8 *)(p)+7)<<56|  \
+                     (guint64)*((guint8 *)(p)+6)<<48|  \
+                     (guint64)*((guint8 *)(p)+5)<<40|  \
+                     (guint64)*((guint8 *)(p)+4)<<32|  \
+                     (guint64)*((guint8 *)(p)+3)<<24|  \
+                     (guint64)*((guint8 *)(p)+2)<<16|  \
+                     (guint64)*((guint8 *)(p)+1)<<8|   \
+                     (guint64)*((guint8 *)(p)+0)<<0)
+#endif
 
-#define hi_nibble(b) ((b & 0xf0) >> 4)
-#define lo_nibble(b) (b & 0x0f)
+#define hi_nibble(b) (((b) & 0xf0) >> 4)
+#define lo_nibble(b) ((b) & 0x0f)
 
 /* Useful when you have an array whose size you can tell at compile-time */
 #define array_length(x)        (sizeof x / sizeof x[0])
 
-
 /* Useful when highlighting regions inside a dissect_*() function. With this
  * macro, you can highlight from an arbitrary offset to the end of the
  * packet (which may come before the end of the frame).
- * See dissect_data() for an example.
+ * See old_dissect_data() for an example.
  */
 #define END_OF_FRAME   (pi.captured_len - offset)
 
@@ -90,30 +110,39 @@ typedef struct _column_info {
   gint      *col_width; /* Column widths to use during a "-S" capture */
   gchar    **col_title; /* Column titles */
   gchar    **col_data;  /* Column data */
+  gboolean   writable;  /* Are we stil writing to the columns? */
 } column_info;
 
 #define COL_MAX_LEN 256
 #define COL_MAX_INFO_LEN 4096
 
 typedef struct _packet_counts {
+  gint           sctp;
   gint           tcp;
   gint           udp;
   gint           icmp;
   gint           ospf;
   gint           gre;
   gint           netbios;
+  gint           ipx;
+  gint           vines;
   gint           other;
   gint           total;
 } packet_counts;
 
+/* Types of character encodings */
+typedef enum {
+       CHAR_ASCII       = 0,   /* ASCII */
+       CHAR_EBCDIC      = 1    /* EBCDIC */
+} char_enc;
+
 /* XXX - some of this stuff is used only while a packet is being dissected;
    should we keep around a separate data structure for that, to save
-   memory?
-
-   Also, should the pseudo-header be supplied by Wiretap when you do a
-   seek-and-read, so that we don't have to save it for all frames? */
+   memory? */
 typedef struct _frame_data {
   struct _frame_data *next; /* Next element in list */
+  struct _frame_data *prev; /* Previous element in list */
+  GSList *pfd;              /* Per frame proto data */
   guint32      num;       /* Frame number */
   guint32      pkt_len;   /* Packet length */
   guint32      cap_len;   /* Amount actually captured */
@@ -125,10 +154,13 @@ typedef struct _frame_data {
   guint32      del_usecs; /* Delta microseconds */
   long         file_off;  /* File offset */
   column_info *cinfo;     /* Column formatting information */
-  gint         row;       /* Row number for this packet in the display */
   int          lnk_t;     /* Per-packet encapsulation/data-link type */
-  gboolean     passed_dfilter; /* TRUE = display, FALSE = no display */
-  union pseudo_header pseudo_header; /* "pseudo-header" from wiretap */
+  struct {
+       unsigned int passed_dfilter     : 1; /* 1 = display, 0 = no display */
+       unsigned int encoding           : 2; /* Character encoding (ASCII, EBCDIC...) */
+       unsigned int visited            : 1; /* Has this packet been visited yet? 1=Yes,0=No*/
+       unsigned int marked             : 1; /* 1 = marked by user, 0 = normal */
+  } flags;
 } frame_data;
 
 /* Types of addresses Ethereal knows about. */
@@ -158,11 +190,17 @@ typedef struct _address {
 /* Types of port numbers Ethereal knows about. */
 typedef enum {
   PT_NONE,             /* no port number */
+  PT_SCTP,              /* SCTP */
   PT_TCP,              /* TCP */
-  PT_UDP               /* UDP */
+  PT_UDP,              /* UDP */
+  PT_NCP               /* NCP connection */
 } port_type;
 
 typedef struct _packet_info {
+  const char *current_proto;   /* name of protocol currently being dissected */
+  frame_data *fd;
+  tvbuff_t *compat_top_tvb;    /* only needed while converting Ethereal to use tvbuffs */
+  union wtap_pseudo_header *pseudo_header;
   int     len;
   int     captured_len;
   address dl_src;              /* link-layer source address */
@@ -195,272 +233,65 @@ typedef struct true_false_string {
        char    *false_string;
 } true_false_string;
 
-
-/* Many of the structs and definitions below and in packet-*.c files
- * were taken from include files in the Linux distribution. */
-
-typedef struct tcp_extra_data {
-  int match_port;
-  int sport;
-  int dport;
-} tcp_extra_data;
-
-/* Tree types.  Each dissect_* routine should have one for each
-   add_subtree() call. */
-
-enum {
-       ETT_NONE,
-       ETT_FRAME,
-       ETT_IEEE8023,
-       ETT_ETHER2,
-       ETT_LLC,
-       ETT_TOKEN_RING,
-       ETT_TOKEN_RING_AC,
-       ETT_TOKEN_RING_FC,
-       ETT_TR_IERR_CNT,
-       ETT_TR_NERR_CNT,
-       ETT_TR_MAC,
-       ETT_PPP,
-       ETT_ARP,
-       ETT_BPDU,
-       ETT_FDDI,
-       ETT_NULL,
-       ETT_IP,
-       ETT_IP_OPTIONS,
-       ETT_IP_OPTION_SEC,
-       ETT_IP_OPTION_ROUTE,
-       ETT_IP_OPTION_TIMESTAMP,
-       ETT_IP_TOS,
-       ETT_IP_OFF,
-       ETT_UDP,
-       ETT_TCP,
-       ETT_TCP_OPTIONS,
-       ETT_TCP_OPTION_SACK,
-       ETT_TCP_FLAGS,
-       ETT_ICMP,
-       ETT_IGMP,
-       ETT_IPX,
-       ETT_SPX,
-       ETT_NCP,
-       ETT_NCP_REQUEST_FIELDS,
-       ETT_NCP_REPLY_FIELDS,
-       ETT_DNS,
-       ETT_DNS_FLAGS,
-       ETT_DNS_QRY,
-       ETT_DNS_QD,
-       ETT_DNS_ANS,
-       ETT_DNS_RR,
-       ETT_EIGRP,
-       ETT_ICQ,
-       ETT_ICQ_DECODE,
-       ETT_ICQ_HEADER,
-       ETT_ICQ_BODY,
-       ETT_ICQ_BODY_PARTS,
-       ETT_ISAKMP,
-       ETT_ISAKMP_FLAGS,
-       ETT_ISAKMP_PAYLOAD,
-       ETT_RIP,
-       ETT_RIP_VEC,
-       ETT_RIPNG,
-       ETT_RIPNG_ADDR,
-       ETT_PIM,
-       ETT_OSPF,
-       ETT_OSPF_HDR,
-       ETT_OSPF_HELLO,
-       ETT_OSPF_DESC,
-       ETT_OSPF_LSR,
-       ETT_OSPF_LSA_UPD,
-       ETT_OSPF_LSA,
-       ETT_LPD,
-       ETT_RAW,
-       ETT_CLIP,
-       ETT_BOOTP,
-       ETT_BOOTP_OPTION,
-       ETT_IPv6,
-       ETT_BGP,
-       ETT_BGP_OPEN,
-       ETT_BGP_UPDATE,
-       ETT_BGP_NOTIFICATION,
-       ETT_BGP_ATTRS,
-       ETT_BGP_ATTR,
-       ETT_BGP_NLRI,
-       ETT_CLNP,
-       ETT_COTP,
-       ETT_VINES_FRP,
-       ETT_VINES,
-       ETT_VINES_ARP,
-       ETT_VINES_ICP,
-       ETT_VINES_IPC,
-       ETT_VINES_RTP,
-       ETT_VINES_SPP,
-       ETT_VLAN,
-       ETT_IPXRIP,
-       ETT_IPXSAP,
-       ETT_IPXSAP_SERVER,
-       ETT_NBNS,
-       ETT_NBNS_FLAGS,
-       ETT_NBNS_NB_FLAGS,
-       ETT_NBNS_NAME_FLAGS,
-       ETT_NBNS_QRY,
-       ETT_NBNS_QD,
-       ETT_NETB,
-       ETT_NETB_FLAGS,
-       ETT_NETB_STATUS,
-       ETT_NETB_NAME,
-       ETT_NBNS_ANS,
-       ETT_NBNS_RR,
-       ETT_NBIPX,
-       ETT_NBIPX_NAME_TYPE_FLAGS,
-       ETT_AARP,
-       ETT_GIOP,
-       ETT_NBDGM,
-       ETT_CDP,
-       ETT_CDP_TLV,
-       ETT_HTTP,
-       ETT_TFTP,
-       ETT_AH,
-       ETT_ESP,
-       ETT_IPCOMP,
-       ETT_ICMPv6,
-       ETT_ICMPv6OPT,
-       ETT_ICMPv6FLAG,
-       ETT_POP,
-       ETT_FTP,
-       ETT_TELNET,
-       ETT_TELNET_SUBOPT,
-       ETT_NNTP,
-       ETT_NTP,
-       ETT_NTP_FLAGS,
-       ETT_SNMP,
-       ETT_NBSS,
-       ETT_NBSS_FLAGS,
-       ETT_RX,
-       ETT_RX_FLAGS,
-       ETT_AFS,
-       ETT_AFS_OP,
-       ETT_AFS_FID,
-       ETT_AFS_ACL,
-       ETT_AFS_CALLBACK,
-       ETT_AFS_UBIKVER,
-       ETT_SMB,
-       ETT_SMB_FLAGS,
-       ETT_SMB_FLAGS2,
-       ETT_SMB_DIALECTS,
-       ETT_SMB_MODE,
-       ETT_SMB_CAPABILITIES,
-       ETT_SMB_RAWMODE,
-       ETT_SMB_AFLAGS,
-       ETT_SMB_DESIREDACCESS,
-       ETT_SMB_SEARCH,
-       ETT_SMB_FILE,
-       ETT_SMB_OPENFUNCTION,
-       ETT_SMB_FILEATTRIBUTES,
-       ETT_SMB_FILETYPE,
-       ETT_SMB_ACTION,
-       ETT_SMB_WRITEMODE,
-       ETT_SMB_LOCK_TYPE,
-       ETT_PPTP,
-       ETT_GRE,
-       ETT_GRE_FLAGS,
-       ETT_ICP,
-       ETT_ICP_PAYLOAD,
-       ETT_PPPOED,
-       ETT_PPPOED_TAGS,
-       ETT_PPPOES,
-       ETT_LCP,
-       ETT_LCP_OPTIONS,
-       ETT_LCP_MRU_OPT,
-       ETT_LCP_ASYNC_MAP_OPT,
-       ETT_LCP_AUTHPROT_OPT,
-       ETT_LCP_QUALPROT_OPT,
-       ETT_LCP_MAGICNUM_OPT,
-       ETT_LCP_FCS_ALTERNATIVES_OPT,
-       ETT_LCP_NUMBERED_MODE_OPT,
-       ETT_LCP_CALLBACK_OPT,
-       ETT_LCP_MULTILINK_EP_DISC_OPT,
-       ETT_LCP_INTERNATIONALIZATION_OPT,
-       ETT_IPCP,
-       ETT_IPCP_OPTIONS,
-       ETT_IPCP_IPADDRS_OPT,
-       ETT_IPCP_COMPRESSPROT_OPT,
-        ETT_RSVP,
-        ETT_RSVP_UNKNOWN_CLASS,
-        ETT_RSVP_HDR,
-        ETT_RSVP_SESSION,
-        ETT_RSVP_SGROUP,
-        ETT_RSVP_HOP,
-        ETT_RSVP_INTEGRITY,
-        ETT_RSVP_TIME_VALUES,
-        ETT_RSVP_ERROR,
-        ETT_RSVP_SCOPE,
-        ETT_RSVP_STYLE,
-        ETT_RSVP_FLOWSPEC,
-        ETT_RSVP_FILTER_SPEC,
-        ETT_RSVP_SENDER_TEMPLATE,
-        ETT_RSVP_SENDER_TSPEC,
-        ETT_RSVP_ADSPEC,
-        ETT_RSVP_POLICY,
-        ETT_RSVP_CONFIRM,
-        ETT_RSVP_ADSPEC_SUBTREE1,
-        ETT_RSVP_ADSPEC_SUBTREE2,
-        ETT_RSVP_ADSPEC_SUBTREE3,
-       ETT_RTSP,
-       ETT_SDP,
-       ETT_RADIUS,
-       ETT_RADIUS_AVP,
-       ETT_LAPB,
-       ETT_X25,
-       ETT_XDLC_CONTROL,
-       ETT_ATM,
-       ETT_ATM_LANE,
-       ETT_ATM_LANE_LC_FLAGS,
-       ETT_ATM_LANE_LC_LAN_DEST,
-       ETT_ATM_LANE_LC_LAN_DEST_RD,
-       ETT_MP,
-       ETT_MP_FLAGS,
-       ETT_IPP,
-       ETT_IPP_AS,
-       ETT_IPP_ATTR,
-       ETT_SNA,
-       ETT_SNA_TH,
-       ETT_SNA_TH_FID,
-       ETT_SNA_RH,
-       ETT_SNA_RH_0,
-       ETT_SNA_RH_1,
-       ETT_SNA_RH_2,
-       ETT_SNA_RU,
-       ETT_YHOO,
-       ETT_RPC,
-       ETT_RPC_STRING,
-       ETT_RPC_CRED,
-       ETT_RPC_VERF,
-       ETT_RPC_GIDS,
-       ETT_NFS,
-       ETT_NFS_FHANDLE,
-       ETT_NFS_TIMEVAL,
-       ETT_NFS_MODE,
-       ETT_NFS_FATTR,
-       ETT_NFS_MODE3,
-       ETT_NFS_SPECDATA3,
-       ETT_NFS_FH3,
-       ETT_NFS_NFSTIME3,
-       ETT_NFS_FATTR3,
-       ETT_BOOT,
-       ETT_MNT,
-       ETT_NLM,
-       ETT_PMAP,
-       ETT_STAT,
-       ETT_YPBIND,
-       ETT_YPSERV,
-       ETT_DDP,
-       NUM_TREE_TYPES  /* last item number plus one */
-};
-
-/* TRUE if subtrees of an item of the specified type are to be expanded. */
-extern gboolean             tree_is_expanded[NUM_TREE_TYPES];
+/* Hash table for matching port numbers and dissectors */
+typedef GHashTable* dissector_table_t;
+
+/* types for sub-dissector lookup */
+typedef void (*old_dissector_t)(const u_char *, int, frame_data *, proto_tree *);
+typedef void (*dissector_t)(tvbuff_t *, packet_info *, proto_tree *);
+
+/* a protocol uses the function to register a sub-dissector table */
+dissector_table_t register_dissector_table(const char *name);
+
+/* Add a sub-dissector to a dissector table.  Called by the protocol routine */
+/* that wants to register a sub-dissector.  */
+void old_dissector_add(const char *abbrev, guint32 pattern, old_dissector_t dissector);
+void dissector_add(const char *abbrev, guint32 pattern, dissector_t dissector);
+
+/* Add a sub-dissector to a dissector table.  Called by the protocol routine */
+/* that wants to de-register a sub-dissector.  */
+void old_dissector_delete(const char *name, guint32 pattern, old_dissector_t dissector);
+void dissector_delete(const char *name, guint32 pattern, dissector_t dissector);
+
+/* Look for a given port in a given dissector table and, if found, call
+   the dissector with the arguments supplied, and return TRUE, otherwise
+   return FALSE. */
+gboolean old_dissector_try_port(dissector_table_t sub_dissectors, guint32 port,
+    const u_char *pd, int offset, frame_data *fd, proto_tree *tree);
+gboolean dissector_try_port(dissector_table_t sub_dissectors, guint32 port,
+    tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+
+/* List of "heuristic" dissectors (which get handed a packet, look at it,
+   and either recognize it as being for their protocol, dissect it, and
+   return TRUE, or don't recognize it and return FALSE) to be called
+   by another dissector. */
+typedef GSList *heur_dissector_list_t;
+
+/* Type of a heuristic dissector */
+typedef gboolean (*old_heur_dissector_t)(const u_char *, int, frame_data *,
+       proto_tree *);
+typedef gboolean (*heur_dissector_t)(tvbuff_t *, packet_info *,
+       proto_tree *);
+
+/* A protocol uses this function to register a heuristic dissector list */
+void register_heur_dissector_list(const char *name, heur_dissector_list_t *list);
+
+/* Add a sub-dissector to a heuristic dissector list.  Called by the
+   protocol routine that wants to register a sub-dissector.  */
+void old_heur_dissector_add(const char *name, old_heur_dissector_t dissector);
+void heur_dissector_add(const char *name, heur_dissector_t dissector);
+
+/* Try all the dissectors in a given heuristic dissector list until
+   we find one that recognizes the protocol, in which case we return
+   TRUE, or we run out of dissectors, in which case we return FALSE. */
+gboolean old_dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
+    const u_char *pd, int offset, frame_data *fd, proto_tree *tree);
+gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
+    tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
 
 /* Utility routines used by packet*.c */
 gchar*     ether_to_str(const guint8 *);
+gchar*     ether_to_str_punct(const guint8 *, char);
 gchar*     ip_to_str(const guint8 *);
 struct e_in6_addr;
 gchar*     ip6_to_str(struct e_in6_addr *);
@@ -483,6 +314,8 @@ const char *decode_enumerated_bitfield(guint32 val, guint32 mask, int width,
   const value_string *tab, const char *fmt);
 const char *decode_numeric_bitfield(guint32 val, guint32 mask, int width,
   const char *fmt);
+
+void      col_set_writable(frame_data *fd, gboolean writable);
 gint       check_col(frame_data *, gint);
 #if __GNUC__ == 2
 void       col_add_fstr(frame_data *, gint, gchar *, ...)
@@ -495,165 +328,49 @@ void       col_append_fstr(frame_data *, gint, gchar *, ...);
 #endif
 void       col_add_str(frame_data *, gint, const gchar *);
 void       col_append_str(frame_data *, gint, gchar *);
+void       col_set_cls_time(frame_data *, int);
+void       fill_in_columns(frame_data *);
+
+void       p_add_proto_data(frame_data *, int, void *);
+void       *p_get_proto_data(frame_data *, int);
 
 void blank_packetinfo(void);
 
-void afs_init_protocol(void);
-void rpc_init_protocol(void);
-void smb_init_protocol(void);
+/* Do all one-time initialization. */
+void dissect_init(void);
 
-void dissect_packet(const u_char *, frame_data *, proto_tree *);
+void dissect_cleanup(void);
 
-/*
- * Routines in packet-*.c
- * Routines should take three args: packet data *, cap_len, packet_counts *
- * They should never modify the packet data.
- */
-void capture_clip(const u_char *, guint32, packet_counts *);
-void capture_eth(const u_char *, guint32, packet_counts *);
-void capture_fddi(const u_char *, guint32, packet_counts *);
-void capture_null(const u_char *, guint32, packet_counts *);
-void capture_ppp(const u_char *, guint32, packet_counts *);
-void capture_raw(const u_char *, guint32, packet_counts *);
-void capture_tr(const u_char *, guint32, packet_counts *);
+/* Allow protocols to register "init" routines, which are called before
+   we make a pass through a capture file and dissect all its packets
+   (e.g., when we read in a new capture file, or run a "filter packets"
+   or "colorize packets" pass over the current capture file). */
+void register_init_routine(void (*func)(void));
 
-/*
- * Routines in packet-*.c
- * Routines should take four args: packet data *, offset, cap_len,
- * packet_counts *
- * They should never modify the packet data.
- */
-void capture_netbios(const u_char *, int, guint32, packet_counts *);
-void capture_llc(const u_char *, int, guint32, packet_counts *);
-void capture_ip(const u_char *, int, guint32, packet_counts *);
+/* Call all the registered "init" routines. */
+void init_all_protocols(void);
 
-/*
- * Routines in packet-*.c
- * Routines should take three args: packet data *, frame_data *, tree *
- * They should never modify the packet data.
- */
-void dissect_ascend(const u_char *, frame_data *, proto_tree *);
-void dissect_atm(const u_char *, frame_data *, proto_tree *);
-void dissect_clip(const u_char *, frame_data *, proto_tree *);
-void dissect_lapb(const u_char *, frame_data *, proto_tree *);
-void dissect_null(const u_char *, frame_data *, proto_tree *);
-void dissect_ppp(const u_char *, frame_data *, proto_tree *);
-void dissect_raw(const u_char *, frame_data *, proto_tree *);
-
-/*
- * Routines in packet-*.c
- * Routines should take four args: packet data *, frame_data *, tree *,
- * gboolean
- * They should never modify the packet data.
- */
-void dissect_fddi(const u_char *, frame_data *, proto_tree *, gboolean);
-
-typedef void   (*DissectFunc)  (const u_char*, int, frame_data*, proto_tree*);
+void init_dissect_rpc(void);
 
 /*
- * Routines in packet-*.c
  * Routines should take four args: packet data *, offset, frame_data *,
  * tree *
  * They should never modify the packet data.
  */
-int dissect_ah(const u_char *, int, frame_data *, proto_tree *);
-void dissect_aarp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_afs(const u_char *, int, frame_data *, proto_tree *);
-void dissect_arp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_bgp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_bootp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_bpdu(const u_char *, int, frame_data *, proto_tree *);
-void dissect_cdp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_cotp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_data(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ddp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_dns(const u_char *, int, frame_data *, proto_tree *);
-void dissect_eigrp(const u_char *, int, frame_data *, proto_tree *);            
-void dissect_esp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_eth(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ftp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ftpdata(const u_char *, int, frame_data *, proto_tree *);
-void dissect_giop(const u_char *, int, frame_data *, proto_tree *);
-void dissect_http(const u_char *, int, frame_data *, proto_tree *);
-void dissect_icmp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_icmpv6(const u_char *, int, frame_data *, proto_tree *);
-void dissect_igmp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ip(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ipcomp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ipp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ipv6(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ipx(const u_char *, int, frame_data *, proto_tree *);
-void dissect_llc(const u_char *, int, frame_data *, proto_tree *);
-void dissect_lpd(const u_char *, int, frame_data *, proto_tree *);
-void dissect_nbdgm(const u_char *, int, frame_data *, proto_tree *);
-void dissect_netbios(const u_char *, int, frame_data *, proto_tree *);
-void dissect_nbipx(const u_char *, int, frame_data *, proto_tree *);
-void dissect_nbns(const u_char *, int, frame_data *, proto_tree *);
-void dissect_nbss(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ncp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_nntp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ntp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_nwlink_dg(const u_char *, int, frame_data *, proto_tree *);
-void dissect_osi(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ospf(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ospf_hello(const u_char *, int, frame_data *, proto_tree *);
-void dissect_pim(const u_char *, int, frame_data *, proto_tree *);
-void dissect_pop(const u_char *, int, frame_data *, proto_tree *);
-void dissect_pppoed(const u_char *, int, frame_data *, proto_tree *);
-void dissect_pppoes(const u_char *, int, frame_data *, proto_tree *);
-void dissect_icp(const u_char *,int, frame_data *, proto_tree *);
-void dissect_icq(const u_char *,int, frame_data *, proto_tree *);
-void dissect_isakmp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_pim(const u_char *, int, frame_data *, proto_tree *);
-void dissect_radius(const u_char *, int, frame_data *, proto_tree *);
-void dissect_rip(const u_char *, int, frame_data *, proto_tree *);
-void dissect_ripng(const u_char *, int, frame_data *, proto_tree *);
-void dissect_rsvp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_rtsp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_rx(const u_char *, int, frame_data *, proto_tree *);
-void dissect_sdp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_sna(const u_char *, int, frame_data *, proto_tree *);
-void dissect_snmp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_tcp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_telnet(const u_char *, int, frame_data *, proto_tree *);
-void dissect_tftp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_tr(const u_char *, int, frame_data *, proto_tree *);
-void dissect_trmac(const u_char *, int, frame_data *, proto_tree *);
-void dissect_udp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_vines(const u_char *, int, frame_data *, proto_tree *);
-void dissect_vines_arp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_vines_frp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_vines_icp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_vines_ipc(const u_char *, int, frame_data *, proto_tree *);
-void dissect_vines_rtp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_vines_spp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_vlan(const u_char *, int, frame_data *, proto_tree *);
-void dissect_payload_ppp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_x25(const u_char *, int, frame_data *, proto_tree *);
-void dissect_yhoo(const u_char *, int, frame_data *, proto_tree *);
-
-void dissect_smb(const u_char *, int, frame_data *, proto_tree *, int);
-void dissect_pptp(const u_char *, int, frame_data *, proto_tree *);
-void dissect_gre(const u_char *, int, frame_data *, proto_tree *);
-
-void dissect_rpc(const u_char *, int, frame_data *, proto_tree *, guint32, void*);
+void dissect_packet(union wtap_pseudo_header *, const u_char *, frame_data *,
+    proto_tree *);
+void old_dissect_data(const u_char *, int, frame_data *, proto_tree *);
+void dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
 
-void init_dissect_rpc(void);
-void init_dissect_udp(void);
-void init_dissect_x25(void);
 
 /* These functions are in ethertype.c */
 void capture_ethertype(guint16 etype, int offset,
-               const u_char *pd, guint32 cap_len, packet_counts *ld);
-void ethertype(guint16 etype, int offset,
-               const u_char *pd, frame_data *fd, proto_tree *tree,
+               const u_char *pd, packet_counts *ld);
+void ethertype(guint16 etype, tvbuff_t*, int offset_after_ethertype,
+               packet_info *pinfo, proto_tree *tree,
                proto_tree *fh_tree, int item_id);
 extern const value_string etype_vals[];
 
-/* These functions are in packet-arp.c */
-gchar *arphrdaddr_to_str(guint8 *ad, int ad_len, guint16 type);
-gchar *arphrdtype_to_str(guint16 hwtype, const char *fmt);
-
 /* ipproto.c */
 extern const char *ipprotostr(int proto);