~ubuntu-branches/ubuntu/natty/knetfilter/natty

« back to all changes in this revision

Viewing changes to src/knat_shaper.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
1
  /*
2
 
 
3
 
  knetfilter v 2.2.0
4
 
 
5
 
  Copyright (C) 2001 Luigi Genoni
6
 
                     venom@DarkStar.sns.it
 
2
  
 
3
   knetfilter v 3.0.2
 
4
 
 
5
   Copyright (C) 2002 Luigi Genoni
 
6
                      venom@sns.it
7
7
  */
8
8
 
9
9
#include <qlayout.h>
189
189
      }
190
190
  };
191
191
 
 
192
void knetfilter::delshaperRules() {
 
193
    QString shapermark, shaperglobalband, shaperrateband, shaperqdischandle, shaperrootclassid, shaperrootclassweight, shaperrootclassprio, shapersubclassid, shapersubclassweight, shapersubclassprio, shaperinterface, shaperrootclassparent;
 
194
    
 
195
    char shaperinterfaceChoice2[5];
 
196
    strcpy (shaperinterfaceChoice2, shaperinterfaceChoice ); 
 
197
    shaperinterfaceChoicedmp = strcat ( shaperinterfaceChoice2, shaperinterfacenrChoicedmp); 
 
198
    shaperinterface.sprintf(shaperinterfaceChoicedmp); 
 
199
 
 
200
    shapermark.sprintf((const char *)(shaperMark->text()));
 
201
    shaperglobalband.sprintf((const char *)(shaperglobalBand->text()));
 
202
    shaperrateband.sprintf((const char *)(shaperrateBand->text()));
 
203
    shaperqdischandle.sprintf((const char *)(shaperqdiscHandle->text()));
 
204
    shaperrootclassid.sprintf((const char *)(shaperrootclassId->text()));
 
205
    shaperrootclassweight.sprintf((const char *)(shaperrootclassWeight->text()));
 
206
    shaperrootclassprio.sprintf((const char *)(shaperrootclassPrio->text()));
 
207
    shapersubclassid.sprintf((const char *)(shapersubclassId->text()));
 
208
    shapersubclassweight.sprintf((const char *)(shapersubclassWeight->text()));
 
209
    shapersubclassprio.sprintf((const char *)(shapersubclassPrio->text()));
 
210
    
 
211
    delshaperqdisc.clearArguments();
 
212
    delshaperrootclass.clearArguments();
 
213
    delshapersubclass.clearArguments();
 
214
    delshaperfilter.clearArguments();
 
215
 
 
216
    if ( qdisc_exec == 0 && class_exec == 0 && subclass_exec == 0)
 
217
      {
 
218
        QMessageBox::critical(0, "Error",
 
219
                              "You have to say which action you want to perform! \n Remember to remove subclasses  at first, then the root class \n and at the end the qdisc!\n"); 
 
220
      }
 
221
    else if(shaperglobalband.length()==0)
 
222
      {
 
223
        QMessageBox::critical(0, "Error",
 
224
                              "You have to supply global bandwidht on net device \n e.g. 100Mbit! \n");
 
225
      }
 
226
 
 
227
 
 
228
    char *shaperrootclassParent;
 
229
    char shaperrootclassParent2[5];
 
230
        
 
231
    strcpy (shaperrootclassParent2, (const char *)(shaperqdiscHandle->text()) ); 
 
232
    shaperrootclassParent = strcat ( shaperrootclassParent2, "0"); 
 
233
    shaperrootclassparent.sprintf(shaperrootclassParent); 
 
234
 
 
235
 
 
236
 
 
237
    if ( subclass_exec == 1 )
 
238
      {
 
239
        if(shaperrateband.length()==0)
 
240
          {
 
241
            QMessageBox::critical(0, "Error",
 
242
                                  "You have to supply the amount on bandwidth on net device \n you want to reser for XX marked packets \n e.g. 600Kbit! \n");
 
243
          }
 
244
        else if (shaperqdischandle.length()==0)
 
245
          {
 
246
            QMessageBox::critical(0, "Error",
 
247
                                  "You have to supply the qdisc handle! \n e.g. 1! \n So knetfilter can establish the filter parent. \n");
 
248
          }
 
249
        else if(shapermark.length()==0)
 
250
          {
 
251
            QMessageBox::critical(0, "Error",
 
252
                                  "You have to supply the mark that the traffic shaper \n should use to count the packet for a reserved rate. \n e.g. 0x03! \n");
 
253
          }
 
254
        else if (shaperrootclassid.length()==0)
 
255
          {
 
256
            QMessageBox::critical(0, "Error",
 
257
                                  "You have to supply the root class ID! \n so knetfilter can establish to which parent the rule \n has to be conencted\n e.g. 1:10! \n");
 
258
          }     
 
259
        else if (shapersubclassid.length()==0)
 
260
          {
 
261
            QMessageBox::critical(0, "Error",
 
262
                                  "You have to supply the subclass ID!\n e.g 1:11! \n");
 
263
 
 
264
                                  }
 
265
        else if (shapersubclassweight.length()==0) 
 
266
          {
 
267
            QMessageBox::critical(0, "Error",
 
268
                                  "You have to supply the subclass data flow weight! :)\n e.g. 600Kbit! \n");
 
269
          }
 
270
        else if (shapersubclassprio.length()==0)
 
271
          {
 
272
            QMessageBox::critical(0, "Error",
 
273
                                  "you have to supply the sub class priority!\n e.g. 5! \n");
 
274
          }
 
275
        else
 
276
          {
 
277
            delshapersubclass << "tc" << "class" << "del" << "dev" << shaperinterface << "parent" << shaperrootclassid << "classid" << shapersubclassid << "cbq" << "bandwidth" << shaperglobalband << "rate" << shaperrateband << "allot" << "1514" << "weight" << shapersubclassweight << "prio" << shapersubclassprio << "maxburst" << "20" << "avpkt" << "1000";
 
278
            delshaperfilter << "tc" << "filter" << "del" << "dev" << shaperinterface << "protocol" << "ip" << "parent" << shaperrootclassparent << "prio" << "1" << "handle" << shapermark << "fw" << "classid" << shapersubclassid; 
 
279
          
 
280
            bool successfilter=delshaperfilter.start();
 
281
            bool successsubclass=delshapersubclass.start(); 
 
282
            if (successfilter && successsubclass) {
 
283
              statusbar->message(i18n("shaper filter deleted"), 2000);
 
284
              QString msg;
 
285
              msg.sprintf("sub class created for device %s\n", shaperinterfaceChoicedmp);
 
286
              messageLog->insertItem(msg);
 
287
              msg.sprintf("shaper filter deleted for device %s\n", shaperinterfaceChoicedmp);
 
288
              messageLog->insertItem(msg);
 
289
            } else {
 
290
              statusbar->message(i18n("tc died"), 2000);
 
291
              QMessageBox::critical(0, "Error",
 
292
                                    "sub class or filter has not been deleted, please check your parameters! \n");
 
293
            }           
 
294
          }
 
295
      }
 
296
 
 
297
 
 
298
 
 
299
    if ( class_exec == 1 )
 
300
      {
 
301
 
 
302
        if (shaperqdischandle.length()==0)
 
303
          {
 
304
            QMessageBox::critical(0, "Error",
 
305
                                  "You have to supply the qdisc handle! \n e.g. 1! \n So knetfilter can establish the root class parent. \n");
 
306
          }
 
307
        else if (shaperrootclassid.length()==0)
 
308
          {
 
309
            QMessageBox::critical(0, "Error",
 
310
                                  "You have to supply the root classID! \n e.g. 1:10! \n");
 
311
          }
 
312
        else if (shaperrootclassweight.length()==0) 
 
313
          {
 
314
            QMessageBox::critical(0, "Error",
 
315
                                  "You have to supply the root class data flow weight! :)\n e.g. 1Mbit! \n");
 
316
          }
 
317
        else if (shaperrootclassprio.length()==0)
 
318
          {
 
319
            QMessageBox::critical(0, "Error",
 
320
                                  "you have to supply the root class priority!\n e.g. 8! \n");
 
321
          }
 
322
        else
 
323
          {
 
324
            delshaperrootclass << "tc" << "class" << "del" << "dev" << shaperinterface << "parent" << shaperrootclassparent << "classid" << shaperrootclassid << "cbq" << "bandwidth" << shaperglobalband << "rate" << shaperglobalband <<  "allot" << "1514"<< "weight" << shaperrootclassweight << "prio" << shaperrootclassprio << "maxburst" << "20" << "avpkt" << "1000";   
 
325
        
 
326
                bool successrootclass=delshaperrootclass.start(); 
 
327
                if (successrootclass) {
 
328
                  statusbar->message(i18n("New root class deleted"), 2000);
 
329
                  QString msg;
 
330
                  msg.sprintf("root class deleted for device %s\n", shaperinterfaceChoicedmp);
 
331
                  messageLog->insertItem(msg);
 
332
                } else {
 
333
                  statusbar->message(i18n("tc died"), 2000);
 
334
                  QMessageBox::critical(0, "Error",
 
335
                                        "root class has not been deleted, please check your parameters! \n");
 
336
                }               
 
337
          }
 
338
        
 
339
      }
 
340
 
 
341
 
 
342
 
 
343
    if ( qdisc_exec == 1 )
 
344
      {
 
345
        if (shaperqdischandle.length()==0)
 
346
          {
 
347
            QMessageBox::critical(0, "Error",
 
348
                                  "You have to supply the qdisc handle! \n e.g. 1! \n");
 
349
          }
 
350
        else
 
351
          {
 
352
            delshaperqdisc << "tc" << "qdisc" << "del" << "dev" << shaperinterface << "root" << "handle" << shaperqdischandle <<  "cbq" << "bandwidth" << shaperglobalband << "avpkt" << "1000"; 
 
353
          }
 
354
        bool successqdisc=delshaperqdisc.start(); 
 
355
        if (successqdisc) {
 
356
          statusbar->message(i18n("qdisc deleted"), 2000);
 
357
          QString msg;
 
358
          msg.sprintf("qdisc deleted for device %s\n", shaperinterfaceChoicedmp);
 
359
          messageLog->insertItem(msg);
 
360
        } else {
 
361
          statusbar->message(i18n("tc died"), 2000);
 
362
          QMessageBox::critical(0, "Error",
 
363
                                "qdisc has not been deleted, please check your parameters! \n");
 
364
        }
 
365
      }
 
366
 
 
367
  };
 
368
 
 
369
 
192
370
 
193
371
// set up interface
194
372
 
195
373
void knetfilter::trafficShaper() {
196
374
    if ( shaperList == NULL )
197
375
      {
198
 
        setupConnect();
 
376
        //      setupConnect();
199
377
        
200
378
        shaperList = new KNFWidget();
201
379
        shaperList->resize(640,480);
228
406
        grid->addMultiCellWidget(shaperinterface,0,0,1,2);
229
407
        
230
408
        QLabel *labelshaperInterfacenr = new QLabel(shaperList);
231
 
        
232
409
        labelshaperInterfacenr->setText("Interface nr:");
233
410
        grid->addMultiCellWidget(labelshaperInterfacenr,1,1,0,0);
234
411
        
303
480
        grid->addMultiCellWidget(shaperclass,4,4,3,5);
304
481
        
305
482
        QLabel *labelshapersubclass = new QLabel(shaperList);
306
 
        labelshapersubclass->setText("create sub blass on net device:");
 
483
        labelshapersubclass->setText("create sub class on net device:");
307
484
        shapersubclass = new QCheckBox( shaperList, "QdiscBox" );
308
485
        shapersubclass->setGeometry(8,8,8,8);
309
486
        shapersubclass->setText("to reserve rate for marked packets");
408
585
        connect(btnShaper,SIGNAL(clicked()), this, SLOT(startshaperRules()));
409
586
        grid->addWidget(btnShaper,11,1);          
410
587
 
 
588
        QPushButton *btndelShaper = new QPushButton(shaperList);
 
589
        btndelShaper->setText("Delete");
 
590
        btndelShaper->setFixedHeight(btndelShaper->sizeHint().height());
 
591
        connect(btndelShaper,SIGNAL(clicked()), this, SLOT(delshaperRules()));
 
592
        grid->addWidget(btndelShaper,11,3);       
 
593
 
411
594
        QPushButton *btnClose = new QPushButton(shaperList);
412
595
        btnClose->setText("Close");
413
596
        btnClose->setFixedHeight(btnClose->sizeHint().height());
414
597
        connect(btnClose,SIGNAL(clicked()), this, SLOT(closeshaperRules()));
415
 
        grid->addWidget(btnClose,11,4);   
 
598
        grid->addWidget(btnClose,11,6);   
416
599
        
417
600
        shaperList->show();
418
 
        setView(shaperList);
 
601
        setCentralWidget(shaperList);
419
602
      }
420
603
    else
421
604
      {
422
 
        if (!shaperList->isVisible() )
 
605
        if ( !shaperList->isVisible() )
423
606
          {
424
607
            shaperList->show();
425
608
          }
591
774
};
592
775
 
593
776
        
 
777
// Traffic Shaper's Rules Monitor
 
778
 
 
779
 
 
780
void knetfilter::startqdiscMonitor() {
 
781
  
 
782
  showip.clearArguments();
 
783
  showqdisc.clearArguments();
 
784
  char shapermonitorinterfaceChoice2[5];
 
785
  strcpy ( shapermonitorinterfaceChoice2, shapermonitorinterfaceChoice );
 
786
 
 
787
  shapermonitorinterfaceChoicedmp = strcat ( shapermonitorinterfaceChoice2, shapermonitorinterfacenrChoicedmp ); 
 
788
 
 
789
  showip << "ip" << "addr" << "show" << "dev" << shapermonitorinterfaceChoicedmp ; 
 
790
  showqdisc << "tc" << "qdisc" << "show" << "dev" << shapermonitorinterfaceChoicedmp ; 
 
791
 
 
792
  
 
793
  bool showaddr=showip.start(KProcess::NotifyOnExit,
 
794
                             KProcess::AllOutput);
 
795
  bool success=showqdisc.start(KProcess::NotifyOnExit,
 
796
                               KProcess::AllOutput);
 
797
  if (showaddr && success)
 
798
    statusbar->message(i18n("Running..."), 2000);
 
799
  else
 
800
    statusbar->message(i18n("Couldn't start tc"), 2000);
 
801
 
 
802
};
 
803
 
 
804
 
 
805
void knetfilter::startclassMonitor() {
 
806
 
 
807
  showip.clearArguments();
 
808
  showclass.clearArguments();
 
809
  char shapermonitorinterfaceChoice2[5];
 
810
  strcpy ( shapermonitorinterfaceChoice2, shapermonitorinterfaceChoice );
 
811
 
 
812
  shapermonitorinterfaceChoicedmp = strcat ( shapermonitorinterfaceChoice2, shapermonitorinterfacenrChoicedmp ); 
 
813
 
 
814
  showip << "ip" << "addr" << "show" << "dev" << shapermonitorinterfaceChoicedmp ; 
 
815
  showclass << "tc" << "class" << "show" << "dev" << shapermonitorinterfaceChoicedmp ; 
 
816
 
 
817
  bool showaddr=showip.start(KProcess::NotifyOnExit,
 
818
                             KProcess::AllOutput);
 
819
  bool success=showclass.start(KProcess::NotifyOnExit,
 
820
                               KProcess::AllOutput);
 
821
  if (showaddr && success)
 
822
    statusbar->message(i18n("Running..."), 2000);
 
823
  else
 
824
    statusbar->message(i18n("Couldn't start tc"), 2000);
 
825
 
 
826
};
 
827
 
 
828
 
 
829
void knetfilter::startfilterMonitor() {
 
830
 
 
831
  showip.clearArguments();
 
832
  showfilter.clearArguments();
 
833
  char shapermonitorinterfaceChoice2[5];
 
834
  strcpy ( shapermonitorinterfaceChoice2, shapermonitorinterfaceChoice );
 
835
 
 
836
  shapermonitorinterfaceChoicedmp = strcat ( shapermonitorinterfaceChoice2, shapermonitorinterfacenrChoicedmp ); 
 
837
 
 
838
  showip << "ip" << "addr" << "show" << "dev" << shapermonitorinterfaceChoicedmp ; 
 
839
  showfilter << "tc" << "filter" << "show" << "dev" << shapermonitorinterfaceChoicedmp ; 
 
840
 
 
841
  bool showaddr=showip.start(KProcess::NotifyOnExit,
 
842
                             KProcess::AllOutput);
 
843
  bool success=showfilter.start(KProcess::NotifyOnExit,
 
844
                                KProcess::AllOutput);
 
845
  if (showaddr && success)
 
846
    statusbar->message(i18n("Running..."), 2000);
 
847
  else
 
848
    statusbar->message(i18n("Couldn't start tc"), 2000);
 
849
 
 
850
};
 
851
 
 
852
 
 
853
void knetfilter::trafficShaperMonitor() {
 
854
  if ( shapermonList == NULL )
 
855
    {
 
856
      //      setupConnect();
 
857
 
 
858
      shapermonList = new KNFWidget();
 
859
      shapermonList->resize(680,420);
 
860
      shapermonList->setCaption("current traffic shaper rules, qdisc, class and filter entries");
 
861
      
 
862
      QBoxLayout *top = new QBoxLayout(shapermonList, QBoxLayout::LeftToRight, 7); 
 
863
      QGridLayout *grid = new QGridLayout(7,5);
 
864
      top->addLayout(grid,5);
 
865
      
 
866
      shapermonBox = new QListBox(shapermonList);
 
867
      grid->addMultiCellWidget(shapermonBox,0,5,0,5);
 
868
 
 
869
      QLabel *labelshapermonInterface = new QLabel(shapermonList);
 
870
      labelshapermonInterface->setText("Interface:");
 
871
      grid->addMultiCellWidget(labelshapermonInterface,6,6,1,1);
 
872
 
 
873
      shapermoninterface = new QComboBox( FALSE, shapermonList, "interface");
 
874
      shapermoninterface->insertItem("eth");
 
875
      shapermoninterface->insertItem("tr");
 
876
      shapermoninterface->insertItem("lec");
 
877
      shapermoninterface->insertItem("atm");
 
878
      shapermoninterface->insertItem("bond");
 
879
      shapermoninterface->insertItem("lo");
 
880
      shapermoninterface->insertItem("slip");
 
881
      shapermoninterface->insertItem("plip");
 
882
      shapermoninterface->insertItem("ppp");
 
883
      shapermoninterface->insertItem("ippp");
 
884
      shapermoninterface->insertItem("tap");
 
885
      shapermoninterface->insertItem("tun");
 
886
      shapermoninterface->setFixedHeight(shapermoninterface->sizeHint().height());
 
887
      connect(shapermoninterface,SIGNAL(activated(int)), SLOT(shapermonitorinterfaceActivated(int)));
 
888
      grid->addMultiCellWidget(shapermoninterface,6,6,2,2);
 
889
 
 
890
      
 
891
      QLabel *labelshapermonInterfacenr = new QLabel(shapermonList);
 
892
      labelshapermonInterfacenr->setText("Interface nr:");
 
893
      grid->addMultiCellWidget(labelshapermonInterfacenr,6,6,3,3);
 
894
 
 
895
      shapermoninterfacenr = new QComboBox( FALSE, shapermonList, "interface nr");
 
896
      shapermoninterfacenr->insertItem("0");
 
897
      shapermoninterfacenr->insertItem("1");
 
898
      shapermoninterfacenr->insertItem("2");
 
899
      shapermoninterfacenr->insertItem("3");
 
900
      shapermoninterfacenr->insertItem("4");
 
901
      shapermoninterfacenr->insertItem("5");
 
902
      shapermoninterfacenr->setFixedHeight(shapermoninterfacenr->sizeHint().height());
 
903
      connect(shapermoninterfacenr,SIGNAL(activated(int)), SLOT(shapermonitorinterfacenrActivated(int)));
 
904
      grid->addMultiCellWidget(shapermoninterfacenr,6,6,4,4);
 
905
 
 
906
      QPushButton *btnQdisc = new QPushButton(shapermonList);
 
907
      btnQdisc->setText("Qdisc");
 
908
      btnQdisc->setFixedHeight(btnQdisc->sizeHint().height());
 
909
      connect(btnQdisc,SIGNAL(clicked()), this, SLOT(startqdiscMonitor()));
 
910
      grid->addWidget(btnQdisc,7,0);
 
911
 
 
912
      QPushButton *btnClass = new QPushButton(shapermonList);
 
913
      btnClass->setText("Class");
 
914
      btnClass->setFixedHeight(btnClass->sizeHint().height());
 
915
      connect(btnClass,SIGNAL(clicked()), this, SLOT(startclassMonitor()));
 
916
      grid->addWidget(btnClass,7,1);
 
917
 
 
918
      QPushButton *btnFilter = new QPushButton(shapermonList);
 
919
      btnFilter->setText("Filter");
 
920
      btnFilter->setFixedHeight(btnFilter->sizeHint().height());
 
921
      connect(btnFilter,SIGNAL(clicked()), this, SLOT(startfilterMonitor()));
 
922
      grid->addWidget(btnFilter,7,2);
 
923
 
 
924
      QPushButton *btnClose = new QPushButton(shapermonList);
 
925
      btnClose->setText("Close");
 
926
      btnClose->setFixedHeight(btnClose->sizeHint().height());
 
927
      connect(btnClose,SIGNAL(clicked()), this, SLOT(closeshaperMonitor()));
 
928
      grid->addWidget(btnClose,7,5);
 
929
 
 
930
      shapermonList->show();
 
931
      setCentralWidget(shapermonList);
 
932
    }
 
933
  else
 
934
    {
 
935
      if (!shapermonList->isVisible() )
 
936
        {
 
937
          shapermonList->show();
 
938
        }
 
939
      else
 
940
        {
 
941
          QMessageBox::critical(0,"Warning", "Already Running\n");
 
942
        }
 
943
    }      
 
944
};
 
945
 
 
946
 
 
947
void knetfilter::closeshaperMonitor() {
 
948
  
 
949
  shapermonList->close();
 
950
 
 
951
};
 
952
 
 
953
 
 
954
void knetfilter::shaperMonitor(KProcess *, char *data, int len) {
 
955
 
 
956
  if (len<0)
 
957
    return;
 
958
  static QString remainder;
 
959
  QString list;
 
960
 
 
961
  char dst[len+1];
 
962
  memmove(dst,data,len);
 
963
  dst[len]=0;
 
964
 
 
965
  list=remainder+dst;
 
966
  QStrList lines;
 
967
  int index=0;
 
968
  int newindex=0;
 
969
 
 
970
  while (1)
 
971
   {
 
972
    newindex=list.find('\n',index);
 
973
    if(newindex==-1) {
 
974
      remainder=list.right(list.length()-index);
 
975
      break;
 
976
    } else {
 
977
      lines.append(list.mid(index,newindex-index));
 
978
      index=newindex+1;
 
979
    };
 
980
  };
 
981
 
 
982
  if(lines.count()>0){
 
983
    shapermonBox->insertStrList(&lines);
 
984
  };
 
985
 
 
986
  shapermonBox->insertItem(remainder.data());
 
987
  shapermonBox->setTopItem(shapermonBox->count()-shapermonBox->numItemsVisible());
 
988
};
 
989
 
 
990
 
 
991
// menu widget choice interface
 
992
void knetfilter::shapermonitorinterfaceActivated(int index) {
 
993
 
 
994
  switch(index) {
 
995
  default:
 
996
    shapermonitorinterfaceChoice = "eth";
 
997
  case 0:
 
998
    shapermonitorinterfaceChoice = "eth";
 
999
    break;
 
1000
  case 1:
 
1001
    shapermonitorinterfaceChoice = "tr";
 
1002
    break;
 
1003
  case 2:
 
1004
    shapermonitorinterfaceChoice = "lec";
 
1005
    break;
 
1006
  case 3:
 
1007
    shapermonitorinterfaceChoice = "atm";
 
1008
    break;
 
1009
  case 4:
 
1010
    shapermonitorinterfaceChoice = "bond";
 
1011
    break;
 
1012
  case 5:
 
1013
    shapermonitorinterfaceChoice = "lo";
 
1014
    break;
 
1015
  case 6:
 
1016
    shapermonitorinterfaceChoice = "slip";
 
1017
    break;
 
1018
  case 7:
 
1019
    shapermonitorinterfaceChoice = "plip";
 
1020
    break;
 
1021
  case 8:
 
1022
    shapermonitorinterfaceChoice = "ppp";
 
1023
    break;
 
1024
  case 9:
 
1025
    shapermonitorinterfaceChoice = "ippp";
 
1026
    break;
 
1027
  case 10:
 
1028
    shapermonitorinterfaceChoice = "tap";
 
1029
    break;
 
1030
  case 11:
 
1031
    shapermonitorinterfaceChoice = "tun";
 
1032
    break;
 
1033
  };
 
1034
 
 
1035
};
 
1036
 
 
1037
 
 
1038
void knetfilter::shapermonitorinterfacenrActivated(int index) {
 
1039
 
 
1040
  switch(index) {
 
1041
  default:
 
1042
    shapermonitorinterfacenrChoice = 0;
 
1043
  case 0:
 
1044
    shapermonitorinterfacenrChoice = 0;
 
1045
    shapermonitorinterfacenrChoicedmp = "0";
 
1046
    break;
 
1047
  case 1:
 
1048
    shapermonitorinterfacenrChoice = 1;
 
1049
    shapermonitorinterfacenrChoicedmp = "1";
 
1050
    break;
 
1051
  case 2:
 
1052
    shapermonitorinterfacenrChoice = 2;
 
1053
    shapermonitorinterfacenrChoicedmp = "2";
 
1054
    break;
 
1055
  case 3:
 
1056
    shapermonitorinterfacenrChoice = 3;
 
1057
    shapermonitorinterfacenrChoicedmp = "3";
 
1058
    break;
 
1059
  case 4:
 
1060
    shapermonitorinterfacenrChoice = 4;
 
1061
    shapermonitorinterfacenrChoicedmp = "4";
 
1062
    break;
 
1063
  case 5:
 
1064
    shapermonitorinterfacenrChoice = 5;
 
1065
    shapermonitorinterfacenrChoicedmp = "5";
 
1066
    break;
 
1067
  };
 
1068
 
 
1069
};
 
1070