File: ngrep.h

package info (click to toggle)
ngrep 1.43-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,776 kB
  • ctags: 1,246
  • sloc: ansic: 28,753; sh: 10,488; makefile: 487; perl: 192
file content (70 lines) | stat: -rw-r--r-- 1,488 bytes parent folder | download
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * $Id: ngrep.h,v 1.25 2005/02/20 05:54:13 jpr5 Exp $
 *
 * Copyright (c) 2005  Jordan Ritter <jpr5@darkridge.com>
 *
 * Please refer to the LICENSE file for more information.
 *
 */

#define VERSION "1.43"

#define ETHHDR_SIZE 14
#define TOKENRING_SIZE 22
#define PPPHDR_SIZE 4
#define SLIPHDR_SIZE 16
#define RAWHDR_SIZE 0
#define LOOPHDR_SIZE 4
#define FDDIHDR_SIZE 21
#define ISDNHDR_SIZE 16
#define IEEE80211HDR_SIZE 32

#ifndef IP_OFFMASK
#define IP_OFFMASK 0x1fff
#endif

#define WORD_REGEX "((^%s\\W)|(\\W%s$)|(\\W%s\\W))"
#define IP_ONLY "ip and ( %s)"

#ifndef TH_ECE
#define TH_ECE 0x40
#endif

#ifndef TH_CWR
#define TH_CWR 0x80
#endif

void process(u_char *, struct pcap_pkthdr*, u_char *);
void clean_exit(int);
void usage(int);
void version(void);

char *get_filter_from_string(char *);
char *get_filter_from_argv(char **);

int re_match_func(char *, unsigned);
int bin_match_func(char *, unsigned);
int blank_match_func(char *, unsigned);

void dump_unwrapped(char *, unsigned);
void dump_byline(char *, unsigned);
void dump_formatted(char *, unsigned);

int strishex(char *);

void print_time_absolute(struct pcap_pkthdr *);
void print_time_diff(struct pcap_pkthdr *);

void dump_delay_proc_init(struct pcap_pkthdr *);
void dump_delay_proc(struct pcap_pkthdr *);

#if !defined(_WIN32)
void update_windowsize(int);
void drop_privs(void);
#endif

#if defined(_WIN32)
int win32_initwinsock(void);
void win32_listdevices(void);
char *win32_usedevice(const char *);
#endif