netdissect.h revision 190207
1146773Ssam/*
2146773Ssam * Copyright (c) 1988-1997
3146773Ssam *	The Regents of the University of California.  All rights reserved.
4146773Ssam *
5146773Ssam * Copyright (c) 1998-2004  Michael Richardson <mcr@tcpdump.org>
6146773Ssam *      The TCPDUMP project
7146773Ssam *
8146773Ssam * Redistribution and use in source and binary forms, with or without
9146773Ssam * modification, are permitted provided that: (1) source code distributions
10146773Ssam * retain the above copyright notice and this paragraph in its entirety, (2)
11146773Ssam * distributions including binary code include the above copyright notice and
12146773Ssam * this paragraph in its entirety in the documentation or other materials
13146773Ssam * provided with the distribution, and (3) all advertising materials mentioning
14146773Ssam * features or use of this software display the following acknowledgement:
15146773Ssam * ``This product includes software developed by the University of California,
16146773Ssam * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
17146773Ssam * the University nor the names of its contributors may be used to endorse
18146773Ssam * or promote products derived from this software without specific prior
19146773Ssam * written permission.
20146773Ssam * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
21146773Ssam * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
22146773Ssam * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23146773Ssam *
24190207Srpaulo * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.23.2.2 2008-04-04 19:42:52 guy Exp $ (LBL)
25146773Ssam */
26146773Ssam
27146773Ssam#ifndef netdissect_h
28146773Ssam#define netdissect_h
29146773Ssam
30146773Ssam#ifdef HAVE_OS_PROTO_H
31146773Ssam#include "os-proto.h"
32146773Ssam#endif
33146773Ssam#include <sys/types.h>
34146773Ssam
35146773Ssam#ifndef HAVE___ATTRIBUTE__
36146773Ssam#define __attribute__(x)
37146773Ssam#endif
38146773Ssam
39146773Ssam/* snprintf et al */
40146773Ssam
41146773Ssam#include <stdarg.h>
42146773Ssam
43146773Ssam#if !defined(HAVE_SNPRINTF)
44146773Ssamint snprintf (char *str, size_t sz, const char *format, ...)
45146773Ssam     __attribute__ ((format (printf, 3, 4)));
46146773Ssam#endif
47146773Ssam
48146773Ssam#if !defined(HAVE_VSNPRINTF)
49146773Ssamint vsnprintf (char *str, size_t sz, const char *format, va_list ap)
50146773Ssam     __attribute__((format (printf, 3, 0)));
51146773Ssam#endif
52146773Ssam
53146773Ssam#ifndef HAVE_STRLCAT
54146773Ssamextern size_t strlcat (char *, const char *, size_t);
55146773Ssam#endif
56146773Ssam#ifndef HAVE_STRLCPY
57146773Ssamextern size_t strlcpy (char *, const char *, size_t);
58146773Ssam#endif
59146773Ssam
60146773Ssam#ifndef HAVE_STRDUP
61146773Ssamextern char *strdup (const char *str);
62146773Ssam#endif
63146773Ssam
64146773Ssam#ifndef HAVE_STRSEP
65146773Ssamextern char *strsep(char **, const char *);
66146773Ssam#endif
67146773Ssam
68146773Ssamstruct tok {
69146773Ssam	int v;			/* value */
70146773Ssam	const char *s;		/* string */
71146773Ssam};
72146773Ssam
73146773Ssam#define TOKBUFSIZE 128
74146773Ssamextern const char *tok2strbuf(const struct tok *, const char *, int,
75146773Ssam			      char *buf, size_t bufsize);
76146773Ssam
77146773Ssam/* tok2str is deprecated */
78146773Ssamextern const char *tok2str(const struct tok *, const char *, int);
79146773Ssamextern char *bittok2str(const struct tok *, const char *, int);
80190207Srpauloextern char *bittok2str_nosep(const struct tok *, const char *, int);
81146773Ssam
82146773Ssam
83146773Ssamtypedef struct netdissect_options netdissect_options;
84146773Ssam
85146773Ssamstruct netdissect_options {
86146773Ssam  int ndo_aflag;		/* translate network and broadcast addresses */
87146773Ssam  int ndo_eflag;		/* print ethernet header */
88146773Ssam  int ndo_fflag;		/* don't translate "foreign" IP address */
89190207Srpaulo  int ndo_Kflag;		/* don't check TCP checksums */
90146773Ssam  int ndo_nflag;		/* leave addresses as numbers */
91146773Ssam  int ndo_Nflag;		/* remove domains from printed host names */
92146773Ssam  int ndo_qflag;		/* quick (shorter) output */
93146773Ssam  int ndo_Rflag;		/* print sequence # field in AH/ESP*/
94146773Ssam  int ndo_sflag;		/* use the libsmi to translate OIDs */
95146773Ssam  int ndo_Sflag;		/* print raw TCP sequence numbers */
96146773Ssam  int ndo_tflag;		/* print packet arrival time */
97146773Ssam  int ndo_Uflag;		/* "unbuffered" output of dump files */
98146773Ssam  int ndo_uflag;		/* Print undecoded NFS handles */
99146773Ssam  int ndo_vflag;		/* verbose */
100146773Ssam  int ndo_xflag;		/* print packet in hex */
101146773Ssam  int ndo_Xflag;		/* print packet in hex/ascii */
102146773Ssam  int ndo_Aflag;		/* print packet only in ascii observing TAB,
103146773Ssam				 * LF, CR and SPACE as graphical chars
104146773Ssam				 */
105190207Srpaulo  int ndo_Bflag;		/* buffer size */
106190207Srpaulo  int ndo_Iflag;		/* rfmon (monitor) mode */
107146773Ssam  int ndo_Oflag;                /* run filter code optimizer */
108146773Ssam  int ndo_dlt;                  /* if != -1, ask libpcap for the DLT it names*/
109146773Ssam  int ndo_pflag;                /* don't go promiscuous */
110146773Ssam
111146773Ssam  int ndo_Cflag;                /* rotate dump files after this many bytes */
112146773Ssam  int ndo_Cflag_count;      /* Keep track of which file number we're writing */
113190207Srpaulo  int ndo_Gflag;            /* rotate dump files after this many seconds */
114190207Srpaulo  int ndo_Gflag_count;      /* number of files created with Gflag rotation */
115190207Srpaulo  time_t ndo_Gflag_time;    /* The last time_t the dump file was rotated. */
116146773Ssam  int ndo_Wflag;          /* recycle output files after this number of files */
117162017Ssam  int ndo_WflagChars;
118162017Ssam  int ndo_suppress_default_print; /* don't use default_print() for unknown packet types */
119146773Ssam  const char *ndo_dltname;
120146773Ssam
121146773Ssam  char *ndo_espsecret;
122146773Ssam  struct sa_list *ndo_sa_list_head;  /* used by print-esp.c */
123146773Ssam  struct sa_list *ndo_sa_default;
124146773Ssam
125146773Ssam  char *ndo_tcpmd5secret;     	/* TCP-MD5 secret key */
126146773Ssam
127146773Ssam  struct esp_algorithm *ndo_espsecret_xform;   /* cache of decoded  */
128146773Ssam  char                 *ndo_espsecret_key;
129146773Ssam
130146773Ssam  int   ndo_packettype;	/* as specified by -T */
131146773Ssam
132146773Ssam  char *ndo_program_name;	/*used to generate self-identifying messages */
133146773Ssam
134146773Ssam  int32_t ndo_thiszone;	/* seconds offset from gmt to local time */
135146773Ssam
136146773Ssam  int   ndo_snaplen;
137146773Ssam
138146773Ssam  /*global pointers to beginning and end of current packet (during printing) */
139146773Ssam  const u_char *ndo_packetp;
140146773Ssam  const u_char *ndo_snapend;
141146773Ssam
142146773Ssam  /* bookkeeping for ^T output */
143146773Ssam  int ndo_infodelay;
144146773Ssam
145146773Ssam  /* pointer to void function to output stuff */
146146773Ssam  void (*ndo_default_print)(netdissect_options *,
147146773Ssam  		      register const u_char *bp, register u_int length);
148146773Ssam  void (*ndo_info)(netdissect_options *, int verbose);
149146773Ssam
150146773Ssam  int  (*ndo_printf)(netdissect_options *,
151146773Ssam		     const char *fmt, ...);
152146773Ssam  void (*ndo_error)(netdissect_options *,
153146773Ssam		    const char *fmt, ...);
154146773Ssam  void (*ndo_warning)(netdissect_options *,
155146773Ssam		      const char *fmt, ...);
156146773Ssam};
157146773Ssam
158146773Ssam#define PT_VAT		1	/* Visual Audio Tool */
159146773Ssam#define PT_WB		2	/* distributed White Board */
160146773Ssam#define PT_RPC		3	/* Remote Procedure Call */
161146773Ssam#define PT_RTP		4	/* Real-Time Applications protocol */
162146773Ssam#define PT_RTCP		5	/* Real-Time Applications control protocol */
163146773Ssam#define PT_SNMP		6	/* Simple Network Management Protocol */
164146773Ssam#define PT_CNFP		7	/* Cisco NetFlow protocol */
165146773Ssam
166146773Ssam#ifndef min
167146773Ssam#define min(a,b) ((a)>(b)?(b):(a))
168146773Ssam#endif
169146773Ssam#ifndef max
170146773Ssam#define max(a,b) ((b)>(a)?(b):(a))
171146773Ssam#endif
172146773Ssam
173146773Ssam#ifndef INET6
174146773Ssam/*
175146773Ssam * The default snapshot length.  This value allows most printers to print
176146773Ssam * useful information while keeping the amount of unwanted data down.
177146773Ssam * In particular, it allows for an ethernet header, tcp/ip header, and
178146773Ssam * 14 bytes of data (assuming no ip options).
179146773Ssam */
180146773Ssam#define DEFAULT_SNAPLEN 68
181146773Ssam#else
182146773Ssam#define DEFAULT_SNAPLEN 96
183146773Ssam#endif
184146773Ssam
185146773Ssam#ifndef BIG_ENDIAN
186146773Ssam#define BIG_ENDIAN 4321
187146773Ssam#define LITTLE_ENDIAN 1234
188146773Ssam#endif
189146773Ssam
190146773Ssam#define ESRC(ep) ((ep)->ether_shost)
191146773Ssam#define EDST(ep) ((ep)->ether_dhost)
192146773Ssam
193146773Ssam#ifndef NTOHL
194146773Ssam#define NTOHL(x)	(x) = ntohl(x)
195146773Ssam#define NTOHS(x)	(x) = ntohs(x)
196146773Ssam#define HTONL(x)	(x) = htonl(x)
197146773Ssam#define HTONS(x)	(x) = htons(x)
198146773Ssam#endif
199146773Ssam
200146773Ssam/*
201146773Ssam * True if "l" bytes of "var" were captured.
202146773Ssam *
203146773Ssam * The "ndo->ndo_snapend - (l) <= ndo->ndo_snapend" checks to make sure
204146773Ssam * "l" isn't so large that "ndo->ndo_snapend - (l)" underflows.
205146773Ssam *
206146773Ssam * The check is for <= rather than < because "l" might be 0.
207146773Ssam */
208146773Ssam#define ND_TTEST2(var, l) (ndo->ndo_snapend - (l) <= ndo->ndo_snapend && \
209146773Ssam			(const u_char *)&(var) <= ndo->ndo_snapend - (l))
210146773Ssam
211146773Ssam/* True if "var" was captured */
212146773Ssam#define ND_TTEST(var) ND_TTEST2(var, sizeof(var))
213146773Ssam
214146773Ssam/* Bail if "l" bytes of "var" were not captured */
215146773Ssam#define ND_TCHECK2(var, l) if (!ND_TTEST2(var, l)) goto trunc
216146773Ssam
217146773Ssam/* Bail if "var" was not captured */
218146773Ssam#define ND_TCHECK(var) ND_TCHECK2(var, sizeof(var))
219146773Ssam
220146773Ssam#define ND_PRINT(STUFF) (*ndo->ndo_printf)STUFF
221146773Ssam#define ND_DEFAULTPRINT(ap, length) (*ndo->ndo_default_print)(ndo, ap, length)
222146773Ssam
223146773Ssam#if 0
224146773Ssamextern void ts_print(netdissect_options *ipdo,
225146773Ssam		     const struct timeval *);
226146773Ssamextern void relts_print(int);
227146773Ssam#endif
228146773Ssam
229146773Ssamextern int fn_print(const u_char *, const u_char *);
230146773Ssamextern int fn_printn(const u_char *, u_int, const u_char *);
231146773Ssamextern const char *tok2str(const struct tok *, const char *, int);
232146773Ssam
233146773Ssamextern void wrapup(int);
234146773Ssam
235146773Ssam#if 0
236146773Ssamextern char *read_infile(netdissect_options *, char *);
237146773Ssamextern char *copy_argv(netdissect_options *, char **);
238146773Ssam#endif
239146773Ssam
240146773Ssamextern void safeputchar(int);
241172683Smlaierextern void safeputs(const char *, int);
242146773Ssam
243146773Ssam#if 0
244146773Ssamextern const char *isonsap_string(netdissect_options *, const u_char *);
245146773Ssamextern const char *protoid_string(netdissect_options *, const u_char *);
246146773Ssamextern const char *dnname_string(netdissect_options *, u_short);
247146773Ssamextern const char *dnnum_string(netdissect_options *, u_short);
248146773Ssam#endif
249146773Ssam
250146773Ssam/* The printer routines. */
251146773Ssam
252146773Ssam#include <pcap.h>
253146773Ssam
254146773Ssam
255190207Srpauloextern void eap_print(netdissect_options *,const u_char *, u_int);
256146773Ssamextern int esp_print(netdissect_options *,
257146773Ssam		     register const u_char *bp, int len, register const u_char *bp2,
258146773Ssam		     int *nhdr, int *padlen);
259146773Ssamextern void arp_print(netdissect_options *,const u_char *, u_int, u_int);
260146773Ssamextern void isakmp_print(netdissect_options *,const u_char *,
261146773Ssam			 u_int, const u_char *);
262146773Ssamextern void isakmp_rfc3948_print(netdissect_options *,const u_char *,
263146773Ssam				 u_int, const u_char *);
264146773Ssamextern void ip_print(netdissect_options *,const u_char *, u_int);
265146773Ssamextern void ip_print_inner(netdissect_options *ndo,
266146773Ssam			   const u_char *bp, u_int length, u_int nh,
267146773Ssam			   const u_char *bp2);
268190207Srpauloextern void rrcp_print(netdissect_options *,const u_char *, u_int);
269146773Ssam
270146773Ssam/* stuff that has not yet been rototiled */
271146773Ssam#if 0
272162017Ssamextern void ascii_print(netdissect_options *,u_int);
273162017Ssamextern void hex_and_ascii_print_with_offset(netdissect_options *,const char *,
274162017Ssam				    u_int, u_int);
275162017Ssamextern void hex_and_ascii_print(netdissect_options *,const char *, u_int);
276146773Ssamextern void hex_print_with_offset(netdissect_options *,const char *,
277162017Ssam				  u_int, u_int);
278162017Ssamextern void hex_print(netdissect_options *,const char *, u_int);
279162017Ssamextern void telnet_print(netdissect_options *,const u_char *, u_int);
280146773Ssamextern int ether_encap_print(netdissect_options *,u_short, const u_char *,
281146773Ssam			     u_int, u_int, u_short *);
282146773Ssamextern int llc_print(netdissect_options *,
283146773Ssam		     const u_char *, u_int, u_int, const u_char *,
284146773Ssam		     const u_char *, u_short *);
285146773Ssamextern void aarp_print(netdissect_options *,const u_char *, u_int);
286146773Ssamextern void atalk_print(netdissect_options *,const u_char *, u_int);
287146773Ssamextern void atm_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
288146773Ssamextern void bootp_print(netdissect_options *,const u_char *,
289146773Ssam			u_int, u_short, u_short);
290146773Ssamextern void bgp_print(netdissect_options *,const u_char *, int);
291146773Ssamextern void bxxp_print(netdissect_options *,const u_char *, u_int);
292146773Ssamextern void chdlc_if_print(u_char *user, const struct pcap_pkthdr *h,
293146773Ssam			   register const u_char *p);
294146773Ssamextern void chdlc_print(netdissect_options *ndo,
295146773Ssam			register const u_char *p, u_int length, u_int caplen);
296146773Ssamextern void cisco_autorp_print(netdissect_options *,
297146773Ssam			       const u_char *, u_int);
298146773Ssamextern void cnfp_print(netdissect_options *,const u_char *cp,
299146773Ssam		       u_int len, const u_char *bp);
300146773Ssamextern void decnet_print(netdissect_options *,const u_char *,
301146773Ssam			 u_int, u_int);
302146773Ssamextern void default_print(netdissect_options *,const u_char *, u_int);
303146773Ssamextern void dvmrp_print(netdissect_options *,const u_char *, u_int);
304146773Ssamextern void egp_print(netdissect_options *,const u_char *, u_int,
305146773Ssam		      const u_char *);
306146773Ssam
307146773Ssamextern void arcnet_if_print(u_char*,const struct pcap_pkthdr *,const u_char *);
308146773Ssamextern void ether_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
309146773Ssamextern void token_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
310146773Ssamextern void fddi_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
311146773Ssam
312146773Ssamextern void gre_print(netdissect_options *,const u_char *, u_int);
313146773Ssamextern void icmp_print(netdissect_options *,const u_char *, u_int,
314146773Ssam		       const u_char *);
315146773Ssamextern void hsrp_print(netdissect_options *ndo,
316146773Ssam		       register const u_char *bp, register u_int len);
317146773Ssamextern void ieee802_11_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
318146773Ssamextern void igmp_print(netdissect_options *,
319146773Ssam		       register const u_char *, u_int);
320146773Ssamextern void igrp_print(netdissect_options *,const u_char *, u_int,
321146773Ssam		       const u_char *);
322146773Ssamextern void ipN_print(netdissect_options *,const u_char *, u_int);
323146773Ssamextern void ipx_print(netdissect_options *,const u_char *, u_int);
324146773Ssamextern void isoclns_print(netdissect_options *,const u_char *,
325146773Ssam			  u_int, u_int, const u_char *,	const u_char *);
326146773Ssamextern void krb_print(netdissect_options *,const u_char *, u_int);
327146773Ssamextern void llap_print(netdissect_options *,const u_char *, u_int);
328146773Ssamextern const char *linkaddr_string(netdissect_options *ndo,
329146773Ssam				   const u_char *ep, const unsigned int len);
330146773Ssamextern void ltalk_if_print(netdissect_options *ndo,
331146773Ssam			   u_char *user, const struct pcap_pkthdr *h,
332146773Ssam			   const u_char *p);
333146773Ssamextern void mpls_print(netdissect_options *ndo,
334146773Ssam		       const u_char *bp, u_int length);
335146773Ssamextern void msdp_print(netdissect_options *ndo,
336146773Ssam		       const unsigned char *sp, u_int length);
337146773Ssamextern void nfsreply_print(netdissect_options *,const u_char *,
338146773Ssam			   u_int, const u_char *);
339146773Ssamextern void nfsreq_print(netdissect_options *,const u_char *,
340146773Ssam			 u_int, const u_char *);
341146773Ssamextern void ns_print(netdissect_options *,const u_char *, u_int);
342146773Ssamextern void ntp_print(netdissect_options *,const u_char *, u_int);
343146773Ssamextern void null_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
344146773Ssamextern void ospf_print(netdissect_options *,const u_char *,
345146773Ssam		       u_int, const u_char *);
346146773Ssamextern void pimv1_print(netdissect_options *,const u_char *, u_int);
347146773Ssamextern void mobile_print(netdissect_options *,const u_char *, u_int);
348146773Ssamextern void pim_print(netdissect_options *,const u_char *, u_int);
349146773Ssamextern void pppoe_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
350146773Ssamextern void pppoe_print(netdissect_options *,const u_char *, u_int);
351146773Ssamextern void ppp_print(netdissect_options *,
352146773Ssam		      register const u_char *, u_int);
353146773Ssam
354146773Ssamextern void ppp_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
355146773Ssamextern void ppp_hdlc_if_print(u_char *,
356146773Ssam			      const struct pcap_pkthdr *, const u_char *);
357146773Ssamextern void ppp_bsdos_if_print(u_char *,
358146773Ssam			       const struct pcap_pkthdr *, const u_char *);
359146773Ssam
360146773Ssamextern int vjc_print(netdissect_options *,register const char *,
361146773Ssam		     register u_int, u_short);
362146773Ssam
363146773Ssamextern void raw_if_print(u_char *,
364146773Ssam			 const struct pcap_pkthdr *, const u_char *);
365146773Ssam
366146773Ssamextern void rip_print(netdissect_options *,const u_char *, u_int);
367146773Ssam
368146773Ssamextern void sctp_print(netdissect_options *ndo,
369146773Ssam		       const u_char *bp, const u_char *bp2,
370146773Ssam		       u_int sctpPacketLength);
371146773Ssam
372146773Ssamextern void sl_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
373146773Ssam
374146773Ssamextern void lane_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
375146773Ssamextern void cip_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
376146773Ssamextern void sl_bsdos_if_print(u_char *,
377146773Ssam			      const struct pcap_pkthdr *, const u_char *);
378146773Ssamextern void sll_if_print(u_char *,
379146773Ssam			 const struct pcap_pkthdr *, const u_char *);
380146773Ssam
381146773Ssamextern void snmp_print(netdissect_options *,const u_char *, u_int);
382146773Ssamextern void sunrpcrequest_print(netdissect_options *,const u_char *,
383146773Ssam				u_int, const u_char *);
384146773Ssamextern void tcp_print(netdissect_options *,const u_char *, u_int,
385146773Ssam		      const u_char *, int);
386146773Ssamextern void tftp_print(netdissect_options *,const u_char *, u_int);
387146773Ssamextern void timed_print(netdissect_options *,const u_char *, u_int);
388146773Ssamextern void udp_print(netdissect_options *,const u_char *, u_int,
389146773Ssam		      const u_char *, int);
390146773Ssamextern void wb_print(netdissect_options *,const void *, u_int);
391146773Ssamextern int ah_print(netdissect_options *,register const u_char *,
392146773Ssam		    register const u_char *);
393146773Ssamextern void esp_print_decodesecret(netdissect_options *ndo);
394146773Ssamextern int ipcomp_print(netdissect_options *,register const u_char *,
395146773Ssam			register const u_char *, int *);
396146773Ssamextern void rx_print(netdissect_options *,register const u_char *,
397146773Ssam		     int, int, int, u_char *);
398146773Ssamextern void netbeui_print(netdissect_options *,u_short,
399146773Ssam			  const u_char *, int);
400146773Ssamextern void ipx_netbios_print(netdissect_options *,const u_char *, u_int);
401146773Ssamextern void nbt_tcp_print(netdissect_options *,const u_char *, int);
402146773Ssamextern void nbt_udp137_print(netdissect_options *,
403146773Ssam			     const u_char *data, int);
404146773Ssamextern void nbt_udp138_print(netdissect_options *,
405146773Ssam			     const u_char *data, int);
406146773Ssamextern char *smb_errstr(netdissect_options *,int, int);
407146773Ssamextern const char *nt_errstr(netdissect_options *, u_int32_t);
408146773Ssamextern void print_data(netdissect_options *,const unsigned char *, int);
409146773Ssamextern void l2tp_print(netdissect_options *,const u_char *, u_int);
410146773Ssamextern void lcp_print(netdissect_options *,const u_char *, u_int);
411146773Ssamextern void vrrp_print(netdissect_options *,const u_char *bp,
412146773Ssam		       u_int len, int ttl);
413146773Ssamextern void cdp_print(netdissect_options *,const u_char *,
414146773Ssam		      u_int, u_int, const u_char *, const u_char *);
415146773Ssamextern void stp_print(netdissect_options *,const u_char *p, u_int length);
416146773Ssamextern void radius_print(netdissect_options *,const u_char *, u_int);
417146773Ssamextern void lwres_print(netdissect_options *,const u_char *, u_int);
418146773Ssamextern void pptp_print(netdissect_options *,const u_char *, u_int);
419146773Ssam
420146773Ssam#ifdef INET6
421146773Ssamextern void ip6_print(netdissect_options *,const u_char *, u_int);
422146773Ssamextern void ip6_opt_print(netdissect_options *,const u_char *, int);
423146773Ssamextern int hbhopt_print(netdissect_options *,const u_char *);
424146773Ssamextern int dstopt_print(netdissect_options *,const u_char *);
425146773Ssamextern int frag6_print(netdissect_options *,const u_char *,
426146773Ssam		       const u_char *);
427146773Ssamextern void icmp6_print(netdissect_options *,const u_char *,
428146773Ssam			const u_char *);
429146773Ssamextern void ripng_print(netdissect_options *,const u_char *, int);
430146773Ssamextern int rt6_print(netdissect_options *,const u_char *, const u_char *);
431146773Ssamextern void ospf6_print(netdissect_options *,const u_char *, u_int);
432146773Ssamextern void dhcp6_print(netdissect_options *,const u_char *,
433146773Ssam			u_int, u_int16_t, u_int16_t);
434146773Ssam
435146773Ssamextern void zephyr_print(netdissect_options * ndo,
436146773Ssam			 const u_char *cp, int length);
437146773Ssam
438146773Ssam#endif /*INET6*/
439146773Ssamextern u_short in_cksum(const u_short *,
440146773Ssam			register u_int, int);
441146773Ssam
442146773Ssam#endif
443146773Ssam
444146773Ssam#endif  /* netdissect_h */
445