/*
 * author: Darren Bounds <dbounds@intrusense.com>
 * copyright: Copyright (C) 2002 by Darren Bounds
 * license: This software is under GPL version 2 of license
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * packit official page at http://packit.sourceforge.net
 */

#include <netdb.h>

#define READ_TIMEOUT            500
#define SNAP_LEN_DEFAULT        68

short display;
short link_layer;
short dump_packet;
short resolve;
short resolve_host;
short resolve_port;
short time_gmt;

unsigned short traffic_reset;
unsigned short snap_len;

char *reset_mode;
char write_filename[MAX_CMDOPT_LEN];
char read_filename[MAX_CMDOPT_LEN];

#ifndef _CAPTURE_FUNC
#define _CAPTURE_FUNC

int    reset_tcp_stream(unsigned char *packet, struct libnet_ipv4_hdr *iphdr);
int    reset_udp_stream(unsigned char *packet, struct libnet_ipv4_hdr *iphdr);
int    retrieve_tcp_flags();
unsigned char * retrieve_arp_type(unsigned short optype);
unsigned char * retrieve_icmp_type(unsigned short type);
unsigned char * retrieve_icmp_code(unsigned short type, unsigned short code);
void   capture_clean_exit(int sig);
void   capture_stats();
void   process_packets(unsigned char *user, struct pcap_pkthdr *pkthdr, unsigned char *packet); 
void   print_timestamp(struct pcap_pkthdr *pkthdr);
void   print_packet_hexdump(unsigned char *packet, int header_len);
void   print_arp_hdr(unsigned char *packet);
void   print_tcp_hdr(unsigned char *packet); 
void   print_udp_hdr(unsigned char *packet); 
void   print_icmpv4_hdr(unsigned char *packet); 
void   print_ipv4_hdr(struct libnet_ipv4_hdr *iphdr);
void   print_ethernet_hdr(struct libnet_ethernet_hdr *enet);
void   print_separator(unsigned int p_count);

#endif /* _CAPTURE_FUNC */
