]> gitweb.fperrin.net Git - iftop.git/blob - iftop.h
Import de iftop-1.0pre1
[iftop.git] / iftop.h
1 /*
2  * iftop.h:
3  *
4  */
5
6 #ifndef __IFTOP_H_ /* include guard */
7 #define __IFTOP_H_
8
9 #include "config.h"
10
11 /* 40 / 2  */
12 #define HISTORY_LENGTH  20
13 #define RESOLUTION 2
14 #define DUMP_RESOLUTION 300
15
16 typedef struct {
17     long recv[HISTORY_LENGTH];
18     long sent[HISTORY_LENGTH];
19     double long total_sent;
20     double long total_recv;
21     int last_write;
22 } history_type;
23
24 void tick(int print);
25
26 void *xmalloc(size_t n);
27 void *xcalloc(size_t n, size_t m);
28 void *xrealloc(void *w, size_t n);
29 char *xstrdup(const char *s);
30 void xfree(void *v);
31
32 /* options.c */
33 void options_read(int argc, char **argv);
34
35 struct pfloghdr {
36       unsigned char             length;
37       unsigned char             af;
38       unsigned char             action;
39       unsigned char             reason;
40       char                              ifname[16];
41       char                              ruleset[16];
42       unsigned int              rulenr;
43       unsigned int              subrulenr;
44       unsigned char             dir;
45       unsigned char             pad[3];
46 };
47
48 #endif /* __IFTOP_H_ */