Annotation of embedaddon/iftop/options.h, revision 1.1.1.2
1.1 misho 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;
1.1.1.2 ! misho 59: int timed_output;
! 60: int no_curses;
! 61: int num_lines;
1.1 misho 62: int bandwidth_in_bytes;
63: option_sort_t sort;
64:
65: int bar_interval;
66:
67: char* screenfilter;
68: int freezeorder;
69:
70: int screen_offset;
71:
72: option_linedisplay_t linedisplay;
73:
74: int show_totals;
75:
76: long long max_bandwidth;
77: int log_scale;
78:
79: /* Cross network filter */
80: int netfilter;
81: struct in_addr netfilternet;
82: struct in_addr netfiltermask;
83:
1.1.1.2 ! misho 84: int netfilter6;
! 85: struct in6_addr netfilter6net;
! 86: struct in6_addr netfilter6mask;
! 87:
! 88: /* Account for link-local traffic. */
! 89: int link_local;
! 90:
1.1 misho 91: char *config_file;
92: int config_file_specified;
93:
94: } options_t;
95:
96:
97: void options_set_defaults();
98: void options_read(int argc, char **argv);
1.1.1.2 ! misho 99: void options_read_args(int argc, char **argv);
! 100: void options_make();
1.1 misho 101:
102: #endif /* __OPTIONS_H_ */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>