-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiftop.h
79 lines (64 loc) · 1.61 KB
/
iftop.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
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
71
72
73
74
75
76
77
78
79
/*
* iftop.h:
*
*/
#ifndef __IFTOP_H_ /* include guard */
#define __IFTOP_H_
#include "config.h"
#include <time.h>
/* 40 / 2 */
#define HISTORY_LENGTH 20
#define RESOLUTION 4
#define DUMP_RESOLUTION 300
//2017.01.21
#define PORT_LIST_LEN 10
//2017.05.26
#define CHECK_AFTER_N_SECS 120
//2017.06.4
#define SWITCH 1
#define NOTSWITCH 0
//2017.06.10
#define ROUTER_ADDR 524292268u // Integer IP of 172.16.64.31
/* At least OpenBSD and NexentaCore do not
* define s6_addr32 for user land settings.
*/
#if !defined s6_addr32 && defined __sun__
# define s6_addr32 _S6_un._S6_u32
#elif !defined s6_addr32 && \
( defined __OpenBSD__ || defined __FreeBSD__ )
# define s6_addr32 __u6_addr.__u6_addr32
#endif /* !defined s6_addr32 */
typedef struct {
//long recv[HISTORY_LENGTH];
//long sent[HISTORY_LENGTH];
unsigned long long total_sent;
unsigned long long total_recv;
//-------------------------
//unsigned long long last_total;
time_t create_time;
time_t last_update_time;
//-------------------------
int approval;
//int last_write;
} history_type;
void tick(int send, time_t t);
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);
/* options.c */
void options_read(int argc, char **argv);
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];
};
#endif /* __IFTOP_H_ */