]> gitweb.fperrin.net Git - iftop.git/blob - options.h
01232855ba8a2613c8186e290519ecf6b7aa8b0e
[iftop.git] / options.h
1 /*
2  * options.h:
3  *
4  */
5
6 #ifndef __OPTIONS_H_ /* include guard */
7 #define __OPTIONS_H_
8
9 #include <sys/types.h>
10 #include <sys/socket.h>
11 #include <netinet/in.h>
12 #include <arpa/inet.h>
13
14
15 typedef enum {
16   OPTION_PORTS_OFF,
17   OPTION_PORTS_SRC,
18   OPTION_PORTS_DEST,
19   OPTION_PORTS_ON
20 } option_port_t;
21
22 typedef enum {
23   OPTION_SORT_DIV1,
24   OPTION_SORT_DIV2,
25   OPTION_SORT_DIV3,
26   OPTION_SORT_SRC,
27   OPTION_SORT_DEST
28 } option_sort_t;
29
30 typedef enum {
31   OPTION_LINEDISPLAY_TWO_LINE,
32   OPTION_LINEDISPLAY_ONE_LINE_BOTH,
33   OPTION_LINEDISPLAY_ONE_LINE_RECV,
34   OPTION_LINEDISPLAY_ONE_LINE_SENT
35 } option_linedisplay_t;
36
37 /* 
38  * This structure has to be defined in the same order as the config 
39  * directives in cfgfile.c.  Clearly this is EBW.
40  */
41 typedef struct {
42     /* interface on which to listen */
43     char *interface;
44
45     int dnsresolution;
46     int portresolution;
47     /* pcap filter code */
48     char *filtercode;
49
50     int showbars;
51     option_port_t showports;
52
53     int promiscuous;
54     int promiscuous_but_choosy;
55     int aggregate_src;
56     int aggregate_dest;
57     int paused;
58     int showhelp;
59     int bandwidth_in_bytes;
60     option_sort_t sort;
61
62     int bar_interval;
63
64     char* screenfilter;
65     int freezeorder;
66
67     int screen_offset;
68
69     option_linedisplay_t linedisplay;
70
71     int show_totals;
72
73     long long max_bandwidth;
74     int log_scale;
75
76     /* Cross network filter */
77     int netfilter;
78     struct in_addr netfilternet;
79     struct in_addr netfiltermask;
80
81     int netfilter6;
82     struct in6_addr netfilter6net;
83     struct in6_addr netfilter6mask;
84
85     /* Account for link-local traffic. */
86     int link_local;
87
88     char *config_file;
89     int config_file_specified;
90
91 } options_t;
92
93
94 void options_set_defaults();
95 void options_read(int argc, char **argv);
96
97 #endif /* __OPTIONS_H_ */