"Fossies" - the Fresh Open Source Software Archive

Member "etherape-0.9.18/src/appdata.h" (14 Apr 2018, 2972 Bytes) of package /linux/privat/etherape-0.9.18.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "appdata.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 0.9.17_vs_0.9.18.

    1 /* EtherApe
    2  * Copyright (C) 2001 Juan Toledo, Riccardo Ghetta
    3  *
    4  * This program is free software; you can redistribute it and/or modify
    5  * it under the terms of the GNU General Public License as published by
    6  * the Free Software Foundation; either version 2 of the License, or
    7  * (at your option) any later version.
    8  *
    9  * This program is distributed in the hope that it will be useful,
   10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12  * GNU General Public License for more details.
   13  *
   14  * You should have received a copy of the GNU General Public License
   15  * along with this program; if not, see <http://www.gnu.org/licenses/>.
   16  */
   17  
   18 #ifndef ETHERAPE_GLOBALS_H
   19 #define ETHERAPE_GLOBALS_H
   20 
   21 #include "common.h"
   22 #include <glib/gprintf.h>
   23 #include <gtk/gtk.h>
   24 
   25 /* Variables */
   26 
   27 struct appdata_struct
   28 {
   29   GtkBuilder *xml;
   30   GtkWidget *app1;      /* Pointer to the main app window */
   31   GtkStatusbar *statusbar;        /* Main window statusbar */
   32 
   33   /* These two are different for offline (file-based) capture/replay */
   34   struct timeval now; /* Where in packet-capture time we are */
   35   struct timeval gui_now; /* Real (as in wall-clock gettimeofday()) time */
   36 
   37   gchar *itf_file;            /* fullspec of xml glade file */
   38   gchar *export_file;       /* file to export to */
   39   gchar *export_file_final;     /* file to export to at end of replay */
   40   gchar *export_file_signal;    /* file to export to at receipt of usr1 */
   41   apemode_t mode;       /* Mode of operation. Can be
   42                  * T.RING/FDDI/ETHERNET, IP or TCP */
   43 
   44   gint node_limit;      /* Max number of nodes to show. If <0 it's not
   45                  * limited */
   46 
   47   struct
   48   {
   49     enum { ST_FILE, ST_LIVE, } type;
   50     union
   51     {
   52       gchar *interface; /* Network interface to listen to */
   53       gchar *file;      /* Capture file to read from */
   54     };
   55   } source;
   56 
   57   GLogLevelFlags debug_mask;    /* debug mask active */
   58 
   59   gulong min_delay;    /* min packet distance when replaying a file */
   60   gulong max_delay;    /* max packet distance when replaying a file */
   61   gboolean stationary_layout;   /* if true, use stationary layout */
   62 
   63   unsigned long n_packets;  /* Number of total packets received */
   64   glong total_mem_packets;      /* Number of packets currently in memory */
   65   gboolean request_dump;        /* if true, do an xml dump */
   66 
   67   GPtrArray *column_patterns; /* Node-matching patterns for columnar-layout mode (-P flag) */
   68 };
   69 
   70 extern struct appdata_struct appdata;
   71 
   72 #define DEBUG_ENABLED  (appdata.debug_mask & G_LOG_LEVEL_DEBUG)
   73 #define INFO_ENABLED  (appdata.debug_mask & G_LOG_LEVEL_INFO)
   74 
   75 void appdata_init(struct appdata_struct *p);
   76 void appdata_clear_source(struct appdata_struct *p);
   77 gboolean appdata_init_builder(const gchar *builder_fname);
   78 void appdata_free(struct appdata_struct *p);
   79 
   80 static inline gchar *appdata_source_name(const struct appdata_struct *p)
   81 {
   82   return p->source.type == ST_LIVE ? p->source.interface : p->source.file;
   83 }
   84 
   85 #endif