-
Notifications
You must be signed in to change notification settings - Fork 0
/
pcap_routines.h
42 lines (34 loc) · 1.15 KB
/
pcap_routines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* =====================================================================================
*
* Filename: pcap_routines.h
*
* Description: methods headers
*
* Version: 1.0
* Created: 12/22/2014 12:00:06 PM
* Revision: none
* Compiler: gcc
*
* Author: nikkolasg (mn),
* Company:
*
* =====================================================================================
*/
#ifndef PCAP_ROUTINES
#define PCAP_ROUTINES
#include <pcap.h>
/* Function pointer to set to receive ARP packets */
typedef void (*Packet_analyzer) (const u_char * packet,size_t size);
void pcap_exit_(void); //signal handler SIGINT
void sniff_callback(u_char * user, const struct pcap_pkthdr * h,const u_char * bytes) ;
int set_options(pcap_t * handle);
int activate(pcap_t * handle) ;
int sniffing_method(char * interface, char * filter,int packet_count) ;
int pcap_send_packet(const u_char * bytes,int size);
int pcap_init(char * interface, char * filter);
void pcap_exit_(void);
void pcap_sniff(int pcount);
void pcap_set_arp_analyzer ( Packet_analyzer arp );
void pcap_set_ip_analyzer ( Packet_analyzer ip );
#endif