~ubuntu-branches/ubuntu/lucid/knetfilter/lucid

« back to all changes in this revision

Viewing changes to src/knat_toolbar.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Angel Ramos
  • Date: 2005-03-17 17:40:18 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050317174018-qychsdv5ifzdmblo
Tags: 3.3.1-3
Renamed mark.xpm icon. Solved conflict with kxsldbg. Thanks again
Javier. (Closes: #301886, #302534).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 
3
 
  knat v 2.2.0
4
 
 
5
 
  Copyright (C) 2001 Luigi Genoni
6
 
                     venom@DarkStar.sns.it
 
1
  /*
 
2
 
 
3
  knat v 3.1.3
 
4
 
 
5
  Copyright (C) 2003 Luigi Genoni
 
6
                     venom@sns.it
7
7
  */
8
8
  
9
 
 
10
 
#include <qlayout.h>
11
 
#include <qmultilinedit.h>
12
 
#include <qkeycode.h>
13
 
#include <qbuttongroup.h>
14
 
#include <qlabel.h>
15
 
#include <qstring.h>
16
 
#include <qstrlist.h>
17
9
#include <strings.h>
18
10
#include <kmessagebox.h>
19
11
#include <kiconloader.h>
20
 
#include <klocale.h>
 
12
 
21
13
#include <kmenubar.h>
22
 
 
 
14
#include <kmainwindow.h>
23
15
// This is for some "strange compilers" running with "strange" big mass distributions
24
16
#include <stdlib.h>
25
17
 
28
20
#include "version.h"
29
21
 
30
22
knetfilter::knetfilter( QWidget *, const char *name )
31
 
  : KTMainWindow( name )
 
23
  : KMainWindow( 0, name )
32
24
{
33
25
  
34
26
    interfaceChoice = "eth";
40
32
    shaperinterfaceChoice = "eth";
41
33
    shaperinterfacenrChoice = 0;
42
34
    shaperinterfacenrChoicedmp = "0";
 
35
    shapermonitorinterfaceChoice = "eth";
 
36
    shapermonitorinterfacenrChoice = 0;
 
37
    shapermonitorinterfacenrChoicedmp = "0";
43
38
    chainChoice = "INPUT";
44
39
    stateChoice = "nostate";
45
40
    policyChoice = "DROP";
46
41
    flagChoice = "-v";
 
42
    ecnflagChoice = "-v";
 
43
    hasEcn = "-v";
 
44
    ecnParam = "-v";
47
45
    markchainChoice = "INPUT";
48
46
    markpolicyChoice = "DROP";
49
47
    markflagChoice = "-v";
50
48
    markstateChoice = "nostate";
51
49
    polchainChoice = "INPUT";
52
50
    chainpolicyChoice = "ACCEPT";
 
51
    monitor_resolution = 1;
53
52
    natchainChoice= "PREROUTING";
54
53
    natchainResult="DNAT";
55
54
    natpolchainChoice = "PREROUTING";
61
60
    manglechainpolicyChoice = "ACCEPT";
62
61
    mangleprotocolChoice = "tcp";
63
62
    mangleactionChoice = "TOS";
64
 
    mangletosChoice = "0";
 
63
    mangletosChoice = "Normal-Service";
65
64
    mangleSyn = "-v";
 
65
    mangleecnflagChoice = "-v";
 
66
    hasmangleEcn = "-v";
 
67
    mangleecnParam = "-v";
66
68
    nmapopt = "-sT";
67
69
    nmapopt_icmp = "-PB";
68
70
    logLevel = "0";
99
101
    masqList = NULL;
100
102
    mangleList = NULL;
101
103
    manglepolList = NULL;
 
104
    routeList = NULL;
102
105
    dumpList = NULL;
103
106
    mapList = NULL;
104
107
    masqWin = NULL;
105
108
    tcpmssList = NULL;
106
109
    shaperList = NULL;
 
110
    shapermonList = NULL;
107
111
};
108
112
 
109
113
 
204
208
  
205
209
  useMasq = nat_tables->insertItem(i18n("Masquerade"), 
206
210
                                this, SLOT(masqRules()));
207
 
  nat_tables->insertItem(i18n("Redirections"),
 
211
  nat_tables->insertItem(i18n("NAT & Redirections"),
208
212
                                this, SLOT(natRules()));
209
213
  nat_tables->insertItem(i18n("Define Nat Chain policy"),
210
214
                                this, SLOT(natpolRules()));
222
226
  options->insertItem(i18n("TcpMSS set up"),
223
227
                                this, SLOT(tcpmssRules()));
224
228
  options->insertSeparator();
225
 
  options->insertItem(i18n("List Rules, Masquerading & Mangle entries"),
 
229
  options->insertItem(i18n("List Rules, &NAT, Mangle entries"),
226
230
                                this, SLOT(iptablesRules()));
 
231
  options->insertItem(i18n("List &Routes, Ipaddrs, Route Cache"),
 
232
                                this, SLOT(routeRules()));
227
233
  if ( system_has_tc == 1 )
228
234
    {
229
235
      options->insertSeparator();
230
236
      options->insertItem(i18n("Traffic Shaper"),
231
237
                                    this, SLOT(trafficShaper()));
 
238
      options->insertItem(i18n("Traffic Shaper's Rules Monitor"),
 
239
                                    this, SLOT(trafficShaperMonitor()));
232
240
    }
233
241
  options->insertSeparator();
234
242
  options->insertItem(i18n("TcpDump"),
248
256
                "original kfirewall has been created by Kim Andre Norheim\n"
249
257
                "knetfilter for 2.4.x kernels has been done by Luigi Genoni\n"
250
258
                "all addons to the original kfirewall have been done by Luigi Genoni\n"
251
 
                "please send feedback to venom@DarkStar.sns.it", KNETFILTER_VERSION);
 
259
                "please send feedback to venom@sns.it", KNETFILTER_VERSION);
252
260
                
253
 
  //  help = kapp->getHelpMenu(TRUE, about);
254
261
  QPopupMenu *help = helpMenu ( about );
255
262
 
256
263
  menubar = new KMenuBar( this, "menubar" );
262
269
  menubar->insertItem(i18n("&Options"), options);
263
270
  menubar->insertItem(i18n("&Help"), help);
264
271
 
265
 
  setMenu(menubar);
266
 
 
267
272
};
268
273
 
269
274
 
292
297
  toolbar->insertButton("stop_icmp.xpm",del,SIGNAL(clicked()),
293
298
                        this,SLOT(delRule_icmp()),TRUE,i18n("Delete rule to icmp"));
294
299
  toolbar->insertSeparator();
295
 
  toolbar->insertButton("mark.xpm",add,SIGNAL(clicked()),
 
300
  toolbar->insertButton("knet_mark.xpm",add,SIGNAL(clicked()),
296
301
                        this,SLOT(markRules()),TRUE,i18n("Set Up Mark based rules"));
297
302
  toolbar->insertSeparator();
298
303
  toolbar->insertButton("probe.xpm",add,SIGNAL(clicked()),
299
304
                        this,SLOT(startprobeInterface()),TRUE,i18n("Probe Network Interface"));
300
305
  toolbar->setBarPos( KToolBar::Top );
301
306
 
302
 
  toolbar1 = addToolBar(toolbar);
303
 
  
304
307
};
305
308
 
306
309
 
308
311
void knetfilter::setupStatusBar() {
309
312
 
310
313
  statusbar = new KStatusBar( this );
311
 
  //  statusbar->setBorderWidth(1);
312
 
 
313
 
  setStatusBar( statusbar );
314
314
 
315
315
};
316
316