2 * copyright (c) 2001-2007 Emil Mikulic.
4 * decode.h: packet decoding.
6 * You may use, modify and redistribute this file under the terms of the
7 * GNU General Public License version 2. (see COPYING.GPL)
11 #include <netinet/in.h> /* in_addr_t */
14 #define FDDI_HDR_LEN 21
16 #define TCP_HDR_LEN 20
18 #define NULL_HDR_LEN 4
19 #define PPPOE_HDR_LEN 8
20 #define SLL_HDR_LEN 16
23 #ifndef ETHER_ADDR_LEN
24 #define ETHER_ADDR_LEN 6
33 const linkhdr_t
*getlinkhdr(int linktype
);
34 int getcaplen(const linkhdr_t
*lh
);
35 char *ip_to_str(const in_addr_t ip
);
38 /* Fields are in host byte order (except IPs) */
39 in_addr_t src_ip
, dest_ip
;
42 uint8_t proto
; /* IPPROTO_{TCP, UDP, ICMP} */
43 uint8_t tcp_flags
; /* only for TCP */
44 uint16_t src_port
, dest_port
; /* only for TCP, UDP */
45 uint8_t src_mac
[ETHER_ADDR_LEN
],
46 dst_mac
[ETHER_ADDR_LEN
]; /* only for Ethernet */
49 /* vim:set ts=3 sw=3 tw=78 expandtab: */