iftop.h 920 Bytes
Newer Older
pdw's avatar
pdw committed
1 2 3 4 5 6 7 8
/*
 * iftop.h:
 *
 */

#ifndef __IFTOP_H_ /* include guard */
#define __IFTOP_H_

chris's avatar
chris committed
9 10
#include "config.h"

11
/* 40 / 2  */
pdw's avatar
pdw committed
12
#define HISTORY_LENGTH  20
pdw's avatar
pdw committed
13
#define RESOLUTION 2
pdw's avatar
pdw committed
14
#define DUMP_RESOLUTION 300
pdw's avatar
pdw committed
15 16 17 18

typedef struct {
    long recv[HISTORY_LENGTH];
    long sent[HISTORY_LENGTH];
19 20
    double long total_sent;
    double long total_recv;
pdw's avatar
pdw committed
21 22 23
    int last_write;
} history_type;

pdw's avatar
pdw committed
24
void tick(int print);
pdw's avatar
pdw committed
25

chris's avatar
chris committed
26 27 28 29 30 31
void *xmalloc(size_t n);
void *xcalloc(size_t n, size_t m);
void *xrealloc(void *w, size_t n);
char *xstrdup(const char *s);
void xfree(void *v);

chris's avatar
chris committed
32 33 34
/* options.c */
void options_read(int argc, char **argv);

35 36 37 38 39 40 41 42 43 44 45 46
struct pfloghdr {
      unsigned char		length;
      unsigned char		af;
      unsigned char		action;
      unsigned char		reason;
      char				ifname[16];
      char				ruleset[16];
      unsigned int		rulenr;
      unsigned int		subrulenr;
      unsigned char		dir;
      unsigned char		pad[3];
};
47

pdw's avatar
pdw committed
48
#endif /* __IFTOP_H_ */