3 * Copyright (c) 2003 Endace Technology Ltd, Hamilton, New Zealand.
6 * This software and documentation has been developed by Endace Technology Ltd.
7 * along with the DAG PCI network capture cards. For further information please
8 * visit http://www.endace.com/.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
20 * 3. The name of Endace Technology Ltd may not be used to endorse or promote
21 * products derived from this software without specific prior written
24 * THIS SOFTWARE IS PROVIDED BY ENDACE TECHNOLOGY LTD ``AS IS'' AND ANY EXPRESS
25 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
27 * EVENT SHALL ENDACE TECHNOLOGY LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
31 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
41 /* Record type defines */
43 #define TYPE_HDLC_POS 1
47 #define TYPE_MC_HDLC 5
50 #define TYPE_MC_RAW_CHANNEL 8
51 #define TYPE_MC_AAL5 9
52 #define TYPE_COLOR_HDLC_POS 10
53 #define TYPE_COLOR_ETH 11
54 #define TYPE_MC_AAL2 12
55 #define TYPE_IP_COUNTER 13
56 #define TYPE_TCP_FLOW_COUNTER 14
57 #define TYPE_DSM_COLOR_HDLC_POS 15
58 #define TYPE_DSM_COLOR_ETH 16
59 #define TYPE_COLOR_MC_HDLC_POS 17
64 #define TYPE_MIN 1 /* sanity checking */
65 #define TYPE_MAX 48 /* sanity checking */
68 * The timestamp is 64bit unsigned fixed point little-endian value with
69 * 32 bits for second and 32 bits for fraction.
71 typedef guint64 erf_timestamp_t;
73 typedef struct erf_record {
82 #define MAX_RECORD_LEN 0x10000 /* 64k */
83 #define RECORDS_FOR_ERF_CHECK 3
87 #define min(a, b) ((a) > (b) ? (b) : (a))
93 #define ATM_SNAPLEN 48
98 #define ATM_SLEN(h, e) ATM_SNAPLEN
99 #define ATM_WLEN(h, e) ATM_SNAPLEN
102 * Size of Ethernet payload
104 #define ETHERNET_WLEN(h, e) (g_htons((h)->wlen))
105 #define ETHERNET_SLEN(h, e) min(ETHERNET_WLEN(h, e), g_htons((h)->rlen) - sizeof(*(h)) - 2)
108 * Size of HDLC payload
110 #define HDLC_WLEN(h, e) (g_htons((h)->wlen))
111 #define HDLC_SLEN(h, e) min(HDLC_WLEN(h, e), g_htons((h)->rlen) - sizeof(*(h)))
114 * Size of MC_HDLC payload
116 #define MC_HDLC_WLEN(h, e) (g_htons((h)->wlen))
117 #define MC_HDLC_SLEN(h, e) min(MC_HDLC_WLEN(h, e), g_htons((h)->rlen) - sizeof(*(h)) )
119 int erf_open(wtap *wth, int *err, gchar **err_info);
121 #endif /* __W_ERF_H__ */