File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / iftop / options.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Oct 18 14:04:50 2016 UTC (7 years, 8 months ago) by misho
Branches: iftop, MAIN
CVS tags: v1_0rc4, HEAD
iftop 1.0pre4

    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 timed_output;
   60:     int no_curses;
   61:     int num_lines;
   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: 
   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: 
   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);
   99: void options_read_args(int argc, char **argv);
  100: void options_make();
  101: 
  102: #endif /* __OPTIONS_H_ */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>