1
/*
2
 * Copyright (c) 2006  Dustin Sallings
3
 */
4
5
#ifndef MULTISNIFF_H
6
#define MULTISNIFF_H 1
7
8
#define FLAG_BIT(a)    (1<<a)
9
#define FLAG_PROMISC 0
10
#define FLAG_FLUSH 1
11
12
#define DEFAULT_CLEANUP_INTERVAL 5
13
14
#define FILENAME_MAXLEN 64
15
16
/* Maximum number of seconds we'll hold a pcap file open. */
17
#define DEFAULT_MAX_PKT_AGE 60
18
19
#define HASH_SIZE 637
20
21
struct cleanupConfig {
22
    int maxAge;
23
    int refreshTime;
24
};
25
26
void process(int flags, const char *intf,
27
             struct cleanupConfig conf, const char *outdir, char *filter);
28
char *ntoa(int);
29
30
/* This stuff was basically stolen from tcpdump */
31
#define ETHER_ADDR_LEN 6
32
struct ether_header {
33
    u_int8_t    ether_dhost[ETHER_ADDR_LEN];
34
    u_int8_t    ether_shost[ETHER_ADDR_LEN];
35
    u_int16_t   ether_type;
36
};
37
38
/* We primarily care about IP.  Everything else goes into a common bucket */
39
#define ETHERTYPE_IP 0x0800
40
41
#endif /* MULTISNIFF_H */