Merge of 0.13 changes and implof ipv6 support for configuration
[jnettop.git] / jnettop / jconfig.h
blob3f650e7e2078c15e9b179e1025df6ad1a481fc93
1 /*
2 * jnettop, network online traffic visualiser
3 * Copyright (C) 2002-2005 Jakub Skopal
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * $Header: /home/jakubs/DEV/jnettop-conversion/jnettop/jconfig.h,v 1.6 2006-05-14 23:55:40 merunka Exp $
23 #ifndef __JCONFIG_H__
24 #define __JCONFIG_H__
26 #include "jbase.h"
28 typedef struct __jconfig_settings {
29 const char *deviceName;
30 const jbase_device *device;
31 gboolean onoffContentFiltering;
32 gboolean onoffPromisc;
33 gboolean onoffResolver;
34 guint localAggregation;
35 guint remoteAggregation;
37 GPtrArray * _bpfFilters;
38 int _selectedBpfFilter;
39 char * _adHocBpfFilter;
40 jbase_network_mask_list * _networkMaskList;
41 } jconfig_settings;
43 gboolean jconfig_Setup();
44 gboolean jconfig_ParseFile(char *configFileName);
45 void jconfig_SetDefaults();
46 void jconfig_ConfigureModules();
48 const char * jconfig_GetSelectedBpfFilterText();
49 const char * jconfig_GetSelectedBpfFilterName();
50 void jconfig_AddBpfFilter(char *filterName, char *filterText);
51 int jconfig_FindBpfFilterByName(char *filterName);
53 void jconfig_AddLocalNetwork(const jbase_mutableaddress *network, const jbase_mutableaddress *netmask, int af);
54 int jconfig_FindMatchingLocalNetworkIndex(const jbase_mutableaddress *network, int af);
56 void jconfig_SelectDevice(const char *deviceName);
58 extern jconfig_settings jconfig_Settings;
60 #define JCONFIG_BPFFILTERS_LEN (jconfig_Settings._bpfFilters->len/2)
61 #define JCONFIG_BPFFILTERS_GETNAME(i) ((char*)g_ptr_array_index(jconfig_Settings._bpfFilters, (i)*2))
62 #define JCONFIG_BPFFILTERS_GETTEXT(i) ((char*)g_ptr_array_index(jconfig_Settings._bpfFilters, (i)*2+1))
63 #define JCONFIG_BPFFILTERS_SETSELECTEDFILTER(i) (jconfig_Settings._selectedBpfFilter = i)
64 #define JCONFIG_BPFFILTERS_SETNONE (jconfig_Settings._selectedBpfFilter = -1)
65 #define JCONFIG_BPFFILTERS_SELECTEDISNONE (jconfig_Settings._selectedBpfFilter == -1)
67 #endif