]> git.samba.org - obnox/wireshark/wip.git/blob - packet.h
Uwe Girlich's ONC RPC and NFS dissectors.
[obnox/wireshark/wip.git] / packet.h
1 /* packet.h
2  * Definitions for packet disassembly structures and routines
3  *
4  * $Id: packet.h,v 1.122 1999/10/29 01:04:18 guy Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@zing.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * 
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  * 
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26
27 #ifndef __PACKET_H__
28 #define __PACKET_H__
29
30 #ifndef __WTAP_H__
31 #include "wiretap/wtap.h"
32 #endif
33
34 #ifndef __PROTO_H__
35 #include "proto.h"
36 #endif
37
38 /* Pointer versions of ntohs and ntohl.  Given a pointer to a member of a
39  * byte array, returns the value of the two or four bytes at the pointer.
40  * The pletoh[sl] versions return the little-endian representation.
41  */
42
43 #define pntohs(p)  ((guint16)                       \
44                     ((guint16)*((guint8 *)p+0)<<8|  \
45                      (guint16)*((guint8 *)p+1)<<0))
46
47 #define pntohl(p)  ((guint32)*((guint8 *)p+0)<<24|  \
48                     (guint32)*((guint8 *)p+1)<<16|  \
49                     (guint32)*((guint8 *)p+2)<<8|   \
50                     (guint32)*((guint8 *)p+3)<<0)
51
52 #define pletohs(p) ((guint16)                       \
53                     ((guint16)*((guint8 *)p+1)<<8|  \
54                      (guint16)*((guint8 *)p+0)<<0))
55
56 #define pletohl(p) ((guint32)*((guint8 *)p+3)<<24|  \
57                     (guint32)*((guint8 *)p+2)<<16|  \
58                     (guint32)*((guint8 *)p+1)<<8|   \
59                     (guint32)*((guint8 *)p+0)<<0)
60
61
62 #define hi_nibble(b) ((b & 0xf0) >> 4)
63 #define lo_nibble(b) (b & 0x0f)
64
65 /* Useful when you have an array whose size you can tell at compile-time */
66 #define array_length(x) (sizeof x / sizeof x[0])
67
68
69 /* Useful when highlighting regions inside a dissect_*() function. With this
70  * macro, you can highlight from an arbitrary offset to the end of the
71  * packet (which may come before the end of the frame).
72  * See dissect_data() for an example.
73  */
74 #define END_OF_FRAME    (pi.captured_len - offset)
75
76 /* Check whether the "len" bytes of data starting at "offset" is
77  * entirely inside the captured data for this packet. */
78 #define BYTES_ARE_IN_FRAME(offset, len) ((offset) + (len) <= pi.captured_len)
79
80 /* Check whether there's any data at all starting at "offset". */
81 #define IS_DATA_IN_FRAME(offset)        ((offset) < pi.captured_len)
82                 
83 /* To pass one of two strings, singular or plural */
84 #define plurality(d,s,p) ((d) == 1 ? (s) : (p))
85
86 typedef struct _column_info {
87   gint       num_cols;  /* Number of columns */
88   gint      *col_fmt;   /* Format of column */
89   gboolean **fmt_matx;  /* Specifies which formats apply to a column */
90   gint      *col_width; /* Column widths to use during a "-S" capture */
91   gchar    **col_title; /* Column titles */
92   gchar    **col_data;  /* Column data */
93 } column_info;
94
95 #define COL_MAX_LEN 256
96 #define COL_MAX_INFO_LEN 4096
97
98 typedef struct _packet_counts {
99   gint           tcp;
100   gint           udp;
101   gint           icmp;
102   gint           ospf;
103   gint           gre;
104   gint           netbios;
105   gint           other;
106   gint           total;
107 } packet_counts;
108
109 /* XXX - some of this stuff is used only while a packet is being dissected;
110    should we keep around a separate data structure for that, to save
111    memory?
112
113    Also, should the pseudo-header be supplied by Wiretap when you do a
114    seek-and-read, so that we don't have to save it for all frames? */
115 typedef struct _frame_data {
116   struct _frame_data *next; /* Next element in list */
117   guint32      num;       /* Frame number */
118   guint32      pkt_len;   /* Packet length */
119   guint32      cap_len;   /* Amount actually captured */
120   guint32      rel_secs;  /* Relative seconds */
121   guint32      rel_usecs; /* Relative microseconds */
122   guint32      abs_secs;  /* Absolute seconds */
123   guint32      abs_usecs; /* Absolute microseconds */
124   guint32      del_secs;  /* Delta seconds */
125   guint32      del_usecs; /* Delta microseconds */
126   long         file_off;  /* File offset */
127   column_info *cinfo;     /* Column formatting information */
128   gint         row;       /* Row number for this packet in the display */
129   int          lnk_t;     /* Per-packet encapsulation/data-link type */
130   gboolean     passed_dfilter; /* TRUE = display, FALSE = no display */
131   union pseudo_header pseudo_header; /* "pseudo-header" from wiretap */
132 } frame_data;
133
134 /* Types of addresses Ethereal knows about. */
135 typedef enum {
136   AT_NONE,              /* no link-layer address */
137   AT_ETHER,             /* MAC (Ethernet, 802.x, FDDI) address */
138   AT_IPv4,              /* IPv4 */
139   AT_IPv6,              /* IPv6 */
140   AT_IPX,               /* IPX */
141   AT_SNA,               /* SNA */
142   AT_ATALK,             /* Appletalk DDP */
143   AT_VINES              /* Banyan Vines */
144 } address_type;
145
146 typedef struct _address {
147   address_type  type;           /* type of address */
148   int           len;            /* length of address, in bytes */
149   const guint8 *data;           /* bytes that constitute address */
150 } address;
151
152 #define SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \
153         (addr)->type = (addr_type); \
154         (addr)->len = (addr_len); \
155         (addr)->data = (addr_data); \
156         }
157
158 /* Types of port numbers Ethereal knows about. */
159 typedef enum {
160   PT_NONE,              /* no port number */
161   PT_TCP,               /* TCP */
162   PT_UDP                /* UDP */
163 } port_type;
164
165 typedef struct _packet_info {
166   int     len;
167   int     captured_len;
168   address dl_src;               /* link-layer source address */
169   address dl_dst;               /* link-layer destination address */
170   address net_src;              /* network-layer source address */
171   address net_dst;              /* network-layer destination address */
172   address src;                  /* source address (net if present, DL otherwise )*/
173   address dst;                  /* destination address (net if present, DL otherwise )*/
174   guint32 ipproto;
175   port_type ptype;              /* type of the following two port numbers */
176   guint32 srcport;              /* source port */
177   guint32 destport;             /* destination port */
178   guint32 match_port;
179   int     iplen;
180   int     iphdrlen;
181 } packet_info;
182
183 extern packet_info pi;
184
185 /* Struct for the match_strval function */
186
187 typedef struct _value_string {
188   guint32  value;
189   gchar   *strptr;
190 } value_string;
191
192 /* Struct for boolean enumerations */
193 typedef struct true_false_string {
194         char    *true_string;
195         char    *false_string;
196 } true_false_string;
197
198
199 /* Many of the structs and definitions below and in packet-*.c files
200  * were taken from include files in the Linux distribution. */
201
202 typedef struct tcp_extra_data {
203   int match_port;
204   int sport;
205   int dport;
206 } tcp_extra_data;
207
208 /* Tree types.  Each dissect_* routine should have one for each
209    add_subtree() call. */
210
211 enum {
212         ETT_NONE,
213         ETT_FRAME,
214         ETT_IEEE8023,
215         ETT_ETHER2,
216         ETT_LLC,
217         ETT_TOKEN_RING,
218         ETT_TOKEN_RING_AC,
219         ETT_TOKEN_RING_FC,
220         ETT_TR_IERR_CNT,
221         ETT_TR_NERR_CNT,
222         ETT_TR_MAC,
223         ETT_PPP,
224         ETT_ARP,
225         ETT_BPDU,
226         ETT_FDDI,
227         ETT_NULL,
228         ETT_IP,
229         ETT_IP_OPTIONS,
230         ETT_IP_OPTION_SEC,
231         ETT_IP_OPTION_ROUTE,
232         ETT_IP_OPTION_TIMESTAMP,
233         ETT_IP_TOS,
234         ETT_IP_OFF,
235         ETT_UDP,
236         ETT_TCP,
237         ETT_TCP_OPTIONS,
238         ETT_TCP_OPTION_SACK,
239         ETT_TCP_FLAGS,
240         ETT_ICMP,
241         ETT_IGMP,
242         ETT_IPX,
243         ETT_SPX,
244         ETT_NCP,
245         ETT_NCP_REQUEST_FIELDS,
246         ETT_NCP_REPLY_FIELDS,
247         ETT_DNS,
248         ETT_DNS_FLAGS,
249         ETT_DNS_QRY,
250         ETT_DNS_QD,
251         ETT_DNS_ANS,
252         ETT_DNS_RR,
253         ETT_CL_ICQ,
254         ETT_CL_ICQ_DECODE,
255         ETT_ICQ_SUBTREE,
256         ETT_SRV_ICQ,
257         ETT_ISAKMP,
258         ETT_ISAKMP_FLAGS,
259         ETT_ISAKMP_PAYLOAD,
260         ETT_RIP,
261         ETT_RIP_VEC,
262         ETT_RIPNG,
263         ETT_RIPNG_ADDR,
264         ETT_PIM,
265         ETT_OSPF,
266         ETT_OSPF_HDR,
267         ETT_OSPF_HELLO,
268         ETT_OSPF_DESC,
269         ETT_OSPF_LSR,
270         ETT_OSPF_LSA_UPD,
271         ETT_OSPF_LSA,
272         ETT_LPD,
273         ETT_RAW,
274         ETT_CLIP,
275         ETT_BOOTP,
276         ETT_BOOTP_OPTION,
277         ETT_IPv6,
278         ETT_BGP,
279         ETT_CLNP,
280         ETT_COTP,
281         ETT_VINES_FRP,
282         ETT_VINES,
283         ETT_VINES_ARP,
284         ETT_VINES_ICP,
285         ETT_VINES_IPC,
286         ETT_VINES_RTP,
287         ETT_VINES_SPP,
288         ETT_VLAN,
289         ETT_IPXRIP,
290         ETT_IPXSAP,
291         ETT_IPXSAP_SERVER,
292         ETT_NBNS,
293         ETT_NBNS_FLAGS,
294         ETT_NBNS_NB_FLAGS,
295         ETT_NBNS_NAME_FLAGS,
296         ETT_NBNS_QRY,
297         ETT_NBNS_QD,
298         ETT_NETB,
299         ETT_NETB_FLAGS,
300         ETT_NETB_STATUS,
301         ETT_NETB_NAME,
302         ETT_NBNS_ANS,
303         ETT_NBNS_RR,
304         ETT_NBIPX,
305         ETT_NBIPX_NAME_TYPE_FLAGS,
306         ETT_AARP,
307         ETT_GIOP,
308         ETT_NBDGM,
309         ETT_CDP,
310         ETT_CDP_TLV,
311         ETT_HTTP,
312         ETT_TFTP,
313         ETT_AH,
314         ETT_ESP,
315         ETT_IPCOMP,
316         ETT_ICMPv6,
317         ETT_ICMPv6OPT,
318         ETT_ICMPv6FLAG,
319         ETT_POP,
320         ETT_FTP,
321         ETT_TELNET,
322         ETT_TELNET_SUBOPT,
323         ETT_NNTP,
324         ETT_NTP,
325         ETT_NTP_FLAGS,
326         ETT_SNMP,
327         ETT_NBSS,
328         ETT_NBSS_FLAGS,
329         ETT_RX,
330         ETT_RX_FLAGS,
331         ETT_AFS,
332         ETT_AFS_OP,
333         ETT_AFS_FID,
334         ETT_AFS_ACL,
335         ETT_AFS_CALLBACK,
336         ETT_AFS_UBIKVER,
337         ETT_SMB,
338         ETT_SMB_FLAGS,
339         ETT_SMB_FLAGS2,
340         ETT_SMB_DIALECTS,
341         ETT_SMB_MODE,
342         ETT_SMB_CAPABILITIES,
343         ETT_SMB_RAWMODE,
344         ETT_SMB_AFLAGS,
345         ETT_SMB_DESIREDACCESS,
346         ETT_SMB_SEARCH,
347         ETT_SMB_FILE,
348         ETT_SMB_OPENFUNCTION,
349         ETT_SMB_FILEATTRIBUTES,
350         ETT_SMB_FILETYPE,
351         ETT_SMB_ACTION,
352         ETT_SMB_WRITEMODE,
353         ETT_SMB_LOCK_TYPE,
354         ETT_PPTP,
355         ETT_GRE,
356         ETT_GRE_FLAGS,
357         ETT_ICP,
358         ETT_ICP_PAYLOAD,
359         ETT_PPPOED,
360         ETT_PPPOED_TAGS,
361         ETT_PPPOES,
362         ETT_LCP,
363         ETT_LCP_OPTIONS,
364         ETT_LCP_MRU_OPT,
365         ETT_LCP_ASYNC_MAP_OPT,
366         ETT_LCP_AUTHPROT_OPT,
367         ETT_LCP_QUALPROT_OPT,
368         ETT_LCP_MAGICNUM_OPT,
369         ETT_LCP_FCS_ALTERNATIVES_OPT,
370         ETT_LCP_NUMBERED_MODE_OPT,
371         ETT_LCP_CALLBACK_OPT,
372         ETT_LCP_MULTILINK_EP_DISC_OPT,
373         ETT_LCP_INTERNATIONALIZATION_OPT,
374         ETT_IPCP,
375         ETT_IPCP_OPTIONS,
376         ETT_IPCP_IPADDRS_OPT,
377         ETT_IPCP_COMPRESSPROT_OPT,
378         ETT_RSVP,
379         ETT_RSVP_UNKNOWN_CLASS,
380         ETT_RSVP_HDR,
381         ETT_RSVP_SESSION,
382         ETT_RSVP_SGROUP,
383         ETT_RSVP_HOP,
384         ETT_RSVP_INTEGRITY,
385         ETT_RSVP_TIME_VALUES,
386         ETT_RSVP_ERROR,
387         ETT_RSVP_SCOPE,
388         ETT_RSVP_STYLE,
389         ETT_RSVP_FLOWSPEC,
390         ETT_RSVP_FILTER_SPEC,
391         ETT_RSVP_SENDER_TEMPLATE,
392         ETT_RSVP_SENDER_TSPEC,
393         ETT_RSVP_ADSPEC,
394         ETT_RSVP_POLICY,
395         ETT_RSVP_CONFIRM,
396         ETT_RSVP_ADSPEC_SUBTREE1,
397         ETT_RSVP_ADSPEC_SUBTREE2,
398         ETT_RSVP_ADSPEC_SUBTREE3,
399         ETT_RTSP,
400         ETT_SDP,
401         ETT_RADIUS,
402         ETT_RADIUS_AVP,
403         ETT_LAPB,
404         ETT_X25,
405         ETT_XDLC_CONTROL,
406         ETT_ATM,
407         ETT_ATM_LANE,
408         ETT_ATM_LANE_LC_FLAGS,
409         ETT_ATM_LANE_LC_LAN_DEST,
410         ETT_ATM_LANE_LC_LAN_DEST_RD,
411         ETT_MP,
412         ETT_MP_FLAGS,
413         ETT_IPP,
414         ETT_IPP_AS,
415         ETT_IPP_ATTR,
416         ETT_SNA,
417         ETT_SNA_TH,
418         ETT_SNA_TH_FID,
419         ETT_SNA_RH,
420         ETT_SNA_RH_0,
421         ETT_SNA_RH_1,
422         ETT_SNA_RH_2,
423         ETT_SNA_RU,
424         ETT_YHOO,
425         ETT_RPC,
426         ETT_RPC_CRED,
427         ETT_RPC_VERF,
428         ETT_RPC_GIDS,
429         ETT_NFS,
430         ETT_NFS2_FH,
431         ETT_NFS3_FH,
432         ETT_BOOT,
433         ETT_MNT,
434         ETT_NLM,
435         ETT_PMAP,
436         ETT_STAT,
437         ETT_YPBIND,
438         ETT_YPSERV,
439         NUM_TREE_TYPES  /* last item number plus one */
440 };
441
442 /* TRUE if subtrees of an item of the specified type are to be expanded. */
443 extern gboolean      tree_is_expanded[NUM_TREE_TYPES];
444
445 /* Utility routines used by packet*.c */
446 gchar*     ether_to_str(const guint8 *);
447 gchar*     ip_to_str(const guint8 *);
448 struct e_in6_addr;
449 gchar*     ip6_to_str(struct e_in6_addr *);
450 gchar*     ipx_addr_to_str(guint32, const guint8 *);
451 gchar*     abs_time_to_str(struct timeval*);
452 gchar*     rel_time_to_str(struct timeval*);
453 gchar*     time_secs_to_str(guint32);
454 gchar*     bytes_to_str(const guint8 *, int);
455 const u_char *find_line_end(const u_char *data, const u_char *dataend,
456     const u_char **eol);
457 int        get_token_len(const u_char *linep, const u_char *lineend,
458     const u_char **next_token);
459 gchar*     format_text(const u_char *line, int len);
460 gchar*     val_to_str(guint32, const value_string *, const char *);
461 gchar*     match_strval(guint32, const value_string*);
462 char * decode_bitfield_value(char *buf, guint32 val, guint32 mask, int width);
463 const char *decode_boolean_bitfield(guint32 val, guint32 mask, int width,
464   const char *truedesc, const char *falsedesc);
465 const char *decode_enumerated_bitfield(guint32 val, guint32 mask, int width,
466   const value_string *tab, const char *fmt);
467 const char *decode_numeric_bitfield(guint32 val, guint32 mask, int width,
468   const char *fmt);
469 gint       check_col(frame_data *, gint);
470 #if __GNUC__ == 2
471 void       col_add_fstr(frame_data *, gint, gchar *, ...)
472     __attribute__((format (printf, 3, 4)));
473 void       col_append_fstr(frame_data *, gint, gchar *, ...)
474     __attribute__((format (printf, 3, 4)));
475 #else
476 void       col_add_fstr(frame_data *, gint, gchar *, ...);
477 void       col_append_fstr(frame_data *, gint, gchar *, ...);
478 #endif
479 void       col_add_str(frame_data *, gint, const gchar *);
480 void       col_append_str(frame_data *, gint, gchar *);
481
482 void blank_packetinfo(void);
483
484 void afs_init_protocol(void);
485 void rpc_init_protocol(void);
486 void smb_init_protocol(void);
487
488 void dissect_packet(const u_char *, frame_data *, proto_tree *);
489
490 /*
491  * Routines in packet-*.c
492  * Routines should take three args: packet data *, cap_len, packet_counts *
493  * They should never modify the packet data.
494  */
495 void capture_clip(const u_char *, guint32, packet_counts *);
496 void capture_eth(const u_char *, guint32, packet_counts *);
497 void capture_fddi(const u_char *, guint32, packet_counts *);
498 void capture_null(const u_char *, guint32, packet_counts *);
499 void capture_ppp(const u_char *, guint32, packet_counts *);
500 void capture_raw(const u_char *, guint32, packet_counts *);
501 void capture_tr(const u_char *, guint32, packet_counts *);
502
503 /*
504  * Routines in packet-*.c
505  * Routines should take four args: packet data *, offset, cap_len,
506  * packet_counts *
507  * They should never modify the packet data.
508  */
509 void capture_netbios(const u_char *, int, guint32, packet_counts *);
510 void capture_llc(const u_char *, int, guint32, packet_counts *);
511 void capture_ip(const u_char *, int, guint32, packet_counts *);
512
513 /*
514  * Routines in packet-*.c
515  * Routines should take three args: packet data *, frame_data *, tree *
516  * They should never modify the packet data.
517  */
518 void dissect_ascend(const u_char *, frame_data *, proto_tree *);
519 void dissect_atm(const u_char *, frame_data *, proto_tree *);
520 void dissect_clip(const u_char *, frame_data *, proto_tree *);
521 void dissect_lapb(const u_char *, frame_data *, proto_tree *);
522 void dissect_null(const u_char *, frame_data *, proto_tree *);
523 void dissect_ppp(const u_char *, frame_data *, proto_tree *);
524 void dissect_raw(const u_char *, frame_data *, proto_tree *);
525
526 /*
527  * Routines in packet-*.c
528  * Routines should take four args: packet data *, frame_data *, tree *,
529  * gboolean
530  * They should never modify the packet data.
531  */
532 void dissect_fddi(const u_char *, frame_data *, proto_tree *, gboolean);
533
534 typedef void    (*DissectFunc)  (const u_char*, int, frame_data*, proto_tree*);
535
536 /*
537  * Routines in packet-*.c
538  * Routines should take four args: packet data *, offset, frame_data *,
539  * tree *
540  * They should never modify the packet data.
541  */
542 int dissect_ah(const u_char *, int, frame_data *, proto_tree *);
543 void dissect_aarp(const u_char *, int, frame_data *, proto_tree *);
544 void dissect_afs(const u_char *, int, frame_data *, proto_tree *);
545 void dissect_arp(const u_char *, int, frame_data *, proto_tree *);
546 void dissect_bgp(const u_char *, int, frame_data *, proto_tree *);
547 void dissect_bootp(const u_char *, int, frame_data *, proto_tree *);
548 void dissect_bpdu(const u_char *, int, frame_data *, proto_tree *);
549 void dissect_cdp(const u_char *, int, frame_data *, proto_tree *);
550 void dissect_cotp(const u_char *, int, frame_data *, proto_tree *);
551 void dissect_data(const u_char *, int, frame_data *, proto_tree *);
552 void dissect_ddp(const u_char *, int, frame_data *, proto_tree *);
553 void dissect_dns(const u_char *, int, frame_data *, proto_tree *);
554 void dissect_esp(const u_char *, int, frame_data *, proto_tree *);
555 void dissect_eth(const u_char *, int, frame_data *, proto_tree *);
556 void dissect_ftp(const u_char *, int, frame_data *, proto_tree *);
557 void dissect_ftpdata(const u_char *, int, frame_data *, proto_tree *);
558 void dissect_giop(const u_char *, int, frame_data *, proto_tree *);
559 void dissect_http(const u_char *, int, frame_data *, proto_tree *);
560 void dissect_icmp(const u_char *, int, frame_data *, proto_tree *);
561 void dissect_icmpv6(const u_char *, int, frame_data *, proto_tree *);
562 void dissect_igmp(const u_char *, int, frame_data *, proto_tree *);
563 void dissect_ip(const u_char *, int, frame_data *, proto_tree *);
564 void dissect_ipcomp(const u_char *, int, frame_data *, proto_tree *);
565 void dissect_ipp(const u_char *, int, frame_data *, proto_tree *);
566 void dissect_ipv6(const u_char *, int, frame_data *, proto_tree *);
567 void dissect_ipx(const u_char *, int, frame_data *, proto_tree *);
568 void dissect_llc(const u_char *, int, frame_data *, proto_tree *);
569 void dissect_lpd(const u_char *, int, frame_data *, proto_tree *);
570 void dissect_nbdgm(const u_char *, int, frame_data *, proto_tree *);
571 void dissect_netbios(const u_char *, int, frame_data *, proto_tree *);
572 void dissect_nbipx(const u_char *, int, frame_data *, proto_tree *);
573 void dissect_nbns(const u_char *, int, frame_data *, proto_tree *);
574 void dissect_nbss(const u_char *, int, frame_data *, proto_tree *);
575 void dissect_ncp(const u_char *, int, frame_data *, proto_tree *);
576 void dissect_nntp(const u_char *, int, frame_data *, proto_tree *);
577 void dissect_ntp(const u_char *, int, frame_data *, proto_tree *);
578 void dissect_nwlink_dg(const u_char *, int, frame_data *, proto_tree *);
579 void dissect_osi(const u_char *, int, frame_data *, proto_tree *);
580 void dissect_ospf(const u_char *, int, frame_data *, proto_tree *);
581 void dissect_ospf_hello(const u_char *, int, frame_data *, proto_tree *);
582 void dissect_pim(const u_char *, int, frame_data *, proto_tree *);
583 void dissect_pop(const u_char *, int, frame_data *, proto_tree *);
584 void dissect_pppoed(const u_char *, int, frame_data *, proto_tree *);
585 void dissect_pppoes(const u_char *, int, frame_data *, proto_tree *);
586 void dissect_icp(const u_char *,int, frame_data *, proto_tree *);
587 void dissect_icq(const u_char *,int, frame_data *, proto_tree *);
588 void dissect_isakmp(const u_char *, int, frame_data *, proto_tree *);
589 void dissect_pim(const u_char *, int, frame_data *, proto_tree *);
590 void dissect_radius(const u_char *, int, frame_data *, proto_tree *);
591 void dissect_rip(const u_char *, int, frame_data *, proto_tree *);
592 void dissect_ripng(const u_char *, int, frame_data *, proto_tree *);
593 void dissect_rsvp(const u_char *, int, frame_data *, proto_tree *);
594 void dissect_rtsp(const u_char *, int, frame_data *, proto_tree *);
595 void dissect_rx(const u_char *, int, frame_data *, proto_tree *);
596 void dissect_sdp(const u_char *, int, frame_data *, proto_tree *);
597 void dissect_sna(const u_char *, int, frame_data *, proto_tree *);
598 void dissect_snmp(const u_char *, int, frame_data *, proto_tree *);
599 void dissect_tcp(const u_char *, int, frame_data *, proto_tree *);
600 void dissect_telnet(const u_char *, int, frame_data *, proto_tree *);
601 void dissect_tftp(const u_char *, int, frame_data *, proto_tree *);
602 void dissect_tr(const u_char *, int, frame_data *, proto_tree *);
603 void dissect_trmac(const u_char *, int, frame_data *, proto_tree *);
604 void dissect_udp(const u_char *, int, frame_data *, proto_tree *);
605 void dissect_vines(const u_char *, int, frame_data *, proto_tree *);
606 void dissect_vines_arp(const u_char *, int, frame_data *, proto_tree *);
607 void dissect_vines_frp(const u_char *, int, frame_data *, proto_tree *);
608 void dissect_vines_icp(const u_char *, int, frame_data *, proto_tree *);
609 void dissect_vines_ipc(const u_char *, int, frame_data *, proto_tree *);
610 void dissect_vines_rtp(const u_char *, int, frame_data *, proto_tree *);
611 void dissect_vines_spp(const u_char *, int, frame_data *, proto_tree *);
612 void dissect_vlan(const u_char *, int, frame_data *, proto_tree *);
613 void dissect_payload_ppp(const u_char *, int, frame_data *, proto_tree *);
614 void dissect_x25(const u_char *, int, frame_data *, proto_tree *);
615 void dissect_yhoo(const u_char *, int, frame_data *, proto_tree *);
616
617 void dissect_smb(const u_char *, int, frame_data *, proto_tree *, int);
618 void dissect_pptp(const u_char *, int, frame_data *, proto_tree *);
619 void dissect_gre(const u_char *, int, frame_data *, proto_tree *);
620
621 void dissect_rpc(const u_char *, int, frame_data *, proto_tree *, guint32, void*);
622
623 void init_dissect_rpc(void);
624 void init_dissect_udp(void);
625 void init_dissect_x25(void);
626
627 /* These functions are in ethertype.c */
628 void capture_ethertype(guint16 etype, int offset,
629                 const u_char *pd, guint32 cap_len, packet_counts *ld);
630 void ethertype(guint16 etype, int offset,
631                 const u_char *pd, frame_data *fd, proto_tree *tree,
632                 proto_tree *fh_tree, int item_id);
633 extern const value_string etype_vals[];
634
635 /* These functions are in packet-arp.c */
636 gchar *arphrdaddr_to_str(guint8 *ad, int ad_len, guint16 type);
637 gchar *arphrdtype_to_str(guint16 hwtype, const char *fmt);
638
639 /* ipproto.c */
640 extern const char *ipprotostr(int proto);
641
642 /*
643  * All of the possible columns in summary listing.
644  *
645  * NOTE: The SRC and DST entries MUST remain in this order, or else you
646  * need to fix the offset #defines before get_column_format!
647  */
648 enum {
649   COL_NUMBER,         /* Packet list item number */
650   COL_CLS_TIME,       /* Command line-specified time (default relative) */
651   COL_REL_TIME,       /* Relative time */
652   COL_ABS_TIME,       /* Absolute time */
653   COL_DELTA_TIME,     /* Delta time */
654   COL_DEF_SRC,        /* Source address */
655   COL_RES_SRC,        /* Resolved source */
656   COL_UNRES_SRC,      /* Unresolved source */
657   COL_DEF_DL_SRC,     /* Data link layer source address */
658   COL_RES_DL_SRC,     /* Resolved DL source */
659   COL_UNRES_DL_SRC,   /* Unresolved DL source */
660   COL_DEF_NET_SRC,    /* Network layer source address */
661   COL_RES_NET_SRC,    /* Resolved net source */
662   COL_UNRES_NET_SRC,  /* Unresolved net source */
663   COL_DEF_DST,        /* Destination address */
664   COL_RES_DST,        /* Resolved dest */
665   COL_UNRES_DST,      /* Unresolved dest */
666   COL_DEF_DL_DST,     /* Data link layer dest address */
667   COL_RES_DL_DST,     /* Resolved DL dest */
668   COL_UNRES_DL_DST,   /* Unresolved DL dest */
669   COL_DEF_NET_DST,    /* Network layer dest address */
670   COL_RES_NET_DST,    /* Resolved net dest */
671   COL_UNRES_NET_DST,  /* Unresolved net dest */
672   COL_DEF_SRC_PORT,   /* Source port */
673   COL_RES_SRC_PORT,   /* Resolved source port */
674   COL_UNRES_SRC_PORT, /* Unresolved source port */
675   COL_DEF_DST_PORT,   /* Destination port */
676   COL_RES_DST_PORT,   /* Resolved dest port */
677   COL_UNRES_DST_PORT, /* Unresolved dest port */
678   COL_PROTOCOL,       /* Protocol */
679   COL_INFO,           /* Description */
680   COL_PACKET_LENGTH,  /* Packet length in bytes */
681   NUM_COL_FMTS        /* Should always be last */
682 };
683
684 #endif /* packet.h */