"ssn_range" needs to be a copy of "global_ssn_range", so that it's not
[obnox/wireshark/wip.git] / wiretap / wtap.h
1 /* wtap.h
2  *
3  * $Id$
4  *
5  * Wiretap Library
6  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21  */
22
23 #ifndef __WTAP_H__
24 #define __WTAP_H__
25
26 #ifdef HAVE_SYS_TIME_H
27 #include <sys/time.h>
28 #endif
29
30 #ifdef HAVE_WINSOCK2_H
31 # include <winsock2.h>
32 #endif
33
34 #include <glib.h>
35 #include <stdio.h>
36
37 /* Encapsulation types. Choose names that truly reflect
38  * what is contained in the packet trace file.
39  *
40  * WTAP_ENCAP_PER_PACKET is a value passed to "wtap_dump_open()" or
41  * "wtap_dump_fd_open()" to indicate that there is no single encapsulation
42  * type for all packets in the file; this may cause those routines to
43  * fail if the capture file format being written can't support that.
44  * It's also returned by "wtap_file_encap()" for capture files that
45  * don't have a single encapsulation type for all packets in the file.
46  *
47  * WTAP_ENCAP_UNKNOWN is returned by "wtap_pcap_encap_to_wtap_encap()"
48  * if it's handed an unknown encapsulation.
49  *
50  * WTAP_ENCAP_FDDI_BITSWAPPED is for FDDI captures on systems where the
51  * MAC addresses you get from the hardware are bit-swapped.  Ideally,
52  * the driver would tell us that, but I know of none that do, so, for
53  * now, we base it on the machine on which we're *reading* the
54  * capture, rather than on the machine on which the capture was taken
55  * (they're probably likely to be the same).  We assume that they're
56  * bit-swapped on everything except for systems running Ultrix, Alpha
57  * systems, and BSD/OS systems (that's what "tcpdump" does; I guess
58  * Digital decided to bit-swap addresses in the hardware or in the
59  * driver, and I guess BSDI bit-swapped them in the driver, given that
60  * BSD/OS generally runs on Boring Old PC's).  If we create a wiretap
61  * save file format, we'd use the WTAP_ENCAP values to flag the
62  * encapsulation of a packet, so there we'd at least be able to base
63  * it on the machine on which the capture was taken.
64  *
65  * WTAP_ENCAP_LINUX_ATM_CLIP is the encapsulation you get with the
66  * ATM on Linux code from <http://linux-atm.sourceforge.net/>;
67  * that code adds a DLT_ATM_CLIP DLT_ code of 19, and that
68  * encapsulation isn't the same as the DLT_ATM_RFC1483 encapsulation
69  * presumably used on some BSD systems, which we turn into
70  * WTAP_ENCAP_ATM_RFC1483.
71  *
72  * WTAP_ENCAP_NULL corresponds to DLT_NULL from "libpcap".  This
73  * corresponds to
74  *
75  *      1) PPP-over-HDLC encapsulation, at least with some versions
76  *         of ISDN4BSD (but not the current ones, it appears, unless
77  *         I've missed something);
78  *
79  *      2) a 4-byte header containing the AF_ address family, in
80  *         the byte order of the machine that saved the capture,
81  *         for the packet, as used on many BSD systems for the
82  *         loopback device and some other devices, or a 4-byte header
83  *         containing the AF_ address family in network byte order,
84  *         as used on recent OpenBSD systems for the loopback device;
85  *
86  *      3) a 4-byte header containing 2 octets of 0 and an Ethernet
87  *         type in the byte order from an Ethernet header, that being
88  *         what older versions of "libpcap" on Linux turn the Ethernet
89  *         header for loopback interfaces into (0.6.0 and later versions
90  *         leave the Ethernet header alone and make it DLT_EN10MB). */
91 #define WTAP_ENCAP_PER_PACKET                   -1
92 #define WTAP_ENCAP_UNKNOWN                      0
93 #define WTAP_ENCAP_ETHERNET                     1
94 #define WTAP_ENCAP_TOKEN_RING                   2
95 #define WTAP_ENCAP_SLIP                         3
96 #define WTAP_ENCAP_PPP                          4
97 #define WTAP_ENCAP_FDDI                         5
98 #define WTAP_ENCAP_FDDI_BITSWAPPED              6
99 #define WTAP_ENCAP_RAW_IP                       7
100 #define WTAP_ENCAP_ARCNET                       8
101 #define WTAP_ENCAP_ARCNET_LINUX                 9
102 #define WTAP_ENCAP_ATM_RFC1483                  10
103 #define WTAP_ENCAP_LINUX_ATM_CLIP               11
104 #define WTAP_ENCAP_LAPB                         12
105 #define WTAP_ENCAP_ATM_PDUS                     13
106 #define WTAP_ENCAP_ATM_PDUS_UNTRUNCATED         14
107 #define WTAP_ENCAP_NULL                         15
108 #define WTAP_ENCAP_ASCEND                       16
109 #define WTAP_ENCAP_ISDN                         17
110 #define WTAP_ENCAP_IP_OVER_FC                   18
111 #define WTAP_ENCAP_PPP_WITH_PHDR                19
112 #define WTAP_ENCAP_IEEE_802_11                  20
113 #define WTAP_ENCAP_PRISM_HEADER                 21
114 #define WTAP_ENCAP_IEEE_802_11_WITH_RADIO       22
115 #define WTAP_ENCAP_IEEE_802_11_WLAN_BSD         23
116 #define WTAP_ENCAP_IEEE_802_11_WLAN_AVS         24
117 #define WTAP_ENCAP_SLL                          25
118 #define WTAP_ENCAP_FRELAY                       26
119 #define WTAP_ENCAP_FRELAY_WITH_PHDR             27
120 #define WTAP_ENCAP_CHDLC                        28
121 #define WTAP_ENCAP_CISCO_IOS                    29
122 #define WTAP_ENCAP_LOCALTALK                    30
123 #define WTAP_ENCAP_OLD_PFLOG                    31
124 #define WTAP_ENCAP_HHDLC                        32
125 #define WTAP_ENCAP_DOCSIS                       33
126 #define WTAP_ENCAP_COSINE                       34
127 #define WTAP_ENCAP_WFLEET_HDLC                  35
128 #define WTAP_ENCAP_SDLC                         36
129 #define WTAP_ENCAP_TZSP                         37
130 #define WTAP_ENCAP_ENC                          38
131 #define WTAP_ENCAP_PFLOG                        39
132 #define WTAP_ENCAP_CHDLC_WITH_PHDR              40
133 #define WTAP_ENCAP_BLUETOOTH_H4                 41
134 #define WTAP_ENCAP_MTP2                         42
135 #define WTAP_ENCAP_MTP3                         43
136 #define WTAP_ENCAP_IRDA                         44
137 #define WTAP_ENCAP_USER0                        45
138 #define WTAP_ENCAP_USER1                        46
139 #define WTAP_ENCAP_USER2                        47
140 #define WTAP_ENCAP_USER3                        48
141 #define WTAP_ENCAP_USER4                        49
142 #define WTAP_ENCAP_USER5                        50
143 #define WTAP_ENCAP_USER6                        51
144 #define WTAP_ENCAP_USER7                        52
145 #define WTAP_ENCAP_USER8                        53
146 #define WTAP_ENCAP_USER9                        54
147 #define WTAP_ENCAP_USER10                       55
148 #define WTAP_ENCAP_USER11                       56
149 #define WTAP_ENCAP_USER12                       57
150 #define WTAP_ENCAP_USER13                       58
151 #define WTAP_ENCAP_USER14                       59
152 #define WTAP_ENCAP_USER15                       60
153 #define WTAP_ENCAP_SYMANTEC                     61
154 #define WTAP_ENCAP_APPLE_IP_OVER_IEEE1394       62
155 #define WTAP_ENCAP_BACNET_MS_TP                 63
156 #define WTAP_ENCAP_RAW_ICMP                     64
157 #define WTAP_ENCAP_RAW_ICMPV6                   65
158
159 /* last WTAP_ENCAP_ value + 1 */
160 #define WTAP_NUM_ENCAP_TYPES                    66
161
162 /* File types that can be read by wiretap.
163    We support writing some many of these file types, too, so we
164    distinguish between different versions of them. */
165 #define WTAP_FILE_UNKNOWN                       0
166 #define WTAP_FILE_WTAP                          1
167 #define WTAP_FILE_PCAP                          2
168 #define WTAP_FILE_PCAP_SS990417                 3
169 #define WTAP_FILE_PCAP_SS990915                 4
170 #define WTAP_FILE_PCAP_SS991029                 5
171 #define WTAP_FILE_PCAP_NOKIA                    6
172 #define WTAP_FILE_PCAP_AIX                      7
173 #define WTAP_FILE_LANALYZER                     8
174 #define WTAP_FILE_NGSNIFFER_UNCOMPRESSED        9
175 #define WTAP_FILE_NGSNIFFER_COMPRESSED          10
176 #define WTAP_FILE_SNOOP                         11
177 #define WTAP_FILE_SHOMITI                       12
178 #define WTAP_FILE_IPTRACE_1_0                   13
179 #define WTAP_FILE_IPTRACE_2_0                   14
180 #define WTAP_FILE_NETMON_1_x                    15
181 #define WTAP_FILE_NETMON_2_x                    16
182 #define WTAP_FILE_NETXRAY_OLD                   17
183 #define WTAP_FILE_NETXRAY_1_0                   18
184 #define WTAP_FILE_NETXRAY_1_1                   19
185 #define WTAP_FILE_NETXRAY_2_00x                 20
186 #define WTAP_FILE_RADCOM                        21
187 #define WTAP_FILE_ASCEND                        22
188 #define WTAP_FILE_NETTL                         23
189 #define WTAP_FILE_TOSHIBA                       24
190 #define WTAP_FILE_I4BTRACE                      25
191 #define WTAP_FILE_CSIDS                         26
192 #define WTAP_FILE_PPPDUMP                       27
193 #define WTAP_FILE_ETHERPEEK_V56                 28
194 #define WTAP_FILE_ETHERPEEK_V7                  29
195 #define WTAP_FILE_VMS                           30
196 #define WTAP_FILE_DBS_ETHERWATCH                31
197 #define WTAP_FILE_VISUAL_NETWORKS               32
198 #define WTAP_FILE_COSINE                        33
199 #define WTAP_FILE_5VIEWS                        34
200 #define WTAP_FILE_ERF                           35
201 #define WTAP_FILE_HCIDUMP                       36
202 #define WTAP_FILE_NETWORK_INSTRUMENTS_V9        37
203 #define WTAP_FILE_AIROPEEK_V9                   38
204 #define WTAP_FILE_EYESDN                        39
205
206 /* last WTAP_FILE_ value + 1 */
207 #define WTAP_NUM_FILE_TYPES                     40
208
209 /*
210  * Maximum packet size we'll support.
211  * It must be at least 65535.
212  */
213 #define WTAP_MAX_PACKET_SIZE                    65535
214
215 /*
216  * "Pseudo-headers" are used to supply to the clients of wiretap
217  * per-packet information that's not part of the packet payload
218  * proper.
219  *
220  * NOTE: do not use pseudo-header structures to hold information
221  * used by the code to read a particular capture file type; to
222  * keep that sort of state information, add a new structure for
223  * that private information to "wtap-int.h", add a pointer to that
224  * type of structure to the "capture" member of the "struct wtap"
225  * structure, and allocate one of those structures and set that member
226  * in the "open" routine for that capture file type if the open
227  * succeeds.  See various other capture file type handlers for examples
228  * of that.
229  */
230
231 /* Packet "pseudo-header" information for Ethernet capture files. */
232 struct eth_phdr {
233         gint    fcs_len;        /* Number of bytes of FCS - -1 means "unknown" */
234 };
235
236 /* Packet "pseudo-header" information for X.25 capture files. */
237 #define FROM_DCE                        0x80
238 struct x25_phdr {
239         guint8  flags; /* ENCAP_LAPB, ENCAP_V120 : 1st bit means From DCE */
240 };
241
242 /* Packet "pseudo-header" information for ISDN capture files. */
243
244 /* Direction */
245 struct isdn_phdr {
246         gboolean uton;
247         guint8  channel;                /* 0 = D-channel; n = B-channel n */
248 };
249
250 /* Packet "pseudo-header" for ATM capture files.
251    Not all of this information is supplied by all capture types. */
252
253 /*
254  * Status bits.
255  */
256 #define ATM_RAW_CELL    0x01    /* TRUE if the packet is a single cell */
257
258 /*
259  * AAL types.
260  */
261 #define AAL_UNKNOWN     0       /* AAL unknown */
262 #define AAL_1           1       /* AAL1 */
263 #define AAL_2           2       /* AAL2 */
264 #define AAL_3_4         3       /* AAL3/4 */
265 #define AAL_5           4       /* AAL5 */
266 #define AAL_USER        5       /* User AAL */
267 #define AAL_SIGNALLING  6       /* Signaling AAL */
268 #define AAL_OAMCELL     7       /* OAM cell */
269
270 /*
271  * Traffic types.
272  */
273 #define TRAF_UNKNOWN    0       /* Unknown */
274 #define TRAF_LLCMX      1       /* LLC multiplexed (RFC 1483) */
275 #define TRAF_VCMX       2       /* VC multiplexed (RFC 1483) */
276 #define TRAF_LANE       3       /* LAN Emulation */
277 #define TRAF_ILMI       4       /* ILMI */
278 #define TRAF_FR         5       /* Frame Relay */
279 #define TRAF_SPANS      6       /* FORE SPANS */
280 #define TRAF_IPSILON    7       /* Ipsilon */
281
282 /*
283  * Traffic subtypes.
284  */
285 #define TRAF_ST_UNKNOWN         0       /* Unknown */
286
287 /*
288  * For TRAF_VCMX:
289  */
290 #define TRAF_ST_VCMX_802_3_FCS  1       /* 802.3 with an FCS */
291 #define TRAF_ST_VCMX_802_4_FCS  2       /* 802.4 with an FCS */
292 #define TRAF_ST_VCMX_802_5_FCS  3       /* 802.5 with an FCS */
293 #define TRAF_ST_VCMX_FDDI_FCS   4       /* FDDI with an FCS */
294 #define TRAF_ST_VCMX_802_6_FCS  5       /* 802.6 with an FCS */
295 #define TRAF_ST_VCMX_802_3      7       /* 802.3 without an FCS */
296 #define TRAF_ST_VCMX_802_4      8       /* 802.4 without an FCS */
297 #define TRAF_ST_VCMX_802_5      9       /* 802.5 without an FCS */
298 #define TRAF_ST_VCMX_FDDI       10      /* FDDI without an FCS */
299 #define TRAF_ST_VCMX_802_6      11      /* 802.6 without an FCS */
300 #define TRAF_ST_VCMX_FRAGMENTS  12      /* Fragments */
301 #define TRAF_ST_VCMX_BPDU       13      /* BPDU */
302
303 /*
304  * For TRAF_LANE:
305  */
306 #define TRAF_ST_LANE_LE_CTRL    1       /* LANE: LE Ctrl */
307 #define TRAF_ST_LANE_802_3      2       /* LANE: 802.3 */
308 #define TRAF_ST_LANE_802_5      3       /* LANE: 802.5 */
309 #define TRAF_ST_LANE_802_3_MC   4       /* LANE: 802.3 multicast */
310 #define TRAF_ST_LANE_802_5_MC   5       /* LANE: 802.5 multicast */
311
312 /*
313  * For TRAF_IPSILON:
314  */
315 #define TRAF_ST_IPSILON_FT0     1       /* Ipsilon: Flow Type 0 */
316 #define TRAF_ST_IPSILON_FT1     2       /* Ipsilon: Flow Type 1 */
317 #define TRAF_ST_IPSILON_FT2     3       /* Ipsilon: Flow Type 2 */
318
319 struct atm_phdr {
320         guint32 flags;          /* status flags */
321         guint8  aal;            /* AAL of the traffic */
322         guint8  type;           /* traffic type */
323         guint8  subtype;        /* traffic subtype */
324         guint16 vpi;            /* virtual path identifier */
325         guint16 vci;            /* virtual circuit identifier */
326         guint16 channel;        /* link: 0 for DTE->DCE, 1 for DCE->DTE */
327         guint16 cells;          /* number of cells */
328         guint16 aal5t_u2u;      /* user-to-user indicator */
329         guint16 aal5t_len;      /* length of the packet */
330         guint32 aal5t_chksum;   /* checksum for AAL5 packet */
331 };
332
333 /* Packet "pseudo-header" for the output from "wandsession", "wannext",
334    "wandisplay", and similar commands on Lucent/Ascend access equipment. */
335
336 #define ASCEND_MAX_STR_LEN 64
337
338 #define ASCEND_PFX_WDS_X 1
339 #define ASCEND_PFX_WDS_R 2
340 #define ASCEND_PFX_WDD   3
341
342 struct ascend_phdr {
343         guint16 type;                   /* ASCEND_PFX_*, as defined above */
344         char    user[ASCEND_MAX_STR_LEN];   /* Username, from wandsession header */
345         guint32 sess;                   /* Session number, from wandsession header */
346         char    call_num[ASCEND_MAX_STR_LEN];   /* Called number, from WDD header */
347         guint32 chunk;                  /* Chunk number, from WDD header */
348         guint32 task;                   /* Task number */
349 };
350
351 /* Packet "pseudo-header" for point-to-point links with direction flags. */
352 struct p2p_phdr {
353         gboolean        sent; /* TRUE=sent, FALSE=received */
354 };
355
356 /* Packet "pseudo-header" information for 802.11
357    Radio information is only present for WTAP_ENCAP_IEEE_802_11_WITH_RADIO. */
358 struct ieee_802_11_phdr {
359         gint    fcs_len;        /* Number of bytes of FCS - -1 means "unknown" */
360         guint8  channel;        /* Channel number */
361         guint8  data_rate;      /* in .5 Mb/s units */
362         guint8  signal_level;   /* percentage */
363 };
364
365 /* Packet "pseudo-header" for the output from CoSine L2 debug output. */
366
367 #define COSINE_MAX_IF_NAME_LEN  128
368
369 #define COSINE_ENCAP_TEST       1
370 #define COSINE_ENCAP_PPoATM     2
371 #define COSINE_ENCAP_PPoFR      3
372 #define COSINE_ENCAP_ATM        4
373 #define COSINE_ENCAP_FR         5
374 #define COSINE_ENCAP_HDLC       6
375 #define COSINE_ENCAP_PPP        7
376 #define COSINE_ENCAP_ETH        8
377 #define COSINE_ENCAP_UNKNOWN    99
378
379 #define COSINE_DIR_TX 1
380 #define COSINE_DIR_RX 2
381
382 struct cosine_phdr {
383         guint8 encap;           /* COSINE_ENCAP_* as defined above */
384         guint8 direction;       /* COSINE_DIR_*, as defined above */
385         char if_name[COSINE_MAX_IF_NAME_LEN];  /* Encap & Logical I/F name */
386         guint16 pro;            /* Protocol */
387         guint16 off;            /* Offset */
388         guint16 pri;            /* Priority */
389         guint16 rm;             /* Rate Marking */
390         guint16 err;            /* Error Code */
391 };
392
393 /* Packet "pseudo-header" for IrDA capture files. */
394
395 /*
396  * Direction of the packet
397  */
398 #define IRDA_INCOMING       0x0000
399 #define IRDA_OUTGOING       0x0004
400
401 /*
402  * "Inline" log messages produced by IrCOMM2k on Windows
403  */
404 #define IRDA_LOG_MESSAGE    0x0100  /* log message */
405 #define IRDA_MISSED_MSG     0x0101  /* missed log entry or frame */
406
407 /*
408  * Differentiate between frames and log messages
409  */
410 #define IRDA_CLASS_FRAME    0x0000
411 #define IRDA_CLASS_LOG      0x0100
412 #define IRDA_CLASS_MASK     0xFF00
413
414 struct irda_phdr {
415         guint16 pkttype;    /* packet type */
416 };
417
418 union wtap_pseudo_header {
419         struct eth_phdr         eth;
420         struct x25_phdr         x25;
421         struct isdn_phdr        isdn;
422         struct atm_phdr         atm;
423         struct ascend_phdr      ascend;
424         struct p2p_phdr         p2p;
425         struct ieee_802_11_phdr ieee_802_11;
426         struct cosine_phdr      cosine;
427         struct irda_phdr        irda;
428 };
429
430 struct wtap_pkthdr {
431         struct timeval ts;
432         guint32 caplen;
433         guint32 len;
434         int pkt_encap;
435 };
436
437 typedef void (*wtap_handler)(guchar*, const struct wtap_pkthdr*,
438                 long, union wtap_pseudo_header *pseudo_header, const guchar *);
439
440 struct wtap;
441 struct Buffer;
442 struct wtap_dumper;
443
444 typedef struct wtap wtap;
445 typedef struct wtap_dumper wtap_dumper;
446
447 /*
448  * On failure, "wtap_open_offline()" returns NULL, and puts into the
449  * "int" pointed to by its second argument:
450  *
451  * a positive "errno" value if the capture file can't be opened;
452  *
453  * a negative number, indicating the type of error, on other failures.
454  */
455 struct wtap* wtap_open_offline(const char *filename, int *err,
456     gchar **err_info, gboolean do_random);
457
458 /* Returns TRUE if entire loop-reading was successful. If read failure
459  * happened, FALSE is returned and err is set. */
460 gboolean wtap_loop(wtap *wth, int, wtap_handler, guchar*, int *err,
461     gchar **err_info);
462
463 /* Returns TRUE if read was successful. FALSE if failure. data_offset is
464  * set the the offset in the file where the data for the read packet is
465  * located. */
466 gboolean wtap_read(wtap *wth, int *err, gchar **err_info,
467     long *data_offset);
468
469 struct wtap_pkthdr *wtap_phdr(wtap *wth);
470 union wtap_pseudo_header *wtap_pseudoheader(wtap *wth);
471 guint8 *wtap_buf_ptr(wtap *wth);
472
473 int wtap_fd(wtap *wth);
474 int wtap_snapshot_length(wtap *wth); /* per file */
475 int wtap_file_type(wtap *wth);
476 int wtap_file_encap(wtap *wth);
477
478 const char *wtap_file_type_string(int filetype);
479 const char *wtap_file_type_short_string(int filetype);
480 int wtap_short_string_to_file_type(const char *short_name);
481
482 const char *wtap_encap_string(int encap);
483 const char *wtap_encap_short_string(int encap);
484 int wtap_short_string_to_encap(const char *short_name);
485
486 const char *wtap_strerror(int err);
487 void wtap_sequential_close(wtap *wth);
488 void wtap_close(wtap *wth);
489 gboolean wtap_seek_read (wtap *wth, long seek_off,
490         union wtap_pseudo_header *pseudo_header, guint8 *pd, int len,
491         int *err, gchar **err_info);
492
493 gboolean wtap_dump_can_open(int filetype);
494 gboolean wtap_dump_can_write_encap(int filetype, int encap);
495 wtap_dumper* wtap_dump_open(const char *filename, int filetype, int encap,
496         int snaplen, int *err);
497 wtap_dumper* wtap_dump_fdopen(int fd, int filetype, int encap, int snaplen,
498         int *err);
499 gboolean wtap_dump(wtap_dumper *, const struct wtap_pkthdr *,
500         const union wtap_pseudo_header *pseudo_header, const guchar *, int *err);
501 FILE* wtap_dump_file(wtap_dumper *);
502 gboolean wtap_dump_close(wtap_dumper *, int *);
503 long wtap_get_bytes_dumped(wtap_dumper *);
504 void wtap_set_bytes_dumped(wtap_dumper *wdh, long bytes_dumped);
505
506 /*
507  * Wiretap error codes.
508  */
509 #define WTAP_ERR_NOT_REGULAR_FILE               -1
510         /* The file being opened for reading isn't a plain file (or pipe) */
511 #define WTAP_ERR_RANDOM_OPEN_PIPE               -2
512         /* The file is being opened for random access and it's a pipe */
513 #define WTAP_ERR_FILE_UNKNOWN_FORMAT            -3
514         /* The file being opened is not a capture file in a known format */
515 #define WTAP_ERR_UNSUPPORTED                    -4
516         /* Supported file type, but there's something in the file we
517            can't support */
518 #define WTAP_ERR_CANT_WRITE_TO_PIPE             -5
519         /* Wiretap can't save to a pipe in the specified format */
520 #define WTAP_ERR_CANT_OPEN                      -6
521         /* The file couldn't be opened, reason unknown */
522 #define WTAP_ERR_UNSUPPORTED_FILE_TYPE          -7
523         /* Wiretap can't save files in the specified format */
524 #define WTAP_ERR_UNSUPPORTED_ENCAP              -8
525         /* Wiretap can't read or save files in the specified format with the
526            specified encapsulation */
527 #define WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED   -9
528         /* The specified format doesn't support per-packet encapsulations */
529 #define WTAP_ERR_CANT_CLOSE                     -10
530         /* The file couldn't be closed, reason unknown */
531 #define WTAP_ERR_CANT_READ                      -11
532         /* An attempt to read failed, reason unknown */
533 #define WTAP_ERR_SHORT_READ                     -12
534         /* An attempt to read read less data than it should have */
535 #define WTAP_ERR_BAD_RECORD                     -13
536         /* We read an invalid record */
537 #define WTAP_ERR_SHORT_WRITE                    -14
538         /* An attempt to write wrote less data than it should have */
539 #define WTAP_ERR_UNC_TRUNCATED                  -15
540         /* Sniffer compressed data was oddly truncated */
541 #define WTAP_ERR_UNC_OVERFLOW                   -16
542         /* Uncompressing Sniffer data would overflow buffer */
543 #define WTAP_ERR_UNC_BAD_OFFSET                 -17
544         /* LZ77 compressed data has bad offset to string */
545
546 /* Errors from zlib; zlib error Z_xxx turns into Wiretap error
547    WTAP_ERR_ZLIB + Z_xxx.
548
549    WTAP_ERR_ZLIB_MIN and WTAP_ERR_ZLIB_MAX bound the range of zlib
550    errors; we leave room for 100 positive and 100 negative error
551    codes. */
552
553 #define WTAP_ERR_ZLIB                           -200
554 #define WTAP_ERR_ZLIB_MAX                       -100
555 #define WTAP_ERR_ZLIB_MIN                       -300
556
557
558 #endif /* __WTAP_H__ */