summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--COPYING280
-rw-r--r--COPYING-DOCS397
-rw-r--r--ChangeLog254
-rw-r--r--INSTALL167
-rw-r--r--KMFIPTInterface/KMFIPTInterface.lsm16
-rw-r--r--KMFIPTInterface/Makefile.am17
-rw-r--r--KMFIPTInterface/README11
-rw-r--r--KMFIPTInterface/iptchecker.cpp234
-rw-r--r--KMFIPTInterface/iptchecker.h41
-rw-r--r--KMFIPTInterface/kmfiptinterface.cpp115
-rw-r--r--KMFIPTInterface/kmfiptinterface.desktop39
-rw-r--r--KMFIPTInterface/kmfiptinterface.h57
-rwxr-xr-xKMFIPTInterface/kmfiptinterface_ctl7
-rw-r--r--KMFIPTInterface/main.cpp67
-rw-r--r--KMFSysTray/Makefile.am22
-rw-r--r--KMFSysTray/README4
-rw-r--r--KMFSysTray/app.cpp63
-rw-r--r--KMFSysTray/app.h27
-rw-r--r--KMFSysTray/details.cpp109
-rw-r--r--KMFSysTray/details.h54
-rw-r--r--KMFSysTray/details_designer.ui484
-rw-r--r--KMFSysTray/kmfiptwatcher.cpp306
-rw-r--r--KMFSysTray/kmfiptwatcher.h73
-rw-r--r--KMFSysTray/kmfsystray.cpp166
-rw-r--r--KMFSysTray/kmfsystray.desktop36
-rw-r--r--KMFSysTray/kmfsystray.h80
-rw-r--r--KMFSysTray/main.cpp57
-rw-r--r--KMFSysTray/mainwidget.cpp74
-rw-r--r--KMFSysTray/mainwidget.h61
-rw-r--r--KMFSysTray/mainwidget_designer.ui88
-rw-r--r--Makefile.am5
-rw-r--r--README139
-rw-r--r--TODO70
-rw-r--r--acinclude.m411920
-rw-r--r--aclocal.m4863
-rwxr-xr-xcheck_svn_build.sh75
-rwxr-xr-xconfig.guess1561
-rw-r--r--config.h.in237
-rw-r--r--config.log362
-rwxr-xr-xconfig.sub1686
-rw-r--r--configure.files2
-rw-r--r--configure.in152
-rw-r--r--configure.in.in9
-rwxr-xr-xdebian_woody_configure35
-rw-r--r--doc/Makefile718
-rw-r--r--doc/Makefile.am5
-rw-r--r--doc/kmyfirewall/Makefile599
-rw-r--r--doc/kmyfirewall/Makefile.am3
-rw-r--r--doc/kmyfirewall/index.docbook1598
-rwxr-xr-xfedora_configuration35
-rw-r--r--kmyfirewall.kdevelop271
-rw-r--r--kmyfirewall.lsm14
-rw-r--r--kmyfirewall/Makefile.am42
-rw-r--r--kmyfirewall/compilers/Makefile.am6
-rw-r--r--kmyfirewall/compilers/iptables/Makefile.am15
-rw-r--r--kmyfirewall/compilers/iptables/kmfcompiler_ipt.desktop65
-rw-r--r--kmyfirewall/compilers/iptables/kmfiptablescompiler.cpp254
-rw-r--r--kmyfirewall/compilers/iptables/kmfiptablescompiler.h94
-rw-r--r--kmyfirewall/compilers/iptables/kmfiptablescompiler.rc16
-rw-r--r--kmyfirewall/compilers/iptables/kmfiptablesdocumentconverter.cpp671
-rw-r--r--kmyfirewall/compilers/iptables/kmfiptablesdocumentconverter.h72
-rw-r--r--kmyfirewall/compilers/iptables/kmfiptablesscriptgenerator.cpp336
-rw-r--r--kmyfirewall/compilers/iptables/kmfiptablesscriptgenerator.h60
-rw-r--r--kmyfirewall/compilers/kmfcompilerplugin.desktop47
-rw-r--r--kmyfirewall/compilers/pf/Makefile.am13
-rw-r--r--kmyfirewall/compilers/pf/kmfcompiler_pf.desktop61
-rw-r--r--kmyfirewall/compilers/pf/kmfpfcompiler.cpp462
-rw-r--r--kmyfirewall/compilers/pf/kmfpfcompiler.h133
-rw-r--r--kmyfirewall/compilers/pf/kmfpfcompiler.rc15
-rw-r--r--kmyfirewall/compilers/pf/kmfpfscriptgenerator.cpp241
-rw-r--r--kmyfirewall/compilers/pf/kmfpfscriptgenerator.h60
-rw-r--r--kmyfirewall/core/Makefile.am94
-rw-r--r--kmyfirewall/core/ipaddress.cpp342
-rw-r--r--kmyfirewall/core/ipaddress.h107
-rw-r--r--kmyfirewall/core/iptable.cpp378
-rw-r--r--kmyfirewall/core/iptable.h119
-rw-r--r--kmyfirewall/core/iptchain.cpp561
-rw-r--r--kmyfirewall/core/iptchain.h215
-rw-r--r--kmyfirewall/core/iptrule.cpp547
-rw-r--r--kmyfirewall/core/iptrule.h176
-rw-r--r--kmyfirewall/core/iptruleoption.cpp330
-rw-r--r--kmyfirewall/core/iptruleoption.h133
-rw-r--r--kmyfirewall/core/kmfapp.cpp93
-rw-r--r--kmyfirewall/core/kmfapp.h45
-rw-r--r--kmyfirewall/core/kmfappstate.cpp49
-rw-r--r--kmyfirewall/core/kmfappstate.h37
-rw-r--r--kmyfirewall/core/kmfcheckinput.cpp437
-rw-r--r--kmyfirewall/core/kmfcheckinput.h77
-rw-r--r--kmyfirewall/core/kmfcompilerinterface.cpp33
-rw-r--r--kmyfirewall/core/kmfcompilerinterface.h50
-rw-r--r--kmyfirewall/core/kmfconfig.kcfg87
-rw-r--r--kmyfirewall/core/kmfconfig.kcfgc6
-rw-r--r--kmyfirewall/core/kmfdoc.cpp236
-rw-r--r--kmyfirewall/core/kmfdoc.h150
-rw-r--r--kmyfirewall/core/kmferror.cpp110
-rw-r--r--kmyfirewall/core/kmferror.h71
-rw-r--r--kmyfirewall/core/kmferrorhandler.cpp73
-rw-r--r--kmyfirewall/core/kmferrorhandler.h43
-rw-r--r--kmyfirewall/core/kmfgenericdoc.cpp563
-rw-r--r--kmyfirewall/core/kmfgenericdoc.h189
-rw-r--r--kmyfirewall/core/kmfinstallerinterface.cpp35
-rw-r--r--kmyfirewall/core/kmfinstallerinterface.h49
-rw-r--r--kmyfirewall/core/kmfiptdoc.cpp487
-rw-r--r--kmyfirewall/core/kmfiptdoc.h201
-rw-r--r--kmyfirewall/core/kmfnethost.cpp394
-rw-r--r--kmyfirewall/core/kmfnethost.h104
-rw-r--r--kmyfirewall/core/kmfnetwork.cpp317
-rw-r--r--kmyfirewall/core/kmfnetwork.h115
-rw-r--r--kmyfirewall/core/kmfnetzone.cpp1046
-rw-r--r--kmyfirewall/core/kmfnetzone.h185
-rw-r--r--kmyfirewall/core/kmfnetzonelist.cpp38
-rw-r--r--kmyfirewall/core/kmfnetzonelist.h32
-rw-r--r--kmyfirewall/core/kmfplugin.cpp93
-rw-r--r--kmyfirewall/core/kmfplugin.h56
-rw-r--r--kmyfirewall/core/kmfpluginfactory.cpp224
-rw-r--r--kmyfirewall/core/kmfpluginfactory.h57
-rw-r--r--kmyfirewall/core/kmfprotocol.cpp311
-rw-r--r--kmyfirewall/core/kmfprotocol.h111
-rw-r--r--kmyfirewall/core/kmfprotocolcategory.cpp239
-rw-r--r--kmyfirewall/core/kmfprotocolcategory.h86
-rw-r--r--kmyfirewall/core/kmfprotocollibrary.cpp395
-rw-r--r--kmyfirewall/core/kmfprotocollibrary.h71
-rw-r--r--kmyfirewall/core/kmfprotocollibrary.xml238
-rw-r--r--kmyfirewall/core/kmfprotocolusage.cpp257
-rw-r--r--kmyfirewall/core/kmfprotocolusage.h94
-rw-r--r--kmyfirewall/core/kmfruleeditinterface.cpp26
-rw-r--r--kmyfirewall/core/kmfruleeditinterface.h35
-rw-r--r--kmyfirewall/core/kmfruleoptioneditinterface.cpp30
-rw-r--r--kmyfirewall/core/kmfruleoptioneditinterface.h25
-rw-r--r--kmyfirewall/core/kmfrulesetdoc.cpp104
-rw-r--r--kmyfirewall/core/kmfrulesetdoc.h61
-rw-r--r--kmyfirewall/core/kmfruletargetoptioneditinterface.cpp36
-rw-r--r--kmyfirewall/core/kmfruletargetoptioneditinterface.h41
-rw-r--r--kmyfirewall/core/kmftarget.cpp386
-rw-r--r--kmyfirewall/core/kmftarget.h128
-rw-r--r--kmyfirewall/core/kmftargetconfig.cpp240
-rw-r--r--kmyfirewall/core/kmftargetconfig.h188
-rw-r--r--kmyfirewall/core/kmftransaction.cpp81
-rw-r--r--kmyfirewall/core/kmftransaction.h72
-rw-r--r--kmyfirewall/core/kmfundoengine.cpp250
-rw-r--r--kmyfirewall/core/kmfundoengine.h147
-rw-r--r--kmyfirewall/core/kmyfirewallinterface.cpp45
-rw-r--r--kmyfirewall/core/kmyfirewallinterface.h64
-rw-r--r--kmyfirewall/core/kprocesswrapper.cpp248
-rw-r--r--kmyfirewall/core/kprocesswrapper.h104
-rw-r--r--kmyfirewall/core/netfilterobject.cpp205
-rw-r--r--kmyfirewall/core/netfilterobject.h173
-rw-r--r--kmyfirewall/core/xmlnames.cpp151
-rw-r--r--kmyfirewall/core/xmlnames.h163
-rw-r--r--kmyfirewall/genericinterface/Makefile.am22
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterface.cpp237
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterface.h100
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterface_part.cpp258
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterface_part.h111
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfacehost.cpp519
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfacehost.h103
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfaceicmp.cpp110
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfaceicmp.h60
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfacelogging.cpp125
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfacelogging.h67
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfacenat.cpp200
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfacenat.h66
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfacepartui.rc16
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfaceprotocol.cpp681
-rw-r--r--kmyfirewall/genericinterface/kmfgenericinterfaceprotocol.h121
-rw-r--r--kmyfirewall/genericinterface/kmyfirewallgenericinterfacehostwidget.ui306
-rw-r--r--kmyfirewall/genericinterface/kmyfirewallgenericinterfaceicmp.ui178
-rw-r--r--kmyfirewall/genericinterface/kmyfirewallgenericinterfacelogging.ui194
-rw-r--r--kmyfirewall/genericinterface/kmyfirewallgenericinterfacenatwidget.ui293
-rw-r--r--kmyfirewall/genericinterface/kmyfirewallgenericinterfaceprotocolwidget.ui215
-rw-r--r--kmyfirewall/installer/Makefile.am23
-rw-r--r--kmyfirewall/installer/README.InstallerPackage.txt7
-rw-r--r--kmyfirewall/installer/kmfinstallerplugin.cpp453
-rw-r--r--kmyfirewall/installer/kmfinstallerplugin.desktop55
-rw-r--r--kmyfirewall/installer/kmfinstallerplugin.h117
-rw-r--r--kmyfirewall/installer/kmfinstallerpluginui.rc38
-rw-r--r--kmyfirewall/installer/linux/Makefile.am17
-rw-r--r--kmyfirewall/installer/linux/autoconfighelper.sh264
-rw-r--r--kmyfirewall/installer/linux/installpackage.sh295
-rw-r--r--kmyfirewall/installer/linux/kmfinstall.sh244
-rw-r--r--kmyfirewall/installer/linux/kmfinstaller_linux.desktop62
-rw-r--r--kmyfirewall/installer/linux/kmfiptinstaller.cpp1170
-rw-r--r--kmyfirewall/installer/linux/kmfiptinstaller.h137
-rw-r--r--kmyfirewall/installer/linux/kmfpkginstall.sh195
-rw-r--r--kmyfirewall/installer/openbsd/Makefile822
-rw-r--r--kmyfirewall/installer/openbsd/Makefile.am18
-rw-r--r--kmyfirewall/installer/openbsd/autoconfighelper.sh205
-rw-r--r--kmyfirewall/installer/openbsd/kmfinstaller_openbsd.desktop18
-rw-r--r--kmyfirewall/installer/openbsd/kmfpfinstaller.cpp1130
-rw-r--r--kmyfirewall/installer/openbsd/kmfpfinstaller.h116
-rw-r--r--kmyfirewall/ipteditor/Makefile.am34
-rw-r--r--kmyfirewall/ipteditor/kmfchainedit.cpp252
-rw-r--r--kmyfirewall/ipteditor/kmfchainedit.h48
-rw-r--r--kmyfirewall/ipteditor/kmfipteditorpart.cpp308
-rw-r--r--kmyfirewall/ipteditor/kmfipteditorpart.desktop15
-rw-r--r--kmyfirewall/ipteditor/kmfipteditorpart.h124
-rw-r--r--kmyfirewall/ipteditor/kmfipteditorpartui.rc29
-rw-r--r--kmyfirewall/ipteditor/kmfnewchaindlg.cpp115
-rw-r--r--kmyfirewall/ipteditor/kmfnewchaindlg.h60
-rw-r--r--kmyfirewall/ipteditor/kmfruleedit.cpp1517
-rw-r--r--kmyfirewall/ipteditor/kmfruleedit.h171
-rw-r--r--kmyfirewall/ipteditor/kmfruleoption_frag_option.xml7
-rw-r--r--kmyfirewall/ipteditor/kmyfirewallchaineditor.ui893
-rw-r--r--kmyfirewall/ipteditor/kmyfirewallchaineditornewchain.ui263
-rw-r--r--kmyfirewall/ipteditor/kmyfirewallruleeditor.ui757
-rw-r--r--kmyfirewall/kmfconfigdialog.cpp415
-rw-r--r--kmyfirewall/kmfconfigdialog.h107
-rw-r--r--kmyfirewall/kmfdisclaimer.cpp48
-rw-r--r--kmyfirewall/kmfgrs.desktop21
-rw-r--r--kmyfirewall/kmfnet.desktop20
-rw-r--r--kmyfirewall/kmfpkg.desktop20
-rw-r--r--kmyfirewall/kmfrs.desktop21
-rw-r--r--kmyfirewall/kmfwidgets/Makefile.am38
-rw-r--r--kmyfirewall/kmfwidgets/kmfchecklistitem.cpp58
-rw-r--r--kmyfirewall/kmfwidgets/kmfchecklistitem.h53
-rw-r--r--kmyfirewall/kmfwidgets/kmfchecklistoutput.cpp104
-rw-r--r--kmyfirewall/kmfwidgets/kmfchecklistoutput.h64
-rw-r--r--kmyfirewall/kmfwidgets/kmfdocumentinfo.cpp80
-rw-r--r--kmyfirewall/kmfwidgets/kmfdocumentinfo.h58
-rw-r--r--kmyfirewall/kmfwidgets/kmfgenericinterfaceeditprotocol.cpp452
-rw-r--r--kmyfirewall/kmfwidgets/kmfgenericinterfaceeditprotocol.h90
-rw-r--r--kmyfirewall/kmfwidgets/kmfhostwidget.cpp368
-rw-r--r--kmyfirewall/kmfwidgets/kmfhostwidget.h69
-rw-r--r--kmyfirewall/kmfwidgets/kmfinterfacewidget.cpp173
-rw-r--r--kmyfirewall/kmfwidgets/kmfinterfacewidget.h63
-rw-r--r--kmyfirewall/kmfwidgets/kmfiptdocoptions.cpp88
-rw-r--r--kmyfirewall/kmfwidgets/kmfiptdocoptions.h49
-rw-r--r--kmyfirewall/kmfwidgets/kmfiptdocview.cpp110
-rw-r--r--kmyfirewall/kmfwidgets/kmfiptdocview.h69
-rw-r--r--kmyfirewall/kmfwidgets/kmfipv4addresswidget.cpp117
-rw-r--r--kmyfirewall/kmfwidgets/kmfipv4addresswidget.h52
-rw-r--r--kmyfirewall/kmfwidgets/kmflistview.cpp1148
-rw-r--r--kmyfirewall/kmfwidgets/kmflistview.h91
-rw-r--r--kmyfirewall/kmfwidgets/kmflistviewitem.cpp431
-rw-r--r--kmyfirewall/kmfwidgets/kmflistviewitem.h144
-rw-r--r--kmyfirewall/kmfwidgets/kmfmainwindow.cpp30
-rw-r--r--kmyfirewall/kmfwidgets/kmfmainwindow.h46
-rw-r--r--kmyfirewall/kmfwidgets/kmfmultiportwidget.cpp134
-rw-r--r--kmyfirewall/kmfwidgets/kmfmultiportwidget.h56
-rw-r--r--kmyfirewall/kmfwidgets/kmfmynetworkwidget.cpp585
-rw-r--r--kmyfirewall/kmfwidgets/kmfmynetworkwidget.h107
-rw-r--r--kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.cpp293
-rw-r--r--kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.h63
-rw-r--r--kmyfirewall/kmfwidgets/kmfnetworkwidget.cpp180
-rw-r--r--kmyfirewall/kmfwidgets/kmfnetworkwidget.h65
-rw-r--r--kmyfirewall/kmfwidgets/kmfnewdocdlg.cpp96
-rw-r--r--kmyfirewall/kmfwidgets/kmfnewdocdlg.h52
-rw-r--r--kmyfirewall/kmfwidgets/kmfobjectinfo.cpp110
-rw-r--r--kmyfirewall/kmfwidgets/kmfobjectinfo.h53
-rw-r--r--kmyfirewall/kmfwidgets/kmfportwidget.cpp294
-rw-r--r--kmyfirewall/kmfwidgets/kmfportwidget.h45
-rw-r--r--kmyfirewall/kmfwidgets/kmfprocout.cpp208
-rw-r--r--kmyfirewall/kmfwidgets/kmfprocout.h82
-rw-r--r--kmyfirewall/kmfwidgets/kmfprotocollistview.cpp197
-rw-r--r--kmyfirewall/kmfwidgets/kmfprotocollistview.h66
-rw-r--r--kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.cpp230
-rw-r--r--kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.h63
-rw-r--r--kmyfirewall/kmfwidgets/kmfqtdesignerplugin.cpp73
-rw-r--r--kmyfirewall/kmfwidgets/kmfqtdesignerplugin.h44
-rw-r--r--kmyfirewall/kmfwidgets/kmfselectactivetarget.cpp190
-rw-r--r--kmyfirewall/kmfwidgets/kmfselectactivetarget.h61
-rw-r--r--kmyfirewall/kmfwidgets/kmfselectinterface.cpp117
-rw-r--r--kmyfirewall/kmfwidgets/kmfselectinterface.h53
-rw-r--r--kmyfirewall/kmfwidgets/kmfsystemsettingslinux.cpp189
-rw-r--r--kmyfirewall/kmfwidgets/kmfsystemsettingslinux.h57
-rw-r--r--kmyfirewall/kmfwidgets/kmftemplatechooser.cpp154
-rw-r--r--kmyfirewall/kmfwidgets/kmftemplatechooser.h72
-rw-r--r--kmyfirewall/kmfwidgets/kmftransactionlog.cpp278
-rw-r--r--kmyfirewall/kmfwidgets/kmftransactionlog.h72
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewalldocumentinfo.ui184
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallgenericinterfaceeditprotocolwidget.ui351
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallhostwidget.ui437
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallinterfacewidget.ui152
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewalliptdocoptions.ui402
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallipv4adddresswidget.ui161
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallmultiportwidget.ui229
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallmynetworkwidget.ui189
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallnethostproperties.ui234
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallnetworkwidget.ui330
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallnewdocument.ui409
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallobjectinfo.ui166
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallportwidget.ui177
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallprotocollistview.ui70
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallprotocolpropertieswidget.ui173
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallselectactivetarget.ui181
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallselectinterface.ui392
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewallsystemsettingslinux.ui202
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewalltemplatechooser.ui474
-rw-r--r--kmyfirewall/kmfwidgets/kmyfirewalltransactionlog.ui344
-rw-r--r--kmyfirewall/kmyfirewall.cpp1113
-rw-r--r--kmyfirewall/kmyfirewall.desktop38
-rw-r--r--kmyfirewall/kmyfirewall.h178
-rw-r--r--kmyfirewall/kmyfirewallrc7
-rw-r--r--kmyfirewall/kmyfirewallui.rc56
-rw-r--r--kmyfirewall/main.cpp78
-rw-r--r--kmyfirewall/ruleoptionplugins/Makefile.am5
-rw-r--r--kmyfirewall/ruleoptionplugins/README75
-rw-r--r--kmyfirewall/ruleoptionplugins/custom_option/Makefile.am22
-rw-r--r--kmyfirewall/ruleoptionplugins/custom_option/kmfruleeditcustomopt.cpp148
-rw-r--r--kmyfirewall/ruleoptionplugins/custom_option/kmfruleeditcustomopt.h53
-rw-r--r--kmyfirewall/ruleoptionplugins/custom_option/kmfruleoption_custom_option.xml9
-rw-r--r--kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptionedit_custom.desktop57
-rw-r--r--kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptioneditcustom.cpp130
-rw-r--r--kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptioneditcustom.h93
-rw-r--r--kmyfirewall/ruleoptionplugins/custom_option/kmyfirewallruleeditorcustomrule.ui372
-rw-r--r--kmyfirewall/ruleoptionplugins/interface_option/Makefile.am26
-rw-r--r--kmyfirewall/ruleoptionplugins/interface_option/kmfruleeditorinterface.cpp155
-rw-r--r--kmyfirewall/ruleoptionplugins/interface_option/kmfruleeditorinterface.h56
-rw-r--r--kmyfirewall/ruleoptionplugins/interface_option/kmfruleoption_interface_option.xml7
-rw-r--r--kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptionedit_interface.desktop57
-rw-r--r--kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptioneditinterface.cpp120
-rw-r--r--kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptioneditinterface.h77
-rw-r--r--kmyfirewall/ruleoptionplugins/interface_option/kmyfirewallruleeditorinterface.ui439
-rw-r--r--kmyfirewall/ruleoptionplugins/ip_option/Makefile.am24
-rw-r--r--kmyfirewall/ruleoptionplugins/ip_option/kmfruleeditip.cpp196
-rw-r--r--kmyfirewall/ruleoptionplugins/ip_option/kmfruleeditip.h69
-rw-r--r--kmyfirewall/ruleoptionplugins/ip_option/kmfruleoption_ip_option.xml7
-rw-r--r--kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptionedit_ip.desktop57
-rw-r--r--kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptioneditip.cpp128
-rw-r--r--kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptioneditip.h87
-rw-r--r--kmyfirewall/ruleoptionplugins/ip_option/kmyfirewallruleeditorip.ui303
-rw-r--r--kmyfirewall/ruleoptionplugins/kmfruleoptionedit.desktop28
-rw-r--r--kmyfirewall/ruleoptionplugins/kmfruletargetoptionedit.desktop28
-rw-r--r--kmyfirewall/ruleoptionplugins/limit_option/Makefile.am23
-rw-r--r--kmyfirewall/ruleoptionplugins/limit_option/kmfruleeditorlimit.cpp144
-rw-r--r--kmyfirewall/ruleoptionplugins/limit_option/kmfruleeditorlimit.h51
-rw-r--r--kmyfirewall/ruleoptionplugins/limit_option/kmfruleoption_limit_option.xml8
-rw-r--r--kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptionedit_limit.desktop55
-rw-r--r--kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptioneditlimit.cpp130
-rw-r--r--kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptioneditlimit.h87
-rw-r--r--kmyfirewall/ruleoptionplugins/limit_option/kmyfirewallruleeditorlimit.ui443
-rw-r--r--kmyfirewall/ruleoptionplugins/log_target_option/Makefile.am21
-rw-r--r--kmyfirewall/ruleoptionplugins/log_target_option/kmfruleedittargetlog.cpp164
-rw-r--r--kmyfirewall/ruleoptionplugins/log_target_option/kmfruleedittargetlog.h52
-rw-r--r--kmyfirewall/ruleoptionplugins/log_target_option/kmfruleoption_target_log_option.xml10
-rw-r--r--kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptionedit_log.desktop55
-rw-r--r--kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptioneditlog.cpp126
-rw-r--r--kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptioneditlog.h76
-rw-r--r--kmyfirewall/ruleoptionplugins/log_target_option/kmyfirewallruleeditortargetlog.ui267
-rw-r--r--kmyfirewall/ruleoptionplugins/mac_option/Makefile.am21
-rw-r--r--kmyfirewall/ruleoptionplugins/mac_option/kmfruleeditmac.cpp222
-rw-r--r--kmyfirewall/ruleoptionplugins/mac_option/kmfruleeditmac.h58
-rw-r--r--kmyfirewall/ruleoptionplugins/mac_option/kmfruleoption_mac_option.xml7
-rw-r--r--kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptionedit_mac.desktop55
-rw-r--r--kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptioneditmac.cpp111
-rw-r--r--kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptioneditmac.h91
-rw-r--r--kmyfirewall/ruleoptionplugins/mac_option/kmyfirewallruleeditormac.ui502
-rw-r--r--kmyfirewall/ruleoptionplugins/mark_target_option/Makefile.am21
-rw-r--r--kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleedittargetmark.cpp96
-rw-r--r--kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleedittargetmark.h55
-rw-r--r--kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleoption_target_mark_option.xml6
-rw-r--r--kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptionedit_mark.desktop57
-rw-r--r--kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptioneditmark.cpp131
-rw-r--r--kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptioneditmark.h79
-rw-r--r--kmyfirewall/ruleoptionplugins/mark_target_option/kmyfirewallruleeditortargetmark.ui142
-rw-r--r--kmyfirewall/ruleoptionplugins/nat_target_option/Makefile.am22
-rw-r--r--kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleeditortargetnat.cpp327
-rw-r--r--kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleeditortargetnat.h63
-rw-r--r--kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleoption_target_nat_option.xml9
-rw-r--r--kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptionedit_nat.desktop57
-rw-r--r--kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptioneditnat.cpp143
-rw-r--r--kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptioneditnat.h88
-rw-r--r--kmyfirewall/ruleoptionplugins/nat_target_option/kmyfirewallruleeditortargetnat.ui339
-rw-r--r--kmyfirewall/ruleoptionplugins/protocol_option/Makefile.am25
-rw-r--r--kmyfirewall/ruleoptionplugins/protocol_option/kmfruleeditorprotocol.cpp725
-rw-r--r--kmyfirewall/ruleoptionplugins/protocol_option/kmfruleeditorprotocol.h67
-rw-r--r--kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoption_protocol_option.xml34
-rw-r--r--kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptionedit_protocol.desktop57
-rw-r--r--kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptioneditprotocol.cpp132
-rw-r--r--kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptioneditprotocol.h89
-rw-r--r--kmyfirewall/ruleoptionplugins/protocol_option/kmyfirewallruleeditorprotocol.ui1189
-rw-r--r--kmyfirewall/ruleoptionplugins/state_option/Makefile.am23
-rw-r--r--kmyfirewall/ruleoptionplugins/state_option/kmfruleeditorstate.cpp128
-rw-r--r--kmyfirewall/ruleoptionplugins/state_option/kmfruleeditorstate.h50
-rw-r--r--kmyfirewall/ruleoptionplugins/state_option/kmfruleoption_state_option.xml7
-rw-r--r--kmyfirewall/ruleoptionplugins/state_option/kmfruleoptionedit_state.desktop56
-rw-r--r--kmyfirewall/ruleoptionplugins/state_option/kmfruleoptioneditstate.cpp126
-rw-r--r--kmyfirewall/ruleoptionplugins/state_option/kmfruleoptioneditstate.h87
-rw-r--r--kmyfirewall/ruleoptionplugins/state_option/kmyfirewallruleeditorstate.ui438
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_option/Makefile.am24
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_option/kmfruleeditortos.cpp219
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_option/kmfruleeditortos.h59
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_option/kmfruleoption_tos_option.xml7
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedit_tos.desktop57
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedittos.cpp131
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedittos.h87
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_option/kmyfirewallruleeditortos.ui173
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_target_option/Makefile.am22
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleeditortos.cpp218
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleeditortos.h59
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleoption_target_tos_reject_option.xml9
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedit_tos.desktop57
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedittos.cpp130
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedittos.h76
-rw-r--r--kmyfirewall/ruleoptionplugins/tos_target_option/kmyfirewallruleeditortos.ui173
-rw-r--r--kmyfirewall/version.h19
-rw-r--r--pics/Makefile.am131
-rw-r--r--pics/builtin-16.pngbin0 -> 930 bytes
-rw-r--r--pics/flame.pngbin0 -> 5058 bytes
-rw-r--r--pics/kmf_snapshot_generic_interface.pngbin0 -> 57659 bytes
-rw-r--r--pics/kmf_snapshot_iptables_interface.pngbin0 -> 80204 bytes
-rw-r--r--pics/kmyfirewall-16-lo.pngbin0 -> 742 bytes
-rw-r--r--pics/kmyfirewall-16.pngbin0 -> 742 bytes
-rw-r--r--pics/kmyfirewall-22.pngbin0 -> 1243 bytes
-rw-r--r--pics/kmyfirewall-32-lo.pngbin0 -> 1835 bytes
-rw-r--r--pics/kmyfirewall-32.pngbin0 -> 1835 bytes
-rw-r--r--pics/kmyfirewall-48-lo.pngbin0 -> 3006 bytes
-rw-r--r--pics/kmyfirewall-48.pngbin0 -> 3006 bytes
-rw-r--r--pics/kmyfirewall-64.pngbin0 -> 3648 bytes
-rw-r--r--pics/reject.pngbin0 -> 506 bytes
-rw-r--r--pics/rule-16.pngbin0 -> 800 bytes
-rw-r--r--pics/rule-22.pngbin0 -> 1108 bytes
-rw-r--r--pics/rule-32.pngbin0 -> 1694 bytes
-rw-r--r--pics/rule-48.pngbin0 -> 2851 bytes
-rw-r--r--pics/rule-64.pngbin0 -> 3849 bytes
-rw-r--r--pics/splash.pngbin0 -> 36498 bytes
-rw-r--r--pics/splash_cut.pngbin0 -> 39158 bytes
-rw-r--r--pics/table-16.pngbin0 -> 797 bytes
-rw-r--r--pics/target.pngbin0 -> 205 bytes
-rw-r--r--pics/user_defined-16.pngbin0 -> 752 bytes
-rw-r--r--stamp-h.in0
-rw-r--r--subdirs6
-rw-r--r--templates/02_workstation_template.tkmfgrs43
-rw-r--r--templates/02_workstation_template.tkmfrs401
-rw-r--r--templates/03_nat_router_template.tkmfgrs39
-rw-r--r--templates/03_nat_router_template.tkmfrs70
-rw-r--r--templates/04_web_server_template.tkmfgrs45
-rw-r--r--templates/04_web_server_template.tkmfrs357
-rw-r--r--templates/Makefile.am9
430 files changed, 82838 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..9fbecc0
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+Christian Hubinger <chubinger@gmail.com>
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..6ae4063
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/COPYING-DOCS b/COPYING-DOCS
new file mode 100644
index 0000000..4a0fe1c
--- /dev/null
+++ b/COPYING-DOCS
@@ -0,0 +1,397 @@
+ GNU Free Documentation License
+ Version 1.2, November 2002
+
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The "Document", below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as "you". You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (Thus, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification. Examples of
+transparent image formats include PNG, XCF and JPG. Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".) To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has fewer than five),
+ unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the section all
+ the substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+ or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications". You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e5fc4bf
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,254 @@
+1.1.0 -> 1.1.1
+* Fix: Local firewall installation
+* New: Started implementing OpenBSD support but disabled in this release
+* New: Add Avahi Protocol To protocol Library
+
+1.0.1 -> 1.1.0
+* New: Better auto confguration. Also works on remote hosts.
+* New: undo/redo engine
+* New: Multi target configuration, allows to cofigure multiple firewalls within one document
+* New: Remote installation, uninstallation, start and stop of the firewall
+* New: Define custom protocols for the generic interface
+* Performance optimation in KMFIPTablesScriptGenerator
+* new Base Class for KMFIPTDoc & KMFGenericDoc making them KMFTarget dependent
+* New member in NetFilterObject loadXML( QDomNode )
+* FIX: Network tree reordering in KMFNetZone
+* FIX: Fragment option bug in advanced interface
+* FIX: Closed some memory leaks
+
+
+
+1.0 -> 1.0.1
+* Adding some more protocols to the Protocol library
+* Fix spelling bug in Workstation template
+* Small code cleanup
+* Deleted old Parser and Wizrad files
+* IPTChain, IPTRule: Fix rule index handling
+* KMFRuleEdit: Allow insert of rule.
+* KMFRuleEdit: Fix Rule renamed canceled bug
+* KMFInstallerInterface: cleanup interface add parameter to select the config part to show insted of different methods
+* Add posibilty to export a package containing the scripts needed to install the ruleset on the system
+* Add commandline parameter to define the GUI interface to startup with
+* Fix chain log prefix saving bug
+* Fix multiport ruleoption bug
+
+1.0beta1 -> 1.0
+* Add Compatibility Warning
+* Fix document saving bug
+* Some small code cleanups
+
+0.9.6.2 -> 1.0beta1
+* KMFIPTCompiler plugin now also compiles the KMFIPTDoc class
+* added -v|--version switch for making script not to noisy
+* Moved init script generation to the installer plugin
+* removed unused KMFCompilerPlugin
+* added KMFPluginFactory which handles the plugin lookup & initialisation
+* removed obsolete class KMFRuleEditInterface was unused but i forgot to remove them.
+* removed class KMFIPTInstaller from kmyfirewall/installer/ was unused but i forgot to remove it.
+* Some more API documentation in the core library
+* Code cleanups.
+* Added KEditToolBar.
+* Fixed bug in IPTChain::loadXML(...) Now corectely loads chain attributes.
+* Added table, user_defined and builtin icon
+* changed some icon positions in ListView
+* Moved the object documentation dialog to kmfwidgets
+* Added possibility to document the whole ruleset
+* New KMFRuleEditInterface class as base for KMFRuleEdit to aviod linking the option edit plugins against the libkmfruleeditorpart.la no more "linking against loadable library is not portable warnings"
+* Moved KMFApp to core/
+* Fixed "linking against loadable library is not portable warnings" for libkmyfirewall.la
+* Removing unused kmyfirewall_part.* files and libkmyfirewall.la target
+* Moved kmfinstall.sh to installer/linux/ - fits much better there
+* Adding "name" attribute to the KMFDoc class
+* Adding Open Template dialog showing the sescription and the name of the templates available
+* Added dialog for editing document name anmd description
+* GenericInterfaceProtocol seems to work now
+* lots of fixes in KMFNetZone & KMFNetHost
+* KMFIPTInstallerPlugin can handle genericDoc now
+* KMFIPTCompiler: ConvertToIPDoc and View works now. Shows all tables.
+* KMFIPTCompiler: now compiles genericDoc zones & protocols honoring limit and logging
+* KMFIPTCompiler: adds default connection tracking rule
+* KMFIPTCompiler: finshed rule creation for in & out zones
+* KMFIPTCompiler: finshed rule creation for trstedHosts, malicious hosts, trusted servers & clients
+* KMFNetHost: fixed bug in loadXML(...) no more duplicate protocol entries
+* Refactored KMFIPTablesCompiler.
+* New class KMFIPTablesScriptGenerator - creates an iptables script from a KMFIPTDoc instance
+* New class KMFIPTablesDocumentConverter - generates a KMFIPTdoc from a KMFGenericDoc instance
+* KMFIPTCompiler: finisehd NAT rules creation
+* KMFIPTCompiler: finisehd ICMP rules creation
+* KMFIPTCompiler: finisehd LOGGING rules creation
+* KMFConfigDialog: Interface detection, Plugin listview shows comment now
+* KMFCompilerInterface: adding new methods for getting the name of the os and backend
+* KMFConfigDialog: platform and backend values are now set by the plugins properties
+* KMFSelectInterface: added new dialog that lets you chooss the interface at startup, not finished yet
+* KMFSelectInterface: added screenshot loading, smaller fixes
+* Switching to KConfig XT framework: replaces kmfconfiguration class
+* Several cosmetical changes
+* New Class KMFAppState: Holds some static variables giving information about the app's state
+* Some minor Fixes
+* Started documentaion for plugin framework
+* Enable kdesu for running commands if not started as root
+* Started implementing Template saving
+* Added HP link URl to about dialog
+* Minor code cleanup
+
+0.9.6.1 -> 0.9.6.2
+*Init scripts (should) have proper permissions now. Was a problem that only occoured to Gentoo users where rc-update is used to add the firewall script to the default runlevel.
+* The Wizard used to create wrong rules for custom ports.
+* Other interface types then the allready provided can be used now.
+
+0.9.6 -> 0.9.6.1
+* fixed bug when deleting chain before a rule has been selected
+* code cleanups and lot of spelling fixes
+* changed most QMessageBox to KMessageBox
+* removed disclaimer to be closer to the kde styleguides
+* small GUI fixes
+
+0.9.5 -> 0.9.6
+* fixed bug that made the main view disaper
+* Added a nice splash screen
+* Start Automatic Configuration on first startup
+* some cosmetics
+* a few small bug fixes
+* files can be loaded and saved ftom/to network using KIO Slaves
+* new fancy NewFile dialog
+* custom options can be now defined for rules
+* rules can be documented
+* fiexd bug in gentoo installation
+
+0.9.4 -> 0.9.5
+* Removed main view and replaced it with the Ruleeditor.
+* Made editing modeless.
+* Fixed lots of memory holes and bugs all over the app.
+* Intergrated all the option dialogs not into the main window.
+
+
+0.9.3 -> 0.9.4
+* added ability to enable/disable rules
+* added ability to log every package matching a rule
+* rewritten Protocol Options dialog
+* more sanity checks for the input
+* proper rule name handling
+* this may lead to errors when importing old rulesets!
+* so please check your rulesets after loading it from
+* the *.kmfrs file
+* Some general Usability enhagements
+* added missing logging functionality to the wizard
+* fixed broken tmp file handling
+* several string fixes
+* lots of other bugfixes and enhagements
+
+
+0.9.2 -> 0.9.3
+* changed wizard to fit into 800x600 resolution
+* enhaged speed
+* better usability
+* better documentation
+* fixed lots of bugs
+
+0.4.5.1 -> 0.9.2
+* mostly rewritten core classes
+* Adde missing option dialogs
+* new output viewer
+* new main window
+* lots of icons
+* RMB menus
+* new chain editor
+* new document options dialog
+* extra export of the shellscript
+* new installation mechanism (shell script)
+* new parser
+* started working on the sanity checks
+* started with documentation
+
+
+0.4.5 -> 0.4.5.1
+* bugfixes, bugfixes and again bugfixes :-(
+
+0.4.4 -> 0.4.5
+* Fixed bug in default ruleset generated by the Wizard.
+* Added some missing dialogs for the "Target options" in the
+* Ruleeditor.
+* Improved the main Window, shows now some more detailed information
+* about the rules in the chain (lot of icons).
+* Started working on the Handbook will need some more time to become useful.
+* bugfixes, bugfixes and again bugfixes :-)
+
+0.4.3 -> 0.4.4
+* fixed that nasty config bug that occurred when using the Wizard with
+* Gentoo mode enabled (no more path configuration in the Wizard).
+* some ather smaller bugfixes
+
+0.4.2 -> 0.4.3
+* Added support for the Gentoo Linux init system
+* this included changes in classes KMyFireallDoc, KMFConfig.
+* Ficxed that "perverse" constuctors from the rule option dialogs
+* (classes KMFRuleedit*) now the courrent rule is passed to the
+* class by the Function loadRule(IPTRule*)
+* Several small bugfixes...
+
+0.4.1 -> 0.4.2
+* Swithched all widgets to use *.ui files
+* fixed non-working Option dialogs (ruleeditor)
+* nicer GUI
+* improved data handling
+* added class KMFRuleEditorTos (still unused)
+* fixed install/uninstall functions in KMyFirewallDoc
+
+0.4 -> 0.4.1
+* Added a QWizard class KMFWizard (setsup simple Personal firewall no routing)
+* Implemented most of the configuration stuff
+* only needed tables are now used in the firewallscript
+* bugfixes
+
+0.3 -> 0.4
+* added install/uninstall function (run firewall at bootup)
+* fixed lots of bugs
+* modified script generation
+* modified config dialog (really uses config now)
+* modified the output viewer (uses also .ui interface now)
+* now possible to use just the iptables you need
+* little bit of code cleanup
+
+0.2.2 -> 0.3
+* new internal data structure
+* Added possibility to use the tables nat,mangle (target options ar not implemented yet)
+* Added dialog for limiting matches
+* Added dialog for connection tracking
+* fixed some compiling problems
+* lots of bugfixes
+
+0.2 -> 0.2.2
+* Finished Config dialog
+* Finished Chain editor (except add/del/edit of feeds & fwds)
+* Interface Option dlg now uses configfile
+* splitted the meuns
+* IPTRule: added icmp,all_prot option fixed bug in handling of unused option arguments
+
+
+* IPTChain: added slotGetChainFwds()
+* KMyFirewalldoc: added slotGetChainFeeds(QString&)
+* lots of small bug fixes
+* Added "Protcol Option" Editor dlg
+
+0.1 -> 0.2
+* Added check for user root & for iptables.
+* Added ChainEditror (just some of the Functions)
+* Added OutputViewer - view Output of scripts generated
+* added config dialog (still unused)
+* made chaineditor work (new,del rule and set target and logging options)
+* added Interface rule dialog (just GUI not implemented)
+* changed a lot of small things bugfixes...
+* added logging view in main window
+* now possible to run firewall from within the program
+* added some more warning messages (are you root etc.)
+* checking for iptables at startup
+
+
+
+
+
+
+
+
+
+
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..02a4a07
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,167 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes a while. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 4. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/KMFIPTInterface/KMFIPTInterface.lsm b/KMFIPTInterface/KMFIPTInterface.lsm
new file mode 100644
index 0000000..d1ffbbe
--- /dev/null
+++ b/KMFIPTInterface/KMFIPTInterface.lsm
@@ -0,0 +1,16 @@
+Begin3
+Title: KMFIPTinterface -- Some description
+Version: 0.1
+Entered-date:
+Description:
+Keywords: KDE Qt
+Author: Christian Hubinger <e9806056@student.tuwien.ac.at>
+Maintained-by: Christian Hubinger <e9806056@student.tuwien.ac.at>
+Home-page:
+Alternate-site:
+Primary-site: ftp://ftp.kde.org/pub/kde/unstable/apps/utils
+ xxxxxx kmfiptinterface-0.1.tar.gz
+ xxx kmfiptinterface-0.1.lsm
+Platform: Linux. Needs KDE
+Copying-policy: GPL
+End
diff --git a/KMFIPTInterface/Makefile.am b/KMFIPTInterface/Makefile.am
new file mode 100644
index 0000000..c8b96ab
--- /dev/null
+++ b/KMFIPTInterface/Makefile.am
@@ -0,0 +1,17 @@
+bin_PROGRAMS = kmfiptinterface
+INCLUDES = $(all_includes)
+kmfiptinterface_LDFLAGS = -module $(all_libraries) $(KDE_RPATH)
+kmfiptinterface_LDADD = $(LIB_KIO)
+kmfiptinterface_SOURCES = main.cpp kmfiptinterface.cpp iptchecker.cpp kmfiptinterface.skel
+
+
+noinst_HEADERS = kmfiptinterface.h iptchecker.h
+
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/dcoptest.pot
+
+
+service_DATA = kmfiptinterface.desktop
+servicedir = $(kde_servicesdir)
diff --git a/KMFIPTInterface/README b/KMFIPTInterface/README
new file mode 100644
index 0000000..58e1775
--- /dev/null
+++ b/KMFIPTInterface/README
@@ -0,0 +1,11 @@
+KMFIPTInterface
+---------------
+
+Small dcop interface using the libiptc library to fetch running iptables configuration from the kernel.
+
+As the libiptc library is pure C and links the kernel headers a small modification of the kernel header iptables.h file is needed to build it. Unfortunately there is no real usable C++/C API available to query/modify the iptables configuration.
+
+So i'm not shure if this will acutually work in the end.
+
+The iptables/netfilter team says that currently the only way to communicate with iptables is using a pipe to the iptables-save
+command which is acctuall not a real soulution for such an application but they know this issue and therefore i hope that an C++ compatible API will be available in the future to make this really work.
diff --git a/KMFIPTInterface/iptchecker.cpp b/KMFIPTInterface/iptchecker.cpp
new file mode 100644
index 0000000..bf6979d
--- /dev/null
+++ b/KMFIPTInterface/iptchecker.cpp
@@ -0,0 +1,234 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Christian Hubinger *
+ * e9806056@student.tuwien.ac.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#include "iptchecker.h"
+
+
+extern "C" {
+#include <getopt.h>
+#include <sys/errno.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dlfcn.h>
+#include <time.h>
+#include <netdb.h>
+#include "libiptc/libiptc.h"
+#include "iptables.h"
+}
+
+
+/* Here begins some of the code taken from iptables-save.c **************** */
+#define IP_PARTS_NATIVE(n) \
+ (unsigned int)((n)>>24)&0xFF, \
+ (unsigned int)((n)>>16)&0xFF, \
+ (unsigned int)((n)>>8)&0xFF, \
+ (unsigned int)((n)&0xFF)
+
+
+
+IPTChecker::IPTChecker()
+{
+}
+
+
+IPTChecker::~IPTChecker()
+{
+}
+
+int IPTChecker::numChainsInTable( char *tablename ) {
+ int foundChain = 0;
+ iptc_handle_t h;
+ const char *chain = NULL;
+
+ h = iptc_init(tablename);
+ if (!h) {
+ printf("Can't initialize IPT Handle for table %s : %s\n", tablename, iptc_strerror(errno));
+ return -1;
+ }
+
+ for (chain = iptc_first_chain(&h); chain; chain = iptc_next_chain(&h)) {
+ foundChain++;
+ }
+ printf("Table %s Num: %d\n", tablename, foundChain );
+ return foundChain;
+}
+
+
+int IPTChecker::numRulesInChain( char *tablename, char *chain ) {
+ int foundRule = 0;
+ iptc_handle_t h;
+ const struct ipt_entry *e;
+ const char *ch = NULL;
+
+ h = iptc_init(tablename);
+ if (!h) {
+ printf("Can't initialize IPT Handle for table %s : %s\n", tablename, iptc_strerror(errno));
+ return -1;
+ }
+
+ if ( iptc_is_chain( chain, h ) == 0 ) {
+ printf("Error Chain: %s Not Found in table: %s\n", chain, tablename );
+ return -1;
+ }
+ for (ch = iptc_first_chain(&h); ch; ch = iptc_next_chain(&h)) {
+ if ( strcmp( ch, chain ) == 0 ) {
+ int found = 0;
+ for (e = iptc_first_rule(ch, &h); e && found == 0; e = iptc_next_rule(e, &h)) {
+ foundRule++;
+ }
+ printf("Table: %s Chain: %s Num Rules: %d\n", tablename, chain, foundRule );
+ return foundRule;
+ }
+ }
+ return -1;
+}
+QStringList IPTChecker::getRuleProperties( char * table, char *chain, int ruleIndex ) {
+ QStringList list;
+ int numRules = 0;
+ int found = 0;
+ iptc_handle_t h;
+ const struct ipt_entry *rule = 0;
+ const struct ipt_entry *my_rule = 0;
+ const char *ch = NULL;
+
+ h = iptc_init(table);
+ if (!h) {
+ printf("Can't initialize IPT Handle for table %s : %s\n", table, iptc_strerror(errno));
+ return list;
+ }
+
+ if ( iptc_is_chain( chain, h ) == 0 ) {
+ printf("Error Chain: %s Not Found in table: %s\n", chain, table );
+ return list;
+ }
+ int foundChain = 0;
+ for (ch = iptc_first_chain(&h); ch && foundChain == 0; ch = iptc_next_chain(&h)) {
+ if ( strcmp( ch, chain ) == 0 ) {
+ foundChain = 1;
+ for (rule = iptc_first_rule(ch, &h); rule && found == 0; rule = iptc_next_rule(rule, &h)) {
+ if ( numRules == ruleIndex ) {
+ my_rule = rule;
+ found = 1;
+ }
+ numRules++;
+ }
+ }
+ }
+ if ( my_rule ) {
+ const char *target_name;
+ /* Print target name */
+ target_name = iptc_get_target( my_rule, &h );
+ if ( target_name && (*target_name != '\0') ) {
+
+ list << QString("%1").arg(target_name);
+ }
+
+
+ /* Print targinfo part */
+/* struct ipt_entry_target *t;
+ t = ipt_get_target( (struct ipt_entry *) my_rule );
+ if ( t ) {
+ list << "Found Target:";
+ list << t->u.user.name;
+ }
+
+ if ( t->u.user.name ) {
+ list << QString("TARGET2:%1").arg(t->u.user.name);
+
+ struct iptables_target *target = find_target( target_name, TRY_LOAD );
+
+ if ( ! target ) {
+ list << "Can't find library for target `%s'\n" << t->u.user.name;
+ return list;
+ }
+
+ if (target->save) {
+ target->save(&my_rule->ip, t);
+ } else {
+ // If the target size is greater than ipt_entry_target
+ // there is something to be saved, we just don't know
+ // how to print it
+ if (t->u.target_size != sizeof(struct ipt_entry_target)) {
+ fprintf(stderr, "Target `%s' is missing "
+ "save function\n",
+ t->u.user.name);
+ return list;
+ }
+ }
+ }*/
+ } else {
+ list << "ERROR";
+ }
+ return list;
+}
+
+QStringList IPTChecker::getChainsInTable( char * table ) {
+ QStringList list;
+ int foundRule = 0;
+ iptc_handle_t h;
+ const struct ipt_entry *e;
+ const char *chain = NULL;
+
+ h = iptc_init(table);
+ if (!h) {
+ printf("Can't initialize IPT Handle for table %s : %s\n", table, iptc_strerror(errno));
+ return list;
+ }
+
+
+ for ( chain = iptc_first_chain(&h); chain; chain = iptc_next_chain(&h) ) {
+ list << chain;
+ }
+ return list;
+}
+
+
+QString IPTChecker::getChainPolicy( char * table, char *chain ) {
+ QString policy = "";
+ iptc_handle_t h;
+ const struct ipt_entry *e;
+ const char *ch = NULL;
+
+ h = iptc_init(table);
+ if (!h) {
+ printf("Can't initialize IPT Handle for table %s : %s\n", table, iptc_strerror(errno));
+ return "";
+ }
+
+
+ for ( ch = iptc_first_chain(&h); ch; ch = iptc_next_chain(&h) ) {
+ if ( strcmp( ch, chain ) == 0 ) {
+
+ if ( iptc_builtin(chain, h) ) {
+ struct ipt_counters count;
+ policy = iptc_get_policy(chain, &count, &h);
+
+/* printf("%s ",
+ iptc_get_policy(chain, &count, &h));
+ printf("[%llu:%llu]\n", (unsigned long long)count.pcnt, (unsigned long long)count.bcnt);*/
+ } else {
+// printf("- [0:0]\n");
+ }
+
+ }
+ }
+ return policy;
+}
diff --git a/KMFIPTInterface/iptchecker.h b/KMFIPTInterface/iptchecker.h
new file mode 100644
index 0000000..51369d6
--- /dev/null
+++ b/KMFIPTInterface/iptchecker.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Christian Hubinger *
+ * e9806056@student.tuwien.ac.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#ifndef IPTCHECKER_H
+#define IPTCHECKER_H
+
+#include <qstringlist.h>
+
+/**
+@author Christian Hubinger
+*/
+class IPTChecker{
+public:
+ IPTChecker();
+
+ ~IPTChecker();
+
+ int numChainsInTable( char *tablename );
+ int numRulesInChain( char *tablename, char *chain );
+ QStringList getChainsInTable( char * table );
+ QString getChainPolicy( char * table, char *chain );
+ QStringList getRuleProperties( char * table, char *chain, int ruleIndex );
+};
+
+#endif
diff --git a/KMFIPTInterface/kmfiptinterface.cpp b/KMFIPTInterface/kmfiptinterface.cpp
new file mode 100644
index 0000000..e963383
--- /dev/null
+++ b/KMFIPTInterface/kmfiptinterface.cpp
@@ -0,0 +1,115 @@
+ /***************************************************************************
+ * Copyright (C) 2005 by Christian Hubinger *
+ * e9806056@student.tuwien.ac.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include "iptchecker.h"
+
+#include "kmfiptinterface.h"
+#include <kdebug.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include <dcopobject.h>
+#include <dcopclient.h>
+
+
+
+KMFIPTInterface::KMFIPTInterface() : DCOPObject("KMFIPTInterface")
+{
+ kdDebug() << "Starting new service... " << endl;
+ m_List = QStringList();
+}
+
+KMFIPTInterface::~KMFIPTInterface()
+{
+ kdDebug() << "Going away... " << endl;
+}
+
+QString KMFIPTInterface::string(int idx)
+{
+ return *m_List.at(idx);
+}
+
+QStringList KMFIPTInterface::list()
+{
+ return m_List;
+}
+
+void KMFIPTInterface::add(QString arg)
+{
+ kdDebug() << "Adding " << arg << " to the list" << endl;
+ m_List << arg;
+}
+
+bool KMFIPTInterface::remove(QString arg)
+{
+ QStringList::Iterator it = m_List.find(arg);
+ if (it != m_List.end())
+ {
+ m_List.remove(it);
+ }
+ else
+ return false;
+ return true;
+}
+
+bool KMFIPTInterface::exit()
+{
+ kapp->quit();
+ return 0;
+}
+
+void KMFIPTInterface::Test() {
+ KMessageBox::information(0 , i18n("Called KMFIPTInterface::Test()") );
+}
+
+int KMFIPTInterface::numRulesInChain( QString table , QString chain ) {
+ IPTChecker *chk = new IPTChecker();
+ char *ctable = strdup(table);
+ char *cchain = strdup(chain);
+ return chk->numRulesInChain( ctable, cchain );
+}
+
+int KMFIPTInterface::numChainsInTable( QString table ) {
+ IPTChecker *chk = new IPTChecker();
+ char *ctable = strdup(table);
+ return chk->numChainsInTable( ctable );
+}
+
+QStringList KMFIPTInterface::getChainsInTable( QString table ) {
+ IPTChecker *chk = new IPTChecker();
+ char *ctable = strdup(table);
+ return chk->getChainsInTable( ctable );
+}
+
+QStringList KMFIPTInterface::getRuleProperties( QString table , QString chain , int index ) {
+ IPTChecker *chk = new IPTChecker();
+ char *ctable = strdup(table);
+ char *cchain = strdup(chain);
+ return chk->getRuleProperties( ctable, cchain, index );
+}
+
+QString KMFIPTInterface::getChainPolicy( QString table , QString chain ) {
+ IPTChecker *chk = new IPTChecker();
+ char *ctable = strdup(table);
+ char *cchain = strdup(chain);
+ return chk->getChainPolicy( ctable, cchain );
+}
+
diff --git a/KMFIPTInterface/kmfiptinterface.desktop b/KMFIPTInterface/kmfiptinterface.desktop
new file mode 100644
index 0000000..7ee32f6
--- /dev/null
+++ b/KMFIPTInterface/kmfiptinterface.desktop
@@ -0,0 +1,39 @@
+[Desktop Entry]
+Comment=KMyFirewall iptables interface
+Comment[bg]=Интерфейс за iptables на KMyFirewall
+Comment[br]=Etrefas ipables KMyFirewall
+Comment[ca]=Interfície per a iptables KMyFirewall
+Comment[cs]=iptable rozhraní KMyFirewall
+Comment[da]=IP-tabelgrænseflade for KMyFirewall
+Comment[de]=Oberfläche für iptables
+Comment[el]=Διασύνδεση iptables του KMyFirewall
+Comment[es]=Interfaz a iptables de KMyFirewall
+Comment[et]=KMyFirewalli IPTablesi liides
+Comment[fr]=Interface iptables de KMyFirewall
+Comment[ga]=Comhéadan iptables KMyFirewall
+Comment[gl]=Interface de KMyFirewall para iptables
+Comment[it]=Interfaccia a iptables KMyFirewall
+Comment[ja]=KMyFirewall iptables インターフェース
+Comment[ka]=KMyFirewall iptables ინტერფეისი
+Comment[lt]=KMyFirewall – IPTables tvarkymo sąsaja
+Comment[nl]=KMyFirewall iptables-interface
+Comment[pl]=Interfejs iptables KMyFirewall
+Comment[pt]=Interface para o 'iptables' do KMyFirewall
+Comment[pt_BR]=Interface do iptables no KMyFirewall
+Comment[sr]=KMyFirewall-ов интерфејс за iptables
+Comment[sr@Latn]=KMyFirewall-ov interfejs za iptables
+Comment[sv]=IP-tabellgränssnitt för Min brandvägg
+Comment[tr]=KMyFirewall iptables Kural Belirleyici
+Comment[uk]=Інтерфейс KMyFirewall до iptables
+Comment[xx]=xxKMyFirewall iptables interfacexx
+Exec=kmfiptinterface
+Icon=
+Name=kmfiptinterface
+Name[pl]=kmfiptinterfejs
+Name[pt_BR]=Interface do Iptables
+Name[sv]=IP-gränssnitt för Min brandvägg
+Name[tr]=kmf ip arabirimi
+Name[xx]=xxkmfiptinterfacexx
+Type=Service
+X-DCOP-ServiceType=Unique
+X-KDE-StartupNotify=false
diff --git a/KMFIPTInterface/kmfiptinterface.h b/KMFIPTInterface/kmfiptinterface.h
new file mode 100644
index 0000000..512f73b
--- /dev/null
+++ b/KMFIPTInterface/kmfiptinterface.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Christian Hubinger *
+ * e9806056@student.tuwien.ac.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+
+#ifndef _kmfiptinterface_H
+#define _kmfiptinterface_H
+
+#include <qstringlist.h>
+#include <qstring.h>
+#include <dcopobject.h>
+
+class KMFIPTInterface : public DCOPObject
+{
+ K_DCOP
+
+ private:
+ QStringList m_List;
+
+ public:
+ KMFIPTInterface();
+
+ ~KMFIPTInterface();
+
+ k_dcop:
+ QString string(int);
+ QStringList list();
+
+ void add(QString);
+ bool remove(QString);
+ bool exit();
+
+ void Test();
+ int numRulesInChain( QString, QString );
+ int numChainsInTable( QString );
+ QStringList getChainsInTable( QString );
+ QStringList getRuleProperties( QString, QString, int );
+
+ QString getChainPolicy( QString, QString );
+};
+#endif
diff --git a/KMFIPTInterface/kmfiptinterface_ctl b/KMFIPTInterface/kmfiptinterface_ctl
new file mode 100755
index 0000000..05c2688
--- /dev/null
+++ b/KMFIPTInterface/kmfiptinterface_ctl
@@ -0,0 +1,7 @@
+#!/bin/bash
+SERVER="`dcopserver --serverid 2>&1`"
+echo -n "Server:"
+echo $SERVER
+kdesu -t --nonewdcop -u root -c kmfiptinterface --dcopserver=$SERVER
+
+
diff --git a/KMFIPTInterface/main.cpp b/KMFIPTInterface/main.cpp
new file mode 100644
index 0000000..c3e28ee
--- /dev/null
+++ b/KMFIPTInterface/main.cpp
@@ -0,0 +1,67 @@
+/***************************************************************************
+* Copyright (C) 2005 by Christian Hubinger *
+* e9806056@student.tuwien.ac.at *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+***************************************************************************/
+
+
+#include <kuniqueapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <dcopclient.h>
+#include "kmfiptinterface.h"
+#include "version.h"
+static const char description[] =
+ I18N_NOOP( "A KDE KPart Application" );
+
+static const char version[] = "0.1";
+
+static KCmdLineOptions options[] =
+ {
+ KCmdLineLastOption
+ };
+
+int main ( int argc, char *argv[] ) {
+ KLocale::setMainCatalogue( "kdelibs" );
+ KAboutData aboutdata( "kmfiptinterface", I18N_NOOP( "KDE" ),
+ version, description,
+ KAboutData::License_GPL, "(C) 2001, Christian Hubinger" );
+ aboutdata.addAuthor( "Christian Hubinger", I18N_NOOP( "Developer" ), "e9806056@student.tuwien.ac.at" );
+
+ KCmdLineArgs::init( argc, argv, &aboutdata );
+ KCmdLineArgs::addCmdLineOptions( options );
+ KUniqueApplication::addCmdLineOptions();
+ kdDebug() << "Starting up...!" << endl;
+ if ( ! KUniqueApplication::start() ) {
+ kdDebug() << "kmfiptinterface is already running!" << endl;
+ return ( 0 );
+ }
+
+ KUniqueApplication app;
+ kdDebug() << "starting kmfiptinterface " << endl;
+ // This app is started automatically, no need for session management
+ app.dcopClient() ->setAcceptCalls( true );
+ kdDebug() << app.dcopClient() ->appId() << endl;
+ kdDebug() << "starting kmfiptinterface " << endl;
+
+ app.disableSessionManagement();
+ /*KMFIPTInterface *service =*/ new KMFIPTInterface;
+ return app.exec();
+
+}
diff --git a/KMFSysTray/Makefile.am b/KMFSysTray/Makefile.am
new file mode 100644
index 0000000..a1fb991
--- /dev/null
+++ b/KMFSysTray/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES= -I$(srcdir)/../kmyfirewall/core -I$(srcdir)/../kmyfirewall/kmfwidgets -I$(srcdir)/../kmyfirewall/interfaces $(all_includes)
+METASOURCES = AUTO
+
+bin_PROGRAMS = kmfsystray
+
+
+
+
+
+kmfsystray_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+kmfsystray_LDADD = ../kmyfirewall/core/libkmfcore.la ../kmyfirewall/kmfwidgets/libkmfwidgets.la $(LIB_KDEUI) $(LIB_KPARTS)
+
+kmfsystray_DATA = kmfsystray.desktop
+kmfsystraydir = $(kde_datadir)/kicker/applets
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kmfsystray.pot
+
+
+kmfsystray_SOURCES = kmfsystray.cpp app.cpp mainwidget.cpp \
+ mainwidget_designer.ui details.cpp details_designer.ui kmfiptwatcher.cpp main.cpp
diff --git a/KMFSysTray/README b/KMFSysTray/README
new file mode 100644
index 0000000..8aadbd2
--- /dev/null
+++ b/KMFSysTray/README
@@ -0,0 +1,4 @@
+KMFSysTray
+----------
+
+Systray applet that show the running iptables configuration in KMF's iptables rule view. It communicates with the KMFIPTInterface to fetch the running iptables configuration.
diff --git a/KMFSysTray/app.cpp b/KMFSysTray/app.cpp
new file mode 100644
index 0000000..bacfda0
--- /dev/null
+++ b/KMFSysTray/app.cpp
@@ -0,0 +1,63 @@
+//
+// C++ Implementation: app
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <e9806056@student.tuwien.ac.at>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "app.h"
+
+// #include <qlcdnumber.h>
+// #include <qlayout.h>
+//
+// // KDE includes
+// #include <kglobal.h>
+// #include <klocale.h>
+// #include <kaboutdata.h>
+// #include <kconfig.h>
+// #include <kapplication.h>
+// #include <kmessagebox.h>
+// #include <kapplication.h>
+// #include <kmessagebox.h>
+// #include <dcopclient.h>
+// #include <kaboutapplication.h>
+
+
+/*
+#include "kmfsystray.h"
+#include "kmfiptwatcher.h"
+#include "mainwidget.h"
+*/
+
+MainApp::MainApp() : KApplication() {
+
+
+ // Get the current application configuration handle
+// KMessageBox::information( 0, i18n( "Starting Deamon" ) );
+
+// KConfig *ksConfig = config();
+// KMFIPTWatcher *watch = new KMFIPTWatcher( this, "KMFIPTWatcher" );
+// MainWidget *mainWid = new MainWidget( 0 );
+// connect( watch, SIGNAL( sigUpdateActive( bool ) ), mainWid, SLOT( slotSetRunningStatus( bool ) ) );
+// connect( watch, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ),
+// mainWid, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ) );
+
+// connect( mainWid, SIGNAL( sigQueryDetails( bool ) ), watch, SLOT( slotQueryDetails( bool ) ) );
+/*
+ QHBoxLayout *_layout = new QHBoxLayout(this);
+ _layout->add(mainWid);*/
+
+
+
+
+
+}
+
+
+MainApp::~MainApp() {}
+
+
diff --git a/KMFSysTray/app.h b/KMFSysTray/app.h
new file mode 100644
index 0000000..2056072
--- /dev/null
+++ b/KMFSysTray/app.h
@@ -0,0 +1,27 @@
+//
+// C++ Interface: app
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <e9806056@student.tuwien.ac.at>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef APP_H
+#define APP_H
+
+#include <kapplication.h>
+
+/**
+@author Christian Hubinger
+*/
+class MainApp : public KApplication {
+public:
+ MainApp();
+ ~MainApp();
+
+};
+
+#endif
diff --git a/KMFSysTray/details.cpp b/KMFSysTray/details.cpp
new file mode 100644
index 0000000..067d697
--- /dev/null
+++ b/KMFSysTray/details.cpp
@@ -0,0 +1,109 @@
+/***************************************************************************
+* Copyright (C) 2005 by Christian Hubinger *
+* e9806056@student.tuwien.ac.at *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+***************************************************************************/
+
+
+#include "details.h"
+
+// QT includes
+#include <qlcdnumber.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <kpushbutton.h>
+
+Details::Details( QWidget* parent, const char* name, WFlags fl )
+ : DetailsDesigner( parent, name, fl ) {
+
+ QObject::connect( m_cmd_close, SIGNAL( clicked() ), this, SLOT ( close() ) );
+
+}
+
+Details::~Details() {}
+
+/*$SPECIALIZATION$*/
+
+void Details::close() {
+ kdDebug() << "void Details::close()" << endl;
+ emit closing();
+ QWidget::close();
+}
+
+void Details::show() {
+ kdDebug() << "void Details::show()" << endl;
+ emit showing();
+ QWidget::show();
+}
+
+void Details::hide() {
+ kdDebug() << "void Details::hide()" << endl;
+ emit closing();
+ QWidget::hide();
+}
+
+void Details::slotUpdateRuleCount( const QString& table, const QString& chain, int num ) {
+ kdDebug() << "slotUpdateRuleCount( const QString& " << table << ", const QString& " << chain << ", int " << num << " )" << endl;
+ QLCDNumber *lcd = 0;
+ if ( table == "filter" ) {
+ if ( chain == "INPUT" ) {
+ lcd = m_lcd_numRulesIn_Filter_Input;
+ }
+ if ( chain == "OUTPUT" ) {
+ lcd = m_lcd_numRulesIn_Filter_Output;
+ }
+ if ( chain == "FORWARD" ) {
+ lcd = m_lcd_numRulesIn_Filter_Forward;
+ }
+ } else if ( table == "nat" ) {
+ if ( chain == "OUTPUT" ) {
+ lcd = m_lcd_numRulesIn_Nat_Output;
+ }
+ if ( chain == "PREROUTING" ) {
+ lcd = m_lcd_numRulesIn_Nat_Prerouting;
+ }
+ if ( chain == "POSTROUTING" ) {
+ lcd = m_lcd_numRulesIn_Nat_Postrouting;
+ }
+ } else if ( table == "mangle" ) {
+ if ( chain == "INPUT" ) {
+ lcd = m_lcd_numRulesIn_Mangle_Input;
+ }
+ if ( chain == "OUTPUT" ) {
+ lcd = m_lcd_numRulesIn_Mangle_Output;
+ }
+ if ( chain == "FORWARD" ) {
+ lcd = m_lcd_numRulesIn_Mangle_Forward;
+ }
+ if ( chain == "PREROUTING" ) {
+ lcd = m_lcd_numRulesIn_Mangle_Prerouting;
+ }
+ if ( chain == "POSTROUTING" ) {
+ lcd = m_lcd_numRulesIn_Mangle_Postrouting;
+ }
+
+ }
+ if ( ! lcd ) {
+ kdDebug() << "ERROR unknown chain or table" << endl;
+ return;
+ }
+ lcd->display( num );
+}
+
+#include "details.moc"
+
diff --git a/KMFSysTray/details.h b/KMFSysTray/details.h
new file mode 100644
index 0000000..b468f09
--- /dev/null
+++ b/KMFSysTray/details.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+* Copyright (C) 2005 by Christian Hubinger *
+* e9806056@student.tuwien.ac.at *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+***************************************************************************/
+
+#ifndef DETAILS_H
+#define DETAILS_H
+
+#include "details_designer.h"
+
+class Details : public DetailsDesigner {
+ Q_OBJECT
+
+public:
+ Details( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~Details();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ void close();
+ void show();
+ void hide();
+ void slotUpdateRuleCount( const QString&, const QString&, int );
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+
+signals:
+ void closing();
+ void showing();
+
+};
+
+#endif
+
diff --git a/KMFSysTray/details_designer.ui b/KMFSysTray/details_designer.ui
new file mode 100644
index 0000000..9a5b1f9
--- /dev/null
+++ b/KMFSysTray/details_designer.ui
@@ -0,0 +1,484 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>DetailsDesigner</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>DetailsDesigner</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>314</width>
+ <height>217</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="KPushButton" row="2" column="2">
+ <property name="name">
+ <cstring>m_cmd_close</cstring>
+ </property>
+ <property name="text">
+ <string>Close &amp;Window</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="2" column="0">
+ <property name="name">
+ <cstring>m_cmd_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <widget class="QWidgetStack" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>widgetStack1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WStackPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRules_Filter_Input</cstring>
+ </property>
+ <property name="text">
+ <string>INPUT:</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="0" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Filter_Input</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRules_Filter_Output</cstring>
+ </property>
+ <property name="text">
+ <string>OUTPUT:</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="1" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Filter_Output</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRules_Filter_Forward</cstring>
+ </property>
+ <property name="text">
+ <string>FORWARD:</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="2" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Filter_Forward</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="2">
+ <property name="name">
+ <cstring>m_lbl_numRulesInfilter_2_3_5_3</cstring>
+ </property>
+ <property name="text">
+ <string>POLICY:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>m_lbl_numRulesInfilter_2_3_5_2</cstring>
+ </property>
+ <property name="text">
+ <string>POLICY:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="3">
+ <property name="name">
+ <cstring>m_lbl_policy_filter_output</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;Policy&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="3">
+ <property name="name">
+ <cstring>m_lbl_policy_filter_forward</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;Policy&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>m_lbl_numRulesInfilter_2_3_5</cstring>
+ </property>
+ <property name="text">
+ <string>POLICY:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="3">
+ <property name="name">
+ <cstring>m_lbl_policy_filter_input</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;Policy&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WStackPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>1</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRulesInfilter_2</cstring>
+ </property>
+ <property name="text">
+ <string>OUTPUT:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="3">
+ <property name="name">
+ <cstring>m_lbl_policy_nat_output</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;Policy&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="0" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Nat_Output</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>m_lbl_numRulesInfilter_2_3</cstring>
+ </property>
+ <property name="text">
+ <string>POLICY:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>m_lbl_numRulesInfilter_2_3_2</cstring>
+ </property>
+ <property name="text">
+ <string>POLICY:</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="1" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Nat_Prerouting</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRulesInNat_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>PREROUTING:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="3">
+ <property name="name">
+ <cstring>m_lbl_policy_nat_prerouting</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;Policy&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="2" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Nat_Postrouting</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="2">
+ <property name="name">
+ <cstring>m_lbl_numRulesInfilter_2_3_3</cstring>
+ </property>
+ <property name="text">
+ <string>POLICY:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="3">
+ <property name="name">
+ <cstring>m_lbl_policy_filter_nat_postrouting</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;Policy&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRulesInNat_2</cstring>
+ </property>
+ <property name="text">
+ <string>POSTROUTING:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WStackPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>2</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLCDNumber" row="0" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Mangle_Input</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="1" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Mangle_Output</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="2" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Mangle_Forward</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRulesInMangle_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>FORWARD:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRulesInfilter_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>OUTPUT:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRulesInfilter_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>INPUT:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRulesInNat_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>PREROUTING:</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="4" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Mangle_Postrouting</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>m_lbl_numRulesInNat_2_3</cstring>
+ </property>
+ <property name="text">
+ <string>POSTROUTING:</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="3" column="1">
+ <property name="name">
+ <cstring>m_lcd_numRulesIn_Mangle_Prerouting</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>lbl_table</cstring>
+ </property>
+ <property name="text">
+ <string>Table:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="1" rowspan="1" colspan="2">
+ <item>
+ <property name="text">
+ <string>Filter</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Nat</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Mangle</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>kComboBox1</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>51</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>kComboBox1</sender>
+ <signal>activated(int)</signal>
+ <receiver>widgetStack1</receiver>
+ <slot>raiseWidget(int)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+</includehints>
+</UI>
diff --git a/KMFSysTray/kmfiptwatcher.cpp b/KMFSysTray/kmfiptwatcher.cpp
new file mode 100644
index 0000000..c2f8c1a
--- /dev/null
+++ b/KMFSysTray/kmfiptwatcher.cpp
@@ -0,0 +1,306 @@
+/***************************************************************************
+* Copyright (C) 2005 by Christian Hubinger *
+* e9806056@student.tuwien.ac.at *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+***************************************************************************/
+#include "kmfiptwatcher.h"
+
+
+// QT includes
+#include <qtimer.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kapp.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+#include <dcopclient.h>
+
+// Project includes
+#include "../core/kmfiptdoc.h"
+#include "../core/kmferror.h"
+#include "../core/iptable.h"
+#include "../core/iptchain.h"
+#include "../core/iptrule.h"
+#include "../core/iptruleoption.h"
+
+KMFIPTWatcher::KMFIPTWatcher( QObject *parent, const char *name )
+ : QObject( parent, name ) {
+ m_queryExtendedInfo = true;
+ m_doc = new KMFIPTDoc( 0, "iptdoc" );
+ go();
+}
+
+
+KMFIPTWatcher::~KMFIPTWatcher() {}
+
+
+void KMFIPTWatcher::go() {
+ // KMessageBox::information( 0, i18n( "go()" ) );
+ m_timer = new QTimer();
+ QObject::connect( m_timer, SIGNAL( timeout() ), this, SLOT( timeout() ) );
+ m_timer->start( 3000, false );
+}
+
+void KMFIPTWatcher::timeout() {
+// kdDebug() << "timeout()" << endl;
+
+
+ DCOPClient *client = kapp->dcopClient();
+ QCString reply_type;
+ QByteArray params;
+ QDataStream stream( params, IO_WriteOnly );
+ QString arg = "filter";
+ stream << arg;
+ QByteArray reply_data;
+
+ if ( ! client->call( *( new QCString( "kmfiptinterface" ) ),
+ *( new QCString( "KMFIPTInterface" ) ),
+ *( new QCString( "numChainsInTable(QString)" ) ), params,
+ reply_type, reply_data, false, 10000 ) ) {
+
+ // KMessageBox::information( 0, i18n( "Error with DCOP: %1" ).arg( kapp->dcopClient() ->appId() ) );
+ emit sigUpdateActive( false );
+ } else {
+ QDataStream answer( reply_data, IO_ReadOnly );
+ if ( reply_type == "int" ) {
+ int result;
+ answer >> result;
+ // KMessageBox::information( 0, i18n( "Got answer %1" ).arg(result) );
+ emit sigUpdateActive( result > 0 );
+ } else
+ KMessageBox::information( 0, i18n( "Calling over DCOP succeeded, but the answer had wrong type!" ) );
+ }
+
+ if ( m_queryExtendedInfo ) {
+ queryExtendedInfo();
+ }
+}
+
+void KMFIPTWatcher::queryExtendedInfo() {
+ queryChainsInTable( "filter", m_doc );
+ queryChainsInTable( "nat", m_doc );
+ queryChainsInTable( "mangle", m_doc );
+ kdDebug() << "emit sigUpdateIPTDoc( m_doc )" << endl;
+ emit sigUpdateIPTDoc( m_doc );
+}
+
+void KMFIPTWatcher::queryChainsInTable( const QString& table, KMFIPTDoc* iptdoc ) {
+ kdDebug() << "queryNumRulesInChain( const QString& table, const QString& chain )" << endl;
+ DCOPClient *client = kapp->dcopClient();
+ QCString reply_type;
+ QByteArray params;
+ QDataStream stream( params, IO_WriteOnly );
+ stream << table;
+ QByteArray reply_data;
+
+ if ( ! client->call( *( new QCString( "kmfiptinterface" ) ),
+ *( new QCString( "KMFIPTInterface" ) ),
+ *( new QCString( "getChainsInTable(QString)" ) ), params,
+ reply_type, reply_data, false, 10000 ) ) {
+ emit sigUpdateActive( false );
+ } else {
+ QDataStream answer( reply_data, IO_ReadOnly );
+ if ( reply_type == "QStringList" ) {
+ QStringList result;
+ answer >> result;
+ IPTable *tableObj = iptdoc->table( table );
+ kdDebug() << "Filling Table: " << tableObj->name() << endl;
+ QPtrList<IPTChain> *used = new QPtrList<IPTChain>;
+ for ( QStringList::Iterator it = result.begin(); it != result.end(); ++it ) {
+ kdDebug() << "Found Chain" << *it << endl;
+ IPTChain *chain = tableObj->chainForName( *it );
+ if ( ! chain ) {
+ QString tg = "ACCEPT";
+ tableObj->addChain( *it, tg, false, new KMFError() );
+ }
+ fetchChainPolicy( tableObj->chainForName( *it ) );
+ fetchRulesInChain( tableObj->chainForName( *it ) );
+ used->append( tableObj->chainForName( *it ) );
+ }
+
+ QPtrListIterator<IPTChain> it_chains( tableObj->chains() );
+ IPTChain* found_chain = 0;
+ while ( it_chains.current() ) {
+ found_chain = it_chains.current();
+ bool found = false;
+ for ( QStringList::Iterator it_all = result.begin(); it_all != result.end(); ++it_all ) {
+ if ( *it_all == found_chain->name() ) {
+ found = true;
+ }
+ }
+ kdDebug() << "Found chain: " << found_chain->name() << " " << found << endl;
+ if ( ! found ) {
+ tableObj->delChain( found_chain );
+ }
+ ++it_chains;
+ }
+
+
+ } else {
+ KMessageBox::information( 0, i18n( "Calling over DCOP succeeded, but the answer had wrong type!" ) );
+ }
+ }
+}
+
+void KMFIPTWatcher::fetchChainPolicy( IPTChain* chain ) {
+ DCOPClient *client = kapp->dcopClient();
+ QCString reply_type;
+ QByteArray params;
+ QDataStream stream( params, IO_WriteOnly );
+ stream << chain->table()->name() << chain->name();
+ QByteArray reply_data;
+
+ if ( ! client->call( *( new QCString( "kmfiptinterface" ) ),
+ *( new QCString( "KMFIPTInterface" ) ),
+ *( new QCString( "getChainPolicy(QString,QString)" ) ), params,
+ reply_type, reply_data, false, 10000 ) ) {
+ emit sigUpdateActive( false );
+ } else {
+ QDataStream answer( reply_data, IO_ReadOnly );
+ if ( reply_type == "QString" ) {
+ QString result;
+ answer >> result;
+ kdDebug() << "Found Chain Policy: " << chain->table()->name() << " " << chain->name() << " " << result << endl;
+ chain->setDefaultTarget( result );
+ }
+ }
+}
+
+void KMFIPTWatcher::fetchRulesInChain( IPTChain* chain ) {
+ kdDebug() << "fetchRulesInChain( const QString& table, const QString& chain )" << endl;
+ DCOPClient *client = kapp->dcopClient();
+ QCString reply_type;
+ QByteArray params;
+ QDataStream stream( params, IO_WriteOnly );
+ stream << chain->table()->name() << chain->name();
+ QByteArray reply_data;
+
+ if ( ! client->call( *( new QCString( "kmfiptinterface" ) ),
+ *( new QCString( "KMFIPTInterface" ) ),
+ *( new QCString( "numRulesInChain(QString,QString)" ) ), params,
+ reply_type, reply_data, false, 10000 ) ) {
+ emit sigUpdateActive( false );
+ } else {
+ QDataStream answer( reply_data, IO_ReadOnly );
+ if ( reply_type == "int" ) {
+ int result;
+ answer >> result;
+ QPtrList<IPTRule> *used = new QPtrList<IPTRule>;
+ for ( int i = 0; i < result; i++ ) {
+ QString rn = QString("rule_%1").arg( i );
+ IPTRule *rule = 0;
+ rule = chain->ruleForName( rn );
+ if ( ! rule ) {
+ rule = chain->addRule( rn , new KMFError() );
+ }
+ fetchRulesProperties( rule, i );
+ used->append( rule );
+ }
+
+ QPtrListIterator<IPTRule> it_rules( chain->chainRuleset() );
+ IPTRule* found_rule = 0;
+ while ( it_rules.current() ) {
+ found_rule = it_rules.current();
+ bool found = false;
+ for ( int i = 0; i < result; i++ ) {
+ QString rn = QString("rule_%1").arg( i );
+ if ( rn == found_rule->name() ) {
+ found = true;
+ }
+ }
+ if ( ! found ) {
+ chain->delRule( found_rule );
+ }
+ ++it_rules;
+ }
+ } else {
+ KMessageBox::information( 0, i18n( "Calling over DCOP succeeded, but the answer had wrong type!" ) );
+ }
+ }
+}
+
+void KMFIPTWatcher::fetchRulesProperties( IPTRule* rule, int index ) {
+ kdDebug() << "queryNumRulesInChain( const QString& table, const QString& chain )" << endl;
+ DCOPClient *client = kapp->dcopClient();
+ QCString reply_type;
+ QByteArray params;
+ QDataStream stream( params, IO_WriteOnly );
+ stream << rule->chain()->table()->name() << rule->chain()->name() << index;
+ QByteArray reply_data;
+
+ if ( ! client->call( *( new QCString( "kmfiptinterface" ) ),
+ *( new QCString( "KMFIPTInterface" ) ),
+ *( new QCString( "getRuleProperties(QString,QString,int)" ) ), params,
+ reply_type, reply_data, false, 10000 ) ) {
+ emit sigUpdateActive( false );
+ } else {
+ QDataStream answer( reply_data, IO_ReadOnly );
+ if ( reply_type == "QStringList" ) {
+ QStringList result;
+ answer >> result;
+ if ( *result.at( 0 ) == "ERROR" ) {
+ return;
+ }
+ rule->setTarget( *result.at( 0 ) );
+
+
+ } else {
+ KMessageBox::information( 0, i18n( "Calling over DCOP succeeded, but the answer had wrong type!" ) );
+ }
+ }
+
+}
+
+
+void KMFIPTWatcher::queryNumRulesInChain( const QString& table, const QString& chain, KMFIPTDoc* doc ) {
+ kdDebug() << "queryNumRulesInChain( const QString& table, const QString& chain )" << endl;
+ DCOPClient *client = kapp->dcopClient();
+ QCString reply_type;
+ QByteArray params;
+ QDataStream stream( params, IO_WriteOnly );
+ stream << table << chain;
+ QByteArray reply_data;
+
+ if ( ! client->call( *( new QCString( "kmfiptinterface" ) ),
+ *( new QCString( "KMFIPTInterface" ) ),
+ *( new QCString( "numRulesInChain(QString,QString)" ) ), params,
+ reply_type, reply_data, false, 10000 ) ) {
+ emit sigUpdateActive( false );
+ } else {
+ QDataStream answer( reply_data, IO_ReadOnly );
+ if ( reply_type == "int" ) {
+ int result;
+ answer >> result;
+
+ } else
+ KMessageBox::information( 0, i18n( "Calling over DCOP succeeded, but the answer had wrong type!" ) );
+ }
+}
+
+void KMFIPTWatcher::worked() {
+ KMessageBox::information( 0, i18n( "Callback Worked" ) );
+}
+
+void KMFIPTWatcher::slotQueryDetails( bool on ) {
+ kdDebug() << "slotQueryDetails( bool " << on << " )" << endl;
+ m_queryExtendedInfo = on;
+}
+#include "kmfiptwatcher.moc"
diff --git a/KMFSysTray/kmfiptwatcher.h b/KMFSysTray/kmfiptwatcher.h
new file mode 100644
index 0000000..c6c27f8
--- /dev/null
+++ b/KMFSysTray/kmfiptwatcher.h
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Christian Hubinger *
+ * e9806056@student.tuwien.ac.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#ifndef KMFIPTWATCHER_H
+#define KMFIPTWATCHER_H
+
+#include <qobject.h>
+
+/**
+@author Christian Hubinger
+*/
+
+class QTimer;
+class KMFIPTDoc;
+class IPTChain;
+class IPTable;
+class IPTRule;
+class IPTRuleOption;
+
+class KMFIPTWatcher : public QObject
+{
+Q_OBJECT
+public:
+ KMFIPTWatcher(QObject *parent = 0, const char *name = 0);
+
+ ~KMFIPTWatcher();
+
+public slots:
+ void slotQueryDetails( bool );
+
+private slots:
+ void timeout();
+ void worked();
+
+
+private:
+ void go();
+ void queryExtendedInfo();
+ void queryNumRulesInChain( const QString& /*table*/, const QString& /*Chain*/, KMFIPTDoc* /* doc */ );
+ void queryChainsInTable( const QString& /*table*/, KMFIPTDoc* /* doc */ );
+
+ QTimer *m_timer;
+ bool m_queryExtendedInfo;
+
+ void fetchChainPolicy( IPTChain* );
+ void fetchRulesInChain( IPTChain* );
+ void fetchRulesProperties( IPTRule*, int );
+
+ KMFIPTDoc *m_doc;
+signals:
+ void sigUpdateIPTDoc( KMFIPTDoc* );
+ void sigUpdateActive( bool );
+ void sigUpdateRuleCount( const QString& /*table*/, const QString& /*Chain*/, int );
+
+};
+
+#endif
diff --git a/KMFSysTray/kmfsystray.cpp b/KMFSysTray/kmfsystray.cpp
new file mode 100644
index 0000000..bea6399
--- /dev/null
+++ b/KMFSysTray/kmfsystray.cpp
@@ -0,0 +1,166 @@
+/**************************************************************************
+* Copyright (C) 2005 by Christian Hubinger *
+* e9806056@student.tuwien.ac.at *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+***************************************************************************/
+
+
+// QT includes
+#include <qlcdnumber.h>
+#include <qlayout.h>
+
+// KDE includes
+#include <kglobal.h>
+#include <klocale.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+#include <dcopclient.h>
+#include <kdebug.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kprocess.h>
+
+// Project includes
+#include "kmfsystray.h"
+#include "kmfiptwatcher.h"
+#include "mainwidget.h"
+
+#include "../core/kmfiptdoc.h"
+#include "../core/kmfappstate.h"
+
+KMFSysTray::KMFSysTray( QWidget* w ) : KSystemTray ( w ) , DCOPObject( "KMFSysTray" ) {
+ mainView = w;
+ ksConfig = kapp->config();
+ KMFIPTWatcher *watch = new KMFIPTWatcher( this, "KMFIPTWatcher" );
+
+ baseIcon = KSystemTray::loadIcon( "kmyfirewall" );
+ setPixmap( baseIcon );
+
+ // Connect the watch deamon
+ connect( watch, SIGNAL( sigUpdateActive( bool ) ), this, SLOT( slotSetRunningStatus( bool ) ) );
+ connect( watch, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ),
+ this, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ) );
+
+ connect( watch, SIGNAL( sigUpdateIPTDoc( KMFIPTDoc* ) ),
+ this, SIGNAL( sigUpdateIPTDoc( KMFIPTDoc* ) ) );
+
+ connect( this, SIGNAL( sigQueryDetails( bool ) ), watch, SLOT( slotQueryDetails( bool ) ) );
+
+ // Connect view
+ connect( w, SIGNAL( closing() ), this, SLOT ( slotDetailsClosed() ) );
+ connect( w, SIGNAL( showing() ), this, SLOT ( slotQueryDetails() ) );
+ connect( this, SIGNAL( sigUpdateIPTDoc( KMFIPTDoc* ) ), w, SLOT( slotLoadDoc( KMFIPTDoc* ) ) );
+
+
+ initMenu();
+
+ show();
+ emit sigQueryDetails( false );
+ KMFAppState::setUpAndRunning( true );
+ KMFAppState::setHasOpenDoc( true );
+}
+
+
+KMFSysTray::~KMFSysTray() {}
+
+void KMFSysTray::initMenu() {
+ KPopupMenu* menu = contextMenu ();
+ menu->insertItem( KGlobal::iconLoader()->loadIcon( "kmyfirewall", KIcon::Small ), i18n( "Launch KMyFirewall..."), this, SLOT( slotLaunchKMF() ), CTRL+Key_K );
+
+}
+
+void KMFSysTray::slotSetRunningStatus( bool on ) {
+ if ( on ) {
+ baseIcon = KSystemTray::loadIcon( "kmyfirewall" );
+ } else {
+ baseIcon = KSystemTray::loadIcon( "kmyfirewall" );
+ }
+ setPixmap( baseIcon );
+}
+
+
+
+void KMFSysTray::slotLaunchKMF () {
+ KProcess *childproc = new KProcess();
+ *childproc << "kdesu";
+ *childproc << "kmyfirewall";
+ childproc->start( KProcess:: DontCare, KProcess::NoCommunication );
+}
+
+void KMFSysTray::slotShowDetails() {
+ kdDebug() << "MFSysTray::slotshowDetails()" << endl;
+ slotQueryDetails();
+ mainView->show();
+
+}
+
+void KMFSysTray::slotQueryDetails() {
+ emit sigQueryDetails( true );
+}
+
+void KMFSysTray::slotDetailsClosed() {
+ kdDebug() << "KMFSysTray::slotDetailsClosed()" << endl;
+ emit sigQueryDetails( false );
+}
+
+void KMFSysTray::about() {
+/* if(!_aboutData) {
+ _aboutData = new KAboutData("KMFSysTray", I18N_NOOP("KMFSysTray"),
+ "1.0", I18N_NOOP("KMyFirewall Pannel Applet.\n\n"
+ "Some basic inform<tion about your running iptables rules"),
+ KAboutData::License_GPL_V2, "(c) 2005, Christian Hubinger");
+ _aboutData->addAuthor("Christian Hubinger", 0, "e9806056@student.tuwien.ac.at");
+
+ }
+ KAboutApplication dialog(_aboutData);
+ dialog.show();*/
+}
+
+
+void KMFSysTray::help() {
+ KMessageBox::information( 0, i18n( "This is a help box" ) );
+}
+
+
+void KMFSysTray::preferences() {
+ KMessageBox::information( 0, i18n( "This is a preferences box" ) );
+}
+
+int KMFSysTray::widthForHeight( int ) const {
+ return width();
+}
+
+int KMFSysTray::heightForWidth( int ) const {
+ return height();
+}
+
+void KMFSysTray::resizeEvent( QResizeEvent *e ) {}
+
+
+// extern "C" {
+// KPanelApplet * init( QWidget * parent, const QString & configFile ) {
+// KGlobal::locale() ->insertCatalogue( "kmfsystray" );
+// return new KMFSysTray( configFile, KPanelApplet::Normal,
+// KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences,
+// parent, "kmfsystray" );
+// }
+// }
+
+
diff --git a/KMFSysTray/kmfsystray.desktop b/KMFSysTray/kmfsystray.desktop
new file mode 100644
index 0000000..6c6d0b7
--- /dev/null
+++ b/KMFSysTray/kmfsystray.desktop
@@ -0,0 +1,36 @@
+[Desktop Entry]
+Encoding=UTF-8
+Comment=A panel applet called $NAME$
+Comment[bg]=Аплет с име $NAME$
+Comment[br]=Un arloadig panell a vez graet $NAME$
+Comment[ca]=Un applet del plafó anomenat $NAME$
+Comment[cs]=Applet panelu $NAME$
+Comment[cy]=Rhaglennig panel o'r enw $NAME$
+Comment[da]=En applet for panelet som hedder $NAME$
+Comment[de]=Eine Bedienfläche mit dem Namen $NAME$
+Comment[el]=Μία μικροεφαρμογή πίνακα με όνομα $NAME$
+Comment[es]=Una miniaplicación para el panel llamada $NAME$
+Comment[et]=Paneeliaplett $NAME$
+Comment[fr]=Une applet appelée $NAME$
+Comment[ga]=Feidhmchláirín painéil darbh ainm $NAME$
+Comment[gl]=Unha applet do painel chamada $NAME$
+Comment[it]=Un applet per il pannello chiamato $NAME$
+Comment[ka]=პანელის აპლეტი სახელად $NAME$
+Comment[lt]=Pulto įskiepis, vadinamas $NAME$
+Comment[nl]=Een paneelapplet genaamd $NAME$
+Comment[pt]=Um 'applet' para o painel chamado $NAME$
+Comment[pt_BR]=Um mini-aplicativo para o painel chamado $NAME$
+Comment[sr]=Аплет за панел назван $NAME$
+Comment[sr@Latn]=Aplet za panel nazvan $NAME$
+Comment[sv]=Ett miniprogram för panelen som heter $NAME$
+Comment[tr]=$NAME$ isimli panel küçük uygulaması
+Comment[uk]=Аплет панелі $NAME$
+Comment[xx]=xxA panel applet called $NAME$xx
+Name=KMFSysTray
+Name[da]=KFTPGrabber
+Name[pt_BR]=Mini-aplicativo de painel
+Name[sv]=Min brandväggs systembricka
+Name[tr]=KMF Sistem Çekmecesi
+Name[xx]=xxKMFSysTrayxx
+X-KDE-Library=kmfsystray_panelapplet
+X-KDE-UniqueApplet = true
diff --git a/KMFSysTray/kmfsystray.h b/KMFSysTray/kmfsystray.h
new file mode 100644
index 0000000..9eb4b8a
--- /dev/null
+++ b/KMFSysTray/kmfsystray.h
@@ -0,0 +1,80 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Christian Hubinger *
+ * e9806056@student.tuwien.ac.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+
+#ifndef KMFSYSTRAY_H
+#define KMFSYSTRAY_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// QT includes
+#include <qstring.h>
+#include <qpixmap.h>
+
+// KDE Includes
+#include <kpanelapplet.h>
+#include <ksystemtray.h>
+#include <kconfig.h>
+#include <dcopobject.h>
+
+class KAboutData;
+class KMFIPTDoc;
+
+class KMFSysTray : public KSystemTray, public DCOPObject
+{
+ Q_OBJECT
+
+public:
+ KMFSysTray( QWidget * );
+ virtual ~KMFSysTray();
+ virtual int widthForHeight(int height) const;
+ virtual int heightForWidth(int width) const;
+ virtual void about();
+ virtual void help();
+ virtual void preferences();
+
+public slots:
+ void slotSetRunningStatus( bool on );
+ void slotLaunchKMF();
+ void slotShowDetails();
+ void slotQueryDetails();
+ void slotDetailsClosed();
+
+protected:
+ void resizeEvent(QResizeEvent *);
+
+private: // Methods
+ void initMenu();
+
+private:
+ KAboutData *_aboutData;
+ KConfig *ksConfig;
+ QWidget *mainView;
+ QPixmap baseIcon;
+
+signals:
+ void sigUpdateIPTDoc( KMFIPTDoc* );
+ void sigQueryDetails( bool );
+ void sigUpdateRuleCount( const QString&, const QString&, int );
+};
+
+#endif
diff --git a/KMFSysTray/main.cpp b/KMFSysTray/main.cpp
new file mode 100644
index 0000000..fe24ce8
--- /dev/null
+++ b/KMFSysTray/main.cpp
@@ -0,0 +1,57 @@
+//
+// C++ Implementation: main
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <e9806056@student.tuwien.ac.at>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include <qwidget.h>
+
+#include <kapplication.h>
+#include <kaboutapplication.h>
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+#include <kconfig.h>
+#include <kdebug.h>
+
+
+#include "../kmyfirewall/version.h"
+#include "../kmyfirewall/kmfwidgets/kmfiptdocview.h"
+
+
+#include "kmfsystray.h"
+#include "kmfiptwatcher.h"
+#include "details.h"
+
+
+static const char description[] = I18N_NOOP( "KMFSysTray - IPTables monitor" );
+
+
+static KCmdLineOptions options[] = {
+ { "+[URL]", I18N_NOOP( "Files/URLs to Open." ), 0 },
+ { "--test ", I18N_NOOP("A short option which takes an argument."), 0 },
+ { 0, 0, 0}
+};
+
+int main( int argc, char *argv[] ) {
+ KAboutData aboutData( "kmfsystray", I18N_NOOP( "KMFSysTray" ),
+ KMYFIREWALL_VERSION, description, KAboutData::License_GPL,
+ COPYRIGHT_STRING, 0, 0, "e9806056@student.tuwien.ac.at" );
+ aboutData.addAuthor( "Christian Hubinger", 0, "e9806056@student.tuwien.ac.at" );
+ aboutData.setHomepage( "http://kmyfirewall.sourceforge.net" );
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
+
+ KApplication a;
+ // Details *mainWid = new Details( 0 );
+
+ KMFIPTDocView *mainWid = new KMFIPTDocView( 0 );
+ KMFSysTray *st = new KMFSysTray( mainWid );
+ return a.exec();
+}
diff --git a/KMFSysTray/mainwidget.cpp b/KMFSysTray/mainwidget.cpp
new file mode 100644
index 0000000..5eeded9
--- /dev/null
+++ b/KMFSysTray/mainwidget.cpp
@@ -0,0 +1,74 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Christian Hubinger *
+ * e9806056@student.tuwien.ac.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+
+#include "mainwidget.h"
+
+// QT includes
+#include <qcolor.h>
+#include <qpushbutton.h>
+#include <qwidget.h>
+
+// KDE includes
+#include <kled.h>
+#include <kpushbutton.h>
+
+// Project Includes
+#include "details.h"
+
+MainWidget::MainWidget(QWidget* parent, const char* name, WFlags fl)
+: MainWidgetDesigner(parent,name,fl)
+{
+ m_ledActive->off();
+ m_cmd_info->setEnabled( false );
+ m_wid_details = new Details( 0 );
+ connect( m_wid_details, SIGNAL( closing() ), this, SLOT ( slotDetailsClosed() ) );
+ connect( this, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ),
+ m_wid_details, SLOT( slotUpdateRuleCount( const QString&, const QString&, int ) ) );
+ connect( m_cmd_info, SIGNAL( clicked() ), this, SLOT( slotShowDetails() ) ) ;
+}
+
+MainWidget::~MainWidget()
+{
+}
+
+void MainWidget::slotSetRunningStatus( bool on ) {
+ m_ledActive->on();
+ m_cmd_info->setEnabled( on );
+ if ( on ) {
+ m_ledActive -> setColor( QColor(0, 255, 0) );
+ } else {
+ m_ledActive -> setColor( QColor(255, 0, 0) );
+ }
+}
+
+
+void MainWidget::slotDetailsClosed() {
+ emit sigQueryDetails( false );
+}
+
+void MainWidget::slotShowDetails() {
+ emit sigQueryDetails( true );
+ m_wid_details->show();
+ m_wid_details->raise();
+}
+
+#include "mainwidget.moc"
+
diff --git a/KMFSysTray/mainwidget.h b/KMFSysTray/mainwidget.h
new file mode 100644
index 0000000..aeae571
--- /dev/null
+++ b/KMFSysTray/mainwidget.h
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Christian Hubinger *
+ * e9806056@student.tuwien.ac.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#ifndef MAINWIDGET_H
+#define MAINWIDGET_H
+
+#include "mainwidget_designer.h"
+
+class Details;
+
+
+class MainWidget : public MainWidgetDesigner
+{
+ Q_OBJECT
+
+public:
+ MainWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~MainWidget();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ void slotSetRunningStatus( bool );
+ void slotDetailsClosed();
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+private slots:
+ void slotShowDetails();
+
+private:
+ Details *m_wid_details;
+
+
+signals:
+ void sigQueryDetails( bool );
+ void sigUpdateRuleCount( const QString&, const QString&, int );
+};
+
+#endif
+
diff --git a/KMFSysTray/mainwidget_designer.ui b/KMFSysTray/mainwidget_designer.ui
new file mode 100644
index 0000000..abdb834
--- /dev/null
+++ b/KMFSysTray/mainwidget_designer.ui
@@ -0,0 +1,88 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>MainWidgetDesigner</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>MainWidgetDesigner</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>124</width>
+ <height>34</height>
+ </rect>
+ </property>
+ <property name="backgroundOrigin">
+ <enum>ParentOrigin</enum>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="KLed">
+ <property name="name">
+ <cstring>m_ledActive</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="state">
+ <enum>On</enum>
+ </property>
+ <property name="shape">
+ <enum>Circular</enum>
+ </property>
+ <property name="look">
+ <enum>Flat</enum>
+ </property>
+ <property name="darkFactor">
+ <number>300</number>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>m_cmd_info</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Info</string>
+ </property>
+ </widget>
+ </hbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kled.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..3858d24
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,5 @@
+SUBDIRS = kmyfirewall pics templates doc
+EXTRA_DIST = kmyfirewall.kdevprj admin AUTHORS COPYING ChangeLog INSTALL README TODO kmyfirewall.lsm kmyfirewall.spec
+
+AUTOMAKE_OPTIONS = foreign
+
diff --git a/README b/README
new file mode 100644
index 0000000..b1e84da
--- /dev/null
+++ b/README
@@ -0,0 +1,139 @@
+Content:
+
+ * About KMyFirewall
+ * Release Notes
+ * Hacking
+ * Packaging
+ * Reporting Bugs
+ * Contact
+
+
+About KMyFirewall
+-----------------
+
+KMyFirewall attempts to make it easier to setup IPTables based firewalls on
+Linux systems. It will be the right tool if you like to have a so called
+"Personal Firewall" running on your Linux box, but don't have the time and/or
+the interest to spend hours in front of the IPTables manual just to setup a
+Firewall that keeps the "bad" people out.
+
+There is also the possibility to save entire rule sets, so you only have to
+configure your rule set one time and then you can use it on several computers
+giving each of them a similar configuration (p.e. school networks, office,
+university etc.). For a complete list of the features have a look at the
+Features section
+
+Programs can't do any magic so you still will have to know what your firewall
+should do to setup your rule set. KMyFirewall just tries to help you as much as
+possible, but you decide what it will do.
+
+
+Release Notes
+-------------
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!! Important: As the file format used to save the rulesets has changed, !!!
+!!! rulesets created with KMF < 1.0beta1 WILL NOT work, don't even try it! !!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+Since the last stable release KMF has been completely rewritten in order to be
+even more flexible and on the other hand easier to use.
+
+New plugin framework
+
+Most parts of the application has been rewritten introducing a plugin framework
+that allows to add new IPTables rule option editors to be written within a few
+hours (well maybe days depends on the options complexity :). This will allow
+us (and contributors) to easily implement the fast growing number of IPTables
+ruleoptions without the need of understanding the whole application.
+
+The backend generating the IPTables rules itself has been extended to allow the
+registration of new rule options by defining them in an XML description file.
+For a detailed description about how to write such plugins have a look at the
+application handbook in the current CVS version. So feel free to contribute
+plugins, there are lots of options still not implemented.
+
+
+New Easy-To-Use platform independant interface
+
+As I often got mails complaining about the to complex nature of KMF and the
+very limited possibilities the wizard provides i simply removed the wizard and
+implemented a completely new interface.
+
+
+Features of the new Interface
+
+As the new interface works on an abstract descrioption of the generated rules
+the new plugin structure allows us top implement script compilers that support
+other firewalling backends than just netfilter/iptables.
+
+To support a new tool kit it is required to write a compiler and an installer
+plugin for the new framework. Currently just the iptables/linux compiler and
+installer is implemented. As with the rule option plugins of the IPTables
+interface it shouldn't bee too much work to develop those plugins.
+
+
+IPTables vs. Generic interface
+
+The main difference between those two interfaces is that the new Generic
+Interface is OS and toolkit independant while the IPTables interface is an
+improved version of the well known KMF GUI and therefore tight bound to the
+netfiler/iptables toolkit and can therefore only be used with Linux as
+operating system.
+
+
+Why two different interfaces?
+
+Especially when concerning security related applications you (as developer)
+need to decide if you like to build an application used by expert users (e.g.
+experienced system administrators) or if you like to provide a tool that
+everybody can handle.
+
+It hasn't been an easy decision to implement one interface for each user group
+but after pondering about concepts to merge those two requirements into one
+interface we decided that it is much better to seperate them. This allows us
+to concentrate on the wishes and wanted features for each of the user groups.
+
+
+Reporting Bugs
+--------------
+
+If you found a bug in please do not hesitate to drop an e-mail to
+chubinger@gmail.com or use the "Report Bug..." dialog from the Help menu.
+
+
+Hacking
+-------
+
+As you can see this thing gets quiet big so every kind of help
+(coding, docs, translations) is very welcome. Please don't hesitate to contact me
+(chubinger@gmail.com) if you have some ideas, patches, wishes or whatever.
+
+
+To ease the development for writing KMyFirewall plugins i've wrote a small
+howto about implementing such plugins which may be a good starting point for
+getting involved in the development process. It can be found in menu "Help ->
+KMyFirewall Handbook" in the Development section or have a look at the project
+website at http://kmyfirewall.sourceforge.net
+
+
+Packaging
+---------
+
+If you are intereseted in packagin KMyFirewall do not hesitate to contact me.
+As my time is quite linited i cannot package KMF on my own so if you like to
+you will be very welcome. Just drop me an e-mail
+
+
+Contact
+-------
+
+Do not hesitate to contact me via e-mail at chubinger@gmail.com if you have
+questions, problems or what ever concerning KMyFirewall.
+
+For the latest news about KMyFirewall have a look at
+http://kmyfirewall.sourceforge.net
+
+
+
+
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..657a497
--- /dev/null
+++ b/TODO
@@ -0,0 +1,70 @@
+ToDo for v1.1 relase
+--------------------
+
+*) FIX: crash after protocol editing/deleting in Generioc interface
+ DONE: chubinger 20.1.2008
+*) FIX: template loading (NAT tmpl)
+ DONE: chubinger 20.1.2008
+
+*) Finish XML Names Constants
+ DONE: chubinger 5.1.2008
+
+*) Make encoding in installpackage work
+ DONE: chubinger 13.9.2007
+
+*) Capsulate everythig in a transaction
+ DONE: chubinger but config changes
+
+*) Generic Interface: Fix protocol add/delete undo/redo
+ DONE: chubinger 14.8.2007
+
+*) Generic Interface: accessControlPage: encapsulate protocol and host properties in own widgets like allready done for the zone
+ DONE: chubinger 12.8.2007
+
+*) Fix: Make Protocol Catgory handling sane
+ DONE: chubinger 14.8.2007
+
+*) Fix: Protocol Edit not saving changes
+ DONE: chubinger 1.1.2008
+
+ToDo
+----
+
+
+*) Single root password input (e.g. kwallet support)
+
+*) Implement logfile parsing and display
+
+*) better icons
+
+*) configuration wizard (maybe only generic interface)
+
+*) remote installation (server client or ssh)
+
+*) make Enter, ESC, Return key presss work for all dialogs
+
+*) handle protocol name changes (maybe: select using ports to indetify doubles)
+
+*) Make it possible to rename the user defined chains.
+
+*) add CUPS rule to the wizard so that printing with CUPS is possible
+ Protocol: TCP, Dest. Port: 631, Incoming Interface: lo, ACCEPT
+
+*) add LPD rule to the wizard so that printing with LPD is possible
+ Protocol: TCP, Dest. Port: 515, Incoming Interface: lo, ACCEPT
+
+*) KHotNewStuff support for protocol library
+
+
+
+
+Nice To Have
+------------
+
+*) Allow to install the firewall in several selected runlevels not just the default.
+
+*) Define a XML-DTD/XSD Scheme for filetypes.
+
+*) Drag N' Drop to move up/down rules in the Chain (those two buttons suck).
+
+
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..ef6135f
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,11920 @@
+## -*- autoconf -*-
+
+dnl This file is part of the KDE libraries/packages
+dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
+dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
+
+dnl This file is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Library General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2 of the License, or (at your option) any later version.
+
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Library General Public License for more details.
+
+dnl You should have received a copy of the GNU Library General Public License
+dnl along with this library; see the file COPYING.LIB. If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+dnl Boston, MA 02110-1301, USA.
+
+dnl IMPORTANT NOTE:
+dnl Please do not modify this file unless you expect your modifications to be
+dnl carried into every other module in the repository.
+dnl
+dnl Single-module modifications are best placed in configure.in for kdelibs
+dnl and kdebase or configure.in.in if present.
+
+# KDE_PATH_X_DIRECT
+dnl Internal subroutine of AC_PATH_X.
+dnl Set ac_x_includes and/or ac_x_libraries.
+AC_DEFUN([KDE_PATH_X_DIRECT],
+[
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+if test "$ac_x_includes" = NO; then
+ # Guess where to find include files, by looking for this one X11 .h file.
+ test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+ # First, try using that file with no special directory specified.
+AC_TRY_CPP([#include <$x_direct_test_include>],
+[# We can compile using X headers with no special include directory.
+ac_x_includes=],
+[# Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ for ac_dir in \
+ /usr/X11/include \
+ /usr/X11R6/include \
+ /usr/X11R5/include \
+ /usr/X11R4/include \
+ \
+ /usr/include/X11 \
+ /usr/include/X11R6 \
+ /usr/include/X11R5 \
+ /usr/include/X11R4 \
+ \
+ /usr/local/X11/include \
+ /usr/local/X11R6/include \
+ /usr/local/X11R5/include \
+ /usr/local/X11R4/include \
+ \
+ /usr/local/include/X11 \
+ /usr/local/include/X11R6 \
+ /usr/local/include/X11R5 \
+ /usr/local/include/X11R4 \
+ \
+ /usr/X386/include \
+ /usr/x386/include \
+ /usr/XFree86/include/X11 \
+ \
+ /usr/include \
+ /usr/local/include \
+ /usr/unsupported/include \
+ /usr/athena/include \
+ /usr/local/x11r5/include \
+ /usr/lpp/Xamples/include \
+ \
+ /usr/openwin/include \
+ /usr/openwin/share/include \
+ ; \
+ do
+ if test -r "$ac_dir/$x_direct_test_include"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+ done])
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+ # Check for the libraries.
+
+ test -z "$x_direct_test_library" && x_direct_test_library=Xt
+ test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS="$LIBS"
+ LIBS="-l$x_direct_test_library $LIBS"
+AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
+[LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=],
+[LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
+ /usr/X11/lib${kdelibsuff} \
+ /usr/X11R6/lib${kdelibsuff} \
+ /usr/X11R5/lib${kdelibsuff} \
+ /usr/X11R4/lib${kdelibsuff} \
+ \
+ /usr/lib${kdelibsuff}/X11 \
+ /usr/lib${kdelibsuff}/X11R6 \
+ /usr/lib${kdelibsuff}/X11R5 \
+ /usr/lib${kdelibsuff}/X11R4 \
+ \
+ /usr/local/X11/lib${kdelibsuff} \
+ /usr/local/X11R6/lib${kdelibsuff} \
+ /usr/local/X11R5/lib${kdelibsuff} \
+ /usr/local/X11R4/lib${kdelibsuff} \
+ \
+ /usr/local/lib${kdelibsuff}/X11 \
+ /usr/local/lib${kdelibsuff}/X11R6 \
+ /usr/local/lib${kdelibsuff}/X11R5 \
+ /usr/local/lib${kdelibsuff}/X11R4 \
+ \
+ /usr/X386/lib${kdelibsuff} \
+ /usr/x386/lib${kdelibsuff} \
+ /usr/XFree86/lib${kdelibsuff}/X11 \
+ \
+ /usr/lib${kdelibsuff} \
+ /usr/local/lib${kdelibsuff} \
+ /usr/unsupported/lib${kdelibsuff} \
+ /usr/athena/lib${kdelibsuff} \
+ /usr/local/x11r5/lib${kdelibsuff} \
+ /usr/lpp/Xamples/lib${kdelibsuff} \
+ /lib/usr/lib${kdelibsuff}/X11 \
+ \
+ /usr/openwin/lib${kdelibsuff} \
+ /usr/openwin/share/lib${kdelibsuff} \
+ ; \
+do
+dnl Don't even attempt the hair of trying to link an X program!
+ for ac_extension in a so sl; do
+ if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done])
+fi # $ac_x_libraries = NO
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Find a file (or one of more files in a list of dirs)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_FIND_FILE],
+[
+$3=NO
+for i in $2;
+do
+ for j in $1;
+ do
+ echo "configure: __oline__: $i/$j" >&AC_FD_CC
+ if test -r "$i/$j"; then
+ echo "taking that" >&AC_FD_CC
+ $3=$i
+ break 2
+ fi
+ done
+done
+])
+
+dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
+dnl if-not-found, test-parameter, prepend-path)
+dnl
+dnl Look for program-name in list-of-dirs+$PATH.
+dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
+dnl If found, $variable-name is set. If not, if-not-found is evaluated.
+dnl test-parameter: if set, the program is executed with this arg,
+dnl and only a successful exit code is required.
+AC_DEFUN([KDE_FIND_PATH],
+[
+ AC_MSG_CHECKING([for $1])
+ if test -n "$$2"; then
+ kde_cv_path="$$2";
+ else
+ kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
+
+ AC_CACHE_VAL(kde_cv_path_$kde_cache,
+ [
+ kde_cv_path="NONE"
+ kde_save_IFS=$IFS
+ IFS=':'
+ dirs=""
+ for dir in $PATH; do
+ dirs="$dirs $dir"
+ done
+ if test -z "$6"; then dnl Append dirs in PATH (default)
+ dirs="$3 $dirs"
+ else dnl Prepend dirs in PATH (if 6th arg is set)
+ dirs="$dirs $3"
+ fi
+ IFS=$kde_save_IFS
+
+ for dir in $dirs; do
+ if test -x "$dir/$1"; then
+ if test -n "$5"
+ then
+ evalstr="$dir/$1 $5 2>&1 "
+ if eval $evalstr; then
+ kde_cv_path="$dir/$1"
+ break
+ fi
+ else
+ kde_cv_path="$dir/$1"
+ break
+ fi
+ fi
+ done
+
+ eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+ ])
+
+ eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+ fi
+
+ if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+ AC_MSG_RESULT(not found)
+ $4
+ else
+ AC_MSG_RESULT($kde_cv_path)
+ $2=$kde_cv_path
+
+ fi
+])
+
+AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
+[
+ AC_MSG_ERROR([No Qt meta object compiler (moc) found!
+Please check whether you installed Qt correctly.
+You need to have a running moc binary.
+configure tried to run $ac_cv_path_moc and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable MOC to the right one before running
+configure.
+])
+])
+
+AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
+[
+ AC_MSG_WARN([No Qt ui compiler (uic) found!
+Please check whether you installed Qt correctly.
+You need to have a running uic binary.
+configure tried to run $ac_cv_path_uic and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable UIC to the right one before running
+configure.
+])
+])
+
+
+AC_DEFUN([KDE_CHECK_UIC_FLAG],
+[
+ AC_MSG_CHECKING([whether uic supports -$1 ])
+ kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
+ AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
+ [
+ cat >conftest.ui <<EOT
+ <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
+EOT
+ ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
+ if AC_TRY_EVAL(ac_uic_testrun); then
+ eval "kde_cv_prog_uic_$kde_cache=yes"
+ else
+ eval "kde_cv_prog_uic_$kde_cache=no"
+ fi
+ rm -f conftest*
+ ])
+
+ if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT([yes])
+ :
+ $3
+ else
+ AC_MSG_RESULT([no])
+ :
+ $4
+ fi
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Find the meta object compiler and the ui compiler in the PATH,
+dnl in $QTDIR/bin, and some more usual places
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_PATH_QT_MOC_UIC],
+[
+ AC_REQUIRE([KDE_CHECK_PERL])
+ qt_bindirs=""
+ for dir in $kde_qt_dirs; do
+ qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
+ done
+ qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
+ if test ! "$ac_qt_bindir" = "NO"; then
+ qt_bindirs="$ac_qt_bindir $qt_bindirs"
+ fi
+
+ KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
+ if test -z "$UIC_NOT_NEEDED"; then
+ KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
+ if test -z "$UIC_PATH" ; then
+ KDE_UIC_ERROR_MESSAGE
+ exit 1
+ else
+ UIC=$UIC_PATH
+
+ if test $kde_qtver = 3; then
+ KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
+ KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
+
+ if test x$ac_uic_supports_libpath = xyes; then
+ UIC="$UIC -L \$(kde_widgetdir)"
+ fi
+ if test x$ac_uic_supports_nounload = xyes; then
+ UIC="$UIC -nounload"
+ fi
+ fi
+ fi
+ else
+ UIC="echo uic not available: "
+ fi
+
+ AC_SUBST(MOC)
+ AC_SUBST(UIC)
+
+ UIC_TR="i18n"
+ if test $kde_qtver = 3; then
+ UIC_TR="tr2i18n"
+ fi
+
+ AC_SUBST(UIC_TR)
+])
+
+AC_DEFUN([KDE_1_CHECK_PATHS],
+[
+ KDE_1_CHECK_PATH_HEADERS
+
+ KDE_TEST_RPATH=
+
+ if test -n "$USE_RPATH"; then
+
+ if test -n "$kde_libraries"; then
+ KDE_TEST_RPATH="-R $kde_libraries"
+ fi
+
+ if test -n "$qt_libraries"; then
+ KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
+ fi
+
+ if test -n "$x_libraries"; then
+ KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
+ fi
+
+ KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
+ fi
+
+AC_MSG_CHECKING([for KDE libraries installed])
+ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_ERROR([your system fails at linking a small KDE application!
+Check, if your compiler is installed correctly and if you have used the
+same compiler to compile Qt and kdelibs as you did use now.
+For more details about this problem, look at the end of config.log.])
+fi
+
+if eval `KDEDIR= ./conftest 2>&5`; then
+ kde_result=done
+else
+ kde_result=problems
+fi
+
+KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
+kde_have_all_paths=yes
+
+KDE_SET_PATHS($kde_result)
+
+])
+
+AC_DEFUN([KDE_SET_PATHS],
+[
+ kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+ kde_htmldir=\"$kde_htmldir\" \
+ kde_appsdir=\"$kde_appsdir\" \
+ kde_icondir=\"$kde_icondir\" \
+ kde_sounddir=\"$kde_sounddir\" \
+ kde_datadir=\"$kde_datadir\" \
+ kde_locale=\"$kde_locale\" \
+ kde_cgidir=\"$kde_cgidir\" \
+ kde_confdir=\"$kde_confdir\" \
+ kde_kcfgdir=\"$kde_kcfgdir\" \
+ kde_mimedir=\"$kde_mimedir\" \
+ kde_toolbardir=\"$kde_toolbardir\" \
+ kde_wallpaperdir=\"$kde_wallpaperdir\" \
+ kde_templatesdir=\"$kde_templatesdir\" \
+ kde_bindir=\"$kde_bindir\" \
+ kde_servicesdir=\"$kde_servicesdir\" \
+ kde_servicetypesdir=\"$kde_servicetypesdir\" \
+ kde_moduledir=\"$kde_moduledir\" \
+ kde_styledir=\"$kde_styledir\" \
+ kde_widgetdir=\"$kde_widgetdir\" \
+ xdg_appsdir=\"$xdg_appsdir\" \
+ xdg_menudir=\"$xdg_menudir\" \
+ xdg_directorydir=\"$xdg_directorydir\" \
+ kde_result=$1"
+])
+
+AC_DEFUN([KDE_SET_DEFAULT_PATHS],
+[
+if test "$1" = "default"; then
+
+ if test -z "$kde_htmldir"; then
+ kde_htmldir='\${datadir}/doc/HTML'
+ fi
+ if test -z "$kde_appsdir"; then
+ kde_appsdir='\${datadir}/applnk'
+ fi
+ if test -z "$kde_icondir"; then
+ kde_icondir='\${datadir}/icons'
+ fi
+ if test -z "$kde_sounddir"; then
+ kde_sounddir='\${datadir}/sounds'
+ fi
+ if test -z "$kde_datadir"; then
+ kde_datadir='\${datadir}/apps'
+ fi
+ if test -z "$kde_locale"; then
+ kde_locale='\${datadir}/locale'
+ fi
+ if test -z "$kde_cgidir"; then
+ kde_cgidir='\${exec_prefix}/cgi-bin'
+ fi
+ if test -z "$kde_confdir"; then
+ kde_confdir='\${datadir}/config'
+ fi
+ if test -z "$kde_kcfgdir"; then
+ kde_kcfgdir='\${datadir}/config.kcfg'
+ fi
+ if test -z "$kde_mimedir"; then
+ kde_mimedir='\${datadir}/mimelnk'
+ fi
+ if test -z "$kde_toolbardir"; then
+ kde_toolbardir='\${datadir}/toolbar'
+ fi
+ if test -z "$kde_wallpaperdir"; then
+ kde_wallpaperdir='\${datadir}/wallpapers'
+ fi
+ if test -z "$kde_templatesdir"; then
+ kde_templatesdir='\${datadir}/templates'
+ fi
+ if test -z "$kde_bindir"; then
+ kde_bindir='\${exec_prefix}/bin'
+ fi
+ if test -z "$kde_servicesdir"; then
+ kde_servicesdir='\${datadir}/services'
+ fi
+ if test -z "$kde_servicetypesdir"; then
+ kde_servicetypesdir='\${datadir}/servicetypes'
+ fi
+ if test -z "$kde_moduledir"; then
+ if test "$kde_qtver" = "2"; then
+ kde_moduledir='\${libdir}/kde2'
+ else
+ kde_moduledir='\${libdir}/kde3'
+ fi
+ fi
+ if test -z "$kde_styledir"; then
+ kde_styledir='\${libdir}/kde3/plugins/styles'
+ fi
+ if test -z "$kde_widgetdir"; then
+ kde_widgetdir='\${libdir}/kde3/plugins/designer'
+ fi
+ if test -z "$xdg_appsdir"; then
+ xdg_appsdir='\${datadir}/applications/kde'
+ fi
+ if test -z "$xdg_menudir"; then
+ xdg_menudir='\${sysconfdir}/xdg/menus'
+ fi
+ if test -z "$xdg_directorydir"; then
+ xdg_directorydir='\${datadir}/desktop-directories'
+ fi
+
+ KDE_SET_PATHS(defaults)
+
+else
+
+ if test $kde_qtver = 1; then
+ AC_MSG_RESULT([compiling])
+ KDE_1_CHECK_PATHS
+ else
+ AC_MSG_ERROR([path checking not yet supported for KDE 2])
+ fi
+
+fi
+])
+
+AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
+[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
+ test -z "$kde_icondir" || test -z "$kde_sounddir" ||
+ test -z "$kde_datadir" || test -z "$kde_locale" ||
+ test -z "$kde_cgidir" || test -z "$kde_confdir" ||
+ test -z "$kde_kcfgdir" ||
+ test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
+ test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
+ test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
+ test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
+ test -z "$kde_styledir" || test -z "kde_widgetdir" ||
+ test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
+ test "x$kde_have_all_paths" != "xyes"; then
+ kde_have_all_paths=no
+ fi
+])
+
+AC_DEFUN([KDE_MISSING_PROG_ERROR],
+[
+ AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed KDE correctly.
+])
+])
+
+AC_DEFUN([KDE_MISSING_ARTS_ERROR],
+[
+ AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed aRts correctly or use
+--without-arts to compile without aRts support (this will remove functionality).
+])
+])
+
+AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
+[
+ kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
+ test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
+ if test -n "$KDEDIRS"; then
+ kde_save_IFS=$IFS
+ IFS=:
+ for dir in $KDEDIRS; do
+ kde_default_bindirs="$dir/bin $kde_default_bindirs "
+ done
+ IFS=$kde_save_IFS
+ fi
+])
+
+AC_DEFUN([KDE_SUBST_PROGRAMS],
+[
+ AC_ARG_WITH(arts,
+ AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
+ [build_arts=$withval],
+ [build_arts=yes]
+ )
+ AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
+ if test "$build_arts" = "no"; then
+ AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
+ fi
+
+ KDE_SET_DEFAULT_BINDIRS
+ kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
+ KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
+ KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
+ if test "$build_arts" '!=' "no"; then
+ KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
+ KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
+ fi
+ KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
+
+ kde32ornewer=1
+ kde33ornewer=1
+ if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
+ kde32ornewer=
+ kde33ornewer=
+ else
+ if test "$kde_qtver" = "3"; then
+ if test "$kde_qtsubver" -le 1; then
+ kde32ornewer=
+ fi
+ if test "$kde_qtsubver" -le 2; then
+ kde33ornewer=
+ fi
+ if test "$KDECONFIG" != "compiled"; then
+ if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
+ kde33ornewer=
+ fi
+ fi
+ fi
+ fi
+
+ if test -n "$kde32ornewer"; then
+ KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
+ KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
+ fi
+ if test -n "$kde33ornewer"; then
+ KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
+ AC_SUBST(MAKEKDEWIDGETS)
+ fi
+ KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
+
+ if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
+ kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
+ test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
+ AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
+ if test "$KDE_XSL_STYLESHEET" = "NO"; then
+ KDE_XSL_STYLESHEET=""
+ else
+ KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
+ fi
+ fi
+
+ DCOP_DEPENDENCIES='$(DCOPIDL)'
+ if test -n "$kde32ornewer"; then
+ KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
+ DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
+ AC_SUBST(KCONFIG_COMPILER)
+ AC_SUBST(KCFG_DEPENDENCIES)
+ AC_SUBST(DCOPIDLNG)
+ fi
+ AC_SUBST(DCOPIDL)
+ AC_SUBST(DCOPIDL2CPP)
+ AC_SUBST(DCOP_DEPENDENCIES)
+ AC_SUBST(MCOPIDL)
+ AC_SUBST(ARTSCCONFIG)
+ AC_SUBST(MEINPROC)
+ AC_SUBST(KDE_XSL_STYLESHEET)
+ AC_SUBST(XMLLINT)
+])dnl
+
+AC_DEFUN([AC_CREATE_KFSSTND],
+[
+AC_REQUIRE([AC_CHECK_RPATH])
+
+AC_MSG_CHECKING([for KDE paths])
+kde_result=""
+kde_cached_paths=yes
+AC_CACHE_VAL(kde_cv_all_paths,
+[
+ KDE_SET_DEFAULT_PATHS($1)
+ kde_cached_paths=no
+])
+eval "$kde_cv_all_paths"
+KDE_CHECK_PATHS_FOR_COMPLETENESS
+if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
+ # wrong values were cached, may be, we can set better ones
+ kde_result=
+ kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
+ kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
+ kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
+ kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
+ kde_have_all_paths=
+ kde_styledir=
+ kde_widgetdir=
+ xdg_appsdir = xdg_menudir= xdg_directorydir=
+ KDE_SET_DEFAULT_PATHS($1)
+ eval "$kde_cv_all_paths"
+ KDE_CHECK_PATHS_FOR_COMPLETENESS
+ kde_result="$kde_result (cache overridden)"
+fi
+if test "$kde_have_all_paths" = "no"; then
+ AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
+Since it had compiled and linked before, it must be a strange problem on your system.
+Look at config.log for details. If you are not able to fix this, look at
+http://www.kde.org/faq/installation.html or any www.kde.org mirror.
+(If you're using an egcs version on Linux, you may update binutils!)
+])
+else
+ rm -f conftest*
+ AC_MSG_RESULT($kde_result)
+fi
+
+bindir=$kde_bindir
+
+KDE_SUBST_PROGRAMS
+
+])
+
+AC_DEFUN([AC_SUBST_KFSSTND],
+[
+AC_SUBST(kde_htmldir)
+AC_SUBST(kde_appsdir)
+AC_SUBST(kde_icondir)
+AC_SUBST(kde_sounddir)
+AC_SUBST(kde_datadir)
+AC_SUBST(kde_locale)
+AC_SUBST(kde_confdir)
+AC_SUBST(kde_kcfgdir)
+AC_SUBST(kde_mimedir)
+AC_SUBST(kde_wallpaperdir)
+AC_SUBST(kde_bindir)
+dnl X Desktop Group standards
+AC_SUBST(xdg_appsdir)
+AC_SUBST(xdg_menudir)
+AC_SUBST(xdg_directorydir)
+dnl for KDE 2
+AC_SUBST(kde_templatesdir)
+AC_SUBST(kde_servicesdir)
+AC_SUBST(kde_servicetypesdir)
+AC_SUBST(kde_moduledir)
+AC_SUBST(kdeinitdir, '$(kde_moduledir)')
+AC_SUBST(kde_styledir)
+AC_SUBST(kde_widgetdir)
+if test "$kde_qtver" = 1; then
+ kde_minidir="$kde_icondir/mini"
+else
+# for KDE 1 - this breaks KDE2 apps using minidir, but
+# that's the plan ;-/
+ kde_minidir="/dev/null"
+fi
+dnl AC_SUBST(kde_minidir)
+dnl AC_SUBST(kde_cgidir)
+dnl AC_SUBST(kde_toolbardir)
+])
+
+AC_DEFUN([KDE_MISC_TESTS],
+[
+ dnl Checks for libraries.
+ AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
+ AC_SUBST(LIBUTIL)
+ AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
+ AC_SUBST(LIBCOMPAT)
+ kde_have_crypt=
+ AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
+ AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
+ AC_MSG_WARN([you have no crypt in either libcrypt or libc.
+You should install libcrypt from another source or configure with PAM
+support])
+ kde_have_crypt=no
+ ]))
+ AC_SUBST(LIBCRYPT)
+ if test $kde_have_crypt = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
+ fi
+ AC_CHECK_SOCKLEN_T
+ AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+ if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+ AC_CHECK_LIB(dnet_stub, dnet_ntoa,
+ [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+ fi
+ AC_CHECK_FUNC(inet_ntoa)
+ if test $ac_cv_func_inet_ntoa = no; then
+ AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
+ fi
+ AC_CHECK_FUNC(connect)
+ if test $ac_cv_func_connect = no; then
+ AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
+ $X_EXTRA_LIBS)
+ fi
+
+ AC_CHECK_FUNC(remove)
+ if test $ac_cv_func_remove = no; then
+ AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
+ fi
+
+ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+ AC_CHECK_FUNC(shmat, ,
+ AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
+
+ # more headers that need to be explicitly included on darwin
+ AC_CHECK_HEADERS(sys/types.h stdint.h)
+
+ # sys/bitypes.h is needed for uint32_t and friends on Tru64
+ AC_CHECK_HEADERS(sys/bitypes.h)
+
+ # darwin requires a poll emulation library
+ AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
+
+ # for some image handling on Mac OS X
+ AC_CHECK_HEADERS(Carbon/Carbon.h)
+
+ # CoreAudio framework
+ AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
+ AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
+ FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
+ ])
+
+ AC_CHECK_RES_INIT
+ AC_SUBST(LIB_POLL)
+ AC_SUBST(FRAMEWORK_COREAUDIO)
+ LIBSOCKET="$X_EXTRA_LIBS"
+ AC_SUBST(LIBSOCKET)
+ AC_SUBST(X_EXTRA_LIBS)
+ AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
+ AC_SUBST(LIBUCB)
+
+ case $host in dnl this *is* LynxOS specific
+ *-*-lynxos* )
+ AC_MSG_CHECKING([LynxOS header file wrappers])
+ [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
+ AC_MSG_RESULT(disabled)
+ AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
+ ;;
+ esac
+
+ KDE_CHECK_TYPES
+ KDE_CHECK_LIBDL
+ KDE_CHECK_STRLCPY
+ KDE_CHECK_PIE_SUPPORT
+
+# darwin needs this to initialize the environment
+AC_CHECK_HEADERS(crt_externs.h)
+AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
+
+AH_VERBATIM(_DARWIN_ENVIRON,
+[
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
+# include <sys/time.h>
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+#endif
+])
+
+AH_VERBATIM(_AIX_STRINGS_H_BZERO,
+[
+/*
+ * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
+ * that defines bzero.
+ */
+
+#if defined(_AIX)
+#include <strings.h>
+#endif
+])
+
+AC_CHECK_FUNCS([vsnprintf snprintf])
+
+AH_VERBATIM(_TRU64,[
+/*
+ * On HP-UX, the declaration of vsnprintf() is needed every time !
+ */
+
+#if !defined(HAVE_VSNPRINTF) || defined(hpux)
+#if __STDC__
+#include <stdarg.h>
+#include <stdlib.h>
+#else
+#include <varargs.h>
+#endif
+#ifdef __cplusplus
+extern "C"
+#endif
+int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
+#ifdef __cplusplus
+extern "C"
+#endif
+int snprintf(char *str, size_t n, char const *fmt, ...);
+#endif
+])
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Find the header files and libraries for X-Windows. Extended the
+dnl macro AC_PATH_X
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([K_PATH_X],
+[
+AC_REQUIRE([KDE_MISC_TESTS])dnl
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_ARG_ENABLE(
+ embedded,
+ AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
+ kde_use_qt_emb=$enableval,
+ kde_use_qt_emb=no
+)
+
+AC_ARG_ENABLE(
+ qtopia,
+ AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
+ kde_use_qt_emb_palm=$enableval,
+ kde_use_qt_emb_palm=no
+)
+
+AC_ARG_ENABLE(
+ mac,
+ AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
+ kde_use_qt_mac=$enableval,
+ kde_use_qt_mac=no
+)
+
+# used to disable x11-specific stuff on special platforms
+AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
+
+if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
+
+AC_MSG_CHECKING(for X)
+
+AC_CACHE_VAL(kde_cv_have_x,
+[# One or both of the vars are not set, and there is no cached value.
+if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
+ kde_x_includes=NO
+else
+ kde_x_includes=$x_includes
+fi
+if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
+ kde_x_libraries=NO
+else
+ kde_x_libraries=$x_libraries
+fi
+
+# below we use the standard autoconf calls
+ac_x_libraries=$kde_x_libraries
+ac_x_includes=$kde_x_includes
+
+KDE_PATH_X_DIRECT
+dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
+dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
+dnl location. The correct location is /usr/lib32 or an undefined value
+dnl (the linker is smart enough to pick the correct default library).
+dnl Things work just fine if you use just AC_PATH_X_DIRECT.
+dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
+dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
+dnl x_includes should be left alone.
+case "$host" in
+mips-sgi-irix6*)
+ ;;
+*-*-solaris*)
+ ;;
+*)
+ _AC_PATH_X_XMKMF
+ if test -z "$ac_x_includes"; then
+ ac_x_includes="."
+ fi
+ if test -z "$ac_x_libraries"; then
+ ac_x_libraries="/usr/lib${kdelibsuff}"
+ fi
+esac
+#from now on we use our own again
+
+# when the user already gave --x-includes, we ignore
+# what the standard autoconf macros told us.
+if test "$kde_x_includes" = NO; then
+ kde_x_includes=$ac_x_includes
+fi
+
+# for --x-libraries too
+if test "$kde_x_libraries" = NO; then
+ kde_x_libraries=$ac_x_libraries
+fi
+
+if test "$kde_x_includes" = NO; then
+ AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
+fi
+
+if test "$kde_x_libraries" = NO; then
+ AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
+fi
+
+# Record where we found X for the cache.
+kde_cv_have_x="have_x=yes \
+ kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
+])dnl
+
+eval "$kde_cv_have_x"
+
+if test "$have_x" != yes; then
+ AC_MSG_RESULT($have_x)
+ no_x=yes
+else
+ AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
+fi
+
+if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
+ X_INCLUDES=""
+ x_includes="."; dnl better than nothing :-
+ else
+ x_includes=$kde_x_includes
+ X_INCLUDES="-I$x_includes"
+fi
+
+if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
+ X_LDFLAGS=""
+ x_libraries="/usr/lib"; dnl better than nothing :-
+ else
+ x_libraries=$kde_x_libraries
+ X_LDFLAGS="-L$x_libraries"
+fi
+all_includes="$X_INCLUDES"
+all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
+
+# Check for libraries that X11R6 Xt/Xaw programs need.
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+# check for ICE first), but we must link in the order -lSM -lICE or
+# we get undefined symbols. So assume we have SM if we have ICE.
+# These have to be linked with before -lX11, unlike the other
+# libraries we check for below, so use a different variable.
+# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+AC_CHECK_LIB(ICE, IceConnectionNumber,
+ [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
+LDFLAGS="$ac_save_LDFLAGS"
+
+LIB_X11='-lX11 $(LIBSOCKET)'
+
+AC_MSG_CHECKING(for libXext)
+AC_CACHE_VAL(kde_cv_have_libXext,
+[
+kde_ldflags_safe="$LDFLAGS"
+kde_libs_safe="$LIBS"
+
+LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
+LIBS="-lXext -lX11 $LIBSOCKET"
+
+AC_TRY_LINK([
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+],
+[
+printf("hello Xext\n");
+],
+kde_cv_have_libXext=yes,
+kde_cv_have_libXext=no
+)
+
+LDFLAGS=$kde_ldflags_safe
+LIBS=$kde_libs_safe
+])
+
+AC_MSG_RESULT($kde_cv_have_libXext)
+
+if test "$kde_cv_have_libXext" = "no"; then
+ AC_MSG_ERROR([We need a working libXext to proceed. Since configure
+can't find it itself, we stop here assuming that make wouldn't find
+them either.])
+fi
+
+LIB_XEXT="-lXext"
+QTE_NORTTI=""
+
+elif test "$kde_use_qt_emb" = "yes"; then
+ dnl We're using QT Embedded
+ CPPFLAGS=-DQWS
+ CXXFLAGS="$CXXFLAGS -fno-rtti"
+ QTE_NORTTI="-fno-rtti -DQWS"
+ X_PRE_LIBS=""
+ LIB_X11=""
+ LIB_XEXT=""
+ LIB_XRENDER=""
+ LIBSM=""
+ X_INCLUDES=""
+ X_LDFLAGS=""
+ x_includes=""
+ x_libraries=""
+elif test "$kde_use_qt_mac" = "yes"; then
+ dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
+ dnl be included to get the information) --Sam
+ CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
+ CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
+ X_PRE_LIBS=""
+ LIB_X11=""
+ LIB_XEXT=""
+ LIB_XRENDER=""
+ LIBSM=""
+ X_INCLUDES=""
+ X_LDFLAGS=""
+ x_includes=""
+ x_libraries=""
+fi
+AC_SUBST(X_PRE_LIBS)
+AC_SUBST(LIB_X11)
+AC_SUBST(LIB_XRENDER)
+AC_SUBST(LIBSM)
+AC_SUBST(X_INCLUDES)
+AC_SUBST(X_LDFLAGS)
+AC_SUBST(x_includes)
+AC_SUBST(x_libraries)
+AC_SUBST(QTE_NORTTI)
+AC_SUBST(LIB_XEXT)
+
+])
+
+AC_DEFUN([KDE_PRINT_QT_PROGRAM],
+[
+AC_REQUIRE([KDE_USE_QT])
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qglobal.h>
+#include <qapplication.h>
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qevent.h>
+#include <qstring.h>
+#include <qstyle.h>
+EOF
+
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+#if QT_VERSION < 210
+#error 1
+#endif
+EOF
+fi
+fi
+
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qcursor.h>
+#include <qstylefactory.h>
+#include <private/qucomextra_p.h>
+EOF
+fi
+
+echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
+cat >> conftest.$ac_ext <<EOF
+#error 1
+#endif
+
+int main() {
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+ QStringList *t = new QStringList();
+ Q_UNUSED(t);
+EOF
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+ QString s;
+ s.setLatin1("Elvis is alive", 14);
+EOF
+fi
+fi
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+ (void)QStyleFactory::create(QString::null);
+ QCursor c(Qt::WhatsThisCursor);
+EOF
+fi
+cat >> conftest.$ac_ext <<EOF
+ return 0;
+}
+EOF
+])
+
+AC_DEFUN([KDE_USE_QT],
+[
+if test -z "$1"; then
+ # Current default Qt version: 3.3
+ kde_qtver=3
+ kde_qtsubver=3
+else
+ kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
+ # following is the check if subversion isnt found in passed argument
+ if test "$kde_qtsubver" = "$1"; then
+ kde_qtsubver=1
+ fi
+ kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
+ if test "$kde_qtver" = "1"; then
+ kde_qtsubver=42
+ fi
+fi
+
+if test -z "$2"; then
+ if test "$kde_qtver" = "2"; then
+ if test $kde_qtsubver -gt 0; then
+ kde_qt_minversion=">= Qt 2.2.2"
+ else
+ kde_qt_minversion=">= Qt 2.0.2"
+ fi
+ fi
+ if test "$kde_qtver" = "3"; then
+ if test $kde_qtsubver -gt 0; then
+ if test $kde_qtsubver -gt 1; then
+ if test $kde_qtsubver -gt 2; then
+ kde_qt_minversion=">= Qt 3.3 and < 4.0"
+ else
+ kde_qt_minversion=">= Qt 3.2 and < 4.0"
+ fi
+ else
+ kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
+ fi
+ else
+ kde_qt_minversion=">= Qt 3.0 and < 4.0"
+ fi
+ fi
+ if test "$kde_qtver" = "1"; then
+ kde_qt_minversion=">= 1.42 and < 2.0"
+ fi
+else
+ kde_qt_minversion="$2"
+fi
+
+if test -z "$3"; then
+ if test $kde_qtver = 3; then
+ if test $kde_qtsubver -gt 0; then
+ kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
+ qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
+ kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
+ else
+ kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
+ fi
+ fi
+ if test $kde_qtver = 2; then
+ if test $kde_qtsubver -gt 0; then
+ kde_qt_verstring="QT_VERSION >= 222"
+ else
+ kde_qt_verstring="QT_VERSION >= 200"
+ fi
+ fi
+ if test $kde_qtver = 1; then
+ kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
+ fi
+else
+ kde_qt_verstring="$3"
+fi
+
+if test $kde_qtver = 4; then
+ kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
+fi
+if test $kde_qtver = 3; then
+ kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
+fi
+if test $kde_qtver = 2; then
+ kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
+fi
+if test $kde_qtver = 1; then
+ kde_qt_dirs="$QTDIR /usr/lib/qt"
+fi
+])
+
+AC_DEFUN([KDE_CHECK_QT_DIRECT],
+[
+AC_REQUIRE([KDE_USE_QT])
+AC_MSG_CHECKING([if Qt compiles without flags])
+AC_CACHE_VAL(kde_cv_qt_direct,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
+ac_LIBRARY_PATH="$LIBRARY_PATH"
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_includes"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
+else
+LIBS="$LIBQT $LIBSOCKET"
+fi
+LD_LIBRARY_PATH=
+export LD_LIBRARY_PATH
+LIBRARY_PATH=
+export LIBRARY_PATH
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ kde_cv_qt_direct="yes"
+else
+ kde_cv_qt_direct="no"
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.$ac_ext >&AC_FD_CC
+fi
+
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
+export LD_LIBRARY_PATH
+LIBRARY_PATH="$ac_LIBRARY_PATH"
+export LIBRARY_PATH
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_qt_direct" = "yes"; then
+ AC_MSG_RESULT(yes)
+ $1
+else
+ AC_MSG_RESULT(no)
+ $2
+fi
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the Qt headers and libraries.
+dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
+dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_PATH_QT_1_3],
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([KDE_USE_QT])
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+dnl ------------------------------------------------------------------------
+dnl Add configure flag to enable linking to MT version of Qt library.
+dnl ------------------------------------------------------------------------
+
+AC_ARG_ENABLE(
+ mt,
+ AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
+ kde_use_qt_mt=$enableval,
+ [
+ if test $kde_qtver = 3; then
+ kde_use_qt_mt=yes
+ else
+ kde_use_qt_mt=no
+ fi
+ ]
+)
+
+USING_QT_MT=""
+
+dnl ------------------------------------------------------------------------
+dnl If we not get --disable-qt-mt then adjust some vars for the host.
+dnl ------------------------------------------------------------------------
+
+KDE_MT_LDFLAGS=
+KDE_MT_LIBS=
+if test "x$kde_use_qt_mt" = "xyes"; then
+ KDE_CHECK_THREADING
+ if test "x$kde_use_threading" = "xyes"; then
+ CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
+ KDE_MT_LDFLAGS="$USE_THREADS"
+ KDE_MT_LIBS="$LIBPTHREAD"
+ else
+ kde_use_qt_mt=no
+ fi
+fi
+AC_SUBST(KDE_MT_LDFLAGS)
+AC_SUBST(KDE_MT_LIBS)
+
+kde_qt_was_given=yes
+
+dnl ------------------------------------------------------------------------
+dnl If we haven't been told how to link to Qt, we work it out for ourselves.
+dnl ------------------------------------------------------------------------
+if test -z "$LIBQT_GLOB"; then
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ LIBQT_GLOB="libqte.*"
+ else
+ LIBQT_GLOB="libqt.*"
+ fi
+fi
+
+dnl ------------------------------------------------------------
+dnl If we got --enable-embedded then adjust the Qt library name.
+dnl ------------------------------------------------------------
+if test "x$kde_use_qt_emb" = "xyes"; then
+ qtlib="qte"
+else
+ qtlib="qt"
+fi
+
+kde_int_qt="-l$qtlib"
+
+if test -z "$LIBQPE"; then
+dnl ------------------------------------------------------------
+dnl If we got --enable-palmtop then add -lqpe to the link line
+dnl ------------------------------------------------------------
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ if test "x$kde_use_qt_emb_palm" = "xyes"; then
+ LIB_QPE="-lqpe"
+ else
+ LIB_QPE=""
+ fi
+ else
+ LIB_QPE=""
+ fi
+fi
+
+dnl ------------------------------------------------------------------------
+dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
+dnl ------------------------------------------------------------------------
+
+if test "x$kde_use_qt_mt" = "xyes"; then
+ LIBQT="-l$qtlib-mt"
+ kde_int_qt="-l$qtlib-mt"
+ LIBQT_GLOB="lib$qtlib-mt.*"
+ USING_QT_MT="using -mt"
+else
+ LIBQT="-l$qtlib"
+fi
+
+if test $kde_qtver != 1; then
+
+ AC_REQUIRE([AC_FIND_PNG])
+ AC_REQUIRE([AC_FIND_JPEG])
+ LIBQT="$LIBQT $LIBPNG $LIBJPEG"
+fi
+
+if test $kde_qtver = 3; then
+ AC_REQUIRE([KDE_CHECK_LIBDL])
+ LIBQT="$LIBQT $LIBDL"
+fi
+
+AC_MSG_CHECKING([for Qt])
+
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
+fi
+ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
+qt_libraries=""
+qt_includes=""
+AC_ARG_WITH(qt-dir,
+ AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
+ [ ac_qt_includes="$withval"/include
+ ac_qt_libraries="$withval"/lib${kdelibsuff}
+ ac_qt_bindir="$withval"/bin
+ ])
+
+AC_ARG_WITH(qt-includes,
+ AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
+ [
+ ac_qt_includes="$withval"
+ ])
+
+kde_qt_libs_given=no
+
+AC_ARG_WITH(qt-libraries,
+ AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
+ [ ac_qt_libraries="$withval"
+ kde_qt_libs_given=yes
+ ])
+
+AC_CACHE_VAL(ac_cv_have_qt,
+[#try to guess Qt locations
+
+qt_incdirs=""
+for dir in $kde_qt_dirs; do
+ qt_incdirs="$qt_incdirs $dir/include $dir"
+done
+qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
+if test ! "$ac_qt_includes" = "NO"; then
+ qt_incdirs="$ac_qt_includes $qt_incdirs"
+fi
+
+if test "$kde_qtver" != "1"; then
+ kde_qt_header=qstyle.h
+else
+ kde_qt_header=qglobal.h
+fi
+
+AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
+ac_qt_includes="$qt_incdir"
+
+qt_libdirs=""
+for dir in $kde_qt_dirs; do
+ qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
+done
+qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
+if test ! "$ac_qt_libraries" = "NO"; then
+ qt_libdir=$ac_qt_libraries
+else
+ qt_libdirs="$ac_qt_libraries $qt_libdirs"
+ # if the Qt was given, the chance is too big that libqt.* doesn't exist
+ qt_libdir=NONE
+ for dir in $qt_libdirs; do
+ try="ls -1 $dir/${LIBQT_GLOB}"
+ if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+ done
+fi
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+ if test -e "$a"; then
+ LIBQT="$LIBQT ${kde_int_qt}_incremental"
+ break
+ fi
+done
+
+ac_qt_libraries="$qt_libdir"
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ rm -f conftest*
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.$ac_ext >&AC_FD_CC
+ ac_qt_libraries="NO"
+fi
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+AC_LANG_RESTORE
+if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
+ ac_cv_have_qt="have_qt=no"
+ ac_qt_notfound=""
+ missing_qt_mt=""
+ if test "$ac_qt_includes" = NO; then
+ if test "$ac_qt_libraries" = NO; then
+ ac_qt_notfound="(headers and libraries)";
+ else
+ ac_qt_notfound="(headers)";
+ fi
+ else
+ if test "x$kde_use_qt_mt" = "xyes"; then
+ missing_qt_mt="
+Make sure that you have compiled Qt with thread support!"
+ ac_qt_notfound="(library $qtlib-mt)";
+ else
+ ac_qt_notfound="(library $qtlib)";
+ fi
+ fi
+
+ AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
+For more details about this problem, look at the end of config.log.$missing_qt_mt])
+else
+ have_qt="yes"
+fi
+])
+
+eval "$ac_cv_have_qt"
+
+if test "$have_qt" != yes; then
+ AC_MSG_RESULT([$have_qt]);
+else
+ ac_cv_have_qt="have_qt=yes \
+ ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
+ AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
+
+ qt_libraries="$ac_qt_libraries"
+ qt_includes="$ac_qt_includes"
+fi
+
+if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
+ KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
+fi
+
+AC_SUBST(qt_libraries)
+AC_SUBST(qt_includes)
+
+if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
+ QT_INCLUDES=""
+else
+ QT_INCLUDES="-I$qt_includes"
+ all_includes="$QT_INCLUDES $all_includes"
+fi
+
+if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
+ QT_LDFLAGS=""
+else
+ QT_LDFLAGS="-L$qt_libraries"
+ all_libraries="$QT_LDFLAGS $all_libraries"
+fi
+test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
+
+AC_SUBST(QT_INCLUDES)
+AC_SUBST(QT_LDFLAGS)
+AC_PATH_QT_MOC_UIC
+
+KDE_CHECK_QT_JPEG
+
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
+else
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
+fi
+test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+ if test -e "$a"; then
+ LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
+ break
+ fi
+done
+
+AC_SUBST(LIB_QT)
+AC_SUBST(LIB_QPE)
+
+AC_SUBST(kde_qtver)
+])
+
+AC_DEFUN([AC_PATH_QT],
+[
+AC_PATH_QT_1_3
+])
+
+AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
+[
+AC_REQUIRE([AC_PATH_QT_MOC_UIC])
+
+if test x$ac_uic_supports_libpath = xyes; then
+
+AC_MSG_CHECKING([if UIC has KDE plugins available])
+AC_CACHE_VAL(kde_cv_uic_plugins,
+[
+cat > actest.ui << EOF
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>NewConnectionDialog</class>
+<widget class="QDialog">
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>testInput</cstring>
+ </property>
+ </widget>
+</widget>
+</UI>
+EOF
+
+
+
+kde_cv_uic_plugins=no
+kde_line="$UIC_PATH -L $kde_widgetdir"
+if test x$ac_uic_supports_nounload = xyes; then
+ kde_line="$kde_line -nounload"
+fi
+kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
+if AC_TRY_EVAL(kde_line); then
+ # if you're trying to debug this check and think it's incorrect,
+ # better check your installation. The check _is_ correct - your
+ # installation is not.
+ if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
+ kde_cv_uic_plugins=yes
+ fi
+fi
+rm -f actest.ui actest.cpp
+])
+
+AC_MSG_RESULT([$kde_cv_uic_plugins])
+if test "$kde_cv_uic_plugins" != yes; then
+ AC_MSG_ERROR([
+you need to install kdelibs first.
+
+If you did install kdelibs, then the Qt version that is picked up by
+this configure is not the same version you used to compile kdelibs.
+The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the
+_same Qt version_, compiled with the _same compiler_ and the same Qt
+configuration settings.
+])
+fi
+fi
+])
+
+AC_DEFUN([KDE_CHECK_FINAL],
+[
+ AC_ARG_ENABLE(final,
+ AC_HELP_STRING([--enable-final],
+ [build size optimized apps (experimental - needs lots of memory)]),
+ kde_use_final=$enableval, kde_use_final=no)
+
+ if test "x$kde_use_final" = "xyes"; then
+ KDE_USE_FINAL_TRUE=""
+ KDE_USE_FINAL_FALSE="#"
+ else
+ KDE_USE_FINAL_TRUE="#"
+ KDE_USE_FINAL_FALSE=""
+ fi
+ AC_SUBST(KDE_USE_FINAL_TRUE)
+ AC_SUBST(KDE_USE_FINAL_FALSE)
+])
+
+AC_DEFUN([KDE_CHECK_CLOSURE],
+[
+ AC_ARG_ENABLE(closure,
+ AC_HELP_STRING([--enable-closure],[delay template instantiation]),
+ kde_use_closure=$enableval, kde_use_closure=no)
+
+ KDE_NO_UNDEFINED=""
+ if test "x$kde_use_closure" = "xyes"; then
+ KDE_USE_CLOSURE_TRUE=""
+ KDE_USE_CLOSURE_FALSE="#"
+# CXXFLAGS="$CXXFLAGS $REPO"
+ else
+ KDE_USE_CLOSURE_TRUE="#"
+ KDE_USE_CLOSURE_FALSE=""
+ KDE_NO_UNDEFINED=""
+ case $host in
+ *-*-linux-gnu)
+ KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
+ [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
+ [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
+ [KDE_NO_UNDEFINED=""])],
+ [KDE_NO_UNDEFINED=""])
+ ;;
+ esac
+ fi
+ AC_SUBST(KDE_USE_CLOSURE_TRUE)
+ AC_SUBST(KDE_USE_CLOSURE_FALSE)
+ AC_SUBST(KDE_NO_UNDEFINED)
+])
+
+dnl Check if the linker supports --enable-new-dtags and --as-needed
+AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
+[
+ AC_ARG_ENABLE(new_ldflags,
+ AC_HELP_STRING([--enable-new-ldflags],
+ [enable the new linker flags]),
+ kde_use_new_ldflags=$enableval,
+ kde_use_new_ldflags=no)
+
+ LDFLAGS_AS_NEEDED=""
+ LDFLAGS_NEW_DTAGS=""
+ if test "x$kde_use_new_ldflags" = "xyes"; then
+ LDFLAGS_NEW_DTAGS=""
+ KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
+ [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
+
+ KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
+ [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
+ fi
+ AC_SUBST(LDFLAGS_AS_NEEDED)
+ AC_SUBST(LDFLAGS_NEW_DTAGS)
+])
+
+AC_DEFUN([KDE_CHECK_NMCHECK],
+[
+ AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
+ kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
+
+ if test "$kde_use_nmcheck" = "yes"; then
+ KDE_USE_NMCHECK_TRUE=""
+ KDE_USE_NMCHECK_FALSE="#"
+ else
+ KDE_USE_NMCHECK_TRUE="#"
+ KDE_USE_NMCHECK_FALSE=""
+ fi
+ AC_SUBST(KDE_USE_NMCHECK_TRUE)
+ AC_SUBST(KDE_USE_NMCHECK_FALSE)
+])
+
+AC_DEFUN([KDE_EXPAND_MAKEVAR], [
+savex=$exec_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+tmp=$$2
+while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
+exec_prefix=$savex
+])
+
+dnl ------------------------------------------------------------------------
+dnl Now, the same with KDE
+dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
+dnl and $(kde_includes) will be the kdehdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_BASE_PATH_KDE],
+[
+AC_REQUIRE([KDE_CHECK_STL])
+AC_REQUIRE([AC_PATH_QT])dnl
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_CHECK_RPATH
+AC_MSG_CHECKING([for KDE])
+
+if test "${prefix}" != NONE; then
+ kde_includes=${includedir}
+ KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
+
+ kde_libraries=${libdir}
+ KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
+
+else
+ ac_kde_includes=
+ ac_kde_libraries=
+ kde_libraries=""
+ kde_includes=""
+fi
+
+AC_CACHE_VAL(ac_cv_have_kde,
+[#try to guess kde locations
+
+if test "$kde_qtver" = 1; then
+ kde_check_header="ksock.h"
+ kde_check_lib="libkdecore.la"
+else
+ kde_check_header="ksharedptr.h"
+ kde_check_lib="libkio.la"
+fi
+
+if test -z "$1"; then
+
+kde_incdirs="$kde_libs_prefix/include /opt/kde3/include/kde /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
+test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
+kde_incdirs="$ac_kde_includes $kde_incdirs"
+AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
+ac_kde_includes="$kde_incdir"
+
+if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
+ AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE headers installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
+test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
+kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
+AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
+ac_kde_libraries="$kde_libdir"
+
+kde_widgetdir=NO
+dnl this might be somewhere else
+AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
+
+if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
+AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE libraries installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
+AC_MSG_ERROR([
+I can't find the designer plugins. These are required and should have been installed
+by kdelibs])
+fi
+
+if test -n "$kde_widgetdir"; then
+ kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
+fi
+
+
+if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
+ ac_cv_have_kde="have_kde=no"
+else
+ ac_cv_have_kde="have_kde=yes \
+ ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+fi
+
+else dnl test -z $1, e.g. from kdelibs
+
+ ac_cv_have_kde="have_kde=no"
+
+fi
+])dnl
+
+eval "$ac_cv_have_kde"
+
+if test "$have_kde" != "yes"; then
+ if test "${prefix}" = NONE; then
+ ac_kde_prefix="$ac_default_prefix"
+ else
+ ac_kde_prefix="$prefix"
+ fi
+ if test "$exec_prefix" = NONE; then
+ ac_kde_exec_prefix="$ac_kde_prefix"
+ AC_MSG_RESULT([will be installed in $ac_kde_prefix])
+ else
+ ac_kde_exec_prefix="$exec_prefix"
+ AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
+ fi
+
+ kde_libraries="${libdir}"
+ kde_includes="${includedir}"
+
+else
+ ac_cv_have_kde="have_kde=yes \
+ ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+ AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
+
+ kde_libraries="$ac_kde_libraries"
+ kde_includes="$ac_kde_includes"
+fi
+AC_SUBST(kde_libraries)
+AC_SUBST(kde_includes)
+
+if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
+ KDE_INCLUDES=""
+else
+ KDE_INCLUDES="-I$kde_includes"
+ all_includes="$KDE_INCLUDES $all_includes"
+fi
+
+KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
+
+KDE_LDFLAGS="-L$kde_libraries"
+if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
+ all_libraries="$KDE_LDFLAGS $all_libraries"
+fi
+
+AC_SUBST(KDE_LDFLAGS)
+AC_SUBST(KDE_INCLUDES)
+
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+AC_SUBST(all_includes)
+AC_SUBST(all_libraries)
+
+if test -z "$1"; then
+KDE_CHECK_UIC_PLUGINS
+fi
+
+ac_kde_libraries="$kde_libdir"
+
+AC_SUBST(AUTODIRS)
+
+
+])
+
+AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
+[
+AC_MSG_CHECKING(for extra includes)
+AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
+ kde_use_extra_includes="$withval",
+ kde_use_extra_includes=NONE
+)
+kde_extra_includes=
+if test -n "$kde_use_extra_includes" && \
+ test "$kde_use_extra_includes" != "NONE"; then
+
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $kde_use_extra_includes; do
+ kde_extra_includes="$kde_extra_includes $dir"
+ USER_INCLUDES="$USER_INCLUDES -I$dir"
+ done
+ IFS=$ac_save_ifs
+ kde_use_extra_includes="added"
+else
+ kde_use_extra_includes="no"
+fi
+AC_SUBST(USER_INCLUDES)
+
+AC_MSG_RESULT($kde_use_extra_includes)
+
+kde_extra_libs=
+AC_MSG_CHECKING(for extra libs)
+AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
+ kde_use_extra_libs=$withval,
+ kde_use_extra_libs=NONE
+)
+if test -n "$kde_use_extra_libs" && \
+ test "$kde_use_extra_libs" != "NONE"; then
+
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $kde_use_extra_libs; do
+ kde_extra_libs="$kde_extra_libs $dir"
+ KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
+ USER_LDFLAGS="$USER_LDFLAGS -L$dir"
+ done
+ IFS=$ac_save_ifs
+ kde_use_extra_libs="added"
+else
+ kde_use_extra_libs="no"
+fi
+
+AC_SUBST(USER_LDFLAGS)
+
+AC_MSG_RESULT($kde_use_extra_libs)
+
+])
+
+AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
+[
+ AC_MSG_CHECKING([for KDE headers installed])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+cat > conftest.$ac_ext <<EOF
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+#include <stdio.h>
+#include "confdefs.h"
+#include <kapp.h>
+
+int main() {
+ printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
+ printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
+ printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
+ printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
+ printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
+ printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
+ printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
+ printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
+ printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
+ printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
+ printf("kde_wallpaperdir=\\"%s\\"\n",
+ KApplication::kde_wallpaperdir().data());
+ printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
+ printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
+ printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
+ printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
+ printf("kde_moduledir=\\"/tmp/dummy\\"\n");
+ printf("kde_styledir=\\"/tmp/dummy\\"\n");
+ printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
+ printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
+ printf("xdg_menudir=\\"/tmp/dummy\\"\n");
+ printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
+ printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
+ return 0;
+ }
+EOF
+
+ ac_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$all_includes $CPPFLAGS"
+ if AC_TRY_EVAL(ac_compile); then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_ERROR([your system is not able to compile a small KDE application!
+Check, if you installed the KDE header files correctly.
+For more details about this problem, look at the end of config.log.])
+ fi
+ CPPFLAGS=$ac_save_CPPFLAGS
+
+ AC_LANG_RESTORE
+])
+
+AC_DEFUN([KDE_CHECK_KDEQTADDON],
+[
+AC_MSG_CHECKING(for kde-qt-addon)
+AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
+[
+ kde_ldflags_safe="$LDFLAGS"
+ kde_libs_safe="$LIBS"
+ kde_cxxflags_safe="$CXXFLAGS"
+
+ LIBS="-lkde-qt-addon $LIBQT $LIBS"
+ CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
+ LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
+
+ AC_TRY_LINK([
+ #include <qdom.h>
+ ],
+ [
+ QDomDocument doc;
+ ],
+ kde_cv_have_kdeqtaddon=yes,
+ kde_cv_have_kdeqtaddon=no
+ )
+
+ LDFLAGS=$kde_ldflags_safe
+ LIBS=$kde_libs_safe
+ CXXFLAGS=$kde_cxxflags_safe
+])
+
+AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
+
+if test "$kde_cv_have_kdeqtaddon" = "no"; then
+ AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
+It is a separate package (and CVS module) named kde-qt-addon.])
+fi
+])
+
+AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
+[
+ AC_REQUIRE([KDE_MISC_TESTS])
+ AC_REQUIRE([KDE_CHECK_LIBDL])
+ AC_REQUIRE([K_PATH_X])
+
+if test $kde_qtver = 3; then
+ case $host in
+ *cygwin*) lib_kded="-lkdeinit_kded" ;;
+ *) lib_kded="" ;;
+ esac
+ AC_SUBST(LIB_KDED, $lib_kded)
+ AC_SUBST(LIB_KDECORE, "-lkdecore")
+ AC_SUBST(LIB_KDEUI, "-lkdeui")
+ AC_SUBST(LIB_KIO, "-lkio")
+ AC_SUBST(LIB_KJS, "-lkjs")
+ AC_SUBST(LIB_SMB, "-lsmb")
+ AC_SUBST(LIB_KAB, "-lkab")
+ AC_SUBST(LIB_KABC, "-lkabc")
+ AC_SUBST(LIB_KHTML, "-lkhtml")
+ AC_SUBST(LIB_KSPELL, "-lkspell")
+ AC_SUBST(LIB_KPARTS, "-lkparts")
+ AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
+ AC_SUBST(LIB_KUTILS, "-lkutils")
+ AC_SUBST(LIB_KDEPIM, "-lkdepim")
+ AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
+ AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
+ AC_SUBST(LIB_KDNSSD, "-lkdnssd")
+ AC_SUBST(LIB_KUNITTEST, "-lkunittest")
+# these are for backward compatibility
+ AC_SUBST(LIB_KSYCOCA, "-lkio")
+ AC_SUBST(LIB_KFILE, "-lkio")
+elif test $kde_qtver = 2; then
+ AC_SUBST(LIB_KDECORE, "-lkdecore")
+ AC_SUBST(LIB_KDEUI, "-lkdeui")
+ AC_SUBST(LIB_KIO, "-lkio")
+ AC_SUBST(LIB_KSYCOCA, "-lksycoca")
+ AC_SUBST(LIB_SMB, "-lsmb")
+ AC_SUBST(LIB_KFILE, "-lkfile")
+ AC_SUBST(LIB_KAB, "-lkab")
+ AC_SUBST(LIB_KHTML, "-lkhtml")
+ AC_SUBST(LIB_KSPELL, "-lkspell")
+ AC_SUBST(LIB_KPARTS, "-lkparts")
+ AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
+else
+ AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
+ AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
+ AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
+ AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
+ AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
+fi
+])
+
+AC_DEFUN([AC_PATH_KDE],
+[
+ AC_BASE_PATH_KDE
+ AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
+ [
+ if test "$enableval" = "no";
+ then ac_use_path_checking="default"
+ else ac_use_path_checking=""
+ fi
+ ],
+ [
+ if test "$kde_qtver" = 1;
+ then ac_use_path_checking=""
+ else ac_use_path_checking="default"
+ fi
+ ]
+ )
+
+ AC_CREATE_KFSSTND($ac_use_path_checking)
+
+ AC_SUBST_KFSSTND
+ KDE_CREATE_LIBS_ALIASES
+])
+
+dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
+AC_DEFUN([KDE_CHECK_FUNC_EXT],
+[
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(kde_cv_func_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+save_CXXFLAGS="$CXXFLAGS"
+kde_safe_LIBS="$LIBS"
+LIBS="$LIBS $X_EXTRA_LIBS"
+if test "$GXX" = "yes"; then
+CXXFLAGS="$CXXFLAGS -pedantic-errors"
+fi
+AC_TRY_COMPILE([
+$2
+],
+[
+$3
+],
+kde_cv_func_$1=yes,
+kde_cv_func_$1=no)
+CXXFLAGS="$save_CXXFLAGS"
+LIBS="$kde_safe_LIBS"
+AC_LANG_RESTORE
+])
+
+AC_MSG_RESULT($kde_cv_func_$1)
+
+AC_MSG_CHECKING([if $1 needs custom prototype])
+AC_CACHE_VAL(kde_cv_proto_$1,
+[
+if test "x$kde_cv_func_$1" = xyes; then
+ kde_cv_proto_$1=no
+else
+ case "$1" in
+ setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
+ kde_cv_proto_$1="yes - in libkdefakes"
+ ;;
+ *)
+ kde_cv_proto_$1=unknown
+ ;;
+ esac
+fi
+
+if test "x$kde_cv_proto_$1" = xunknown; then
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ kde_safe_libs=$LIBS
+ LIBS="$LIBS $X_EXTRA_LIBS"
+ AC_TRY_LINK([
+$2
+
+extern "C" $4;
+],
+[
+$3
+],
+[ kde_cv_func_$1=yes
+ kde_cv_proto_$1=yes ],
+ [kde_cv_proto_$1="$1 unavailable"]
+)
+LIBS=$kde_safe_libs
+AC_LANG_RESTORE
+fi
+])
+AC_MSG_RESULT($kde_cv_proto_$1)
+
+if test "x$kde_cv_func_$1" = xyes; then
+ AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
+ $6
+fi
+if test "x$kde_cv_proto_$1" = xno; then
+ AC_DEFINE(HAVE_$5_PROTO, 1,
+ [Define if you have the $1 prototype])
+fi
+
+AH_VERBATIM([_HAVE_$5_PROTO],
+[
+#if !defined(HAVE_$5_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+$4;
+#ifdef __cplusplus
+}
+#endif
+#endif
+])
+])
+
+AC_DEFUN([AC_CHECK_SETENV],
+[
+ KDE_CHECK_FUNC_EXT(setenv, [
+#include <stdlib.h>
+],
+ [setenv("VAR", "VALUE", 1);],
+ [int setenv (const char *, const char *, int)],
+ [SETENV])
+])
+
+AC_DEFUN([AC_CHECK_UNSETENV],
+[
+ KDE_CHECK_FUNC_EXT(unsetenv, [
+#include <stdlib.h>
+],
+ [unsetenv("VAR");],
+ [void unsetenv (const char *)],
+ [UNSETENV])
+])
+
+AC_DEFUN([AC_CHECK_GETDOMAINNAME],
+[
+ KDE_CHECK_FUNC_EXT(getdomainname, [
+#include <stdlib.h>
+#include <unistd.h>
+#include <netdb.h>
+],
+ [
+char buffer[200];
+getdomainname(buffer, 200);
+],
+ [#include <sys/types.h>
+ int getdomainname (char *, size_t)],
+ [GETDOMAINNAME])
+])
+
+AC_DEFUN([AC_CHECK_GETHOSTNAME],
+[
+ KDE_CHECK_FUNC_EXT(gethostname, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+ [
+char buffer[200];
+gethostname(buffer, 200);
+],
+ [int gethostname (char *, unsigned int)],
+ [GETHOSTNAME])
+])
+
+AC_DEFUN([AC_CHECK_USLEEP],
+[
+ KDE_CHECK_FUNC_EXT(usleep, [
+#include <unistd.h>
+],
+ [
+usleep(200);
+],
+ [int usleep (unsigned int)],
+ [USLEEP])
+])
+
+
+AC_DEFUN([AC_CHECK_RANDOM],
+[
+ KDE_CHECK_FUNC_EXT(random, [
+#include <stdlib.h>
+],
+ [
+random();
+],
+ [long int random(void)],
+ [RANDOM])
+
+ KDE_CHECK_FUNC_EXT(srandom, [
+#include <stdlib.h>
+],
+ [
+srandom(27);
+],
+ [void srandom(unsigned int)],
+ [SRANDOM])
+
+])
+
+AC_DEFUN([AC_CHECK_INITGROUPS],
+[
+ KDE_CHECK_FUNC_EXT(initgroups, [
+#include <sys/types.h>
+#include <unistd.h>
+#include <grp.h>
+],
+ [
+char buffer[200];
+initgroups(buffer, 27);
+],
+ [int initgroups(const char *, gid_t)],
+ [INITGROUPS])
+])
+
+AC_DEFUN([AC_CHECK_MKSTEMPS],
+[
+ KDE_CHECK_FUNC_EXT(mkstemps, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+ [
+mkstemps("/tmp/aaaXXXXXX", 6);
+],
+ [int mkstemps(char *, int)],
+ [MKSTEMPS])
+])
+
+AC_DEFUN([AC_CHECK_MKSTEMP],
+[
+ KDE_CHECK_FUNC_EXT(mkstemp, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+ [
+mkstemp("/tmp/aaaXXXXXX");
+],
+ [int mkstemp(char *)],
+ [MKSTEMP])
+])
+
+AC_DEFUN([AC_CHECK_MKDTEMP],
+[
+ KDE_CHECK_FUNC_EXT(mkdtemp, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+ [
+mkdtemp("/tmp/aaaXXXXXX");
+],
+ [char *mkdtemp(char *)],
+ [MKDTEMP])
+])
+
+
+AC_DEFUN([AC_CHECK_RES_INIT],
+[
+ AC_MSG_CHECKING([if res_init needs -lresolv])
+ kde_libs_safe="$LIBS"
+ LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
+ AC_TRY_LINK(
+ [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+ ],
+ [
+ res_init();
+ ],
+ [
+ LIBRESOLV="-lresolv"
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
+ ],
+ [ AC_MSG_RESULT(no) ]
+ )
+ LIBS=$kde_libs_safe
+ AC_SUBST(LIBRESOLV)
+
+ KDE_CHECK_FUNC_EXT(res_init,
+ [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+ ],
+ [res_init()],
+ [int res_init(void)],
+ [RES_INIT])
+])
+
+AC_DEFUN([AC_CHECK_STRLCPY],
+[
+ KDE_CHECK_FUNC_EXT(strlcpy, [
+#include <string.h>
+],
+[ char buf[20];
+ strlcpy(buf, "KDE function test", sizeof(buf));
+],
+ [unsigned long strlcpy(char*, const char*, unsigned long)],
+ [STRLCPY])
+])
+
+AC_DEFUN([AC_CHECK_STRLCAT],
+[
+ KDE_CHECK_FUNC_EXT(strlcat, [
+#include <string.h>
+],
+[ char buf[20];
+ buf[0]='\0';
+ strlcat(buf, "KDE function test", sizeof(buf));
+],
+ [unsigned long strlcat(char*, const char*, unsigned long)],
+ [STRLCAT])
+])
+
+AC_DEFUN([AC_CHECK_RES_QUERY],
+[
+ KDE_CHECK_FUNC_EXT(res_query, [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+#include <netdb.h>
+],
+[
+res_query(NULL, 0, 0, NULL, 0);
+],
+ [int res_query(const char *, int, int, unsigned char *, int)],
+ [RES_QUERY])
+])
+
+AC_DEFUN([AC_CHECK_DN_SKIPNAME],
+[
+ KDE_CHECK_FUNC_EXT(dn_skipname, [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+],
+[
+dn_skipname (NULL, NULL);
+],
+ [int dn_skipname (unsigned char *, unsigned char *)],
+ [DN_SKIPNAME])
+])
+
+
+AC_DEFUN([AC_FIND_GIF],
+ [AC_MSG_CHECKING([for giflib])
+AC_CACHE_VAL(ac_cv_lib_gif,
+[ac_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
+else
+LIBS="$all_libraries -lgif"
+fi
+AC_TRY_LINK(dnl
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+int GifLastError(void);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+],
+ [return GifLastError();],
+ eval "ac_cv_lib_gif=yes",
+ eval "ac_cv_lib_gif=no")
+LIBS="$ac_save_LIBS"
+])dnl
+if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
+else
+ AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
+fi
+])
+
+AC_DEFUN([KDE_FIND_JPEG_HELPER],
+[
+AC_MSG_CHECKING([for libjpeg$2])
+AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
+[
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+void jpeg_CreateDecompress();
+#ifdef __cplusplus
+}
+#endif
+],
+[jpeg_CreateDecompress();],
+ eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
+ eval "ac_cv_lib_jpeg_$1=no")
+LIBS="$ac_save_LIBS"
+CFLAGS="$ac_save_CFLAGS"
+])
+
+if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
+ LIBJPEG="$ac_cv_lib_jpeg_$1"
+ AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
+else
+ AC_MSG_RESULT(no)
+ $3
+fi
+
+])
+
+AC_DEFUN([AC_FIND_JPEG],
+[
+dnl first look for libraries
+KDE_FIND_JPEG_HELPER(6b, 6b,
+ KDE_FIND_JPEG_HELPER(normal, [],
+ [
+ LIBJPEG=
+ ]
+ )
+)
+
+dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
+dnl requires system dependent includes loaded before it)
+jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
+AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
+test "x$jpeg_incdir" = xNO && jpeg_incdir=
+
+dnl if headers _and_ libraries are missing, this is no error, and we
+dnl continue with a warning (the user will get no jpeg support in khtml)
+dnl if only one is missing, it means a configuration error, but we still
+dnl only warn
+if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
+ AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
+else
+ if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
+ AC_MSG_WARN([
+There is an installation error in jpeg support. You seem to have only one
+of either the headers _or_ the libraries installed. You may need to either
+provide correct --with-extra-... options, or the development package of
+libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
+Disabling JPEG support.
+])
+ else
+ AC_MSG_WARN([libjpeg not found. disable JPEG support.])
+ fi
+ jpeg_incdir=
+ LIBJPEG=
+fi
+
+AC_SUBST(LIBJPEG)
+AH_VERBATIM(_AC_CHECK_JPEG,
+[/*
+ * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
+ * headers and I'm too lazy to write a configure test as long as only
+ * unixware is related
+ */
+#ifdef _UNIXWARE
+#define HAVE_BOOLEAN
+#endif
+])
+])
+
+AC_DEFUN([KDE_CHECK_QT_JPEG],
+[
+if test -n "$LIBJPEG"; then
+AC_MSG_CHECKING([if Qt needs $LIBJPEG])
+AC_CACHE_VAL(kde_cv_qt_jpeg,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
+LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[#include <qapplication.h>],
+ [
+ int argc;
+ char** argv;
+ QApplication app(argc, argv);],
+ eval "kde_cv_qt_jpeg=no",
+ eval "kde_cv_qt_jpeg=yes")
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+fi
+])
+
+if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
+ AC_MSG_RESULT(yes)
+ LIBJPEG_QT='$(LIBJPEG)'
+else
+ AC_MSG_RESULT(no)
+ LIBJPEG_QT=
+fi
+
+])
+
+AC_DEFUN([AC_FIND_ZLIB],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for libz])
+AC_CACHE_VAL(ac_cv_lib_z,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#include<zlib.h>
+],
+[
+ char buf[42];
+ gzFile f = (gzFile) 0;
+ /* this would segfault.. but we only link, don't run */
+ (void) gzgets(f, buf, sizeof(buf));
+
+ return (zlibVersion() == ZLIB_VERSION);
+],
+ eval "ac_cv_lib_z='-lz'",
+ eval "ac_cv_lib_z=no")
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if test ! "$ac_cv_lib_z" = no; then
+ AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
+ LIBZ="$ac_cv_lib_z"
+ AC_MSG_RESULT($ac_cv_lib_z)
+else
+ AC_MSG_ERROR(not found.
+ Possibly configure picks up an outdated version
+ installed by XFree86. Remove it from your system.
+
+ Check your installation and look into config.log)
+ LIBZ=""
+fi
+AC_SUBST(LIBZ)
+])
+
+AC_DEFUN([KDE_TRY_TIFFLIB],
+[
+AC_MSG_CHECKING([for libtiff $1])
+
+AC_CACHE_VAL(kde_cv_libtiff_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
+else
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
+fi
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+[
+#include<tiffio.h>
+],
+ [return (TIFFOpen( "", "r") == 0); ],
+[
+ kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
+], [
+ kde_cv_libtiff_$1=no
+])
+
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_libtiff_$1" = "no"; then
+ AC_MSG_RESULT(no)
+ LIBTIFF=""
+ $3
+else
+ LIBTIFF="$kde_cv_libtiff_$1"
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
+ $2
+fi
+
+])
+
+AC_DEFUN([AC_FIND_TIFF],
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+KDE_TRY_TIFFLIB(tiff, [],
+ KDE_TRY_TIFFLIB(tiff34))
+
+AC_SUBST(LIBTIFF)
+])
+
+AC_DEFUN([KDE_FIND_LIBEXR],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_CACHE_VAL(ac_cv_libexr,
+[
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+
+ AC_MSG_CHECKING([for OpenEXR libraries])
+
+ if test "$PKG_CONFIG" = "no" ; then
+ AC_MSG_RESULT(no)
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ if !(`$PKG_CONFIG --exists OpenEXR`) ; then
+ AC_MSG_RESULT(no)
+ EXRSTATUS=no
+ else
+ if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then
+ AC_MSG_RESULT(no)
+ EXRSTATUS=old
+ else
+ kde_save_LIBS="$LIBS"
+ LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ kde_save_CXXFLAGS="$CXXFLAGS"
+ EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
+ CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
+
+ AC_TRY_LINK(dnl
+ [
+ #include <ImfRgbaFile.h>
+ ],
+ [
+ using namespace Imf;
+ RgbaInputFile file ("dummy");
+ return 0;
+ ],
+ eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
+ eval "ac_cv_libexr=no"
+ )
+ LIBS="$kde_save_LIBS"
+ CXXFLAGS="$kde_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])dnl
+ if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
+ AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
+ LIB_EXR="$ac_cv_libexr"
+ AC_MSG_RESULT($ac_cv_libexr)
+ else
+ AC_MSG_RESULT(no)
+ LIB_EXR=""
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST(LIB_EXR)
+ AC_SUBST(EXR_FLAGS)
+])
+
+
+
+AC_DEFUN([AC_FIND_PNG],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_MSG_CHECKING([for libpng])
+AC_CACHE_VAL(ac_cv_lib_png,
+[
+kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
+else
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
+fi
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+ [
+ #include<png.h>
+ ],
+ [
+ png_structp png_ptr = png_create_read_struct( /* image ptr */
+ PNG_LIBPNG_VER_STRING, 0, 0, 0 );
+ return( png_ptr != 0 );
+ ],
+ eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
+ eval "ac_cv_lib_png=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
+ AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
+ LIBPNG="$ac_cv_lib_png"
+ AC_SUBST(LIBPNG)
+ AC_MSG_RESULT($ac_cv_lib_png)
+else
+ AC_MSG_RESULT(no)
+ LIBPNG=""
+ AC_SUBST(LIBPNG)
+fi
+])
+
+
+AC_DEFUN([AC_FIND_JASPER],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_MSG_CHECKING([for jasper])
+AC_CACHE_VAL(ac_cv_jasper,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+ [
+ #include<jasper/jasper.h>
+ ],
+ [
+ return( jas_init() );
+ ],
+ eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
+ eval "ac_cv_jasper=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
+ AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
+ LIB_JASPER="$ac_cv_jasper"
+ AC_MSG_RESULT($ac_cv_jasper)
+else
+ AC_MSG_RESULT(no)
+ LIB_JASPER=""
+fi
+AC_SUBST(LIB_JASPER)
+])
+
+AC_DEFUN([AC_CHECK_BOOL],
+[
+ AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
+])
+
+AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
+[
+AC_MSG_CHECKING(if you need GNU extensions)
+AC_CACHE_VAL(ac_cv_gnu_extensions,
+[
+cat > conftest.c << EOF
+#include <features.h>
+
+#ifdef __GNU_LIBRARY__
+yes
+#endif
+EOF
+
+if (eval "$ac_cpp conftest.c") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_gnu_extensions=yes
+else
+ ac_cv_gnu_extensions=no
+fi
+])
+
+AC_MSG_RESULT($ac_cv_gnu_extensions)
+if test "$ac_cv_gnu_extensions" = "yes"; then
+ AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
+fi
+])
+
+AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
+[
+AC_MSG_CHECKING([whether $CXX supports -$1])
+kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
+AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
+[
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -$1"
+ AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
+ CXXFLAGS="$save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
+[
+AC_MSG_CHECKING([whether $CC supports -$1])
+kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
+AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
+[
+ AC_LANG_SAVE
+ AC_LANG_C
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -$1"
+ AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
+ CFLAGS="$save_CFLAGS"
+ AC_LANG_RESTORE
+])
+if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+
+dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
+dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
+dnl it's all white-space separated
+AC_DEFUN([AC_REMOVE_FORBIDDEN],
+[ __val=$$1
+ __forbid=" $2 "
+ if test -n "$__val"; then
+ __new=""
+ ac_save_IFS=$IFS
+ IFS=" "
+ for i in $__val; do
+ case "$__forbid" in
+ *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
+ *) # Careful to not add spaces, where there were none, because otherwise
+ # libtool gets confused, if we change e.g. CXX
+ if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+ esac
+ done
+ IFS=$ac_save_IFS
+ $1=$__new
+ fi
+])
+
+
+AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
+[
+ AC_MSG_CHECKING([whether $CC is blacklisted])
+
+ dnl In theory we have tu run this test against $CC and $CXX
+ dnl in C and in C++ mode, because its perfectly legal for
+ dnl the user to mix compiler versions, since C has a defined
+ dnl ABI.
+ dnl
+ dnl For now, we assume the user is not on crack.
+
+ AC_TRY_COMPILE([
+#ifdef __GNUC__
+#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
+choke me
+#endif
+#endif
+], ,
+ kde_bad_compiler=no,
+ kde_bad_compiler=yes
+)
+
+ AC_MSG_RESULT($kde_bad_compiler)
+
+if test "$kde_bad_compiler" = "yes"; then
+ AC_MSG_ERROR([
+
+This particular compiler version is blacklisted because it
+is known to miscompile KDE. Please use a newer version, or
+if that is not yet available, choose an older version.
+
+Please do not report a bug or bother us reporting this
+configure error. We know about it, and we introduced
+it by intention to avoid untraceable bugs or crashes in KDE.
+
+])
+fi
+
+])
+
+
+AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
+[
+ AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
+ kde_cv_opt_noinline_match,
+ [
+ kde_cv_opt_noinline_match=irrelevant
+ dnl if we don't use both -O2 and -fno-inline, this check is moot
+ if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
+ && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
+
+ ac_cflags_save="$CFLAGS"
+ CFLAGS="$CFLAGS -D_USE_GNU"
+
+ AC_TRY_LINK([
+ #include <string.h>
+], [ const char *pt, *et;
+ et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ;
+],
+ kde_cv_opt_noinline_match=yes,
+ kde_cv_opt_noinline_match=no
+ )
+
+ CFLAGS="$ac_cflags_save"
+ fi
+ ])
+])
+
+
+dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
+AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
+[dnl
+if test "x$kde_use_qt_emb" != "xyes"; then
+ AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
+else
+ AC_REMOVE_FORBIDDEN(CXX, [-rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
+fi
+])
+
+AC_DEFUN([AC_CHECK_COMPILERS],
+[
+ AC_ARG_ENABLE(debug,
+ AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
+ [
+ case $enableval in
+ yes)
+ kde_use_debug_code="yes"
+ kde_use_debug_define=no
+ ;;
+ full)
+ kde_use_debug_code="full"
+ kde_use_debug_define=no
+ ;;
+ *)
+ kde_use_debug_code="no"
+ kde_use_debug_define=yes
+ ;;
+ esac
+ ],
+ [kde_use_debug_code="no"
+ kde_use_debug_define=no
+ ])
+
+ dnl Just for configure --help
+ AC_ARG_ENABLE(dummyoption,
+ AC_HELP_STRING([--disable-debug],
+ [disables debug output and debug symbols [default=no]]),
+ [],[])
+
+ AC_ARG_ENABLE(strict,
+ AC_HELP_STRING([--enable-strict],
+ [compiles with strict compiler options (may not work!)]),
+ [
+ if test $enableval = "no"; then
+ kde_use_strict_options="no"
+ else
+ kde_use_strict_options="yes"
+ fi
+ ], [kde_use_strict_options="no"])
+
+ AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
+ [
+ if test $enableval = "no"; then
+ kde_use_warnings="no"
+ else
+ kde_use_warnings="yes"
+ fi
+ ], [kde_use_warnings="yes"])
+
+ dnl enable warnings for debug build
+ if test "$kde_use_debug_code" != "no"; then
+ kde_use_warnings=yes
+ fi
+
+ AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
+ [kde_use_profiling=$enableval],
+ [kde_use_profiling="no"]
+ )
+
+ dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
+ CFLAGS=" $CFLAGS"
+
+ AC_PROG_CC
+
+ AC_PROG_CPP
+
+ if test "$GCC" = "yes"; then
+ if test "$kde_use_debug_code" != "no"; then
+ if test $kde_use_debug_code = "full"; then
+ CFLAGS="-g3 -fno-inline $CFLAGS"
+ else
+ CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
+ fi
+ else
+ CFLAGS="-O2 $CFLAGS"
+ fi
+ fi
+
+ if test "$kde_use_debug_define" = "yes"; then
+ CFLAGS="-DNDEBUG $CFLAGS"
+ fi
+
+
+ case "$host" in
+ *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
+ *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
+ esac
+
+ if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
+ LDFLAGS=""
+ fi
+
+ CXXFLAGS=" $CXXFLAGS"
+
+ AC_PROG_CXX
+
+ KDE_CHECK_FOR_BAD_COMPILER
+
+ if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
+ if test "$kde_use_debug_code" != "no"; then
+ if test "$CXX" = "KCC"; then
+ CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
+ else
+ if test "$kde_use_debug_code" = "full"; then
+ CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
+ else
+ CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
+ fi
+ fi
+ KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
+
+ dnl convenience compiler flags
+ KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
+ AC_SUBST(WOVERLOADED_VIRTUAL)
+ else
+ if test "$CXX" = "KCC"; then
+ CXXFLAGS="+K3 $CXXFLAGS"
+ else
+ CXXFLAGS="-O2 $CXXFLAGS"
+ fi
+ fi
+ fi
+
+ if test "$kde_use_debug_define" = "yes"; then
+ CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
+ fi
+
+ if test "$kde_use_profiling" = "yes"; then
+ KDE_CHECK_COMPILER_FLAG(pg,
+ [
+ CFLAGS="-pg $CFLAGS"
+ CXXFLAGS="-pg $CXXFLAGS"
+ ])
+ fi
+
+ if test "$kde_use_warnings" = "yes"; then
+ if test "$GCC" = "yes"; then
+ CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
+ case $host in
+ *-*-linux-gnu)
+ CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
+ CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
+ KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
+ KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
+ ;;
+ esac
+ KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
+ KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
+ dnl ### FIXME: revert for KDE 4
+ KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
+ fi
+ fi
+
+ if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
+ CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
+ fi
+
+ AC_ARG_ENABLE(pch,
+ AC_HELP_STRING([--enable-pch],
+ [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
+ [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
+
+ HAVE_GCC_VISIBILITY=0
+ AC_SUBST([HAVE_GCC_VISIBILITY])
+
+ if test "$GXX" = "yes"; then
+ gcc_no_reorder_blocks=NO
+ KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
+ if test $kde_use_debug_code != "no" && \
+ test $kde_use_debug_code != "full" && \
+ test "YES" = "$gcc_no_reorder_blocks" ; then
+ CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
+ CFLAGS="$CFLAGS -fno-reorder-blocks"
+ fi
+ KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
+ KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
+ KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
+ KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
+ ENABLE_PERMISSIVE_FLAG="-fpermissive"
+
+ if test "$kde_use_pch" = "yes"; then
+ AC_MSG_CHECKING(whether gcc supports precompiling c header files)
+ echo >conftest.h
+ if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
+ kde_gcc_supports_pch=yes
+ AC_MSG_RESULT(yes)
+ else
+ kde_gcc_supports_pch=no
+ AC_MSG_RESULT(no)
+ fi
+ if test "$kde_gcc_supports_pch" = "yes"; then
+ AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
+ if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
+ kde_gcc_supports_pch=yes
+ AC_MSG_RESULT(yes)
+ else
+ kde_gcc_supports_pch=no
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ rm -f conftest.h conftest.h.gch
+ fi
+
+ KDE_CHECK_FOR_OPT_NOINLINE_MATCH
+ if test "x$kde_cv_opt_noinline_match" = "xno" ; then
+ CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
+ fi
+ fi
+ AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
+ if test "$CXX" = "KCC"; then
+ dnl unfortunately we currently cannot disable exception support in KCC
+ dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
+ dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
+ dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
+
+ if test "$kde_use_pch" = "yes"; then
+ dnl TODO: support --pch-dir!
+ KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
+ dnl the below works (but the dir must exist), but it's
+ dnl useless for a whole package.
+ dnl The are precompiled headers for each source file, so when compiling
+ dnl from scratch, it doesn't make a difference, and they take up
+ dnl around ~5Mb _per_ sourcefile.
+ dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
+ dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
+ fi
+ dnl this flag controls inlining. by default KCC inlines in optimisation mode
+ dnl all implementations that are defined inside the class {} declaration.
+ dnl because of templates-compatibility with broken gcc compilers, this
+ dnl can cause excessive inlining. This flag limits it to a sane level
+ KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
+ KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
+ KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
+ KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
+ dnl Some source files are shared between multiple executables
+ dnl (or libraries) and some of those need template instantiations.
+ dnl In that case KCC needs to compile those sources with
+ dnl --one_instantiation_per_object. To make it easy for us we compile
+ dnl _all_ objects with that flag (--one_per is a shorthand).
+ KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
+ fi
+ AC_SUBST(USE_EXCEPTIONS)
+ dnl obsolete macro - provided to keep things going
+ USE_RTTI=
+ AC_SUBST(USE_RTTI)
+
+ case "$host" in
+ *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
+ *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
+ *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
+ *-*-solaris*)
+ if test "$GXX" = yes; then
+ libstdcpp=`$CXX -print-file-name=libstdc++.so`
+ if test ! -f $libstdcpp; then
+ AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
+ fi
+ fi
+ ;;
+ esac
+
+ AC_VALIDIFY_CXXFLAGS
+
+ AC_PROG_CXXCPP
+
+ if test "$GCC" = yes; then
+ NOOPT_CFLAGS=-O0
+ fi
+ KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
+
+ AC_ARG_ENABLE(coverage,
+ AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
+ if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
+ ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+ ac_coverage_linker="-lgcc"
+ elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
+ ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+ ac_coverage_linker=""
+ else
+ AC_MSG_ERROR([coverage with your compiler is not supported])
+ fi
+ CFLAGS="$CFLAGS $ac_coverage_compiler"
+ CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
+ LDFLAGS="$LDFLAGS $ac_coverage_linker"
+ ])
+
+ AC_SUBST(NOOPT_CXXFLAGS)
+ AC_SUBST(NOOPT_CFLAGS)
+ AC_SUBST(ENABLE_PERMISSIVE_FLAG)
+
+ KDE_CHECK_NEW_LDFLAGS
+ KDE_CHECK_FINAL
+ KDE_CHECK_CLOSURE
+ KDE_CHECK_NMCHECK
+
+ ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
+])
+
+AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
+ [
+ AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ safe_CXXFLAGS=$CXXFLAGS
+ safe_LDFLAGS=$LDFLAGS
+ CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
+ LDFLAGS="$LDFLAGS -shared -fPIC"
+
+ AC_TRY_LINK(
+ [
+ /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
+ #include <string>
+ int some_function( void ) __attribute__ ((visibility("default")));
+ int some_function( void )
+ {
+ std::string s("blafasel");
+ return 0;
+ }
+ ], [/* elvis is alive */],
+ kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
+
+ CXXFLAGS=$safe_CXXFLAGS
+ LDFLAGS=$safe_LDFLAGS
+ AC_LANG_RESTORE
+ ]
+ )
+
+ if test x$kde_cv_val_gcc_visibility_bug = xno; then
+ CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
+ fi
+ ]
+)
+
+AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
+[
+ AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
+
+ AC_MSG_CHECKING([grepping for visibility push/pop in headers])
+
+ if test "x$GXX" = "xyes"; then
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_EGREP_CPP(
+ [GCC visibility push],
+ [ #include <exception>
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ kde_stdc_visibility_patched=yes ],
+ [
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for
+ visibility support. Disabling -fvisibility=hidden])
+
+ kde_stdc_visibility_patched=no ])
+
+ AC_LANG_RESTORE
+
+ kde_have_gcc_visibility=no
+ KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
+ [
+ kde_have_gcc_visibility=yes
+ dnl the whole toolchain is just a mess, gcc is just too buggy
+ dnl to handle STL with visibility enabled. Lets reconsider
+ dnl when gcc 4.2 is out or when things get fixed in the compiler.
+ dnl Contact mueller@kde.org for details.
+ AC_ARG_ENABLE(gcc-hidden-visibility,
+ AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
+ [kde_have_gcc_visibility=$enableval],
+ [kde_have_gcc_visibility=no])
+
+ AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ safe_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS $all_includes"
+
+ AC_TRY_COMPILE(
+ [
+#include <qglobal.h>
+#if Q_EXPORT - 0 != 0
+/* if this compiles, then Q_EXPORT is undefined */
+/* if Q_EXPORT is nonempty, this will break compilation */
+#endif
+ ], [/* elvis is alive */],
+ kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
+
+ CXXFLAGS=$safe_CXXFLAGS
+ AC_LANG_RESTORE
+ ]
+ )
+
+ if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
+ CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ KDE_CHECK_VISIBILITY_GCC_BUG
+ HAVE_GCC_VISIBILITY=1
+ AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
+ fi
+ ])
+ fi
+])
+
+AC_DEFUN([KDE_ADD_DEPENDENCIES],
+[
+ [A]M_DEPENDENCIES(CC)
+ [A]M_DEPENDENCIES(CXX)
+])
+
+dnl just a wrapper to clean up configure.in
+AC_DEFUN([KDE_PROG_LIBTOOL],
+[
+AC_REQUIRE([AC_CHECK_COMPILERS])
+AC_REQUIRE([AC_ENABLE_SHARED])
+AC_REQUIRE([AC_ENABLE_STATIC])
+
+AC_REQUIRE([AC_LIBTOOL_DLOPEN])
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_OBJEXT
+AC_EXEEXT
+
+AM_PROG_LIBTOOL
+AC_LIBTOOL_CXX
+
+LIBTOOL_SHELL="/bin/sh ./libtool"
+# LIBTOOL="$LIBTOOL --silent"
+KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
+AC_SUBST(KDE_PLUGIN)
+
+# This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs.
+KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
+AC_SUBST(KDE_CHECK_PLUGIN)
+
+# we patch configure quite some so we better keep that consistent for incremental runs
+AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
+])
+
+AC_DEFUN([KDE_CHECK_LIB64],
+[
+ AC_ARG_ENABLE(libsuffix,
+ AC_HELP_STRING([--enable-libsuffix],
+ [/lib directory suffix (64,32,none,auto[=default])]),
+ kdelibsuff=$enableval, kdelibsuff="auto")
+
+ if test "$kdelibsuff" = "auto"; then
+
+cat > conftest.c << EOF
+#include <stdio.h>
+int main() {
+ return 0;
+}
+EOF
+ kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
+ s,.*/lib\([[^\/]]*\)/.*,\1,
+ p
+}'`
+ rm -rf conftest.*
+ fi
+
+ if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then
+ kdelibsuff=
+ fi
+ if test -z "$kdelibsuff"; then
+ AC_MSG_RESULT([not using lib directory suffix])
+ AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
+ else
+ if test "$libdir" = '${exec_prefix}/lib'; then
+ libdir="$libdir${kdelibsuff}"
+ AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
+ fi
+ AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
+ AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
+ fi
+])
+
+AC_DEFUN([KDE_CHECK_TYPES],
+[ AC_CHECK_SIZEOF(int, 4)dnl
+ AC_CHECK_SIZEOF(short)dnl
+ AC_CHECK_SIZEOF(long, 4)dnl
+ AC_CHECK_SIZEOF(char *, 4)dnl
+])dnl
+
+dnl Not used - kept for compat only?
+AC_DEFUN([KDE_DO_IT_ALL],
+[
+AC_CANONICAL_SYSTEM
+AC_ARG_PROGRAM
+AM_INIT_AUTOMAKE($1, $2)
+AM_DISABLE_LIBRARIES
+AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+AC_CHECK_COMPILERS
+KDE_PROG_LIBTOOL
+AM_KDE_WITH_NLS
+AC_PATH_KDE
+])
+
+AC_DEFUN([AC_CHECK_RPATH],
+[
+AC_MSG_CHECKING(for rpath)
+AC_ARG_ENABLE(rpath,
+ AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
+ USE_RPATH=$enableval, USE_RPATH=yes)
+
+if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
+
+ KDE_RPATH="-R \$(libdir)"
+
+ if test "$kde_libraries" != "$libdir"; then
+ KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
+ fi
+
+ if test -n "$qt_libraries"; then
+ KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
+ fi
+ dnl $x_libraries is set to /usr/lib in case
+ if test -n "$X_LDFLAGS"; then
+ X_RPATH="-R \$(x_libraries)"
+ KDE_RPATH="$KDE_RPATH $X_RPATH"
+ fi
+ if test -n "$KDE_EXTRA_RPATH"; then
+ KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
+ fi
+fi
+AC_SUBST(KDE_EXTRA_RPATH)
+AC_SUBST(KDE_RPATH)
+AC_SUBST(X_RPATH)
+AC_MSG_RESULT($USE_RPATH)
+])
+
+dnl Check for the type of the third argument of getsockname
+AC_DEFUN([AC_CHECK_SOCKLEN_T],
+[
+ AC_MSG_CHECKING(for socklen_t)
+ AC_CACHE_VAL(kde_cv_socklen_t,
+ [
+ AC_LANG_PUSH(C++)
+ kde_cv_socklen_t=no
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ],
+ [
+ socklen_t len;
+ getpeername(0,0,&len);
+ ],
+ [
+ kde_cv_socklen_t=yes
+ kde_cv_socklen_t_equiv=socklen_t
+ ])
+ AC_LANG_POP(C++)
+ ])
+ AC_MSG_RESULT($kde_cv_socklen_t)
+ if test $kde_cv_socklen_t = no; then
+ AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
+ AC_CACHE_VAL(kde_cv_socklen_t_equiv,
+ [
+ kde_cv_socklen_t_equiv=int
+ AC_LANG_PUSH(C++)
+ for t in int size_t unsigned long "unsigned long"; do
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ],
+ [
+ $t len;
+ getpeername(0,0,&len);
+ ],
+ [
+ kde_cv_socklen_t_equiv="$t"
+ break
+ ])
+ done
+ AC_LANG_POP(C++)
+ ])
+ AC_MSG_RESULT($kde_cv_socklen_t_equiv)
+ fi
+ AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
+ [type to use in place of socklen_t if not defined])
+ AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
+ [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
+])
+
+dnl This is a merge of some macros out of the gettext aclocal.m4
+dnl since we don't need anything, I took the things we need
+dnl the copyright for them is:
+dnl >
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+dnl >
+dnl for this file it is relicensed under LGPL
+
+AC_DEFUN([AM_KDE_WITH_NLS],
+ [
+ dnl If we use NLS figure out what method
+
+ AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
+ [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+ if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
+ AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
+ GMSGFMT=":"
+ fi
+ MSGFMT=$GMSGFMT
+ AC_SUBST(GMSGFMT)
+ AC_SUBST(MSGFMT)
+
+ AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is no GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext programs is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ fi
+ AC_SUBST(XGETTEXT)
+
+ ])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+# serial 1
+# Stephan Kulow: I appended a _KDE against name conflicts
+
+dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ /*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# serial 1
+
+AC_DEFUN([AM_LC_MESSAGES],
+ [if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
+ fi
+ fi])
+
+dnl From Jim Meyering.
+dnl FIXME: migrate into libit.
+
+AC_DEFUN([AM_FUNC_OBSTACK],
+[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
+ [AC_TRY_LINK([#include "obstack.h"],
+ [struct obstack *mem;obstack_free(mem,(char *) 0)],
+ am_cv_func_obstack=yes,
+ am_cv_func_obstack=no)])
+ if test $am_cv_func_obstack = yes; then
+ AC_DEFINE(HAVE_OBSTACK)
+ else
+ LIBOBJS="$LIBOBJS obstack.o"
+ fi
+])
+
+dnl From Jim Meyering. Use this if you use the GNU error.[ch].
+dnl FIXME: Migrate into libit
+
+AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
+[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
+ [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
+ am_cv_lib_error_at_line=yes,
+ am_cv_lib_error_at_line=no)])
+ if test $am_cv_lib_error_at_line = no; then
+ LIBOBJS="$LIBOBJS error.o"
+ fi
+ AC_SUBST(LIBOBJS)dnl
+])
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# serial 1
+# Stephan Kulow: I put a KDE in it to avoid name conflicts
+
+AC_DEFUN([AM_KDE_GNU_GETTEXT],
+ [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([AC_TYPE_OFF_T])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+ AC_REQUIRE([AM_KDE_WITH_NLS])dnl
+ AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
+ AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+ AC_MSG_CHECKING(for stpcpy)
+ AC_CACHE_VAL(kde_cv_func_stpcpy,
+ [
+ kde_safe_cxxflags=$CXXFLAGS
+ CXXFLAGS="-Werror"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+ #include <string.h>
+ ],
+ [
+ char buffer[200];
+ stpcpy(buffer, buffer);
+ ],
+ kde_cv_func_stpcpy=yes,
+ kde_cv_func_stpcpy=no)
+ AC_LANG_RESTORE
+ CXXFLAGS=$kde_safe_cxxflags
+ ])
+ AC_MSG_RESULT($kde_cv_func_stpcpy)
+ if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
+ AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
+ fi
+
+ AM_LC_MESSAGES
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ AC_MSG_CHECKING(for catalogs to be installed)
+ NEW_LINGUAS=
+ for lang in ${LINGUAS=$ALL_LINGUAS}; do
+ case "$ALL_LINGUAS" in
+ *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+ esac
+ done
+ LINGUAS=$NEW_LINGUAS
+ AC_MSG_RESULT($LINGUAS)
+ fi
+
+ dnl Construct list of names of catalog files to be constructed.
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ ])
+
+AC_DEFUN([AC_HAVE_XPM],
+ [AC_REQUIRE_CPP()dnl
+ AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
+ test -z "$XPM_INCLUDE" && XPM_INCLUDE=
+
+ AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
+ xpm_test=$withval, xpm_test="yes")
+ if test "x$xpm_test" = xno; then
+ ac_cv_have_xpm=no
+ else
+ AC_MSG_CHECKING(for XPM)
+ AC_CACHE_VAL(ac_cv_have_xpm,
+ [
+ ac_save_ldflags="$LDFLAGS"
+ ac_save_cflags="$CFLAGS"
+ if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+ LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
+ else
+ LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
+ fi
+ CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
+ test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
+ AC_TRY_LINK([#include <X11/xpm.h>],[],
+ ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
+ LDFLAGS="$ac_save_ldflags"
+ CFLAGS="$ac_save_cflags"
+ ])dnl
+
+ if test "$ac_cv_have_xpm" = no; then
+ AC_MSG_RESULT(no)
+ XPM_LDFLAGS=""
+ XPMINC=""
+ $2
+ else
+ AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
+ if test "$XPM_LDFLAGS" = ""; then
+ XPMLIB='-lXpm $(LIB_X11)'
+ else
+ XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
+ fi
+ if test "$XPM_INCLUDE" = ""; then
+ XPMINC=""
+ else
+ XPMINC="-I$XPM_INCLUDE"
+ fi
+ AC_MSG_RESULT(yes)
+ $1
+ fi
+ fi
+ AC_SUBST(XPMINC)
+ AC_SUBST(XPMLIB)
+])
+
+AC_DEFUN([AC_HAVE_DPMS],
+ [AC_REQUIRE_CPP()dnl
+ AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
+ test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
+ DPMS_LIB=
+
+ AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
+ dpms_test=$withval, dpms_test="yes")
+ if test "x$dpms_test" = xno; then
+ ac_cv_have_dpms=no
+ else
+ AC_MSG_CHECKING(for DPMS)
+ dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
+ dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
+ AC_CACHE_VAL(ac_cv_have_dpms,
+ [
+ if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
+ AC_MSG_RESULT(no)
+ ac_cv_have_dpms="no"
+ else
+ ac_save_ldflags="$LDFLAGS"
+ ac_save_cflags="$CFLAGS"
+ ac_save_libs="$LIBS"
+ LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
+ LIBS="-lX11 -lXext $LIBSOCKET"
+ CFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+ AC_TRY_LINK([
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>
+ int foo_test_dpms()
+ { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+ ac_cv_have_dpms="yes", [
+ LIBS="-lXdpms $LIBS"
+ AC_TRY_LINK([
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>
+ int foo_test_dpms()
+ { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+ [
+ ac_cv_have_dpms="-lXdpms"
+ ],ac_cv_have_dpms="no")
+ ])
+ LDFLAGS="$ac_save_ldflags"
+ CFLAGS="$ac_save_cflags"
+ LIBS="$ac_save_libs"
+ fi
+ ])dnl
+
+ if test "$ac_cv_have_dpms" = no; then
+ AC_MSG_RESULT(no)
+ DPMS_LDFLAGS=""
+ DPMSINC=""
+ $2
+ else
+ AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
+ if test "$ac_cv_have_dpms" = "-lXdpms"; then
+ DPMS_LIB="-lXdpms"
+ fi
+ if test "$DPMS_LDFLAGS" = ""; then
+ DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
+ else
+ DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
+ fi
+ if test "$DPMS_INCLUDE" = ""; then
+ DPMSINC=""
+ else
+ DPMSINC="-I$DPMS_INCLUDE"
+ fi
+ AC_MSG_RESULT(yes)
+ $1
+ fi
+ fi
+ ac_save_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+ AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
+ [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
+ AC_CHECK_DECL(DPMSCapable,
+ AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
+ [#include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>])
+ AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
+ [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
+ AC_CHECK_DECL(DPMSInfo,
+ AC_DEFINE(HAVE_DPMSINFO_PROTO),,
+ [#include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>])
+ CFLAGS="$ac_save_cflags"
+ AC_SUBST(DPMSINC)
+ AC_SUBST(DPMSLIB)
+])
+
+AC_DEFUN([AC_HAVE_GL],
+ [AC_REQUIRE_CPP()dnl
+ AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$GL_LDFLAGS" && GL_LDFLAGS=
+ test -z "$GL_INCLUDE" && GL_INCLUDE=
+
+ AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
+ gl_test=$withval, gl_test="yes")
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ # GL and Qt Embedded is a no-go for now.
+ ac_cv_have_gl=no
+ elif test "x$gl_test" = xno; then
+ ac_cv_have_gl=no
+ else
+ AC_MSG_CHECKING(for GL)
+ AC_CACHE_VAL(ac_cv_have_gl,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_ldflags=$LDFLAGS
+ ac_save_cxxflags=$CXXFLAGS
+ ac_save_libs=$LIBS
+ LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
+ LIBS="$LIBS -lGL -lGLU"
+ test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
+ LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
+ CXXFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
+ AC_TRY_LINK([#include <GL/gl.h>
+#include <GL/glu.h>
+], [],
+ ac_cv_have_gl="yes", ac_cv_have_gl="no")
+ AC_LANG_RESTORE
+ LDFLAGS=$ac_save_ldflags
+ CXXFLAGS=$ac_save_cxxflags
+ LIBS=$ac_save_libs
+ ])dnl
+
+ if test "$ac_cv_have_gl" = "no"; then
+ AC_MSG_RESULT(no)
+ GL_LDFLAGS=""
+ GLINC=""
+ $2
+ else
+ AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
+ if test "$GL_LDFLAGS" = ""; then
+ GLLIB='-lGLU -lGL $(LIB_X11)'
+ else
+ GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
+ fi
+ if test "$GL_INCLUDE" = ""; then
+ GLINC=""
+ else
+ GLINC="-I$GL_INCLUDE"
+ fi
+ AC_MSG_RESULT($ac_cv_have_gl)
+ $1
+ fi
+ fi
+ AC_SUBST(GLINC)
+ AC_SUBST(GLLIB)
+])
+
+
+ dnl shadow password and PAM magic - maintained by ossi@kde.org
+
+AC_DEFUN([KDE_PAM], [
+ AC_REQUIRE([KDE_CHECK_LIBDL])
+
+ want_pam=
+ AC_ARG_WITH(pam,
+ AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
+ [ if test "x$withval" = "xyes"; then
+ want_pam=yes
+ pam_service=kde
+ elif test "x$withval" = "xno"; then
+ want_pam=no
+ else
+ want_pam=yes
+ pam_service=$withval
+ fi
+ ], [ pam_service=kde ])
+
+ use_pam=
+ PAMLIBS=
+ if test "x$want_pam" != xno; then
+ AC_CHECK_LIB(pam, pam_start, [
+ AC_CHECK_HEADER(security/pam_appl.h,
+ [ pam_header=security/pam_appl.h ],
+ [ AC_CHECK_HEADER(pam/pam_appl.h,
+ [ pam_header=pam/pam_appl.h ],
+ [
+ AC_MSG_WARN([PAM detected, but no headers found!
+Make sure you have the necessary development packages installed.])
+ ]
+ )
+ ]
+ )
+ ], , $LIBDL)
+ if test -z "$pam_header"; then
+ if test "x$want_pam" = xyes; then
+ AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
+ fi
+ else
+ AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
+ PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
+ use_pam=yes
+
+ dnl darwin claims to be something special
+ if test "$pam_header" = "pam/pam_appl.h"; then
+ AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
+ fi
+
+ dnl test whether struct pam_message is const (Linux) or not (Sun)
+ AC_MSG_CHECKING(for const pam_message)
+ AC_EGREP_HEADER([struct pam_message], $pam_header,
+ [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
+ [AC_MSG_RESULT([const: Linux-type PAM])],
+ [AC_MSG_RESULT([nonconst: Sun-type PAM])
+ AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
+ )],
+ [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
+ fi
+ fi
+
+ AC_SUBST(PAMLIBS)
+])
+
+dnl DEF_PAM_SERVICE(arg name, full name, define name)
+AC_DEFUN([DEF_PAM_SERVICE], [
+ AC_ARG_WITH($1-pam,
+ AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
+ [ if test "x$use_pam" = xyes; then
+ $3_PAM_SERVICE=$withval
+ else
+ AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
+You may want to enforce it by using --with-pam.])
+ fi
+ ],
+ [ if test "x$use_pam" = xyes; then
+ $3_PAM_SERVICE="$pam_service"
+ fi
+ ])
+ if test -n "$$3_PAM_SERVICE"; then
+ AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
+ AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
+ fi
+ AC_SUBST($3_PAM_SERVICE)
+])
+
+AC_DEFUN([KDE_SHADOWPASSWD], [
+ AC_REQUIRE([KDE_PAM])
+
+ AC_CHECK_LIB(shadow, getspent,
+ [ LIBSHADOW="-lshadow"
+ ac_use_shadow=yes
+ ],
+ [ dnl for UnixWare
+ AC_CHECK_LIB(gen, getspent,
+ [ LIBGEN="-lgen"
+ ac_use_shadow=yes
+ ],
+ [ AC_CHECK_FUNC(getspent,
+ [ ac_use_shadow=yes ],
+ [ ac_use_shadow=no ])
+ ])
+ ])
+ AC_SUBST(LIBSHADOW)
+ AC_SUBST(LIBGEN)
+
+ AC_MSG_CHECKING([for shadow passwords])
+
+ AC_ARG_WITH(shadow,
+ AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
+ [ if test "x$withval" != "xno"; then
+ use_shadow=yes
+ else
+ use_shadow=no
+ fi
+ ], [
+ use_shadow="$ac_use_shadow"
+ ])
+
+ if test "x$use_shadow" = xyes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
+ else
+ AC_MSG_RESULT(no)
+ LIBSHADOW=
+ LIBGEN=
+ fi
+
+ dnl finally make the relevant binaries setuid root, if we have shadow passwds.
+ dnl this still applies, if we could use it indirectly through pam.
+ if test "x$use_shadow" = xyes ||
+ ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
+ case $host in
+ *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
+ SETUIDFLAGS="-m 4755 -o root";;
+ *)
+ SETUIDFLAGS="-m 4755";;
+ esac
+ fi
+ AC_SUBST(SETUIDFLAGS)
+
+])
+
+AC_DEFUN([KDE_PASSWDLIBS], [
+ AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
+ AC_REQUIRE([KDE_PAM])
+ AC_REQUIRE([KDE_SHADOWPASSWD])
+
+ if test "x$use_pam" = "xyes"; then
+ PASSWDLIBS="$PAMLIBS"
+ else
+ PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
+ fi
+
+ dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
+ dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
+ dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
+ dnl may need to read /etc/master.passwd).
+ case $host in
+ *-*-freebsd*)
+ SETUIDFLAGS="-m 4755 -o root"
+ ;;
+ *)
+ ;;
+ esac
+
+ AC_SUBST(PASSWDLIBS)
+])
+
+AC_DEFUN([KDE_CHECK_LIBDL],
+[
+AC_CHECK_LIB(dl, dlopen, [
+LIBDL="-ldl"
+ac_cv_have_dlfcn=yes
+])
+
+AC_CHECK_LIB(dld, shl_unload, [
+LIBDL="-ldld"
+ac_cv_have_shload=yes
+])
+
+AC_SUBST(LIBDL)
+])
+
+AC_DEFUN([KDE_CHECK_DLOPEN],
+[
+KDE_CHECK_LIBDL
+AC_CHECK_HEADERS(dlfcn.h dl.h)
+if test "$ac_cv_header_dlfcn_h" = "no"; then
+ ac_cv_have_dlfcn=no
+fi
+
+if test "$ac_cv_header_dl_h" = "no"; then
+ ac_cv_have_shload=no
+fi
+
+dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
+dnl (MM)
+AC_ARG_ENABLE(dlopen,
+AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
+enable_dlopen=$enableval,
+enable_dlopen=yes)
+
+# override the user's opinion, if we know it better ;)
+if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
+ enable_dlopen=no
+fi
+
+if test "$ac_cv_have_dlfcn" = "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
+fi
+
+if test "$ac_cv_have_shload" = "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
+fi
+
+if test "$enable_dlopen" = no ; then
+ test -n "$1" && eval $1
+else
+ test -n "$2" && eval $2
+fi
+
+])
+
+AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
+[
+KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
+KDE_PROG_LIBTOOL
+AC_MSG_CHECKING([dynamic loading])
+eval "`egrep '^build_libtool_libs=' libtool`"
+if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
+ dynamic_loading=yes
+ AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
+else
+ dynamic_loading=no
+fi
+AC_MSG_RESULT($dynamic_loading)
+if test "$dynamic_loading" = "yes"; then
+ $1
+else
+ $2
+fi
+])
+
+AC_DEFUN([KDE_ADD_INCLUDES],
+[
+if test -z "$1"; then
+ test_include="Pix.h"
+else
+ test_include="$1"
+fi
+
+AC_MSG_CHECKING([for libg++ ($test_include)])
+
+AC_CACHE_VAL(kde_cv_libgpp_includes,
+[
+kde_cv_libgpp_includes=no
+
+ for ac_dir in \
+ \
+ /usr/include/g++ \
+ /usr/include \
+ /usr/unsupported/include \
+ /opt/include \
+ $extra_include \
+ ; \
+ do
+ if test -r "$ac_dir/$test_include"; then
+ kde_cv_libgpp_includes=$ac_dir
+ break
+ fi
+ done
+])
+
+AC_MSG_RESULT($kde_cv_libgpp_includes)
+if test "$kde_cv_libgpp_includes" != "no"; then
+ all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
+fi
+])
+])
+
+AC_DEFUN([KDE_CHECK_LIBPTHREAD],
+[
+ dnl This code is here specifically to handle the
+ dnl various flavors of threading library on FreeBSD
+ dnl 4-, 5-, and 6-, and the (weird) rules around it.
+ dnl There may be an environment PTHREAD_LIBS that
+ dnl specifies what to use; otherwise, search for it.
+ dnl -pthread is special cased and unsets LIBPTHREAD
+ dnl below if found.
+ LIBPTHREAD=""
+
+ if test -n "$PTHREAD_LIBS"; then
+ if test "x$PTHREAD_LIBS" = "x-pthread" ; then
+ LIBPTHREAD="PTHREAD"
+ else
+ PTHREAD_LIBS_save="$PTHREAD_LIBS"
+ PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
+ AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
+ KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
+ LIBPTHREAD="$PTHREAD_LIBS_save"])
+ PTHREAD_LIBS="$PTHREAD_LIBS_save"
+ fi
+ fi
+
+ dnl Is this test really needed, in the face of the Tru64 test below?
+ if test -z "$LIBPTHREAD"; then
+ AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
+ fi
+
+ dnl This is a special Tru64 check, see BR 76171 issue #18.
+ if test -z "$LIBPTHREAD" ; then
+ AC_MSG_CHECKING([for pthread_create in -lpthread])
+ kde_safe_libs=$LIBS
+ LIBS="$LIBS -lpthread"
+ AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
+ AC_MSG_RESULT(yes)
+ LIBPTHREAD="-lpthread"],[
+ AC_MSG_RESULT(no)])
+ LIBS=$kde_safe_libs
+ fi
+
+ dnl Un-special-case for FreeBSD.
+ if test "x$LIBPTHREAD" = "xPTHREAD" ; then
+ LIBPTHREAD=""
+ fi
+
+ AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
+[
+ USE_THREADS=""
+ if test -z "$LIBPTHREAD"; then
+ KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
+ fi
+
+ AH_VERBATIM(__svr_define, [
+#if defined(__SVR4) && !defined(__svr4__)
+#define __svr4__ 1
+#endif
+])
+ case $host_os in
+ solaris*)
+ KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
+ ;;
+ freebsd*)
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
+ ;;
+ aix*)
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+ LIBPTHREAD="$LIBPTHREAD -lc_r"
+ ;;
+ linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ if test "$CXX" = "KCC"; then
+ CXXFLAGS="$CXXFLAGS --thread_safe"
+ NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
+ fi
+ ;;
+ *)
+ ;;
+ esac
+ AC_SUBST(USE_THREADS)
+ AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN([KDE_CHECK_THREADING],
+[
+ AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+ AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
+ dnl default is yes if libpthread is found and no if no libpthread is available
+ if test -z "$LIBPTHREAD"; then
+ if test -z "$USE_THREADS"; then
+ kde_check_threading_default=no
+ else
+ kde_check_threading_default=yes
+ fi
+ else
+ kde_check_threading_default=yes
+ fi
+ AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
+ kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
+ if test "x$kde_use_threading" = "xyes"; then
+ AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
+ fi
+])
+
+AC_DEFUN([KDE_TRY_LINK_PYTHON],
+[
+if test "$kde_python_link_found" = no; then
+
+if test "$1" = normal; then
+ AC_MSG_CHECKING(if a Python application links)
+else
+ AC_MSG_CHECKING(if Python depends on $2)
+fi
+
+AC_CACHE_VAL(kde_cv_try_link_python_$1,
+[
+kde_save_cflags="$CFLAGS"
+CFLAGS="$CFLAGS $PYTHONINC"
+kde_save_libs="$LIBS"
+LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
+kde_save_ldflags="$LDFLAGS"
+LDFLAGS="$LDFLAGS $PYTHONLIB"
+
+AC_TRY_LINK(
+[
+#include <Python.h>
+],[
+ PySys_SetArgv(1, 0);
+],
+ [kde_cv_try_link_python_$1=yes],
+ [kde_cv_try_link_python_$1=no]
+)
+CFLAGS="$kde_save_cflags"
+LIBS="$kde_save_libs"
+LDFLAGS="$kde_save_ldflags"
+])
+
+if test "$kde_cv_try_link_python_$1" = "yes"; then
+ AC_MSG_RESULT(yes)
+ kde_python_link_found=yes
+ if test ! "$1" = normal; then
+ LIBPYTHON="$LIBPYTHON $2"
+ fi
+ $3
+else
+ AC_MSG_RESULT(no)
+ $4
+fi
+
+fi
+
+])
+
+AC_DEFUN([KDE_CHECK_PYTHON_DIR],
+[
+AC_MSG_CHECKING([for Python directory])
+
+AC_CACHE_VAL(kde_cv_pythondir,
+[
+ if test -z "$PYTHONDIR"; then
+ kde_cv_pythondir=/usr/local
+ else
+ kde_cv_pythondir="$PYTHONDIR"
+ fi
+])
+
+AC_ARG_WITH(pythondir,
+AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
+[
+ ac_python_dir=$withval
+], ac_python_dir=$kde_cv_pythondir
+)
+
+AC_MSG_RESULT($ac_python_dir)
+])
+
+AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
+[
+AC_REQUIRE([KDE_CHECK_LIBDL])
+AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
+
+if test -z "$1"; then
+ version="1.5"
+else
+ version="$1"
+fi
+
+AC_MSG_CHECKING([for Python$version])
+
+python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
+AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
+if test ! -r $python_incdir/Python.h; then
+ AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
+ python_incdir=$python_incdir/python$version
+ if test ! -r $python_incdir/Python.h; then
+ python_incdir=no
+ fi
+fi
+
+PYTHONINC=-I$python_incdir
+
+python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
+AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
+if test ! -r $python_libdir/libpython$version.so; then
+ AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
+ if test ! -r $python_libdir/libpython$version.a; then
+ AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
+ python_libdir=$python_libdir/python$version/config
+ if test ! -r $python_libdir/libpython$version.a; then
+ python_libdir=no
+ fi
+ fi
+fi
+
+PYTHONLIB=-L$python_libdir
+kde_orig_LIBPYTHON=$LIBPYTHON
+if test -z "$LIBPYTHON"; then
+ LIBPYTHON=-lpython$version
+fi
+
+AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
+python_moddir=$python_moddir/python$version
+if test ! -r $python_moddir/copy.py; then
+ python_moddir=no
+fi
+
+PYTHONMODDIR=$python_moddir
+
+AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
+
+if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
+ LIBPYTHON=$kde_orig_LIBPYTHON
+ test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
+ test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
+ $2
+else
+ dnl Note: this test is very weak
+ kde_python_link_found=no
+ KDE_TRY_LINK_PYTHON(normal)
+ KDE_TRY_LINK_PYTHON(m, -lm)
+ KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
+ KDE_TRY_LINK_PYTHON(tcl, -ltcl)
+ KDE_TRY_LINK_PYTHON(db2, -ldb2)
+ KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
+ KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
+ KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
+ KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
+ KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
+ KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
+ KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
+ KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
+ [AC_MSG_WARN([it seems, Python depends on another library.
+ Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
+ and contact the authors to let them know about this problem])
+ ])
+
+ LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
+ AC_SUBST(PYTHONINC)
+ AC_SUBST(PYTHONLIB)
+ AC_SUBST(LIBPYTHON)
+ AC_SUBST(PYTHONMODDIR)
+ AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
+fi
+
+])
+
+
+AC_DEFUN([KDE_CHECK_PYTHON],
+[
+ KDE_CHECK_PYTHON_INTERN("2.5",
+ [KDE_CHECK_PYTHON_INTERN("2.4",
+ [KDE_CHECK_PYTHON_INTERN("2.3",
+ [KDE_CHECK_PYTHON_INTERN("2.2",
+ [KDE_CHECK_PYTHON_INTERN("2.1",
+ [KDE_CHECK_PYTHON_INTERN("2.0",
+ [KDE_CHECK_PYTHON_INTERN($1, $2) ])
+ ])
+ ])
+ ])
+ ])
+ ])
+])
+
+AC_DEFUN([KDE_CHECK_STL],
+[
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
+
+ AC_MSG_CHECKING([if C++ programs can be compiled])
+ AC_CACHE_VAL(kde_cv_stl_works,
+ [
+ AC_TRY_COMPILE([
+#include <string>
+using namespace std;
+],[
+ string astring="Hallo Welt.";
+ astring.erase(0, 6); // now astring is "Welt"
+ return 0;
+], kde_cv_stl_works=yes,
+ kde_cv_stl_works=no)
+])
+
+ AC_MSG_RESULT($kde_cv_stl_works)
+
+ if test "$kde_cv_stl_works" = "yes"; then
+ # back compatible
+ AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
+ else
+ AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
+Check config.log for details - if you're using a Linux distribution you might miss
+a package named similar to libstdc++-dev.])
+ fi
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+
+AC_DEFUN([AC_FIND_QIMGIO],
+ [AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for qimgio])
+AC_CACHE_VAL(ac_cv_lib_qimgio,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+ac_save_CXXFLAGS="$CXXFLAGS"
+LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+AC_TRY_RUN(dnl
+[
+#include <qimageio.h>
+#include <qstring.h>
+int main() {
+ QString t = "hallo";
+ t.fill('t');
+ qInitImageIO();
+}
+],
+ ac_cv_lib_qimgio=yes,
+ ac_cv_lib_qimgio=no,
+ ac_cv_lib_qimgio=no)
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
+ LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
+ AC_SUBST(LIBQIMGIO)
+else
+ AC_MSG_RESULT(not found)
+fi
+])
+
+AC_DEFUN([AM_DISABLE_LIBRARIES],
+[
+ AC_PROVIDE([AM_ENABLE_STATIC])
+ AC_PROVIDE([AM_ENABLE_SHARED])
+ enable_static=no
+ enable_shared=yes
+])
+
+
+AC_DEFUN([AC_CHECK_UTMP_FILE],
+[
+ AC_MSG_CHECKING([for utmp file])
+
+ AC_CACHE_VAL(kde_cv_utmp_file,
+ [
+ kde_cv_utmp_file=no
+
+ for ac_file in \
+ \
+ /var/run/utmp \
+ /var/adm/utmp \
+ /etc/utmp \
+ ; \
+ do
+ if test -r "$ac_file"; then
+ kde_cv_utmp_file=$ac_file
+ break
+ fi
+ done
+ ])
+
+ if test "$kde_cv_utmp_file" != "no"; then
+ AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
+ $1
+ AC_MSG_RESULT($kde_cv_utmp_file)
+ else
+ $2
+ AC_MSG_RESULT([non found])
+ fi
+])
+
+
+AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
+[
+
+DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
+TOPSUBDIRS=""
+
+if test ! -s $srcdir/subdirs; then
+ dnl Note: Makefile.common creates subdirs, so this is just a fallback
+ files=`cd $srcdir && ls -1`
+ dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
+ for i in $dirs; do
+ echo $i >> $srcdir/subdirs
+ done
+fi
+
+ac_topsubdirs=
+if test -s $srcdir/inst-apps; then
+ ac_topsubdirs="`cat $srcdir/inst-apps`"
+elif test -s $srcdir/subdirs; then
+ ac_topsubdirs="`cat $srcdir/subdirs`"
+fi
+
+for i in $ac_topsubdirs; do
+ AC_MSG_CHECKING([if $i should be compiled])
+ if test -d $srcdir/$i; then
+ install_it="yes"
+ for j in $DO_NOT_COMPILE; do
+ if test $i = $j; then
+ install_it="no"
+ fi
+ done
+ else
+ install_it="no"
+ fi
+ AC_MSG_RESULT($install_it)
+ vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
+ if test $install_it = "yes"; then
+ TOPSUBDIRS="$TOPSUBDIRS $i"
+ eval "$vari""_SUBDIR_included=yes"
+ else
+ eval "$vari""_SUBDIR_included=no"
+ fi
+done
+
+AC_SUBST(TOPSUBDIRS)
+])
+
+AC_DEFUN([KDE_CHECK_NAMESPACES],
+[
+AC_MSG_CHECKING(whether C++ compiler supports namespaces)
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE([
+],
+[
+namespace Foo {
+ extern int i;
+ namespace Bar {
+ extern int i;
+ }
+}
+
+int Foo::i = 0;
+int Foo::Bar::i = 1;
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_NAMESPACES)
+], [
+AC_MSG_RESULT(no)
+])
+AC_LANG_RESTORE
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_CHECK_S_ISSOCK],
+[
+AC_MSG_CHECKING(for S_ISSOCK)
+AC_CACHE_VAL(ac_cv_have_s_issock,
+[
+AC_TRY_LINK(
+[
+#include <sys/stat.h>
+],
+[
+struct stat buff;
+int b = S_ISSOCK( buff.st_mode );
+],
+ac_cv_have_s_issock=yes,
+ac_cv_have_s_issock=no)
+])
+AC_MSG_RESULT($ac_cv_have_s_issock)
+if test "$ac_cv_have_s_issock" = "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
+fi
+
+AH_VERBATIM(_ISSOCK,
+[
+#ifndef HAVE_S_ISSOCK
+#define HAVE_S_ISSOCK
+#define S_ISSOCK(mode) (1==0)
+#endif
+])
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
+[
+AC_MSG_CHECKING(for MAXPATHLEN)
+AC_CACHE_VAL(ac_cv_maxpathlen,
+[
+cat > conftest.$ac_ext <<EOF
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+#include <stdio.h>
+#include <sys/param.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+KDE_HELLO MAXPATHLEN
+
+EOF
+
+ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
+
+if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
+ ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
+else
+ ac_cv_maxpathlen=1024
+fi
+
+rm conftest.*
+
+])
+AC_MSG_RESULT($ac_cv_maxpathlen)
+AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
+])
+
+AC_DEFUN([KDE_CHECK_HEADER],
+[
+ kde_safe_cppflags=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $all_includes"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_CHECK_HEADER([$1], [$2], [$3], [$4])
+ AC_LANG_RESTORE
+ CPPFLAGS=$kde_safe_cppflags
+])
+
+AC_DEFUN([KDE_CHECK_HEADERS],
+[
+ AH_CHECK_HEADERS([$1])
+ AC_LANG_SAVE
+ kde_safe_cppflags=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $all_includes"
+ AC_LANG_CPLUSPLUS
+ AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
+ CPPFLAGS=$kde_safe_cppflags
+ AC_LANG_RESTORE
+])
+
+AC_DEFUN([KDE_FAST_CONFIGURE],
+[
+ dnl makes configure fast (needs perl)
+ AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
+ with_fast_perl=$enableval, with_fast_perl=yes)
+])
+
+AC_DEFUN([KDE_CONF_FILES],
+[
+ val=
+ if test -f $srcdir/configure.files ; then
+ val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
+ fi
+ CONF_FILES=
+ if test -n "$val" ; then
+ for i in $val ; do
+ CONF_FILES="$CONF_FILES $i"
+ done
+ fi
+ AC_SUBST(CONF_FILES)
+])dnl
+
+dnl This sets the prefix, for arts and kdelibs
+dnl Do NOT use in any other module.
+dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
+AC_DEFUN([KDE_SET_PREFIX_CORE],
+[
+ unset CDPATH
+ dnl make $KDEDIR the default for the installation
+ AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+
+ if test "x$prefix" = "xNONE"; then
+ prefix=$ac_default_prefix
+ ac_configure_args="$ac_configure_args --prefix=$prefix"
+ fi
+ # And delete superfluous '/' to make compares easier
+ prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+ exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+
+ kde_libs_prefix='$(prefix)'
+ kde_libs_htmldir='$(kde_htmldir)'
+ AC_SUBST(kde_libs_prefix)
+ AC_SUBST(kde_libs_htmldir)
+ KDE_FAST_CONFIGURE
+ KDE_CONF_FILES
+])
+
+
+AC_DEFUN([KDE_SET_PREFIX],
+[
+ unset CDPATH
+ dnl We can't give real code to that macro, only a value.
+ dnl It only matters for --help, since we set the prefix in this function anyway.
+ AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
+
+ KDE_SET_DEFAULT_BINDIRS
+ if test "x$prefix" = "xNONE"; then
+ dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
+ KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
+ else
+ dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
+ kde_save_PATH="$PATH"
+ PATH="$exec_prefix/bin:$prefix/bin:$PATH"
+ KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
+ PATH="$kde_save_PATH"
+ fi
+
+ kde_libs_prefix=`$KDECONFIG --prefix`
+ if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
+ AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
+ This means it has been moved since you installed it.
+ This won't work. Please recompile kdelibs for the new prefix.
+ ])
+ fi
+ kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
+
+ AC_MSG_CHECKING([where to install])
+ if test "x$prefix" = "xNONE"; then
+ prefix=$kde_libs_prefix
+ AC_MSG_RESULT([$prefix (as returned by kde-config)])
+ else
+ dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
+ given_prefix=$prefix
+ AC_MSG_RESULT([$prefix (as requested)])
+ fi
+
+ # And delete superfluous '/' to make compares easier
+ prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+ exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+ given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+
+ AC_SUBST(KDECONFIG)
+ AC_SUBST(kde_libs_prefix)
+ AC_SUBST(kde_libs_htmldir)
+
+ KDE_FAST_CONFIGURE
+ KDE_CONF_FILES
+])
+
+pushdef([AC_PROG_INSTALL],
+[
+ dnl our own version, testing for a -p flag
+ popdef([AC_PROG_INSTALL])
+ dnl as AC_PROG_INSTALL works as it works we first have
+ dnl to save if the user didn't specify INSTALL, as the
+ dnl autoconf one overwrites INSTALL and we have no chance to find
+ dnl out afterwards
+ test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
+ test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
+ test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
+ AC_PROG_INSTALL
+
+ if test -z "$kde_save_INSTALL_given" ; then
+ # OK, user hasn't given any INSTALL, autoconf found one for us
+ # now we test, if it supports the -p flag
+ AC_MSG_CHECKING(for -p flag to install)
+ rm -f confinst.$$.* > /dev/null 2>&1
+ echo "Testtest" > confinst.$$.orig
+ ac_res=no
+ if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
+ if test -f confinst.$$.new ; then
+ # OK, -p seems to do no harm to install
+ INSTALL="${INSTALL} -p"
+ ac_res=yes
+ fi
+ fi
+ rm -f confinst.$$.*
+ AC_MSG_RESULT($ac_res)
+ fi
+ dnl the following tries to resolve some signs and wonders coming up
+ dnl with different autoconf/automake versions
+ dnl e.g.:
+ dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
+ dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
+ dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
+ dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
+ dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
+ dnl install-@DIR@PROGRAMS targets to explicitly use that flag
+ dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
+ dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
+ dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
+ dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
+ dnl automake (due to broken Makefile.am or whatever) to install programs,
+ dnl and so does not see the -s flag in automake > 1.4
+ dnl to clean up that mess we:
+ dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
+ dnl which cleans KDE's program with automake > 1.4;
+ dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
+ dnl with automake<=1.4
+ dnl note that dues to this sometimes two '-s' flags are used (if KDE
+ dnl properly uses install-@DIR@PROGRAMS, but I don't care
+ dnl
+ dnl And to all this comes, that I even can't write in comments variable
+ dnl names used by automake, because it is so stupid to think I wanted to
+ dnl _use_ them, therefor I have written A_M_... instead of AM_
+ dnl hmm, I wanted to say something ... ahh yes: Arghhh.
+
+ if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
+ INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
+ fi
+ if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
+ INSTALL_SCRIPT='${INSTALL}'
+ fi
+])dnl
+
+AC_DEFUN([KDE_LANG_CPLUSPLUS],
+[AC_LANG_CPLUSPLUS
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
+pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
+])
+
+pushdef([AC_LANG_CPLUSPLUS],
+[popdef([AC_LANG_CPLUSPLUS])
+KDE_LANG_CPLUSPLUS
+])
+
+AC_DEFUN([KDE_CHECK_LONG_LONG],
+[
+AC_MSG_CHECKING(for long long)
+AC_CACHE_VAL(kde_cv_c_long_long,
+[
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_LINK([], [
+ long long foo = 0;
+ foo = foo+1;
+ ],
+ kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
+ AC_LANG_RESTORE
+])
+AC_MSG_RESULT($kde_cv_c_long_long)
+if test "$kde_cv_c_long_long" = yes; then
+ AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
+fi
+])
+
+AC_DEFUN([KDE_CHECK_LIB],
+[
+ kde_save_LDFLAGS="$LDFLAGS"
+ dnl AC_CHECK_LIB modifies LIBS, so save it here
+ kde_save_LIBS="$LIBS"
+ LDFLAGS="$LDFLAGS $all_libraries"
+ case $host_os in
+ aix*) LDFLAGS="-brtl $LDFLAGS"
+ test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
+ ;;
+ esac
+ AC_CHECK_LIB($1, $2, $3, $4, $5)
+ LDFLAGS="$kde_save_LDFLAGS"
+ LIBS="$kde_save_LIBS"
+])
+
+AC_DEFUN([KDE_JAVA_PREFIX],
+[
+ dir=`dirname "$1"`
+ base=`basename "$1"`
+ list=`ls -1 $dir 2> /dev/null`
+ for entry in $list; do
+ if test -d $dir/$entry/bin; then
+ case $entry in
+ $base)
+ javadirs="$javadirs $dir/$entry/bin"
+ ;;
+ esac
+ elif test -d $dir/$entry/jre/bin; then
+ case $entry in
+ $base)
+ javadirs="$javadirs $dir/$entry/jre/bin"
+ ;;
+ esac
+ fi
+ done
+])
+
+dnl KDE_CHEC_JAVA_DIR(onlyjre)
+AC_DEFUN([KDE_CHECK_JAVA_DIR],
+[
+
+AC_ARG_WITH(java,
+AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
+[ ac_java_dir=$withval
+], ac_java_dir=""
+)
+
+AC_MSG_CHECKING([for Java])
+
+dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
+if test "x$ac_java_dir" = "xno"; then
+ kde_java_bindir=no
+ kde_java_includedir=no
+ kde_java_libjvmdir=no
+ kde_java_libgcjdir=no
+ kde_java_libhpidir=no
+else
+ if test "x$ac_java_dir" = "x"; then
+
+
+ dnl No option set -> collect list of candidate paths
+ if test -n "$JAVA_HOME"; then
+ KDE_JAVA_PREFIX($JAVA_HOME)
+ fi
+ KDE_JAVA_PREFIX(/usr/j2se)
+ KDE_JAVA_PREFIX(/usr/lib/j2se)
+ KDE_JAVA_PREFIX(/usr/j*dk*)
+ KDE_JAVA_PREFIX(/usr/lib/j*dk*)
+ KDE_JAVA_PREFIX(/opt/j*sdk*)
+ KDE_JAVA_PREFIX(/usr/lib/java*)
+ KDE_JAVA_PREFIX(/usr/java*)
+ KDE_JAVA_PREFIX(/usr/java/j*dk*)
+ KDE_JAVA_PREFIX(/usr/java/j*re*)
+ KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
+ KDE_JAVA_PREFIX(/usr/lib/SunJava*)
+ KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
+ KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
+ KDE_JAVA_PREFIX(/opt/java*)
+
+ kde_cv_path="NONE"
+ kde_save_IFS=$IFS
+ IFS=':'
+ for dir in $PATH; do
+ if test -d "$dir"; then
+ javadirs="$javadirs $dir"
+ fi
+ done
+ IFS=$kde_save_IFS
+ jredirs=
+
+ dnl Now javadirs contains a list of paths that exist, all ending with bin/
+ for dir in $javadirs; do
+ dnl Check for the java executable
+ if test -x "$dir/java"; then
+ sane_path=$(cd $dir; /bin/pwd)
+ dnl And also check for a libjvm.so somewhere under there
+ dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
+ if test "$sane_path" != "/usr/bin"; then
+ libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
+ if test ! -f $libjvmdir/libjvm.so; then continue; fi
+ jredirs="$jredirs $dir"
+ fi
+ fi
+ done
+
+ dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
+ JAVAC=
+ JAVA=
+ kde_java_bindir=no
+ for dir in $jredirs; do
+ JAVA="$dir/java"
+ kde_java_bindir=$dir
+ if test -x "$dir/javac"; then
+ JAVAC="$dir/javac"
+ break
+ fi
+ done
+
+ if test -n "$JAVAC"; then
+ dnl this substitution might not work - well, we test for jni.h below
+ kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
+ else
+ kde_java_includedir=no
+ fi
+ else
+ dnl config option set
+ kde_java_bindir=$ac_java_dir/bin
+ if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
+ kde_java_includedir=no
+ else
+ kde_java_includedir=$ac_java_dir/include
+ fi
+ fi
+fi
+
+dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
+if test "x$kde_java_bindir" != "xno"; then
+
+ dnl Look for libjvm.so
+ kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
+ dnl Look for libgcj.so
+ kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
+ dnl Look for libhpi.so and avoid green threads
+ kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
+
+ dnl Now check everything's fine under there
+ dnl the include dir is our flag for having the JDK
+ if test -d "$kde_java_includedir"; then
+ if test ! -x "$kde_java_bindir/javac"; then
+ AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
+ fi
+ if test ! -x "$kde_java_bindir/javah"; then
+ AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+ fi
+ if test ! -x "$kde_java_bindir/jar"; then
+ AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+ fi
+ if test ! -r "$kde_java_includedir/jni.h"; then
+ AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
+ fi
+
+ jni_includes="-I$kde_java_includedir"
+ dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
+ dnl and under linux here..
+
+ dnl not needed for gcj
+
+ if test "x$kde_java_libgcjdir" = "x"; then
+ test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
+ test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
+ test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
+ fi
+
+ else
+ JAVAC=
+ jni_includes=
+ fi
+
+ if test "x$kde_java_libgcjdir" = "x"; then
+ if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
+ AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
+ fi
+ else
+ if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
+ AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
+ fi
+ fi
+
+ if test ! -x "$kde_java_bindir/java"; then
+ AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+ fi
+
+ dnl not needed for gcj compile
+
+ if test "x$kde_java_libgcjdir" = "x"; then
+ if test ! -r "$kde_java_libhpidir/libhpi.so"; then
+ AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
+ fi
+ fi
+
+ if test -n "$jni_includes"; then
+ dnl Check for JNI version
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_cxxflags_safe="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
+
+ AC_TRY_COMPILE([
+ #include <jni.h>
+ ],
+ [
+ #ifndef JNI_VERSION_1_2
+ Syntax Error
+ #endif
+ ],[ kde_jni_works=yes ],
+ [ kde_jni_works=no ])
+
+ if test $kde_jni_works = no; then
+ AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
+ You need to have Java Development Kit (JDK) version 1.2.
+
+ Use --with-java to specify another location.
+ Use --without-java to configure without java support.
+ Or download a newer JDK and try again.
+ See e.g. http://java.sun.com/products/jdk/1.2 ])
+ fi
+
+ CXXFLAGS="$ac_cxxflags_safe"
+ AC_LANG_RESTORE
+
+ dnl All tests ok, inform and subst the variables
+
+ JAVAC=$kde_java_bindir/javac
+ JAVAH=$kde_java_bindir/javah
+ JAR=$kde_java_bindir/jar
+ AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+ if test "x$kde_java_libgcjdir" = "x"; then
+ JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
+ else
+ JVMLIBS="-L$kde_java_libgcjdir -lgcj"
+ fi
+ AC_MSG_RESULT([java JDK in $kde_java_bindir])
+
+ else
+ AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+ AC_MSG_RESULT([java JRE in $kde_java_bindir])
+ fi
+elif test -d "/Library/Java/Home"; then
+ kde_java_bindir="/Library/Java/Home/bin"
+ jni_includes="-I/Library/Java/Home/include"
+
+ JAVAC=$kde_java_bindir/javac
+ JAVAH=$kde_java_bindir/javah
+ JAR=$kde_java_bindir/jar
+ JVMLIBS="-Wl,-framework,JavaVM"
+
+ AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+ AC_MSG_RESULT([Apple Java Framework])
+else
+ AC_MSG_RESULT([none found])
+fi
+
+AC_SUBST(JAVAC)
+AC_SUBST(JAVAH)
+AC_SUBST(JAR)
+AC_SUBST(JVMLIBS)
+AC_SUBST(jni_includes)
+
+# for backward compat
+kde_cv_java_includedir=$kde_java_includedir
+kde_cv_java_bindir=$kde_java_bindir
+])
+
+dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
+dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
+dnl big packages, m4_foreach is dog-slow. So use our own version of
+dnl it. (matz@kde.org)
+m4_define([mm_foreach],
+[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
+m4_define([mm_car], [[$1]])
+m4_define([mm_car2], [[$@]])
+m4_define([_mm_foreach],
+[m4_if(m4_quote($2), [], [],
+ [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
+ mm_car2(m4_shift($2)),
+ [$3])])])
+m4_define([AC_FOREACH],
+[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
+
+AC_DEFUN([KDE_NEED_FLEX],
+[
+kde_libs_safe=$LIBS
+LIBS="$LIBS $USER_LDFLAGS"
+AM_PROG_LEX
+LIBS=$kde_libs_safe
+if test -z "$LEXLIB"; then
+ AC_MSG_ERROR([You need to have flex installed.])
+fi
+AC_SUBST(LEXLIB)
+])
+
+AC_DEFUN([AC_PATH_QTOPIA],
+[
+ dnl TODO: use AC_CACHE_VAL
+
+ if test -z "$1"; then
+ qtopia_minver_maj=1
+ qtopia_minver_min=5
+ qtopia_minver_pat=0
+ else
+ qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
+ qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
+ qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
+ fi
+
+ qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
+ qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
+
+ AC_REQUIRE([AC_PATH_QT])
+
+ AC_MSG_CHECKING([for Qtopia])
+
+ LIB_QTOPIA="-lqpe"
+ AC_SUBST(LIB_QTOPIA)
+
+ kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
+
+ ac_qtopia_incdir=NO
+
+ AC_ARG_WITH(qtopia-dir,
+ AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
+ [ ac_qtopia_incdir="$withval"/include] )
+
+ qtopia_incdirs=""
+ for dir in $kde_qtopia_dirs; do
+ qtopia_incdirs="$qtopia_incdirs $dir/include"
+ done
+
+ if test ! "$ac_qtopia_incdir" = "NO"; then
+ qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
+ fi
+
+ qtopia_incdir=""
+ AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
+ ac_qtopia_incdir="$qtopia_incdir"
+
+ if test -z "$qtopia_incdir"; then
+ AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
+ fi
+
+ qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
+ qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
+ qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
+
+ qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
+ qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
+ if test "$qtopia_ver" -lt "$qtopia_minver"; then
+ AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
+is required.])
+ fi
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ ac_cxxflags_safe="$CXXFLAGS"
+ ac_ldflags_safe="$LDFLAGS"
+ ac_libs_safe="$LIBS"
+
+ CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
+ LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+ LIBS="$LIBS $LIB_QTOPIA $LIBQT"
+
+ cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qpe/qpeapplication.h>
+#include <qpe/version.h>
+
+int main( int argc, char **argv )
+{
+ QPEApplication app( argc, argv );
+ return 0;
+}
+EOF
+
+ if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ rm -f conftest*
+ else
+ rm -f conftest*
+ AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
+the end of config.log])
+ fi
+
+ CXXFLAGS="$ac_cxxflags_safe"
+ LDFLAGS="$ac_ldflags_safe"
+ LIBS="$ac_libs_safe"
+
+ AC_LANG_RESTORE
+
+ QTOPIA_INCLUDES="-I$qtopia_incdir"
+ AC_SUBST(QTOPIA_INCLUDES)
+
+ AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
+])
+
+
+AC_DEFUN([KDE_INIT_DOXYGEN],
+[
+AC_MSG_CHECKING([for Qt docs])
+kde_qtdir=
+if test "${with_qt_dir+set}" = set; then
+ kde_qtdir="$with_qt_dir"
+fi
+
+AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
+AC_MSG_RESULT($QTDOCDIR)
+
+AC_SUBST(QTDOCDIR)
+
+KDE_FIND_PATH(dot, DOT, [], [])
+if test -n "$DOT"; then
+ KDE_HAVE_DOT="YES"
+else
+ KDE_HAVE_DOT="NO"
+fi
+AC_SUBST(KDE_HAVE_DOT)
+KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
+AC_SUBST(DOXYGEN)
+
+DOXYGEN_PROJECT_NAME="$1"
+DOXYGEN_PROJECT_NUMBER="$2"
+AC_SUBST(DOXYGEN_PROJECT_NAME)
+AC_SUBST(DOXYGEN_PROJECT_NUMBER)
+
+KDE_HAS_DOXYGEN=no
+if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
+ KDE_HAS_DOXYGEN=yes
+fi
+AC_SUBST(KDE_HAS_DOXYGEN)
+
+])
+
+
+AC_DEFUN([AC_FIND_BZIP2],
+[
+AC_MSG_CHECKING([for bzDecompress in libbz2])
+AC_CACHE_VAL(ac_cv_lib_bzip2,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#define BZ_NO_STDIO
+#include<bzlib.h>
+],
+ [ bz_stream s; (void) bzDecompress(&s); ],
+ eval "ac_cv_lib_bzip2='-lbz2'",
+ eval "ac_cv_lib_bzip2=no")
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+AC_MSG_RESULT($ac_cv_lib_bzip2)
+
+if test ! "$ac_cv_lib_bzip2" = no; then
+ BZIP2DIR=bzip2
+
+ LIBBZ2="$ac_cv_lib_bzip2"
+ AC_SUBST(LIBBZ2)
+
+else
+
+ cxx_shared_flag=
+ ld_shared_flag=
+ KDE_CHECK_COMPILER_FLAG(shared, [
+ ld_shared_flag="-shared"
+ ])
+ KDE_CHECK_COMPILER_FLAG(fPIC, [
+ cxx_shared_flag="-fPIC"
+ ])
+
+ AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
+ AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ kde_save_LIBS="$LIBS"
+ LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
+ kde_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
+
+ AC_TRY_LINK(dnl
+ [
+ #define BZ_NO_STDIO
+ #include<bzlib.h>
+ ],
+ [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
+ eval "ac_cv_lib_bzip2_prefix='-lbz2'",
+ eval "ac_cv_lib_bzip2_prefix=no")
+ LIBS="$kde_save_LIBS"
+ CXXFLAGS="$kde_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])dnl
+
+ AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
+
+ if test ! "$ac_cv_lib_bzip2_prefix" = no; then
+ BZIP2DIR=bzip2
+
+ LIBBZ2="$ac_cv_lib_bzip2_prefix"
+ AC_SUBST(LIBBZ2)
+
+ AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
+ dnl else, we just ignore this
+ fi
+
+fi
+AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the SSL headers and libraries.
+dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
+dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([KDE_CHECK_SSL],
+[
+LIBSSL="-lssl -lcrypto"
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+ac_ssl_includes=NO ac_ssl_libraries=NO
+ssl_libraries=""
+ssl_includes=""
+AC_ARG_WITH(ssl-dir,
+ AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
+ [ ac_ssl_includes="$withval"/include
+ ac_ssl_libraries="$withval"/lib$kdelibsuff
+ ])
+
+want_ssl=yes
+AC_ARG_WITH(ssl,
+ AC_HELP_STRING([--without-ssl],[disable SSL checks]),
+ [want_ssl=$withval])
+
+if test $want_ssl = yes; then
+
+AC_MSG_CHECKING(for OpenSSL)
+
+AC_CACHE_VAL(ac_cv_have_ssl,
+[#try to guess OpenSSL locations
+
+ ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
+ ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
+ AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
+ ac_ssl_includes="$ssl_incdir"
+
+ ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
+ if test ! "$ac_ssl_libraries" = "NO"; then
+ ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
+ fi
+
+ test=NONE
+ ssl_libdir=NONE
+ for dir in $ssl_libdirs; do
+ try="ls -1 $dir/libssl*"
+ if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+ done
+
+ ac_ssl_libraries="$ssl_libdir"
+
+ ac_ldflags_safe="$LDFLAGS"
+ ac_libs_safe="$LIBS"
+
+ LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
+ LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
+
+ AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
+ ac_ssl_rsaref="yes"
+ ,
+ ac_ssl_rsaref="no"
+ )
+
+ LDFLAGS="$ac_ldflags_safe"
+ LIBS="$ac_libs_safe"
+
+ if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
+ have_ssl=no
+ else
+ have_ssl=yes;
+ fi
+
+ ])
+
+ eval "$ac_cv_have_ssl"
+
+ AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
+
+ AC_MSG_CHECKING([whether OpenSSL uses rsaref])
+ AC_MSG_RESULT($ac_ssl_rsaref)
+
+ AC_MSG_CHECKING([for easter eggs])
+ AC_MSG_RESULT([none found])
+
+else
+ have_ssl=no
+fi
+
+if test "$have_ssl" = yes; then
+ AC_MSG_CHECKING(for OpenSSL version)
+ dnl Check for SSL version
+ AC_CACHE_VAL(ac_cv_ssl_version,
+ [
+
+ cat >conftest.$ac_ext <<EOF
+#include <openssl/opensslv.h>
+#include <stdio.h>
+ int main() {
+
+#ifndef OPENSSL_VERSION_NUMBER
+ printf("ssl_version=\\"error\\"\n");
+#else
+ if (OPENSSL_VERSION_NUMBER < 0x00906000)
+ printf("ssl_version=\\"old\\"\n");
+ else
+ printf("ssl_version=\\"ok\\"\n");
+#endif
+ return (0);
+ }
+EOF
+
+ ac_save_CPPFLAGS=$CPPFLAGS
+ if test "$ac_ssl_includes" != "/usr/include"; then
+ CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
+ fi
+
+ if AC_TRY_EVAL(ac_link); then
+
+ if eval `./conftest 2>&5`; then
+ if test $ssl_version = error; then
+ AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
+ else
+ if test $ssl_version = old; then
+ AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
+ have_ssl=no
+ fi
+ fi
+ ac_cv_ssl_version="ssl_version=$ssl_version"
+ else
+ AC_MSG_ERROR([Your system couldn't run a small SSL test program.
+ Check config.log, and if you can't figure it out, send a mail to
+ David Faure <faure@kde.org>, attaching your config.log])
+ fi
+
+ else
+ AC_MSG_ERROR([Your system couldn't link a small SSL test program.
+ Check config.log, and if you can't figure it out, send a mail to
+ David Faure <faure@kde.org>, attaching your config.log])
+ fi
+ CPPFLAGS=$ac_save_CPPFLAGS
+
+ ])
+
+ eval "$ac_cv_ssl_version"
+ AC_MSG_RESULT($ssl_version)
+fi
+
+if test "$have_ssl" != yes; then
+ LIBSSL="";
+else
+ AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
+ ac_cv_have_ssl="have_ssl=yes \
+ ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
+
+
+ ssl_libraries="$ac_ssl_libraries"
+ ssl_includes="$ac_ssl_includes"
+
+ if test "$ac_ssl_rsaref" = yes; then
+ LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
+ fi
+
+ if test $ssl_version = "old"; then
+ AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
+ fi
+fi
+
+SSL_INCLUDES=
+
+if test "$ssl_includes" = "/usr/include"; then
+ if test -f /usr/kerberos/include/krb5.h; then
+ SSL_INCLUDES="-I/usr/kerberos/include"
+ fi
+elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
+ SSL_INCLUDES="-I$ssl_includes"
+fi
+
+if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
+ SSL_LDFLAGS=""
+else
+ SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
+fi
+
+AC_SUBST(SSL_INCLUDES)
+AC_SUBST(SSL_LDFLAGS)
+AC_SUBST(LIBSSL)
+])
+
+AC_DEFUN([KDE_CHECK_STRLCPY],
+[
+ AC_REQUIRE([AC_CHECK_STRLCAT])
+ AC_REQUIRE([AC_CHECK_STRLCPY])
+ AC_CHECK_SIZEOF(size_t)
+ AC_CHECK_SIZEOF(unsigned long)
+
+ AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
+ AC_TRY_COMPILE(,[
+ #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
+ choke me
+ #endif
+ ],AC_MSG_RESULT([yes]),[
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([
+ Apparently on your system our assumption sizeof size_t == sizeof unsigned long
+ does not apply. Please mail kde-devel@kde.org with a description of your system!
+ ])
+ ])
+])
+
+AC_DEFUN([KDE_CHECK_BINUTILS],
+[
+ AC_MSG_CHECKING([if ld supports unversioned version maps])
+
+ kde_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+ echo "{ local: extern \"C++\" { foo }; };" > conftest.map
+ AC_TRY_LINK([int foo;],
+[
+#ifdef __INTEL_COMPILER
+icc apparently does not support libtools version-info and version-script
+at the same time. Dunno where the bug is, but until somebody figured out,
+better disable the optional version scripts.
+#endif
+
+ foo = 42;
+], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
+ LDFLAGS="$kde_save_LDFLAGS"
+ rm -f conftest.map
+ AM_CONDITIONAL(include_VERSION_SCRIPT,
+ [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
+
+ AC_MSG_RESULT($kde_supports_versionmaps)
+])
+
+AC_DEFUN([AM_PROG_OBJC],[
+AC_CHECK_PROGS(OBJC, gcc, gcc)
+test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
+if test "x${OBJCFLAGS-unset}" = xunset; then
+ OBJCFLAGS="-g -O2"
+fi
+AC_SUBST(OBJCFLAGS)
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
+])
+
+AC_DEFUN([KDE_CHECK_PERL],
+[
+ KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
+ AC_MSG_ERROR([No Perl found in your $PATH.
+We need perl to generate some code.])
+ ])
+ AC_SUBST(PERL)
+])
+
+AC_DEFUN([KDE_CHECK_LARGEFILE],
+[
+AC_SYS_LARGEFILE
+if test "$ac_cv_sys_file_offset_bits" != no; then
+ CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
+fi
+
+if test "x$ac_cv_sys_large_files" != "xno"; then
+ CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
+fi
+
+])
+
+dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
+dnl which allows to search for libs that get installed into the KDE prefix.
+dnl
+dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
+dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
+dnl also defines KSTUFF_PKG_ERRORS on error
+AC_DEFUN([KDE_PKG_CHECK_MODULES], [
+
+ PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
+ if test "$prefix" != "$kde_libs_prefix"; then
+ PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
+ fi
+ export PKG_CONFIG_PATH
+ PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
+])
+
+
+dnl Check for PIE support in the compiler and linker
+AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
+[
+ AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ safe_CXXFLAGS=$CXXFLAGS
+ safe_LDFLAGS=$LDFLAGS
+ CXXFLAGS="$CXXFLAGS -fPIE"
+ LDFLAGS="$LDFLAGS -pie"
+
+ AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
+
+ CXXFLAGS=$safe_CXXFLAGS
+ LDFLAGS=$safe_LDFLAGS
+ AC_LANG_RESTORE
+ ])
+
+ AC_MSG_CHECKING(if enabling -pie/fPIE support)
+
+ AC_ARG_ENABLE(pie,
+ AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
+ [kde_has_pie_support=$enableval],
+ [kde_has_pie_support=detect])
+
+ if test "$kde_has_pie_support" = "detect"; then
+ kde_has_pie_support=$kde_cv_val_pie_support
+ fi
+
+ AC_MSG_RESULT([$kde_has_pie_support])
+
+ KDE_USE_FPIE=""
+ KDE_USE_PIE=""
+
+ AC_SUBST([KDE_USE_FPIE])
+ AC_SUBST([KDE_USE_PIE])
+
+ if test "$kde_has_pie_support" = "yes"; then
+ KDE_USE_FPIE="-fPIE"
+ KDE_USE_PIE="-pie"
+ fi
+])
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001
+## Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# serial 47 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [m4_define([AC_PROVIDE_IFELSE],
+ [m4_ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [AC_LIBTOOL_CXX],
+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+ ])])
+dnl And a similar setup for Fortran 77 support
+ AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [AC_LIBTOOL_F77],
+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([LT_AC_PROG_GCJ],
+ [define([LT_AC_PROG_GCJ],
+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ AC_PATH_MAGIC
+ fi
+ ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+ [AC_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+[$]*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LINUX_64_MODE="32"
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ LINUX_64_MODE="64"
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+ ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$5], , :, [$5])
+else
+ ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ else
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$4], , :, [$4])
+else
+ ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ testring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ *)
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
+ = "XX$testring") >/dev/null 2>&1 &&
+ new_result=`expr "X$testring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ testring=$testring$testring
+ done
+ testring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}]
+EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_unknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+ # that will create temporary files in the current directory regardless of
+ # the output directory. Thus, making CWD read-only will cause this test
+ # to fail, enabling locking or at least warning the user not to do parallel
+ # builds.
+ chmod -w .
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s out/conftest.err; then
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
+ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_AC_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ libsuff=
+ if test "x$LINUX_64_MODE" = x64; then
+ # Some platforms are per default 64-bit, so there's no /lib64
+ if test -d /lib64; then
+ libsuff=64
+ fi
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+ [include additional configurations @<:@automatic@:>@])],
+ [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ AC_MSG_WARN([output file `$ofile' does not exist])
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+ else
+ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+ fi
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+ "") ;;
+ *) AC_MSG_ERROR([invalid tag name: $tagname])
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ AC_MSG_ERROR([tag name \"$tagname\" already exists])
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && test "X$CXX" != "Xno"; then
+ AC_LIBTOOL_LANG_CXX_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+ AC_LIBTOOL_LANG_F77_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+ AC_LIBTOOL_LANG_GCJ_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+ AC_LIBTOOL_LANG_RC_CONFIG
+ ;;
+
+ *)
+ AC_MSG_ERROR([Unsupported tag name: $tagname])
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ AC_MSG_ERROR([unable to update list of available tagged configurations.])
+ fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="ifelse([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+ [AC_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+mingw* | pw32*)
+ # win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='win32_libid'
+ ;;
+
+darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | kfreebsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case "$host_cpu" in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ irix5* | nonstopux*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ case $host_cpu in
+ alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ # the debian people say, arm and glibc 2.3.1 works for them with pass_all
+ arm* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ case $enable_ltdl_convenience in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
+# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
+# quotes!). If your package is not flat and you're not using automake,
+# define top_builddir and top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, lt_dlinit,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ else
+ enable_ltdl_install=yes
+ fi
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ LTDLINCL=
+ fi
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+ case $host_os in
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+ ;;
+ esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+ AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+ if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then :
+ else
+ AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+ _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+ fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+ [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ AC_PROG_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # KDE requires run time linking. Make it the default.
+ aix_use_runtimelinking=yes
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='-qmkshrobj ${wl}-G'
+ else
+ shared_flag='-qmkshrobj'
+ fi
+ fi
+ fi
+
+ # Let the compiler handle the export list.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ freebsd-elf*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ freebsd* | kfreebsd*-gnu)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ ia64*|hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC)
+ # SGI C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc)
+ # Intel C++
+ with_gnu_ld=yes
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ cxx)
+ # Compaq C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
+ $rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ sco*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+ _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext|*.$libext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+ _LT_AC_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+ _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4*)
+ test "$enable_shared" = yes && enable_static=no
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars. Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ _LT_AC_TAGVAR(compiler, $1) \
+ _LT_AC_TAGVAR(CC, $1) \
+ _LT_AC_TAGVAR(LD, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+ _LT_AC_TAGVAR(old_archive_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+ _LT_AC_TAGVAR(predep_objects, $1) \
+ _LT_AC_TAGVAR(postdep_objects, $1) \
+ _LT_AC_TAGVAR(predeps, $1) \
+ _LT_AC_TAGVAR(postdeps, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(archive_cmds, $1) \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(postinstall_cmds, $1) \
+ _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+ _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+ _LT_AC_TAGVAR(no_undefined_flag, $1) \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+ _LT_AC_TAGVAR(hardcode_automatic, $1) \
+ _LT_AC_TAGVAR(module_cmds, $1) \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(exclude_expsyms, $1) \
+ _LT_AC_TAGVAR(include_expsyms, $1); do
+
+ case $var in
+ _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(module_cmds, $1) | \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\[$]0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+ ;;
+ esac
+
+ifelse([$1], [],
+ [cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ AC_MSG_NOTICE([creating $ofile])],
+ [cfgfile="$ofile"])
+
+ cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+])
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris* | sysv5*)
+ symcode='[[BDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGISTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | kfreebsd*-gnu)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # KAI C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ icpc)
+ # Intel C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ cxx)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx)
+ # Digital/Compaq C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ sco*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc)
+ # Lucid
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ unixware*)
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc* | ecc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ ccc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+],[
+ runpath_var=
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)=
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+ _LT_AC_TAGVAR(module_cmds, $1)=
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_AC_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+
+ # KDE requires run time linking. Make it the default.
+ aix_use_runtimelinking=yes
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='-qmkshrobj ${wl}-G'
+ else
+ shared_flag='-qmkshrobj'
+ fi
+ fi
+ fi
+
+ # Let the compiler handle the export list.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ # see comment about different semantics on the GNU ld section
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ bsdi4*)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes ; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ dgux*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ openbsd*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+ fi
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv5*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_AC_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && break
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_MSG_RESULT([$SED])
+])
+
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN([PKG_CHECK_MODULES], [
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ AC_MSG_CHECKING(for $2)
+
+ if $PKG_CONFIG --exists "$2" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING($1_CFLAGS)
+ $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+ AC_MSG_RESULT($$1_CFLAGS)
+
+ AC_MSG_CHECKING($1_LIBS)
+ $1_LIBS=`$PKG_CONFIG --libs "$2"`
+ AC_MSG_RESULT($$1_LIBS)
+ else
+ $1_CFLAGS=""
+ $1_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ ifelse([$4], ,echo $$1_PKG_ERRORS,)
+ fi
+
+ AC_SUBST($1_CFLAGS)
+ AC_SUBST($1_LIBS)
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+
+ if test $succeeded = yes; then
+ ifelse([$3], , :, [$3])
+ else
+ ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+ fi
+])
+
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..dd92cb3
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,863 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake. There are at least two reasons why we must not
+# use `-m 0755':
+# - it causes special bits like SGID to be ignored,
+# - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out. Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([acinclude.m4])
diff --git a/check_svn_build.sh b/check_svn_build.sh
new file mode 100755
index 0000000..ac69bf3
--- /dev/null
+++ b/check_svn_build.sh
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+
+clean() {
+ echo -n "Delete old build..."
+ rm -rf $BUILDDIR
+ echo "Done."
+
+ echo -n "Create $BUILDDIR..."
+ mkdir $BUILDDIR
+ echo "Done."
+}
+
+checkout() {
+ echo "Do SVN checkout from $SVNURL..."
+ svn co $SVNURL
+ echo "Done."
+
+}
+
+linkadmin() {
+ echo -n "Link admin dir...$ADMIN"
+ ln -s $ADMIN .
+ echo "Done."
+}
+
+
+cleanbuild() {
+ echo "Make Clean..."
+ $MAKE clean
+ echo "Done."
+}
+
+build() {
+ echo "Start build..."
+ $MAKE -f admin/Makefile.common && \
+ ./configure $CONFIG_OPTIONS && \
+ time $MAKE $MAKE_ARGS
+ echo "Done."
+}
+
+BUILDDIR="../check_svn_build_buildDir"
+MAKE="unsermake"
+MAKE_ARGS="-j3"
+CONFIG_OPTIONS="--prefix=/usr --enable-debug=no "
+SVNURL="https://svn.kde.org/home/kde/branches/extragear/kde3/network/kmyfirewall/"
+ADMIN="../../kde-common/admin/"
+
+echo "Usage: check_svn_config.sh"
+
+clean
+cd $BUILDDIR
+checkout
+cd kmyfirewall/
+linkadmin
+cleanbuild
+build
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..da83314
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1561 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2009-04-27'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:[3456]*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T | authenticamd | genuineintel)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..01ee35e
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,237 @@
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
+#undef HAVE_CARBON_CARBON_H
+
+/* Define if you have the CoreAudio API */
+#undef HAVE_COREAUDIO
+
+/* Define to 1 if you have the <crt_externs.h> header file. */
+#undef HAVE_CRT_EXTERNS_H
+
+/* Defines if your system has the crypt function */
+#undef HAVE_CRYPT
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define if you have libjpeg */
+#undef HAVE_LIBJPEG
+
+/* Define if you have libpng */
+#undef HAVE_LIBPNG
+
+/* Define if you have a working libpthread (will enable threaded code) */
+#undef HAVE_LIBPTHREAD
+
+/* Define if you have libz */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if your system needs _NSGetEnviron to set up the environment */
+#undef HAVE_NSGETENVIRON
+
+/* Define if you have res_init */
+#undef HAVE_RES_INIT
+
+/* Define if you have the res_init prototype */
+#undef HAVE_RES_INIT_PROTO
+
+/* Define if you have a STL implementation by SGI */
+#undef HAVE_SGI_STL
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have strlcat */
+#undef HAVE_STRLCAT
+
+/* Define if you have the strlcat prototype */
+#undef HAVE_STRLCAT_PROTO
+
+/* Define if you have strlcpy */
+#undef HAVE_STRLCPY
+
+/* Define if you have the strlcpy prototype */
+#undef HAVE_STRLCPY_PROTO
+
+/* Define to 1 if you have the <sys/bitypes.h> header file. */
+#undef HAVE_SYS_BITYPES_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Suffix for lib directories */
+#undef KDELIBSUFF
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of `char *', as computed by sizeof. */
+#undef SIZEOF_CHAR_P
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
+/* The size of `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Defined if compiling without arts */
+#undef WITHOUT_ARTS
+
+/*
+ * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
+ * headers and I'm too lazy to write a configure test as long as only
+ * unixware is related
+ */
+#ifdef _UNIXWARE
+#define HAVE_BOOLEAN
+#endif
+
+
+
+/*
+ * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
+ * that defines bzero.
+ */
+
+#if defined(_AIX)
+#include <strings.h>
+#endif
+
+
+
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
+# include <sys/time.h>
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+#endif
+
+
+
+#if !defined(HAVE_RES_INIT_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+int res_init(void);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+
+
+#if !defined(HAVE_STRLCAT_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+unsigned long strlcat(char*, const char*, unsigned long);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+
+
+#if !defined(HAVE_STRLCPY_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+unsigned long strlcpy(char*, const char*, unsigned long);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+
+
+/*
+ * On HP-UX, the declaration of vsnprintf() is needed every time !
+ */
+
+#if !defined(HAVE_VSNPRINTF) || defined(hpux)
+#if __STDC__
+#include <stdarg.h>
+#include <stdlib.h>
+#else
+#include <varargs.h>
+#endif
+#ifdef __cplusplus
+extern "C"
+#endif
+int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
+#ifdef __cplusplus
+extern "C"
+#endif
+int snprintf(char *str, size_t n, char const *fmt, ...);
+#endif
+
+
+
+#if defined(__SVR4) && !defined(__svr4__)
+#define __svr4__ 1
+#endif
+
+
+/* type to use in place of socklen_t if not defined */
+#undef kde_socklen_t
+
+/* type to use in place of socklen_t if not defined (deprecated, use
+ kde_socklen_t) */
+#undef ksize_t
diff --git a/config.log b/config.log
new file mode 100644
index 0000000..fc9d99b
--- /dev/null
+++ b/config.log
@@ -0,0 +1,362 @@
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by configure, which was
+generated by GNU Autoconf 2.61. Invocation command line was
+
+ $ ./configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --disable-debug --prefix=/usr --sysconfdir=/etc --includedir=/usr/include/kde --infodir=/usr/share/info --mandir=/usr/share/man --with-qt-dir=/usr/share/qt3 --prefix=/opt/kde3 --with-extra-libs=/opt/kde3/lib --with-extra-includes=/opt/kde3/include/kde
+
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = argus4
+uname -m = x86_64
+uname -r = 2.6.31-16-generic
+uname -s = Linux
+uname -v = #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009
+
+/usr/bin/uname -p = unknown
+/bin/uname -X = unknown
+
+/bin/arch = unknown
+/usr/bin/arch -k = unknown
+/usr/convex/getsysinfo = unknown
+/usr/bin/hostinfo = unknown
+/bin/machine = unknown
+/usr/bin/oslevel = unknown
+/bin/universe = unknown
+
+PATH: /opt/kde3/bin
+PATH: /opt/kde3/bin
+PATH: /opt/kde3/games
+PATH: /opt/kde3/bin
+PATH: /home/eldarion/bin
+PATH: /usr/local/sbin
+PATH: /usr/local/bin
+PATH: /usr/sbin
+PATH: /usr/bin
+PATH: /sbin
+PATH: /bin
+PATH: /usr/games
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+configure:2136: checking build system type
+configure:2154: result: x86_64-pc-linux-gnu
+configure:2176: checking host system type
+configure:2191: result: x86_64-pc-linux-gnu
+configure:2213: checking target system type
+configure:2228: result: x86_64-pc-linux-gnu
+configure:2289: checking for a BSD-compatible install
+configure:2345: result: /usr/bin/install -c
+configure:2360: checking for -p flag to install
+configure:2373: result: yes
+configure:2384: checking whether build environment is sane
+
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+
+ac_cv_build=x86_64-pc-linux-gnu
+ac_cv_env_CCC_set=
+ac_cv_env_CCC_value=
+ac_cv_env_CC_set=
+ac_cv_env_CC_value=
+ac_cv_env_CFLAGS_set=set
+ac_cv_env_CFLAGS_value='-Wall -g -O2'
+ac_cv_env_CPPFLAGS_set=set
+ac_cv_env_CPPFLAGS_value=
+ac_cv_env_CPP_set=
+ac_cv_env_CPP_value=
+ac_cv_env_CXXCPP_set=
+ac_cv_env_CXXCPP_value=
+ac_cv_env_CXXFLAGS_set=set
+ac_cv_env_CXXFLAGS_value='-g -O2'
+ac_cv_env_CXX_set=
+ac_cv_env_CXX_value=
+ac_cv_env_F77_set=
+ac_cv_env_F77_value=
+ac_cv_env_FFLAGS_set=set
+ac_cv_env_FFLAGS_value='-g -O2'
+ac_cv_env_LDFLAGS_set=set
+ac_cv_env_LDFLAGS_value=-Wl,-Bsymbolic-functions
+ac_cv_env_LIBS_set=
+ac_cv_env_LIBS_value=
+ac_cv_env_XMKMF_set=
+ac_cv_env_XMKMF_value=
+ac_cv_env_build_alias_set=set
+ac_cv_env_build_alias_value=x86_64-linux-gnu
+ac_cv_env_host_alias_set=set
+ac_cv_env_host_alias_value=x86_64-linux-gnu
+ac_cv_env_target_alias_set=
+ac_cv_env_target_alias_value=
+ac_cv_host=x86_64-pc-linux-gnu
+ac_cv_path_install='/usr/bin/install -c'
+ac_cv_target=x86_64-pc-linux-gnu
+
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+
+ACLOCAL=''
+AMDEPBACKSLASH=''
+AMDEP_FALSE=''
+AMDEP_TRUE=''
+AMTAR=''
+AR=''
+ARTSCCONFIG=''
+AUTOCONF=''
+AUTODIRS=''
+AUTOHEADER=''
+AUTOMAKE=''
+AWK=''
+CC=''
+CCDEPMODE=''
+CFLAGS='-Wall -g -O2'
+CONF_FILES=''
+CPP=''
+CPPFLAGS=''
+CXX=''
+CXXCPP=''
+CXXDEPMODE=''
+CXXFLAGS='-g -O2'
+CYGPATH_W=''
+DCOPIDL2CPP=''
+DCOPIDL=''
+DCOPIDLNG=''
+DCOP_DEPENDENCIES=''
+DEFS=''
+DEPDIR=''
+ECHO='echo'
+ECHO_C=''
+ECHO_N='-n'
+ECHO_T=''
+EGREP=''
+ENABLE_PERMISSIVE_FLAG=''
+EXEEXT=''
+F77=''
+FFLAGS='-g -O2'
+FRAMEWORK_COREAUDIO=''
+GMSGFMT=''
+GREP=''
+HAVE_GCC_VISIBILITY=''
+INSTALL_DATA='${INSTALL} -m 644'
+INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
+INSTALL_SCRIPT='${INSTALL}'
+INSTALL_STRIP_PROGRAM=''
+KCFG_DEPENDENCIES=''
+KCONFIG_COMPILER=''
+KDECONFIG=''
+KDE_CHECK_PLUGIN=''
+KDE_EXTRA_RPATH=''
+KDE_INCLUDES=''
+KDE_LDFLAGS=''
+KDE_MT_LDFLAGS=''
+KDE_MT_LIBS=''
+KDE_NO_UNDEFINED=''
+KDE_PLUGIN=''
+KDE_RPATH=''
+KDE_USE_CLOSURE_FALSE=''
+KDE_USE_CLOSURE_TRUE=''
+KDE_USE_FINAL_FALSE=''
+KDE_USE_FINAL_TRUE=''
+KDE_USE_FPIE=''
+KDE_USE_NMCHECK_FALSE=''
+KDE_USE_NMCHECK_TRUE=''
+KDE_USE_PIE=''
+KDE_XSL_STYLESHEET=''
+LDFLAGS='-Wl,-Bsymbolic-functions'
+LDFLAGS_AS_NEEDED=''
+LDFLAGS_NEW_DTAGS=''
+LIBCOMPAT=''
+LIBCRYPT=''
+LIBDL=''
+LIBJPEG=''
+LIBOBJS=''
+LIBPNG=''
+LIBPTHREAD=''
+LIBRESOLV=''
+LIBS=''
+LIBSM=''
+LIBSOCKET=''
+LIBTOOL=''
+LIBUCB=''
+LIBUTIL=''
+LIBZ=''
+LIB_KAB=''
+LIB_KABC=''
+LIB_KDECORE=''
+LIB_KDED=''
+LIB_KDEPIM=''
+LIB_KDEPRINT=''
+LIB_KDEUI=''
+LIB_KDNSSD=''
+LIB_KFILE=''
+LIB_KFM=''
+LIB_KHTML=''
+LIB_KIMPROXY=''
+LIB_KIO=''
+LIB_KJS=''
+LIB_KNEWSTUFF=''
+LIB_KPARTS=''
+LIB_KSPELL=''
+LIB_KSYCOCA=''
+LIB_KUNITTEST=''
+LIB_KUTILS=''
+LIB_POLL=''
+LIB_QPE=''
+LIB_QT=''
+LIB_SMB=''
+LIB_X11=''
+LIB_XEXT=''
+LIB_XRENDER=''
+LN_S=''
+LTLIBOBJS=''
+MAKEINFO=''
+MAKEKDEWIDGETS=''
+MCOPIDL=''
+MEINPROC=''
+MOC=''
+MSGFMT=''
+NOOPT_CFLAGS=''
+NOOPT_CXXFLAGS=''
+OBJEXT=''
+PACKAGE=''
+PACKAGE_BUGREPORT=''
+PACKAGE_NAME=''
+PACKAGE_STRING=''
+PACKAGE_TARNAME=''
+PACKAGE_VERSION=''
+PATH_SEPARATOR=':'
+PERL=''
+QTE_NORTTI=''
+QT_INCLUDES=''
+QT_LDFLAGS=''
+RANLIB=''
+SET_MAKE=''
+SHELL='/bin/bash'
+STRIP=''
+TOPSUBDIRS=''
+UIC=''
+UIC_TR=''
+USER_INCLUDES=''
+USER_LDFLAGS=''
+USE_EXCEPTIONS=''
+USE_RTTI=''
+USE_THREADS=''
+VERSION=''
+WOVERLOADED_VIRTUAL=''
+XGETTEXT=''
+XMKMF=''
+XMLLINT=''
+X_EXTRA_LIBS=''
+X_INCLUDES=''
+X_LDFLAGS=''
+X_PRE_LIBS=''
+X_RPATH=''
+ac_ct_CC=''
+ac_ct_CXX=''
+ac_ct_F77=''
+all_includes=''
+all_libraries=''
+am__fastdepCC_FALSE=''
+am__fastdepCC_TRUE=''
+am__fastdepCXX_FALSE=''
+am__fastdepCXX_TRUE=''
+am__include=''
+am__leading_dot=''
+am__quote=''
+am__tar=''
+am__untar=''
+bindir='${exec_prefix}/bin'
+build='x86_64-pc-linux-gnu'
+build_alias='x86_64-linux-gnu'
+build_cpu='x86_64'
+build_os='linux-gnu'
+build_vendor='pc'
+datadir='${datarootdir}'
+datarootdir='${prefix}/share'
+docdir='${datarootdir}/doc/${PACKAGE}'
+dvidir='${docdir}'
+exec_prefix='NONE'
+host='x86_64-pc-linux-gnu'
+host_alias='x86_64-linux-gnu'
+host_cpu='x86_64'
+host_os='linux-gnu'
+host_vendor='pc'
+htmldir='${docdir}'
+include_ARTS_FALSE=''
+include_ARTS_TRUE=''
+include_x11_FALSE=''
+include_x11_TRUE=''
+includedir='/usr/include/kde'
+infodir='/usr/share/info'
+install_sh=''
+kde_appsdir=''
+kde_bindir=''
+kde_confdir='/etc/kde3'
+kde_datadir=''
+kde_htmldir='/usr/share/doc/kde/HTML'
+kde_icondir=''
+kde_includes=''
+kde_kcfgdir=''
+kde_libraries=''
+kde_libs_htmldir=''
+kde_libs_prefix=''
+kde_locale=''
+kde_mimedir=''
+kde_moduledir=''
+kde_qtver=''
+kde_servicesdir=''
+kde_servicetypesdir=''
+kde_sounddir=''
+kde_styledir=''
+kde_templatesdir=''
+kde_wallpaperdir=''
+kde_widgetdir=''
+kdeinitdir=''
+libdir='${exec_prefix}/lib'
+libexecdir='${exec_prefix}/libexec'
+localedir='${datarootdir}/locale'
+localstatedir='${prefix}/var'
+mandir='/usr/share/man'
+mkdir_p=''
+oldincludedir='/usr/include'
+pdfdir='${docdir}'
+prefix='/opt/kde3'
+program_transform_name='s,x,x,'
+psdir='${docdir}'
+qt_includes=''
+qt_libraries=''
+sbindir='${exec_prefix}/sbin'
+sharedstatedir='${prefix}/com'
+sysconfdir='/etc'
+target='x86_64-pc-linux-gnu'
+target_alias=''
+target_cpu='x86_64'
+target_os='linux-gnu'
+target_vendor='pc'
+unsermake_enable_pch_FALSE=''
+unsermake_enable_pch_TRUE=''
+x_includes='NONE'
+x_libraries='NONE'
+xdg_appsdir=''
+xdg_directorydir=''
+xdg_menudir=''
+
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+
+#define PACKAGE_NAME ""
+#define PACKAGE_TARNAME ""
+#define PACKAGE_VERSION ""
+#define PACKAGE_STRING ""
+#define PACKAGE_BUGREPORT ""
+
+configure: caught signal 2
+configure: exit 1
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..a39437d
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1686 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2009-04-17'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure.files b/configure.files
new file mode 100644
index 0000000..030bce8
--- /dev/null
+++ b/configure.files
@@ -0,0 +1,2 @@
+./admin/configure.in.min
+configure.in.in
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..222d2d7
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,152 @@
+dnl =======================================================
+dnl FILE: ./admin/configure.in.min
+dnl =======================================================
+
+dnl This file is part of the KDE libraries/packages
+dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
+
+dnl This file is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Library General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2 of the License, or (at your option) any later version.
+
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Library General Public License for more details.
+
+dnl You should have received a copy of the GNU Library General Public License
+dnl along with this library; see the file COPYING.LIB. If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+dnl Boston, MA 02110-1301, USA.
+
+# Original Author was Kalle@kde.org
+# I lifted it in some mater. (Stephan Kulow)
+# I used much code from Janos Farkas
+
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(acinclude.m4) dnl a source file from your sub dir
+
+dnl This is so we can use kde-common
+AC_CONFIG_AUX_DIR(admin)
+
+dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
+unset CDPATH
+
+dnl Checking host/target/build systems, for make, install etc.
+AC_CANONICAL_SYSTEM
+dnl Perform program name transformation
+AC_ARG_PROGRAM
+
+dnl Automake doc recommends to do this only here. (Janos)
+AM_INIT_AUTOMAKE(kmyfirewall-1.1.1, "3.5.6") dnl searches for some needed programs
+
+KDE_SET_PREFIX
+
+dnl generate the config header
+AM_CONFIG_HEADER(config.h) dnl at the distribution this done
+
+dnl Checks for programs.
+AC_CHECK_COMPILERS
+AC_ENABLE_SHARED(yes)
+AC_ENABLE_STATIC(no)
+KDE_PROG_LIBTOOL
+
+dnl for NLS support. Call them in this order!
+dnl WITH_NLS is for the po files
+AM_KDE_WITH_NLS
+
+KDE_USE_QT(3.2)
+AC_PATH_KDE
+dnl =======================================================
+dnl FILE: configure.in.in
+dnl =======================================================
+
+#MIN_CONFIG(3.2)
+
+#dnl CXXFLAGS="$NOOPT_CXXFLAGS" dnl __kdevelop[noopt]__
+#dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__
+#dnl CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" dnl __kdevelop[exc]__
+
+#dnl KDE_NEED_FLEX dnl __kdevelop__
+#dnl AC_PROG_YACC dnl __kdevelop__
+
+KDE_CREATE_SUBDIRSLIST
+AC_CONFIG_FILES([ Makefile ])
+AC_CONFIG_FILES([ KMFIPTInterface/Makefile ])
+AC_CONFIG_FILES([ KMFSysTray/Makefile ])
+AC_CONFIG_FILES([ doc/Makefile ])
+AC_CONFIG_FILES([ doc/kmyfirewall/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/compilers/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/compilers/iptables/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/compilers/pf/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/core/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/genericinterface/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/installer/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/installer/linux/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/installer/openbsd/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ipteditor/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/kmfwidgets/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/custom_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/interface_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/ip_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/limit_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/log_target_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/mac_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/mark_target_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/nat_target_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/protocol_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/state_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/tos_option/Makefile ])
+AC_CONFIG_FILES([ kmyfirewall/ruleoptionplugins/tos_target_option/Makefile ])
+AC_CONFIG_FILES([ pics/Makefile ])
+AC_CONFIG_FILES([ templates/Makefile ])
+AC_OUTPUT
+# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
+if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
+ # And if so, warn when they don't match
+ if test "$kde_libs_prefix" != "$given_prefix"; then
+ # And if kde doesn't know about the prefix yet
+ echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
+ if test $? -ne 0; then
+ echo ""
+ echo "Warning: you chose to install this package in $given_prefix,"
+ echo "but KDE was found in $kde_libs_prefix."
+ echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
+ echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
+ echo "Then restart KDE."
+ echo ""
+ fi
+ fi
+fi
+
+if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
+ echo ""
+ echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
+ echo "was not included. Therefore, GCC symbol visibility support remains disabled."
+ echo ""
+ echo "For better performance, consider including the Qt visibility supporting patch"
+ echo "located at:"
+ echo ""
+ echo "http://bugs.kde.org/show_bug.cgi?id=109386"
+ echo ""
+ echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
+ echo "everything will continue to work just fine without it."
+ echo ""
+fi
+
+if test "$all_tests" = "bad"; then
+ if test ! "$cache_file" = "/dev/null"; then
+ echo ""
+ echo "Please remove the file $cache_file after changing your setup"
+ echo "so that configure will find the changes next time."
+ echo ""
+ fi
+else
+ echo ""
+ echo "Good - your configure finished. Start make now"
+ echo ""
+fi
diff --git a/configure.in.in b/configure.in.in
new file mode 100644
index 0000000..bc8e6b7
--- /dev/null
+++ b/configure.in.in
@@ -0,0 +1,9 @@
+#MIN_CONFIG(3.2)
+
+#dnl CXXFLAGS="$NOOPT_CXXFLAGS" dnl __kdevelop[noopt]__
+#dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__
+#dnl CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" dnl __kdevelop[exc]__
+
+#dnl KDE_NEED_FLEX dnl __kdevelop__
+#dnl AC_PROG_YACC dnl __kdevelop__
+
diff --git a/debian_woody_configure b/debian_woody_configure
new file mode 100755
index 0000000..596271b
--- /dev/null
+++ b/debian_woody_configure
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+export kde_confdir="/etc/kde3"
+export kde_prefix="/usr"
+export kde_bindir="$kde_prefix/bin"
+export kde_includedir="$kde_prefix/include/kde"
+export kde_libdir="$kde_prefix/lib"
+export kde_cgidir="$kde_prefix/lib/cgi-bin"
+export kde_moduledir="$kde_prefix/lib/kde3"
+export kde_appsdir="$kde_prefix/share/applnk"
+export kde_datadir="$kde_prefix/share/apps"
+export kde_htmldir="$kde_prefix/share/doc/kde/HTML"
+export kde_icondir="$kde_prefix/share/icons"
+export kde_locale="$kde_prefix/share/locale"
+export kde_mimedir="$kde_prefix/share/mimelnk"
+export kde_servicesdir="$kde_prefix/share/services"
+export kde_servicetypesdir="$kde_prefix/share/servicetypes"
+export kde_sounddir="$kde_prefix/share/sounds"
+export kde_templatesdir="$kde_prefix/share/templates"
+export kde_wallpaperdir="$kde_prefix/share/wallpapers"
+
+export mandir="$kde_prefix/share/man"
+export infodir="$kde_prefix/share/info"
+export sysconfdir="/etc"
+
+export QTDIR="/usr/share/qt"
+export IDL="$kde_bindir/cuteidl"
+export DCOPIDL="$kde_bindir/dcopidl"
+export DCOPIDL2CPP="$kde_bindir/dcopidl2cpp"
+export KDB2HTML="$kde_bindir/kdb2html"
+export MCOPIDL="$kde_bindir/mcopidl"
+export ARTSCCONFIG="$kde_bindir/artsc-config"
+
+
+./configure --prefix=/usr --enable-debug=full --with-qt-includes=/usr/include/qt3
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..4709b04
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,718 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 483858 $
+# doc/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+srcdir = .
+top_srcdir = ..
+
+pkgdatadir = $(datadir)/kmyfirewall-1.1.0
+pkglibdir = $(libdir)/kmyfirewall-1.1.0
+pkgincludedir = $(includedir)/kmyfirewall-1.1.0
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = /usr/bin/install -c -p
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+target_triplet = i686-pc-linux-gnu
+subdir = doc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+#>- html-recursive info-recursive install-data-recursive \
+#>- install-exec-recursive install-info-recursive \
+#>- install-recursive installcheck-recursive installdirs-recursive \
+#>- pdf-recursive ps-recursive uninstall-info-recursive \
+#>- uninstall-recursive
+#>+ 6
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive nmcheck-recursive bcheck-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run aclocal-1.9
+AMDEP_FALSE = #
+AMDEP_TRUE =
+AMTAR = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run tar
+AR = ar
+ARTSCCONFIG = /usr/bin/artsc-config
+AUTOCONF = $(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure
+AUTODIRS =
+AUTOHEADER = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run automake-1.9
+AWK = mawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -g3 -fno-inline -Wformat-security -Wmissing-format-attribute
+CONF_FILES = $(top_srcdir)/./admin/configure.in.min $(top_srcdir)/configure.in.in
+CPP = gcc -E
+CPPFLAGS = -DQT_THREAD_SUPPORT -D_REENTRANT
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -fno-builtin -g3 -fno-inline -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common
+CYGPATH_W = echo
+DCOPIDL = /usr/bin/dcopidl
+DCOPIDL2CPP = /usr/bin/dcopidl2cpp
+DCOPIDLNG = /usr/bin/dcopidlng
+DCOP_DEPENDENCIES = $(DCOPIDL) $(DCOPIDLNG)
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+ECHO = echo
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /bin/grep -E
+ENABLE_PERMISSIVE_FLAG = -fpermissive
+EXEEXT =
+F77 =
+FFLAGS =
+FRAMEWORK_COREAUDIO =
+GMSGFMT = /usr/bin/msgfmt
+GREP = /bin/grep
+HAVE_GCC_VISIBILITY = 0
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL} $(INSTALL_STRIP_FLAG)
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
+KCFG_DEPENDENCIES = $(KCONFIG_COMPILER)
+KCONFIG_COMPILER = /usr/bin/kconfig_compiler
+KDECONFIG = /usr/bin/kde-config
+KDE_CHECK_PLUGIN = $(KDE_PLUGIN) -rpath $(libdir)
+KDE_EXTRA_RPATH =
+KDE_INCLUDES = -I/usr/include/kde
+KDE_LDFLAGS = -L/usr/lib
+KDE_MT_LDFLAGS =
+KDE_MT_LIBS = -lpthread
+KDE_NO_UNDEFINED = -Wl,--no-undefined -Wl,--allow-shlib-undefined
+KDE_PLUGIN = -avoid-version -module -no-undefined $(KDE_NO_UNDEFINED) $(KDE_RPATH) $(KDE_MT_LDFLAGS)
+KDE_RPATH = -R $(libdir) -R $(kde_libraries) -R $(qt_libraries)
+KDE_USE_CLOSURE_FALSE =
+KDE_USE_CLOSURE_TRUE = #
+KDE_USE_FINAL_FALSE =
+KDE_USE_FINAL_TRUE = #
+KDE_USE_FPIE = -fPIE
+KDE_USE_NMCHECK_FALSE =
+KDE_USE_NMCHECK_TRUE = #
+KDE_USE_PIE = -pie
+KDE_XSL_STYLESHEET = /usr/share/apps/ksgmltools2/customization/kde-chunk.xsl
+LDFLAGS =
+LDFLAGS_AS_NEEDED =
+LDFLAGS_NEW_DTAGS =
+LIBCOMPAT =
+LIBCRYPT = -lcrypt
+LIBDL = -ldl
+LIBJPEG = -ljpeg
+LIBOBJS =
+LIBPNG = -lpng -lz -lm
+LIBPTHREAD = -lpthread
+LIBRESOLV = -lresolv
+LIBS =
+LIBSM = -lSM -lICE
+LIBSOCKET =
+LIBTOOL = $(SHELL) $(top_builddir)/libtool --silent
+LIBUCB =
+LIBUTIL = -lutil
+LIBZ = -lz
+LIB_KAB = -lkab
+LIB_KABC = -lkabc
+LIB_KDECORE = -lkdecore
+LIB_KDED =
+LIB_KDEPIM = -lkdepim
+LIB_KDEPRINT = -lkdeprint
+LIB_KDEUI = -lkdeui
+LIB_KDNSSD = -lkdnssd
+LIB_KFILE = -lkio
+LIB_KFM =
+LIB_KHTML = -lkhtml
+LIB_KIMPROXY = -lkimproxy
+LIB_KIO = -lkio
+LIB_KJS = -lkjs
+LIB_KNEWSTUFF = -lknewstuff
+LIB_KPARTS = -lkparts
+LIB_KSPELL = -lkspell
+LIB_KSYCOCA = -lkio
+LIB_KUNITTEST = -lkunittest
+LIB_KUTILS = -lkutils
+LIB_POLL =
+LIB_QPE =
+LIB_QT = -lqt-mt $(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) -lpthread
+LIB_SMB = -lsmb
+LIB_X11 = -lX11 $(LIBSOCKET)
+LIB_XEXT = -lXext
+LIB_XRENDER =
+LN_S = ln -s
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run makeinfo
+MAKEKDEWIDGETS =
+MCOPIDL = /usr/bin/mcopidl
+MEINPROC = /usr/bin/meinproc
+MOC = /usr/share/qt3/bin/moc
+MSGFMT = /usr/bin/msgfmt
+NOOPT_CFLAGS = -O0
+NOOPT_CXXFLAGS = -O0
+OBJEXT = o
+PACKAGE = kmyfirewall-1.1.0
+PACKAGE_BUGREPORT =
+PACKAGE_NAME =
+PACKAGE_STRING =
+PACKAGE_TARNAME =
+PACKAGE_VERSION =
+PATH_SEPARATOR = :
+PERL = /usr/bin/perl
+PKG_CONFIG = /usr/bin/pkg-config
+QTE_NORTTI =
+QT_INCLUDES = -I/usr/include/qt3
+QT_LDFLAGS =
+RANLIB = ranlib
+SET_MAKE =
+SHELL = /bin/bash
+STRIP = strip
+TOPSUBDIRS = KMFIPTInterface KMFSysTray doc kmyfirewall pics templates
+UIC = /usr/share/qt3/bin/uic -L $(kde_widgetdir) -nounload
+UIC_TR = tr2i18n
+USER_INCLUDES =
+USER_LDFLAGS =
+USE_EXCEPTIONS = -fexceptions
+USE_RTTI =
+USE_THREADS =
+VERSION = 3.5.8
+WOVERLOADED_VIRTUAL = -Woverloaded-virtual
+XGETTEXT = /usr/bin/xgettext
+XMKMF =
+XMLLINT = /usr/bin/xmllint
+X_EXTRA_LIBS =
+X_INCLUDES = -I.
+X_LDFLAGS =
+X_PRE_LIBS =
+X_RPATH =
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_F77 =
+all_includes = -I/usr/include/kde -I/usr/include/qt3 -I.
+all_libraries =
+am__fastdepCC_FALSE = #
+am__fastdepCC_TRUE =
+am__fastdepCXX_FALSE = #
+am__fastdepCXX_TRUE =
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = /usr/bin
+build = i686-pc-linux-gnu
+build_alias =
+build_cpu = i686
+build_os = linux-gnu
+build_vendor = pc
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = i686-pc-linux-gnu
+host_alias =
+host_cpu = i686
+host_os = linux-gnu
+host_vendor = pc
+htmldir = ${docdir}
+include_ARTS_FALSE = #
+include_ARTS_TRUE =
+include_x11_FALSE = #
+include_x11_TRUE =
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/install-sh
+kde_appsdir = /usr/share/applnk
+kde_bindir = /usr/bin
+kde_confdir = /etc/kde3
+kde_datadir = /usr/share/apps
+kde_htmldir = /usr/share/doc/kde/HTML
+kde_icondir = /usr/share/icons
+kde_includes = /usr/include/kde
+kde_kcfgdir = ${datadir}/config.kcfg
+kde_libraries = /usr/lib
+kde_libs_htmldir = /usr/share/doc/kde/HTML
+kde_libs_prefix = /usr
+kde_locale = /usr/share/locale
+kde_mimedir = /usr/share/mimelnk
+kde_moduledir = /usr/lib/kde3
+kde_qtver = 3
+kde_servicesdir = /usr/share/services
+kde_servicetypesdir = /usr/share/servicetypes
+kde_sounddir = /usr/share/sounds
+kde_styledir = ${libdir}/kde3/plugins/styles
+kde_templatesdir = /usr/share/templates
+kde_wallpaperdir = /usr/share/wallpapers
+kde_widgetdir = /usr/lib/kde3/plugins/designer
+kdeinitdir = $(kde_moduledir)
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = mkdir -p --
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr
+program_transform_name = s,x,x,
+psdir = ${docdir}
+qt_includes = /usr/include/qt3
+qt_libraries = /usr/lib
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+sysconfdir = ${prefix}/etc
+target = i686-pc-linux-gnu
+target_alias =
+target_cpu = i686
+target_os = linux-gnu
+target_vendor = pc
+unsermake_enable_pch_FALSE =
+unsermake_enable_pch_TRUE = #
+x_includes = .
+x_libraries = /usr/lib
+xdg_appsdir = ${datadir}/applications/kde
+xdg_directorydir = ${datadir}/desktop-directories
+xdg_menudir = ${sysconfdir}/xdg/menus
+KDE_LANG = en
+KDE_DOCS = AUTO
+#>- SUBDIRS = $(AUTODIRS)
+#>+ 1
+SUBDIRS =. kmyfirewall
+#>- all: all-recursive
+#>+ 1
+all: docs-am all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+#>- @for dep in $?; do \
+#>- case '$(am__configure_deps)' in \
+#>- *$$dep*) \
+#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+#>- && exit 0; \
+#>- exit 1;; \
+#>- esac; \
+#>- done; \
+#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
+#>- cd $(top_srcdir) && \
+#>- $(AUTOMAKE) --gnu doc/Makefile
+#>+ 12
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/Makefile
+ cd $(top_srcdir) && perl admin/am_edit doc/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean clean-recursive
+
+#>- clean-am: clean-generic clean-libtool mostlyclean-am
+#>+ 1
+clean-am: clean-bcheck clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-recursive ctags \
+ ctags-recursive distclean distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/Makefile
+ cd $(top_srcdir) && perl admin/am_edit doc/Makefile.in
+
+
+#>+ 21
+clean-bcheck:
+ rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-recursive
+
+bcheck-am:
+ @for i in ; do \
+ if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+ echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+ echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+ echo "$$i"; \
+ if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+ rm -f $$i.bchecktest.cc; exit 1; \
+ fi ; \
+ echo "" >> $$i.bchecktest.cc.class; \
+ perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+ rm -f a.out; \
+ fi ; \
+ done
+
+
+#>+ 3
+final:
+ $(MAKE) all-am
+
+#>+ 3
+final-install:
+ $(MAKE) install-am
+
+#>+ 3
+no-final:
+ $(MAKE) all-am
+
+#>+ 3
+no-final-install:
+ $(MAKE) install-am
+
+#>+ 3
+kde-rpo-clean:
+ -rm -f *.rpo
+
+#>+ 3
+nmcheck:
+nmcheck-am: nmcheck
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..6812bd2
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,5 @@
+
+KDE_LANG = en
+KDE_DOCS = AUTO
+SUBDIRS = $(AUTODIRS)
+
diff --git a/doc/kmyfirewall/Makefile b/doc/kmyfirewall/Makefile
new file mode 100644
index 0000000..3d26eea
--- /dev/null
+++ b/doc/kmyfirewall/Makefile
@@ -0,0 +1,599 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 483858 $
+# doc/kmyfirewall/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+srcdir = .
+top_srcdir = ../..
+
+pkgdatadir = $(datadir)/kmyfirewall-1.1.0
+pkglibdir = $(libdir)/kmyfirewall-1.1.0
+pkgincludedir = $(includedir)/kmyfirewall-1.1.0
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = /usr/bin/install -c -p
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+target_triplet = i686-pc-linux-gnu
+subdir = doc/kmyfirewall
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run aclocal-1.9
+AMDEP_FALSE = #
+AMDEP_TRUE =
+AMTAR = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run tar
+AR = ar
+ARTSCCONFIG = /usr/bin/artsc-config
+AUTOCONF = $(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure
+AUTODIRS =
+AUTOHEADER = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run automake-1.9
+AWK = mawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -g3 -fno-inline -Wformat-security -Wmissing-format-attribute
+CONF_FILES = $(top_srcdir)/./admin/configure.in.min $(top_srcdir)/configure.in.in
+CPP = gcc -E
+CPPFLAGS = -DQT_THREAD_SUPPORT -D_REENTRANT
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -fno-builtin -g3 -fno-inline -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common
+CYGPATH_W = echo
+DCOPIDL = /usr/bin/dcopidl
+DCOPIDL2CPP = /usr/bin/dcopidl2cpp
+DCOPIDLNG = /usr/bin/dcopidlng
+DCOP_DEPENDENCIES = $(DCOPIDL) $(DCOPIDLNG)
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+ECHO = echo
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /bin/grep -E
+ENABLE_PERMISSIVE_FLAG = -fpermissive
+EXEEXT =
+F77 =
+FFLAGS =
+FRAMEWORK_COREAUDIO =
+GMSGFMT = /usr/bin/msgfmt
+GREP = /bin/grep
+HAVE_GCC_VISIBILITY = 0
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL} $(INSTALL_STRIP_FLAG)
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
+KCFG_DEPENDENCIES = $(KCONFIG_COMPILER)
+KCONFIG_COMPILER = /usr/bin/kconfig_compiler
+KDECONFIG = /usr/bin/kde-config
+KDE_CHECK_PLUGIN = $(KDE_PLUGIN) -rpath $(libdir)
+KDE_EXTRA_RPATH =
+KDE_INCLUDES = -I/usr/include/kde
+KDE_LDFLAGS = -L/usr/lib
+KDE_MT_LDFLAGS =
+KDE_MT_LIBS = -lpthread
+KDE_NO_UNDEFINED = -Wl,--no-undefined -Wl,--allow-shlib-undefined
+KDE_PLUGIN = -avoid-version -module -no-undefined $(KDE_NO_UNDEFINED) $(KDE_RPATH) $(KDE_MT_LDFLAGS)
+KDE_RPATH = -R $(libdir) -R $(kde_libraries) -R $(qt_libraries)
+KDE_USE_CLOSURE_FALSE =
+KDE_USE_CLOSURE_TRUE = #
+KDE_USE_FINAL_FALSE =
+KDE_USE_FINAL_TRUE = #
+KDE_USE_FPIE = -fPIE
+KDE_USE_NMCHECK_FALSE =
+KDE_USE_NMCHECK_TRUE = #
+KDE_USE_PIE = -pie
+KDE_XSL_STYLESHEET = /usr/share/apps/ksgmltools2/customization/kde-chunk.xsl
+LDFLAGS =
+LDFLAGS_AS_NEEDED =
+LDFLAGS_NEW_DTAGS =
+LIBCOMPAT =
+LIBCRYPT = -lcrypt
+LIBDL = -ldl
+LIBJPEG = -ljpeg
+LIBOBJS =
+LIBPNG = -lpng -lz -lm
+LIBPTHREAD = -lpthread
+LIBRESOLV = -lresolv
+LIBS =
+LIBSM = -lSM -lICE
+LIBSOCKET =
+LIBTOOL = $(SHELL) $(top_builddir)/libtool --silent
+LIBUCB =
+LIBUTIL = -lutil
+LIBZ = -lz
+LIB_KAB = -lkab
+LIB_KABC = -lkabc
+LIB_KDECORE = -lkdecore
+LIB_KDED =
+LIB_KDEPIM = -lkdepim
+LIB_KDEPRINT = -lkdeprint
+LIB_KDEUI = -lkdeui
+LIB_KDNSSD = -lkdnssd
+LIB_KFILE = -lkio
+LIB_KFM =
+LIB_KHTML = -lkhtml
+LIB_KIMPROXY = -lkimproxy
+LIB_KIO = -lkio
+LIB_KJS = -lkjs
+LIB_KNEWSTUFF = -lknewstuff
+LIB_KPARTS = -lkparts
+LIB_KSPELL = -lkspell
+LIB_KSYCOCA = -lkio
+LIB_KUNITTEST = -lkunittest
+LIB_KUTILS = -lkutils
+LIB_POLL =
+LIB_QPE =
+LIB_QT = -lqt-mt $(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) -lpthread
+LIB_SMB = -lsmb
+LIB_X11 = -lX11 $(LIBSOCKET)
+LIB_XEXT = -lXext
+LIB_XRENDER =
+LN_S = ln -s
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/missing --run makeinfo
+MAKEKDEWIDGETS =
+MCOPIDL = /usr/bin/mcopidl
+MEINPROC = /usr/bin/meinproc
+MOC = /usr/share/qt3/bin/moc
+MSGFMT = /usr/bin/msgfmt
+NOOPT_CFLAGS = -O0
+NOOPT_CXXFLAGS = -O0
+OBJEXT = o
+PACKAGE = kmyfirewall-1.1.0
+PACKAGE_BUGREPORT =
+PACKAGE_NAME =
+PACKAGE_STRING =
+PACKAGE_TARNAME =
+PACKAGE_VERSION =
+PATH_SEPARATOR = :
+PERL = /usr/bin/perl
+PKG_CONFIG = /usr/bin/pkg-config
+QTE_NORTTI =
+QT_INCLUDES = -I/usr/include/qt3
+QT_LDFLAGS =
+RANLIB = ranlib
+SET_MAKE =
+SHELL = /bin/bash
+STRIP = strip
+TOPSUBDIRS = KMFIPTInterface KMFSysTray doc kmyfirewall pics templates
+UIC = /usr/share/qt3/bin/uic -L $(kde_widgetdir) -nounload
+UIC_TR = tr2i18n
+USER_INCLUDES =
+USER_LDFLAGS =
+USE_EXCEPTIONS = -fexceptions
+USE_RTTI =
+USE_THREADS =
+VERSION = 3.5.8
+WOVERLOADED_VIRTUAL = -Woverloaded-virtual
+XGETTEXT = /usr/bin/xgettext
+XMKMF =
+XMLLINT = /usr/bin/xmllint
+X_EXTRA_LIBS =
+X_INCLUDES = -I.
+X_LDFLAGS =
+X_PRE_LIBS =
+X_RPATH =
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_F77 =
+all_includes = -I/usr/include/kde -I/usr/include/qt3 -I.
+all_libraries =
+am__fastdepCC_FALSE = #
+am__fastdepCC_TRUE =
+am__fastdepCXX_FALSE = #
+am__fastdepCXX_TRUE =
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = /usr/bin
+build = i686-pc-linux-gnu
+build_alias =
+build_cpu = i686
+build_os = linux-gnu
+build_vendor = pc
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = i686-pc-linux-gnu
+host_alias =
+host_cpu = i686
+host_os = linux-gnu
+host_vendor = pc
+htmldir = ${docdir}
+include_ARTS_FALSE = #
+include_ARTS_TRUE =
+include_x11_FALSE = #
+include_x11_TRUE =
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = /home/animal/devel/KDE-SVN/kmyfirewall-1.1.0/admin/install-sh
+kde_appsdir = /usr/share/applnk
+kde_bindir = /usr/bin
+kde_confdir = /etc/kde3
+kde_datadir = /usr/share/apps
+kde_htmldir = /usr/share/doc/kde/HTML
+kde_icondir = /usr/share/icons
+kde_includes = /usr/include/kde
+kde_kcfgdir = ${datadir}/config.kcfg
+kde_libraries = /usr/lib
+kde_libs_htmldir = /usr/share/doc/kde/HTML
+kde_libs_prefix = /usr
+kde_locale = /usr/share/locale
+kde_mimedir = /usr/share/mimelnk
+kde_moduledir = /usr/lib/kde3
+kde_qtver = 3
+kde_servicesdir = /usr/share/services
+kde_servicetypesdir = /usr/share/servicetypes
+kde_sounddir = /usr/share/sounds
+kde_styledir = ${libdir}/kde3/plugins/styles
+kde_templatesdir = /usr/share/templates
+kde_wallpaperdir = /usr/share/wallpapers
+kde_widgetdir = /usr/lib/kde3/plugins/designer
+kdeinitdir = $(kde_moduledir)
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = mkdir -p --
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr
+program_transform_name = s,x,x,
+psdir = ${docdir}
+qt_includes = /usr/include/qt3
+qt_libraries = /usr/lib
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+sysconfdir = ${prefix}/etc
+target = i686-pc-linux-gnu
+target_alias =
+target_cpu = i686
+target_os = linux-gnu
+target_vendor = pc
+unsermake_enable_pch_FALSE =
+unsermake_enable_pch_TRUE = #
+x_includes = .
+x_libraries = /usr/lib
+xdg_appsdir = ${datadir}/applications/kde
+xdg_directorydir = ${datadir}/desktop-directories
+xdg_menudir = ${sysconfdir}/xdg/menus
+KDE_LANG = en
+KDE_DOCS = AUTO
+#>- all: all-am
+#>+ 1
+all: docs-am all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+#>- @for dep in $?; do \
+#>- case '$(am__configure_deps)' in \
+#>- *$$dep*) \
+#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+#>- && exit 0; \
+#>- exit 1;; \
+#>- esac; \
+#>- done; \
+#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/kmyfirewall/Makefile'; \
+#>- cd $(top_srcdir) && \
+#>- $(AUTOMAKE) --gnu doc/kmyfirewall/Makefile
+#>+ 12
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/kmyfirewall/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/kmyfirewall/Makefile
+ cd $(top_srcdir) && perl admin/am_edit doc/kmyfirewall/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+#>- distdir: $(DISTFILES)
+#>+ 1
+distdir: distdir-nls $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+#>- uninstall: uninstall-am
+#>+ 1
+uninstall: uninstall-docs uninstall-nls uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean clean-am
+
+#>- clean-am: clean-generic clean-libtool mostlyclean-am
+#>+ 1
+clean-am: clean-docs clean-bcheck clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+#>- install-data-am:
+#>+ 1
+install-data-am: install-docs install-nls
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in index.docbook Makefile.am
+
+#>+ 24
+index.cache.bz2: $(srcdir)/index.docbook $(KDE_XSL_STYLESHEET) index.docbook
+ @if test -n "$(MEINPROC)"; then echo $(MEINPROC) --check --cache index.cache.bz2 $(srcdir)/index.docbook; $(MEINPROC) --check --cache index.cache.bz2 $(srcdir)/index.docbook; fi
+
+docs-am: index.cache.bz2
+
+install-docs: docs-am install-nls
+ $(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall
+ @if test -f index.cache.bz2; then \
+ echo $(INSTALL_DATA) index.cache.bz2 $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall/; \
+ $(INSTALL_DATA) index.cache.bz2 $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall/; \
+ elif test -f $(srcdir)/index.cache.bz2; then \
+ echo $(INSTALL_DATA) $(srcdir)/index.cache.bz2 $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall/; \
+ $(INSTALL_DATA) $(srcdir)/index.cache.bz2 $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall/; \
+ fi
+ -rm -f $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall/common
+ $(LN_S) $(kde_libs_htmldir)/$(KDE_LANG)/common $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall/common
+
+uninstall-docs:
+ -rm -rf $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall
+
+clean-docs:
+ -rm -f index.cache.bz2
+
+
+#>+ 13
+install-nls:
+ $(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall
+ @for base in index.docbook ; do \
+ echo $(INSTALL_DATA) $$base $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall/$$base ;\
+ $(INSTALL_DATA) $(srcdir)/$$base $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall/$$base ;\
+ done
+
+uninstall-nls:
+ for base in index.docbook ; do \
+ rm -f $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/kmyfirewall/$$base ;\
+ done
+
+
+#>+ 5
+distdir-nls:
+ for file in index.docbook ; do \
+ cp $(srcdir)/$$file $(distdir); \
+ done
+
+#>+ 15
+force-reedit:
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/kmyfirewall/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/kmyfirewall/Makefile
+ cd $(top_srcdir) && perl admin/am_edit doc/kmyfirewall/Makefile.in
+
+
+#>+ 21
+clean-bcheck:
+ rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+ @for i in ; do \
+ if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+ echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+ echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+ echo "$$i"; \
+ if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+ rm -f $$i.bchecktest.cc; exit 1; \
+ fi ; \
+ echo "" >> $$i.bchecktest.cc.class; \
+ perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+ rm -f a.out; \
+ fi ; \
+ done
+
+
+#>+ 3
+final:
+ $(MAKE) all-am
+
+#>+ 3
+final-install:
+ $(MAKE) install-am
+
+#>+ 3
+no-final:
+ $(MAKE) all-am
+
+#>+ 3
+no-final-install:
+ $(MAKE) install-am
+
+#>+ 3
+kde-rpo-clean:
+ -rm -f *.rpo
+
+#>+ 3
+nmcheck:
+nmcheck-am: nmcheck
diff --git a/doc/kmyfirewall/Makefile.am b/doc/kmyfirewall/Makefile.am
new file mode 100644
index 0000000..4169155
--- /dev/null
+++ b/doc/kmyfirewall/Makefile.am
@@ -0,0 +1,3 @@
+KDE_LANG = en
+KDE_DOCS = AUTO
+
diff --git a/doc/kmyfirewall/index.docbook b/doc/kmyfirewall/index.docbook
new file mode 100644
index 0000000..2b16a0a
--- /dev/null
+++ b/doc/kmyfirewall/index.docbook
@@ -0,0 +1,1598 @@
+<?xml version="1.0" ?>
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.0//EN" "dtd/kdex.dtd" [
+ <!ENTITY kmyfirewall '<application>KMyFirewall</application>'>
+ <!ENTITY kapp "&kmyfirewall;"><!-- replace kmyfirewall here -->
+ <!ENTITY % addindex "IGNORE">
+ <!ENTITY % English "INCLUDE"><!-- change language only here -->
+
+
+ <!-- Do not define any other entities; instead, use the entities
+ from kde-genent.entities and $LANG/user.entities. -->
+]>
+
+<!-- The language must NOT be changed here. -->
+
+<book lang="&language;">
+
+<!-- This header contains all of the meta-information for the document such
+as Authors, publish date, the abstract, and Keywords -->
+
+<bookinfo>
+<title>The KMyFirewall Handbook</title>
+<authorgroup>
+<author>
+<firstname>Christian</firstname>
+<surname>Hubinger</surname>
+<affiliation>
+<address><email>chubinger@gmail.com</email></address>
+</affiliation>
+</author>
+</authorgroup>
+
+<!-- TRANS:ROLES_OF_TRANSLATORS -->
+
+<copyright>
+<year>2002-2005</year>
+<holder>Christian Hubinger</holder>
+</copyright>
+<!-- Translators: put here the copyright notice of the translation -->
+<!-- Put here the FDL notice. Read the explanation in fdl-notice.docbook
+ and in the FDL itself on how to use it. -->
+<legalnotice>&FDLNotice;</legalnotice>
+
+<!-- Date and version information of the documentation
+Don't forget to include this last date and this last revision number, we
+need them for translation coordination !
+Please respect the format of the date (DD/MM/YYYY) and of the version
+(V.MM.LL), it could be used by automation scripts.
+Do NOT change these in the translation. -->
+
+<date>03/04/2005</date>
+<releaseinfo>1.0</releaseinfo>
+
+<!-- Abstract about this handbook -->
+
+<abstract>
+<para>
+&kmyfirewall; - Firewall configuration tool
+</para>
+</abstract>
+
+<!-- This is a set of Keywords for indexing by search engines.
+Please at least include KDE, the KDE package it is in, the name
+ of your application, and a few relevant keywords. -->
+
+<keywordset>
+<keyword>KDE</keyword>
+<keyword>kdeadmin</keyword>
+<keyword>kdeextragear</keyword>
+<keyword>KMyFirewall</keyword>
+<keyword>iptables</keyword>
+<keyword>firewall</keyword>
+<keyword>security</keyword>
+</keywordset>
+
+</bookinfo>
+
+<!-- The contents of the documentation begin here. Label
+each chapter so with the id attribute. This is necessary for two reasons: it
+allows you to easily reference the chapter from other chapters of your
+document, and if there is no ID, the name of the generated HTML files will vary
+from time to time making it hard to manage for maintainers and for the CVS
+system. Any chapter labelled (OPTIONAL) may be left out at the author's
+discretion. Other chapters should not be left out in order to maintain a
+consistent documentation style across all KDE apps. -->
+
+<chapter id="introduction">
+<title>Introduction</title>
+
+<!-- The introduction chapter contains a brief introduction for the
+application that explains what it does and where to report
+problems. Basically a long version of the abstract. Don't include a
+revision history. (see installation appendix comment) -->
+
+<sect1 id="about">
+<title>About</title>
+<para>
+&kmyfirewall; attempts to make it easier to setup firewalls for your computer network without limitating your configuration options. If you don't have the time and/or the interest to spend hours in front of your operating system manual just to setup a simple firewall that keeps the "bad" people out, &kmyfirewall; will help you to configure your computer within a few clicks.
+</para>
+<para>
+It will be the right tool if you like to have a so called "Personal Firewall" running on your worstation but it will also help you to setup complex rulesets for your network routers. Each of it's two different Graphical ruleset editors try to provide the right tool for each group of users.
+</para>
+<para>
+Entire rule sets can be saved, so you only have to configure your rule set one time and then you can use it on several computers giving each of them a similar configuration (p.e. school networks, office, university etc.).
+</para>
+</sect1>
+
+<sect1 id="note">
+<title>Note</title>
+<para>
+Programs can't do any magic so you still will have to know what your firewall should do to setup your rule set.
+</para>
+<para>
+KMyFirewall tries to provide well designed default settings so that there should not be much to do anymore to provide a secure setup. But there is no way &kmyfirewall; can prevent you from openeing security holes in your setup! Please allways test rulesets you created before you use them for a production system.
+</para>
+</sect1>
+<!--
+</chapter>
+<chapter id="features">
+<title>Features</title>
+<para></para>
+-->
+<sect1 id="common">
+<title>Features</title>
+
+<sect2 id="main-features">
+<title>Main Features</title>
+
+<orderedlist>
+<listitem>
+ <para>Easy setup of a small but efficient "Personal Firewall".</para>
+</listitem>
+<listitem>
+ <para>Nice overview of the configuration.</para>
+</listitem>
+<listitem>
+ <para>Import/Export of rule sets to ease the setup of large networks.</para>
+</listitem>
+<listitem>
+ <para>Easy-to-use GUI interface for most common setups.</para>
+</listitem>
+<listitem>
+ <para>An advanced interface for complex rule sets as needed by routers</para>
+</listitem>
+<listitem>
+ <para>Preconfigured rulesets for most common setups.</para>
+</listitem>
+<listitem>
+ <para>Integrated Install scripts for automatic execution during booting.</para>
+</listitem>
+<listitem>
+ <para>Plugin framowork that allows easy and fast development of new features.</para>
+</listitem>
+<listitem>
+ <para>Plugin framowork that allows easy and fast development of new features.</para>
+</listitem>
+</orderedlist>
+
+</sect2>
+
+<sect2 id="generic-interface-features">
+<title>Generic Interface</title>
+<para>
+<orderedlist>
+<listitem>
+ <para>Zone/Host based rule creation.</para>
+</listitem>
+<listitem>
+ <para>No portnumbers need to be known.</para>
+</listitem>
+<listitem>
+ <para>NAT and simple network router support.</para>
+</listitem>
+<listitem>
+ <para>Support for special hosts e.g. trusted banned etc.</para>
+</listitem>
+<listitem>
+ <para>Rule inheritance can be enabled/disabled for nested notwork zones.</para>
+</listitem>
+<listitem>
+ <para>Operating system and backend independet. (Currently only Linux is supported but OpenBSD should follow soon)</para>
+</listitem>
+</orderedlist>
+</para>
+</sect2>
+
+<sect2 id="ipt-interface-features">
+<title>IPTables Interface</title>
+<para>
+<orderedlist>
+<listitem>
+ <para>XML based iptables command generation engine that allows to be extended by plugins providing a description about the new option.</para>
+</listitem>
+<listitem>
+ <para>State full packet filtering.</para>
+</listitem>
+<listitem>
+ <para>IP, MAC, Protocol, ROS and Interface based filtering</para>
+</listitem>
+<listitem>
+ <para>Limiting packet matches (avoids DoS attacks)</para>
+</listitem>
+<listitem>
+ <para>Logging of dropped packets</para>
+</listitem>
+<listitem>
+ <para>View running IP Tables configuration</para>
+</listitem>
+<listitem>
+ <para>NAT (SNAT, DNAT) configuration (Masquerading)</para>
+</listitem>
+<listitem>
+ <para>User defined Chains</para>
+</listitem>
+<listitem>
+ <para>MANGLE configuration</para>
+</listitem>
+<listitem>
+ <para>Undo/Redo</para>
+</listitem>
+</orderedlist>
+
+</para>
+</sect2>
+</sect1>
+</chapter>
+
+
+
+<chapter id="theory">
+<title>Just a bit of Theory</title>
+
+<sect1 id="firewall-can-do">
+<title>What can a firewall do?</title>
+<para>
+As firewalling is a really complex topic I'd like to give you a briefly introduction about what firewalls are and how
+IPTables firewalls work.
+</para>
+<para>
+When you think of a firewall most people would say <quote>firewalls just restrict the network traffic</quote>,
+but a modern firewall has more to do that just restricting the traffic which is of course it's main task.
+</para>
+<para>You can filter by having a look at the packet headers that store information about where the packet comes from,
+which protocol is used etc.
+</para>
+<para>
+The filtering possibilities provided by the IPTables are very powerful so it's even possible to
+only let packets in that are know to belong to a connection you have made. This technology is called <quote>Connection Tracking</quote>
+or <quote>Statefull Packet Filtering</quote>.
+</para>
+<para>
+The second important feature a firewall has to provide is the possibility to log the network traffic.
+This is a much more important part of it as you may think, because logfiles are give you a good view
+about the activities in your network like who did what and when.
+</para>
+<para>
+Logs are also really important when
+the firewall got cracked and you want to know how. In that you would have a much harder life if you didn't
+activeted the logging functions so that you can see what has happend and how the configuration be improved.
+</para>
+<para>
+Most people think about firewalls just being used to block traffic from the Internet to your host, but you may also
+configure your firewall to restrict the Internet access. Par example you may block some well known porn sites on your Children's PC
+or you just want to allow e-mail and Web browsing in your office but you don't want your employees to be able to download files via FTP.
+</para>
+<para>
+All the things described are really easy to implement with the IPTables once you have understood how they work. Please read
+carefully through the next few chapters to learn how to efficiently use this Program to settup an firewall for your PC/Network.
+</para>
+</sect1>
+
+<sect1 id="firewall-cant-do">
+<title>A Note about Security in general</title>
+<para>
+A firewall can actually not guarantee 100% of security just because there may be bugs in the underlying software or the
+configuration or even a hardware problem can be the <quote>open door</quote> for the bad guys.
+</para>
+<para>
+It is also a common mistake to believe that a firewall is enough to provide security.
+If you want to have a really high level of security you will need a whole <quote>Security Concept</quote> which
+defined the basic rules for the network environment. This includes the used software, installing security updates to the running
+software, a good documentation about how the security level is enforced in your network etc.
+</para>
+<para>
+Here is an example what I mean by that.
+</para>
+<para>
+Imagine you are running a public web server. To make it possible for the World to reach you you have to open the TCP port 80 for
+incoming connections. By opening this port your computer is reachable through the Internet. You as the admin implemented a
+really bomb save firewall configuration and you feel save because your firewall protects you. But certainly a securityhole in the webserver
+application is found and made public in the Internet. If you didn't installed the security update because you forgot or it isn't available
+yet a hacker may be able to use this securityhole (in the webserver not the firewall) to get access to your network. In this case the
+firewall can't do anything against it because you allowed people to connect to your server.
+</para>
+<para>
+I hope that this example makes it a little bit clearer what is meant when talking about a security concept.
+To prevent these cases there are some basic rules to follow.
+<orderedlist>
+<listitem>
+ <para>Install updates to the software you are running.</para>
+</listitem>
+<listitem>
+ <para>Try to have a look at some security based websites to stay informed about whats going on out there.</para>
+</listitem>
+<listitem>
+ <para>Think about creating a security concept for your network.</para>
+</listitem>
+<listitem>
+ <para>Never ever trust your configuration blindly!</para>
+</listitem>
+<listitem>
+ <para>Watch your logfiles for strange activities.</para>
+</listitem>
+<listitem>
+ <para>Keep an eye on the legal users in your network, a lot of networks have been hacked because of users
+ that didn't follow the security concept and installed disallowed software, connect to the internet via modem or WLAN
+ so that your firewall is simply can't see those connections, or the installed software was a virus or hidden backdoor to the system.</para>
+</listitem>
+<listitem>
+ <para>Read books and all kind of documentation about this topic you can find.</para>
+</listitem>
+<listitem>
+ <para>Always remember there is no save host. Except it's offline...</para>
+</listitem>
+</orderedlist>
+</para>
+</sect1>
+
+<sect1 id="iptables-concept">
+<title>IPTables basics</title>
+<para>
+An IPTables based firewall is made of three different basic <quote>objects</quote>.
+<orderedlist>
+<listitem>
+ <para>Rules</para>
+</listitem>
+<listitem>
+ <para>Chains</para>
+</listitem>
+<listitem>
+ <para>Tables</para>
+</listitem>
+</orderedlist>
+</para>
+<para>
+Please read through the next three chapters to get a short description about those
+objects. Note that this is just a briefly introduction to the IPTables. For more detailed documentation have a look at the IPTables
+Manpage or <ulink url="http://www.iptables.org">www.iptables.org</ulink>.
+</para>
+
+
+<sect2 id="rules">
+<title>Rules</title>
+<para>
+The lowest level objects are the <quote>rules</quote> that are performing the packetfiltering or manipulation.
+A rule is made of several parts.
+<orderedlist>
+<listitem>
+ <para>The Table to which this rule should be added. If no table is defined the rule will be added to the <quote>filter</quote> table.</para>
+</listitem>
+<listitem>
+ <para>The Chain to which this rule should be added p.e INPUT or FORWARD</para>
+</listitem>
+<listitem>
+ <para>The filtering or manipulation instructions.</para>
+</listitem>
+<listitem>
+ <para>The target of the rule. This target decides what should be done with the packet if it matches the rule.
+ The most Important targets are <quote>DROP</quote>, which drops the packet without any further action,
+ <quote>ACCEPT</quote>, which will let the packet pass the firewall and the data is sent to the receiver and
+ <quote>LOG</quote> that simply writes some information (src. IP, ports etc.) about the packet that matches to the Syslog.</para>
+</listitem>
+</orderedlist>
+</para>
+</sect2>
+
+<sect2 id="chains">
+<title>Chains</title>
+<para>
+Those rules are organized in <quote>chains</quote> which are simple ordered list of rules.
+There are some built-in chains that are always available for the user like the INPUT or the OUTPUT chain in
+the filter table.
+Built-in chains do also have a so called <quote>Default Target</quote> which decides what to do with a packet that didn't
+match any of the rules defined in that chain.
+</para>
+<para>
+For large configurations it's often required to settup rules for packets that are common in some pieces of their attributes.
+When you setup a firewall that also provides routing functionality you may want to have different kind of rules for packets coming
+from the internal network than for packets coming from the evil Internet.
+</para>
+<para>
+To make it more easy to manage such configurations you have the possibility to create your own chains.
+Those user defined chains don't have a <quote>Default Target</quote>.
+</para>
+<para>
+User defined chains must be fed by rules that have the name of the user defined chain as their target.
+When a packet passes the whole user defined chain without matching any of its rules the packet will
+be sent back to the chain that fed this chain just right after the rule that sent the packet to the user defined chain.
+</para>
+<para>
+The packets will be compared to the rules in the order as they are defined in the chain. This means
+that the packet will no longer be tested if a rule before matched. So please pay attention to the order of the rules
+as a wrong ruleorder may end up in an very hard to find bug in the configuration.
+</para>
+</sect2>
+
+<sect2>
+<title>Tables</title>
+<para>
+Because of the lots of possibilities that IPTables rules give you to filter and/or mainpulate the packets
+that are checked the chains themselves are organized in so called <quote>tables</quote>.
+Each table has it's own set of built-in chains that are available for direct use.
+</para>
+<para>
+There are three tables available <quote>filter</quote>, <quote>nat</quote> and <quote>mangle</quote>.
+<orderedlist>
+<listitem>
+ <para>The <quote>filter</quote> table that is used for packet filtering as we all think about when we are talking about firewalls</para>
+</listitem>
+<listitem>
+ <para>The <quote>nat</quote> table is made for all kind of <quote>Network Address Translation</quote> which is a technology
+ used to change the source and destination attributes of the packet. The well known <quote>IP Masquerading</quote> is the most common way to use this
+ feature.</para>
+</listitem>
+<listitem>
+ <para>The <quote>mangle</quote> table is designed to hold chains and rules that change other attributes of the packets or
+ sending them into the userspace to be processed by any other application. If you are not thinking about really complicated things
+ you shouldn't need to use this table.</para>
+</listitem>
+</orderedlist>
+</para>
+</sect2>
+</sect1>
+</chapter>
+
+
+<chapter id="iptusage">
+<title>IPTables usage</title>
+<para>
+Here is a short reference for the iptables commandline program. I'll try to explain most of the important
+options the iptables command allows. For more details please have a look at <ulink url="man:/usr/share/man/man8/iptables.8.gz">man iptables</ulink>
+</para>
+<para>
+Some (quiet a lot) of the descriptions are copy and paste from the iptables manpage, because the manpage is really good and I just added my own explanations where I thought this should be clearer. I'd like to say thanks to the iptables developers for this fabulous manpage.
+</para>
+
+<sect1 id="tableselection">
+<title>Selecting the Table</title>
+
+<para>
+Each rule you like to add to your firewall needs to be inserted or appended into an existing chain in one of the three tables
+<quote>filter</quote>, <quote>nat</quote> or <quote>mangle</quote>. Which of the tables are available depends on the configuration of your kernel.
+</para>
+
+<para>
+Lets have a look at the following iptables commandline:
+</para>
+
+<para><command>iptables -t filter -A INPUT --source 192.168.0.1 -j DROP</command></para>
+
+<para>
+As you can see the command has several parts to set the behavior of the rule. Lets start with <command>iptables -t &lt;tablename&gt; ...</command>
+The option <quote>-t</quote> tells iptables to add the rule to a chain in the table &lt;tablename&gt;. If no -t option is defined the rule will be inserted
+into the <quote>filter</quote> table which is the default.
+</para>
+
+</sect1>
+
+<sect1 id="append">
+<title>Append, Insert and Delete</title>
+<para><command>iptables -t filter -A INPUT ...</command></para>
+<para>
+The option <quote>-A INPUT</quote> tells the program to add the rule at the end of the<quote> INPUT</quote> chain. There are also the
+options <quote>-I chain [rulenum] </quote> for inserting a rule, <quote>-R chain [rulenum]</quote> for replacing a rule and
+<quote>-D chain rulenum</quote> for deleting a rule from a chain.
+</para>
+<para>&kapp; only uses the -A option in the generated script.</para>
+</sect1>
+
+<sect1 id="options">
+<title>Defining Options</title>
+<para>
+For filtering and manipulation of packets you need to define which properties a packet must have
+to be filtered/manipulated. This is done by passing one or more option names p.e. <quote> --source</quote>
+and the value that should match <quote>192.168.0.1</quote> in that case.
+</para>
+
+<para>
+IPTables define quiet a lot of different options you can check for. Some of them are directly implemented in the iptables
+program like the --source option but there are also some more complex options that need to load the needed modules into the kernel to
+be available. Those options are defined like <command>... --match state --state RELATED,ESTABLISHED ...</command> The <quote>--match state</quote>
+options lets the program look for an available option called <quote>state</quote> which is in this case the connection tracking module.
+</para>
+
+<para>
+The availability of those extended options depends on the configuration of your kernel and the available modules that can be loaded or are directly compiled into the kernel.
+</para>
+<para>
+For a more detailed description of the options that can be used from within this program have a look at the chapter
+<link linkend="rule_manupulation">Packet Filtering and Altering</link>.
+</para>
+
+
+</sect1>
+
+<sect1 id="targets">
+<title>Targets</title>
+
+<para><command>... -j LOG --log-prefix "KMF: "</command></para>
+
+<para>
+The Target of a rule defines what to do if a packet matches the rule. The target is defined by the <command>-j &lt;target&gt; [target-options]</command> option
+at the end of the filtering/manipulation options at the end of the rule. There are two different types of targets terminating and non-terminating.
+If a target is terminating the packet will not be passed to rules after the matching one.
+</para>
+
+<para>A good example for a terminating target is <command>... -j DROP</command>.
+The DROP target that tell the kernel to drop (delete) the matching packet which means that it will not reach it's destination. And it's quiet logical that
+you don't want to check the packet against the other (later in the chain) defined rule as you already know what to do with it.
+</para>
+
+<para>
+For a non-terminating target have a look at the code snip above. The here used LOG target lets the kernel log the packets matching this rule to
+the syslog. It wouldn't be very useful if the packets would stop here therefore the packets continue the way through the kernel.
+</para>
+</sect1>
+</chapter>
+
+<chapter id="rule_manupulation">
+<title>Filtering and Manipulation of Packets</title>
+
+<para>
+Packet filtering and altering is the main task iptables have to perform and they are really good in it. But a highly configurable and flexible packetfilter is nothing trivial so please read this carefully before you start you experiments.
+</para>
+<para>
+This chapter will show you how the different filter modules of the iptables are used in detail. It may look shocking but it's not that hard to understand and once you've got it, it' really easy to settup highly complex rulesets for big network routers or simple personal firewalls.
+Some of these advanced filtering options (connection tracking, mac) need extra modules to be either loaded as module or directly compiled into the kernel. Have a look at the Kernel Compiling HOWTO for details about building a custom kernel.
+</para>
+
+<sect1 id="src_dest_ip">
+<title>Source and destination IP</title>
+
+<para><command>iptables -A INPUT --source 12.168.120.15 -j ACCEPT</command></para>
+
+<para>
+Source specification. Address can be either a network name, a hostname (please note that specifying any name to be resolved with a remote query such as DNS is a really bad idea), a network IP address (with /mask), or a plain IP address. The mask can be either a network mask or a plain number, specifying the number of 1's at the left side of the network mask. Thus, a mask of 24 is equivalent to <command>255.255.255.</command>. A <command>!</command> argument before the address specification inverts the sense of the address. The flag <command>--src</command> is an alias for this option.
+</para>
+
+<para><command>iptables -A INPUT --destination ! 32.112.0.31/24 -j ACCEPT</command></para>
+
+<para>
+Destination specification is similar in usage to the source option.</para>
+
+</sect1>
+
+<sect1 id="protocol">
+<title>Checking for the protocol</title>
+
+<para><command>iptables -A INPUT --protocol tcp -j ACCEPT</command></para>
+<para><command>iptables -A INPUT --protocol ! udp -j LOG</command></para>
+
+<para>
+The protocol of the rule or of the packet to check. The specified protocol can be one of <command>tcp</command>, <command>udp</command>, <command>icmp</command>, or all, or it can be a numeric value, representing one of these protocols or a different one. A protocol name from /etc/protocols is also allowed. A <command>!</command> argument before the protocol inverts the test. The number zero is equivalent to all. Protocol all will match with all protocols and is taken as default when this option is omitted.
+</para>
+
+
+<sect2 id="protocol_tcp">
+<title>TCP specific options</title>
+<para>
+TCP specific are all filter options that have a deeper look into the TCP header of the packet. This includes checking for source-, destination port, real tcp connection tracking, tcp flags etc.
+</para>
+
+<sect3 id="protocol_tcp_ports">
+<title>TCP Source and destination ports</title>
+<para><command>iptables -A INPUT --protocol tcp --source-port 22:12 -j LOG</command></para>
+<para><command>iptables -A POSTROUTING --protocol tcp --destination-port ! 21232 -j DROP</command></para>
+
+<para>
+Source/Destination port or port range specification. This can either be a service name or a port number. An inclusive range can also be specified, using the format <command>port:port</command>. If the first port is omitted, "0" is assumed; if the last is omitted, <command>65535</command> is assumed. If the second port greater then the first they will be swapped. The flag <command>--sport</command> is a convenient alias for this option.
+</para>
+</sect3>
+
+
+<sect3 id="protocol_tcp_flags">
+<title>TCP Flags</title>
+
+<para><command>iptables -A INPUT --protocol tcp --tcp-flags ! SYN,ACK,FIN SYN,ACK -j LOG</command></para>
+<para>
+Match when the TCP flags are as specified. The first argument is the flags which we should examine, written as a comma-separated list, and the second argument is a comma-separated list of flags which must be set. Flags are: <command>SYN ACK FIN RST URG PSH ALL NONE </command>. Hence the command:
+</para>
+
+<para>
+<command>iptables -A FORWARD -p tcp --tcp-option SYN,ACK,FIN,RST SYN -j ACCEPT </command> will only match packets with the SYN flag set, and the ACK, FIN and RST flags unset.
+</para>
+</sect3>
+
+<sect3 id="protocol_tcp_option">
+<title>TCP Options</title>
+
+<para><command>iptables -A INPUT --protocol tcp --tcp-option 0 -j LOG</command></para>
+
+<para>
+Match if the numeric TCP option is set in the tcp header. A <command>!</command> may be used to invert the match option.
+</para>
+</sect3>
+</sect2>
+
+<sect2 id="protocol_UDP">
+<title>UDP specific options</title>
+
+<para>
+UDP is the second big protocol in the internet. The main difference to TCP is that it does not provide a stateful connection to the peer host. In other words UDP packets are anonymous and easy to fake. On the other hand is it extremely fast (no overhead of establishing connections) and therefore it's used by lots of protocols. Most important UDP protocols are <command>DNS</command> (hostname &lt;---&gt; ip address ) and <command>NFS</command> (Standard *NIX filesharing protocol).
+</para>
+
+<sect3 id="protocol_udp_ports">
+<title>UDP Source and destination ports</title>
+<para><command>iptables -A INPUT --protocol udp --source-port 22:12 -j LOG</command></para>
+<para><command>iptables -A POSTROUTING --protocol udp --destination-port ! 21232 -j DROP</command></para>
+
+<para>
+Source/Destination port or port range specification. This can either be a service name or a port number. An inclusive range can also be specified, using the format <command>port:port</command>. If the first port is omitted, "0" is assumed; if the last is omitted, <command>65535</command> is assumed. If the second port greater then the first they will be swapped. The flag <command>--sport</command> is a convenient alias for this option.
+</para>
+</sect3>
+</sect2>
+
+<sect2 id="icmp">
+<title>ICMP</title>
+<para>
+The Internet Control Message Protocol (ICMP) is the control and message protocol for the underlying IP protocol. Often needed messages and commands are defined in this protocol like <quote>host-unreachable</quote> when an ip address was not found,<quote>echo-request</quote> the normal ping and <quote>source-quench</quote> tells the receiver to slow down the traffic -> !!!Denial of Service!!!,
+</para>
+
+<sect3 id="icmp_type">
+<title>ICMP type</title>
+
+<para><command>iptables -A INPUT --protocol icmp --icmp-type echo-request -j LOG</command></para>
+
+<para>
+This allows specification of the ICMP type, which can be a numeric ICMP type, or one of the ICMP type names shown by the command: <command>iptables -p icmp -h </command>.
+</para>
+
+</sect3>
+</sect2>
+
+<sect2 id="multiport">
+<title>Multiport Match Extension</title>
+<para>
+The Multiport match extension allows you to define a comma-separated list of up to 15 ports in an TCP or UDP specific rule. This is mostly useful to save some typing by specifying mor that one port per rule.
+</para>
+
+<sect3 id="source_multiport">
+<title>Source Ports</title>
+
+<para><command>iptables -A INPUT --protocol tcp --match multiport --source-ports 22,21,20,80 -j LOG</command></para>
+
+<para>
+This rule will match all tcp packets that have a source port contained in the given port list.
+</para>
+
+</sect3>
+
+<sect3 id="destination_multiport">
+<title>Destination Ports</title>
+
+<para><command>iptables -A INPUT --protocol udp --match multiport --destination-ports 20,80,10 -j LOG</command></para>
+
+<para>
+This rule will match all udp packets that have a destination port contained in the given port list.
+</para>
+</sect3>
+
+<sect3 id="equal_multiport">
+<title></title>
+
+<para><command>iptables -A INPUT --protocol tcp --match multiport --ports 20,50,1660 -j LOG</command></para>
+
+<para>
+Match if the both the source and destination ports are equal to each other and to one of the given ports.
+</para>
+
+</sect3>
+</sect2>
+</sect1>
+
+<sect1 id="interfaces">
+<title>Incoming and Outgoing Interface</title>
+
+<para><command>iptables -A INPUT --in-interface eth0 -j LOG</command></para>
+
+<para>
+Name of an interface via which a packet is going to be received (only for packets entering the <command>INPUT</command>, <command>FORWARD</command> and <command>PREROUTING</command> chains). When the "!" argument is used before the interface name, the sense is inverted. If the interface name ends in a "+", then any interface which begins with this name will match. If this option is omitted, any interface name will match.
+</para>
+
+<para><command>iptables -A OUTPUT --out-interface ! ippp1 -j DROP</command></para>
+
+<para>
+Name of an interface via which a packet is going to be sent (for packets entering the <command>FORWARD</command>, <command>OUTPUT</command> and <command>POSTROUTING</command> chains). When the "!" argument is used before the interface name, the sense is inverted. If the interface name ends in a "+", then any interface which begins with this name will match. If this option is omitted, any interface name will match.
+</para>
+
+</sect1>
+
+<sect1 id="src_mac">
+<title>Source MAC</title>
+
+<para>
+<command>iptables -A INPUT --match mac --mac-source 12:E4:86:FA:5C:54 -j ACCEPT</command>
+</para>
+
+<para>
+Match source MAC address. It must be of the form XX:XX:XX:XX:XX:XX. Note that this only makes sense for packets coming from an Ethernet device and entering the <command>PREROUTING</command>, <command>FORWARD</command> or <command>INPUT</command> chains.
+</para>
+
+<para>
+This options is very useful for protection against man-in-the-middle attacks, because it is possible to combine it
+ with the <command>--source</command> option and so protection against arp-spoofing may be provided.
+</para>
+
+</sect1>
+
+
+<sect1 id="limit">
+<title>Limit matches</title>
+
+<para>
+This module matches at a limited rate using a token bucket filter. A rule using this extension will match until this limit is reached (unless the `!' flag is used). It can be used in combination with the <command>LOG</command> target to give limited logging, for example.
+</para>
+
+<para><command>iptables -A INPUT --match limit --limit 10/second --limit-burst 5 -j ACCEPT</command></para>
+<para><command>iptables -A INPUT --match limit --limit 2/hour --limit-burst 10 -j LOG</command></para>
+
+</sect1>
+
+<sect1 id="state">
+<title>Statefull Packet Filtering</title>
+
+<para><command>iptables -A INPUT --match state --state RELATED,ESTABLISHED -j ACCEPT</command></para>
+
+<para>
+Where state is a comma separated list of the connection states to match. Possible states are <command>INVALID</command> meaning that the packet is associated with no known connection, <command>ESTABLISHED</command> meaning that the packet is associated with a connection which has seen packets in both directions, <command>NEW</command> meaning that the packet has started a new connection, or otherwise associated with a connection which has not seen packets in both directions, and <command>RELATED</command> meaning that the packet is starting a new connection, but is associated with an existing connection, such as an FTP data transfer, or an ICMP error.
+</para>
+
+</sect1>
+
+<sect1 id="tos">
+<title>TOS - Type of Service</title>
+
+<para>
+This module matches the 8 bits of Type of Service field in the IP header (ie. including the precedence bits).
+</para>
+
+<para><command>iptables -A INPUT --match tos --tos Minimize-Delay -j ACCEPT</command></para>
+
+<para>
+The argument is either a standard name, or a numeric value to match. Run <command>iptables -m tos -h</command>
+to see the list of allowed names).
+</para>
+
+</sect1>
+
+</chapter>
+
+
+<chapter id="using-kapp">
+<title>Using &kapp;</title>
+
+<!-- This chapter should tell the user how to use your app. You should use as
+many sections (Chapter, Sect1, Sect3, etc...) as is necessary to fully document
+your application. -->
+
+<sect1 id="kapp-overview">
+<title>Overview - GUI Interfaces</title>
+<para>&kapp; ships with two different GUI interfaces.</para>
+
+<sect2 id="kapp-interfaces-generic">
+<title>Generic Interface</title>
+
+<para>The Generic Interface is an abstract view on what kind of netwok traffic may or may not pass yout computer. The rules are generated by a compiler plugin so that it is possible to generate scripts for other plattforms p.e. OpenBSD/pf then GNU/Linux/iptables (well currently just the iptables compiler is implemented. Let me know if you are interrested in implementing that :)).</para>
+</sect2>
+
+<sect2 id="kapp-interfaces-ipt">
+<title>IPTables Interface</title>
+
+<para>The IPTables interfaces tries to represent a 1-1 look at the iptables rule set your configuration will create. Therefore it is ment to be used by experienced system administrators in order to setup very fine graduaded rulesets. Becaus of the tight relation this GUI has to the netfilter/iptables framework it can only be used on GNU/Linux workstations as the document can not be compiled into any other rule description language.</para>
+
+</sect2>
+
+
+
+</sect1>
+
+
+<sect1 id="getting-started">
+<title>Getting Started</title>
+<para>
+The easiest way to start is to create a new Document <keycombo><keycap>Ctrl</keycap><keycap>n</keycap></keycombo>
+and use the Wizard to setup the basic rules for your new firewall.
+For a simple <quote>Personal Firewall</quote> the default configuration should be quiet usable as it is designed to
+let everything out of your Box (Table: Filter, Chain: OUTPUT, Target: ACCEPT) and only lets packets is that
+are related with connections you established.
+</para>
+<para>
+This configuration is a good starting point for your firewall if you don't need any kind of routing or packet mangling because
+it deactivates the routing functionality in your kernel and only the filter table is used.
+</para>
+<para>
+The Wizard can not be used to change an existing configuration it's simply made for setting up a basic ruleset that can be
+changed by using the <quote>Rule Editor</quote> and the <quote>Chain Editor</quote>.
+</para>
+<para>
+For more complex rulesets as needed by routes or firewalls that protect a whole network, you need to use the
+<quote>Advanced Interface</quote> to setup the firewall.
+The document generated by the <quote>Advanced Interface</quote> is an empty ruleset! In other words there
+are no rules defined to filter any kind of packets.
+</para>
+</sect1>
+
+
+</chapter>
+<!--
+
+<chapter id="commands">
+<title>Command Reference</title>
+
+<sect1 id="kapp-mainwindow">
+<title>The main KMyFirewall window</title>
+<para></para>
+
+<sect2>
+<title>The File Menu</title>
+<para>
+<variablelist>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo><keycap>Ctrl</keycap><keycap>n</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>New</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Creates a new document</action></para></listitem>
+</varlistentry>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo><keycap>Ctrl</keycap><keycap>s</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Save</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Saves the document</action></para></listitem>
+</varlistentry>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo><keycap>Ctrl</keycap><keycap>q</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Quit</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Quits</action> &kapp;</para></listitem>
+</varlistentry>
+</variablelist>
+</para>
+
+</sect2>
+
+</sect1>
+</chapter>
+
+-->
+
+<chapter id="developers">
+<title>Developer's Guide to &kapp;</title>
+
+<para>
+As you can see this thing gets quiet big so every kind of help (coding,docs,translations)
+is very welcome. Please don't hesitate to contact me <email>chubinger@gmail.com</email>
+if you have some ideas, patches, wishes or whatever.
+</para>
+
+<sect1 id="developers-plugins">
+<title>&kapp; Plugin framework</title>
+<para>
+&kapp; extensively uses KDE's KParts/XMLGUI technology to provide an easy to and robust plugin infrastructure. Allmost every function is performed by dynamicaly loaded plugins in order to make it easy manage the code and write extentions. Especially the IPTables interface uses plugins to embeed the different iptables rule options edit dialogs.
+</para>
+</sect1>
+
+<sect1 id="developers-plugins-ruleoptions">
+<title>Rule- option/targetoptin Plugins (IPTables interface only)</title>
+<para>As the iptables command utility is really fast developing and every few week new options are added, all ruleoption handling is outsourced to small easy to write plugins.</para>
+<para>The underlieing document format is designed flexible enougth to allow the implementaiton of any command option iptables knows (or will know, if i didn't forget anything).</para>
+<para>The rule creation engine can be extend by registering new option/targetoption types defined in small XML files that are parsed at startup. And the editor GUI can embeed the edit widgets needed to configure the ruleoption.</para>
+
+
+<sect2 id="developers-plugins-ruleoptions-parts">
+<title>Parts of an Ruleoption/targetoption Plugin</title>
+<itemizedlist>
+<listitem><para>A XML file named p.e. kmfruleoption_mac_option.xml</para></listitem>
+<listitem><para>A desktop file p.e. kmfruleoptionedit_mac.desktop that registeres the plugin within the KDE services framework.</para></listitem>
+<listitem><para>An KParts Plugin component/class that derives form either KMFRuleOptionEditInterface or KMFRuleTargetOptionEditInterface named p.e. KMFRuleOptionEditMAC </para></listitem>
+<listitem><para>A Class deriving from QWidget that may be loaded into the editor view when editing that option.</para>
+<para>Most likely you'll use QTDesigner to design the GUI. If you do this you need to inherit from the generated class.</para></listitem>
+</itemizedlist>
+</sect2>
+
+<sect2 id="developers-plugins-ruleoptions-parts-xmlruledefinition">
+<title>XML File describing the rule option</title>
+<para>The xml file gets loaded during application startup and registers the specified rule option in the engine. Have a look at some of the other XML files installed in $KDE-PREFIX/share/apps/kmyfirewall/ruleoptions for some more example of how to define the needed options.</para>
+<programlisting>
+
+&lt;!DOCTYPE kmyfirewall-kmfruleoptiondefinition&gt;
+&lt;ruleoptiondefinitionset&gt;
+&lt;ruleoptiondefinition name="mac_opt" guiName="MAC Address"&gt;
+ &lt;option guiName="" command="--match mac" /&gt;
+ &lt;option guiName="MAC:" command="--mac-source" /&gt;
+&lt;/ruleoptiondefinition&gt;
+&lt;/ruleoptiondefinitionset&gt;
+
+</programlisting>
+</sect2>
+
+<sect2 id="developers-plugins-ruleoptions-parts-desktopfile">
+<title>The .desktop file</title>
+<para>This file is installed into the services directory and makes the plugin available for the KDE plugin framework</para>
+<para>The important thing here is that you set Type=Service and the right SeviceType. The application only searches for plugins with SeviceType=KMyFirewall/RuleOptionEdit or SeviceType=KMyFirewall/RuleTargetOptionEdit.</para>
+<para>The line X-KDE-Library=libkmfruleoptionedit_mac lets the KDE plugin framework know which library defines the functionality.</para>
+
+<programlisting>
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Name=KMyFirewall MAC option edit
+Name[da]=KMyFirewall MAC redigeringstilvalg
+Comment=Plugin for edition MAC address based iptables rule options
+Comment[da]=Plugin ril at redigere MAC adressebaserede regeltilvalg for iptables
+X-KDE-Library=libkmfruleoptionedit_mac
+ServiceTypes=KMyFirewall/RuleOptionEdit
+</programlisting>
+</sect2>
+
+<sect2 id="developers-plugins-ruleoptions-parts-makefileam">
+<title>The Makefile.am</title>
+<para>Make shure that you add the option -module $(KDE_PLUGIN) to the &lt;library_name&gt;_LDFLAGS. Otherwise the plugin can not be loaded at runtime.</para>
+<programlisting>
+INCLUDES = -I../kmfwidgets -I../../ipteditor -I$(srcdir)/../interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruleoptionedit_mac.la
+
+libkmfruleoptionedit_mac_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+libkmfruleoptionedit_mac_la_LIBADD = ../../core/libkmfcore.la ../../interfaces/libkmfinterfaces.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruleoptioneditmac.h kmfruleeditmac.h
+
+libkmfruleoptionedit_mac_la_SOURCES = kmfruleoptioneditmac.cpp kmfruleeditmac.cpp kmyfirewallruleeditormac.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruleoptionedit_mac.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_mac_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_mac_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_mac_option.xml
+
+</programlisting>
+</sect2>
+
+<sect2 id="developers-plugins-ruleoptions-parts-kpartclass">
+<title>KParts Plugin component/class</title>
+<para>This class defines the plugin that will be loaded at application startup.</para>
+<para>kmfruleoptioneditmac.h</para>
+<programlisting>
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+// Author: Christian Hubinger &lt;chubinger@gmail.com&gt;, (C) 2004
+#ifndef KMFRULEOPTIONEDITMAC_H
+#define KMFRULEOPTIONEDITMAC_H
+
+#include "../../interfaces/kmfruleoptioneditinterface.h"
+
+// KDE includes
+#include &lt;kparts/part.h&gt;
+#include &lt;kparts/plugin.h&gt;
+#include &lt;kparts/factory.h&gt;
+#include &lt;kxmlgui.h&gt;
+
+#include &lt;qstring.h&gt;
+#include &lt;qptrlist.h&gt;
+
+class IPTRule;
+class KMFRuleEditMac;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleOptionEditMAC : public KMFRuleOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditMAC(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleOptionEditMAC();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString&amp; optionEditName() const;
+ const QString&amp; description() const;
+
+private slots:
+ void slotAddRuleOption(QString*, QPtrList&lt; QString &gt;* );
+ void slotAddTargetOption(QString*, QPtrList&lt; QString &gt;* );
+ void slotShowOverview();
+
+private:
+ KMFRuleEditMac *m_edit;
+ IPTRule *m_rule;
+
+};
+
+class KInstance;
+
+class KMFRuleOptionEditMACFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditMACFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleOptionEditMACFactory() {
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &amp;args = QStringList() );
+
+};
+
+</programlisting>
+
+<para>kmfruleoptioneditmac.cpp</para>
+<programlisting>
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "kmfruleoptioneditmac.h"
+
+// QT includes
+#include &lt;qstring.h&gt;
+
+// KDE includes
+#include &lt;kdebug.h&gt;
+#include &lt;klocale.h&gt;
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../interfaces/kmfruleeditinterface.h"
+#include "kmfruleeditmac.h"
+
+// Constructor get out plugin into a valid state
+KMFRuleOptionEditMAC::KMFRuleOptionEditMAC(QObject *parent, const char *name)
+ : KMFRuleOptionEditInterface(parent, name) {
+
+ // Initialise the editor class
+ m_edit = new KMFRuleEditMac( 0 , "Edit", 0 );
+ // hide it for now
+ m_edit->hide();
+
+ // Connect the Signals for the editor class to our slots passing them to the app
+ connect( m_edit,SIGNAL(sigAddRuleOpt(QString*, QPtrList&lt; QString &gt;* ) ),
+ this,SLOT( slotAddRuleOption(QString*, QPtrList&lt; QString &gt;* ) ) );
+ //
+ //connect( m_edit,SIGNAL(sigAddTargetOpt(QString*, QPtrList&lt; QString &gt;* ) ),
+ // this,SLOT( slotAddTargetOption(QString*, QPtrList&lt; QString &gt;* ) ) );
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+
+KMFRuleOptionEditMAC::~KMFRuleOptionEditMAC() {}
+
+// Slot to pass the Signals to the app
+void KMFRuleOptionEditMAC::slotAddRuleOption(QString* name, QPtrList&lt; QString &gt;* values ) {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast&lt;KMFRuleEditInterface*&gt; ( parent() ) ) {
+ ruleedit->addRuleOption( name, values );
+ } else {
+ kdDebug() &lt;&lt; "KMFRuleOptionEditMAC::slotAddRuleOption(): parent() not of type KMFRuleEditInterface" &lt;&lt; endl;
+ }
+}
+void KMFRuleOptionEditMAC::slotAddTargetOption(QString* name, QPtrList&lt; QString &gt;* values ) {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast&lt;KMFRuleEditInterface*&gt; ( parent() ) ) {
+ ruleedit->addRuleTargetOption( name, values );
+ } else {
+ kdDebug() &lt;&lt; "KMFRuleOptionEditMAC::slotAddTargetOption(): parent() not of type KMFRuleEditInterface" &lt;&lt; endl;
+ }
+}
+
+// Make the editor hide the plugin widget
+void KMFRuleOptionEditMAC::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast&lt;KMFRuleEditInterface*&gt; ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() &lt;&lt; "KMFRuleOptionEditMAC::slotShowOverview(): parent() not of type KMFRuleEditInterface" &lt;&lt; endl;
+ }
+}
+
+
+// Get info for GUI about the plugin
+const QString&amp; KMFRuleOptionEditMAC::optionEditName() const {
+ return *( new QString( i18n("MAC Option") ) );
+}
+const QString&amp; KMFRuleOptionEditMAC::description() const {
+ return *( new QString( i18n("This plugin manages the MAC address based options of iptables.") ) );
+}
+
+// We must implement this as it is called from the underliening rule editor
+void KMFRuleOptionEditMAC::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() &lt;&lt; "KMFRuleOptionEditMAC::loadRule( IPTRule* rule ) - rule == 0" &lt;&lt;endl;
+ return;
+ }
+ m_edit->loadRule( rule );
+ m_rule = rule;
+}
+
+// return a pointer to our editor widget
+QWidget* KMFRuleOptionEditMAC::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() &lt;&lt; "KMFRuleOptionEditMAC::editWidget() - m_edit == 0" &lt;&lt; endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include &lt;kaboutdata.h&gt;
+#include &lt;klocale.h&gt;
+
+// KInstance* KMFRuleOptionEditMACFactory::s_instance = 0L;
+// KAboutData* KMFRuleOptionEditMACFactory::s_about = 0L;
+
+KMFRuleOptionEditMACFactory::KMFRuleOptionEditMACFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+}
+
+QObject* KMFRuleOptionEditMACFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList &amp; ) {
+ QObject * obj = new KMFRuleOptionEditMAC( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+extern "C" {
+ void* init_libkmfruleoptionedit_mac() {
+ return new KMFRuleOptionEditMACFactory;
+ }
+}
+#include "kmfruleoptioneditmac.moc"
+</programlisting>
+</sect2>
+
+<sect2 id="developers-plugins-ruleoptions-parts-editwidget">
+<title>The editor widget class</title>
+<para>This class defines a widget that can configure the specific rule option.</para>
+
+<para>kmfruleeditmac.h</para>
+
+<programlisting>
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger &lt;chubinger@gmail.com&gt;, (C) 2001-2004
+*/
+
+
+#ifndef KMFRULEEDITMAC_H
+#define KMFRULEEDITMAC_H
+
+#include "kmyfirewallruleeditormac.h"
+
+#include &lt;qvariant.h&gt;
+#include &lt;qdialog.h&gt;
+#include &lt;qptrlist.h&gt;
+
+class IPTRule;
+class KMFErrorHandler;
+class KMFCheckInput;
+class KMFError;
+
+class KMFRuleEditMac : public KMyFirewallRuleEditorMac {
+ Q_OBJECT
+
+public:
+ KMFRuleEditMac( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFRuleEditMac();
+
+ void loadRule( IPTRule* );
+
+public slots:
+ void accept();
+ void slotHelp();
+ void reject();
+
+protected:
+ bool event( QEvent* );
+
+private:
+ KMFCheckInput *m_check_input;
+ KMFErrorHandler *m_err_handler;
+ KMFError *m_err;
+ IPTRule* m_rule;
+
+signals:
+ void sigAddRuleOpt( QString*, QPtrList&lt;QString&gt;* );
+ void sigHideMe();
+};
+
+#endif // KMFRULEEDITMAC_H
+
+</programlisting>
+
+<para>kmfruleeditmac.cpp</para>
+
+<programlisting>
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger &lt;chubinger@gmail.com&gt;, (C) 2001-2004
+*/
+
+#include "kmfruleeditmac.h"
+
+#include &lt;qcheckbox.h&gt;
+#include &lt;qframe.h&gt;
+#include &lt;qlabel.h&gt;
+#include &lt;qlineedit.h&gt;
+#include &lt;qpushbutton.h&gt;
+#include &lt;qlayout.h&gt;
+#include &lt;qvariant.h&gt;
+#include &lt;qtooltip.h&gt;
+#include &lt;qwhatsthis.h&gt;
+
+#include &lt;kdebug.h&gt;
+#include &lt;kmessagebox.h&gt;
+#include &lt;klocale.h&gt;
+#include &lt;kapplication.h&gt;
+
+// project includes
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfcheckinput.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmferrorhandler.h"
+
+/*
+ * Constructs a KMFRuleEditMac which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+KMFRuleEditMac::KMFRuleEditMac( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallRuleEditorMac( parent, name, fl ) {
+ m_err_handler = new KMFErrorHandler( "KMFRuleEditMac" );
+ m_check_input = new KMFCheckInput();
+ m_err = new KMFError();
+
+
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+KMFRuleEditMac::~KMFRuleEditMac() {
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * Main event handler. Reimplemented to handle application
+ * font changes
+ */
+bool KMFRuleEditMac::event( QEvent* ev ) {
+ bool ret = QWidget::event( ev );
+ if ( ev->type() == QEvent::ApplicationFontChange ) {}
+ return ret;
+}
+
+void KMFRuleEditMac::loadRule( IPTRule * rule ) {
+ kdDebug() &lt;&lt; "void KMFRuleEditMac::loadRule( IPTRule * rule )" &lt;&lt; endl,
+ c_src_mac->setChecked( false );
+ c_inv_src_mac->setChecked( false );
+ t_src_mac1 ->clear();
+ t_src_mac2 ->clear();
+ t_src_mac3 ->clear();
+ t_src_mac4 ->clear();
+ t_src_mac5 ->clear();
+ t_src_mac6 ->clear();
+ m_rule = rule;
+ QString line = "";
+
+ IPTRuleOption* opt = 0;
+ opt = m_rule->getOptionForName("mac_opt");
+ if ( opt ) {
+ QStringList args = opt->getValues();
+ QString src, dest;
+ line = *args.at(1);
+ if ( line.isEmpty() || line == "UNDEFINED" )
+ return;
+ if ( line.startsWith( "! " ) ) {
+ line = line.right( line.length() - 2 );
+ c_inv_src_mac->setChecked( true );
+ }
+ int num = 1;
+ QString part = "";
+ c_src_mac->setChecked( true );
+ while ( !line.isEmpty() ) {
+ int pos = -1;
+ pos = line.find( ":" );
+ if ( pos &lt; 0 ) {
+ part = line;
+ line = "";
+ } else {
+ part = line.left( pos );
+ line = line.right( line.length() - ( pos + 1 ) );
+ }
+ switch ( num ) {
+ case 1:
+ t_src_mac1 -> setText( part );
+ break;
+ case 2:
+ t_src_mac2 -> setText( part );
+ break;
+ case 3:
+ t_src_mac3 -> setText( part );
+ break;
+ case 4:
+ t_src_mac4 -> setText( part );
+ break;
+ case 5:
+ t_src_mac5 -> setText( part );
+ break;
+ case 6:
+ t_src_mac6 -> setText( part );
+ break;
+ }
+ num++;
+ }
+ }
+}
+
+
+void KMFRuleEditMac::accept() {
+ kdDebug() &lt;&lt; "KMFRuleEditMac::accept()" &lt;&lt; endl;
+ m_rule->chain()->table()->kmfDoc()->startTransaction();
+ m_rule->saveState();
+ QString tok1 = t_src_mac1->text().upper();
+ QString tok2 = t_src_mac2->text().upper();
+ QString tok3 = t_src_mac3->text().upper();
+ QString tok4 = t_src_mac4->text().upper();
+ QString tok5 = t_src_mac5->text().upper();
+ QString tok6 = t_src_mac6->text().upper();
+
+ if ( c_src_mac->isChecked() &amp;&amp; ( tok1.isEmpty() || tok2.isEmpty() || tok3.isEmpty() || tok4.isEmpty() || tok5.isEmpty() || tok6.isEmpty() ) ) {
+ const QString &amp; msg = i18n( "One ore more of the fields are empty. Please fill out all fields to define a valid MAC address." );
+ KMessageBox::error( this, msg );
+ m_rule->chain()->table()->kmfDoc()->endTransaction();
+ return ;
+ }
+
+ QString mac = "";
+
+ if ( c_src_mac->isChecked() ) {
+ mac = tok1 + ":" + tok2 + ":" + tok3 + ":" + tok4 + ":" + tok5 + ":" + tok6;
+ m_check_input->checkInput( mac, "MAC", m_err );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ m_rule->chain()->table()->kmfDoc()->endTransaction();
+ return ;
+ }
+ }
+
+ QPtrList&lt;QString>* values = new QPtrList&lt;QString&gt;;
+ QString* op = new QString( "mac_opt" );
+ if ( c_src_mac->isChecked() &amp;&amp; !mac.isEmpty() ) {
+ kdDebug() &lt;&lt; "Add new mac option" &lt;&lt; endl;
+ QString* src_mac = new QString( mac );
+ if ( c_inv_src_mac->isChecked() ) {
+ src_mac->prepend( "! " );
+ }
+ values->append( new QString( "bool:on" ) );
+ values->append( src_mac );
+ }
+ emit sigAddRuleOpt( op, values );
+ m_rule->chain()->table()->kmfDoc()->endTransaction();
+ emit sigHideMe();
+}
+
+void KMFRuleEditMac::slotHelp() {
+ kdDebug() &lt;&lt; "void KMFRuleEditMac::slotHelp()" &lt;&lt; endl;
+ kapp->invokeHelp( "src_mac" );
+}
+void KMFRuleEditMac::reject() {
+ kdDebug() &lt;&lt; "void KMFRuleEditMac::reject()" &lt;&lt; endl;
+ emit sigHideMe();
+}
+#include "kmfruleeditmac.moc"
+
+</programlisting>
+</sect2>
+</sect1>
+
+<!-- Use refentries to describe APIs. Refentries are fairly complicated and you
+should consult the docbook reference for further details. The example below was
+taken from that reference and shortened a bit for readability. -->
+
+</chapter>
+
+<!-- <chapter id="faq">
+<title>Questions and Answers</title> -->
+
+<!-- (OPTIONAL but recommended) This chapter should include all of the silly
+(and not-so-silly) newbie questions that fill up your mailbox. This chapter
+should be reserved for BRIEF questions and answers! If one question uses more
+than a page or so then it should probably be part of the
+"Using this Application" chapter instead. You should use links to
+cross-reference questions to the parts of your documentation that answer them.
+This is also a great place to provide pointers to other FAQ's if your users
+must do some complicated configuration on other programs in order for your
+application work. -->
+<!--
+&reporting.bugs;
+&updating.documentation;
+
+<qandaset id="faqlist">
+<qandaentry>
+<question>
+<para>My Mouse doesn't work. How do I quit &kapp;?</para>
+</question>
+<answer>
+<para>You silly goose! Check out the <link linkend="commands">Commands
+Section</link> for the answer.</para>
+</answer>
+</qandaentry>
+<qandaentry>
+<question>
+<para>Why can't I twiddle my documents?</para>
+</question>
+<answer>
+<para>You can only twiddle your documents if you have the foobar.lib
+installed.</para>
+</answer>
+</qandaentry>
+</qandaset>
+</chapter>
+-->
+<chapter id="credits">
+
+<!-- Include credits for the programmers, documentation writers, and
+contributors here. The license for your software should then be included below
+the credits with a reference to the appropriate license file included in the KDE
+distribution. -->
+
+<title>Credits and License</title>
+<para>
+Program and Documentation copyright 2002 Christian Hubinger <email>chubinger@gmail.com</email>
+</para>
+
+<!-- TRANS:CREDIT_FOR_TRANSLATORS -->
+
+&underFDL; <!-- FDL: do not remove. Commercial development should -->
+&underGPL; <!-- GPL License -->
+
+</chapter>
+
+<appendix id="installation">
+<title>Installation</title>
+
+<sect1 id="getting-kmyfirewall">
+<title>How to obtain KMyFirewall</title>
+
+<para>
+&kmyfirewall; has it's on homepage at
+<ulink url="http://kmyfirewall.sourceforge.net">http://kmyfirewall.sourceforge.net</ulink>.
+You may find a downloadlink and some more information about it there.
+</para>
+
+</sect1>
+
+<sect1 id="requirements">
+<title>Requirements</title>
+
+<!--
+List any special requirements for your application here. This should include:
+.Libraries or other software that is not included in kdesupport,
+kdelibs, or kdebase.
+.Hardware requirements like amount of RAM, disk space, graphics card
+capabilities, screen resolution, special expansion cards, etc.
+.Operating systems the app will run on. If your app is designed only for a
+specific OS, (you wrote a graphical LILO configurator for example) put this
+information here.
+-->
+
+<para>
+To run KMyFirewall you need to have at least KDE3 and iptables installed.
+So you can only use KMyFirewall on Linux systems.
+</para>
+
+<itemizedlist>
+<listitem><para>iptables >= 1.2.x</para></listitem>
+<listitem><para>linux >= 2.4.x (versions &gt; 2.4.17 are recommended)</para></listitem>
+<listitem><para>KDE >= 3.x</para></listitem>
+</itemizedlist>
+
+<para>
+&kmyfirewall; itself can be found
+on <ulink url="http://kmyfirewall.sourceforge.net">The &kmyfirewall; home page</ulink>.
+</para>
+
+<para>
+There you'll also find a list of important changes and know bugs. </para>
+</sect1>
+
+<sect1 id="compilation">
+<title>Compilation and Installation</title>
+
+<para>
+In order to compile and install &kmyfirewall; on your system, type the following in the base
+directory of the extracted tarball:
+<screen width="40">
+<prompt>%</prompt><userinput>./configure --prefix=/kde-install-path/ --with-qt-dir=/qt-install-path/</userinput>
+<prompt>%</prompt><userinput>make</userinput>
+<prompt>%</prompt><userinput>(as root) make install</userinput>
+</screen>
+</para>
+
+<para>Since &kmyfirewall; uses autoconf and automake you should not have trouble compiling it.
+Should you run into problems please report them to the author.</para>
+
+</sect1>
+
+<!--
+<sect1 id="configuration">
+<title>Configuration</title>
+
+<para>
+
+</para>
+
+</sect1>
+-->
+
+</appendix>
+
+&documentation.index;
+</book>
+
+<!--
+Local Variables:
+mode: sgml
+sgml-minimize-attributes:nil
+sgml-general-insert-case:lower
+sgml-indent-step:0
+sgml-indent-data:nil
+End:
+-->
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/fedora_configuration b/fedora_configuration
new file mode 100755
index 0000000..9bf0c94
--- /dev/null
+++ b/fedora_configuration
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+export kde_confdir="/etc/kde"
+export kde_prefix="/usr"
+export kde_bindir="$kde_prefix/bin"
+export kde_includedir="$kde_prefix/include/kde"
+export kde_libdir="$kde_prefix/lib"
+export kde_cgidir="$kde_prefix/lib/cgi-bin"
+export kde_moduledir="$kde_prefix/lib/kde3"
+export kde_appsdir="$kde_prefix/share/applnk"
+export kde_datadir="$kde_prefix/share/apps"
+export kde_htmldir="$kde_prefix/share/doc/HTML"
+export kde_icondir="$kde_prefix/share/icons"
+export kde_locale="$kde_prefix/share/locale"
+export kde_mimedir="$kde_prefix/share/mimelnk"
+export kde_servicesdir="$kde_prefix/share/services"
+export kde_servicetypesdir="$kde_prefix/share/servicetypes"
+export kde_sounddir="$kde_prefix/share/sounds"
+export kde_templatesdir="$kde_prefix/share/templates"
+export kde_wallpaperdir="$kde_prefix/share/wallpapers"
+
+export mandir="$kde_prefix/share/man"
+export infodir="$kde_prefix/share/info"
+export sysconfdir="/etc"
+
+export QTDIR="/usr/share/qt"
+export IDL="$kde_bindir/cuteidl"
+export DCOPIDL="$kde_bindir/dcopidl"
+export DCOPIDL2CPP="$kde_bindir/dcopidl2cpp"
+export KDB2HTML="$kde_bindir/kdb2html"
+export MCOPIDL="$kde_bindir/mcopidl"
+export ARTSCCONFIG="$kde_bindir/artsc-config"
+
+
+./configure --prefix=/usr --enable-debug=yes --with-qt-dir=/usr/lib/qt-3.3
diff --git a/kmyfirewall.kdevelop b/kmyfirewall.kdevelop
new file mode 100644
index 0000000..696a0c9
--- /dev/null
+++ b/kmyfirewall.kdevelop
@@ -0,0 +1,271 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Christian Hubinger</author>
+ <email>chubinger@irrsinnig.org</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <ignoreparts/>
+ <versioncontrol>kdevsubversion</versioncontrol>
+ <projectname>kmyfirewall</projectname>
+ <defaultencoding/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <showvcsfields>true</showvcsfields>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <configGdbScript/>
+ <runShellScript/>
+ <runGdbScript/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <raiseGDBOnStart>false</raiseGDBOnStart>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevautoproject>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>true</abortonerror>
+ <numberofjobs>3</numberofjobs>
+ <dontact>false</dontact>
+ <makebin>unsermake</makebin>
+ <prio>0</prio>
+ <runmultiplejobs>true</runmultiplejobs>
+ </make>
+ <run>
+ <directoryradio>executable</directoryradio>
+ <runarguments>
+ <kmfsystray/>
+ <kmfiptinterface/>
+ </runarguments>
+ <customdirectory>/</customdirectory>
+ <mainprogram/>
+ <programargs/>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ <globaldebugarguments/>
+ <globalcwd>/home/animal/devel/KDE-SVN/kmyfirewall</globalcwd>
+ <useglobalprogram>true</useglobalprogram>
+ <autoinstall>false</autoinstall>
+ <autokdesu>false</autokdesu>
+ </run>
+ <general>
+ <useconfiguration>default</useconfiguration>
+ <activetarget>kmyfirewall/core/libkmfcore.la</activetarget>
+ </general>
+ <configurations>
+ <default>
+ <envvars/>
+ <configargs>--prefi=/usr --enable-debug=full</configargs>
+ <builddir>/home/animal/devel/KDE-SVN/kmyfirewall</builddir>
+ <topsourcedir>/home/animal/devel/KDE-SVN/kmyfirewall</topsourcedir>
+ <cppflags/>
+ <ldflags/>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevpgf77options</f77compiler>
+ <ccompilerbinary/>
+ <cxxcompilerbinary/>
+ <f77compilerbinary/>
+ <cflags/>
+ <cxxflags>-Wall</cxxflags>
+ <f77flags/>
+ </default>
+ <sdfgs>
+ <envvars/>
+ <configargs/>
+ <builddir>sdfgs</builddir>
+ <topsourcedir/>
+ <cppflags/>
+ <ldflags/>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevpgf77options</f77compiler>
+ <ccompilerbinary/>
+ <cxxcompilerbinary/>
+ <f77compilerbinary/>
+ <cflags/>
+ <cxxflags/>
+ <f77flags/>
+ </sdfgs>
+ </configurations>
+ <subclassing>
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallsystemsettingslinux.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfsystemsettingslinux.cpp" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallsystemsettingslinux.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfsystemsettingslinux.h" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallselectactivetarget.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfselectactivetarget.cpp" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallselectactivetarget.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfselectactivetarget.h" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewalltransactionlog.ui" sourcefile="/kmyfirewall/kmfwidgets/kmftransactionlog.cpp" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewalltransactionlog.ui" sourcefile="/kmyfirewall/kmfwidgets/kmftransactionlog.h" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallipv4adddresswidget.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfipv4addresswidget.cpp" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallipv4adddresswidget.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfipv4addresswidget.h" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallnethostproperties.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.cpp" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallnethostproperties.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.h" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallprotocolpropertieswidget.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.cpp" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallprotocolpropertieswidget.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.h" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallprotocollistview.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfprotocollistview.cpp" />
+ <subclass uifile="/kmyfirewall/kmfwidgets/kmyfirewallprotocollistview.ui" sourcefile="/kmyfirewall/kmfwidgets/kmfprotocollistview.h" />
+ </subclassing>
+ </kdevautoproject>
+ <kdevcppsupport>
+ <references/>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
+ <completionBoxItemOrder>0</completionBoxItemOrder>
+ <howEvaluationContextMenu>true</howEvaluationContextMenu>
+ <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
+ <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
+ <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
+ <processPrimaryTypes>true</processPrimaryTypes>
+ <processFunctionArguments>false</processFunctionArguments>
+ <preProcessAllHeaders>false</preProcessAllHeaders>
+ <parseMissingHeaders>false</parseMissingHeaders>
+ <resolveIncludePaths>true</resolveIncludePaths>
+ <alwaysParseInBackground>true</alwaysParseInBackground>
+ <usePermanentCaching>true</usePermanentCaching>
+ <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
+ <includePaths>.;</includePaths>
+ <parseMissingHeadersExperimental>false</parseMissingHeadersExperimental>
+ <resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
+ </codecompletion>
+ <creategettersetter>
+ <prefixGet/>
+ <prefixSet>set</prefixSet>
+ <prefixVariable>m_,_</prefixVariable>
+ <parameterName>theValue</parameterName>
+ <inlineGet>true</inlineGet>
+ <inlineSet>true</inlineSet>
+ </creategettersetter>
+ <qt>
+ <used>false</used>
+ <version>3</version>
+ <root>/usr/share/qt3</root>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ <qmake>/usr/bin/qmake-qt3</qmake>
+ <designer>/usr/bin/designer-qt3</designer>
+ <designerpluginpaths/>
+ </qt>
+ <splitheadersource>
+ <enabled>false</enabled>
+ <synchronize>true</synchronize>
+ <orientation>Vertical</orientation>
+ </splitheadersource>
+ </kdevcppsupport>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevvisualadvance>
+ <emulator>VisualBoyAdvance</emulator>
+ <binary/>
+ <addOptions/>
+ <terminal>false</terminal>
+ <fullscreen>false</fullscreen>
+ <graphicFilter>-f0</graphicFilter>
+ <scaling>-1</scaling>
+ </kdevvisualadvance>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem/>
+ <docurl/>
+ <usermanualurl/>
+ </projectdoc>
+ </kdevdocumentation>
+ <ctagspart>
+ <customArguments/>
+ <customTagfilePath/>
+ </ctagspart>
+</kdevelop>
diff --git a/kmyfirewall.lsm b/kmyfirewall.lsm
new file mode 100644
index 0000000..510c9f8
--- /dev/null
+++ b/kmyfirewall.lsm
@@ -0,0 +1,14 @@
+Begin3
+Title: KMyFirewall
+Version: 1.0
+Entered-date:
+Description: iptables configuration tool
+Keywords: iptables, firewall, KDE
+Author: Christian Hubinger <chubinegr@gmail.com>
+Maintained-by: Christian Hubinger <chubinegr@gmail.com>
+Primary-site:
+Home-page: http://kmyfirewall.sourceforge.net
+Original-site
+Platforms: Linux
+Copying-policy: GNU Public License
+End
diff --git a/kmyfirewall/Makefile.am b/kmyfirewall/Makefile.am
new file mode 100644
index 0000000..88e2cd6
--- /dev/null
+++ b/kmyfirewall/Makefile.am
@@ -0,0 +1,42 @@
+SUBDIRS = core kmfwidgets installer ipteditor compilers genericinterface \
+ ruleoptionplugins
+
+# set the include path for X, qt and KDE
+INCLUDES = -I$(srcdir)/core -I$(srcdir)/ipteditor -I./ipteditor -I$(srcdir)/genericinterface -Ikmfwidgets $(all_includes)
+
+METASOURCES = AUTO
+
+#########################################################################
+# APPLICATION SECTION
+#########################################################################
+bin_PROGRAMS = kmyfirewall
+kmyfirewall_SOURCES = kmfconfigdialog.cpp kmyfirewall.cpp main.cpp
+kmyfirewall_LDFLAGS = -no-undefined $(KDE_RPATH) $(all_libraries)
+kmyfirewall_LDADD = kmfwidgets/libkmfwidgets.la \
+ core/libkmfcore.la $(LIB_KPARTS)
+
+
+# this is where the desktop file will go
+xdg_apps_DATA = kmyfirewall.desktop
+
+# this is where the shell's XML-GUI resource file goes
+shellrcdir = $(kde_datadir)/kmyfirewall
+shellrc_DATA = kmyfirewallui.rc
+
+mimedir = $(kde_mimedir)/application
+mime_DATA = kmfrs.desktop kmfgrs.desktop kmfnet.desktop kmfpkg.desktop
+
+kde_conf_DATA = kmyfirewallrc
+
+
+
+EXTRA_DIST = main.cpp kmyfirewall.cpp kmyfirewall.h kmyfirewalldoc.cpp kmyfirewalldoc.h kmyfirewallui.rc kmyfirewall.desktop lo32-app-kmyfirewall.png lo16-app-kmyfirewall.png firewall_uninstall.png kmfchainedit.cpp kmfchainedit.h kmfconfig.cpp kmfconfig.h kmfnewchaindlg.cpp kmfnewchaindlg.h kmyfirewallconfigdialog.ui kmyfirewallnewdocument.ui kmyfirewallrc kmfconfignewhost.cpp kmfconfignewhost.h kmyfirewallconfignewhost.ui kmfchecklistoutput.cpp kmfchecklistoutput.h kmferrorhandler.cpp kmferrorhandler.h kmfinstall.sh
+
+
+messages: rc.cpp
+ LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
+ if test -n "$$LIST"; then \
+ $(XGETTEXT) $$LIST -o $(podir)/kmyfirewall.pot; \
+ fi
+
+noinst_HEADERS = kmyfirewall.h version.h
diff --git a/kmyfirewall/compilers/Makefile.am b/kmyfirewall/compilers/Makefile.am
new file mode 100644
index 0000000..40f6cba
--- /dev/null
+++ b/kmyfirewall/compilers/Makefile.am
@@ -0,0 +1,6 @@
+SUBDIRS = iptables
+# SUBDIRS = iptables pf
+
+partdesktopdir = $(kde_servicetypesdir)
+partdesktop_DATA = kmfcompilerplugin.desktop
+
diff --git a/kmyfirewall/compilers/iptables/Makefile.am b/kmyfirewall/compilers/iptables/Makefile.am
new file mode 100644
index 0000000..b0e864d
--- /dev/null
+++ b/kmyfirewall/compilers/iptables/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = $(all_includes) -I../../core -I../../kmfwidgets -I../../libkmfplugins
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfcompiler_ipt.la
+libkmfcompiler_ipt_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) \
+ $(all_libraries)
+libkmfcompiler_ipt_la_SOURCES = kmfiptablescompiler.cpp kmfiptablesscriptgenerator.cpp kmfiptablesdocumentconverter.cpp
+libkmfcompiler_ipt_la_LIBADD = \
+ $(LIB_KPARTS) ../../kmfwidgets/libkmfwidgets.la ../../core/libkmfcore.la
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfcompiler_ipt.desktop
+
+pluginsdir = $(kde_datadir)/kmyfirewall/kpartplugins
+plugins_DATA = kmfiptablescompiler.rc
+noinst_HEADERS = kmfiptablesscriptgenerator.h kmfiptablesdocumentconverter.h
diff --git a/kmyfirewall/compilers/iptables/kmfcompiler_ipt.desktop b/kmyfirewall/compilers/iptables/kmfcompiler_ipt.desktop
new file mode 100644
index 0000000..98c8b29
--- /dev/null
+++ b/kmyfirewall/compilers/iptables/kmfcompiler_ipt.desktop
@@ -0,0 +1,65 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Comment=Plugin for compiling to an iptables scriptfile
+Comment[bg]=Приставка, служеща за компилиране на скриптов файл на iptables
+Comment[ca]=Connector de compilació per a un fitxer script de iptables
+Comment[cs]=Modul pro kompilaci do skriptovacího souboru iptables
+Comment[da]=Plugin til at kompilere en iptables scriptfil
+Comment[de]=Modul zum Kompilieren einer iptables-Skriptdatei
+Comment[el]=Πρόσθετο μεταγλώττισης σε ένα αρχείο σεναρίου iptables
+Comment[es]=Un complemento para compilar un fichero script de iptables
+Comment[et]=Plugin IPTablesi skriptifaili kompileerimiseks
+Comment[fr]=Module pour la génération d'un fichier script iptables
+Comment[gl]=Extensión para compilar un guión de iptables
+Comment[hi]=एक आईपी-टेबल्स स्क्रिप्ट-फाइल में कम्पाइल करने हेतु प्लगइन
+Comment[it]=Plugin per compilare un file script di iptables
+Comment[ka]=iptables-ის სკრიპტის ფაილის შემსები მოდული
+Comment[lt]=Priedas, skirtas IPTables scenarijaus failo kūrimui
+Comment[nl]=Plugin voor het compileren van een iptables-scriptbestand
+Comment[pl]=Wtyczka kompilacji do skryptu iptables
+Comment[pt]='Plugin' para compilar um ficheiro do IPTables
+Comment[pt_BR]=Plug-in para a compilação de um arquivo de scripts do iptables
+Comment[ru]=Модуль для компилирования в сценарий iptables
+Comment[sr]=Прикључак за превођење у iptables скрипту
+Comment[sr@Latn]=Priključak za prevođenje u iptables skriptu
+Comment[sv]=Insticksprogram för att kompilera en skriptfil för IP-tabeller
+Comment[ta]=ஒரு iptables குறுநிரல் கோப்பை தொகுக்க சொருகுப்பொருள்
+Comment[tr]=Bir iptables betik dosyası derleme eklentisi
+Comment[xx]=xxPlugin for compiling to an iptables scriptfilexx
+Name=KMyFirewall IPTables Compiler
+Name[bg]= Компилатор на IPTables за KMyFirewal
+Name[br]=Dastumer IPTables KMyFirewall
+Name[bs]=KMyFirewall IPTables kompajler
+Name[ca]=Compilador IPTables per a KMyFirewall
+Name[cs]=KMyFirewall IPTables kompilátor
+Name[da]=KMyFirewall IPTables kompilering
+Name[de]=KMyFirewall IPTables-Compiler
+Name[el]=Μεταγλωττιστής IPTables για το KMyFirewall
+Name[es]=Compilador para IPTables de KMyFirewall
+Name[et]=KMyFirewalli IPTablesi kompilaator
+Name[fr]=Compilateur IPTables de KMyFirewall
+Name[gl]=Compilador de KMyFirewall para IPTables
+Name[hi]=के-माइ-फायरवाल आईपी-टेबल्स कम्पाइलर
+Name[hu]=KMyFirewall IPTables-fordító
+Name[it]=Compilatore per IPTables di KMyFirewall
+Name[ja]=KMyFirewall IPTables コンパイラ
+Name[ka]=KMyFirewall IPTables კომპილატორი
+Name[lt]=KMyFirewall IPTables kompiliatorius
+Name[pa]=KMyFirewall IPTables ਕੰਪਾਇਲਰ
+Name[pl]=Kompilator iptables KMyFirewall
+Name[pt]=Compilador para IPTables do KMyFirewall
+Name[pt_BR]=Compilador do IPTables do KMyFirewall
+Name[ru]=KMyFirewall - Компилятор IPTables
+Name[sr]=KMyFirewall-ов преводилац за iptables
+Name[sr@Latn]=KMyFirewall-ov prevodilac za iptables
+Name[sv]=IP-tabellkompilator för Min brandvägg
+Name[ta]=KMyதீச்சுவ்ர் IPஅட்டவணைத் தொகுப்பியைச் சொருகு
+Name[tr]=KMyFirewall IP Tabloları Derleyici
+Name[xx]=xxKMyFirewall IPTables Compilerxx
+Name[zh_CN]=KMyFirewall IP 规则表编辑器
+X-KDE-Library=libkmfcompiler_ipt
+ServiceTypes=KMyFirewall/Compiler
+X-KMyFirewall-Platform=linux
+X-KMyFirewall-Language=iptables
diff --git a/kmyfirewall/compilers/iptables/kmfiptablescompiler.cpp b/kmyfirewall/compilers/iptables/kmfiptablescompiler.cpp
new file mode 100644
index 0000000..8f7348d
--- /dev/null
+++ b/kmyfirewall/compilers/iptables/kmfiptablescompiler.cpp
@@ -0,0 +1,254 @@
+//
+// C++ Implementation: kmfiptablescompiler
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfiptablescompiler.h"
+
+// QT includes
+#include <qptrlist.h>
+#include <qmultilineedit.h>
+#include <qtabwidget.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+#include <kio/netaccess.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+
+// Project includes
+#include "../../version.h"
+#include "../../core/xmlnames.h"
+#include "../../core/kmfrulesetdoc.h"
+#include "../../core/kmfgenericdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmferrorhandler.h"
+#include "../../core/kmfconfig.h"
+#include "../../core/kmftarget.h"
+#include "../../kmfwidgets/kmflistview.h"
+#include "../../kmfwidgets/kmfselectactivetarget.h"
+
+#include "kmfiptablesscriptgenerator.h"
+#include "kmfiptablesdocumentconverter.h"
+
+namespace KMF {
+KMFIPTablesCompiler::KMFIPTablesCompiler( QObject* parent, const char* name ) : KMFPlugin( parent, name ) {
+ m_osName = "linux";
+ m_osGUIName = "Linux";
+ m_backendName = "iptables";
+ m_backendGUIName = "IPTables";
+
+ m_errorHandler = new KMFErrorHandler( "KMFIPTablesCompiler" );
+ m_iptWidget = 0;
+ new KAction( i18n( "&Export as IPTables (Linux) Script" ), "fileexport",
+ 0, this, SLOT( slotExportIPT() ), actionCollection(), "compile_iptables" );
+
+ if ( genericDoc() ) {
+ new KAction( i18n( "&Convert to IPTables Document and View" ), "fileexport",
+ 0, this, SLOT( slotConvertToIPTDoc() ), actionCollection(), "convert_to_iptdoc" );
+
+ setXMLFile( "kmfiptablescompiler.rc" );
+ kdDebug() << "KMFIPTablesCompiler: Finished initialisation." << endl;
+ }
+}
+
+
+KMFIPTablesCompiler::~KMFIPTablesCompiler() {}
+
+const QString& KMFIPTablesCompiler::osName(){
+ return m_osName;
+}
+const QString& KMFIPTablesCompiler::osGUIName(){
+ return m_osGUIName;
+}
+const QString& KMFIPTablesCompiler::backendName(){
+ return m_backendName;
+}
+const QString& KMFIPTablesCompiler::backendGUIName(){
+ return m_backendGUIName;
+}
+
+void KMFIPTablesCompiler::compile() {
+ kdDebug() << "void KMFIPTablesCompiler::compile()" << endl;
+}
+
+void KMFIPTablesCompiler::slotExportIPT() {
+ kdDebug() << "KMFIPTablesCompiler::slotExportIPT()" << endl;
+
+ KMFTarget* tg = KMFSelectActiveTarget::selectTarget( network(), i18n("<qt><p>Please select target from which the configuration should be exported as iptables script.</p></qt>") );
+
+ if ( ! tg ) {
+ return;
+ }
+
+
+
+
+ KURL url = KFileDialog::getSaveURL( ":", "*.sh|Shell Script (*.sh)" );
+ QString filename = url.fileName();
+ if ( url.fileName().isEmpty() )
+ return ;
+ int answer = 0;
+ while ( answer != 3 ) {
+ if ( KIO::NetAccess::exists( url, false, KApplication::kApplication()->mainWidget() ) ) {
+ if ( answer == 4 ) {
+ slotExportIPT();
+ return ;
+ } else {
+ answer = KMessageBox::warningYesNo( 0, i18n( "<qt>File <b>%1</b> already exists!</p>"
+ "<p><b>Overwrite the existing file?</b></p></qt>" ).arg( url.url() ) );
+ }
+ } else {
+ answer = 3;
+ }
+ }
+ QString extension = filename.right( 3 );
+ if ( extension != ".sh" )
+ filename.append( ".sh" );
+ url.setFileName( filename );
+ KTempFile tempfile;
+
+
+ m_err = tg->rulesetDoc()->createFirewallScript( tempfile.name() );
+
+
+
+ if ( m_errorHandler->showError( m_err ) ) {
+ if ( KIO::NetAccess::upload( tempfile.name(), url, KApplication::kApplication()->mainWidget() ) ) {
+ // statusBar() ->message( i18n( "Wrote file: " ) + url.fileName() , 5000 );
+ } else {
+ kdDebug() << "Couldn't upload file!!!" << tempfile.name() << endl;
+ KMessageBox::detailedError( 0, i18n( "<qt><p>Saving file: <b>%1</b> Failed.</p></qt>" ).arg( url.url() ),
+ i18n( "<qt><p>If you are working with remotely stored files "
+ "make sure that the target host and the directory is reachable. "
+ "</p></qt>" ) );
+ }
+ }
+
+ tempfile.unlink();
+}
+
+// void KMFIPTablesCompiler::slotShowIPTScript() {
+// // QString s = compile( genericDoc() );
+// QMultiLineEdit* ed = new QMultiLineEdit( 0, "edit" );
+// if ( genericDoc() ) {
+// ed->setText( compile( genericDoc() ) );
+// } else if ( iptablesDoc() ) {
+// ed->setText( compile( iptablesDoc() ) );
+// }
+// setOutputWidget( ed );
+// showOutput();
+// }
+
+const QString& KMFIPTablesCompiler::compile( KMFGenericDoc* doc ) {
+ kdDebug() << "const QString& KMFIPTablesCompiler::compile( KMFGenericDoc* doc )" << endl;
+ //kdDebug() << "Doc XLM:\n" << m_genericDoc->getXMLSniplet() << endl;
+ KMFIPTablesDocumentConverter *converter = new KMFIPTablesDocumentConverter();
+ m_iptdoc = converter->compileToIPTDoc( doc );
+ delete converter;
+
+ if ( m_iptdoc ) {
+ QString ret = m_iptdoc->compile();
+ m_iptdoc->deleteLater();
+ return *( new QString( ret ) );
+ } else {
+ return *( new QString( "ERROR: Couldn't compile document - may be wrong type " ) );
+ }
+
+}
+
+const QString& KMFIPTablesCompiler::compile( KMFIPTDoc* doc ) {
+ KMFIPTablesScriptGenerator *generator = new KMFIPTablesScriptGenerator();
+ QString script = generator->compile( doc );
+ delete generator;
+ return *(new QString( script ) );
+}
+
+void KMFIPTablesCompiler::slotConvertToIPTDoc() {
+ if ( ! doc() ) {
+ kdDebug() << "No document Available to compile" << endl;
+ return;
+ }
+ KMFIPTablesDocumentConverter *converter = new KMFIPTablesDocumentConverter();
+
+
+ m_iptdoc = converter->compileToIPTDoc( genericDoc() );
+ delete converter;
+
+ if ( ! m_iptWidget ) {
+ m_iptWidget = new QTabWidget( 0 , "QTabWidget" );
+ m_iptViewFilter = new KMFListView( 0, "view" );
+ m_iptViewNat = new KMFListView( 0, "view" );
+ m_iptViewMangle = new KMFListView( 0, "view" );
+ m_iptWidget ->addTab( m_iptViewFilter, "Filter" );
+ m_iptWidget ->addTab( m_iptViewNat, "Nat" );
+ m_iptWidget ->addTab( m_iptViewMangle, "Mangle" );
+ }
+ m_iptViewFilter ->setEnabled( true );
+ m_iptViewFilter->clear();
+ m_iptViewFilter->slotLoadNode( m_iptdoc->table( Constants::FilterTable_Name ) );
+ m_iptViewFilter->slotUpdateView();
+
+ m_iptViewNat ->setEnabled( true );
+ m_iptViewNat->clear();
+ m_iptViewNat->slotLoadNode( m_iptdoc->table( Constants::NatTable_Name ) );
+ m_iptViewNat->slotUpdateView();
+
+ m_iptViewMangle ->setEnabled( true );
+ m_iptViewMangle->clear();
+ m_iptViewMangle->slotLoadNode( m_iptdoc->table( Constants::MangleTable_Name ) );
+ m_iptViewMangle->slotUpdateView();
+
+ m_iptWidget->setMinimumSize( 800, 600 );
+ m_iptWidget->show();
+ m_iptWidget->raise();
+
+ m_iptdoc->deleteLater();
+}
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFIPTablesCompilerFactory::s_instance = 0L;
+// KAboutData* KMFIPTablesCompilerFactory::s_about = 0L;
+
+KMFIPTablesCompilerFactory::KMFIPTablesCompilerFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+ // s_instance = new KInstance( "KMFIPTablesCompilerFactory" );
+}
+
+QObject* KMFIPTablesCompilerFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFIPTablesCompiler( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFIPTablesCompilerFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFIPTablesCompilerFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfcompiler_ipt() {
+ return new KMFIPTablesCompilerFactory;
+ }
+}
+}
+#include "kmfiptablescompiler.moc"
diff --git a/kmyfirewall/compilers/iptables/kmfiptablescompiler.h b/kmyfirewall/compilers/iptables/kmfiptablescompiler.h
new file mode 100644
index 0000000..376f7be
--- /dev/null
+++ b/kmyfirewall/compilers/iptables/kmfiptablescompiler.h
@@ -0,0 +1,94 @@
+//
+// C++ Interface: kmfiptablescompiler
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFIPTABLESCOMPILER_H
+#define KMFIPTABLESCOMPILER_H
+
+#include "../../core/kmfcompilerinterface.h"
+
+/**
+@author Christian Hubinger
+*/
+
+// QT includes
+#include <qstring.h>
+#include <qobject.h>
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+// Project includes
+#include "../../core/kmfplugin.h"
+#include "../../core/kmfcompilerinterface.h"
+
+class QTabWidget;
+class KInstance;
+
+namespace KMF {
+class KMFListView;
+class KMFGenericDoc;
+class KMFIPTDoc;
+class KMFErrorHandler;
+
+class KMFIPTablesCompiler : public KMFPlugin, public virtual KMFCompilerInterface {
+ Q_OBJECT
+public:
+ KMFIPTablesCompiler( QObject* parent, const char* name );
+ ~KMFIPTablesCompiler();
+ void compile();
+ const QString& compile( KMFGenericDoc* );
+ const QString& compile( KMFIPTDoc* );
+ const QString& osName();
+ const QString& osGUIName();
+ const QString& backendName();
+ const QString& backendGUIName();
+
+private slots:
+ void slotConvertToIPTDoc();
+ void slotExportIPT();
+// void slotShowIPTScript();
+
+private:
+ KMFErrorHandler *m_errorHandler;
+ QTabWidget *m_iptWidget;
+ KMFListView *m_iptViewFilter, *m_iptViewNat, *m_iptViewMangle;
+ QString m_osName;
+ QString m_osGUIName;
+ QString m_backendName;
+ QString m_backendGUIName;
+ KMFIPTDoc *m_iptdoc;
+};
+
+
+
+
+class KMFIPTablesCompilerFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFIPTablesCompilerFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFIPTablesCompilerFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+#endif
diff --git a/kmyfirewall/compilers/iptables/kmfiptablescompiler.rc b/kmyfirewall/compilers/iptables/kmfiptablescompiler.rc
new file mode 100644
index 0000000..4020ec8
--- /dev/null
+++ b/kmyfirewall/compilers/iptables/kmfiptablescompiler.rc
@@ -0,0 +1,16 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kmfiptablescompiler" library="libkmfcompiler_ipt" version="1">
+<MenuBar>
+ <Menu name="file">
+ <Menu name="export_script_menu">
+ <Action name="compile_iptables"/>
+ <Action name="convert_to_iptdoc"/>
+ </Menu>
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+</ToolBar>
+</kpartgui>
+
+
+
diff --git a/kmyfirewall/compilers/iptables/kmfiptablesdocumentconverter.cpp b/kmyfirewall/compilers/iptables/kmfiptablesdocumentconverter.cpp
new file mode 100644
index 0000000..f7b8c22
--- /dev/null
+++ b/kmyfirewall/compilers/iptables/kmfiptablesdocumentconverter.cpp
@@ -0,0 +1,671 @@
+//
+// C++ Implementation: kmfiptablesdocumentconverter
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+// License: GPL
+//
+#include "kmfiptablesdocumentconverter.h"
+
+// QT includes
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+#include "../../version.h"
+#include "../../core/kmfgenericdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetzone.h"
+#include "../../core/kmfnethost.h"
+#include "../../core/kmfprotocol.h"
+#include "../../core/kmfprotocolusage.h"
+#include "../../core/iptable.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmferrorhandler.h"
+#include "../../core/kmfconfig.h"
+#include "../../core/xmlnames.h"
+
+
+namespace KMF {
+KMFIPTablesDocumentConverter::KMFIPTablesDocumentConverter() {
+
+ m_errorHandler = new KMFErrorHandler( "KMFIPTablesDocumentConverter" );
+ m_err = new KMFError();
+ m_iptdoc = 0;
+
+}
+
+
+KMFIPTablesDocumentConverter::~KMFIPTablesDocumentConverter() {}
+
+
+KMFIPTDoc* KMFIPTablesDocumentConverter::compileToIPTDoc( KMFGenericDoc* doc ) {
+ kdDebug() << "const QString& KMFIPTablesCompiler::compileToIPTDoc( KMFGenericDoc* doc )" << endl;
+ if ( ! doc ) {
+ kdDebug() << "No document Available to compile" << endl;
+ return 0;
+ }
+ // kdDebug() << "Doc XLM:\n" << doc->getXMLSniplet() << endl;
+
+ m_iptdoc = new KMFIPTDoc( 0, "iptdoc", doc->target() );
+ KMFNetZone *zone = 0;
+ IPTable *table = 0;
+ IPTChain *chain = 0;
+
+ setupInAndOutHosts( m_iptdoc, doc->trustedHostsZone(), "ACCEPT" );
+ setupInAndOutHosts( m_iptdoc, doc->maliciousHostsZone(), "DROP" );
+ setupForbiddenHosts( m_iptdoc, doc->badClientsHostsZone(), "in" );
+ setupForbiddenHosts( m_iptdoc, doc->badServersHostsZone(), "out" );
+
+ setupICMPRules( doc, m_iptdoc );
+ setupLocalhostRules( doc, m_iptdoc );
+
+ if ( doc->allowIncomingConnections() ) {
+ zone = doc->incomingZone();
+ table = m_iptdoc->table( Constants::FilterTable_Name );
+ chain = table->chainForName( Constants::InputChain_Name );
+ addToChains( zone, m_iptdoc, chain, Constants::InputChain_Name);
+ }
+
+ if ( doc->restrictOutgoingConnections() ) {
+ zone = doc->outgoingZone();
+ table = m_iptdoc->table( Constants::FilterTable_Name );
+ chain = table->chainForName( Constants::OutputChain_Name );
+ addToChains( zone, m_iptdoc, chain, Constants::OutputChain_Name);
+ }
+
+
+ setupConnectionTracking( m_iptdoc );
+ setupPolicies( doc, m_iptdoc );
+
+ setupNatRules( doc, m_iptdoc );
+ setupLogging( doc, m_iptdoc );
+
+ return m_iptdoc;
+}
+
+void KMFIPTablesDocumentConverter::setupConnectionTracking( KMFIPTDoc* doc ) {
+ kdDebug() << "void KMFIPTablesCompiler::setupConnectionTracking( KMFIPTDoc* doc )" << endl;
+
+ IPTable *table = doc->table( Constants::FilterTable_Name );
+ IPTChain *chain = table->chainForName( Constants::InputChain_Name );
+
+ IPTRule *rule = chain->addRule( "CONNTRACK", m_err );
+ if ( ! m_errorHandler->showError( m_err ) ) {
+ return;
+ }
+ QPtrList<QString> args;
+ args.append( new QString(XML::BoolOn_Value) );
+ args.append( new QString("RELATED,ESTABLISHED") );
+ QString opt = "state_opt";
+ rule->addRuleOption( opt, args );
+ rule->setTarget( "ACCEPT" );
+ rule->setDescription( i18n( "This rule enables connection tracking\n"
+ "in your firewall.\n"
+ "It simply allows all traffic reaching\n"
+ "your host, which is somehow related to\n"
+ "connections you established e.g. answers\n"
+ "others send you to your requests.") );
+}
+
+void KMFIPTablesDocumentConverter::setupLocalhostRules( KMFGenericDoc* gendoc, KMFIPTDoc* doc ){
+ kdDebug() << "void KMFIPTablesCompiler::setupConnectionTracking( KMFGenericDoc* gendoc, KMFIPTDoc* doc )" << endl;
+
+ IPTable *table = doc->table( Constants::FilterTable_Name );
+ IPTChain *chain = table->chainForName( Constants::InputChain_Name );
+
+ IPTRule *rule = chain->addRule( "LOCALHOST", m_err );
+ if ( ! m_errorHandler->showError( m_err ) ) {
+ return;
+ }
+ QPtrList<QString> args;
+ args.append( new QString( Constants::Localhost_IP ) );
+ args.append( new QString( XML::BoolOff_Value ) );
+ QString opt = "ip_opt";
+ rule->addRuleOption( opt, args );
+ rule->setTarget( "ACCEPT" );
+
+ args.clear();
+ opt = "interface_opt";
+ args.append( new QString( "lo" ) );
+ args.append( new QString( XML::BoolOff_Value ) );
+ rule->addRuleOption( opt, args );
+ rule->setDescription( i18n( "Allows all localhost traffic" ) );
+
+
+ if ( gendoc->restrictOutgoingConnections() ) {
+ chain = table->chainForName( Constants::OutputChain_Name );
+ rule = chain->addRule( "LOCALHOST", m_err );
+ if ( ! m_errorHandler->showError( m_err ) ) {
+ return;
+ }
+
+ args.clear();
+ opt = "interface_opt";
+ args.append( new QString( XML::BoolOff_Value ) );
+ args.append( new QString( "lo" ) );
+ rule->addRuleOption( opt, args );
+ rule->setTarget( "ACCEPT" );
+ rule->setDescription( i18n( "Allows all localhost traffic" ) );
+ }
+
+}
+
+void KMFIPTablesDocumentConverter::setupPolicies( KMFGenericDoc* gendoc, KMFIPTDoc* iptdoc ) {
+ kdDebug() << "void KMFIPTablesCompiler::setupPolicies( KMFGenericDoc* gendoc, KMFIPTDoc* iptdoc )" << endl;
+ IPTable *table = iptdoc->table( Constants::FilterTable_Name );
+ IPTChain *chain = table->chainForName( Constants::InputChain_Name );
+ chain->setDefaultTarget( "DROP" );
+ chain = table->chainForName( Constants::OutputChain_Name );
+
+ if ( gendoc->restrictOutgoingConnections() ) {
+ chain->setDefaultTarget( "DROP" );
+ } else {
+ chain->setDefaultTarget( "ACCEPT" );
+ }
+}
+
+void KMFIPTablesDocumentConverter::addToChains( KMFNetZone* zone, KMFIPTDoc* doc, IPTChain* chain, const QString& root_chain ) {
+ QPtrList<KMFNetZone>& children = zone->zones();
+ QPtrListIterator<KMFNetZone> it( children );
+ static int i = 0;
+ while( it.current() ) {
+ addToChains( it.current(), doc, chain, root_chain );
+ ++it;
+ }
+ IPTable *table = doc->table( Constants::FilterTable_Name );
+ QString num = "";
+ num.setNum( i );
+ QString name = "";
+
+ if ( root_chain == Constants::InputChain_Name ) {
+ name = "IZ_" + num;
+ } else if ( root_chain == Constants::OutputChain_Name ) {
+ name = "OZ_" + num;
+ }
+
+ name.stripWhiteSpace();
+ QString target = "ACCEPT";
+ if ( zone->address()->toString() != "0.0.0.0" ) {
+ table->addChain( name, target, false, m_err );
+ if ( ! m_errorHandler->showError( m_err ) )
+ return;
+
+ if ( ! chain ) {
+ kdDebug() << "KMFIPTablesCompiler: WARNING Couldn't create chain: " << name << endl;
+ return;
+ }
+ IPTRule* rule = 0;
+ rule = chain->addRule( "Feed_" + num , m_err );
+ if ( ! m_errorHandler->showError( m_err ) )
+ return;
+ rule->setDescription( i18n( "This rule forwards all traffic to\n"
+ "chain: %1 which handles traffic for\n"
+ "zone: %2.").arg( name ).arg( zone->guiName() ) );
+ i++;
+ if ( ! rule ) {
+ kdDebug() << "KMFIPTablesCompiler: WARNING Couldn't create rule: Feed in chain: " << chain->name() << endl;
+ return;
+ }
+ IPTChain *ch = table->chainForName( name );
+ if ( ! ch ) {
+ kdDebug() << "KMFIPTablesCompiler: WARNING Couldn't find chain: " << name << endl;
+ return;
+ }
+ ch->setDescription( i18n("The Chain created to handle\nrules defined in zone %1.").arg( zone->guiName() ) );
+
+ QPtrList<QString> args;
+ if ( root_chain == Constants::InputChain_Name ) {
+ args.append( new QString( zone->address()->toString()+"/"+zone->mask()->toString() ) );
+ args.append( new QString( XML::BoolOff_Value ) );
+ } else if ( root_chain == Constants::OutputChain_Name ) {
+ args.append( new QString( XML::BoolOff_Value ) );
+ args.append( new QString( zone->address()->toString()+"/"+zone->mask()->toString() ) );
+ }
+ QString s ="ip_opt";
+ rule->addRuleOption( s , args );
+ rule->setTarget( name );
+ createRules( zone, ch, root_chain );
+ } else {
+ createRules( zone, chain, root_chain );
+ }
+}
+
+void KMFIPTablesDocumentConverter::createRules( KMFNetZone* zone, IPTChain* chain, const QString& root_chain ) {
+ QPtrList<KMFProtocolUsage>& prots = zone->protocols();
+ QPtrListIterator<KMFProtocolUsage> it ( prots );
+ while ( it.current() ) {
+ KMFProtocolUsage* prot = it.current();
+ if ( ! zone->protocolInherited( prot->protocol()->uuid() ) ) {
+ createZoneProtocolRules( chain, prot );
+ } else {
+ kdDebug() << "Skipping inherited Portocol: " << prot->protocol()->name() << " in zone: " << zone->guiName() << endl;
+ }
+ ++it;
+ }
+
+ QPtrList<KMFTarget>& hosts = zone->hosts();
+ QPtrListIterator<KMFTarget> it2 ( hosts );
+ while ( it2.current() ) {
+ KMFNetHost* host = dynamic_cast<KMFNetHost*> ( it2.current() );
+ kdDebug() << "Will create rules for host: " << host->guiName() << " in zone:" << zone->guiName() << endl;
+ QPtrList<KMFProtocolUsage>& prots = host->protocols();
+ QPtrListIterator<KMFProtocolUsage> it3 ( prots );
+ while ( it3.current() ) {
+ KMFProtocolUsage* protUsage = it3.current();
+ kdDebug() << "Found Stored Usage" << endl;
+ kdDebug() << " Name: " << protUsage->name() << endl;
+ if ( ! host->protocolInherited( protUsage->protocol()->uuid() ) ) {
+ kdDebug() << "Found Protocol: " << protUsage->protocol()->name() << endl;
+ createHostProtocolRules( chain, host, protUsage, root_chain );
+ } else {
+ kdDebug() << "Skipping inherited Portocol: " << protUsage->protocol()->name() << " in host: " << host->guiName() << endl;
+ }
+ ++it3;
+ }
+ ++it2;
+ }
+}
+
+void KMFIPTablesDocumentConverter::createZoneProtocolRules( IPTChain* chain, KMFProtocolUsage* prot ) {
+ kdDebug() << "void KMFIPTablesCompiler::createProtocolRules( ITPChain* chain, KMFProtocol* protocol )" << endl;
+ const QString& tcpPorts = prot->protocol()->tcpPortsList();
+ const QString& udpPorts = prot->protocol()->udpPortsList();
+ if ( ! tcpPorts.isEmpty() ) {
+ createZoneProtocol( chain, prot, "tcp", tcpPorts );
+ }
+ if ( ! udpPorts.isEmpty() ) {
+ createZoneProtocol( chain, prot, "udp", udpPorts );
+ }
+}
+
+void KMFIPTablesDocumentConverter::createZoneProtocol( IPTChain* chain, KMFProtocolUsage* prot, const QString& option, const QString& ports ) {
+ kdDebug() << "void KMFIPTablesCompiler::createProtocol( IPTChain*, const QString& option, QStringList ports )" << endl;
+ QString s;
+ QPtrList<QString> args;
+ args.clear();
+ args.append( new QString( XML::BoolOn_Value ) );
+ args.append( new QString( XML::BoolOff_Value ) );
+
+ IPTRule* rule;
+ rule = chain->addRule( prot->protocol()->name()+ "_" + option , m_err );
+ if ( ports.contains( "," ) > 0 ) {
+ s = option + "_multiport_opt";
+ } else {
+ s = option + "_opt";
+ }
+
+ if ( ! m_errorHandler->showError( m_err ) )
+ return;
+
+ rule->addRuleOption( s , args );
+ rule->setDescription( i18n( "Allow Protocol: %1\n"
+ "Protocol Description: %2" ).arg( prot->protocol()->name( ) ).arg( prot->protocol()->description() ) );
+
+
+ rule->setDescription( prot->protocol()->description() );
+ args.append( new QString( ports ) );
+ rule->addRuleOption( s, args );
+
+ if ( prot->logging() ) {
+ rule->setLogging( true );
+ }
+
+ if ( prot->limit() > 0 ) {
+ s = "limit_opt";
+ args.clear();
+ args.append( new QString(XML::BoolOn_Value) );
+ QString limit;
+ limit.setNum( prot->limit() );
+ limit += "/" + prot->limitInterval();
+ kdDebug() << "Setting limit: " << limit << endl;
+ args.append( new QString( limit ) );
+ rule->addRuleOption( s, args );
+ }
+ rule->setTarget("ACCEPT");
+}
+
+
+void KMFIPTablesDocumentConverter::createHostProtocolRules( IPTChain* chain, KMFNetHost* host, KMFProtocolUsage* prot, const QString& root_chain ) {
+ kdDebug() << "void KMFIPTablesCompiler::createProtocolRules( ITPChain* chain, KMFProtocol* protocol )" << endl;
+ const QString& tcpPorts = prot->protocol()->tcpPortsList();
+ const QString& udpPorts = prot->protocol()->udpPortsList();
+ if ( ! tcpPorts.isEmpty() ) {
+ createHostProtocol( chain, host, prot, "tcp", tcpPorts, root_chain );
+ }
+ if ( ! udpPorts.isEmpty() ) {
+ createHostProtocol( chain, host, prot, "udp", udpPorts, root_chain );
+ }
+}
+
+void KMFIPTablesDocumentConverter::createHostProtocol( IPTChain* chain, KMFNetHost* host, KMFProtocolUsage* prot, const QString& option, const QString& ports, const QString& root_chain ) {
+ kdDebug() << "void KMFIPTablesCompiler::createProtocol( IPTChain*, const QString& option, QStringList ports )" << endl;
+ QString s;
+ QPtrList<QString> args;
+ args.clear();
+ args.append( new QString( XML::BoolOn_Value ) );
+ args.append( new QString( XML::BoolOff_Value ) );
+ static int i = 0;
+
+ IPTRule* rule;
+ QString hn = "";
+ hn = hn.setNum( i );
+ i++;
+ hn = "H" + hn;
+ rule = chain->addRule( hn + "_" + prot->protocol()->name() + "_" + option , m_err );
+ if ( ports.contains( "," ) > 0 ) {
+ s = option + "_multiport_opt";
+ } else {
+ s = option + "_opt";
+ }
+ rule->setDescription( i18n( "Rule created to apply filters for host: %1\n"
+ "Allow Protocol: %2\n"
+ "Protocol Description: %3" ).arg( host->guiName() ).arg( prot->protocol()->name( ) ).arg( prot->protocol()->description() ) );
+ if ( ! m_errorHandler->showError( m_err ) )
+ return;
+
+ rule->addRuleOption( s , args );
+
+ args.append( new QString( ports ) );
+ rule->addRuleOption( s, args );
+
+ if ( prot->logging() ) {
+ rule->setLogging( true );
+ }
+
+ if ( prot->limit() > 0 ) {
+ s = "limit_opt";
+ args.clear();
+ args.append( new QString(XML::BoolOn_Value) );
+ QString limit;
+ limit.setNum( prot->limit() );
+ limit += "/" + prot->limitInterval();
+ kdDebug() << "Setting limit: " << limit << endl;
+ args.append( new QString( limit ) );
+ rule->addRuleOption( s, args );
+ }
+
+ args.clear();
+ if ( root_chain == Constants::OutputChain_Name ) {
+ args.append( new QString( XML::BoolOff_Value ) );
+ }
+ s = "ip_opt";
+ args.append( new QString( host->address()->toString() ) );
+ rule->addRuleOption( s, args );
+ rule->setTarget("ACCEPT");
+}
+
+void KMFIPTablesDocumentConverter::setupInAndOutHosts( KMFIPTDoc* iptdoc, KMFNetZone* zone, const QString& target ) {
+ kdDebug() << "KMFIPTablesCompiler::setupTrustedHosts( KMFNetZone* )" << endl;
+ QPtrListIterator<KMFTarget> it ( zone->hosts() );
+ int i = 0;
+ while ( it.current() ) {
+ KMFNetHost *host = dynamic_cast<KMFNetHost*> ( *it );
+ IPTable *table = iptdoc->table( Constants::FilterTable_Name );
+ IPTChain *chain;
+ IPTRule *rule;
+ QString ruleName = "";
+ ruleName = ruleName.setNum( i );
+ if ( target == "ACCEPT" ) {
+ ruleName = "Trusted_" + ruleName;
+ } else {
+ ruleName = "Malicious_" + ruleName;
+ }
+ QString opt = "ip_opt";
+ QPtrList<QString> args;
+
+ chain = table->chainForName( Constants::InputChain_Name );
+ rule = chain->addRule( ruleName, m_err );
+ if ( ! m_errorHandler->showError( m_err ) )
+ return;
+
+ args.append( new QString( host->address()->toString() ) );
+ rule->addRuleOption( opt, args );
+ if ( target == "ACCEPT" ) {
+ rule->setDescription( i18n("This rule allows incoming packets from trusted host: %1.").arg( host->guiName() ) );
+ } else {
+ rule->setDescription( i18n("This rule drops incoming packets from malicious host: %1.").arg( host->guiName() ) );
+
+ }
+ rule->setTarget( target );
+ if ( host->logIncoming() ) {
+ rule->setLogging( true );
+ }
+
+
+ chain = table->chainForName( Constants::OutputChain_Name );
+ rule = chain->addRule( ruleName, m_err );
+ args.clear();
+ args.append( new QString( XML::BoolOff_Value ) );
+ args.append( new QString( host->address()->toString() ) );
+ rule->addRuleOption( opt, args );
+ if ( ! m_errorHandler->showError( m_err ) )
+ return;
+
+ if ( target == "ACCEPT" ) {
+ rule->setDescription( i18n("This rule allows outgoing packets to trusted host: %1.").arg( host->guiName() ) );
+ } else {
+ rule->setDescription( i18n("This rule drops outgoing packets to malicious host: %1.").arg( host->guiName() ) );
+
+ }
+ rule->setTarget( target );
+ if ( host->logOutgoing() ) {
+ rule->setLogging( true );
+ }
+ ++it;
+ i++;
+ }
+}
+
+void KMFIPTablesDocumentConverter::setupForbiddenHosts( KMFIPTDoc* iptdoc , KMFNetZone* zone, const QString& inOut ) {
+ QPtrListIterator<KMFTarget> it ( zone->hosts() );
+ int i = 0;
+ while ( it.current() ) {
+ KMFNetHost *host = dynamic_cast<KMFNetHost*> ( *it );
+ IPTable *table = iptdoc->table( Constants::FilterTable_Name );
+ IPTChain *chain;
+ IPTRule *rule;
+ QString ruleName = "";
+ ruleName = ruleName.setNum( i );
+ if ( inOut == "in" ) {
+ ruleName = "ForbiddenClient_" + ruleName;
+ } else {
+ ruleName = "ForbiddenServer_" + ruleName;
+ }
+ QString opt = "ip_opt";
+ QPtrList<QString> args;
+
+ if ( inOut == "in" ) {
+ chain = table->chainForName( Constants::InputChain_Name );
+ } else {
+ chain = table->chainForName( Constants::OutputChain_Name );
+ }
+ rule = chain->addRule( ruleName, m_err );
+ if ( ! m_errorHandler->showError( m_err ) )
+ return;
+
+ if ( inOut == "out" ) {
+ args.append( new QString(XML::BoolOff_Value) );
+ }
+ args.append( new QString( host->address()->toString() ) );
+ rule->addRuleOption( opt, args );
+ if ( inOut =="in" ) {
+ rule->setDescription( i18n("This rule drops packets from forbidden client: %1.").arg( host->guiName() ) );
+ } else {
+ rule->setDescription( i18n("This rule drops packets to forbidden server: %1.").arg( host->guiName() ) );
+ }
+ rule->setTarget( "DROP" );
+ if ( inOut =="in" ) {
+ if ( host->logIncoming() ) {
+ rule->setLogging( true );
+ }
+ } else {
+ if ( host->logOutgoing() ) {
+ rule->setLogging( true );
+ }
+ }
+ ++it;
+ i++;
+ }
+}
+
+void KMFIPTablesDocumentConverter::setupNatRules( KMFGenericDoc* doc, KMFIPTDoc* iptdoc ) {
+ if ( ! doc->useNat() ) {
+ return;
+ }
+
+ IPTable* table = iptdoc->table( Constants::NatTable_Name );
+ if ( ! table ) {
+ kdDebug() << "ERROR: Couldn't find table nat!!!" << endl;
+ return;
+ }
+
+ IPTChain* chain = table->chainForName( Constants::PostRoutingChain_Name );
+ if ( ! chain ) {
+ kdDebug() << "ERROR: Couldn't find chain POSTROUTING!!!" << endl;
+ return;
+ }
+ iptdoc->setUseIPFwd( true );
+ iptdoc->useNat();
+ IPTRule* rule = chain->addRule( "NAT_RULE", m_err );
+ if ( ! m_errorHandler->showError( m_err ) ) {
+ return;
+ }
+
+ rule->setDescription( i18n("Rule created for setting up\nthe nat router functionality.") );
+
+ QString opt = "interface_opt";
+ QPtrList<QString> args;
+ args.append( new QString( XML::BoolOff_Value ) );
+ args.append( new QString( doc->outgoingInterface() ) );
+ rule->addRuleOption( opt, args );
+ setupNatTarget( doc, rule );
+}
+
+void KMFIPTablesDocumentConverter::setupNatTarget( KMFGenericDoc* doc, IPTRule* rule ) {
+ if ( doc->useMasquerade() ) {
+ rule->setTarget( "MASQUERADE" );
+ } else {
+ rule->setTarget( "SNAT" );
+ QString opt = "target_snat_opt";
+ QPtrList<QString> args;
+ args.append( new QString( doc->natAddress()->toString() ) );
+ rule->addRuleOption( opt, args );
+ }
+}
+
+void KMFIPTablesDocumentConverter::setupLogging( KMFGenericDoc* doc, KMFIPTDoc* iptdoc ) {
+ if ( ! doc->logDropped() ) {
+ return;
+ }
+ IPTable* table = iptdoc->table( Constants::FilterTable_Name );
+ if ( ! table ) {
+ kdDebug() << "ERROR: Couldn't find table filter!!!" << endl;
+ return;
+ }
+
+ IPTChain* chain = table->chainForName( Constants::InputChain_Name );
+ if ( ! chain ) {
+ kdDebug() << "ERROR: Couldn't find chain INPUT!!!" << endl;
+ return;
+ }
+
+ setupLoggingRules( doc, chain );
+
+ if ( doc->restrictOutgoingConnections() ) {
+ chain = table->chainForName( Constants::OutputChain_Name );
+ if ( ! chain ) {
+ kdDebug() << "ERROR: Couldn't find chain INPUT!!!" << endl;
+ return;
+ }
+ setupLoggingRules( doc, chain );
+ }
+}
+
+void KMFIPTablesDocumentConverter::setupLoggingRules( KMFGenericDoc* doc, IPTChain* chain ) {
+ QString limit = "";
+ QString burst = "";
+ QString prefix = doc->logPrefix();
+
+ if ( doc->limitLog() ) {
+ limit = "5/second";
+ burst = "5";
+ }
+
+ chain->setDropLogging( true, limit, burst, prefix );
+}
+
+void KMFIPTablesDocumentConverter::setupICMPRules( KMFGenericDoc* doc, KMFIPTDoc* iptdoc) {
+ if ( ! doc->allowPingReply() ) {
+ return;
+ }
+ IPTable* table = iptdoc->table( Constants::FilterTable_Name );
+ if ( ! table ) {
+ kdDebug() << "ERROR: Couldn't find table filter!!!" << endl;
+ return;
+ }
+
+ IPTChain* chain = table->chainForName( Constants::InputChain_Name );
+ if ( ! chain ) {
+ kdDebug() << "ERROR: Couldn't find chain INPUT!!!" << endl;
+ return;
+ }
+
+ IPTRule *rule = chain->addRule( "ICMP", m_err );
+ if ( ! m_errorHandler->showError( m_err ) ) {
+ return;
+ }
+ rule->setDescription( i18n("Rule to setup the ICMP Ping policy.") );
+ QString opt = "icmp_opt";
+ QPtrList<QString> args;
+ args.append( new QString( XML::BoolOn_Value ) );
+ args.append( new QString( "echo-request" ) );
+ rule->addRuleOption( opt, args );
+ rule->setTarget( "ACCEPT" );
+
+ if ( doc->limitPingReply() ) {
+ args.clear();
+ QString opt = "limit_opt";
+ args.append( new QString( XML::BoolOn_Value ) );
+ args.append( new QString( "5/second" ) );
+ args.append( new QString( "5" ) );
+ rule->addRuleOption( opt, args );
+ }
+
+
+ if ( doc->restrictOutgoingConnections() ) {
+ chain = table->chainForName( Constants::OutputChain_Name );
+ if ( ! chain ) {
+ kdDebug() << "ERROR: Couldn't find chain INPUT!!!" << endl;
+ return;
+ }
+
+ rule = chain->addRule( "ICMP", m_err );
+ if ( ! m_errorHandler->showError( m_err ) ) {
+ return;
+ }
+ rule->setDescription( i18n("Rule to setup the ICMP Ping policy.") );
+ QString opt = "icmp_opt";
+ args.clear();
+ args.append( new QString( XML::BoolOn_Value ) );
+ args.append( new QString( "echo-request" ) );
+ rule->addRuleOption( opt, args );
+ rule->setTarget( "ACCEPT" );
+ }
+}
+}
+
+
+
+
+
+
diff --git a/kmyfirewall/compilers/iptables/kmfiptablesdocumentconverter.h b/kmyfirewall/compilers/iptables/kmfiptablesdocumentconverter.h
new file mode 100644
index 0000000..51462b7
--- /dev/null
+++ b/kmyfirewall/compilers/iptables/kmfiptablesdocumentconverter.h
@@ -0,0 +1,72 @@
+//
+// C++ Interface: kmfiptablesdocumentconverter
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+// License: GPL
+//
+#ifndef KMFIPTABLESDOCUMENTCONVERTER_H
+#define KMFIPTABLESDOCUMENTCONVERTER_H
+
+/**
+@author Christian Hubinger
+*/
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+
+
+namespace KMF {
+class KMFNetZone;
+class KMFNetHost;
+class IPTRule;
+class IPTChain;
+class IPTable;
+class KMFIPTDoc;
+class KMFProtocol;
+class KMFProtocolUsage;
+class KMFGenericDoc;
+class KMFErrorHandler;
+class KMFError;
+
+
+class KMFIPTablesDocumentConverter{
+public:
+ KMFIPTablesDocumentConverter();
+
+ ~KMFIPTablesDocumentConverter();
+ KMFIPTDoc* compileToIPTDoc( KMFGenericDoc* doc );
+
+private:
+ void addToChains( KMFNetZone*, KMFIPTDoc* , IPTChain*, const QString& );
+ void createRules( KMFNetZone*, IPTChain*, const QString& );
+ void setupLocalhostRules( KMFGenericDoc*, KMFIPTDoc* );
+ void setupConnectionTracking( KMFIPTDoc* );
+ void setupPolicies( KMFGenericDoc*, KMFIPTDoc* );
+ void createZoneProtocolRules( IPTChain*, KMFProtocolUsage* );
+ void createZoneProtocol( IPTChain*, KMFProtocolUsage* prot , const QString& option, const QString& ports );
+ void createHostProtocolRules( IPTChain*, KMFNetHost*, KMFProtocolUsage*, const QString& );
+ void createHostProtocol( IPTChain*, KMFNetHost*, KMFProtocolUsage* prot , const QString& option, const QString&, const QString& );
+ void setupInAndOutHosts( KMFIPTDoc*, KMFNetZone*, const QString& );
+ void setupForbiddenHosts( KMFIPTDoc*, KMFNetZone*, const QString& );
+
+ void setupICMPRules( KMFGenericDoc*, KMFIPTDoc* );
+
+ void setupNatRules( KMFGenericDoc*, KMFIPTDoc* );
+ void setupNatTarget( KMFGenericDoc*, IPTRule* );
+ void setupLogging( KMFGenericDoc*, KMFIPTDoc* );
+ void setupLoggingRules( KMFGenericDoc*, IPTChain* );
+
+private: // DATA
+ KMFGenericDoc *m_genericDoc;
+ KMFErrorHandler *m_errorHandler;
+ KMFError *m_err;
+ KMFIPTDoc *m_iptdoc;
+};
+}
+#endif
diff --git a/kmyfirewall/compilers/iptables/kmfiptablesscriptgenerator.cpp b/kmyfirewall/compilers/iptables/kmfiptablesscriptgenerator.cpp
new file mode 100644
index 0000000..961cbc0
--- /dev/null
+++ b/kmyfirewall/compilers/iptables/kmfiptablesscriptgenerator.cpp
@@ -0,0 +1,336 @@
+//
+// C++ Implementation: kmfiptablesscriptgenerator
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+// License: GPL
+//
+#include "kmfiptablesscriptgenerator.h"
+
+// QT includes
+#include <qptrlist.h>
+#include <qstringlist.h>
+#include <qmultilineedit.h>
+#include <qtabwidget.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+#include <kio/netaccess.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+
+// Project includes
+#include "../../version.h"
+#include "../../core/xmlnames.h"
+#include "../../core/kmfgenericdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetzone.h"
+#include "../../core/kmfnethost.h"
+#include "../../core/kmfprotocol.h"
+#include "../../core/iptable.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmferrorhandler.h"
+#include "../../core/kmfconfig.h"
+#include "../../core/kmftarget.h"
+#include "../../core/kmftargetconfig.h"
+#include "../../kmfwidgets/kmflistview.h"
+
+
+
+namespace KMF {
+KMFIPTablesScriptGenerator::KMFIPTablesScriptGenerator()
+{
+}
+
+
+KMFIPTablesScriptGenerator::~KMFIPTablesScriptGenerator()
+{
+}
+
+const QString& KMFIPTablesScriptGenerator::compile( KMFIPTDoc* doc ) {
+ m_iptDoc = doc;
+ QString script;
+ m_stream = new QTextOStream( &script );
+ printScriptHeader();
+ printScriptStartFunction();
+ printScriptStopFunction();
+ printScriptExecLogic();
+ return *(new QString( script ) );
+}
+
+
+
+void KMFIPTablesScriptGenerator::printScriptExecLogic() {
+ *m_stream <<
+ "IPT=\"" + m_iptDoc->target()->config()->IPTPath() + "\"\n"
+ "MOD=\"" + m_iptDoc->target()->config()->modprobePath() + "\"\n"
+
+ "status=\"0\"\n"
+ "verbose=\"0\"\n"
+ "action=\"$1\"\n"
+
+ "if [ \"$1\" = \"-v\" ]; then\n "
+ " verbose=\"1\"\n"
+ "fi\n\n"
+ "if [ \"$1\" = \"--verbose\" ]; then\n "
+ " verbose=\"1\"\n"
+ "fi\n\n"
+
+ "if [ \"$verbose\" = \"1\" ]; then\n "
+ " if [ \"$2\" = \"\" ]; then\n"
+ " echo \"Usage: sh kmyfirewall.sh [-v|--verbose] { start | stop | restart }\"\n"
+ " exit 1\n"
+ " fi\n"
+ "action=\"$2\"\n"
+ "fi\n\n"
+
+ "case $action in\n"
+ " start)\n"
+ " stopFirewall\n"
+ " startFirewall\n"
+ " ;;\n"
+ " stop)\n"
+ " stopFirewall\n"
+ " ;;\n"
+ " restart)\n"
+ " stopFirewall\n"
+ " startFirewall\n"
+ " ;;\n"
+ " *)\n"
+ " echo \"Invalid action!\nUsage: sh kmyfirewall.sh [-v|--verbose] { start | stop | restart }\"\n"
+ " ;;\n"
+ " esac\n\n"
+
+ "if [ \"$status\" = \"1\" ]; then\n"
+ " exit 1\n"
+ "else\n"
+ " exit 0\n"
+ "fi\n" << endl;
+}
+
+void KMFIPTablesScriptGenerator::printScriptStartFunction() {
+ *m_stream << "startFirewall() {\n"
+ "\necho -n \"Starting iptables (created by KMyFirewall)... \"";
+ if ( m_iptDoc->useModules() ) {
+ printScriptModuleLoad();
+ *m_stream << endl;
+ }
+ *m_stream << "# Define all custom chains" << endl;
+ *m_stream << printScriptDebug( "Create custom chains... ", false) << endl;
+ if ( m_iptDoc->useFilter() ) {
+ printScriptTableChainDefinition( m_iptDoc->table( Constants::FilterTable_Name ) );
+ *m_stream << endl;
+ }
+ if ( m_iptDoc->useNat() ) {
+ printScriptTableChainDefinition( m_iptDoc->table( Constants::NatTable_Name ) );
+ *m_stream << endl;
+ }
+ if ( m_iptDoc->useMangle() ) {
+ printScriptTableChainDefinition( m_iptDoc->table( Constants::MangleTable_Name ) );
+ *m_stream << endl;
+ }
+
+ *m_stream << printScriptDebug( " Done." ) << endl;
+ *m_stream << "\n# Rules:" << endl;
+ if ( m_iptDoc->useFilter() ) {
+ printScriptTableRules( m_iptDoc->table( Constants::FilterTable_Name ) );
+ *m_stream << endl;
+ }
+ if ( m_iptDoc->useNat() ) {
+ printScriptTableRules( m_iptDoc->table( Constants::NatTable_Name ) );
+ *m_stream << endl;
+ }
+ if ( m_iptDoc->useMangle() ) {
+ printScriptTableRules( m_iptDoc->table( Constants::MangleTable_Name ) );
+ *m_stream << endl;
+ }
+
+ if ( m_iptDoc->useIPFwd() ) {
+ *m_stream << "\n"<< printScriptDebug( "Enable IP Forwarding. ", false ) << endl;
+ *m_stream << "echo 1 > /proc/sys/net/ipv4/ip_forward" << endl;
+ *m_stream << printScriptDebug( "Done." ) << endl;
+ } else {
+ *m_stream << printScriptDebug( "Disable IP Forwarding. ", false ) << endl;
+ *m_stream << "echo 0 > /proc/sys/net/ipv4/ip_forward" << endl;
+ *m_stream << printScriptDebug( "Done.") << endl;
+ }
+
+ if ( m_iptDoc->useRPFilter() ) {
+
+ *m_stream << "\n" << printScriptDebug( "Enable Reverse Path Filtering ", false ) << endl;
+ *m_stream << "for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do" << endl;
+ *m_stream << "echo 2 > $i " << endl;
+ *m_stream << "done" << endl;
+ *m_stream << printScriptDebug( "Done." ) << endl;
+ } else {
+ *m_stream << printScriptDebug( "Disable Reverse Path Filtering ", false ) << endl;
+ *m_stream << "for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do" << endl;
+ *m_stream << "echo 0 > $i " << endl;
+ *m_stream << "done" << endl;
+ *m_stream << printScriptDebug( "Done." ) << endl;
+ }
+
+ if ( m_iptDoc->useMartians() ) {
+ *m_stream << "\n" << printScriptDebug( "Enable log_martians (logging). ", false ) << endl;
+ *m_stream << "for i in /proc/sys/net/ipv4/conf/*/log_martians ; do" << endl;
+ *m_stream << "echo 1 > $i " << endl;
+ *m_stream << "done" << endl;
+ *m_stream << printScriptDebug( "Done." ) << endl;
+ } else {
+ *m_stream << printScriptDebug( "Disable log_martians (logging). ", false ) << endl;
+ *m_stream << "for i in /proc/sys/net/ipv4/conf/*/log_martians ; do" << endl;
+ *m_stream << "echo 0 > $i " << endl;
+ *m_stream << "done" << endl;
+ *m_stream << printScriptDebug( "Done." ) << endl;
+ }
+
+ if ( m_iptDoc->useSynCookies() ) {
+ *m_stream << "\n" << printScriptDebug( "Enable Syn Cookies. ", false ) << endl;
+ *m_stream << "echo 1 > /proc/sys/net/ipv4/tcp_syncookies" << endl;
+ *m_stream << printScriptDebug( "Done." )<< endl;
+ } else {
+ *m_stream << printScriptDebug( "Disable Syn Cookies. ", false ) << endl;
+ *m_stream << "echo 0 > /proc/sys/net/ipv4/tcp_syncookies" << endl;
+ *m_stream << printScriptDebug( "Done." ) << endl;
+ }
+ *m_stream << "echo Done." << endl;
+ *m_stream << "}" << endl;
+}
+
+void KMFIPTablesScriptGenerator::printScriptStopFunction() {
+ *m_stream << "stopFirewall() {\n"
+ " echo -n \"Clearing iptables (created by KMyFirewall)... \"\n" << endl;
+ if ( m_iptDoc->useFilter() ) {
+ *m_stream << " $IPT -t filter -F || status=\"1\"\n"
+ " $IPT -t filter -X || status=\"1\"\n"
+ " $IPT -t filter -P INPUT ACCEPT || status=\"1\"\n"
+ " $IPT -t filter -P OUTPUT ACCEPT || status=\"1\"\n"
+ " $IPT -t filter -P FORWARD ACCEPT || status=\"1\"\n"<< endl;
+ }
+ if ( m_iptDoc->useNat() ) {
+ *m_stream << " $IPT -t nat -F || status=\"1\"\n"
+ " $IPT -t nat -X || status=\"1\"\n"
+ " $IPT -t nat -P OUTPUT ACCEPT || status=\"1\"\n"
+ " $IPT -t nat -P PREROUTING ACCEPT || status=\"1\"\n"
+ " $IPT -t nat -P POSTROUTING ACCEPT || status=\"1\"\n"<< endl;
+ }
+ if ( m_iptDoc->useMangle() ) {
+ *m_stream << " $IPT -t mangle -F || status=\"1\"\n"
+ " $IPT -t mangle -X || status=\"1\"\n"
+ " $IPT -t mangle -P INPUT ACCEPT || status=\"1\"\n"
+ " $IPT -t mangle -P OUTPUT ACCEPT || status=\"1\"\n"
+ " $IPT -t mangle -P OUTPUT ACCEPT || status=\"1\"\n"
+ " $IPT -t mangle -P PREROUTING ACCEPT || status=\"1\"\n"
+ " $IPT -t mangle -P POSTROUTING ACCEPT || status=\"1\"\n" << endl;
+ }
+ *m_stream << " echo \"Done.\"\n" << endl;
+ *m_stream << "}" << endl;
+}
+
+
+
+
+void KMFIPTablesScriptGenerator::printScriptTableChainDefinition( IPTable *tbl ) {
+ for ( uint i = 0;i < tbl->chains().count();i++ ) {
+ IPTChain* c = tbl->chains().at( i );
+ if ( !c->isBuildIn() ) {
+ *m_stream << "\n# Create Chain: " + c->name() << endl;
+ QString s2 = c->createIPTablesChainDefinition();
+ if ( !s2.isEmpty() ) {
+ *m_stream << s2 << " || { status=\"1\"; echo \"Setting up Chain: " + c->name() + " FAILED !!!\"; echo \"Ann Error occoured! Clearing rules\"; stopFirewall; exit 1; }\n";
+ }
+ }
+ }
+}
+
+void KMFIPTablesScriptGenerator::printScriptTableRules( IPTable *tbl ) {
+ *m_stream << printScriptDebug( "Settup Rules in Table " + tbl->name().upper() + ":" ) << "\n" << endl;
+ for ( uint i = 0;i < tbl->chains().count();i++ ) {
+ IPTChain* c = tbl->chains().at( i );
+ *m_stream << "\n# Define Rules for Chain: " + c->name() << endl ;
+ *m_stream << printScriptDebug( "Create Rules for Chain: " + c->name() ) + " " << endl;
+ QPtrList<QStringList> rules = c->createIPTablesChainRules();
+ QStringList* curr_rule;
+ QString rule_name;
+ for ( curr_rule = rules.first(); curr_rule; curr_rule = rules.next() ) {
+ rule_name = *curr_rule->at( 0 );
+ QString s = *curr_rule->at( 1 );
+ if ( !s.isEmpty() ) {
+ *m_stream << s << " || { status=\"1\"; echo \" Setting up Rule: " + rule_name + " FAILED! Clearing Rules!\"; stopFirewall; exit 1; }\n" << endl;
+ }
+ }
+ }
+}
+
+void KMFIPTablesScriptGenerator::printScriptModuleLoad() {
+ *m_stream << "\n";
+ *m_stream << printScriptDebug( "\nLoading needed modules... ", false ) << endl;
+ *m_stream <<
+ "$MOD ip_tables \n"
+ "$MOD ip_conntrack \n"
+ "$MOD ipt_LOG \n"
+ "$MOD ipt_limit \n"
+ "$MOD ipt_state \n"
+ "$MOD ip_conntrack_ftp\n"
+ "$MOD ip_conntrack_irc\n"
+ << endl;
+ if ( m_iptDoc->useFilter() ) {
+ *m_stream << "$MOD iptable_filter" << endl;
+ }
+ if ( m_iptDoc->useNat() ) {
+ *m_stream << "$MOD iptable_nat" << endl;
+
+ }
+ if ( m_iptDoc->useMangle() ) {
+ *m_stream << "$MOD iptable_mangle" << endl;
+ }
+ *m_stream << printScriptDebug( "Done.") << endl;
+}
+
+void KMFIPTablesScriptGenerator::printScriptHeader() {
+ KMFTarget *tg = m_iptDoc->target();
+ QString version = KMYFIREWALL_VERSION;
+ QString copyright_string = COPYRIGHT_STRING;
+ QString maintainer = MAINTAINER;
+ QString license = LICENSE;
+ *m_stream <<
+ "#!/bin/sh\n"
+ "#\n"
+ "# " + copyright_string + "\n"
+ "# Please report bugs to: " + maintainer + "\n"
+ "#\n"
+ "# " + license + "\n"
+ "#\n"
+ "# KMyFirewall v" + version + "\n"
+ "# This is an automatic generated file DO NOT EDIT\n" +
+ "#\n" +
+ "# Configuration created for " + tg->toFriendlyString() + "\n" +
+ "#\n" << endl;
+}
+
+
+const QString& KMFIPTablesScriptGenerator::printScriptDebug( const QString& msg, bool newLine ) {
+ QString script;
+ *m_stream << "if [ \"$verbose\" = \"1\" ]; then\n" ;
+ *m_stream << "echo " ;
+ if ( ! newLine )
+ *m_stream << "-n " ;
+ *m_stream << "\"" + msg +"\"\n";
+ *m_stream << "fi\n" << endl;
+ return *(new QString( script ) );
+}
+
+}
+
diff --git a/kmyfirewall/compilers/iptables/kmfiptablesscriptgenerator.h b/kmyfirewall/compilers/iptables/kmfiptablesscriptgenerator.h
new file mode 100644
index 0000000..de789e2
--- /dev/null
+++ b/kmyfirewall/compilers/iptables/kmfiptablesscriptgenerator.h
@@ -0,0 +1,60 @@
+//
+// C++ Interface: kmfiptablesscriptgenerator
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+// License: GPL
+//
+#ifndef KMFIPTABLESSCRIPTGENERATOR_H
+#define KMFIPTABLESSCRIPTGENERATOR_H
+
+/**
+@author Christian Hubinger
+*/
+// QT includes
+#include <qstring.h>
+#include <qobject.h>
+#include <qtextstream.h>
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+namespace KMF {
+class IPTable;
+class KMFIPTDoc;
+
+class KMFIPTablesScriptGenerator{
+public:
+ KMFIPTablesScriptGenerator();
+
+ ~KMFIPTablesScriptGenerator();
+
+ const QString& compile( KMFIPTDoc* );
+
+
+private:
+ // Script Generating methods, acting on m_stream
+ void printScriptTableRules( IPTable *tbl );
+ void printScriptTableChainDefinition( IPTable *tbl );
+ void printScriptStartFunction();
+ void printScriptStopFunction();
+ void printScriptModuleLoad();
+ void printScriptHeader();
+ void printScriptExecLogic();
+
+ const QString& printScriptDebug( const QString&, bool newLine = true);
+
+
+private: // DATA
+ KMFIPTDoc *m_iptDoc;
+ QTextOStream *m_stream;
+};
+}
+#endif
diff --git a/kmyfirewall/compilers/kmfcompilerplugin.desktop b/kmyfirewall/compilers/kmfcompilerplugin.desktop
new file mode 100644
index 0000000..f3f9292
--- /dev/null
+++ b/kmyfirewall/compilers/kmfcompilerplugin.desktop
@@ -0,0 +1,47 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=ServiceType
+X-KDE-ServiceType=KMyFirewall/Compiler
+X-KDE-Library=libkmfcompilerplugin
+Name=KMyFirewall Compiler Plugin
+Name[bg]=Приставка-компилатор за KMyFirewall
+Name[br]=Lugent dastumer KMyFirewall
+Name[bs]=KMyFirewall kompajler dodatak
+Name[ca]=Connector de compilació per a KMyFirewall
+Name[cs]=Modul KMyFirewall kompilátoru
+Name[da]=KMyFirewall kompilering-plugin
+Name[de]=KMyFirewall Compiler-Erweiterung
+Name[el]=Πρόσθετο μεταγλωττιστή για το KMyFirewall
+Name[es]=Complemento de compilación de KMyFirewall
+Name[et]=KMyFirewalli kompileerimisplugin
+Name[fr]=Module de compilation de KMyFirewall
+Name[gl]=Extensión de Compilazón de KMyFirewall
+Name[hi]=के-माइ-फायरवाल कम्पाइलर प्लगइन
+Name[hu]=KMyFirewall fordítóprogram-modul
+Name[it]=Plugin di compilazione per KMyFirewall
+Name[ja]=KMyFirewall コンパイラ プラグイン
+Name[ka]=KMyFirewall კომპილატორის მოდული
+Name[lt]=KMyFirewall kompiliatoriaus priedas
+Name[pa]=KMyFirewall ਕੰਪਾਇਲਰ ਪਲੱਗਿੰਨ
+Name[pl]=Wtyczka kompilatora KMyFirewall
+Name[pt]='Plugin' de Compilação do KMyFirewall
+Name[pt_BR]=Plug-in do Compilador KMyFirewall
+Name[ru]=Модуль компилирования KMyFirewall
+Name[sr]=KMyFirewall-ов прикључак за превођење
+Name[sr@Latn]=KMyFirewall-ov priključak za prevođenje
+Name[sv]=Kompileringsinsticksprogram för Min brandvägg
+Name[ta]=KMyதீச்சுவ்ர் தொகுப்பியைச் சொருகு
+Name[tr]=KMyFirewall Derleme Eklentisi
+Name[uk]=Втулок компілятора KMyFirewall
+Name[xx]=xxKMyFirewall Compiler Pluginxx
+Name[zh_CN]=KMyFirewall 编辑器插件
+
+[PropertyDef::X-KMyFirewall-Platform]
+Type=QString
+
+[PropertyDef::X-KMyFirewall-Language]
+Type=QString
+
+
+
+
diff --git a/kmyfirewall/compilers/pf/Makefile.am b/kmyfirewall/compilers/pf/Makefile.am
new file mode 100644
index 0000000..793906e
--- /dev/null
+++ b/kmyfirewall/compilers/pf/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = $(all_includes) -l../../core
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfcompiler_pf.la
+libkmfcompiler_pf_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+libkmfcompiler_pf_la_SOURCES = kmfpfcompiler.cpp kmfpfscriptgenerator.cpp
+libkmfcompiler_pf_la_LIBADD = \
+ $(LIB_KPARTS) ../../kmfwidgets/libkmfwidgets.la ../../core/libkmfcore.la
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfcompiler_pf.desktop
+
+pluginsdir = $(kde_datadir)/kmyfirewall/kpartplugins
+plugins_DATA = kmfpfcompiler.rc
diff --git a/kmyfirewall/compilers/pf/kmfcompiler_pf.desktop b/kmyfirewall/compilers/pf/kmfcompiler_pf.desktop
new file mode 100644
index 0000000..0c4ffa6
--- /dev/null
+++ b/kmyfirewall/compilers/pf/kmfcompiler_pf.desktop
@@ -0,0 +1,61 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Comment=Plugin for compiling KMFGenericDoc to an OpenBSD pf scriptfile
+Comment[bg]=Приставка за компилиране на KMFGenericDoc файлове до pf скриптови файлове на OpenBSD
+Comment[ca]=Connector de compilació KMFGenericDoc per a un fitxer script pf de OpenBSD
+Comment[cs]=Modul pro kompilaci KMFGenericDoc do OpenBSD pf skriptového souboru
+Comment[da]=Plugin til at kompilere KMFGenericDoc til en OpenBSD pf-scriptfil
+Comment[de]=Modul zum Kompilieren eines KMFGenericDoc in eine OpenBSD pf-Skriptdatei
+Comment[el]=Πρόσθετο μεταγλώττισης KMFGenericDoc σε αρχείο σεναρίου OpenBSD pf
+Comment[es]=Un complemento para compilar KMFGenericDoc a un script pf de OpenBSD
+Comment[et]=Plugin KMFGenericDoc kompileerimiseks OpenBSD pf skriptifaili
+Comment[fr]=Module de compilation de KMFGenericDoc vers un fichier de script OpenBSD pf
+Comment[gl]=Extensión para compilar un KMFGenericDoc nun guión pf de OpenBSD
+Comment[hi]=केएमएफ-जेनेरिक-डॉक को एक ओपन-बीएसडी पीएफ़ स्क्रिप्ट-फाइल में कम्पाइल करने हेतु प्लगइन
+Comment[it]=Plugin per compilare un documento generico di KMyFirewall in un file script di OpenBSD pf
+Comment[ka]=KMFGenericDoc-ის OpenBSD pf scriptfile-ად დამკომპილირებელი მოდული
+Comment[nl]=Plugin voor het compileren van KMFGenericDoc naar een OpenBSD pf scriptbestand
+Comment[pl]=Wtyczka do kompilacji KMFGenericDoc do skryptu OpenBSD pf
+Comment[pt]=Um 'plugin' para compilar o KMFGenericDoc para um ficheiro do OpenBSD pf
+Comment[pt_BR]=Plug-in para a compilação KMFGenericDoc para um arquivo de scripts do OpenBSD pf
+Comment[sr]=Прикључак за превођење KMFGenericDoc-а у OpenBSD pf скрипту
+Comment[sr@Latn]=Priključak za prevođenje KMFGenericDoc-a u OpenBSD pf skriptu
+Comment[sv]=Insticksprogram för att kompilera generella dokument i Min brandvägg till OpenBSD pf-skriptfiler
+Comment[ta]= தொகுத்த KMFபிறப்பு ஆவணத்திலிருந்துத் திறந்தBSD எழுத்துக்கோப்பினைச் சொருகு
+Comment[tr]=KMFGenericDoc dosyasını, OpenBSD pf betik dosyasına derlemek için eklenti
+Comment[uk]=Втулок для компілювання KMFGenericDoc до скриптфайла pf OpenBSD
+Comment[xx]=xxPlugin for compiling KMFGenericDoc to an OpenBSD pf scriptfilexx
+Name=KMyFirewall OpenBSD pf Compiler
+Name[bg]=Компилатор на OpenBSD pf файлове на KMyFirewall
+Name[br]=Dastumer pf OpenBSD KMyFirewall
+Name[ca]=Compilador pf de OpenBSD per a KMyFirewall
+Name[cs]=KMyFirewall OpenBSD pf kompilátor
+Name[da]=KMyFirewall OpenBSD pf-kompilering
+Name[de]=KMyFirewall OpenBSD-pf-Compiler
+Name[el]=Μεταγλωττιστής OpenBSD pf για το KMyFirewall
+Name[es]=Compilador para el pf de OpenBSD de KMyFirewall
+Name[et]=KMyFirewalli OpenBSD pf kompilaator
+Name[fr]=Compilateur pf OpenBSD de KMyFirewall
+Name[gl]=Compilador pf de OpenBSD de KMyFirewall
+Name[hi]=के-माइ-फायरवाल ओपन-बीएसडी कम्पाइलर
+Name[it]=Compilatore per OpenBSD pf di KMyFirewall
+Name[ja]=KMyFirewall OpenBSD pf コンパイラ
+Name[ka]=KMyFirewall OpenBSD pf კომპილატორი
+Name[pa]=KMyFirewall OpenBSD pf ਕੰਪਾਇਲਰ
+Name[pl]=Kompilator KMyFirewall OpenBSD pf
+Name[pt]=Compilador para OpenBSD pf do KMyFirewall
+Name[pt_BR]=Compilador OpenBSD do KMyFirewall
+Name[ru]=KMyFirewall - Компилятор OpenBSD pf
+Name[sr]=KMyFirewall-ов преводилац за OpenBSD pf
+Name[sr@Latn]=KMyFirewall-ov prevodilac za OpenBSD pf
+Name[sv]=OpenBSD pf-kompilator för Min brandvägg
+Name[ta]=KMyதீச்சுவர் திறந்தBSD பிஎப்பை சொருகு
+Name[tr]=KMyFirewall OpenBSD pf Derleyici
+Name[uk]=Компілятор KMyFirewall для OpenBSD pf
+Name[xx]=xxKMyFirewall OpenBSD pf Compilerxx
+X-KDE-Library=libkmfcompiler_pf
+ServiceTypes=KMyFirewall/Compiler
+X-KMyFirewall-Platform=openbsd
+X-KMyFirewall-Language=pf
diff --git a/kmyfirewall/compilers/pf/kmfpfcompiler.cpp b/kmyfirewall/compilers/pf/kmfpfcompiler.cpp
new file mode 100644
index 0000000..cfe4f68
--- /dev/null
+++ b/kmyfirewall/compilers/pf/kmfpfcompiler.cpp
@@ -0,0 +1,462 @@
+//
+// C++ Implementation: kmfpfcompiler
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <e9806056@student.tuwien.ac.at>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfpfcompiler.h"
+
+// QT includes
+#include <qptrlist.h>
+#include <qstringlist.h>
+#include <qmultilineedit.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/kmfgenericdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetzone.h"
+#include "../../core/kmfnethost.h"
+#include "../../core/kmfprotocol.h"
+#include "../../core/kmferror.cpp"
+#include "../../core/kmfprotocol.h"
+#include "../../core/kmfprotocolusage.h"
+
+#include "../../kmfwidgets/kmflistview.h"
+namespace KMF {
+
+KMFPFCompiler::KMFPFCompiler( QObject* parent, const char* name ) : KMFPlugin( parent, name ) {
+ m_osName = "openbsd";
+ m_osGUIName = "OpenBSD";
+ m_backendName = "pf";
+ m_backendGUIName = "PF";
+
+
+
+ if ( genericDoc() ) {
+ new KAction( i18n( "Export as &PF (OpenBSD) Script" ), "fileexport",
+ 0, this, SLOT( slotExportPF() ), actionCollection(), "compile_pf" );
+
+ setXMLFile( "kmfpfcompiler.rc" );
+ kdDebug() << "KMFPFCompiler: Finished initialisation." << endl;
+ }
+}
+
+
+KMFPFCompiler::~KMFPFCompiler() {}
+
+const QString& KMFPFCompiler::osName(){
+ return m_osName;
+}
+const QString& KMFPFCompiler::osGUIName(){
+ return m_osGUIName;
+}
+const QString& KMFPFCompiler::backendName(){
+ return m_backendName;
+}
+const QString& KMFPFCompiler::backendGUIName(){
+ return m_backendGUIName;
+}
+
+
+void KMFPFCompiler::compile() {
+ kdDebug() << "void KMFPFCompiler::compile()" << endl;
+ kdDebug() << "Doc XML:\n" << m_doc->getXMLSniplet() << endl;
+
+}
+
+void KMFPFCompiler::slotExportPF() {
+ kdDebug() << "KMFPFCompiler::slotExportIPT()" << endl;
+ QString s = compile( genericDoc() );
+ kdDebug() << "Generated scrip: " << s << endl;
+}
+
+const QString& KMFPFCompiler::compile( KMFGenericDoc* gendoc ) {
+ kdDebug() << "const QString& KMFPFCompiler::compile( KMFGenericDoc* doc )" << endl;
+ if ( gendoc ) {
+ m_compiledScript = "";
+
+ setupNatRules( gendoc );
+
+ setupLocalhostRules();
+
+ setupInAndOutHosts( gendoc->trustedHostsZone(), "pass" );
+ setupInAndOutHosts( gendoc->maliciousHostsZone(), "block" );
+ setupForbiddenHosts( gendoc->badClientsHostsZone(), "in" );
+ setupForbiddenHosts( gendoc->badServersHostsZone(), "out" );
+ setupICMPRules( gendoc );
+
+ createIncommingACCESSRules( 0, gendoc );
+ createOutgoingACCESSRules( 0, gendoc );
+ setupPolicies( gendoc );
+ kdDebug() << "Return compiled pf:\n " << m_compiledScript << endl;
+ return m_compiledScript;
+ } else {
+ return *( new QString( "ERROR: Couldn't compile document - may be wrong type " ) );
+ }
+}
+
+void KMFPFCompiler::setupInAndOutHosts( KMFNetZone* zone , const QString& cmd ) {
+ kdDebug() << "KMFPFCompiler::setupInAndOutHosts( KMFNetZone* )" << endl;
+ if ( zone->hosts().count() == 0 ) {
+ return;
+ }
+
+ QPtrListIterator<KMFTarget> it ( zone->hosts() );
+ if ( cmd == "pass" ) {
+ m_compiledScript.append( "\n# Trusted Hosts\n" );
+ } else {
+ m_compiledScript.append( "\n# Maliciuous Hosts\n" );
+ }
+
+ while ( it.current() ) {
+ KMFNetHost *host = dynamic_cast<KMFNetHost*> ( *it );
+ ++it;
+
+ if ( cmd == "pass" ) {
+ m_compiledScript.append( "pass in quick from " );
+ m_compiledScript.append( host->address()->toString() );
+ m_compiledScript.append( " to any keep state\n" );
+ } else {
+ m_compiledScript.append( "block in quick from " );
+ m_compiledScript.append( host->address()->toString() );
+ m_compiledScript.append( " to any\n" );
+ }
+ }
+}
+
+void KMFPFCompiler::setupForbiddenHosts( KMFNetZone* zone, const QString& inOut ) {
+ if ( zone->hosts().count() == 0 ) {
+ return;
+ }
+
+ QPtrListIterator<KMFTarget> it ( zone->hosts() );
+ if ( inOut == "in" ) {
+ m_compiledScript.append( "\n# Forbidden Clients\n" );
+ } else {
+ m_compiledScript.append( "\n# Forbidden Server\n" );
+ }
+
+ while ( it.current() ) {
+ KMFNetHost *host = dynamic_cast<KMFNetHost*> ( *it );
+ ++it;
+ if ( inOut == "in" ) {
+ m_compiledScript.append( "block in quick from " );
+ m_compiledScript.append( host->address()->toString() );
+ m_compiledScript.append( " to any\n" );
+ } else {
+ m_compiledScript.append( "block out quick from any to " );
+ m_compiledScript.append( host->address()->toString() );
+ m_compiledScript.append( "\n" );
+ }
+ }
+}
+
+void KMFPFCompiler::setupICMPRules( KMFGenericDoc* doc ) {
+ if ( ! doc->allowPingReply() ) {
+ return;
+ }
+ m_compiledScript.append( "\n# Allow ping\n" );
+ m_compiledScript.append( "pass in quick inet proto icmp all icmp-type { 0, 3, 11 } keep state\n" );
+}
+
+void KMFPFCompiler::setupLocalhostRules() {
+ m_compiledScript.append( "\n# Allow loopback traffic\n" );
+ m_compiledScript.append( "pass in quick on lo0 from 127.0.0.1 to 127.0.0.1 keep state\n" );
+ m_compiledScript.append( "pass out quick on lo0 from 127.0.0.1 to 127.0.0.1 keep state\n" );
+}
+
+void KMFPFCompiler::createIncommingACCESSRules( KMFNetZone* zone, KMFGenericDoc* doc ) {
+ kdDebug() << "void KMFPFCompiler::createIncommingACCESSRules( KMFNetZone* zone, KMFGenericDoc* doc )" << endl;
+ if ( ! doc->allowIncomingConnections() ) {
+ return;
+ }
+ if ( zone == 0 ) {
+ m_compiledScript.append( QString("\n# Settup Inncomming Connection access rules\n") );
+ zone = doc->incomingZone();
+ }
+
+ QPtrList<KMFNetZone>& children = zone->zones();
+ QPtrListIterator<KMFNetZone> it( children );
+ while( it.current() ) {
+ createIncommingACCESSRules( it.current(), doc );
+ ++it;
+ }
+
+ QPtrList<KMFTarget>& zoneHosts = zone->hosts();
+ QPtrListIterator<KMFTarget> itZoneHosts ( zoneHosts );
+ while ( itZoneHosts.current() ) {
+ KMFNetHost* host = dynamic_cast<KMFNetHost*> ( itZoneHosts.current() );
+ ++itZoneHosts;
+ m_compiledScript.append( QString("\n# Settup rules for host %1 [%2]\n").arg( host->guiName() ).arg( zone->address()->toString() ) );
+
+ QPtrList<KMFProtocolUsage>& hostProts = host->protocols();
+ QPtrListIterator<KMFProtocolUsage> itHostProtocols ( hostProts );
+ while ( itHostProtocols.current() ) {
+ KMFProtocolUsage* prot = itHostProtocols.current();
+ ++itHostProtocols;
+ if ( ! host->protocolInherited( prot->protocol()->uuid() ) ) {
+ m_compiledScript.append( QString("# Settup rules for protocol %1\n").arg( prot->protocol()->name() ) );
+ if ( prot->protocol()->tcpPorts().count() > 0 ) {
+ m_compiledScript.append( "pass in " );
+ if ( prot->logging() || host->logIncoming() ) {
+ m_compiledScript.append( " log " );
+ }
+ m_compiledScript.append( " quick inet proto tcp from " );
+ m_compiledScript.append( zone->address()->toString() );
+ m_compiledScript.append( "/32 " );
+ m_compiledScript.append( " to any " );
+ m_compiledScript.append( " port " );
+ m_compiledScript.append( getPortList( prot->protocol()->tcpPorts() ) );
+ m_compiledScript.append( " synproxy state\n" );
+ }
+ if ( prot->protocol()->udpPorts().count() > 0 ) {
+ m_compiledScript.append( "pass in " );
+ if ( prot->logging() || host->logIncoming() ) {
+ m_compiledScript.append( " log " );
+ }
+ m_compiledScript.append( " quick inet proto udp from " );
+ m_compiledScript.append( zone->address()->toString() );
+ m_compiledScript.append( "/32" );
+ m_compiledScript.append( " to any " );
+ m_compiledScript.append( " port " );
+ m_compiledScript.append( getPortList( prot->protocol()->udpPorts() ) );
+ m_compiledScript.append( " keep state\n" );
+ }
+ } else {
+ kdDebug() << "Skipping inherited Portocol: " << prot->protocol()->name() << " in zone: " << zone->guiName() << endl;
+ }
+ }
+ }
+
+ m_compiledScript.append( QString("\n# Settup rules for zone %1 [%2/%3]\n").arg( zone->guiName() ).arg( zone->address()->toString() ).arg( zone->maskLength() ) );
+ QPtrList<KMFProtocolUsage>& zoneProts = zone->protocols();
+ QPtrListIterator<KMFProtocolUsage> itZoneProtocols ( zoneProts );
+ while ( itZoneProtocols.current() ) {
+ KMFProtocolUsage* prot = itZoneProtocols.current();
+ ++itZoneProtocols;
+ if ( ! zone->protocolInherited( prot->protocol()->uuid() ) ) {
+ m_compiledScript.append( QString("# Settup rules for protocol %1\n").arg( prot->protocol()->name() ) );
+ if ( prot->protocol()->tcpPorts().count() > 0 ) {
+ m_compiledScript.append( "pass in " );
+ if ( prot->logging() ) {
+ m_compiledScript.append( " log " );
+ }
+ m_compiledScript.append( " quick inet proto tcp from " );
+ m_compiledScript.append( zone->address()->toString() );
+ m_compiledScript.append( "/" );
+ m_compiledScript.append( QString::number( zone->maskLength() ) );
+ m_compiledScript.append( " to any " );
+ m_compiledScript.append( " port " );
+ m_compiledScript.append( getPortList( prot->protocol()->tcpPorts() ) );
+ m_compiledScript.append( " synproxy state\n" );
+ }
+ if ( prot->protocol()->udpPorts().count() > 0 ) {
+ m_compiledScript.append( "pass in " );
+ if ( prot->logging() ) {
+ m_compiledScript.append( " log " );
+ }
+ m_compiledScript.append( " quick inet proto udp from " );
+ m_compiledScript.append( zone->address()->toString() );
+ m_compiledScript.append( "/" );
+ m_compiledScript.append( QString::number( zone->maskLength() ) );
+ m_compiledScript.append( " to any " );
+ m_compiledScript.append( " port " );
+ m_compiledScript.append( getPortList( prot->protocol()->udpPorts() ) );
+ m_compiledScript.append( " keep state\n" );
+ }
+ } else {
+ kdDebug() << "Skipping inherited Portocol: " << prot->protocol()->name() << " in zone: " << zone->guiName() << endl;
+ }
+ }
+}
+
+void KMFPFCompiler::createOutgoingACCESSRules( KMFNetZone* zone, KMFGenericDoc* doc ) {
+ kdDebug() << "void KMFPFCompiler::createOutgoingACCESSRules( KMFNetZone* zone, KMFGenericDoc* doc )" << endl;
+ if ( ! doc->restrictOutgoingConnections() ) {
+ return;
+ }
+ if ( zone == 0 ) {
+ m_compiledScript.append( QString("\n# Settup Outgoing Connection access rules\n") );
+ zone = doc->outgoingZone();
+ }
+
+ QPtrList<KMFNetZone>& children = zone->zones();
+ QPtrListIterator<KMFNetZone> it( children );
+ while( it.current() ) {
+ createIncommingACCESSRules( it.current(), doc );
+ ++it;
+ }
+
+ QPtrList<KMFTarget>& zoneHosts = zone->hosts();
+ QPtrListIterator<KMFTarget> itZoneHosts ( zoneHosts );
+ while ( itZoneHosts.current() ) {
+ KMFNetHost* host = dynamic_cast<KMFNetHost*> ( itZoneHosts.current() );
+ ++itZoneHosts;
+ m_compiledScript.append( QString("\n# Settup rules for host %1 [%2]\n").arg( host->guiName() ).arg( zone->address()->toString() ) );
+
+ QPtrList<KMFProtocolUsage>& hostProts = host->protocols();
+ QPtrListIterator<KMFProtocolUsage> itHostProtocols ( hostProts );
+ while ( itHostProtocols.current() ) {
+ KMFProtocolUsage* prot = itHostProtocols.current();
+ ++itHostProtocols;
+ if ( ! host->protocolInherited( prot->protocol()->uuid() ) ) {
+ m_compiledScript.append( QString("# Settup rules for protocol %1\n").arg( prot->protocol()->name() ) );
+ if ( prot->protocol()->tcpPorts().count() > 0 ) {
+ m_compiledScript.append( "pass out " );
+ if ( prot->logging() || host->logIncoming() ) {
+ m_compiledScript.append( " log " );
+ }
+ m_compiledScript.append( " quick inet proto tcp from " );
+ m_compiledScript.append( zone->address()->toString() );
+ m_compiledScript.append( "/32 " );
+ m_compiledScript.append( " to any " );
+ m_compiledScript.append( " port " );
+ m_compiledScript.append( getPortList( prot->protocol()->tcpPorts() ) );
+ m_compiledScript.append( " synproxy state\n" );
+ }
+ if ( prot->protocol()->udpPorts().count() > 0 ) {
+ m_compiledScript.append( "pass out " );
+ if ( prot->logging() || host->logIncoming() ) {
+ m_compiledScript.append( " log " );
+ }
+ m_compiledScript.append( " quick inet proto udp from " );
+ m_compiledScript.append( zone->address()->toString() );
+ m_compiledScript.append( "/32" );
+ m_compiledScript.append( " to any " );
+ m_compiledScript.append( " port " );
+ m_compiledScript.append( getPortList( prot->protocol()->udpPorts() ) );
+ m_compiledScript.append( " keep state\n" );
+ }
+ } else {
+ kdDebug() << "Skipping inherited Portocol: " << prot->protocol()->name() << " in zone: " << zone->guiName() << endl;
+ }
+ }
+ }
+
+ m_compiledScript.append( QString("\n# Settup rules for zone %1 [%2/%3]\n").arg( zone->guiName() ).arg( zone->address()->toString() ).arg( zone->maskLength() ) );
+ QPtrList<KMFProtocolUsage>& zoneProts = zone->protocols();
+ QPtrListIterator<KMFProtocolUsage> itZoneProtocols ( zoneProts );
+ while ( itZoneProtocols.current() ) {
+ KMFProtocolUsage* prot = itZoneProtocols.current();
+ ++itZoneProtocols;
+ if ( ! zone->protocolInherited( prot->protocol()->uuid() ) ) {
+ m_compiledScript.append( QString("# Settup rules for protocol %1\n").arg( prot->protocol()->name() ) );
+ if ( prot->protocol()->tcpPorts().count() > 0 ) {
+ m_compiledScript.append( "pass out " );
+ if ( prot->logging() ) {
+ m_compiledScript.append( " log " );
+ }
+ m_compiledScript.append( " quick inet proto tcp from " );
+ m_compiledScript.append( zone->address()->toString() );
+ m_compiledScript.append( "/" );
+ m_compiledScript.append( QString::number( zone->maskLength() ) );
+ m_compiledScript.append( " to any " );
+ m_compiledScript.append( " port " );
+ m_compiledScript.append( getPortList( prot->protocol()->tcpPorts() ) );
+ m_compiledScript.append( " synproxy state\n" );
+ }
+ if ( prot->protocol()->udpPorts().count() > 0 ) {
+ m_compiledScript.append( "pass out " );
+ if ( prot->logging() ) {
+ m_compiledScript.append( " log " );
+ }
+ m_compiledScript.append( " quick inet proto udp from " );
+ m_compiledScript.append( zone->address()->toString() );
+ m_compiledScript.append( "/" );
+ m_compiledScript.append( QString::number( zone->maskLength() ) );
+ m_compiledScript.append( " to any " );
+ m_compiledScript.append( " port " );
+ m_compiledScript.append( getPortList( prot->protocol()->udpPorts() ) );
+ m_compiledScript.append( " keep state\n" );
+ }
+ } else {
+ kdDebug() << "Skipping inherited Portocol: " << prot->protocol()->name() << " in zone: " << zone->guiName() << endl;
+ }
+ }
+}
+
+
+
+QString KMFPFCompiler::getPortList( QValueList<int>& list ) {
+ QString ret = "{";
+ QValueList<int>::iterator ports;
+ uint i = 0;
+ for( ports = list.begin(); ports != list.end(); ++ports ) {
+ ret.append( QString::number( *ports ) );
+ if ( i != list.count() - 1 ) {
+ ret.append( ", " );
+ }
+ i++;
+ }
+ ret.append( "}" );
+ return ret;
+}
+
+
+
+void KMFPFCompiler::setupPolicies( KMFGenericDoc* doc ) {
+ m_compiledScript.append( "\n# Default action for unhandled packets\n" );
+ m_compiledScript.append( "block in quick\n" );
+ if ( doc->restrictOutgoingConnections() ) {
+ m_compiledScript.append( "block out quick\n" );
+ } else {
+ m_compiledScript.append( "pass out quick all keep state\n" );
+ }
+}
+
+void KMFPFCompiler::setupNatRules( KMFGenericDoc* doc ) {
+ if ( ! doc->useNat() ) {
+ return;
+ }
+
+ m_compiledScript.append( "\n# Setup NAT\n" );
+ if ( doc->useMasquerade() ) {
+ m_compiledScript.append( QString("nat on %1 from any to any -> (%2)\n").arg( doc->outgoingInterface() ).arg( doc->outgoingInterface() ) );
+ } else {
+ m_compiledScript.append( QString("nat on %1 from any to any -> %2\n").arg( doc->outgoingInterface() ).arg( doc->natAddress()->toString() ) );
+ }
+
+
+}
+
+// KInstance* KMFPFCompilerFactory::s_instance = 0L;
+// KAboutData* KMFPFCompilerFactory::s_about = 0L;
+
+KMFPFCompilerFactory::KMFPFCompilerFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFPFCompilerFactory" );
+}
+
+QObject* KMFPFCompilerFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFPFCompiler( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFPFCompilerFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFPFCompilerFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfcompiler_pf() {
+ return new KMFPFCompilerFactory;
+ }
+}
+}
+#include "kmfpfcompiler.moc"
diff --git a/kmyfirewall/compilers/pf/kmfpfcompiler.h b/kmyfirewall/compilers/pf/kmfpfcompiler.h
new file mode 100644
index 0000000..0ba9210
--- /dev/null
+++ b/kmyfirewall/compilers/pf/kmfpfcompiler.h
@@ -0,0 +1,133 @@
+//
+// C++ Interface: kmfpfcompiler
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <e9806056@student.tuwien.ac.at>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFPFCOMPILER_H
+#define KMFPFCOMPILER_H
+
+#include "../../core/kmfcompilerinterface.h"
+
+/**
+@author Christian Hubinger
+*/
+
+// QT includes
+#include <qstring.h>
+#include <qobject.h>
+#include <qvaluelist.h>
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+// Project includes
+#include "../../core/kmfplugin.h"
+#include "../../core/kmfcompilerinterface.h"
+
+
+class KInstance;
+namespace KMF {
+class KMFGenericDoc;
+class KMFIPTDoc;
+class KMFNetZone;
+class IPTChain;
+
+
+
+class KMFPFCompiler : public KMFPlugin, public virtual KMFCompilerInterface {
+ Q_OBJECT
+public:
+ KMFPFCompiler( QObject* parent, const char* name );
+ ~KMFPFCompiler();
+ void compile();
+ const QString& compile( KMFGenericDoc* );
+ const QString& osName();
+ const QString& osGUIName();
+ const QString& backendName();
+ const QString& backendGUIName();
+
+private:
+ void setupInAndOutHosts( KMFNetZone*, const QString& );
+ void setupForbiddenHosts( KMFNetZone*, const QString& );
+ void setupICMPRules( KMFGenericDoc* );
+ void setupLocalhostRules();
+ void setupPolicies( KMFGenericDoc* );
+ void setupNatRules( KMFGenericDoc* );
+ void createIncommingACCESSRules( KMFNetZone*, KMFGenericDoc* );
+ void createOutgoingACCESSRules( KMFNetZone*, KMFGenericDoc* );
+
+ QString getPortList( QValueList<int>& );
+
+
+// void addToChains( KMFNetZone*, KMFIPTDoc* , IPTChain*, const QString& );
+// void createRules( KMFNetZone*, IPTChain*, const QString& );
+// void setupLocalhostRules( KMFGenericDoc*, KMFIPTDoc* );
+// void setupConnectionTracking( KMFIPTDoc* );
+// void setupPolicies( KMFGenericDoc*, KMFIPTDoc* );
+// void createZoneProtocolRules( IPTChain*, KMFProtocolUsage* );
+// void createZoneProtocol( IPTChain*, KMFProtocolUsage* prot , const QString& option, const QString& ports );
+// void createHostProtocolRules( IPTChain*, KMFNetHost*, KMFProtocolUsage*, const QString& );
+// void createHostProtocol( IPTChain*, KMFNetHost*, KMFProtocolUsage* prot , const QString& option, const QString&, const QString& );
+//
+// void setupForbiddenHosts( KMFIPTDoc*, KMFNetZone*, const QString& );
+//
+// void setupICMPRules( KMFGenericDoc*, KMFIPTDoc* );
+//
+// void setupNatRules( KMFGenericDoc*, KMFIPTDoc* );
+// void setupNatTarget( KMFGenericDoc*, IPTRule* );
+// void setupLogging( KMFGenericDoc*, KMFIPTDoc* );
+// void setupLoggingRules( KMFGenericDoc*, IPTChain* );
+
+
+private:
+ KMFGenericDoc *m_doc;
+ QString m_compiledScript;
+
+ QString m_osName;
+ QString m_osGUIName;
+ QString m_backendName;
+ QString m_backendGUIName;
+
+
+private slots:
+ void slotExportPF();
+
+
+
+
+
+// void slotShowPFScript();
+};
+
+
+
+
+
+class KMFPFCompilerFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFPFCompilerFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFPFCompilerFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+#endif
diff --git a/kmyfirewall/compilers/pf/kmfpfcompiler.rc b/kmyfirewall/compilers/pf/kmfpfcompiler.rc
new file mode 100644
index 0000000..642e909
--- /dev/null
+++ b/kmyfirewall/compilers/pf/kmfpfcompiler.rc
@@ -0,0 +1,15 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kmfpfcompiler" library="libkmfcompiler_pf" version="1">
+<MenuBar>
+ <Menu name="file">
+ <Menu name="export_script_menu">
+ <Action name="compile_pf"/>
+ </Menu>
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+</ToolBar>
+</kpartgui>
+
+
+
diff --git a/kmyfirewall/compilers/pf/kmfpfscriptgenerator.cpp b/kmyfirewall/compilers/pf/kmfpfscriptgenerator.cpp
new file mode 100644
index 0000000..9aafaca
--- /dev/null
+++ b/kmyfirewall/compilers/pf/kmfpfscriptgenerator.cpp
@@ -0,0 +1,241 @@
+//
+// C++ Implementation: kmfiptablesscriptgenerator
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+// License: GPL
+//
+#include "kmfpfscriptgenerator.h"
+
+// QT includes
+#include <qptrlist.h>
+#include <qstringlist.h>
+#include <qmultilineedit.h>
+#include <qtabwidget.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+#include <kio/netaccess.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+
+// Project includes
+#include "../../version.h"
+#include "../../core/xmlnames.h"
+#include "../../core/kmfgenericdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetzone.h"
+#include "../../core/kmfnethost.h"
+#include "../../core/kmfprotocol.h"
+#include "../../core/iptable.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmferrorhandler.h"
+#include "../../core/kmfconfig.h"
+#include "../../core/kmftarget.h"
+#include "../../core/kmftargetconfig.h"
+#include "../../kmfwidgets/kmflistview.h"
+
+
+
+namespace KMF {
+KMFPFScriptGenerator::KMFPFScriptGenerator()
+{
+}
+
+
+KMFPFScriptGenerator::~KMFPFScriptGenerator()
+{
+}
+
+const QString& KMFPFScriptGenerator::compile( KMFIPTDoc* doc ) {
+ m_iptDoc = doc;
+ QString script;
+ m_stream = new QTextOStream( &script );
+ printScriptHeader();
+ printScriptStartFunction();
+ printScriptStopFunction();
+ printScriptExecLogic();
+ return *(new QString( script ) );
+}
+
+
+
+void KMFPFScriptGenerator::printScriptExecLogic() {
+ *m_stream <<
+ "status=\"0\"\n"
+ "verbose=\"0\"\n"
+ "action=\"$1\"\n"
+
+ "if [ \"$1\" = \"-v\" ]; then\n "
+ " verbose=\"1\"\n"
+ "fi\n\n"
+ "if [ \"$1\" = \"--verbose\" ]; then\n "
+ " verbose=\"1\"\n"
+ "fi\n\n"
+
+ "if [ \"$verbose\" = \"1\" ]; then\n "
+ " if [ \"$2\" = \"\" ]; then\n"
+ " print \"Usage: sh kmyfirewall.sh [-v|--verbose] { start | stop | restart }\"\n"
+ " exit 1\n"
+ " fi\n"
+ "action=\"$2\"\n"
+ "fi\n\n"
+
+ "case $action in\n"
+ " start)\n"
+ " stopFirewall\n"
+ " startFirewall\n"
+ " ;;\n"
+ " stop)\n"
+ " stopFirewall\n"
+ " ;;\n"
+ " restart)\n"
+ " stopFirewall\n"
+ " startFirewall\n"
+ " ;;\n"
+ " *)\n"
+ " print \"Invalid action!\nUsage: sh kmyfirewall.sh [-v|--verbose] { start | stop | restart }\"\n"
+ " ;;\n"
+ " esac\n\n"
+
+ "if [ \"$status\" = \"1\" ]; then\n"
+ " exit 1\n"
+ "else\n"
+ " exit 0\n"
+ "fi\n" << endl;
+}
+
+void KMFPFScriptGenerator::printScriptStartFunction() {
+ *m_stream << "startFirewall() {\n"
+ "\nprint -n \"Starting pf (created by KMyFirewall)... \"";
+ *m_stream << printScriptDebug( "Start pflogd... ", false) << endl;
+ *m_stream << "ifconfig pflog0 up || status=\"1\"\n" << endl;
+ *m_stream << "pflogd || status=\"1\"\n" << endl;
+
+ *m_stream << printScriptDebug( "Load pf rules... ", false) << endl;
+ *m_stream << "pfctl -e || status=\"1\"\n" << endl;
+ *m_stream << "pfctl -f /etc/kmyfirewall/pf.conf || status=\"1\"\n" << endl;
+ *m_stream << printScriptDebug( "Create custom chains... ", false) << endl;
+ *m_stream << "print Done." << endl;
+ *m_stream << "}" << endl;
+}
+
+void KMFPFScriptGenerator::printScriptStopFunction() {
+ *m_stream << "stopFirewall() {\n"
+ " print -n \"Clearing pf (created by KMyFirewall)... \"\n" << endl;
+ *m_stream << printScriptDebug( "Stop pflogd... ", false) << endl;
+ *m_stream << "kill `cat /var/run/pflogd.pid` || status=\"1\"\n" << endl;
+ *m_stream << printScriptDebug( "Flush pf rules... ", false) << endl;
+ *m_stream << " pfctl -F all || status=\"1\"\n";
+ *m_stream << " pfctl -d || status=\"1\"\n";
+ *m_stream << " print \"Done.\"\n" << endl;
+ *m_stream << "}" << endl;
+}
+
+
+
+
+void KMFPFScriptGenerator::printScriptTableChainDefinition( IPTable *tbl ) {
+ for ( uint i = 0;i < tbl->chains().count();i++ ) {
+ IPTChain* c = tbl->chains().at( i );
+ if ( !c->isBuildIn() ) {
+ *m_stream << "\n# Create Chain: " + c->name() << endl;
+ QString s2 = c->createIPTablesChainDefinition();
+ if ( !s2.isEmpty() ) {
+ *m_stream << s2 << " || { status=\"1\"; print \"Setting up Chain: " + c->name() + " FAILED !!!\"; print \"Ann Error occoured! Clearing rules\"; stopFirewall; exit 1; }\n";
+ }
+ }
+ }
+}
+
+void KMFPFScriptGenerator::printScriptTableRules( IPTable *tbl ) {
+ *m_stream << printScriptDebug( "Settup Rules in Table " + tbl->name().upper() + ":" ) << "\n" << endl;
+ for ( uint i = 0;i < tbl->chains().count();i++ ) {
+ IPTChain* c = tbl->chains().at( i );
+ *m_stream << "\n# Define Rules for Chain: " + c->name() << endl ;
+ *m_stream << printScriptDebug( "Create Rules for Chain: " + c->name() ) + " " << endl;
+ QPtrList<QStringList> rules = c->createIPTablesChainRules();
+ QStringList* curr_rule;
+ QString rule_name;
+ for ( curr_rule = rules.first(); curr_rule; curr_rule = rules.next() ) {
+ rule_name = *curr_rule->at( 0 );
+ QString s = *curr_rule->at( 1 );
+ if ( !s.isEmpty() ) {
+ *m_stream << s << " || { status=\"1\"; print \" Setting up Rule: " + rule_name + " FAILED! Clearing Rules!\"; stopFirewall; exit 1; }\n" << endl;
+ }
+ }
+ }
+}
+
+void KMFPFScriptGenerator::printScriptModuleLoad() {
+ *m_stream << "\n";
+ *m_stream << printScriptDebug( "\nLoading needed modules... ", false ) << endl;
+ *m_stream <<
+ "$MOD ip_tables \n"
+ "$MOD ip_conntrack \n"
+ "$MOD ipt_LOG \n"
+ "$MOD ipt_limit \n"
+ "$MOD ipt_state \n"
+ "$MOD ip_conntrack_ftp\n"
+ "$MOD ip_conntrack_irc\n"
+ << endl;
+ if ( m_iptDoc->useFilter() ) {
+ *m_stream << "$MOD iptable_filter" << endl;
+ }
+ if ( m_iptDoc->useNat() ) {
+ *m_stream << "$MOD iptable_nat" << endl;
+
+ }
+ if ( m_iptDoc->useMangle() ) {
+ *m_stream << "$MOD iptable_mangle" << endl;
+ }
+ *m_stream << printScriptDebug( "Done.") << endl;
+}
+
+void KMFPFScriptGenerator::printScriptHeader() {
+ KMFTarget *tg = m_iptDoc->target();
+ QString version = KMYFIREWALL_VERSION;
+ QString copyright_string = COPYRIGHT_STRING;
+ QString maintainer = MAINTAINER;
+ QString license = LICENSE;
+ *m_stream <<
+ "#!/bin/ksh\n"
+ "#\n"
+ "# " + copyright_string + "\n"
+ "# Please report bugs to: " + maintainer + "\n"
+ "#\n"
+ "# " + license + "\n"
+ "#\n"
+ "# KMyFirewall v" + version + "\n"
+ "# This is an automatic generated file DO NOT EDIT\n" +
+ "#\n" +
+ "# Configuration created for " + tg->toFriendlyString() + "\n" +
+ "#\n" << endl;
+}
+
+
+const QString& KMFPFScriptGenerator::printScriptDebug( const QString& msg, bool newLine ) {
+ QString script;
+ *m_stream << "if [ \"$verbose\" = \"1\" ]; then\n" ;
+ *m_stream << "print " ;
+ if ( ! newLine )
+ *m_stream << "-n " ;
+ *m_stream << "\"" + msg +"\"\n";
+ *m_stream << "fi\n" << endl;
+ return *(new QString( script ) );
+}
+
+}
+
diff --git a/kmyfirewall/compilers/pf/kmfpfscriptgenerator.h b/kmyfirewall/compilers/pf/kmfpfscriptgenerator.h
new file mode 100644
index 0000000..c6c1aea
--- /dev/null
+++ b/kmyfirewall/compilers/pf/kmfpfscriptgenerator.h
@@ -0,0 +1,60 @@
+//
+// C++ Interface: kmfiptablesscriptgenerator
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+// License: GPL
+//
+#ifndef KMFPFSCRIPTGENERATOR_H
+#define KMFPFSCRIPTGENERATOR_H
+
+/**
+@author Christian Hubinger
+*/
+// QT includes
+#include <qstring.h>
+#include <qobject.h>
+#include <qtextstream.h>
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+namespace KMF {
+class IPTable;
+class KMFIPTDoc;
+
+class KMFPFScriptGenerator{
+public:
+ KMFPFScriptGenerator();
+
+ ~KMFPFScriptGenerator();
+
+ const QString& compile( KMFIPTDoc* );
+
+
+private:
+ // Script Generating methods, acting on m_stream
+ void printScriptTableRules( IPTable *tbl );
+ void printScriptTableChainDefinition( IPTable *tbl );
+ void printScriptStartFunction();
+ void printScriptStopFunction();
+ void printScriptModuleLoad();
+ void printScriptHeader();
+ void printScriptExecLogic();
+
+ const QString& printScriptDebug( const QString&, bool newLine = true);
+
+
+private: // DATA
+ KMFIPTDoc *m_iptDoc;
+ QTextOStream *m_stream;
+};
+}
+#endif
diff --git a/kmyfirewall/core/Makefile.am b/kmyfirewall/core/Makefile.am
new file mode 100644
index 0000000..fec6f25
--- /dev/null
+++ b/kmyfirewall/core/Makefile.am
@@ -0,0 +1,94 @@
+INCLUDES = $(all_includes)
+METASOURCES = AUTO
+
+kde_kcfg_DATA = kmfconfig.kcfg
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/protocols/
+ $(INSTALL_DATA) $(srcdir)/kmfprotocollibrary.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/protocols/kmfprotocollibrary.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/protocols/kmfprotocollibrary.xml
+
+lib_LTLIBRARIES = libkmfcore.la
+libkmfcore_la_LDFLAGS = -no-undefined $(KDE_RPATH) $(all_libraries)
+libkmfcore_la_SOURCES = ipaddress.cpp \
+ iptable.cpp \
+ iptchain.cpp \
+ iptrule.cpp \
+ iptruleoption.cpp \
+ kmfapp.cpp \
+ kmfappstate.cpp \
+ kmfcheckinput.cpp \
+ kmfcompilerinterface.cpp \
+ kmfconfig.kcfgc \
+ kmfdoc.cpp \
+ kmferror.cpp \
+ kmferrorhandler.cpp \
+ kmfgenericdoc.cpp \
+ kmfinstallerinterface.cpp \
+ kmfiptdoc.cpp \
+ kmfnethost.cpp \
+ kmfnetwork.cpp \
+ kmfnetzone.cpp \
+ kmfnetzonelist.cpp \
+ kmfplugin.cpp \
+ kmfpluginfactory.cpp \
+ kmfprotocol.cpp \
+ kmfprotocolcategory.cpp \
+ kmfprotocollibrary.cpp \
+ kmfprotocolusage.cpp \
+ kmfruleeditinterface.cpp \
+ kmfruleoptioneditinterface.cpp \
+ kmfrulesetdoc.cpp \
+ kmfruletargetoptioneditinterface.cpp \
+ kmftargetconfig.cpp \
+ kmftarget.cpp \
+ kmftransaction.cpp \
+ kmfundoengine.cpp \
+ kmyfirewallinterface.cpp \
+ kprocesswrapper.cpp \
+ netfilterobject.cpp \
+ xmlnames.cpp
+
+libkmfcoreincludedir = $(includedir)/kmyfirewall/core/
+
+libkmfcore_la_LIBADD = $(LIB_KPARTS) $(LIB_KIO)
+
+libkmfcoreinclude_HEADERS = ipaddress.h \
+ iptable.h \
+ iptchain.h \
+ iptrule.h \
+ iptruleoption.h \
+ kmfapp.h \
+ kmfappstate.h \
+ kmfcheckinput.h \
+ kmfcompilerinterface.h \
+ kmfdoc.h \
+ kmferror.h \
+ kmferrorhandler.h \
+ kmfgenericdoc.h \
+ kmfinstallerinterface.h \
+ kmfiptdoc.h \
+ kmfnethost.h \
+ kmfnetwork.h \
+ kmfnetzone.h \
+ kmfnetzonelist.h \
+ kmfplugin.h \
+ kmfpluginfactory.h \
+ kmfprotocol.h \
+ kmfprotocolcategory.h \
+ kmfprotocollibrary.h \
+ kmfprotocolusage.h \
+ kmfruleeditinterface.h \
+ kmfruleoptioneditinterface.h \
+ kmfrulesetdoc.h \
+ kmfruletargetoptioneditinterface.h \
+ kmftargetconfig.h \
+ kmftarget.h \
+ kmftransaction.h \
+ kmfundoengine.h \
+ kmyfirewallinterface.h \
+ kprocesswrapper.h \
+ netfilterobject.h \
+ xmlnames.h
diff --git a/kmyfirewall/core/ipaddress.cpp b/kmyfirewall/core/ipaddress.cpp
new file mode 100644
index 0000000..c8dc147
--- /dev/null
+++ b/kmyfirewall/core/ipaddress.cpp
@@ -0,0 +1,342 @@
+//
+// C++ Implementation: ipaddress
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "ipaddress.h"
+
+// QT includes
+
+// KDE includes
+#include <kdebug.h>
+
+// Project includes
+#include "kmfcheckinput.h"
+#include "kmferror.h"
+#include "xmlnames.h"
+using namespace std;
+
+namespace KMF {
+
+IPAddress::IPAddress( int fi, int se, int th, int fo ) {
+ m_checkInput = new KMFCheckInput();
+ m_err = new KMFError();
+ for ( int i = 0; i < NUMDIGITS; i++ ) {
+ m_digits[i] = 0;
+ }
+ if ( !setAddress( fi, se, th, fo ) )
+ kdDebug() << "ERROR: Tried to initialise IPAddress with invalid parameters." << endl;
+}
+
+
+IPAddress::~IPAddress() {
+ delete m_checkInput;
+ delete m_err;
+}
+
+int IPAddress::getDigit( int num ) const {
+ if ( num >= 4 || num < 0 )
+ return -1;
+ return m_digits[ num ];
+}
+
+IPAddress& IPAddress::plus(int num) {
+ // kdDebug() << "IPAddress& IPAddress::operator+( int " << num << " )" << endl;
+ if ( m_digits[3] + num < 256 && m_digits[3] + num > -1 ) {
+ m_digits[3] = m_digits[3] + num;
+ }
+ return *this;
+}
+
+int IPAddress::operator==( const IPAddress& addr ) {
+ // kdDebug() << "IPAddress& IPAddress::operator==( const IPAddress& addr " << addr.toString()<< " )" << endl;
+ bool ident = true;
+ int first_diff = 0;
+ for ( int i = 0; i < NUMDIGITS && ident; i++ ) {
+ if ( m_digits[i] != addr.getDigit(i) ) {
+ ident = false;
+ first_diff = i;
+ }
+ }
+ if ( ident )
+ return EQUAL;
+
+ if ( m_digits[ first_diff ] > addr.getDigit( first_diff ) )
+ return SMALLER;
+ else
+ return BIGGER;
+}
+
+bool IPAddress::setAddress( int fi, int se, int th, int fo ) {
+ if ( fi < 0 || fi > 255 || se < 0 || se > 255 || th < 0 || th > 255 || fo < 0 || fo > 255 )
+ return false;
+
+ m_digits[0] = fi;
+ m_digits[1] = se;
+ m_digits[2] = th;
+ m_digits[3] = fo;
+
+ return true;
+}
+
+bool IPAddress::setAddress( const QString& input ) {
+ QString inp = input;
+ m_checkInput->checkInput( inp, "IP", m_err );
+ if ( m_err->errType() != KMFError::OK ) {
+ kdDebug() << "WARNING: Given wron IP address string: " << inp << endl;
+ return false;
+ }
+ int pos;
+ QString str_num;
+ bool valid = true;
+ int counter = 0;
+ while ( !inp.isEmpty() ) {
+ pos = inp.find( "." );
+ if ( pos > -1 ) {
+ str_num = inp.left( pos );
+ // kdDebug() << "IP Num Part: " << str_num << endl;
+ inp = inp.right( inp.length() - ( pos + 1 ) );
+ // kdDebug() << "Digit: " << str_num << endl;
+ int val = str_num.toInt();
+ // kdDebug() << "Val: " << val << endl;
+ if ( val < 0 || val > 255 ) {
+ valid = false;
+ } else {
+ // kdDebug() << "IPAddress: Setting digit: " << counter << " to " << val << endl;
+ m_digits[ counter ] = val;
+ counter++;
+ }
+ } else {
+ str_num = inp;
+ // kdDebug() << "IP Num Part: " << str_num << endl;
+ inp = "";
+ // kdDebug() << "Rest: " << inp << endl;
+ int val = str_num.toInt();
+ // kdDebug() << "Digit: " << val << endl;
+ if ( val < 0 || val > 255 ) {
+ valid = false;
+ } else {
+ // kdDebug() << "IPAddress: Setting digit: " << counter << " to " << val << endl;
+ m_digits[ counter ] = val;
+ counter++;
+ }
+ }
+ }
+ return true;
+}
+
+const QString& IPAddress::toString() const {
+ QString fi = "";
+ QString se = "";
+ QString th = "";
+ QString fo = "";
+ return *( new QString( fi.setNum( m_digits[0] ) + "." + se.setNum( m_digits[1] ) + "." + th.setNum( m_digits[2] ) + "." + fo.setNum( m_digits[3] ) ) );
+}
+
+
+// static stuff
+IPAddress& IPAddress::calcNetworkMaskFromLength( int len ) {
+ QValueList<int> list;
+ int nextOne = 0;
+ int digit1 = IPAddress::calcLenthToMaskDigit( len, &nextOne );
+ int digit2 = IPAddress::calcLenthToMaskDigit( nextOne, &nextOne );
+ int digit3 = IPAddress::calcLenthToMaskDigit( nextOne, &nextOne );
+ int digit4 = IPAddress::calcLenthToMaskDigit( nextOne, &nextOne );
+ list.append( digit1 );
+ list.append( digit2 );
+ list.append( digit3 );
+ list.append( digit4 );
+ IPAddress *addr = new IPAddress( digit1,digit2,digit3,digit4 );
+
+ return *addr;
+}
+
+
+int IPAddress::calcLenthToMaskDigit( int nMask, int *nextOne ) {
+ if (nMask < 1 || nMask > 32 ) {
+ return 0;
+ }
+ int nCalc = 0;
+ for (int nX = 7;nX > -1 ; nX--) {
+ int total=1;
+ for ( int j=0; j < nX; j++) {
+ total*=2;
+ }
+
+ nCalc=nCalc + total;
+
+ nMask = nMask -1;
+ *nextOne=nMask;
+ if (nMask <1) {
+ return nCalc;
+ }
+ }
+ return nCalc;
+}
+
+int IPAddress::calcLenthToMask( IPAddress& addr) {
+ // kdDebug() << "calcLenthToMask( " << addr.toString() << " )" << endl;
+ if ( ! IPAddress::isValidMask( addr ) ) {
+ kdDebug() << "Netmaks is not Valid!!!" << endl;
+ return -1;
+ }
+
+ int m[4];
+ for ( int i = 0; i< 4 ; i++ ) {
+ m[i] = addr.getDigit( i );
+ }
+
+
+ int mask = 0;
+ for (int loop=0; loop<4; loop++) {
+ int div = 256;
+ while ( div > 1) {
+ div = div/2;
+ int test = m[loop] - div;
+ if ( test >-1) {
+ mask=mask+1;
+ m[loop]=test;
+ } else {
+ break;
+ }
+ }
+
+ }
+ // kdDebug() << "Returning: " << mask << endl;
+ return mask;
+}
+
+bool IPAddress::isValidAddress( IPAddress& addr) {
+ int IP1 = addr.getDigit( 0 );
+ int IP2 = addr.getDigit( 1 );
+ int IP3 = addr.getDigit( 2 );
+ int IP4 = addr.getDigit( 3 );
+
+ if ((IP1 > 255) || (IP1 < 0)) {
+ return false;
+ }
+ if ((IP2 > 255) || (IP2 < 0)) {
+ return false;
+ }
+ if ((IP3 > 255) || (IP3 < 0)) {
+ return false;
+ }
+ if ((IP4 > 255) || (IP4 < 0)) {
+ return false;
+ }
+ return true;
+}
+
+bool IPAddress::isValidMask( IPAddress& addr) {
+ // alert(IP1+"."+IP2+"."+IP3+"."+IP4)
+ int IP1 = addr.getDigit( 0 );
+ int IP2 = addr.getDigit( 1 );
+ int IP3 = addr.getDigit( 2 );
+ int IP4 = addr.getDigit( 3 );
+
+ if ((IP1 > 255) || (IP1 < 0)) {
+ return false;
+ }
+ if ((IP2 > 255) || (IP2 < 0)) {
+ return false;
+ }
+ if ((IP3 > 255) || (IP3 < 0)) {
+ return false;
+ }
+ if ((IP4 > 255) || (IP4 < 0)) {
+ return false;
+ }
+
+ int IPX =5;
+ // find where it changes
+ if (IP1 < 255) {
+ if((IP2 > 0) || (IP3 > 0) || (IP4 > 0)) {
+ return false;
+ }
+ IPX = IP1;
+ } else {
+ if (IP2 < 255) {
+ if((IP3 > 0) || (IP4 > 0)) {
+ return false;
+ }
+ IPX = IP2;
+ } else {
+ if (IP3 < 255) {
+ if((IP4 > 0)) {
+ return false;
+ }
+ IPX = IP3;
+ } else {
+ IPX = IP4;
+ }
+ }
+ }
+
+ // determine if IPX is a good
+ switch (IPX) {
+ case 255:
+ case 128:
+ case 192:
+ case 224:
+ case 240:
+ case 248:
+ case 252:
+ case 254:
+ case 0:
+ return true;
+ default:
+ return false;
+ }
+
+ return true;
+}
+
+bool IPAddress::hostsOnSameNetwork( IPAddress& host1, IPAddress& host2, int len ) {
+// kdDebug() << "IPAddress::hostsOnSameNetwork( IPAddress&, IPAddress&, int )" << endl;
+ IPAddress mask = IPAddress::calcNetworkMaskFromLength( len );
+ return ( IPAddress::hostsOnSameNetwork( host1, host2, mask ) );
+}
+
+bool IPAddress::hostsOnSameNetwork( IPAddress& host1, IPAddress& host2, IPAddress& mask ) {
+ kdDebug() << "IPAddress::hostsOnSameNetwork( IPAddress&, IPAddress&, int )" << endl;
+ kdDebug() << "Host 1: " << host1.toString() << endl;
+ kdDebug() << "Host 2: " << host2.toString() << endl;
+ kdDebug() << "Mask: " << mask.toString() << endl;
+// IPAddress mask = IPAddress::calcNetworkMaskFromLength( len );
+
+ int nOctA1=host1.getDigit(0) & mask.getDigit(0);
+ int nOctA2=host1.getDigit(1) & mask.getDigit(1);
+ int nOctA3=host1.getDigit(2) & mask.getDigit(2);
+ int nOctA4=host1.getDigit(3) & mask.getDigit(3);
+
+
+ int nOctB1=host2.getDigit(0) & mask.getDigit(0);
+ int nOctB2=host2.getDigit(1) & mask.getDigit(1);
+ int nOctB3=host2.getDigit(2) & mask.getDigit(2);
+ int nOctB4=host2.getDigit(3) & mask.getDigit(3);
+
+ if ((nOctA1==nOctB1) && (nOctA2==nOctB2) && (nOctA3==nOctB3) && (nOctA4==nOctB4)) {
+ kdDebug() << "Hosts on same net." << endl;
+ return true;
+ } else {
+ kdDebug() << "Hosts NOT on same net." << endl;
+ return false;
+ }
+}
+}
diff --git a/kmyfirewall/core/ipaddress.h b/kmyfirewall/core/ipaddress.h
new file mode 100644
index 0000000..b9a71cc
--- /dev/null
+++ b/kmyfirewall/core/ipaddress.h
@@ -0,0 +1,107 @@
+//
+// C++ Interface: ipaddress
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef IPADDRESS_H
+#define IPADDRESS_H
+
+/**
+@author Christian Hubinger
+*/
+
+// QT includes
+#include <qstring.h>
+#include <qvaluelist.h>
+
+// KDE includes
+#include <kdemacros.h>
+
+// Project includes
+
+namespace KMF {
+class KMFError;
+class KMFCheckInput;
+
+#define NUMDIGITS 4
+
+
+class KDE_EXPORT IPAddress {
+public:
+ IPAddress( int = 0, int = 0, int = 0, int = 0 );
+ ~IPAddress();
+
+ /** Sets the address to the given 4 int representation.
+ Returns false if the address is invalid */
+ bool setAddress( int, int, int, int );
+
+ /** Set the address to the address given in the string.
+ Returns false if the address is invalid */
+ bool setAddress( const QString& );
+
+
+ IPAddress& plus(int); // FIXME: remove that!!!
+
+ /** check if the address is equal to the other */
+ int operator==( const IPAddress& );
+
+ /** Return the int for the given posintion in the address */
+ int getDigit( int num ) const;
+
+ /** returns a QString holding the address e.g. 123.234.123.234 */
+ const QString& toString() const;
+
+ /** Return values for the comparision operator== */
+ enum { EQUAL, BIGGER, SMALLER };
+
+private:
+ int m_digits[ NUMDIGITS ];
+ KMFCheckInput *m_checkInput;
+ KMFError *m_err;
+
+
+
+// static stuff
+public:
+ /** Calculates the netmask from the mask length
+ e.g. 255.255.255.0 -> 24 */
+ static IPAddress& calcNetworkMaskFromLength( int maskLen );
+
+ /** Calculates the given netmask length to the net mask.
+ e.g. 24 -> 255.255.255.0 */
+ static int calcLenthToMask( IPAddress& );
+
+ /** Returns true it the given adddress is a valid net mask */
+ static bool isValidMask( IPAddress& );
+
+ /** Returns true it the given adddress is a valid net mask */
+ static bool isValidAddress( IPAddress& );
+
+ /** Checks if the the addresses are on the same network. */
+ static bool hostsOnSameNetwork( IPAddress&, IPAddress&, int maskLen );
+
+ /** Checks if the the addresses are on the same network. */
+ static bool hostsOnSameNetwork( IPAddress&, IPAddress&, IPAddress& mask );
+
+private:
+ private: static int calcLenthToMaskDigit( int nMask, int *nextOne );
+
+};
+}
+#endif
diff --git a/kmyfirewall/core/iptable.cpp b/kmyfirewall/core/iptable.cpp
new file mode 100644
index 0000000..de54f34
--- /dev/null
+++ b/kmyfirewall/core/iptable.cpp
@@ -0,0 +1,378 @@
+/***************************************************************************
+begin : Tue Aug 20 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "iptable.h"
+
+// qt includes
+#include <qstring.h>
+#include <qregexp.h>
+
+// kde includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// project includes
+#include "kmfcheckinput.h"
+#include "iptchain.h"
+#include "kmferror.h"
+#include "kmfiptdoc.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+IPTable::IPTable( KMFIPTDoc* doc, const char* name, const QString& tableName ) : NetfilterObject( doc, name ) {
+ // kdDebug() << "IPTable::IPTable(QString& name)" << endl;
+ kmfdoc = doc;
+ // m_object_type = NetfilterObject::TABLE;
+ m_err = new KMFError();
+ m_chains.setAutoDelete( false );
+ setName( tableName );
+}
+
+IPTable::~IPTable() {
+ kdDebug() << "\n\nIPTable::~IPTable() : " << name() << endl;
+ clear();
+}
+
+int IPTable::type() {
+// kdDebug() << "IPTable::type()" << endl;
+ return NetfilterObject::TABLE;
+}
+void IPTable::clear() {
+ m_chains.setAutoDelete( true );
+ m_chains.clear();
+ m_chains.setAutoDelete( false );
+}
+void IPTable::reset() {
+ // kdDebug() << "void IPTable::resetTable()" << endl;
+ QPtrListIterator<IPTChain> it ( m_chains );
+ while ( it.current() ) {
+ IPTChain* chain = it.current();
+ if ( chain->isBuildIn() ) {
+ chain->reset();
+ ++it;
+ } else {
+ m_chains.remove( chain );
+ }
+ }
+ changed();
+}
+
+void IPTable::settupDefaultChains() {
+ // kdDebug() << "void IPTable::settupDefaultChains()" << endl;
+ QString target = "ACCEPT";
+ IPTChain* chain = 0;
+ if ( name() == Constants::FilterTable_Name ) {
+
+ setDescription( i18n("This table is the main table for filtering\n"
+ "packets. Here you may define your\n"
+ "access control rules") );
+
+
+ chain = addChain( Constants::InputChain_Name, target, true, m_err );
+// if ( chain ) {
+ chain->setDescription( i18n( "In this chain you can filter packets that\n"
+ "are addressed directly to this computer." ) );
+// }
+ chain = addChain( Constants::OutputChain_Name, target, true, m_err );
+ if ( chain ) {
+ chain->setDescription( i18n( "In this chain you can decide which\n"
+ "packets are allowed to be sent away\n"
+ "from this computer." ) );
+ }
+ chain = addChain( Constants::ForwardChain_Name, target, true, m_err );
+ if ( chain ) {
+ chain->setDescription( i18n( "In this chain you can filter the packets\n"
+ "that are routed to other hosts by this\n"
+ "computer." ) );
+ }
+
+ } else if ( name() == Constants::NatTable_Name ) {
+ setDescription( i18n("This table is made for every kind of\n"
+ "NAT (Network Address Translation).") );
+
+ chain = addChain( Constants::OutputChain_Name, target, true, m_err );
+ if ( chain ) {
+ chain->setDescription( i18n( "In this chain you can decide which\n"
+ "packets are allowed to be sent away\n"
+ "from this computer." ) );
+ }
+ chain = addChain( Constants::PreRoutingChain_Name, target, true, m_err );
+ if ( chain )
+ chain->setDescription( i18n( "..." ) );
+
+ chain = addChain( Constants::PostRoutingChain_Name, target, true, m_err );
+ if ( chain ) {
+ chain->setDescription( i18n( "..." ) );
+ }
+
+ } else if ( name() == Constants::MangleTable_Name ) {
+ setDescription( i18n("This table is made for altering packets.") );
+
+ chain = addChain( Constants::InputChain_Name, target, true, m_err );
+ if ( chain ) {
+ chain->setDescription( i18n( "In this chain you can filter packets that\n"
+ "are addressed directly to this compter." ) );
+ }
+ chain = addChain( Constants::OutputChain_Name, target, true, m_err );
+ if ( chain ) {
+ chain->setDescription( i18n( "In this chain you can decide which\n"
+ "packets are allowed to be sent away\n"
+ "from this computer." ) );
+ }
+ chain = addChain( Constants::ForwardChain_Name, target, true, m_err );
+ if ( chain ) {
+ chain->setDescription( i18n( "In this chain you can filter the packets\n"
+ "that are routed to other hosts by this\n"
+ "computer." ) );
+ }
+ chain = addChain( Constants::PreRoutingChain_Name, target, true, m_err );
+ if ( chain ) {
+ chain->setDescription( i18n( "..." ) );
+ }
+ chain = addChain( Constants::PostRoutingChain_Name, target, true, m_err );
+ if ( chain ) {
+ chain->setDescription( i18n( "..." ) );
+ }
+ }
+}
+
+
+IPTChain* IPTable::chainForName( const QString& name ) {
+ IPTChain * tmp_chain;
+ for ( tmp_chain = m_chains.first();tmp_chain; tmp_chain = m_chains.next() ) {
+ if ( tmp_chain->name() == name )
+ return tmp_chain;
+ }
+ return 0;
+}
+
+IPTChain* IPTable::chainForUuid( const QUuid& id ) {
+ IPTChain * tmp_chain;
+ for ( tmp_chain = m_chains.first(); tmp_chain; tmp_chain = m_chains.next() ) {
+ if ( tmp_chain->uuid() == id )
+ return tmp_chain;
+ }
+ return 0;
+}
+
+QPtrList<IPTChain>& IPTable::chains() const {
+ QPtrList<IPTChain>* ret_val = new QPtrList<IPTChain>;
+ *ret_val = m_chains;
+ return *ret_val;
+}
+
+IPTChain* IPTable::addChain( const QString& chain_name, const QString& chain_target, bool builtin, KMFError *err ) {
+ // kdDebug() << "KMFError* IPTable::addChain( QString& chain_name,QString& chain_table,QString& chain_target,bool builtin )" << endl;
+ KMFCheckInput* check = new KMFCheckInput();
+ check->checkInput( chain_name, "CHAINNAME", err );
+ if ( err->errNum() != 0 ) {
+ return 0;
+ }
+
+ QPtrListIterator<IPTChain> it ( m_chains );
+ while ( it.current() ) {
+ IPTChain* tmp_chain = it.current();
+ ++it;
+ QString found_name = tmp_chain->name();
+ if ( found_name == chain_name ) {
+ const QString msg = i18n( "<qt><p>Chain: <b>%1</b> already exists in table: <b>%2</b>.<br>"
+ "Please try again with another name. A chain name must be unique in a table.</p></qt>" ).arg( found_name ).arg( name() );
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( msg );
+ kdDebug() << "\n\nWARNING: Couldn't add chain because of dupilcate name\n\n" << endl;
+ return 0;
+ }
+ }
+
+ IPTChain * chain = new IPTChain( this, chain_name.latin1(), chain_name, builtin );
+ if ( builtin && chain_target != QString::null )
+ chain->setDefaultTarget( chain_target );
+// kdDebug() << "Adding Chain: " << chain->name() << endl;
+ m_chains.append( chain );
+ changed();
+ err->setErrType( KMFError::OK );
+ return chain;
+}
+
+KMFError* IPTable::delChain( IPTChain *chain ) {
+ // kdDebug() << "KMFError* IPTable::delChain( IPTChain *chain )" << endl;
+ m_err = new KMFError();
+ QString name = chain->name();
+ if ( chain->isBuildIn() ) {
+ const QString msg = i18n( "Cannot delete built-in chain: %1" ).arg( name );
+ m_err->setErrMsg( msg );
+ m_err->setErrType( KMFError::NORMAL );
+ return m_err;
+ }
+ int index = m_chains.find( chain );
+ // kdDebug() << "fount chain nr: " << index << endl;
+ if ( index < 0 ) {
+ chain->deleteLater();
+ const QString msg = i18n( "Cannot delete nonexistent chain" );
+ m_err->setErrMsg( msg );
+ m_err->setErrType( KMFError::NORMAL );
+
+ return m_err;
+ } else {
+ m_chains.remove( index );
+ chain->deleteLater();
+ const QString msg = "";
+ m_err->setErrMsg( msg );
+ m_err->setErrType( KMFError::OK );
+ changed();
+ return m_err;
+ }
+}
+
+KMFError* IPTable::moveRuleToChain( IPTRule* rule, IPTChain *target_chain ) {
+ // kdDebug() << "KMFError* IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain )" << endl;
+ if ( rule == 0 ) {
+ m_err->setErrType( KMFError::FATAL );
+ const QString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain"
+ "rule == 0. This is a bug." );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+ if ( target_chain == 0 ) {
+ m_err->setErrType( KMFError::FATAL );
+ const QString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain"
+ "target_chain == 0. This is a bug." );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+ // kdDebug() << "Move Rule: " << rule->name() <<" from Chain: " << rule->chain() ->name() << "to chain" << target_chain->name() << endl;
+
+ IPTRule* new_rule = target_chain->addRule( i18n( "%1_Copy" ).arg( rule->name() ), m_err );
+ if ( m_err->errNum() == 0 ) {
+ rule->createRuleClone( new_rule );
+ IPTRule* ru = rule;
+ rule->chain()->delRule( ru );
+ }
+ return m_err;
+}
+
+KMFError* IPTable::copyRuleToChain( IPTRule* rule, IPTChain *target_chain ) {
+ // kdDebug() << "KMFError* IPTable::copyRuleToChain(IPTRule* rule, IPTChain *target_chain )" << endl;
+ if ( rule == 0 ) {
+ m_err->setErrType( KMFError::FATAL );
+ const QString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain"
+ "rule == 0. This is a bug " );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+ if ( target_chain == 0 ) {
+ m_err->setErrType( KMFError::FATAL );
+ const QString& msg = i18n( "IPTable::moveRuleToChain(IPTRule* rule, IPTChain *target_chain"
+ "target_chain == 0. This is a bug " );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+ // kdDebug() << "Copy Rule: " << rule->name() << " from Chain: " << rule->chain() ->name() << "to chain" << target_chain->name() << endl;
+
+ IPTRule* new_rule = target_chain->addRule( i18n( "%1_Copy" ).arg( rule->name() ), m_err );
+ if ( m_err->errNum() == 0 ) {
+ rule->createRuleClone( new_rule );
+ }
+ return m_err;
+}
+
+const QDomDocument& IPTable::getDOMTree() {
+ // kdDebug() << "const QString& IPTChain::getIDOMree( )" << endl;
+ QDomDocument doc;
+ QDomElement root = doc.createElement( XML::Table_Element );
+ NetfilterObject::saveUuid( root );
+ root.setAttribute( XML::Name_Attribute, name() );
+ root.setAttribute( XML::Description_Attribute, description() );
+
+ QPtrListIterator<IPTChain> it ( m_chains );
+ IPTChain *chain = 0;
+ while ( ( chain = it.current() ) != 0 ) {
+ ++it;
+ if ( chain ) {
+ root.appendChild( chain->getDOMTree( ) );
+ // kdDebug() << "Got XML for Rule: " << *chain->name() << endl;
+ } else {
+ kdDebug() << "Rule == 0"<< endl;
+ }
+ }
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+
+void IPTable::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ kdDebug() << "void IPTable::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML( root, errors );
+}
+void IPTable::loadXML( QDomNode root, QStringList& errors ) {
+ setName( name() );
+ NetfilterObject::loadUuid ( root, errors );
+// QDomElement root = doc.documentElement();
+ QDomNode curr = root.firstChild();
+ QPtrList<IPTChain> used_chains;
+ while ( !curr.isNull() ) {
+ // kdDebug() << "Parsing Node: " << curr.nodeName() << endl;
+ if ( curr.isElement() && curr.nodeName() == XML::Chain_Element ) {
+ QString name = curr.toElement().attribute( XML::Name_Attribute );
+ QString uuid = curr.toElement().attribute( XML::Uuid_Attribute );
+ QUuid chain_uuid( uuid );
+
+ // kdDebug() << "IPTable: Start Parsing Chain: " << name << endl;
+ QDomDocument chain_xml;
+ chain_xml.appendChild( curr.cloneNode(true) );
+ IPTChain* chain = 0;
+ chain = chainForUuid( chain_uuid );
+ if ( ! chain ) {
+ chain = chainForName( name );
+ if ( ! chain ) {
+ chain = addChain( name ,*( new QString( "ACCEPT" ) ), false, m_err );
+ if ( m_err->errNum() != 0 ) {
+ kdDebug() << "ERROR: Couldn't create Chain: " << name << endl;
+ return;
+ }
+ }
+ }
+ chain->loadXML( chain_xml, errors );
+ used_chains.append( chain );
+ // kdDebug() << "IPTable: Finished Parsing Chain: " << name << endl;
+ }
+ curr = curr.nextSibling();
+ }
+
+ QPtrListIterator<IPTChain> it ( m_chains );
+ while ( it.current() ) {
+ // kdDebug() << "IPTChain::xloadXML() cleanup loop." << endl;
+ IPTChain *chain = it.current();
+ QPtrListIterator<IPTChain> it2 ( used_chains );
+ bool found = false;
+ while ( it2.current() ) {
+ IPTChain *chain2 = it2.current();
+ ++it2;
+ if ( chain2 == chain )
+ found = true;
+ }
+ if ( ! found ) {
+ m_err = delChain( chain );
+ if ( m_err->errNum() != 0 )
+ ++it;
+ } else {
+ ++it;
+ }
+ }
+ changed();
+}
+
+}
diff --git a/kmyfirewall/core/iptable.h b/kmyfirewall/core/iptable.h
new file mode 100644
index 0000000..89da260
--- /dev/null
+++ b/kmyfirewall/core/iptable.h
@@ -0,0 +1,119 @@
+/***************************************************************************
+begin : Tue Aug 20 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef IPTABLE_H
+#define IPTABLE_H
+
+/**Class that represents the properties of a "table" in the iptables
+
+ *@author Christian Hubinger
+ */
+
+#include "netfilterobject.h"
+
+// qt includes
+#include <qptrlist.h>
+#include <quuid.h>
+// project includes
+#include "iptchain.h"
+// qt classes
+class QString;
+namespace KMF {
+// project classes
+class KMFError;
+class KMFIPTDoc;
+
+
+class KDE_EXPORT IPTable : public NetfilterObject {
+public:
+ /** initialise a IPTable with the given name */
+ IPTable( KMFIPTDoc*, const char* name, const QString& tableName );
+ ~IPTable();
+
+ virtual int type();
+ virtual void clear();
+
+ /** Set the used flag */
+ void setUsed( bool used ) {
+ m_used = used;
+ };
+
+ /** Simply deletes all chains */
+ void reset();
+
+ /** Return the IPTChain with the name provided */
+ IPTChain* chainForName( const QString& );
+
+ /** Return the IPTChain for the given ID */
+ IPTChain* chainForUuid( const QUuid& );
+
+ /** Add a new IPTChain object to this table with the given prperties */
+ IPTChain* addChain( const QString& chain_name,
+ const QString& chain_target,
+ bool builtin,
+ KMFError* );
+
+ /** Remove the given IPTChain */
+ KMFError* delChain( IPTChain *chain );
+
+
+ /** Move rule to target_chain */
+ KMFError* moveRuleToChain( IPTRule* rule, IPTChain *target_chain );
+
+ /** Copy rule to target_chain */
+ KMFError* copyRuleToChain( IPTRule* rule, IPTChain *target_chain );
+
+ /** Return a pointer to KMFIPTDoc object to which this
+ table belongs */
+ KMFIPTDoc* kmfDoc() const {
+ return kmfdoc;
+ };
+
+
+ /** Returns true if it used by the current configuration */
+ bool used() const {
+ return m_used;
+ };
+
+ /** Returns the list with the iptchains in this table */
+ QPtrList<IPTChain>& chains() const;
+
+ /** Return a QDomDocument representation of this Table */
+ virtual const QDomDocument& getDOMTree();
+
+ /** Load the Table from the QDomDocument */
+ virtual void loadXML( const QDomDocument&, QStringList& errors );
+
+ /** Load Table From DomNode */
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+ /** Stup the built-in chains */
+ void settupDefaultChains();
+
+private:
+ /** the list holding the chains in this table */
+ private: QPtrList<IPTChain> m_chains;
+
+ /** used by the current configuration */
+ private: bool m_used;
+
+
+ private: KMFError* m_err;
+ private: KMFIPTDoc* kmfdoc;
+};
+}
+#endif
+
+
diff --git a/kmyfirewall/core/iptchain.cpp b/kmyfirewall/core/iptchain.cpp
new file mode 100644
index 0000000..9a9d2b1
--- /dev/null
+++ b/kmyfirewall/core/iptchain.cpp
@@ -0,0 +1,561 @@
+/***************************************************************************
+ begin : Mon Jan 28 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "qptrlist.h"
+#include "qstring.h"
+#include "qmessagebox.h"
+
+// kde includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+//my includes
+#include "kmfdoc.h"
+#include "iptchain.h"
+#include "iptrule.h"
+#include "iptable.h"
+#include "kmferror.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+IPTChain::IPTChain( IPTable* table, const char* name, const QString& chainName, bool buildin ) : NetfilterObject( table, name ) {
+ // kdDebug() << "IPTChain::IPTChain(const QString& name,IPTable* table,bool buildin)" << endl;
+ m_err = new KMFError();
+
+ // m_object_type = NetfilterObject::CHAIN;
+ setName( chainName );
+ setTable( table );
+ is_build_in_chain = false;
+ has_default_target = false;
+ setBuildIn( buildin );
+ enable_log = false;
+
+
+ m_ruleset.setAutoDelete( false );
+
+ m_cmd_default_target = XML::Undefined_Value;
+ m_cmd_chain_definition = XML::Undefined_Value;
+ m_log_limit = XML::Undefined_Value;
+ m_log_prefix = XML::Undefined_Value;
+ m_log_burst = XML::Undefined_Value;
+ setUsed( true );
+}
+
+IPTChain::~IPTChain() {
+ kdDebug() << "\n\nIPChain::~IPTChain() : " << name() << endl;
+ m_ruleset.setAutoDelete( true );
+ m_ruleset.clear();
+ m_ruleset.setAutoDelete( false );
+ delete m_err;
+}
+
+int IPTChain::type() {
+// kdDebug() << "IPTChain::type()" << endl;
+ return NetfilterObject::CHAIN;
+}
+
+void IPTChain::clear() {
+ m_ruleset.setAutoDelete( true );
+ m_ruleset.clear();
+ m_ruleset.setAutoDelete( false );
+}
+
+void IPTChain::reset() {
+ m_ruleset.setAutoDelete( true );
+ m_ruleset.clear();
+ m_ruleset.setAutoDelete( false );
+ changed();
+}
+
+void IPTChain::setDefaultTarget( const QString& target ) {
+ // kdDebug() << "void IPTChain::setDefaultTarget(const QString& target) " << endl;
+ m_default_target = target;
+ has_default_target = true;
+ changed();
+}
+
+void IPTChain::setTable( IPTable* table ) {
+ setParent( table );
+ m_table = table;
+}
+
+IPTable* IPTChain::table() const {
+ return m_table;
+}
+
+QPtrList<IPTRule>& IPTChain::chainRuleset() const {
+ QPtrList<IPTRule>* ret_list = new QPtrList<IPTRule>;
+ *ret_list = m_ruleset;
+ return *ret_list;
+}
+
+void IPTChain::setBuildIn( bool build_in ) {
+ is_build_in_chain = build_in;
+ if ( is_build_in_chain ) {
+ const QString target = "DROP";
+ setDefaultTarget( target );
+ hasCustomDefaultTarget( false );
+ }
+}
+
+void IPTChain::hasCustomDefaultTarget( bool has ) {
+ if ( is_build_in_chain )
+ has_default_target = true;
+ else
+ has_default_target = has;
+ changed();
+}
+
+void IPTChain::setUsed( bool valid ) {
+ is_used = valid;
+ changed();
+}
+
+int IPTChain::indexOf( const IPTRule& rule ) {
+// kdDebug() << "int IPTChain::indexOf( IPTRule* " << rule.name() << " ) " << endl;
+ return m_ruleset.find( &rule );
+}
+
+IPTRule* IPTChain::addRule( const QString& rule_name, KMFError *err, int index ) {
+ kdDebug() << "IPTRule* IPTChain::addRule(QString& " << rule_name << ", KMFError *err) " << endl;
+
+ QString target = "DROP";
+ const QString& new_name = rule_name;
+ QString name = new_name;
+
+ for ( uint i = 0; i < m_ruleset.count(); i++ ) {
+ QString tmp_name = m_ruleset.at( i ) ->name();
+ if ( tmp_name == name ) {
+ err->setErrType(KMFError::NORMAL);
+ err->setErrMsg( i18n( "<qt><p>Unable to add rule: <b>%1</b> into chain: <b>%2</b>.<br>There is already a rule defined with that name. Please try again with another name (must be unique in that chain).</p></qt>" ).arg( tmp_name ).arg( NetfilterObject::name() ) );
+ return 0;
+ }
+ }
+
+ IPTRule* new_rule = new IPTRule( this, new_name.latin1(), new_name, target );
+ if ( ! new_rule ) {
+ err->setErrType(KMFError::FATAL);
+ err->setErrMsg( i18n("Sorry, a bad internal error occurred. This is a bug ;-(") );
+ return 0;
+ }
+ err->setErrType(KMFError::OK);
+ if ( index == -1 ) {
+ kdDebug() << "IPTChain::addRule: appending rule" << endl;
+ m_ruleset.append( new_rule );
+ } else {
+ if ( index < 0 || index > (int) chainRuleset().count() - -1 ) {
+ err->setErrType(KMFError::FATAL);
+ err->setErrMsg( i18n("Cannot insert rule at %1 This is a bug ;-(").arg( index ) );
+ return 0;
+ }
+ kdDebug() << "IPTChain::addRule: inserting rule at: " << index << endl;
+ m_ruleset.insert( index, new_rule );
+ }
+// regenerateRuleNumbers();
+ changed();
+ return new_rule;
+}
+
+
+KMFError* IPTChain::delRule( IPTRule* rule ) {
+ kdDebug() << "KMFError* IPTChain::delRule( IPTRule* rule )" << endl;
+ if ( m_ruleset.count() < 1 )
+ return false;
+
+ QString name = rule->name();
+ if ( m_ruleset.find( rule ) != -1 ) {
+ m_err->setErrType(KMFError::OK );
+ if ( ! m_ruleset.remove( rule ) ) {
+ rule->deleteLater();
+ rule = 0;
+ m_err->setErrType( KMFError::FATAL );
+ const QString& msg = i18n( "Sorry, can't find Rule: %1 in the Ruleset of this chain." ).arg( rule->name() );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+ rule->deleteLater();
+ changed();
+ kdDebug() << "DONE." << endl;
+ return m_err;
+ } else {
+ m_err->setErrType( KMFError::FATAL );
+ const QString& msg = i18n( "Sorry, can't find Rule: %1 in the Ruleset of this chain." ).arg( rule->name() );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+ kdDebug() << "Sorry can't delete Rule: " << rule->name() << ".\nRule not found in Chain !!!" << endl;
+ return m_err;
+}
+
+bool IPTChain::moveRule( IPTRule* rule, int how_much ) {
+ // kdDebug() << "void IPTChain::moveRule(IPTRule* rule,int how_much)" << endl;
+ int num = m_ruleset.find( rule );
+ int new_pos = num + how_much;
+ if ( new_pos < 0 || new_pos > ( int ) m_ruleset.count() - 1 ) {
+ // kdDebug() << "New Position is not Valid: " << new_pos << endl;
+ return false;
+ } else {
+ // kdDebug() << "Moving rule to position: " << new_pos << endl;
+ IPTRule *tmp_rule = m_ruleset.take( num );
+ m_ruleset.insert( new_pos, tmp_rule );
+ // regenerateRuleNumbers();
+ changed();
+ return true;
+ }
+}
+
+void IPTChain::setDropLogging( bool enabled, QString& limit, QString& burst, QString& prefix ) {
+ enable_log = enabled;
+
+ if ( !limit.isEmpty() )
+ m_log_limit = limit;
+ else
+ m_log_limit = "";
+ if ( !prefix.isEmpty() )
+ m_log_prefix = prefix;
+ else
+ m_log_prefix = "";
+ if ( !burst.isEmpty() )
+ m_log_burst = burst;
+ else
+ m_log_burst = XML::Undefined_Value;
+ changed();
+}
+
+
+QPtrList<IPTRule>& IPTChain::chainFwds() {
+ // kdDebug() << "QPtrList<IPTRule> IPTChain::chainFwds()" << endl;
+ QPtrList<IPTRule>* fwds = new QPtrList<IPTRule>;
+ QPtrListIterator<IPTRule> it( m_ruleset );
+ IPTRule* rule = 0;
+ while ( it.current() ) {
+ rule = it.current();
+ ++it;
+ QString target = rule->target();
+ // FIXME: lots of targets missing !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ if ( !target.isEmpty() && target != "ACCEPT" && target != "DROP" && target != "LOG"
+ && target != "REJECT" && target != "RETURN" && target != "DNAT" && target != "SNAT"
+ && target != "QUEUE" && target != "MIRROR" && target != "REDIRECT" && target != "MASQUERADE" ) {
+ //kdDebug() << "Found Forward to chain: " << target << endl;
+ fwds->append( rule );
+ }
+ }
+// kdDebug() << "EXIT: QPtrList<IPTRule>& IPTChain::chainFwds()" << endl;
+ return *fwds;
+}
+
+QPtrList<IPTRule>& IPTChain::chainFeeds() {
+// kdDebug() << "QPtrList<IPTRule> IPTChain::chainFeeds()" << endl;
+ QPtrList<IPTRule>* feeds = new QPtrList<IPTRule>;
+ IPTChain* tmp_chain;
+ QPtrList<IPTChain> table_chains = table() ->chains();
+ QPtrListIterator<IPTChain> it( table_chains );
+ while ( it.current() ) {
+ tmp_chain = it.current();
+ ++it;
+ // kdDebug() << "Searching in chain: " << tmp_chain->name() << endl;
+ if ( !tmp_chain->chainRuleset().isEmpty() ) {
+ IPTRule * tmp_rule;
+ QPtrList<IPTRule> rules = tmp_chain->chainRuleset();
+ QPtrListIterator<IPTRule> it2( rules );
+ while ( it2.current() ) {
+ tmp_rule = it2.current();
+ ++it2;
+ QString target = tmp_rule->target();
+ //kdDebug() << "Found Rule: " << tmp_rule->name() << " with target: " << target << endl;
+ if ( target == name() ) {
+ feeds->append( tmp_rule );
+ //kdDebug() << "Found feed: " << tmp_rule->name() << " from chain: " << tmp_chain->name() << endl;
+ }
+ }
+ }
+ }
+ // kdDebug() << "EXIT: QPtrList<IPTRule>& IPTChain::chainFeeds()" << endl;
+ return *feeds;
+}
+
+IPTRule* IPTChain::ruleForName( const QString& name ) {
+ IPTRule * tmp_rule = 0;
+ for ( tmp_rule = m_ruleset.first();tmp_rule; tmp_rule = m_ruleset.next() ) {
+ if ( tmp_rule->name() == name ) {
+ return tmp_rule;
+ }
+ }
+ return 0;
+}
+
+IPTRule* IPTChain::ruleForUuid( const QUuid& id ) {
+ IPTRule * tmp_rule = 0;
+ for ( tmp_rule = m_ruleset.first();tmp_rule; tmp_rule = m_ruleset.next() ) {
+ if ( tmp_rule->uuid() == id ) {
+ return tmp_rule;
+ }
+ }
+ return 0;
+
+}
+
+QString IPTChain::createIPTablesChainDefinition() {
+ QString chainDef = "";
+ if ( is_build_in_chain ) {
+ return chainDef;
+ } else {
+ m_cmd_chain_definition = "$IPT -t ";
+ m_cmd_chain_definition.append( m_table->name() );
+ m_cmd_chain_definition.append( " -N " );
+ m_cmd_chain_definition.append( name() );
+ return m_cmd_chain_definition;
+ }
+}
+
+QString IPTChain::createIPTablesChainDefaultTarget() {
+ // kdDebug() << "IPTChain::createIPTablesChainDefaultTarget()" << endl;
+ m_cmd_default_target = "$IPT -t ";
+ m_cmd_default_target.append( m_table->name() );
+ if ( is_build_in_chain ) {
+ m_cmd_default_target.append( " -P " );
+ m_cmd_default_target.append( name() );
+ m_cmd_default_target.append( " " );
+ } else {
+ m_cmd_default_target.append( " -A " );
+ m_cmd_default_target.append( name() );
+ m_cmd_default_target.append( " -j " );
+ }
+ m_cmd_default_target.append( m_default_target );
+ //kdDebug() << "Default Target Cmd: " << m_cmd_default_target << endl;
+ return m_cmd_default_target;
+}
+
+const QDomDocument& IPTChain::getDOMTree() {
+ // kdDebug() << "const QString& IPTChain::getIDOMree( )" << endl;
+ QDomDocument doc;
+ QDomElement root = doc.createElement( XML::Chain_Element );
+ NetfilterObject::saveUuid( root );
+
+
+ root.setAttribute( XML::Name_Attribute, name() );
+ if ( hasDefaultTarget() )
+ root.setAttribute( XML::DefaultTarget_Attribute, m_default_target );
+
+ root.setAttribute( XML::Description_Attribute, description() );
+
+ if ( isBuildIn() ) {
+ root.setAttribute( XML::BuiltIn_Attribute, XML::Yes_Value );
+ } else {
+ root.setAttribute( XML::BuiltIn_Attribute, XML::No_Value );
+ }
+
+ if ( logging() ) {
+ QDomElement logging = doc.createElement( XML::Logging_Element );
+ root.appendChild( logging );
+ logging.setAttribute( XML::Prefix_Attribute, m_log_prefix );
+ logging.setAttribute( XML::Limit_Attribute, m_log_limit );
+ logging.setAttribute( XML::Burst_Attribute, m_log_burst );
+ }
+
+ QPtrListIterator<IPTRule> it ( m_ruleset );
+ IPTRule *rule = 0;
+ while ( ( rule = it.current() ) != 0 ) {
+ ++it;
+ if ( rule) {
+ root.appendChild( rule->getDOMTree( ) );
+ // kdDebug() << "Got XML for Rule: " << rule->name() << endl;
+ } else {
+ kdDebug() << "Rule == 0"<< endl;
+ }
+ }
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+
+void IPTChain::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ kdDebug() << "void IPTChain::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML( root, errors );
+}
+void IPTChain::loadXML( QDomNode root, QStringList& errors ) {
+/*
+void IPTChain::loadXML( const QDomDocument& doc ) {*/
+ kdDebug() << "\nvoid IPTChain::loadXML( const QDomDocument& doc )" << endl;
+ NetfilterObject::loadUuid( root, errors );
+ // QDomNode curr = root.toElement();
+
+ QString target = "";
+ QString builtin = "";
+ QString desc = "";
+ kdDebug() << "Parsing node: " << root.nodeName() << endl;
+ builtin = root.toElement().attribute( XML::BuiltIn_Attribute );
+ if ( !builtin.isEmpty() && builtin == XML::Yes_Value ) {
+ setBuildIn( true );
+ } else if ( !builtin.isEmpty() && builtin == XML::No_Value ) {
+ setBuildIn( false );
+ }
+
+ target = root.toElement().attribute( XML::DefaultTarget_Attribute );
+ if ( !target.isEmpty() ) {
+ if ( ! isBuildIn() )
+ hasCustomDefaultTarget( true );
+ setDefaultTarget( *(new QString( target ) ) );
+ }
+
+
+ desc = root.toElement().attribute( XML::Description_Attribute );
+ setDescription( *(new QString( desc ) ) );
+ kdDebug() << "Loading chain description: " << desc << endl;
+
+ kdDebug() << "Loading Chain: " << name() << endl;
+ kdDebug() << "Is built in: " << builtin << endl;
+ kdDebug() << "Description chain description: " << desc << endl;
+
+ QDomNode curr = root.firstChild();
+ QPtrList<IPTRule> used_rules;
+ while ( !curr.isNull() ) {
+ kdDebug() << "Parsing Node: " << curr.nodeName() << endl;
+ if ( curr.isElement() && curr.nodeName() == XML::Rule_Element ) {
+ QString name = curr.toElement().attribute( XML::Name_Attribute );
+ QString id = curr.toElement().attribute( XML::Uuid_Attribute );
+ QUuid rule_id( id );
+
+ // kdDebug() << "IPTChain: Start Parsing Rule: " << name << endl;
+ QDomDocument rule_xml;
+ rule_xml.appendChild( curr.cloneNode(true) );
+ IPTRule* rule = 0;
+ rule = ruleForUuid( rule_id );
+ if ( ! rule ) {
+ rule = ruleForName( name );
+ if ( ! rule ) {
+ rule = addRule( name, m_err );
+ if ( ! rule || m_err->errNum() != 0 ) {
+ kdDebug() << "ERROR: Couldn't create Rule: " << name << endl;
+ kdDebug() << "Error Message: " << m_err->errMsg() << endl;
+ return;
+ }
+ }
+ // kdDebug() << "IPTChain: Created Rule: " << name << endl;
+ }
+ rule->loadXML( rule_xml, errors );
+ used_rules.append( rule );
+ // kdDebug() << "IPTChain: Finished Parsing Rule: " << name << endl;
+ } else if( curr.isElement() && curr.nodeName() == XML::Logging_Element ) {
+ QString log_limit = "";
+ QString log_burst = "";
+ QString log_prefix = "";
+
+ enable_log = true;
+ log_limit = curr.toElement().attribute( XML::Limit_Attribute );
+ if( ! log_limit.isEmpty() )
+ m_log_limit = log_limit;
+
+ log_burst = curr.toElement().attribute( XML::Burst_Attribute );
+ if( ! log_burst.isEmpty() )
+ m_log_burst = log_burst;
+
+ log_prefix = curr.toElement().attribute( XML::Prefix_Attribute );
+ if( ! log_prefix.isEmpty() )
+ m_log_prefix = log_prefix;
+ }
+ curr = curr.nextSibling();
+ }
+
+
+ QPtrListIterator<IPTRule> it ( m_ruleset );
+ while ( it.current() ) {
+ // kdDebug() << "IPTChain::xloadXML() cleanup loop." << endl;
+ IPTRule *rule = it.current();
+ QPtrListIterator<IPTRule> it2 ( used_rules );
+ bool found = false;
+ while ( it2.current() ) {
+ IPTRule *rule2 = it2.current();
+ ++it2;
+ if ( rule2 == rule )
+ found = true;
+ }
+ if ( ! found ) {
+ m_err = delRule( rule );
+ if ( m_err->errNum() != 0 )
+ ++it;
+ } else {
+ ++it;
+ }
+ }
+ changed();
+}
+
+QPtrList<QStringList>& IPTChain::createIPTablesChainRules() {
+ // kdDebug() << "QPtrList<QStringList>& IPTChain::createIPTablesChainRules()" << endl;
+ QPtrList<QStringList>* all_rules = new QPtrList<QStringList>;
+ if ( !m_ruleset.isEmpty() ) {
+ //kdDebug() << "------- Chain Rules --------"<< endl;
+ IPTRule * rule;
+ for ( rule = m_ruleset.first(); rule; rule = m_ruleset.next() ) {
+ QString rule_name = rule->name();
+ QString rule_cmd = rule->toString();
+ QStringList* chainDefs = new QStringList();
+ chainDefs->append( rule_name );
+ if ( rule->enabled() ) {
+ chainDefs->append( rule_cmd );
+ } else {
+ QString warning = "if [ \"$verbose\" = \"1\" ]; then\n"
+ " echo \"Skipping Disabled Rule " + rule_name + "!!!\"\n"
+ "fi\n true";
+ chainDefs->append( warning );
+ }
+ all_rules->append( chainDefs );
+ }
+ }
+ if ( enable_log ) {
+ //kdDebug() << "------- Chain Logging --------"<< endl;
+ QString chain_log = "";
+ chain_log.append( "$IPT -t " );
+ chain_log.append( m_table->name() );
+ chain_log.append( " -A " );
+ chain_log.append( name() );
+ if ( ! m_log_limit.isEmpty() && m_log_limit != XML::Undefined_Value ) {
+ chain_log.append( " -m limit --limit " );
+ chain_log.append( m_log_limit );
+ if ( ! m_log_burst.isEmpty() && m_log_burst != XML::Undefined_Value ) {
+ chain_log.append( " --limit-burst " );
+ chain_log.append( m_log_burst );
+ }
+ }
+ chain_log.append( " -j LOG" );
+ if ( !m_log_prefix.isEmpty() && m_log_prefix != XML::Undefined_Value ) {
+ chain_log.append( " --log-prefix \"" );
+ chain_log.append( m_log_prefix );
+ chain_log.append( "\"" );
+ }
+ kdDebug() << chain_log << endl;
+ QStringList* chainDefs = new QStringList();
+ QString rule_name = i18n( "Chain: %1 Drop Logging" ).arg( name() );
+ chainDefs->append( rule_name );
+ chainDefs->append( chain_log );
+ all_rules->append( chainDefs );
+ }
+ //kdDebug() << "------- Chain Default Target --------"<< endl;
+ if ( has_default_target && !m_cmd_default_target.isEmpty() ) {
+ QString deftg = createIPTablesChainDefaultTarget();
+ QStringList* chainDefs = new QStringList();
+ QString rule_name = i18n( "Chain: %1 Default Target" ).arg( name() );
+ chainDefs->append( rule_name );
+ chainDefs->append( deftg );
+ all_rules->append( chainDefs );
+ }
+ // kdDebug() << "Leaving IPTChain::createIPTablesChainRules()" << endl;
+ return *all_rules;
+}
+
+}
+
diff --git a/kmyfirewall/core/iptchain.h b/kmyfirewall/core/iptchain.h
new file mode 100644
index 0000000..6a6db2b
--- /dev/null
+++ b/kmyfirewall/core/iptchain.h
@@ -0,0 +1,215 @@
+/***************************************************************************
+begin : Mon Jan 28 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef IPTCHAIN_H
+#define IPTCHAIN_H
+
+#include "netfilterobject.h"
+
+#include "qptrlist.h"
+#include "qstringlist.h"
+#include "qdom.h"
+#include "quuid.h"
+
+#include <kdemacros.h>
+
+namespace KMF {
+class KMFError;
+class IPTRule;
+class IPTable;
+
+/**
+ *@author Christian Hubinger
+ */
+
+
+class KDE_EXPORT IPTChain : public NetfilterObject {
+public:
+
+ /** The Constructor that will set the "Name" and the "Table" of the chain. If buildin is set true the chain will be handeled as bild-in chain. Normaly this is only done at the initiallistaion of the whole KMFIPTDoc.
+ */
+ IPTChain( IPTable* table, const char* name, const QString& chainName, bool buildin = false );
+ ~IPTChain();
+
+ virtual int type();
+ virtual void clear();
+
+ /** Sets the table to which this chain will be added */
+ void setTable( IPTable* table );
+
+ /** Return the IPTAble to which this chain belongs */
+ IPTable* table() const;
+
+ /** Sets the Default Policy of the Chain if it is a
+ build in chain like ( $IPT -P INPUT -j DROP )
+ For user defined chain this function generates a
+ rule like ( $IPT -A CHAINNAME -j DROP ) which will
+ be added at the end of the chain to avoid that the
+ packetes jump back to the chain that feeded this chain. */
+ void setDefaultTarget( const QString& );
+
+ /** Enabbles/Disables the build in logging for this Chain.
+ This will generate a Rule like: $IPT -A CHAINNAME --match
+ limit --limit <limit> --limit-burst <burst> -j LOG --log-prefix
+ <prefix> This rule will be placed right before the
+ Default Policy to log just the Packets that don't match any
+ of the rules defined by this chain. limit, burst, prefix may be
+ empty strings to disable those features.
+ If enable is "false" the logging will be deactivated. */
+ void setDropLogging( bool enable,
+ QString& limit ,
+ QString& burst ,
+ QString& prefix );
+
+ /** Defines weather a Chain is build-in or is user-defined */
+ void setBuildIn( bool );
+
+ /** will set a switch that lets the chain be shown by the GUI */
+ void setUsed( bool );
+
+ /** Sets if a chain has a "Default Policy" set. */
+ void hasCustomDefaultTarget( bool has_target );
+
+ /** Moves the rule up (to beginning of the chain) if how_much < 0 else
+ moves the rule down (to end of the chain) */
+ bool moveRule( IPTRule* rule, int how_much );
+
+ /** Simply adds a Rule to the Chains Ruleset. */
+ IPTRule* addRule( const QString& name, KMFError*, int index = -1 );
+
+ /** The the index of the rule in the chain **/
+ int indexOf( const IPTRule& );
+
+ /** Deletes a given Rule in the Ruleset. */
+ KMFError* delRule( IPTRule* );
+
+ /** Returns a pointer to a rule for the given name if it exists in
+ this chain. If no rule is found 0 is returned */
+ IPTRule* ruleForName( const QString& name );
+
+ /** Returns a pointer to a rule for the given object id if it exists in
+ this chain. If no rule is found 0 is returned */
+ IPTRule* ruleForUuid( const QUuid& );
+
+
+ /** Returns "true" if the logging is enabled, otherwhise "false". */
+ bool logging() const {
+ return enable_log;
+ };
+
+ /** Returns "true" if the Chain is a build-in chain and "fasle" if it is
+ an user defined chain */
+ bool isBuildIn() const {
+ return is_build_in_chain;
+ };
+
+ /** Returns "true" if the Chain has a "Default Policy" set or not. */
+ bool hasDefaultTarget() const {
+ return has_default_target;
+ };
+
+ /** Returns "true" if the Chain should be visible inn the GUI. */
+ bool isUsed() const {
+ return is_used;
+ };
+
+ /** Reset the chain to its initial state */
+ void reset();
+
+ /** Returns the limit of matches for the logging - rule. */
+ const QString& logLimit() const {
+ return m_log_limit;
+ };
+
+ /** Returns the log prefix */
+ const QString& logPrefix() const {
+ return m_log_prefix;
+ };
+
+ /** Returns the log limit burst number. */
+ const QString& logBurst() const {
+ return m_log_burst;
+ };
+
+ /** Returns the returns the Chaindefinition ($IPT -N chainname)
+ if this is a user defined chain. if it's a build in chain
+ like INPUT it returnes an empty string. */
+ const QString& chainDefinitions() const {
+ return m_cmd_chain_definition ;
+ } ;
+
+ /** Returns the Chain Policy ( "DROP" "ACCEPT" "LOG" etc ) */
+ const QString& defaultTarget() const {
+ return m_default_target;
+ } ;
+
+ /** Returns rules that forward packets to other chains.
+ Those Rules have a chain as their target ( -j <chainname>) */
+ QPtrList<IPTRule>& chainFwds();
+
+ /** Returns rules that forward packets to this chain.
+ Those Rules have this chain as their target ( -j <chainname>) */
+ QPtrList<IPTRule>& chainFeeds();
+
+ /** Returns the whole ruleset defined by the Chain as
+ an QPtrList<IPTRule>. */
+ QPtrList<IPTRule>& chainRuleset() const;
+
+ /** Returns a list of strings like: "$IPT -A CHAINNAME OPTIONS
+ [ all kind of allowed optiions p.e --match state --state NEW,
+ RELATED --source 192.168.0.2 ... ] -j TARGET [target options
+ p.e --log-prefix 'KMF:' ] */
+ QPtrList<QStringList>& createIPTablesChainRules();
+
+ /** Returns a String like: "$IPT -P INPUT DROP" for build-in
+ and "$IPT -A CHAINNAME -j DROP" for user defined chans. */
+ QString createIPTablesChainDefaultTarget();
+
+ /** Returns a String like: "$IPT -N CHAINNAME" that is written to the script. */
+ QString createIPTablesChainDefinition();
+
+ /** Return DomDocument of this Chain */
+ const QDomDocument& getDOMTree();
+
+ /** Lad the XML sniplet representing the chain */
+ virtual void loadXML( const QDomDocument&, QStringList& errors );
+
+ /** Load Table From DomNode */
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+private: // functions
+
+private: //data
+ // initialisized by the constructor
+ IPTable* m_table;
+ KMFError* m_err;
+
+ bool is_used;
+ bool enable_log;
+ bool is_build_in_chain;
+ bool has_default_target;
+
+ QString m_log_limit;
+ QString m_log_prefix;
+ QString m_log_burst;
+
+ QString m_default_target;
+ QString m_cmd_chain_definition;
+ QString m_cmd_default_target;
+
+ QPtrList<IPTRule> m_ruleset;
+};
+}
+#endif
diff --git a/kmyfirewall/core/iptrule.cpp b/kmyfirewall/core/iptrule.cpp
new file mode 100644
index 0000000..dec79b0
--- /dev/null
+++ b/kmyfirewall/core/iptrule.cpp
@@ -0,0 +1,547 @@
+/***************************************************************************
+begin : Mon Feb 4 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//project includes
+#include "iptrule.h"
+// #include "iptruleoption.h"
+#include "iptchain.h"
+#include "iptable.h"
+#include "kmfdoc.h"
+#include "kmferror.h"
+#include "kmfcheckinput.h"
+#include "xmlnames.h"
+
+//qt includes
+#include "qstring.h"
+#include "qdict.h"
+
+// kde includes
+#include <kdebug.h>
+#include <klocale.h>
+
+namespace KMF {
+
+IPTRule::IPTRule( IPTChain* tmp_chain, const char *name, const QString& tmp_name, const QString& tmp_target ) : NetfilterObject( tmp_chain, name ) {
+// m_object_type = NetfilterObject::RULE;
+ setName( XML::Undefined_Value );
+ m_target = XML::Undefined_Value;
+ m_check_input = new KMFCheckInput();
+ m_err = new KMFError();
+ setChain( tmp_chain );
+ setTable( tmp_chain->table() );
+ setName( tmp_name );
+ setTarget( tmp_target );
+ setCustomRule( false );
+ m_enabled = true;
+ m_log_rule = false;
+ m_options.setAutoDelete( false );
+ ipt_cmd = "$IPT";
+ tab = "-t";
+ ap = "-A";
+ ws = " ";
+ post = "-j";
+}
+
+IPTRule::~IPTRule() {
+ // kdDebug() << "\nIPTRule::~IPTRule()" << endl;
+ delete m_check_input;
+ delete m_err;
+ clear();
+}
+
+int IPTRule::type() {
+// kdDebug() << "IPTRule::type()" << endl;
+ return NetfilterObject::RULE;
+}
+
+void IPTRule::clear() {
+ m_options.setAutoDelete( true );
+ m_options.clear();
+ m_options.setAutoDelete( false );
+}
+
+KMFError* IPTRule::setRuleName( const QString& tmp_name ) {
+ kdDebug() << "IPTRule::setName( const QString& tmp_name )" << endl;
+ QString inp = tmp_name;
+ m_check_input->checkInput( inp, "RULENAME", m_err );
+ if ( m_err->errType() != KMFError::OK ) {
+ kdDebug() << "-- Name unchanged: invalid name" << tmp_name << endl;
+ return m_err;
+ }
+ NetfilterObject::setName( tmp_name );
+ changed();
+ return m_err;
+}
+
+void IPTRule::setChain( IPTChain* ch ) {
+ setParent( ch );
+ m_chain = ch;
+ changed();
+}
+
+void IPTRule::setTable( IPTable* tmp_table ) {
+ m_table = tmp_table;
+ changed();
+ // kdDebug() << "Rule Table: " << *m_table->name() << endl;
+}
+
+void IPTRule::setEnabled( bool on ) {
+ m_enabled = on;
+ changed();
+}
+
+void IPTRule::setLogging( bool on ) {
+ m_log_rule = on;
+ changed();
+}
+
+void IPTRule::setTarget( const QString& tmp_target ) {
+ if ( !tmp_target.isNull() ) {
+ m_target = tmp_target;
+ }
+
+ QPtrList<QString>* available_options = IPTRuleOption::getAvailableOptionTypes();
+ for ( uint j = 0;j < available_options->count();j++ ) {
+ QString type = *available_options->at( j );
+ IPTRuleOption* opt = 0;
+ opt = getOptionForName( type );
+ if ( opt && opt->isTargetOption() ) {
+ QStringList args;
+ opt->loadValues( args );
+ }
+ }
+ changed();
+}
+
+void IPTRule::setCustomRule( bool on ) {
+ m_custom_rule = on;
+ changed();
+}
+
+int IPTRule::ruleNum() const {
+ return chain()->indexOf( *this );
+ //return m_rule_num;
+}
+
+const QString& IPTRule::target() const {
+ return m_target;
+}
+
+bool IPTRule::isForward() const {
+ //FIXME: Is that sematically correct???
+ if ( m_target == "ACCEPT" || m_target == "DROP" ||
+ m_target == "LOG" || m_target == "QUEUE" ||
+ m_target == "RETURN" || m_target == "REJECT" ||
+ m_target == "MIRROR" || m_target == "SNAT" ||
+ m_target == "DNAT" || m_target == "REDIRECT" ||
+ m_target == "MASQUERADE" || m_target == "MARK" ||
+ m_target == "TOS" ) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+QStringList IPTRule::availableTargets() const {
+ kdDebug() << "QStringList availableTargets() const {" << endl;
+ QStringList targets;
+ QString table = chain() ->table() ->name();
+ QString name = chain() ->name();
+ if ( table.isEmpty() || name.isEmpty() ) {
+ kdDebug() << "KMFRuleEdit::slotAddValidTargets( const IPTChain& chain ): ERROR: name or table not found in table" << endl;
+ return *( new QStringList() );
+ }
+ // general Targets
+ targets << "ACCEPT" << "DROP" << "LOG" << "QUEUE" << "RETURN";
+ if ( name == Constants::InputChain_Name || name == Constants::OutputChain_Name || name == Constants::ForwardChain_Name )
+ targets << "REJECT";
+
+ if ( name == Constants::InputChain_Name || name == Constants::OutputChain_Name || name == Constants::PreRoutingChain_Name )
+ targets << "MIRROR";
+
+ if ( table == Constants::NatTable_Name && name == Constants::PostRoutingChain_Name )
+ targets << "SNAT";
+
+ if ( table == Constants::NatTable_Name && ( name == Constants::PreRoutingChain_Name || name == Constants::OutputChain_Name ) ) {
+ targets << "DNAT" << "REDIRECT";
+ }
+
+ if ( table == Constants::NatTable_Name && name == Constants::PostRoutingChain_Name )
+ targets << "MASQUERADE";
+
+ if ( table == Constants::MangleTable_Name ) {
+ targets << "MARK" << "TOS";
+ }
+
+ if ( table == Constants::FilterTable_Name || table == Constants::NatTable_Name || table == Constants::MangleTable_Name ) {
+ QPtrList<IPTChain> tmp_chains = chain() ->table() ->chains();
+ QPtrListIterator<IPTChain> it( tmp_chains );
+ while ( it.current() ) {
+ IPTChain * tmp_ch = it.current();
+ ++it;
+ if ( !tmp_ch->isBuildIn() && tmp_ch->name() != name ) {
+ // kdDebug() << "Adding Chain: " << tmp_ch->name() << " to Targets. " << endl;
+ targets << tmp_ch->name();
+ }
+ }
+ }
+ return targets;
+}
+
+IPTRuleOption* IPTRule::getOptionForName( const QString& type ) {
+ IPTRuleOption * option_obj;
+ option_obj = m_options.find( type );
+ if ( option_obj == 0 && !type.stripWhiteSpace().isEmpty() ) {
+ // kdDebug() << "Creating new IPTRuleOption( IPTRule* )" << endl;
+ option_obj = new IPTRuleOption( this, type.latin1() );
+ option_obj->setOptionType( type );
+ m_options.insert( type, option_obj );
+ return option_obj;
+ } else {
+ return option_obj;
+ }
+}
+
+bool IPTRule::addRuleOption( QString& par_name, QPtrList<QString>& cmds ) {
+ //############# start new implementation ##################//
+ QString new_par_name = "";
+ if ( par_name == "src_ip" || par_name == "dest_ip" ) {
+ // kdDebug() << "Translating to new option name: " << par_name << " -> ip_opt" << endl;
+ new_par_name = "ip_opt";
+ } else if ( par_name == "mac" ) {
+ // kdDebug() << "Translating to new option name: " << par_name << " -> mac_opt" << endl;
+ new_par_name = "mac_opt";
+
+ } else {
+ new_par_name = par_name;
+ }
+ if ( new_par_name.stripWhiteSpace().isEmpty() ) {
+ return false;
+ }
+ IPTRuleOption * option_obj;
+ option_obj = m_options.find( new_par_name );
+ if ( option_obj == 0 ) {
+ // kdDebug() << "Creating new IPTRuleOption( IPTRule* )" << endl;
+ option_obj = new IPTRuleOption( this, new_par_name.latin1() );
+ m_options.insert( new_par_name, option_obj );
+ } else {
+ // kdDebug() << "Option: " << new_par_name << "Allready in Dict" << endl;
+ }
+ kdDebug() << "+ Adding Opiton: " << new_par_name << endl;
+ option_obj->setOptionType( new_par_name );
+ if ( ! cmds.isEmpty() ) {
+ QStringList args;
+ for ( uint i = 0; i < cmds.count(); i++ )
+ args << *( new QString( *cmds.at( i ) ) );
+ option_obj->loadValues( args );
+ } else {
+ option_obj->reset();
+ }
+ // kdDebug() << "Rule->getXMLSniplet(): " << getXMLSniplet() << endl;
+ changed();
+ return true;
+}
+
+bool IPTRule::addTargetOption( QString& par_name, QPtrList<QString>& cmds ) {
+ //############# start new implementation ##################//
+ QString new_par_name = "";
+ new_par_name = par_name;
+
+ if ( new_par_name.stripWhiteSpace().isEmpty() ) {
+ return false;
+ }
+
+ IPTRuleOption * option_obj;
+ option_obj = m_options.find( new_par_name );
+ if ( option_obj == 0 ) {
+ // kdDebug() << "Creating new IPTRuleOption( IPTRule* )" << endl;
+ option_obj = new IPTRuleOption( this, par_name.latin1() );
+ m_options.insert( new_par_name, option_obj );
+ option_obj->setTargetOption( true );
+ } else {
+ // kdDebug() << "Option: " << new_par_name << "Allready in Dict" << endl;
+ option_obj->setTargetOption( true );
+ }
+ option_obj->setOptionType( new_par_name );
+ option_obj->setTargetOption( true );
+ if ( ! cmds.isEmpty() ) {
+ QStringList args;
+ for ( uint i = 0; i < cmds.count(); i++ )
+ args << *( new QString( *cmds.at( i ) ) );
+ option_obj->loadValues( args );
+ } else {
+ option_obj->reset();
+ }
+ // kdDebug() << "Rule->getXMLSniplet(): " << getXMLSniplet() << endl;
+ changed();
+ return true;
+}
+
+
+const QString& IPTRule::toString() {
+ // kdDebug() << "\nconst QString& IPTRule::toString()" << endl;
+ option_cmd = "";
+ option_cmd.append( ipt_cmd ); // $IPT
+ option_cmd.append( ws );
+ option_cmd.append( tab ); // -t
+ option_cmd.append( ws );
+ option_cmd.append( m_table->name() ); // <TABLE>
+ option_cmd.append( ws );
+ option_cmd.append( ap ); // -A
+ option_cmd.append( ws );
+ option_cmd.append( m_chain->name() ); // <CHAIN>
+ option_cmd.append( ws );
+ // append all normal rule options
+ QPtrList<QString>* known_types = 0;
+ known_types = IPTRuleOption::getAvailableOptionTypes();
+ if ( known_types == 0 ) {
+ kdDebug() << "ERROR: IPTRuleOption::getAvailableOptionTypes() == 0\n" << endl;
+ } else {
+ // kdDebug() << "Found Number of Types: " << known_types->count() << endl;
+ for ( uint i = 0; i < known_types->count(); i++ ) {
+ QString* option_name = 0;
+ option_name = known_types->at( i );
+ if ( option_name == 0 ) {
+ kdDebug() << "ERROR: option_name == 0" << endl;
+ } else {
+ // kdDebug() << "Searching for Option: " << *option_name << endl;
+ IPTRuleOption* opt = 0;
+ opt = m_options.find( *option_name );
+ if ( opt && ! opt->isEmpty() && ! opt->isTargetOption() ) {
+ QString option = opt->toString();
+ // kdDebug() << "Add Option: " << opt->toString() << endl;
+ if ( !option.isEmpty() ) {
+ option_cmd.append( opt->toString() );
+ option_cmd.append( ws );
+ }
+ }
+ }
+ }
+ }
+ option_cmd. append( post );
+ option_cmd. append( ws );
+ option_cmd.simplifyWhiteSpace();
+ if ( logging() ) {
+ QString new_line = option_cmd;
+ new_line. append( "LOG" );
+ new_line. append( " --log-prefix \"Rule " + name() + ": \"" );
+ new_line.simplifyWhiteSpace();
+ new_line.append( "\n" );
+ option_cmd.prepend( new_line );
+ }
+
+ option_cmd. append( m_target );
+ option_cmd. append( ws );
+
+ QString target_options = "";
+ if ( known_types == 0 ) {
+ kdDebug() << "ERROR: IPTRuleOption::getAvailableOptionTypes() == 0\n" << endl;
+ } else {
+ // kdDebug() << "Found Number of Types: " << known_types->count() << endl;
+ for ( uint i = 0; i < known_types->count(); i++ ) {
+ QString* option_name = 0;
+ option_name = known_types->at( i );
+ if ( option_name == 0 ) {
+ kdDebug() << "ERROR: option_name == 0" << endl;
+ } else {
+ // kdDebug() << "Searching for Option: " << *option_name << endl;
+ IPTRuleOption* opt = 0;
+ opt = m_options.find( *option_name );
+ if ( opt && opt->isTargetOption() && ! opt->isEmpty() ) {
+ // kdDebug() << "Add Option: " << opt->toString() << endl;
+ QString option = "";
+ option = opt->toString();
+ if ( !option.isEmpty() ) {
+ target_options.append( opt->toString() );
+ target_options.append( ws );
+ target_options.simplifyWhiteSpace();
+ }
+ }
+ }
+ }
+ }
+ option_cmd.append( target_options );
+
+ // kdDebug() << "Rule Cmd Line for Rule " << m_name << ": " << option_cmd << endl;
+ if ( ! logging() )
+ option_cmd.simplifyWhiteSpace();
+ return *( new QString( option_cmd ) );
+}
+
+
+const QDomDocument& IPTRule::getDOMTree( ) {
+ // kdDebug() << "const QString& IPTRule::getDOMTree( )" << endl;
+ QDomDocument doc;
+ QDomElement root = doc.createElement( XML::Rule_Element );
+ NetfilterObject::saveUuid( root );
+ root.setAttribute( XML::Num_Attribute, ruleNum() );
+ root.setAttribute( XML::Name_Attribute, name() );
+ root.setAttribute( XML::Target_Attribute, m_target );
+ root.setAttribute( XML::Description_Attribute, description() );
+ if ( enabled() ) {
+ root.setAttribute( XML::Enabled_Attribute, XML::Yes_Value );
+ } else {
+ root.setAttribute( XML::Enabled_Attribute, XML::No_Value );
+ }
+
+ if ( customRule() ) {
+ root.setAttribute( XML::CustomRule_Attribute, XML::Yes_Value );
+ } else {
+ root.setAttribute( XML::CustomRule_Attribute, XML::No_Value );
+ }
+
+ if ( logging() ) {
+ root.setAttribute( XML::Logging_Attribute, XML::Yes_Value );
+ } else {
+ root.setAttribute( XML::Logging_Attribute, XML::No_Value );
+ }
+
+ QPtrList<QString>* available_options = 0;
+ available_options = IPTRuleOption::getAvailableOptionTypes();
+ if ( available_options ) {
+ QPtrListIterator<QString> it ( *available_options );
+ QString *type = 0;
+ while ( ( type = it.current() ) != 0 ) {
+ ++it;
+ if ( type ) {
+ IPTRuleOption * opt = 0;
+ opt = m_options.find( *type );
+ if ( opt ) {
+ root.appendChild( opt->getDOMTree( ) );
+ // kdDebug() << "Got XML for Rule Option Type: " << *type << endl;
+ } else {
+ // kdDebug() << "No option with type: " << *type << " found. " << endl;
+ }
+ }
+ }
+ }
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+
+void IPTRule::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ kdDebug() << "void IPTRule::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML( root, errors );
+}
+void IPTRule::loadXML( QDomNode root, QStringList& errors ) {
+// void IPTRule::loadXML( const QDomDocument& doc ) {
+ // kdDebug() << "void IPTRule::loadXML( const QDomDocument& doc )" << endl;
+ // kdDebug() << "Parsing XML:\n" << doc.toString() << endl;
+// QDomElement root = doc.documentElement();
+ NetfilterObject::loadUuid ( root, errors );
+ QString name = "";
+ QString num = "";
+ QString logging = "";
+ QString desc = "";
+ QString target = "";
+ QString custom = "";
+ QString enabled = "";
+ name = root.toElement().attribute( XML::Name_Attribute );
+ num = root.toElement().attribute( XML::Num_Attribute );
+ logging = root.toElement().attribute( XML::Logging_Attribute );
+ custom = root.toElement().attribute( XML::CustomRule_Attribute );
+ target = root.toElement().attribute( XML::Target_Attribute );
+ desc = root.toElement().attribute( XML::Description_Attribute );
+ enabled = root.toElement().attribute( XML::Enabled_Attribute );
+
+ if ( logging == XML::Yes_Value ) {
+ setLogging( true );
+ } else {
+ setLogging( false );
+ }
+ if ( enabled == XML::Yes_Value ) {
+ setEnabled( true );
+ } else {
+ setEnabled( false );
+ }
+
+ if ( custom == XML::Yes_Value ) {
+ setCustomRule( true );
+ } else {
+ setCustomRule( false );
+ }
+
+ setTarget( *( new QString( target ) ) );
+ setDescription( *( new QString( desc ) ) );
+ setName( *( new QString( name ) ) );
+/* bool ok;
+ int rule_number = num.toInt( &ok );
+ if ( ok )
+ setRuleNum( rule_number );*/
+ QPtrList<QString> *avail_opts = IPTRuleOption::getAvailableOptionTypes();
+ QPtrListIterator<QString> it ( *avail_opts );
+ while ( it.current() ) {
+ QString name = *it.current();
+ ++it;
+ IPTRuleOption *opt = getOptionForName( name );
+ if ( opt )
+ opt->reset();
+ }
+
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ // kdDebug() << "IPTRule: Parsing Node: " << curr.nodeName() << endl;
+ if ( curr.isElement() && curr.nodeName() == XML::RuleOption_Element ) {
+ QString type = curr.toElement().attribute( XML::Type_Attribute );
+ // kdDebug() << "IPTRule: Start Parsing Option: " << type << endl;
+ QDomDocument opt_xml;
+ opt_xml.appendChild( curr.cloneNode( true ) );
+ IPTRuleOption* opt = 0;
+ opt = m_options.find( *( new QString( type ) ) );
+ if ( opt == 0 ) {
+ QPtrList<QString> list;
+ list.append( new QString( "" ) );
+ addRuleOption( type, list );
+ opt = m_options.find( *( new QString( type ) ) );
+ if ( ! opt ) {
+ kdDebug() << "ERROR: Couldn't create Option: " << type << endl;
+ return ;
+ }
+ // kdDebug() << "IPTRule: Created Option: " << type << endl;
+ }
+ opt->loadXML( opt_xml, errors );
+ // kdDebug() << "IPTRule: Finished Parsing Option: " << type << endl;
+ }
+ curr = curr.nextSibling();
+ }
+ changed();
+}
+
+void IPTRule::createRuleClone( IPTRule* new_rule ) {
+ // kdDebug() << "IPTRule& IPTRule::createRuleClone()" << endl;
+ QString na = name();
+ if ( na.length() > 15 ) {
+ na = na.left( 15 ) ;
+ }
+ new_rule->setCustomRule( m_custom_rule );
+ new_rule->setDescription( description() );
+ new_rule->setLogging( logging() );
+ new_rule->setEnabled( enabled() );
+ new_rule->setTarget( target() );
+ QPtrList<QString>* available_types = IPTRuleOption::getAvailableOptionTypes();
+ QString type = "";
+ QPtrListIterator<QString> it( *available_types );
+ while ( it.current() ) {
+ type = *it.current();
+ ++it;
+ IPTRuleOption* opt = getOptionForName( type );
+ IPTRuleOption* clone_opt = new_rule->getOptionForName( type );
+ // FIXME: Check For Error
+ QStringList *errors = new QStringList();
+ clone_opt->loadXML( opt->getDOMTree(), *errors );
+ }
+}
+
+}
diff --git a/kmyfirewall/core/iptrule.h b/kmyfirewall/core/iptrule.h
new file mode 100644
index 0000000..02f0145
--- /dev/null
+++ b/kmyfirewall/core/iptrule.h
@@ -0,0 +1,176 @@
+/***************************************************************************
+begin : Mon Feb 4 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef IPTRULE_H
+#define IPTRULE_H
+
+#include "netfilterobject.h"
+
+#include <qptrlist.h>
+#include <qdict.h>
+
+#include <kdemacros.h>
+
+// Project Includes
+#include "iptruleoption.h"
+/**
+ *@author Christian Hubinger
+ */
+
+class QString;
+
+namespace KMF {
+
+class IPTChain;
+class IPTable;
+class KMFError;
+class KMFCheckInput;
+/** This class represents one "Rule" in the ruleset needed to settup
+ the firewall those rule look like: $IPT -A CHAINNAME [ OPTIONS ] -j TARGET [ OPTIONS ]
+*/
+
+class KDE_EXPORT IPTRule : public NetfilterObject {
+public:
+
+ /** The only constructor that sets the name,chain,target and table. */
+ IPTRule( IPTChain* chain, const char *objectname , const QString& name , const QString& target );
+ ~IPTRule();
+
+ virtual int type();
+ virtual void clear();
+
+ /** Sets the name of the rule to name.
+ This name is displayed in the Document View */
+ KMFError* setRuleName( const QString& name );
+
+ /** Sets the chain for which this Rule applies */
+ void setChain( IPTChain* chain );
+
+ /** Sets the Target for the Rule */
+ void setTarget( const QString& target );
+
+ /** Sets the Table of the rule to table */
+ void setTable( IPTable* table ); // FIXME: set IPTable to use default="filter"
+
+ /** Enable/Disable cmd line generation for this rule */
+ void setEnabled( bool on );
+
+ /** Return true if the Rule is enabled; else returns false */
+ bool enabled() const {
+ return m_enabled;
+ };
+
+ /** Enable/Disable logging rule for this rule */
+ void setLogging( bool on );
+
+ /** Return true if the rule logging is turend on;
+ else returns false */
+ bool logging() const {
+ return m_log_rule;
+ };
+
+ /** Addes a ruleoption defined the a string optionname
+ e.g. "ip_opt" "state" and the strings needed to define
+ all options is given by the list options values of the */
+ bool addRuleOption( QString& optionname, QPtrList<QString>& options );
+
+
+ /** Addes a rule target option defined the a string optionname
+ e.g. "ip_opt" "state" and the strings needed to define
+ all options is given by the list options values of the */
+ bool addTargetOption( QString& optionname, QPtrList<QString>& options );
+
+ /** Returns the chain to which this rule belongs */
+ IPTChain* chain() const {
+ return m_chain;
+ };
+
+ /** Returns the table to which this rule belongs */
+ IPTable* table() const {
+ return m_table;
+ };
+
+ /** Returns a ruleoption object for this option type if it
+ exists.
+ If no one exists a new rule option will be created with the given type.
+ If the type is invalid 0 is returned. */
+ IPTRuleOption* getOptionForName( const QString& );
+
+ /** Returns the target of the rule */
+ const QString& target() const ;
+
+
+ /** Return the rule number in it's chain */
+ int ruleNum() const;
+
+ /** Return true if this is a rule eith custom options */
+ bool customRule() const {
+ return m_custom_rule;
+ };
+
+ /** Set the custom rule flag */
+ void setCustomRule( bool );
+
+ /** Returns the commandline that this rule represents */
+ const QString& toString();
+
+ /** Serialize the rule to a QDomDocument */
+ const QDomDocument& getDOMTree();
+
+ /** Load the rule from the QDomDocument */
+ virtual void loadXML( const QDomDocument&, QStringList& errors );
+
+ /** Load rule From DomNode */
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+ /** Creates a deep copy of the rule */
+ void createRuleClone( IPTRule* );
+
+
+ /** Returns List of all possible Targets for this rule */
+ QStringList availableTargets() const;
+
+ /** Returns true if the target is the name of a chain
+ e.g the rule forwards packets to a chain */
+ bool isForward() const;
+
+private:
+ /** The chain of the rule */
+ IPTChain *m_chain;
+
+ /** The table of the rule */
+ IPTable *m_table;
+
+ /** The target of the rule */
+ QString m_target;
+
+ KMFError *m_err;
+ KMFCheckInput *m_check_input;
+ QDict<IPTRuleOption> m_options;
+
+ bool m_enabled;
+ bool m_log_rule;
+ bool m_custom_rule;
+
+ QString opt;
+ QString ipt_cmd;
+ QString tab;
+ QString ap;
+ QString ws;
+ QString post;
+ QString option_cmd;
+};
+}
+#endif
diff --git a/kmyfirewall/core/iptruleoption.cpp b/kmyfirewall/core/iptruleoption.cpp
new file mode 100644
index 0000000..2532c64
--- /dev/null
+++ b/kmyfirewall/core/iptruleoption.cpp
@@ -0,0 +1,330 @@
+/***************************************************************************
+begin : Mon Feb 4 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "iptruleoption.h"
+// KDE
+#include <kdebug.h>
+#include <klocale.h>
+
+
+// QT
+#include <qdom.h>
+
+// PROJECT
+#include "kmfdoc.h"
+#include "kmfiptdoc.h"
+#include "iptchain.h"
+#include "iptable.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+//############# Initialise static members
+QDict<QStringList>* IPTRuleOption::m_dict_option_strings = new QDict<QStringList>;
+QDict<QStringList>* IPTRuleOption::m_dict_gui_strings = new QDict<QStringList>;
+QDict<QString>* IPTRuleOption::m_dict_option_names = new QDict<QString>;
+QPtrList<QString>* IPTRuleOption::m_known_types = new QPtrList<QString>;
+bool IPTRuleOption::m_created_dict = false;
+
+IPTRuleOption::IPTRuleOption( IPTRule* rule, const char* name ) : NetfilterObject( rule, name ) {
+ if ( rule == 0 ) {
+ kdDebug() << "ERROR: IPTRuleOption rule == 0" << endl;
+ return;
+ }
+
+ // kdDebug() << "IPTRuleOption::IPTRuleOption(..): Creating new IPTRuleOption" << endl;
+ // m_object_type = NetfilterObject::RULEOPTION;
+ m_rule = rule;
+ m_option_type = XML::Undefined_Value;
+ m_target_option = false;
+ m_dict_option_strings->setAutoDelete( true );
+ m_known_types->setAutoDelete( true );
+ for ( int i = 0; i < MAXOPTNUM;i++ )
+ m_values[ i ] = XML::Undefined_Value;
+
+ if ( ! m_created_dict ) {
+ // Initialise Dict on first use
+ m_rule->chain()->table()->kmfDoc()->registerRuleOptions();
+ m_created_dict = true;
+ }
+
+
+}
+
+IPTRuleOption::~IPTRuleOption() {}
+
+int IPTRuleOption::type() {
+// kdDebug() << "IPTRuleOption::type()" << endl;
+ return NetfilterObject::RULEOPTION;
+}
+
+void IPTRuleOption::clear() {
+}
+
+void IPTRuleOption::setOptionType( const QString& type ) {
+ if ( type.isNull() ) {
+ return;
+ }
+ m_option_type = type;
+}
+
+const QString& IPTRuleOption::guiName() const {
+ return *m_dict_option_names->find( m_option_type );
+}
+
+void IPTRuleOption::setTargetOption( bool is_tg_opt ) {
+ m_target_option = is_tg_opt;
+}
+
+void IPTRuleOption::reset() {
+ for ( int i = 0; i < MAXOPTNUM;i++ )
+ m_values[ i ] = XML::BoolOff_Value;
+ changed();
+}
+
+bool IPTRuleOption::isEmpty() {
+ for ( int i = 0; i < MAXOPTNUM ;i++ ) {
+ // kdDebug() << "Curr opt: " << m_values[ i ] << endl;
+ if ( ! m_values[ i ].isEmpty() && m_values[ i ] != XML::Undefined_Value && m_values[ i ] != XML::BoolOff_Value && m_values[ i ] != " " ) {
+ // kdDebug() << "Curr opt: " << getOptionType() << " is not empty found Value: "<< m_values[ i ] << endl;
+ return false;
+ }
+ }
+ // kdDebug() << "Curr opt: " << getOptionType() << " is empty!" << endl;
+ return true;
+}
+
+void IPTRuleOption::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ kdDebug() << "void IPTRuleOption::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML( root, errors );
+}
+void IPTRuleOption::loadXML( QDomNode root, QStringList& errors ) {
+ NetfilterObject::loadUuid( root, errors );
+
+ QString new_opt_type = root.toElement().attribute( XML::Type_Attribute );
+ if ( m_option_type == XML::BoolOff_Value ) {
+ m_option_type = new_opt_type;
+ }
+ if ( m_option_type == new_opt_type )
+ kdDebug() << "Found Option Type: " << m_option_type << endl;
+
+ QString tmp = root.toElement().attribute( XML::TargetOption_Attribute );
+ if ( tmp == XML::Yes_Value )
+ setTargetOption( true );
+ else
+ setTargetOption( false );
+
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ if ( curr.isElement() ) {
+ if ( curr.nodeName() == XML::RuleOptionValue_Element ) {
+ for ( int i = 0; i < MAXOPTNUM;i++ ) {
+ QDomText textChild = curr.firstChild().toText();
+ QString attrib = QString( "value%1" ).arg( i );
+ QString val = curr.toElement().attribute( attrib );
+
+ if ( !val.isEmpty() && val != XML::Undefined_Value ) {
+ m_values[ i ] = val;
+ // kdDebug() << "Found Option Value: " << m_values[i] << endl;
+ }
+ }
+ }
+ }
+ curr = curr.nextSibling();
+ }
+ changed();
+}
+
+void IPTRuleOption::loadValues( QStringList args ) {
+ for ( uint i = 0; i < MAXOPTNUM; i++ )
+ m_values[ i ] = XML::BoolOff_Value;
+
+ int i = 0;
+ for ( QStringList::Iterator it = args.begin(); it != args.end(); ++it ) {
+ m_values[ i ] = *it;
+ kdDebug() << "+ Inserted Option Argument Nr: " << i << " value: " << m_values[ i ] << endl;
+ i++;
+ }
+ changed();
+}
+
+const QStringList& IPTRuleOption::getValues() {
+ // kdDebug() << "const QStringList& IPTRuleOption::getValues()" << endl;
+ QStringList vals;
+ for ( uint i = 0; i < MAXOPTNUM; i++ ) {
+ QString val = m_values[ i ];
+ // kdDebug() << "Append Value: " << val << endl;
+ vals << val;
+ }
+ return *( new QStringList( vals ) );
+}
+
+
+const QDomDocument& IPTRuleOption::getDOMTree() {
+ // kdDebug() << "const QString& IPTRuleOption::getDOMTree( )" << endl;
+ QDomDocument doc;
+ if ( isEmpty() )
+ return * ( new QDomDocument( doc ) );
+
+ bool found = false;
+ for ( uint i = 0; i < MAXOPTNUM; i++ )
+ if ( !m_values[ i ].isEmpty() && m_values[ i ] != XML::Undefined_Value )
+ found = true;
+ if ( true ) {
+ QDomElement root = doc.createElement( XML::RuleOption_Element );
+ NetfilterObject::saveUuid( root );
+ root.setAttribute( XML::Type_Attribute, m_option_type );
+ if ( m_target_option ) {
+ root.setAttribute( XML::TargetOption_Attribute, XML::Yes_Value );
+ } else {
+ root.setAttribute( XML::TargetOption_Attribute, XML::No_Value );
+ }
+
+ doc.appendChild( root );
+ for ( uint i = 0; i < MAXOPTNUM; i++ ) {
+ QString val = m_values[ i ];
+ if ( !val.isEmpty() && val != XML::Undefined_Value ) {
+ QDomElement tag = doc.createElement( XML::RuleOptionValue_Element );
+ tag.setTagName( XML::RuleOptionValue_Element );
+ // kdDebug() << "Writing Attribute: value" << i << " val: " << val << endl;
+ QString attrib = QString( "value%1" ).arg( i );
+ tag.setAttribute( attrib, val );
+ root.appendChild( tag );
+ }
+ }
+ }
+ // kdDebug() << "XML:\n " << doc.toString() << endl;
+ return *( new QDomDocument( doc ) );
+}
+
+
+const QString& IPTRuleOption::toString() {
+ // kdDebug() << "const QString& IPTRuleOption::toString()" << endl;
+
+ QStringList * commandStrings;
+ commandStrings = m_dict_option_strings->find( m_option_type );
+ QString s = "";
+ QTextStream str( &s, IO_WriteOnly );
+ QString ws = " ";
+ // kdDebug() << "Option: " << m_option_type << " defined " << used << endl;
+ if ( ! isEmpty() && commandStrings && ! commandStrings->isEmpty() ) {
+ // str << *commandStrings->at( 0 );
+ str << ws;
+ // bool was_modifier = false;
+ for ( uint i = 0; i < commandStrings->count(); i++ ) {
+ QString command = *commandStrings->at( i );
+ QString val = m_values[ i ];
+ QStringList* guiStrings = m_dict_gui_strings->find( m_option_type );
+ QString guiName = *guiStrings->at( i );
+
+ if (! val.isNull() &&
+ ! val.isEmpty() &&
+ val != XML::Undefined_Value &&
+ val != XML::BoolOff_Value ) {
+ if ( val == XML::BoolOn_Value ) {
+ val = "";
+ }
+// kdDebug() << "Create option Name: " << guiName << endl;
+// kdDebug() << "Create option string: " << command << " " << val << endl;
+ str << command;
+ str << ws;
+ str << val;
+ str << ws;
+ }
+ }
+ }
+ // kdDebug() << "Returning String: " << s << endl;
+
+ return *( new QString( s.simplifyWhiteSpace() ) );
+}
+
+//############ static members ####################//
+QDict<QStringList>* IPTRuleOption::getOptionStringDict() {
+ return m_dict_option_strings;
+}
+
+QDict<QStringList>* IPTRuleOption::getGUIStringDict() {
+ return m_dict_gui_strings;
+}
+
+QPtrList<QString>* IPTRuleOption::getAvailableOptionTypes() {
+ return m_known_types;
+}
+
+void IPTRuleOption::readRuleOptionDefinition( const QDomDocument& doc ) {
+ QDomElement root = doc.documentElement();
+ QDomNode curr = root.firstChild();
+ bool inOption = false;
+ QString name = "";
+ QString guiName = "";
+ QStringList *vals = 0;
+ QStringList *gui = 0;
+ while ( !curr.isNull() ) {
+ // kdDebug() << "IPTRuleOption: Parsing Node: " << curr.nodeName() << endl;
+ if ( curr.isElement() && curr.nodeName() == "ruleoptiondefinition" ) {
+ name = curr.toElement().attribute( XML::Name_Attribute );
+ guiName = curr.toElement().attribute( XML::GUIName_Attribute );
+ // version = root.toElement().attribute( XML::Version_Attribute );
+ vals = new QStringList();
+ gui = new QStringList();
+ kdDebug() << "+ Register Rule Option: " << name << " " << guiName << endl;
+ inOption = true;
+ readRuleOptionDefinitionNode( curr, vals, gui );
+ m_dict_option_strings->insert( name, vals );
+ m_dict_gui_strings->insert( name, gui );
+ m_dict_option_names->insert( name, new QString( guiName ) );
+ m_known_types->append( ( new QString( name ) ) );
+
+ kdDebug() << "+ Testing Key: " << name << endl;
+ QStringList* list;
+ list = m_dict_option_strings->find( name );
+ if ( list ) {
+ for ( uint i = 0; i < list->count(); i ++ ) {
+ QString s = *list->at( i );
+ kdDebug() << "---+ Found Option String: " << s << endl;
+ s = "";
+ }
+ } else {
+ kdDebug() << "!!!!Couldn't fetch QStringList with key: " << name << endl;
+ }
+ }
+ curr = curr.nextSibling();
+ }
+}
+
+
+void IPTRuleOption::readRuleOptionDefinitionNode( const QDomNode& currNode, QStringList* vals, QStringList* gui ) {
+ QDomNode curr = currNode;
+ curr = curr.firstChild();
+ while ( !curr.isNull() ) {
+ kdDebug() << "IPTRuleOption: Parsing Node: " << curr.nodeName() << endl;
+ if ( curr.isElement() && curr.nodeName() == "option" ) {
+ QString cmd = curr.toElement().attribute( "command" );
+ QString guiName = curr.toElement().attribute( XML::GUIName_Attribute );
+
+ cmd.simplifyWhiteSpace();
+ vals->append( cmd );
+ kdDebug() << "---+ Registering Option String: " << cmd << endl;
+
+ guiName.simplifyWhiteSpace();
+ gui->append( guiName );
+ kdDebug() << "---+ Registering GUI String: " << guiName << endl;
+
+ }
+ curr = curr.nextSibling();
+ }
+}
+
+}
diff --git a/kmyfirewall/core/iptruleoption.h b/kmyfirewall/core/iptruleoption.h
new file mode 100644
index 0000000..55a611b
--- /dev/null
+++ b/kmyfirewall/core/iptruleoption.h
@@ -0,0 +1,133 @@
+/***************************************************************************
+begin : Mon Feb 4 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef IPTRULEOPTION_H
+#define IPTRULEOPTION_H
+
+#include "netfilterobject.h"
+
+// QT
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qdict.h>
+
+#include <qdom.h>
+
+#include <kdemacros.h>
+
+#define MAXOPTNUM 10
+namespace KMF {
+class KMFIPTDoc;
+class IPTRule;
+
+/**
+ * class IPTRuleOption
+ *
+ */
+
+class KDE_EXPORT IPTRuleOption : public NetfilterObject {
+ //########## BEGIN STATIC ##############
+
+public:
+ /** Contains the option commands for each option type. */
+ static QDict<QStringList>* getOptionStringDict();
+
+ /** Returns a Stringlist containing the user visible strings for the opition */
+ static QDict<QStringList>* getGUIStringDict();
+
+ /** Return a list of all currently available option types */
+ static QPtrList<QString>* getAvailableOptionTypes();
+
+ static void readRuleOptionDefinition( const QDomDocument& );
+private:
+ /** Reads a XML OptionDefinitionNode */
+ static void readRuleOptionDefinitionNode( const QDomNode& curr, QStringList* vals, QStringList* gui ) ;
+
+private: // DATA
+ static QDict<QStringList>* m_dict_option_strings;
+ static QDict<QStringList>* m_dict_gui_strings;
+ static QDict<QString>* m_dict_option_names;
+
+ static QPtrList<QString>* m_known_types;
+ static bool m_created_dict;
+ //########## END STATIC ################
+
+ /** Public methods: */
+public:
+ IPTRuleOption( IPTRule* rule, const char* name );
+ ~IPTRuleOption();
+
+ virtual int type();
+ virtual void clear();
+
+ /** restore the opotion config from an xml sniplet */
+ virtual void loadXML( const QDomDocument&, QStringList& errors );
+
+ /** restore the opotion config from an xml sniplet */
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+ /** Makes the option empty. */
+ void reset();
+
+ /** Returns true if no option values are set */
+ bool isEmpty();
+
+ /** Return DomDocument representing this rule() */
+ const QDomDocument& getDOMTree( );
+
+ /** Returns a QString containing the option. */
+ const QString& toString( );
+
+ /** Set Option Type */
+ void setOptionType( const QString& );
+
+ /** Return the type of the option. */
+ const QString& getOptionType() const {
+ return m_option_type;
+ };
+
+ /** Return the type of the option. */
+ const QString& guiName() const ;
+
+ /** Returns true if this is a target option otherwise false*/
+ bool isTargetOption() const {
+ return m_target_option;
+ };
+
+ /** Returns a pointer to the rule to which this options belongs */
+ IPTRule* rule() const {
+ return m_rule;
+ };
+
+ /** Make this option a target option.
+ Target options are appended at the very
+ end of the rule */
+ void setTargetOption( bool );
+
+ /** Load the provided option values in the QStringList. */
+ void loadValues( QStringList );
+
+ /** Returns a QStringList containing the option values. */
+ const QStringList& getValues();
+
+private:
+ IPTRule *m_rule;
+ QString m_option_type;
+ bool m_target_option;
+ QString m_values[ MAXOPTNUM ];
+};
+}
+
+#endif // IPTRULEOPTION_H
diff --git a/kmyfirewall/core/kmfapp.cpp b/kmyfirewall/core/kmfapp.cpp
new file mode 100644
index 0000000..0724359
--- /dev/null
+++ b/kmyfirewall/core/kmfapp.cpp
@@ -0,0 +1,93 @@
+/***************************************************************************
+ begin : Fri Feb 21 2003
+ copyright : (C) 2003 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+// QT includes
+#include <qlabel.h>
+#include <qpainter.h>
+#include <qfont.h>
+#include <qwidget.h>
+
+// KDE includes
+#include <kstandarddirs.h>
+#include <kdebug.h>
+#include <kglobalsettings.h>
+#include <kurl.h>
+#include <kfiledialog.h>
+// Project includes
+#include "kmfapp.h"
+#include "../version.h"
+
+
+namespace KMF {
+
+KMFApp::KMFApp() {}
+KMFApp::~KMFApp() {}
+
+static QLabel *splash = 0;
+
+void set_splash_status( const QString& msg ) {
+ if ( !splash )
+ return ;
+ splash->repaint( FALSE );
+ QPainter p( splash );
+ QFont f( KGlobalSettings::generalFont().family(), 8, QFont::Bold );
+ p.setFont( f );
+ p.setPen( Qt::white );
+ p.drawText( splash->width() / 2 - splash->fontMetrics().width( msg ) / 2, 265, msg );
+ QApplication::flush();
+}
+
+void showSplash() {
+ QRect screen = QApplication::desktop() ->screenGeometry();
+ QRect mainRect;
+ screen = QApplication::desktop() ->screenGeometry( QApplication::desktop() ->screenNumber( mainRect.center() ) );
+
+ bool show = true;
+ if ( show ) {
+ KStandardDirs std_dir;
+ QString dir = std_dir.findResource( "data", "kmyfirewall/pics/splash.png" );
+ kdDebug() << "\nFound Splashscreen at: " << dir << endl;
+
+ QPixmap pic = QPixmap::fromMimeSource( dir );
+ QFont f( KGlobalSettings::generalFont().family(), 8, QFont::Bold );
+ if ( pic.isNull() )
+ return ;
+ QPainter p( &pic );
+ p.setFont( f );
+ p.setPen( Qt::white );
+ p.drawText( 280, 93, QString( "Version %1" ).arg( KMYFIREWALL_VERSION ) );
+ splash = new QLabel( 0, "splash", QWidget::WDestructiveClose | QWidget::WStyle_Customize | QWidget::WStyle_NoBorder | QWidget::WX11BypassWM | QWidget::WStyle_StaysOnTop );
+ splash->setFrameStyle( QFrame::WinPanel | QFrame::Raised );
+ splash->setPixmap( pic );
+ splash->adjustSize();
+ splash->setFixedSize( splash->sizeHint() );
+ splash->move( screen.center() - QPoint( splash->width() / 2, splash->height() / 2 ) );
+ splash->repaint( FALSE );
+ splash->show();
+ set_splash_status( "Initializing..." );
+ QApplication::flush();
+ }
+}
+
+void closeSplash() {
+ if ( splash ) {
+ splash->close();
+ splash = 0;
+ }
+}
+
+}
+
diff --git a/kmyfirewall/core/kmfapp.h b/kmyfirewall/core/kmfapp.h
new file mode 100644
index 0000000..fa8be21
--- /dev/null
+++ b/kmyfirewall/core/kmfapp.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ begin : Fri Feb 21 2003
+ copyright : (C) 2003 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFAPP_H
+#define KMFAPP_H
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kapplication.h>
+
+/**
+ *@author Christian Hubinger
+ */
+
+class QLabel;
+namespace KMF {
+
+
+class KDE_EXPORT KMFApp : public KApplication {
+public:
+ KMFApp();
+ ~KMFApp();
+};
+
+KDE_EXPORT void showSplash();
+KDE_EXPORT void closeSplash();
+KDE_EXPORT void set_splash_status( const QString& );
+
+}
+#endif
diff --git a/kmyfirewall/core/kmfappstate.cpp b/kmyfirewall/core/kmfappstate.cpp
new file mode 100644
index 0000000..4b6d9a3
--- /dev/null
+++ b/kmyfirewall/core/kmfappstate.cpp
@@ -0,0 +1,49 @@
+//
+// C++ Implementation: %{MODULE}
+//
+// Description:
+//
+//
+// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfappstate.h"
+
+// QT Includes
+
+// KDE Includes
+#include "kdebug.h"
+
+
+
+namespace KMF {
+
+bool KMFAppState::_upAndRunning = false;
+bool KMFAppState::_hasOpenDoc = false;
+
+
+KMFAppState::KMFAppState(){}
+
+
+KMFAppState::~KMFAppState(){}
+
+void KMFAppState::setUpAndRunning( bool on ) {
+ kdDebug() << "KMFAppState::setUpAndRunning( " << on << " ) " << endl;
+ _upAndRunning = on;
+}
+
+// void KMFAppState::setHasOpenDoc( bool on ) {
+// kdDebug() << "KMFAppState::setHasOpenDoc( " << on << " ) " << endl;
+// _hasOpenDoc = on;
+// }
+
+bool KMFAppState::upAndRunning() {
+ return _upAndRunning;
+}
+// bool KMFAppState::hasOpenDoc() {
+// return _hasOpenDoc;
+// }
+
+}
diff --git a/kmyfirewall/core/kmfappstate.h b/kmyfirewall/core/kmfappstate.h
new file mode 100644
index 0000000..fb685c8
--- /dev/null
+++ b/kmyfirewall/core/kmfappstate.h
@@ -0,0 +1,37 @@
+//
+// C++ Interface: %{MODULE}
+//
+// Description:
+//
+//
+// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFAPPSTATE_H
+#define KMFAPPSTATE_H
+
+#include <kdemacros.h>
+
+
+namespace KMF {
+/**
+@author Christian Hubinger
+*/
+
+class KDE_EXPORT KMFAppState{
+public:
+ KMFAppState();
+ ~KMFAppState();
+ static void setUpAndRunning( bool on );
+// static void setHasOpenDoc( bool on );
+ static bool upAndRunning();
+// static bool hasOpenDoc();
+
+private:
+ static bool _upAndRunning;
+ static bool _hasOpenDoc;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfcheckinput.cpp b/kmyfirewall/core/kmfcheckinput.cpp
new file mode 100644
index 0000000..c45d111
--- /dev/null
+++ b/kmyfirewall/core/kmfcheckinput.cpp
@@ -0,0 +1,437 @@
+/***************************************************************************
+ begin : Tue Aug 6 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfcheckinput.h"
+// My includes
+#include "kmferror.h"
+
+// QT includes
+#include <qstring.h>
+#include <qregexp.h>
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+namespace KMF {
+
+KMFCheckInput::KMFCheckInput() {
+ generateMsgDict();
+}
+
+KMFCheckInput::~KMFCheckInput() {}
+
+void KMFCheckInput::checkInput( const QString& inp, const QString& inp_type, KMFError* err ) {
+// kdDebug() << "KMFCheckInput::checkInput(QString& inp, const QString& inp_type)" << endl;
+// KMFError *err = new KMFError();
+ QString str_input = inp;
+ if ( str_input.isEmpty() ) {
+ const QString msg = "String is Empty.";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::FATAL );
+ return;
+ }
+
+ if ( inp_type == "IP/NETWORK/FQHN" ) {
+// kdDebug() << "Check for IP/NETWORK/FQHN" << endl;
+ bool isIP = checkIP( str_input );
+ // bool isFQHN = checkFQHN( str_input );
+ bool isNETWORK = checkNetWork( str_input );
+ if ( !isIP && !isNETWORK ) {
+ const QString msg = *m_msg_dict.find( "IP/NETWORK/FQHN" );
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::HINT );
+ return;
+ } else {
+ const QString msg = "";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::OK );
+ return;
+ }
+ }
+
+ if ( inp_type == "PORT" ) {
+ bool isPORT = checkPORT( str_input );
+ if ( !isPORT ) {
+ const QString msg = *m_msg_dict.find( "PORT" );
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::NORMAL );
+ return;
+ } else {
+ const QString msg = "";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::OK );
+ return;
+ }
+ }
+
+ if ( inp_type == "MULTIPORT" ) {
+ bool isMULTIPORT = checkMULTIPORT( str_input );
+ if ( !isMULTIPORT ) {
+ const QString msg = *m_msg_dict.find( "MULTIPORT" );
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::NORMAL );
+ return;
+ } else {
+ const QString msg = "";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::OK );
+ return;
+ }
+ }
+
+ if ( inp_type == "PORT/PORTRANGE" ) {
+ bool isPORT = checkPORT( str_input );
+ bool isPORTRANGE = checkPORTRANGE( str_input );
+ if ( !isPORT && !isPORTRANGE ) {
+ const QString msg = *m_msg_dict.find( "PORT" );
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::NORMAL );
+ return;
+ } else {
+ const QString msg = "";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::OK );
+ return;
+ }
+ }
+
+ if ( inp_type == "FQHN" ) {
+ bool isFQHN = checkFQHN( str_input );
+ if ( !isFQHN ) {
+ const QString msg = *m_msg_dict.find( "FQHN" );
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::NORMAL );
+ return;
+ } else {
+ const QString msg = "";
+ err->setErrMsg( msg );
+ err->setErrType(KMFError::OK );
+ return;
+ }
+ }
+
+ if ( inp_type == "IP" ) {
+ bool isIP = checkIP( str_input );
+ if ( !isIP ) {
+ const QString msg = *m_msg_dict.find( "IP" );
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::NORMAL );
+ return;
+ } else {
+ const QString msg = "";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::OK );
+ return;
+ }
+ }
+
+
+ if ( inp_type == "CHAINNAME" ) {
+ bool isValid = checkChainName( str_input );
+ if ( !isValid ) {
+ const QString msg = *m_msg_dict.find( "CHAINNAME" );
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::NORMAL );
+ return;
+ } else {
+ const QString msg = "";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::OK );
+ return;
+ }
+ }
+
+ if ( inp_type == "RULENAME" ) {
+ bool isValid = checkRuleName( str_input );
+ if ( !isValid ) {
+ const QString msg = *m_msg_dict.find( "RULENAME" );
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::NORMAL );
+ return;
+ } else {
+ const QString msg = "";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::OK );
+ return;
+ }
+ }
+
+ if ( inp_type == "MAC" ) {
+ bool isValid = checkMAC( str_input );
+ if ( !isValid ) {
+ const QString msg = *m_msg_dict.find( "MAC" );
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::NORMAL );
+ return;
+ } else {
+ const QString msg = "";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::OK );
+ return;
+ }
+ }
+
+ const QString msg = "Misuse of this function.";
+ err->setErrMsg( msg );
+ err->setErrType( KMFError::FATAL );
+ return;
+}
+
+bool KMFCheckInput::checkIP( QString inp ) {
+ QRegExp exp( "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$" );
+// kdDebug() << "RegEx isValid: " << exp.isValid() << endl;
+ if ( inp.contains( exp ) ) {
+ int pos;
+ QString str_num;
+ bool valid = true;
+ while ( !inp.isEmpty() ) {
+ pos = inp.find( "." );
+ if ( pos > -1 ) {
+ str_num = inp.left( pos );
+ // kdDebug() << "IP Num Part: " << str_num << endl;
+ inp = inp.right( inp.length() - ( pos + 1 ) );
+ // kdDebug() << "Rest: " << inp << endl;
+ int val = str_num.toInt();
+ // kdDebug() << "Val: " << val << endl;
+ if ( val < 0 || val > 255 ) {
+ valid = false;
+ }
+ } else {
+ str_num = inp;
+ // kdDebug() << "IP Num Part: " << str_num << endl;
+ inp = "";
+ // kdDebug() << "Rest: " << inp << endl;
+ int val = str_num.toInt();
+ // kdDebug() << "Val: " << val << endl;
+ if ( val < 0 || val > 255 ) {
+ valid = false;
+ }
+ }
+ }
+
+ return valid;
+ } else
+ return false;
+}
+
+bool KMFCheckInput::checkNetMask ( QString inp ) {
+ QRegExp exp( "^[0-9]{1,2}$" );
+// kdDebug() << "RegEx isValid: " << exp.isValid() << endl;
+ if ( inp.contains( exp ) ) {
+ int val = inp.toInt();
+ if ( val < 0 || val > 24 ) {
+ kdDebug() << "Mask must not be > 24" << endl;
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+bool KMFCheckInput::checkPORT ( QString inp ) {
+ QRegExp exp( "^[0-9]{1,5}$" );
+// kdDebug() << "RegEx isValid: " << exp.isValid() << endl;
+ if ( inp.contains( exp ) ) {
+ int val = inp.toInt();
+ if ( val < 0 || val > 65535 ) {
+ kdDebug() << "Port must not be > 65535" << endl;
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+bool KMFCheckInput::checkMULTIPORT ( QString inp ) {
+ QString tmp = inp;
+ while ( !tmp.isEmpty() ) {
+ QString port = "";
+ int pos = tmp.find( "," );
+ if ( pos == -1 ) {
+ port = tmp;
+ port = port.stripWhiteSpace();
+ tmp = "";
+ if ( !checkPORT( port ) ) {
+ return false;
+ }
+ } else {
+ port = tmp.left( pos );
+ port = port.stripWhiteSpace();
+ kdDebug() << "Found for port: " << port << endl;
+ tmp = tmp.right( tmp.length() - ( pos + 1 ) );
+ kdDebug() << "Rest: " << tmp << endl;
+ if ( !checkPORT( port ) ) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+bool KMFCheckInput::checkPORTRANGE ( QString inp ) {
+ bool valid_1 = false;
+ bool valid_2 = false;
+ kdDebug() << "Checking for PORTRANGE: " << endl;
+ int delimiter = inp.find( ":" );
+ if ( delimiter == -1 ) {
+ kdDebug() << "This is no port range" << endl;
+ return false;
+ } else {
+ QString port1 = inp.left( delimiter );
+ QString port2 = inp.right( inp.length() - ( delimiter + 1 ) );
+ valid_1 = checkPORT ( port1 );
+ valid_2 = checkPORT ( port2 );
+ if ( valid_1 && valid_2 ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return false;
+}
+
+bool KMFCheckInput::checkNetWork ( QString inp ) {
+ bool valid_address = false;
+ bool valid_mask = false;
+ kdDebug() << "Checking for NETWORK: " << endl;
+ int delimiter = inp.find( "/" );
+ if ( delimiter == -1 ) {
+ kdDebug() << "This is no network" << endl;
+ return false;
+ } else {
+ QString addr = inp.left( delimiter );
+ QString mask = inp.right( inp.length() - ( delimiter + 1 ) );
+ kdDebug() << "Found address: " << addr << endl;
+ kdDebug() << "Found mask: " << mask << endl;
+ if ( mask.isEmpty() ) {
+// kdDebug() << "Mask is Empty\n" << endl;
+ return false;
+ } else {
+ valid_address = checkIP( addr );
+ valid_mask = checkIP( mask );
+// kdDebug() << "Mask address valid: " << valid_mask << endl;
+ if ( !valid_mask ) {
+ valid_mask = checkNetMask ( mask );
+// kdDebug() << "Mask number valid: " << valid_mask << endl;
+ }
+ if ( !valid_address || !valid_mask ) {
+// kdDebug() << "This is no valid Network" << endl;
+ return false;
+ } else {
+// kdDebug() << "This is a valid Network" << endl;
+ return true;
+ }
+ }
+ }
+}
+
+bool KMFCheckInput::checkFQHN( QString inp ) {
+ bool valid = TRUE;
+ // QRegExp exp( "^(\\w{1,256})\\.([a-z]{2,6})$", false );
+ QRegExp exp( "^[0-9a-zA-Z_-\\.]{3,256}$", false );
+ if ( !inp.contains( exp ) )
+ valid = false;
+ return valid;
+}
+
+bool KMFCheckInput::checkMAC( QString inp ) {
+ bool valid = TRUE;
+ QRegExp exp( "^[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}\\:[0-9a-fA-F]{2,2}$", false );
+ if ( !inp.contains( exp ) )
+ valid = false;
+ return valid;
+}
+
+bool KMFCheckInput::checkChainName( QString inp ) {
+ bool valid = TRUE;
+ QRegExp exp( "^[a-zA-Z0-9_]{1,29}$", false );
+ if ( !inp.contains( exp ) )
+ valid = false;
+ return valid;
+}
+
+bool KMFCheckInput::checkRuleName( QString inp ) {
+ bool valid = TRUE;
+ QRegExp exp( "^[a-zA-Z0-9_-]{1,20}$", false );
+ if ( !inp.contains( exp ) )
+ valid = false;
+ return valid;
+}
+
+void KMFCheckInput::generateMsgDict() {
+ QString key = "IP/NETWORK/FQHN";
+ const QString *msg = new QString( i18n( "<p><b>This is not a numerical IP or NETWORK therefore this can only be a HOSTNAME;</b><br>"
+ "there is nothing wrong with that except that you will need to "
+ "have a working name resolution (e.g. DNS) at firewall startup<br>"
+ "and hence the network needs to be up before the firewall can be started. "
+ "Therefore, it is highly recommended that you only use numerical IP/NETWORK addresses, "
+ "but it will also work that way.<br>"
+ "<b>Please note that it is not possible to guarantee that the hostname is valid - it is "
+ "your job to make sure that the hostname is right.</b>"
+ "<p><ul><li>An IP address has the format: [0-255].[0-255].[0-255].[0-255]</li>"
+ "<li>A network may look like 123.123.123.0/255.255.255.0 or 123.123.123.0/24 (these two are identical.)</li>"
+ "<li>A hostname looks like www.debian.org or my-host.the-net.org</li></ul>" ) );
+ m_msg_dict.insert( key, msg );
+
+ key = "IP";
+ const QString *msg2 = new QString( i18n( "<p>This is not a valid IP address or hostname."
+ "<p>An IP address has the format: [0-255].[0-255].[0-255].[0-255]" ) );
+ m_msg_dict.insert( key, msg2 );
+
+ key = "FQHN";
+ const QString *msg3 = new QString( i18n( "<p>This is not a valid IP address or hostname."
+ "<p>A hostname looks like www.suse.com" ) );
+ m_msg_dict.insert( key, msg3 );
+
+ key = "CHAINNAME";
+ const QString *msg4 = new QString( i18n( "<p>This is not a valid chain name."
+ "<p>Chain names <b>must not</b> contain special characters (like whitespace, ?, &, %, etc.) "
+ "and <b>must not</b> be longer then 29 characters" ) );
+ m_msg_dict.insert( key, msg4 );
+
+ key = "MAC";
+ const QString *msg5 = new QString( i18n( "<p>This is not a valid MAC address."
+ "<p>A MAC address has six hex digits from 00-FF<br>A valid address could be: <b>02:E4:5A:90:1B:3C</b>" ) );
+ m_msg_dict.insert( key, msg5 );
+
+ key = "PORT";
+ const QString *msg6 = new QString( i18n( "<p><b>This is not a valid numeric PORT number.</b><br>"
+ "Port numbers are all numbers from 1 to 65535.<br> "
+ "If you specified a service name (e.g. ssh or www) like they are listed "
+ "in <i>/etc/services</i> the rule will work, but it is highly recommended "
+ "that you only use numerical port numbers to avoid problems when having a broken (faked) "
+ "/etc/services file.<br>"
+ "<b>Please think twice about before you use service names, port numbers are much safer.</b>" ) );
+ m_msg_dict.insert( key, msg6 );
+
+ key = "MULTIPORT";
+ const QString *msg7 = new QString( i18n( "<p>This is not a valid MULTIPORT string.<br>"
+ "A MULTIPORT strings is a comma separated list of PORT numbers.<br>"
+ "Please not that service names are not supported within MULTIPORT strings." ) );
+ m_msg_dict.insert( key, msg7 );
+
+ key = "RULENAME";
+ const QString *msg8 = new QString( i18n( "<p>This is not a valid rule name."
+ "<p>Rule names <b>must not</b> contain special characters (like whitespace, ?, &, %, etc.) "
+ "and <b>must not</b> be longer then 20 characters" ) );
+ m_msg_dict.insert( key, msg8 );
+
+}
+
+}
diff --git a/kmyfirewall/core/kmfcheckinput.h b/kmyfirewall/core/kmfcheckinput.h
new file mode 100644
index 0000000..4b85159
--- /dev/null
+++ b/kmyfirewall/core/kmfcheckinput.h
@@ -0,0 +1,77 @@
+/***************************************************************************
+ begin : Tue Aug 6 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFCHECKINPUT_H
+#define KMFCHECKINPUT_H
+
+
+/**
+ *@author Christian Hubinger
+ */
+
+#include <qdict.h>
+
+#include <kdemacros.h>
+class QString;
+
+namespace KMF {
+class KMFError;
+
+class KDE_EXPORT KMFCheckInput {
+public:
+ KMFCheckInput();
+ ~KMFCheckInput();
+
+ /** Check the given input string is it matches the criterias
+ for the given input type */
+ void checkInput( const QString& inp, const QString& inp_type, KMFError* );
+
+private: // functions
+ void generateMsgDict();
+
+ /** Check if inp is a IP address */
+ bool checkIP( QString input );
+
+ /** Check if inp is a FQHN */
+ bool checkFQHN( QString inp );
+
+ /** Check if inp can be a chain name */
+ bool checkChainName( QString inp );
+
+ /** Check if inp can be a rule name */
+ bool checkRuleName( QString inp );
+
+ /** Check if inp is a MAC address */
+ bool checkMAC( QString inp );
+
+ /** Check if inp is a net mask */
+ bool checkNetMask ( QString inp );
+
+ /** Check if inp is a network */
+ bool checkNetWork ( QString inp );
+
+ /** Check if inp is a port */
+ bool checkPORT( QString inp );
+
+ /** Check if inp is a portrange */
+ bool checkPORTRANGE( QString inp );
+
+ /** Check if inp is a multiport string */
+ bool checkMULTIPORT( QString inp );
+private: // data
+ QDict<QString> m_msg_dict;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfcompilerinterface.cpp b/kmyfirewall/core/kmfcompilerinterface.cpp
new file mode 100644
index 0000000..4ccfb9d
--- /dev/null
+++ b/kmyfirewall/core/kmfcompilerinterface.cpp
@@ -0,0 +1,33 @@
+//
+// C++ Implementation: kmcompilerinterface
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include "kmfcompilerinterface.h"
+
+#include <kdebug.h>
+
+
+
+namespace KMF {
+
+KMFCompilerInterface::KMFCompilerInterface() {
+ kdDebug() << "Calling Constuctor: KMFCompilerInterface::KMFCompilerInterface()" << endl;
+}
+
+KMFCompilerInterface::~KMFCompilerInterface() {
+ kdDebug() << "Calling Destructor: KMFCompilerInterface::~KMFCompilerInterface()" << endl;
+}
+
+const QString& KMFCompilerInterface::compile( KMFIPTDoc* ) {
+ return *( new QString("ERROR: This compiler can not compile for KMFIPTDoc") );
+}
+
+}
diff --git a/kmyfirewall/core/kmfcompilerinterface.h b/kmyfirewall/core/kmfcompilerinterface.h
new file mode 100644
index 0000000..166ad58
--- /dev/null
+++ b/kmyfirewall/core/kmfcompilerinterface.h
@@ -0,0 +1,50 @@
+//
+// C++ Interface: kmfcompilerinterface
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFCOMPILERINTERFACE_H
+#define KMFCOMPILERINTERFACE_H
+
+/**
+@author Christian Hubinger
+*/
+
+// QT includes
+#include <qstring.h>
+#include <qobject.h>
+
+// KDE Includes
+#include <kparts/plugin.h>
+
+
+namespace KMF {
+class KMFDoc;
+class KMFGenericDoc;
+class KMFIPTDoc;
+
+
+
+
+
+class KDE_EXPORT KMFCompilerInterface {
+public:
+// KMFCompilerInterface( QObject* parent , const char* name ) : KParts::Plugin( parent , name ) {};
+ KMFCompilerInterface();
+ virtual ~KMFCompilerInterface();
+ virtual void compile() = 0;
+ virtual const QString& compile( KMFGenericDoc* ) = 0;
+ virtual const QString& compile( KMFIPTDoc* );
+ virtual const QString& osName() = 0;
+ virtual const QString& osGUIName() = 0;
+ virtual const QString& backendName() = 0;
+ virtual const QString& backendGUIName() = 0;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfconfig.kcfg b/kmyfirewall/core/kmfconfig.kcfg
new file mode 100644
index 0000000..37d7e69
--- /dev/null
+++ b/kmyfirewall/core/kmfconfig.kcfg
@@ -0,0 +1,87 @@
+<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
+<kcfg>
+<kcfgfile name="kmyfirewallrc"/>
+ <group name="GENERAL">
+ <entry name="FirstRun" type="Bool">
+ <label>Indicates if this is the first startup.</label>
+ <default>true</default>
+ </entry>
+ <entry name="ConfigurationConverted" type="Bool">
+ <label>Indicates if the applicatiojn configuration has been converted to the new multi target model.</label>
+ <default>false</default>
+ </entry>
+ <entry name="MaxUndo" type="Int">
+ <label>Number of undo/redo steps.</label>
+ <default>100</default>
+ </entry>
+ <entry name="ShowSplash" type="Bool">
+ <label>Show splash on strtup.</label>
+ <default>true</default>
+ </entry>
+ <entry name="UseGenericInterface" type="Bool">
+ <label>Show the Generic or the IPTables interface</label>
+ <default>true</default>
+ </entry>
+ <entry name="UseSSHForLocalhost" type="Bool">
+ <label>Use SSH for localhost Execution, enables password keeping, kwallet support</label>
+ <default>false</default>
+ </entry>
+ <entry name="OS" type="String">
+ <label>Which OS are we using.</label>
+ <default>linux</default>
+ </entry>
+ <entry name="Backend" type="String">
+ <label>Firewalling backend name.</label>
+ <default>iptables</default>
+ </entry>
+ <entry name="ShowSelInterface" type="Bool">
+ <label>Show selected Interface.</label>
+ <default>true</default>
+ </entry>
+ </group>
+ <group name="LISTVIEW">
+ <entry name="ShowDocumentation" type="Bool">
+ <label>Show Documentation for default IPTables objects.</label>
+ <default>true</default>
+ </entry>
+ <entry name="ShowCommandLine" type="Bool">
+ <label>Indicates if list view should show the generated commands</label>
+ <default>false</default>
+ </entry>
+ <entry name="ShowObjectID" type="Bool">
+ <label>Indicates if the ObjectIDs should be shown in the ListView.</label>
+ <default>false</default>
+ </entry>
+ </group>
+ <group name="PATHS">
+ <entry name="Distribution" type="String">
+ <label>What kind of ditribution are we using.</label>
+ <default>sysv</default>
+ </entry>
+ <entry name="InitPath" type="String">
+ <label>Path to the init scripts</label>
+ <default>/etc/init.d/</default>
+ </entry>
+ <entry name="rcDefaultPath" type="String">
+ <label>Path to the default runlevel directory.</label>
+ <default>/etc/init.d/rc5.d/</default>
+ </entry>
+ <entry name="IPTPath" type="String">
+ <label>Path to iptables binary.</label>
+ <default>/usr/sbin/iptables</default>
+ </entry>
+ <entry name="ModprobePath" type="String">
+ <label>Path to the modprobe binary.</label>
+ <default>/usr/sbin/modprobe</default>
+ </entry>
+ <entry name="CurrentConfiguration" type="String">
+ <label>Path to the current configuration.</label>
+ </entry>
+ </group>
+ <group name="INTERFACES">
+ <entry name="Interfaces" type="StringList">
+ <label>Network interfaces</label>
+ <default>lo</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/kmyfirewall/core/kmfconfig.kcfgc b/kmyfirewall/core/kmfconfig.kcfgc
new file mode 100644
index 0000000..b99899b
--- /dev/null
+++ b/kmyfirewall/core/kmfconfig.kcfgc
@@ -0,0 +1,6 @@
+File=kmfconfig.kcfg
+ClassName=KMFConfig
+Singleton=true
+Mutators=true
+Visibility=KDE_EXPORT
+NameSpace=KMF \ No newline at end of file
diff --git a/kmyfirewall/core/kmfdoc.cpp b/kmyfirewall/core/kmfdoc.cpp
new file mode 100644
index 0000000..4d2ce73
--- /dev/null
+++ b/kmyfirewall/core/kmfdoc.cpp
@@ -0,0 +1,236 @@
+/***************************************************************************
+ begin : Mon Jan 28 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// StdLib includes
+#include <iostream>
+#include <unistd.h>
+#include <sys/stat.h>
+
+// QT includes
+#include "qtextstream.h"
+#include "qfile.h"
+#include "qxml.h"
+#include "qregexp.h"
+#include "qptrlist.h"
+#include "qmessagebox.h"
+#include <qstringlist.h>
+#include <qvbox.h>
+#include <qlabel.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+#include <kurl.h>
+#include <qfiledialog.h>
+#include <kio/job.h>
+#include <kio/netaccess.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kmessagebox.h>
+#include <ktempfile.h>
+
+// My includes
+#include "../version.h"
+#include "kmfdoc.h"
+#include "iptchain.h"
+#include "iptrule.h"
+#include "iptable.h"
+#include "netfilterobject.h"
+#include "kmferror.h"
+#include "kmfconfig.h"
+#include "kmferrorhandler.h"
+#include "kmfnetwork.h"
+#include "kmftarget.h"
+
+namespace KMF {
+
+KMFDoc::KMFDoc( NetfilterObject *parent, const char *name ) : NetfilterObject( parent, name ) {
+ kdDebug() << "KMFDoc::KMFDoc( QObject *parent, const char *name ) : NetfilterObject( parent )" << endl;
+/* NetfilterObject::setName( i18n( "Unnamed Document" ) );
+ NetfilterObject::setDescription( i18n( "No Description Available" ) );*/
+ m_newSavePathNeeded = true;
+ m_url = KURL();
+ resetUrl();
+}
+
+KMFDoc::~KMFDoc() {}
+
+KURL& KMFDoc::url() {
+ return m_url;
+}
+
+bool KMFDoc::newSavePathNeeded() {
+ return m_newSavePathNeeded;
+}
+
+const QString& KMFDoc::docName() {
+ if ( m_url.isEmpty() ) {
+ return *( new QString( i18n("Unnamed Document") ) );
+ } else {
+ return *( new QString( m_url.fileName() ) );
+ }
+}
+
+void KMFDoc::resetUrl() {
+ m_url.setHost( QString::null );
+ m_url.setPath( QString::null );
+ m_url.setProtocol( QString::null );
+ NetfilterObject::setName( i18n( "Unnamed Document" ) );
+ NetfilterObject::setDescription( i18n( "No Description Available" ) );
+ m_newSavePathNeeded = true;
+}
+
+void KMFDoc::updateView() {
+ kdDebug() << "void KMFDoc::upateView()" << endl;
+}
+
+KMFError* KMFDoc::exportXMLRuleset( bool promptFile, bool asTemplate ) {
+ kdDebug() << "bool KMFDoc::exportXMLRuleset( promptFile " << promptFile << " asTemplate " << asTemplate << " )" << endl;
+ // KMFError err
+
+ kdDebug() << "Curr DocURL:: " << this->url().url() << endl;
+ if ( this->newSavePathNeeded() ) {
+ promptFile = true;
+ }
+ KURL saveUrl = this->url();
+ kdDebug() << "promptFile: " << promptFile << endl;
+ if ( promptFile ) {
+ // KURL url;
+ // bool chooseTemlate = false;
+ QString path = ":";
+ QString filter = "*.kmfrs|KMyFirewall IPTables Ruleset (*.kmfrs)";
+
+ QString desc = i18n("KMyFirewall IPTables Ruleset (*.kmfrs)");
+ QString tdesc = i18n("KMyFirewall IPTables Ruleset Template (*.tkmfrs)");
+
+ QString gdesc = i18n("KMyFirewall Generic Ruleset (*.kmfgrs)");
+ QString tgdesc = i18n("KMyFirewall Generic Ruleset Template (*.tkmfgrs)");
+
+ QString ndesc = i18n("KMyFirewall Network (*.kmfnet)");
+
+
+
+ KStandardDirs std_dir;
+ QString tmp_dir = std_dir.findResourceDir( "data", "kmyfirewall/templates/" );
+ QDir dir( tmp_dir + "/kmyfirewall/templates/" );
+
+
+ filter = QString("*.kmfnet|" + ndesc );
+
+/* saveUrl = KFileDialog::getSaveURL( ":", "*.kmfnet|KMyFirewall Network (*.kmfnet)\n*.kmfgrs|KMyFirewall Generic Ruleset(*.kmfgrs)\n*.kmfrs|KMyFirewall IPTables Ruleset(*.kmfrs)" );*/
+
+ saveUrl = KFileDialog::getSaveURL( ":", getFileDialogFilter() );
+
+ // saveUrl = KFileDialog::getSaveURL( path, filter );
+ QString filename = saveUrl.fileName();
+ if ( saveUrl.fileName().isEmpty() ) {
+ return new KMFError();
+ }
+ int answer = 0;
+ while ( answer != KMessageBox::Yes ) {
+ if ( KIO::NetAccess::exists( saveUrl, false, KApplication::kApplication()->mainWidget() ) ) {
+ if ( answer == 4 ) {
+ return exportXMLRuleset( promptFile, asTemplate );
+ } else {
+ answer = KMessageBox::questionYesNo( 0, i18n( "<qt>File <b>%1</b> already exists!</p>"
+ "<p><b>Overwrite the existing file?</b></p></qt>" ).arg( saveUrl.url() ) );
+ }
+ } else {
+ answer = 3;
+ }
+ }
+ }
+ return exportXMLRuleset( saveUrl );
+}
+
+
+KMFError* KMFDoc::exportXMLRuleset( const KURL& url ) {
+ kdDebug() << "bool KMFIPTDoc::exportXMLRuleset(const KURL& " << url.url() << " )" << endl;
+ KTempFile file;
+ const QString& xml = getXMLSniplet();
+// kdDebug() << "Writing XML:\n " << xml << endl;
+ if ( file.name() != QString::null ) {
+ QFile f( file.name() );
+ f.remove();
+ bool isWriteable = f.open( IO_ReadWrite );
+ if ( isWriteable ) {
+ QTextStream ts( &f );
+ ts << xml << endl;
+ f.flush();
+ f.close();
+
+ if ( ! KIO::NetAccess::upload( file.name(), url, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "Coudn't save File: " << url.url() << endl;
+ m_err->setErrType( KMFError::NORMAL );
+ m_err->setErrMsg( i18n( "<qt><p><b>Saving <i>%1</i> Failed.</b></p>"
+ "<p>Please make sure that you have the permissions to write to this Directory.<br>"
+ "If you are working with remotely stored files "
+ "make sure that the target host and the directory is reachable. "
+ "</p></qt>" ).arg( url.url() ) );
+ file.unlink();
+ return m_err;
+ }
+ file.unlink();
+
+
+ m_err -> setErrType( KMFError::OK );
+ m_err -> setErrMsg( "" );
+ kdDebug() << "KMFDoc: Wrote " << url.url() << endl;
+ m_url = url;
+ m_newSavePathNeeded = false;
+ return m_err;
+ } else {
+ // generate retrun error object
+ m_err -> setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "Opening file %1 for writing failed.\n"
+ "Please make sure that you are logged in as root" ).arg( file.name() );
+ m_err -> setErrMsg( msg );
+ file.unlink();
+ return m_err;
+ }
+
+ } else {
+ // generate retrun error object
+ m_err -> setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "Opening file %1 for writing failed.\n"
+ "Please make sure that you are logged in as root" ).arg( file.name() );
+ m_err -> setErrMsg( msg );
+ file.unlink();
+ return m_err;
+ }
+ // generate retrun error object
+ m_err -> setErrType( KMFError::FATAL );
+ const QString& msg = i18n( "File to save = QString::null. This is a bug." );
+ m_err -> setErrMsg( msg );
+ file.unlink();
+ return m_err;
+}
+
+const QString& KMFDoc::getXMLSniplet() {
+ return *( new QString( getDOMTree().toString() ) );
+}
+
+const QString& KMFDoc::getXMLRuleset() {
+ return getXMLSniplet();
+}
+
+}
+#include "kmfdoc.moc"
diff --git a/kmyfirewall/core/kmfdoc.h b/kmyfirewall/core/kmfdoc.h
new file mode 100644
index 0000000..4db29f2
--- /dev/null
+++ b/kmyfirewall/core/kmfdoc.h
@@ -0,0 +1,150 @@
+/***************************************************************************
+begin : Mon Jan 28 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef KMFDOC_H
+#define KMFDOC_H
+
+//project includes
+#include "iptchain.h"
+#include "iptrule.h"
+#include "iptruleoption.h"
+#include "iptable.h"
+#include "kmfnetzone.h"
+#include "netfilterobject.h"
+
+// qt includes
+#include "qdict.h"
+#include "qvaluelist.h"
+#include "qptrlist.h"
+#include "qstring.h"
+#include "qobject.h"
+
+// kde includes
+#include "kurl.h"
+
+/**
+ *@author Christian Hubinger
+ */
+class KURL;
+
+namespace KMF {
+class KMFErrorHandler;
+class KMFError;
+
+class KMFNetwork;
+class KMFTarget;
+
+//############# Start class KMFDoc ###############
+/**
+ KMFDoc is the base class for all document classes in KMyFirewall.
+ It provides the most common features a document class should have
+ e.g. undo/redo setUrl() setFilename() etc. and lots of abstarct methods
+ that need to be implemented by a document class.
+*/
+
+class KDE_EXPORT KMFDoc : public NetfilterObject {
+ Q_OBJECT
+public:
+ KMFDoc( NetfilterObject* parent, const char* name );
+ virtual ~KMFDoc();
+
+
+ /** resets the document to the initial values */
+ virtual void clear() = 0;
+
+// /** return a QString containing the documents script to
+// setup the firewall configuration */
+// virtual const QString& compile() = 0;
+
+ /** Writes the xml-representation of this document a String and returns it. */
+ virtual const QString& getXMLRuleset();
+
+ /** return true if the document is in it's initial state */
+ virtual bool isEmpty() = 0;
+
+// /** Writes the shellscrip that contains the iptables commands to settup
+// the firewall to file.
+// If file = QString::null a SaveAs dialog will popup. */
+// KMFError* createFirewallScript( const QString& fi );
+
+// /** Return DomDocument of this Chain */
+// virtual const QDomDocument& getDOMTree() = 0;
+
+ /** Return String representation of the DomDocument generated by const QDomDocument& getDOMTree() */
+ virtual const QString& getXMLSniplet();
+
+ /** Load configuratuion from the QDomDocument */
+// virtual void loadXML( const QDomDocument&, QStringList& errors ) = 0;
+
+ /** Load configuratuion from the QDomDocument */
+// virtual void loadXML( QDomNode, QStringList& errors ) = 0;
+
+ /** Save the rule set to the given file defined by the KURL */
+ virtual KMFError* exportXMLRuleset( bool promptFile, bool asTemplate );
+
+ /** Get the File dialog filter string for the document type */
+ virtual const QString& getFileDialogFilter() = 0;
+
+ /** Load the ruleset from the given url */
+ virtual void parseDocument( const KURL&, QStringList& errors ) = 0;
+
+ /** return the documents KURL pointer */
+ KURL& url();
+
+ bool newSavePathNeeded();
+ void resetUrl();
+
+ /** Set Description for this Object */
+// virtual void setDescription( const QString& ) = 0;
+
+ /** Return the Object's Description */
+/* const QString description() const {
+ return m_description;
+ };*/
+
+ /** Set Name for this Object */
+// virtual void setName( const QString& ) = 0;
+
+ /** Return the Object's Description */
+ virtual const QString& docName();
+
+
+ // void objChanged();
+// void objChanged( int );
+
+ /** update the View */
+ void updateView();
+
+protected:
+ virtual KMFError* exportXMLRuleset( const KURL& );
+ virtual void initDoc() = 0;
+
+ KURL m_url;
+ KMFErrorHandler *m_err_handler;
+ KMFError *m_err;
+ bool m_newSavePathNeeded;
+
+signals:
+ void documentChanged();
+ void documentChanged( KMFDoc* );
+ void sigEnableUndo( bool );
+ void sigEnableRedo( bool );
+
+};
+}
+
+
+
+
+#endif
diff --git a/kmyfirewall/core/kmferror.cpp b/kmyfirewall/core/kmferror.cpp
new file mode 100644
index 0000000..13c2219
--- /dev/null
+++ b/kmyfirewall/core/kmferror.cpp
@@ -0,0 +1,110 @@
+/***************************************************************************
+ begin : Tue Aug 6 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmferror.h"
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+
+
+//############# static ##############//
+
+namespace KMF {
+
+KMFError* KMFError::parseErrors( QStringList& errors ) {
+ KMFError *err = new KMFError();
+ QStringList::iterator it = errors.begin();
+ QString msg = "";
+ while( it != errors.end() ) {
+ QString s = *it;
+ kdDebug() << "Parsing Error: " << s << endl;
+ msg += s;
+ if ( s.contains( i18n("WARNING: ") ) != 0 && err->errType() == KMFError::OK ) {
+ err->setErrType( KMFError::HINT );
+ } else if ( s.contains( i18n("ERROR: ") ) != 0 ) {
+ err->setErrType( KMFError::FATAL );
+ }
+ ++it;
+ }
+
+ err->setErrMsg( msg );
+ return err;
+}
+
+const QString& KMFError::getAsString( int error_type, const QString& msg ) {
+ QString s;
+ s += "<b>";
+ if ( error_type == KMFError::OK ) {
+ s += "<font color=\"green\">" + i18n("SUCCESS: ");
+ } else if ( error_type == KMFError::WARNING || error_type == KMFError::HINT ) {
+ s += "<font color=\"orange\">" + i18n("WARNING: ");
+ } else {
+ s += "<font color=\"red\">" + i18n("ERROR: ");
+ }
+ s += "</font></b> ";
+ s += msg;
+ s += "<br />";
+ return *( new QString( s ) );
+}
+
+//########### end static ##############//
+KMFError::KMFError() {
+ // kdDebug() << "Creating new KMFError Object" << endl;
+ m_err_type = -1;
+ m_err_msg = "";
+ m_err_num = -1;
+
+}
+KMFError::~KMFError() {}
+
+void KMFError::setErrMsg( const QString &msg ) {
+ m_err_msg = msg;
+}
+
+void KMFError::setErrType( int type ) {
+// kdDebug() << "KMFError::setErrType( int type ) - Setting Error Type: " << type << endl;
+ if ( type == OK ) {
+ m_err_type = OK;
+ m_err_num = 0;
+ } else if ( type == HINT ) {
+ m_err_type = HINT;
+ m_err_num = 0;
+ } else if ( type == NORMAL ) {
+ m_err_type = NORMAL;
+ m_err_num = NORMAL;
+ } else if ( type == FATAL ) {
+ m_err_type = FATAL;
+ m_err_num = FATAL;
+ }
+}
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/kmyfirewall/core/kmferror.h b/kmyfirewall/core/kmferror.h
new file mode 100644
index 0000000..04917fc
--- /dev/null
+++ b/kmyfirewall/core/kmferror.h
@@ -0,0 +1,71 @@
+/***************************************************************************
+ begin : Tue Aug 6 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFERROR_H
+#define KMFERROR_H
+
+#include <qstring.h>
+#include <kdemacros.h>
+#include <qstringlist.h>
+
+/**
+ *@author Christian Hubinger
+ */
+using namespace std;
+namespace KMF {
+class KDE_EXPORT KMFError {
+
+// using namespace ;
+
+
+public:
+/** Contains the option commands for each option type. */
+ static KMFError* parseErrors( QStringList& errors );
+ static const QString& getAsString( int error_type, const QString& msg );
+
+public:
+ KMFError();
+ ~KMFError();
+
+ enum { OK = 0, HINT = 1, NORMAL = 2, FATAL = 3, WARNING = 4 };
+
+ /** Set the error message */
+ void setErrMsg( const QString& msg );
+
+ /** Sets the message type */
+ void setErrType( int type );
+
+ /** get the Error message */
+ const QString& errMsg() const {
+ return m_err_msg;
+ };
+
+ /** Get the error number */
+ int errNum() const {
+ return m_err_num;
+ };
+
+ /** Get the error type e.g. HINT, FATAL etc.*/
+ int errType() const {
+ return m_err_type;
+ };
+
+private:
+ int m_err_type;
+ QString m_err_msg;
+ int m_err_num;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmferrorhandler.cpp b/kmyfirewall/core/kmferrorhandler.cpp
new file mode 100644
index 0000000..667f6c7
--- /dev/null
+++ b/kmyfirewall/core/kmferrorhandler.cpp
@@ -0,0 +1,73 @@
+/***************************************************************************
+ begin : Tue Aug 6 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmferrorhandler.h"
+
+// QT includes
+#include <kmessagebox.h>
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+// my includes
+#include "kmferror.h"
+
+namespace KMF {
+
+KMFErrorHandler::KMFErrorHandler( const QString& name ) {
+ m_caller_name = new QString( name );
+}
+KMFErrorHandler::~KMFErrorHandler() {}
+
+bool KMFErrorHandler::showError( KMFError* err ) {
+// kdDebug() << "KMFErrorHandler::showError(KMFError* err)" << endl;
+ QString header = "";
+ if ( err->errType() == KMFError::OK ) {
+// kdDebug() << "Found Error Type: KMFError::OK" << endl;
+ return true;
+ }
+
+ if ( err->errType() == KMFError::HINT ) {
+// kdDebug() << "Found Error Type: KMFError::HINT" << endl;
+ header += i18n( "Hint" );
+ const QString err_msg = err->errMsg();
+// kdDebug() << "Error Msg: " + err_msg << endl;
+ KMessageBox::information( 0, err_msg, header, err_msg);
+ return true;
+ }
+ if ( err->errType() == KMFError::NORMAL ) {
+// kdDebug() << "Found Error Type: KMFError::NORMAL " << endl;
+ header += *m_caller_name;
+ const QString err_msg = err->errMsg();
+// kdDebug() << "Error Msg: " + err_msg << endl;
+ KMessageBox::sorry( 0, err_msg, header );
+ return false;
+ }
+
+ if ( err->errType() == KMFError::FATAL ) {
+// kdDebug() << "Found Error Type: KMFError::FATAL" << endl;
+ header += *m_caller_name;
+ const QString err_msg = err->errMsg();
+// kdDebug() << "Error Msg: " + err_msg << endl;
+ KMessageBox::error( 0, err_msg, header );
+ return false;
+ }
+ return false;
+}
+
+}
+
+
diff --git a/kmyfirewall/core/kmferrorhandler.h b/kmyfirewall/core/kmferrorhandler.h
new file mode 100644
index 0000000..1df496f
--- /dev/null
+++ b/kmyfirewall/core/kmferrorhandler.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ begin : Tue Aug 6 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFERRORHANDLER_H
+#define KMFERRORHANDLER_H
+
+#include <kdemacros.h>
+
+/**
+ *@author Christian Hubinger
+ */
+class QString;
+namespace KMF {
+class KMFError;
+
+
+class KDE_EXPORT KMFErrorHandler {
+public:
+ KMFErrorHandler( const QString& name );
+ ~KMFErrorHandler();
+
+ /** Show a messagebox with the error message if the
+ error type != OK */
+ bool showError( KMFError* err );
+
+private:
+ QString *m_caller_name;
+};
+}
+
+#endif
diff --git a/kmyfirewall/core/kmfgenericdoc.cpp b/kmyfirewall/core/kmfgenericdoc.cpp
new file mode 100644
index 0000000..91f5e21
--- /dev/null
+++ b/kmyfirewall/core/kmfgenericdoc.cpp
@@ -0,0 +1,563 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfgenericdoc.h"
+
+
+// QT includes
+#include <qfile.h>
+#include <qdom.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kio/netaccess.h>
+#include <kio/job.h>
+#include <ktrader.h>
+#include <klibloader.h>
+
+// Project includes
+#include "../version.h"
+#include "kmfcompilerinterface.h"
+#include "kmfplugin.h"
+#include "kmfpluginfactory.h"
+#include "kmferror.h"
+#include "kmfprotocol.h"
+#include "kmfnetzone.h"
+#include "kmfnetwork.h"
+#include "kmfconfig.h"
+#include "ipaddress.h"
+#include "kmftarget.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+KMFGenericDoc::KMFGenericDoc( NetfilterObject* parent, const char* name, KMFTarget* target ) : KMFDoc( parent, name ), KMFRulesetDoc( target ) {
+ kdDebug() << "KMFGenericDoc::KMFGenericDoc( QObject *parent, const char *name ) : KMFDoc( parent, name )" << endl;
+ m_zones.setAutoDelete( false );
+ m_zone_incoming = 0;
+ m_zone_outgoing = 0;
+ m_zone_trusted= 0 ;
+ m_zone_malicious= 0 ;
+ m_zone_badClients= 0 ;
+ m_zone_badServers= 0 ;
+ m_allowIncomingConnections = false;
+ m_restrictOutgoingConnections = false;
+ m_allowPingReply = true;
+ m_limitPingReply = true;
+ m_useNat = false;
+ m_useMasquerade = false;
+ m_logDropped = true;
+ m_limitLog = true;
+ m_logPrefix = "KMF: ";
+ m_natAddress = new IPAddress(0,0,0,0);
+ m_outgoingInterface = XML::BoolOff_Value;
+ initDoc();
+}
+
+int KMFGenericDoc::type() {
+// kdDebug() << "IPTRule::type()" << endl;
+ return NetfilterObject::GENERIC_RULESET;
+}
+
+
+KMFGenericDoc::~KMFGenericDoc() {}
+
+void KMFGenericDoc::clear() {
+ kdDebug() << "void KMFGenericDoc::clear()" << endl;
+ m_zone_incoming->clear();
+ m_zone_outgoing->clear();
+ m_zone_trusted->clear();
+ m_zone_malicious->clear();
+ m_zone_badClients->clear();
+ m_zone_badServers->clear();
+ m_allowIncomingConnections = false;
+ m_restrictOutgoingConnections = false;
+ m_allowPingReply = true;
+ m_limitPingReply = true;
+ m_useNat = false;
+ m_useMasquerade = false;
+ m_logDropped = true;
+ m_limitLog = true;
+ m_logPrefix = "KMF: ";
+ m_natAddress->setAddress( 0, 0, 0, 0 );
+ m_outgoingInterface = XML::BoolOff_Value;
+ resetUrl();
+ setDescription( i18n("No description available") );
+}
+
+void KMFGenericDoc::initDoc() {
+ kdDebug() << "void KMFGenericDoc::initDoc()" << endl;
+ m_err = new KMFError;
+ m_url.setFileName( i18n( "Untitled" ) );
+
+ m_zone_incoming = new KMFNetZone( this, "incoming_world", "incoming_world" );
+ m_zone_outgoing = new KMFNetZone( this, "outgoing_world", "outgoing_world" );
+ m_zone_trusted= new KMFNetZone( this, "trusted_hosts", "trusted_hosts" );
+ m_zone_malicious= new KMFNetZone( this, "malicious_hosts", "malicious_hosts" );
+ m_zone_badClients= new KMFNetZone( this, "badClients_hosts", "badClients_hosts" );
+ m_zone_badServers= new KMFNetZone( this, "badServers_hosts", "badServers_hosts" );
+
+
+ m_zone_incoming->setGuiName( i18n( "Incoming Connections" ) );
+ m_zone_outgoing->setGuiName( i18n( "Outgoing Connections" ) );
+ m_zone_trusted->setGuiName( i18n( "Trusted Hosts" ) );
+ m_zone_malicious->setGuiName( i18n( "Malicious Hosts" ) );
+ m_zone_badClients->setGuiName( i18n( "Forbidden Clients" ) );
+ m_zone_badServers->setGuiName( i18n( "Forbidden Servers" ) );
+
+ m_zone_incoming->setZone( IPAddress( 0, 0, 0, 0 ), 0 );
+ m_zone_outgoing->setZone( IPAddress( 0, 0, 0, 0 ), 0 );
+ m_zone_trusted->setZone( IPAddress( 0, 0, 0, 0 ), 0 );
+ m_zone_malicious->setZone( IPAddress( 0, 0, 0, 0 ), 0 );
+ m_zone_badClients->setZone( IPAddress( 0, 0, 0, 0 ),0 );
+ m_zone_badServers->setZone( IPAddress( 0, 0, 0, 0 ), 0 );
+
+ m_zone_incoming->setDescription( i18n( "This is the global zone that contains\n"
+ "all valid IP addresses." ) );
+ m_zone_outgoing->setDescription( i18n( "This is the global zone that contains\n"
+ "all valid IP addresses." ) );
+ m_zone_trusted->setDescription( i18n( "Traffic coming from and going to hosts\n"
+ "will be accepted always.\n"
+ "Only add really trusted Hosts to this Zone" ) );
+ m_zone_malicious->setDescription( i18n("Traffic coming from and going to hosts\n"
+ "will be dropped always." ) );
+ m_zone_badClients->setDescription( i18n( "Hosts in this zone will not be able\n"
+ "to use services your computer provides." ) );
+ m_zone_badServers->setDescription( i18n( "You will not be able to use the services\n"
+ "of the hosts in that list." ) );
+}
+
+const QString& KMFGenericDoc::getFileDialogFilter() {
+ return *( new QString("*.kmfgrs|KMyFirewall Generic Ruleset(*.kmfgrs)") );
+}
+
+
+void KMFGenericDoc::setRestrictOutgoingConnections( bool onoff ) {
+ m_restrictOutgoingConnections = onoff;
+}
+
+void KMFGenericDoc::setAllowIncomingConnections( bool onoff ) {
+ m_allowIncomingConnections = onoff;
+}
+
+void KMFGenericDoc::setLogDropped( bool onoff ) {
+ m_logDropped = onoff;
+}
+
+void KMFGenericDoc::setLimitLog( bool onoff ) {
+ m_limitLog = onoff;
+}
+
+void KMFGenericDoc::setLogPrefix( const QString& pre ) {
+ if ( ! pre.isNull() )
+ m_logPrefix = pre;
+ else
+ m_logPrefix = "";
+}
+
+
+
+bool KMFGenericDoc::isEmpty() {
+// kdDebug() << "bool KMFGenericDoc::isEmpty()" << endl;
+ return false;
+}
+
+void KMFGenericDoc::setAllowPingReply( bool onoff ) {
+ m_allowPingReply = onoff;
+}
+void KMFGenericDoc::setLimitPingReply( bool onoff ){
+ m_limitPingReply = onoff;
+}
+
+void KMFGenericDoc::setUseNat( bool onoff ) {
+ m_useNat = onoff;
+}
+
+void KMFGenericDoc::setUseMasquerade( bool onoff ) {
+ m_useMasquerade = onoff;
+}
+
+void KMFGenericDoc::setNatAddress( const QString& addr ) {
+ m_natAddress->setAddress( addr );
+}
+
+void KMFGenericDoc::setOutgoingInterface( const QString& str ) {
+ m_outgoingInterface = str;
+}
+
+
+QPtrList<KMFNetZone>& KMFGenericDoc::zones() const {
+ QPtrList<KMFNetZone>* ret_val = new QPtrList<KMFNetZone>;
+ *ret_val = m_zones;
+ return *ret_val;
+}
+
+KMFNetZone* KMFGenericDoc::addZone( const QString& name, KMFError* err ) {
+// kdDebug() << "KMFNetZone* addZone( const QString& name, KMFError* err )" << endl;
+ bool found = false;
+ QPtrListIterator<KMFNetZone> it ( m_zones );
+ while ( it.current() && ! found ) {
+ KMFNetZone * zone = it.current();
+ ++it;
+ if ( zone->name() == name )
+ found = true;
+ }
+ if ( found ) {
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>Sorry, cannot create Zone with name '<b>%1</b>':<br>"
+ "there already exists a zone with that name. Please try again"
+ " with another name that is unique within your configuration.</qt>" ).arg(name) );
+ return 0;
+ }
+
+ KMFNetZone * new_zone = new KMFNetZone( this, name.latin1(), name );
+ m_zones.append( new_zone );
+ err->setErrType( KMFError::OK );
+ return new_zone;
+}
+
+KMFError* KMFGenericDoc::delZone( KMFNetZone* zone ) {
+// kdDebug() << "KMFError* delZone( const QString& name )" << endl;
+ bool found = false;
+ QPtrListIterator<KMFNetZone> it ( m_zones );
+ while ( it.current() && ! found ) {
+ KMFNetZone * z = it.current();
+ ++it;
+ if ( zone == z ) {
+ found = true;
+ m_zones.remove( zone );
+ m_err->setErrType( KMFError::OK );
+ changed();
+ }
+ }
+ if ( ! found ) {
+ m_err->setErrType( KMFError::NORMAL );
+ m_err->setErrMsg( i18n( "<qt>Sorry, cannot create Zone with name: <b>%1</b>.<br>"
+ "There already exists a zone with that name; please try again"
+ " with another name that is unique within your configuration.</qt>" ).arg( zone->name() ) );
+ }
+ return m_err;
+}
+
+KMFNetZone* KMFGenericDoc::findZone( const QString& name ) const {
+// kdDebug() << "KMFNetZone* KMFGenericDoc::findZone( const QString& name ) const" << endl;
+ QPtrListIterator<KMFNetZone> it ( m_zones );
+ while ( it.current() ) {
+ KMFNetZone *z = it.current();
+ ++it;
+ if ( z->name() == name )
+ return z;
+ }
+ return 0;
+}
+
+const QString& KMFGenericDoc::compile() {
+// kdDebug() << "const QString& KMFGenericDoc::compile()" << endl;
+ KMFCompilerInterface* compiler = target()->compiler();
+ if ( ! compiler ) {
+ return *( new QString("ERROR") );
+ }
+ return compiler->compile( this );
+}
+
+void KMFGenericDoc::parseDocument( const KURL& url, QStringList& errors ) {
+// kdDebug() << "KMFDoc* KMFGenericDoc::parseDocument( const KURL& )" << endl;
+ QString xmlfile;
+ if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) {
+ clear();
+ m_url.setFileName( i18n( "Untitled" ) );
+ return;
+ // return this;
+ }
+
+ if ( !xmlfile.isEmpty() ) {
+// kdDebug() << "Found xmlfile: " << xmlfile << endl;
+ // delete old chainsets if there
+ clear();
+ QFile kmfrsFile( xmlfile );
+ QDomDocument domTree;
+ if ( !kmfrsFile.open( IO_ReadOnly ) ) {
+ return;
+ // return 0;
+ }
+ if ( !domTree.setContent( &kmfrsFile ) ) {
+ kmfrsFile.close();
+ return;
+ // return 0;
+ }
+ kmfrsFile.close();
+
+ kdDebug() << "############ Start Parsing ############" << endl;
+ loadXML( domTree, errors );
+ kdDebug() << "########## Finished Parsing ###########" << endl;
+
+ m_url = url;
+ // setUrl( url );
+ emit documentChanged();
+ KIO::NetAccess::removeTempFile( xmlfile );
+ return;
+ // return this;
+ }
+ KIO::NetAccess::removeTempFile( xmlfile );
+// return this;
+}
+
+const QDomDocument& KMFGenericDoc::getDOMTree() {
+ // kdDebug() << "const QDomDocument& KMFGenericDoc::getDOMTree()" << endl;
+ QDomDocument doc( "kmyfirewall-ruleset" );
+ QDomElement root = doc.createElement( XML::GenericDoc_DocumentElement );
+ NetfilterObject::saveUuid( root );
+ root.setAttribute( XML::Version_Attribute, KMYFIREWALL_VERSION );
+ root.setAttribute( XML::MinVersion_Attribute, "1.0.0" );
+ root.setAttribute( XML::MaxVersion_Attribute, "~" );
+
+ root.appendChild( m_zone_incoming->getDOMTree() );
+ root.appendChild( m_zone_outgoing->getDOMTree() );
+ root.appendChild( m_zone_badClients->getDOMTree() );
+ root.appendChild( m_zone_badServers->getDOMTree() );
+ root.appendChild( m_zone_malicious->getDOMTree() );
+ root.appendChild( m_zone_trusted->getDOMTree() );
+ QDomElement abstract = doc.createElement( XML::Abstract_Element );
+ if ( restrictOutgoingConnections() )
+ abstract.setAttribute( XML::RestrictOutgoingConnections_Attribute ,XML::BoolOn_Value );
+ else
+ abstract.setAttribute( XML::RestrictOutgoingConnections_Attribute ,XML::BoolOff_Value );
+ if ( allowIncomingConnections() )
+ abstract.setAttribute( XML::AllowIncomingConnections_Attribute ,XML::BoolOn_Value );
+ else
+ abstract.setAttribute( XML::AllowIncomingConnections_Attribute ,XML::BoolOff_Value );
+
+ abstract.setAttribute( XML::Description_Attribute, description() );
+ abstract.setAttribute( XML::Name_Attribute, name() );
+
+ root.appendChild( abstract );
+
+ QDomElement logging = doc.createElement( XML::Logging_Element );
+ if ( logDropped() )
+ logging.setAttribute( XML::LogDropped_Attribute, XML::BoolOn_Value );
+ else
+ logging.setAttribute( XML::LogDropped_Attribute, XML::BoolOff_Value );
+
+ if ( limitLog() )
+ logging.setAttribute( XML::LimitLog_Attribute, XML::BoolOn_Value );
+ else
+ logging.setAttribute( XML::LimitLog_Attribute, XML::BoolOff_Value );
+
+ logging.setAttribute( XML::LogPrefix_Attribute, logPrefix() );
+ root.appendChild( logging );
+
+ QDomElement icmp = doc.createElement( XML::ICMP_Element );
+ if ( allowPingReply() ) {
+ icmp.setAttribute( XML::AllowPingReply_Attribute, XML::BoolOn_Value );
+ } else {
+ icmp.setAttribute( XML::AllowPingReply_Attribute, XML::BoolOff_Value );
+ }
+
+ if ( limitPingReply() )
+ icmp.setAttribute( XML::LimitPingReply_Attribute, XML::BoolOn_Value );
+ else
+ icmp.setAttribute( XML::LimitPingReply_Attribute, XML::BoolOff_Value );
+ root.appendChild( icmp );
+
+ QDomElement nat = doc.createElement( XML::NAT_Element );
+ if ( useNat() )
+ nat.setAttribute( XML::UseNat_Attribute, XML::BoolOn_Value );
+ else
+ nat.setAttribute( XML::UseNat_Attribute, XML::BoolOff_Value );
+
+ if ( useMasquerade() )
+ nat.setAttribute( XML::UseMasquerade_Attribute, XML::BoolOn_Value );
+ else
+ nat.setAttribute( XML::UseMasquerade_Attribute, XML::BoolOff_Value );
+
+
+ nat.setAttribute( XML::NatAddress_Attribute, m_natAddress->toString() );
+ QString allowedIn = "";
+
+ nat.setAttribute( XML::OutgoingInterface_Attribute, m_outgoingInterface );
+
+ root.appendChild( nat );
+
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+void KMFGenericDoc::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ kdDebug() << "void KMFGenericDoc::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ if ( root.nodeName() != XML::GenericDoc_DocumentElement ) {
+ kdDebug() << "!!! ERROR: Wrong XML format " << root.nodeName() << " found !!!" << endl;
+ errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfgrs").arg( root.nodeName() ) ) );
+ return;
+ }
+ loadXML( root, errors );
+}
+
+void KMFGenericDoc::loadXML( QDomNode root, QStringList& errors ) {
+// void KMFGenericDoc::loadXML( const QDomDocument& doc ) {
+// kdDebug() << "void KMFGenericDoc::loadXML( const QDomDocument& )" << endl;
+// QDomElement root = doc.documentElement();
+ NetfilterObject::loadUuid ( root, errors );
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ kdDebug() << "Parsing Node: " << curr.nodeName() << endl;
+ if ( curr.isElement() && curr.nodeName() == XML::NetZone_Element ) {
+ QString name = "";
+ name = curr.toElement().attribute( XML::Name_Attribute );
+ QDomDocument zone_doc;
+ zone_doc.appendChild( curr.cloneNode(true) );
+ if ( name == "incoming_world" ) {
+// kdDebug() << "\nKMFIPTDoc: Start Parsing INCOMMING ZONES" << endl;
+ m_zone_incoming->loadXML( zone_doc, errors );
+// kdDebug() << "KMFIPTDoc: Finished Parsing INCOMMING ZONES" << endl;
+ }
+ if ( name == "outgoing_world" ) {
+// kdDebug() << "\nKMFIPTDoc: Start Parsing OUTGOING ZONES" << endl;
+ m_zone_outgoing->loadXML( zone_doc, errors );
+// kdDebug() << "KMFIPTDoc: Finished Parsing OUTGOING ZONES" << endl;
+ }
+ if ( name == "trusted_hosts" ) {
+// kdDebug() << "\nKMFIPTDoc: Start Parsing TRUSTED HOSTS" << endl;
+ m_zone_trusted->loadXML( zone_doc, errors );
+// kdDebug() << "KMFIPTDoc: Finished Parsing TRUSTED HOSTS" << endl;
+ }
+ if ( name == "malicious_hosts" ) {
+// kdDebug() << "\nKMFIPTDoc: Start Parsing MALICIOUS HOSTS" << endl;
+ m_zone_malicious->loadXML( zone_doc, errors );
+// kdDebug() << "KMFIPTDoc: Finished Parsing MALICIOUS HOSTS" << endl;
+ }
+ if ( name == "badClients_hosts" ) {
+// kdDebug() << "\nKMFIPTDoc: Start Parsing BADCLIENTS HOSTS" << endl;
+ m_zone_badClients->loadXML( zone_doc, errors );
+// kdDebug() << "KMFIPTDoc: Finished Parsing BADCLIENTS HOSTS" << endl;
+ }
+ if ( name == "badServers_hosts" ) {
+// kdDebug() << "\nKMFIPTDoc: Start Parsing BADSERVERS HOSTS" << endl;
+ m_zone_badServers->loadXML( zone_doc, errors );
+// kdDebug() << "KMFIPTDoc: Finished Parsing BADSERVERS HOSTS" << endl;
+ }
+ } else if ( curr.isElement() && curr.nodeName() == XML::Logging_Element ) {
+// kdDebug() << "\nKMFIPTDoc: Start Parsing Logging" << endl;
+ QString logDropped = "";
+ QString limitLog = "";
+ QString logPrefix = "";
+
+ logDropped = curr.toElement().attribute( XML::LogDropped_Attribute );
+ limitLog = curr.toElement().attribute( XML::LimitLog_Attribute );
+ logPrefix = curr.toElement().attribute( XML::LogPrefix_Attribute );
+
+ if ( logDropped == XML::BoolOn_Value )
+ setLogDropped( true );
+ else
+ setLogDropped( false );
+
+ if ( limitLog == XML::BoolOn_Value )
+ setLimitLog( true );
+ else
+ setLimitLog( false );
+
+ setLogPrefix( logPrefix );
+// kdDebug() << "KMFIPTDoc: Finished Parsing Logging" << endl;
+ } else if ( curr.isElement() && curr.nodeName() == XML::ICMP_Element ) {
+// kdDebug() << "\nKMFIPTDoc: Start Parsing ICMP" << endl;
+ QString allowPing = "";
+ QString limitPing = "";
+ allowPing = curr.toElement().attribute( XML::AllowPingReply_Attribute );
+ limitPing = curr.toElement().attribute( XML::LimitPingReply_Attribute );
+
+ if ( allowPing == XML::BoolOn_Value)
+ setAllowPingReply( true );
+ else
+ setAllowPingReply( false );
+
+ if ( limitPing == XML::BoolOn_Value )
+ setLimitPingReply( true );
+ else
+ setLimitPingReply( false );
+
+// kdDebug() << "KMFIPTDoc: Finished Parsing ICMP" << endl;
+ } else if ( curr.isElement() && curr.nodeName() == XML::NAT_Element ) {
+// kdDebug() << "\nKMFIPTDoc: Start Parsing NAT" << endl;
+ QString useNat = "";
+ QString useMasquerade = "";
+ QString natAddress = "";
+ QString outgoingInterface = "";
+ useNat = curr.toElement().attribute( XML::UseNat_Attribute );
+ useMasquerade = curr.toElement().attribute( XML::UseMasquerade_Attribute );
+ natAddress = curr.toElement().attribute( XML::NatAddress_Attribute );
+ outgoingInterface = curr.toElement().attribute( XML::OutgoingInterface_Attribute );
+
+
+
+ if ( useNat == XML::BoolOn_Value)
+ setUseNat( true );
+ else
+ setUseNat( false );
+
+ if ( useMasquerade == XML::BoolOn_Value)
+ setUseMasquerade( true );
+ else
+ setUseMasquerade( false );
+
+ m_outgoingInterface = outgoingInterface;
+ m_natAddress->setAddress( natAddress );
+// kdDebug() << "Stored NAT address: " << m_natAddress->toString() << endl;
+// kdDebug() << "KMFIPTDoc: Finished Parsing NAT" << endl;
+ }else if ( curr.isElement() && curr.nodeName() == XML::Abstract_Element ) {
+ kdDebug() << "KMFIPTDoc: Start Parsing Abstract" << endl;
+ QString allowIncomingConnections = "";
+ QString restrictOutgoingConnections = "";
+ QString description = "";
+ QString name = "";
+ allowIncomingConnections =curr.toElement().attribute( XML::AllowIncomingConnections_Attribute );
+ restrictOutgoingConnections =curr.toElement().attribute( XML::RestrictOutgoingConnections_Attribute );
+
+ description += curr.toElement().attribute( XML::Description_Attribute );
+ if ( ! description.isNull() )
+ setDescription( *( new QString( description ) ) );
+
+ name += curr.toElement().attribute( XML::Name_Attribute );
+ if ( ! name.isNull() )
+ setName( *( new QString( name ) ) );
+
+
+ if ( allowIncomingConnections == XML::BoolOn_Value )
+ setAllowIncomingConnections( true );
+ else
+ setAllowIncomingConnections( false );
+
+ if ( restrictOutgoingConnections == XML::BoolOn_Value )
+ setRestrictOutgoingConnections( true );
+ else
+ setRestrictOutgoingConnections( false );
+ kdDebug() << "KMFIPTDoc: Finished Parsing Abstract" << endl;
+ }
+ curr = curr.nextSibling();
+ }
+}
+
+}
+
diff --git a/kmyfirewall/core/kmfgenericdoc.h b/kmyfirewall/core/kmfgenericdoc.h
new file mode 100644
index 0000000..62ea2a2
--- /dev/null
+++ b/kmyfirewall/core/kmfgenericdoc.h
@@ -0,0 +1,189 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFGENERICDOC_H
+#define KMFGENERICDOC_H
+
+#include "kmfdoc.h"
+#include "kmfrulesetdoc.h"
+
+// QT includes
+#include <qdom.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+
+
+// KDE includes
+#include <kurl.h>
+
+// Project includes
+#include "ipaddress.h"
+#include "kmfprotocol.h"
+
+namespace KMF {
+class KMFError;
+class KMFNetZone;
+class KMFTarget;
+class IPAddress;
+class KMFCompilerInterface;
+/**
+@author Christian Hubinger
+*/
+
+class KDE_EXPORT KMFGenericDoc : public KMFDoc, public KMFRulesetDoc {
+public:
+ KMFGenericDoc( NetfilterObject*, const char*, KMFTarget* );
+// KMFGenericDoc( NetfiletObject*, const char* );
+
+ ~KMFGenericDoc();
+ /** resets the document to the initial values
+ */
+ void clear();
+
+ bool isEmpty();
+
+ /** return a QString containing the documents script to
+ setup the firewall configuration */
+ const QString& compile();
+
+ /** Return DomDocument of this Chain */
+ const QDomDocument& getDOMTree();
+
+ virtual void loadXML( const QDomDocument&, QStringList& errors );
+ virtual void loadXML( QDomNode, QStringList& errors );
+ virtual int type();
+ virtual void parseDocument( const KURL&, QStringList& errors );
+
+ /** Get the File dialog filter string for the document type */
+ virtual const QString& getFileDialogFilter();
+
+ KMFNetZone *incomingZone() const {
+ return m_zone_incoming;
+ };
+
+ KMFNetZone *outgoingZone() const {
+ return m_zone_outgoing;
+ };
+
+ KMFNetZone *trustedHostsZone() const {
+ return m_zone_trusted;
+ };
+
+ KMFNetZone *maliciousHostsZone() const {
+ return m_zone_malicious;
+ };
+
+ KMFNetZone *badServersHostsZone() const {
+ return m_zone_badServers;
+ };
+
+ KMFNetZone *badClientsHostsZone() const {
+ return m_zone_badClients;
+ };
+ QPtrList<KMFNetZone>& zones() const;
+
+ bool restrictOutgoingConnections() const {
+ return m_restrictOutgoingConnections;
+ };
+ void setRestrictOutgoingConnections( bool ) ;
+
+ bool allowIncomingConnections()const {
+ return m_allowIncomingConnections;
+ };
+ void setAllowIncomingConnections( bool );
+
+ bool allowPingReply() const {
+ return m_allowPingReply;
+ };
+ void setAllowPingReply( bool );
+
+ bool limitPingReply() const {
+ return m_limitPingReply;
+ };
+ void setLimitPingReply( bool );
+
+ bool useNat() const {
+ return m_useNat;
+ };
+
+ void setUseNat( bool );
+
+ bool useMasquerade() const {
+ return m_useMasquerade;
+ };
+ void setUseMasquerade( bool );
+
+ IPAddress* natAddress() const {
+ return m_natAddress;
+ };
+
+ void setNatAddress( const QString& );
+
+ const QString& outgoingInterface() const {
+ return m_outgoingInterface;
+ };
+ void setOutgoingInterface( const QString& );
+
+ bool logDropped() const {
+ return m_logDropped;
+ };
+ void setLogDropped( bool );
+
+ bool limitLog() const {
+ return m_limitLog;
+ };
+ void setLimitLog( bool );
+
+ const QString& logPrefix() const {
+ return m_logPrefix;
+ };
+ void setLogPrefix( const QString& );
+
+protected:
+ void initDoc();
+ KMFNetZone* addZone( const QString& name, KMFError* err );
+ KMFError* delZone( KMFNetZone* zone );
+ KMFNetZone* findZone( const QString& name ) const;
+
+private:
+ // bool loadProtocolLibrary();
+
+private: // DATA
+ // QPtrList<KMFProtocol> m_protocol_library;
+ QPtrList<KMFNetZone> m_zones;
+
+ KMFNetZone* m_zone_incoming;
+ KMFNetZone* m_zone_outgoing;
+ KMFNetZone* m_zone_trusted;
+ KMFNetZone* m_zone_malicious;
+ KMFNetZone* m_zone_badClients;
+ KMFNetZone* m_zone_badServers;
+ bool m_allowPingReply, m_limitPingReply, m_allowIncomingConnections, m_restrictOutgoingConnections;
+
+ bool m_useNat, m_useMasquerade, m_logDropped, m_limitLog;
+ IPAddress *m_natAddress;
+ QString m_outgoingInterface, m_logPrefix;
+
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfinstallerinterface.cpp b/kmyfirewall/core/kmfinstallerinterface.cpp
new file mode 100644
index 0000000..3b33073
--- /dev/null
+++ b/kmyfirewall/core/kmfinstallerinterface.cpp
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001
+*/
+
+#include "kmfinstallerinterface.h"
+
+#include <kdebug.h>
+
+// QT Inludes
+#include <qvaluelist.h>
+
+// Project Includes
+#include "kmfpluginfactory.h"
+
+namespace KMF {
+
+KMFInstallerInterface::KMFInstallerInterface() {
+ kdDebug() << "KMFInstallerInterface::KMFInstallerInterface()" << endl;
+}
+KMFInstallerInterface::~KMFInstallerInterface() {
+ kdDebug() << "KMFInstallerInterface::~KMFInstallerInterface()" << endl;
+}
+
+
+
+}
+
diff --git a/kmyfirewall/core/kmfinstallerinterface.h b/kmyfirewall/core/kmfinstallerinterface.h
new file mode 100644
index 0000000..c5e5438
--- /dev/null
+++ b/kmyfirewall/core/kmfinstallerinterface.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001
+*/
+
+#ifndef __KMFINSTALLER_INTERFACE_H
+#define __KMFINSTALLER_INTERFACE_H
+
+#include <kdemacros.h>
+
+#include <qvaluelist.h>
+
+class QString;
+class QStringList;
+class KURL;
+
+namespace KMF {
+class KMFDoc;
+class KMFIPTDoc;
+class KMFTarget;
+class KMFCompilerInterface;
+
+
+class KDE_EXPORT KMFInstallerInterface {
+ public:
+ KMFInstallerInterface();
+ virtual ~KMFInstallerInterface();
+ virtual KMFCompilerInterface* compiler() = 0;
+ virtual void cmdRunFW() = 0;
+ virtual void cmdStopFW() = 0;
+ virtual void cmdShowRunningConfig( const QString& ) = 0;
+ virtual void cmdInstallFW() = 0;
+ virtual void cmdUninstallFW() = 0;
+ virtual void generateInstallerPackage( KMFTarget *, const KURL& ) = 0;
+ virtual const QString& osName() const = 0;
+ virtual const QString& osGUIName() const = 0;
+ virtual QValueList<KMFCompilerInterface*>* compilers() = 0;
+
+ };
+}
+
+#endif // __KMFINSTALLER_INTERFACE_Hs
diff --git a/kmyfirewall/core/kmfiptdoc.cpp b/kmyfirewall/core/kmfiptdoc.cpp
new file mode 100644
index 0000000..560eaad
--- /dev/null
+++ b/kmyfirewall/core/kmfiptdoc.cpp
@@ -0,0 +1,487 @@
+//
+// C++ Implementation: kmfiptdoc
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfiptdoc.h"
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// StdLib includes
+#include <iostream>
+#include <unistd.h>
+#include <sys/stat.h>
+
+// QT includes
+#include <qtextstream.h>
+#include <qfile.h>
+#include <qxml.h>
+#include <qregexp.h>
+#include <qptrlist.h>
+#include <qmessagebox.h>
+#include <qstringlist.h>
+#include <qvbox.h>
+#include <qlabel.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+#include <kurl.h>
+#include <qfiledialog.h>
+#include <kio/job.h>
+#include <kio/netaccess.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kmessagebox.h>
+#include <ktempfile.h>
+#include <ktrader.h>
+#include <klibloader.h>
+
+
+// My includes
+#include "../version.h"
+#include "kmfcompilerinterface.h"
+#include "kmfplugin.h"
+#include "kmfdoc.h"
+#include "iptchain.h"
+#include "iptrule.h"
+#include "iptable.h"
+#include "netfilterobject.h"
+#include "kmferror.h"
+#include "kmferrorhandler.h"
+#include "kmfpluginfactory.h"
+#include "kmfconfig.h"
+#include "kmftarget.h"
+#include "kmfnetwork.h"
+#include "kmfundoengine.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+KMFIPTDoc::KMFIPTDoc( NetfilterObject *parent, const char *name, KMFTarget* target ) : KMFDoc( parent, name ), KMFRulesetDoc( target ) {
+ initDoc();
+}
+
+
+KMFIPTDoc::~KMFIPTDoc() {
+ kdDebug() << "Callong KMFIPTDoc::~KMFIPTDoc()" << endl;
+ m_ipt_filter->deleteLater();
+ m_ipt_nat->deleteLater();;
+ m_ipt_mangle->deleteLater();;
+
+ // error handler
+ delete m_err;
+ m_err = 0;
+}
+
+int KMFIPTDoc::type() {
+// kdDebug() << "IPTRule::type()" << endl;
+ return NetfilterObject::IPTABLES_RULESET;
+}
+
+
+void KMFIPTDoc::initDoc() {
+ // kdDebug() << "\n\nvoid KMFIPTDoc::initKMFIPTDoc()" << endl;
+ // registerRuleOptions();
+
+ m_err_handler = new KMFErrorHandler( "KMFIPTDoc" );
+ m_err = new KMFError();
+ m_url.setFileName( i18n( "Untitled" ) );
+ m_use_filter = true;
+ m_use_nat = true;
+ m_use_mangle = true;
+ m_use_ipfwd = true;
+ m_use_rp_filter = false;
+ m_use_martians = false;
+ m_use_syn_cookies = true;
+ m_use_modules = true;
+// is_saved = false;
+
+ m_ipt_filter = new IPTable( this, Constants::FilterTable_Name.latin1(),
+ Constants::FilterTable_Name.latin1() );
+ m_ipt_filter->settupDefaultChains();
+ m_ipt_nat = new IPTable( this, Constants::NatTable_Name.latin1(), Constants::NatTable_Name );
+ m_ipt_nat->settupDefaultChains();
+ m_ipt_mangle = new IPTable( this, Constants::MangleTable_Name.latin1(), Constants::MangleTable_Name );
+
+ m_ipt_mangle->settupDefaultChains();
+}
+
+void KMFIPTDoc::clear() {
+ m_url.setFileName( i18n( "Untitled" ) );
+ m_use_filter = true;
+ m_use_nat = true;
+ m_use_mangle = true;
+ m_use_ipfwd = true;
+ m_use_rp_filter = false;
+ m_use_martians = false;
+ m_use_syn_cookies = true;
+ m_use_modules = true;
+ // m_changed_objects.clear();
+ // is_saved = false;
+
+ m_ipt_filter->reset();
+ m_ipt_nat->reset();
+ m_ipt_mangle->reset();
+
+ setName( i18n("Unamed Ruleset") );
+ setDescription( i18n("No description available") );
+ resetUrl();
+}
+
+const QString& KMFIPTDoc::getFileDialogFilter() {
+ return *( new QString("*.kmfrs|KMyFirewall IPTables Ruleset(*.kmfrs)") );
+}
+
+void KMFIPTDoc::setUseFilter( bool on ) {
+ if ( m_use_filter != on ) {
+ m_use_filter = on;
+ changed();
+ }
+}
+
+void KMFIPTDoc::setUseNat( bool on ) {
+ if ( m_use_nat != on ) {
+ m_use_nat = on;
+ changed();
+ }
+}
+
+void KMFIPTDoc::setUseMangle( bool on ) {
+ if ( m_use_mangle != on ) {
+ m_use_mangle = on;
+ changed();
+ }
+}
+
+void KMFIPTDoc::setUseIPFwd( bool on ) {
+ if ( m_use_ipfwd != on ) {
+ m_use_ipfwd = on;
+ changed();
+ }
+}
+
+void KMFIPTDoc::setUseRPFilter( bool on ) {
+ if ( m_use_rp_filter != on ) {
+ m_use_rp_filter = on;
+ changed();
+ }
+}
+void KMFIPTDoc::setUseMartians( bool on ) {
+ if ( m_use_martians != on ) {
+ m_use_martians = on;
+ changed();
+ }
+}
+void KMFIPTDoc::setUseSynCookies( bool on ) {
+ if ( m_use_syn_cookies != on ) {
+ m_use_syn_cookies = on;
+ changed();
+ }
+}
+void KMFIPTDoc::setUseModules( bool on ) {
+ if ( m_use_modules != on ) {
+ m_use_modules = on;
+ changed();
+ }
+}
+
+bool KMFIPTDoc::isEmpty() {
+ if ( m_ipt_filter->chains().isEmpty() && m_ipt_nat->chains().isEmpty() && m_ipt_mangle->chains().isEmpty() ) {
+ return true;
+ } else {
+ return false;
+ }
+ return false;
+}
+
+const QDomDocument& KMFIPTDoc::getDOMTree() {
+ // kdDebug() << "const QDomDocument& KMFIPTDoc::getDOMTree()" << endl;
+ QDomDocument doc( "kmyfirewall-ruleset" );
+ QDomElement root = doc.createElement( XML::IPTDoc_DocumentElement );
+ NetfilterObject::saveUuid( root );
+ root.setAttribute( XML::Version_Attribute, KMYFIREWALL_VERSION );
+ root.setAttribute( XML::MinVersion_Attribute, "1.0.0" );
+ root.setAttribute( XML::MaxVersion_Attribute, "~" );
+
+ QDomElement abstract = doc.createElement( XML::Abstract_Element );
+ root.appendChild( abstract );
+ if ( useFilter() ) {
+ abstract.setAttribute( XML::UseFilter_Attribute, XML::Yes_Value );
+ } else {
+ abstract.setAttribute( XML::UseFilter_Attribute, XML::No_Value );
+ }
+ if ( useNat() ) {
+ abstract.setAttribute( XML::Use_Nat_Attribute, XML::Yes_Value );
+ } else {
+ abstract.setAttribute( XML::Use_Nat_Attribute, XML::No_Value );
+ }
+ if ( useMangle() ) {
+ abstract.setAttribute( XML::UseMangle_Attribute, XML::Yes_Value );
+ } else {
+ abstract.setAttribute( XML::UseMangle_Attribute, XML::No_Value );
+ }
+ if ( useModules() ) {
+ abstract.setAttribute( XML::UseModules_Attribute, XML::Yes_Value );
+ } else {
+ abstract.setAttribute( XML::UseModules_Attribute, XML::No_Value );
+ }
+ if ( useRPFilter() ) {
+ abstract.setAttribute( XML::UseRpFilter_Attribute, XML::Yes_Value );
+ } else {
+ abstract.setAttribute( XML::UseRpFilter_Attribute, XML::No_Value );
+ }
+ if ( useIPFwd() ) {
+ abstract.setAttribute( XML::UseIPFwd_Attribute, XML::Yes_Value );
+ } else {
+ abstract.setAttribute( XML::UseIPFwd_Attribute, XML::No_Value );
+ }
+ if ( useSynCookies() ) {
+ abstract.setAttribute( XML::UseSynCookies_Attribute, XML::Yes_Value );
+ } else {
+ abstract.setAttribute( XML::UseSynCookies_Attribute, XML::No_Value );
+ }
+ if ( useMartians() ) {
+ abstract.setAttribute( XML::UseMartians_Attribute, XML::Yes_Value );
+ } else {
+ abstract.setAttribute( XML::UseMartians_Attribute, XML::No_Value );
+ }
+ abstract.setAttribute( XML::Description_Attribute, description() );
+ abstract.setAttribute( XML::Name_Attribute, name() );
+
+ root.appendChild( m_ipt_filter->getDOMTree( ) );
+ root.appendChild( m_ipt_nat->getDOMTree( ) );
+ root.appendChild( m_ipt_mangle->getDOMTree( ) );
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+void KMFIPTDoc::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ kdDebug() << "void KMFIPTDoc::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ if ( root.nodeName() != XML::IPTDoc_DocumentElement ) {
+ kdDebug() << "!!! ERROR: Wrong XML format " << root.nodeName() << " found !!!" << endl;
+ errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfrs").arg( root.nodeName() ) ) );
+ return;
+ }
+ loadXML( root, errors );
+}
+void KMFIPTDoc::loadXML( QDomNode root, QStringList& errors ) {
+ kdDebug() << "void KMFIPTDoc::loadXML( QDomNode root, QStringList& errors )" << endl;
+ if ( root.nodeName() != XML::IPTDoc_DocumentElement ) {
+ kdDebug() << "!!! ERROR: Wrong XML format " << root.nodeName() << " found !!!" << endl;
+ errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfrs").arg( root.nodeName() ) ) );
+ return;
+ }
+ NetfilterObject::loadUuid( root, errors );
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ kdDebug() << "Parsing Node: " << curr.nodeName() << endl;
+ if ( curr.isElement() && curr.nodeName() == XML::Table_Element ) {
+ QString name = curr.toElement().attribute( XML::Name_Attribute );
+ kdDebug() << "KMFIPTDoc: Start Parsing Table: " << name << endl;
+ QDomDocument table;
+ table.appendChild( curr.cloneNode( true ) );
+ if ( name == Constants::FilterTable_Name ) {
+ m_ipt_filter->loadXML( table, errors );
+ } else if ( name == Constants::NatTable_Name ) {
+ m_ipt_nat->loadXML( table, errors );
+ } else if ( name == Constants::MangleTable_Name ) {
+ m_ipt_mangle->loadXML( table, errors );
+ }
+ kdDebug() << "KMFIPTDoc: Finished Parsing Table: " << name << endl;
+ } else if ( curr.isElement() && curr.nodeName() == XML::Abstract_Element ) {
+ kdDebug() << "KMFIPTDoc: Start Parsing Abstract" << endl;
+ QString filter;
+ QString nat;
+ QString mangle;
+ QString martians;
+ QString ipfwd;
+ QString syncookies;
+ QString rpfilter;
+ QString modules;
+ QString description = "";
+ QString name = "";
+ filter = curr.toElement().attribute( XML::UseFilter_Attribute );
+ nat = curr.toElement().attribute( XML::Use_Nat_Attribute );
+ mangle = curr.toElement().attribute( XML::UseMangle_Attribute );
+ martians = curr.toElement().attribute( XML::UseMartians_Attribute );
+ ipfwd = curr.toElement().attribute( XML::UseIPFwd_Attribute );
+ syncookies = curr.toElement().attribute( XML::UseSynCookies_Attribute );
+ rpfilter = curr.toElement().attribute( XML::UseRpFilter_Attribute );
+ modules = curr.toElement().attribute( XML::UseModules_Attribute );
+
+ description += curr.toElement().attribute( XML::Description_Attribute );
+ if ( ! description.isNull() )
+ setDescription( *( new QString( description ) ) );
+
+ name = curr.toElement().attribute( XML::Name_Attribute );
+ if ( ! name.isNull() )
+ setName( *( new QString( name ) ) );
+
+ if ( filter == XML::Yes_Value )
+ m_use_filter = true;
+ else
+ m_use_filter = false;
+
+ if ( nat == XML::Yes_Value )
+ m_use_nat = true;
+ else
+ m_use_nat = false;
+
+ if ( mangle == XML::Yes_Value )
+ m_use_mangle = true;
+ else
+ m_use_mangle = false;
+
+ if ( martians == XML::Yes_Value )
+ m_use_martians = true;
+ else
+ m_use_martians = false;
+
+ if ( ipfwd == XML::Yes_Value )
+ m_use_ipfwd = true;
+ else
+ m_use_ipfwd = false;
+
+ if ( syncookies == XML::Yes_Value )
+ m_use_syn_cookies = true;
+ else
+ m_use_syn_cookies = false;
+
+ if ( rpfilter == XML::Yes_Value )
+ m_use_rp_filter = true;
+ else
+ m_use_rp_filter = false;
+
+ if ( modules == XML::Yes_Value )
+ m_use_modules = true;
+ else
+ m_use_modules = false;
+
+
+ kdDebug() << "KMFIPTDoc: Finished Parsing Abstract" << endl;
+ }
+ curr = curr.nextSibling();
+ }
+ changed();
+}
+
+IPTable* KMFIPTDoc::table( const QString& table ) {
+ if ( table == Constants::FilterTable_Name )
+ return m_ipt_filter;
+ if ( table == Constants::NatTable_Name )
+ return m_ipt_nat;
+ if ( table == Constants::MangleTable_Name )
+ return m_ipt_mangle;
+ return 0;
+}
+
+const QString& KMFIPTDoc::compile() {
+ KMFCompilerInterface* compiler = target()->compiler();
+ if ( ! compiler ) {
+ return *( new QString("ERROR") );
+ }
+ return compiler->compile( this );
+}
+
+void KMFIPTDoc::parseDocument( const KURL& url, QStringList& errors ) {
+ // kdDebug() << "KMFIPTDoc::parseDocument()" << endl;
+ QString xmlfile;
+ if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) {
+ clear();
+ m_url.setFileName( i18n( "Untitled" ) );
+ return;
+ // return this;
+ }
+
+ if ( !xmlfile.isEmpty() ) {
+ // kdDebug() << "Found xmlfile: " << xmlfile << endl;
+ // delete old chainsets if there
+ if ( !m_ipt_filter->chains().isEmpty() )
+ m_ipt_filter->reset();
+ if ( !m_ipt_nat->chains().isEmpty() )
+ m_ipt_nat->reset();
+ if ( !m_ipt_mangle->chains().isEmpty() )
+ m_ipt_mangle->reset();
+ clear();
+ QFile kmfrsFile( xmlfile );
+ QDomDocument domTree;
+ if ( !kmfrsFile.open( IO_ReadOnly ) ) {
+ return;
+ // return 0;
+ }
+ if ( !domTree.setContent( &kmfrsFile ) ) {
+ kmfrsFile.close();
+ return;
+ // return 0;
+ }
+ kmfrsFile.close();
+
+ kdDebug() << "############ Start Parsing ############" << endl;
+
+ loadXML( domTree, errors );
+
+ kdDebug() << "########## Finished Parsing ###########" << endl;
+
+ // setUrl( url );
+ m_url = url;
+ emit documentChanged();
+ KIO::NetAccess::removeTempFile( xmlfile );
+ return;
+ // return this;
+ }
+ KIO::NetAccess::removeTempFile( xmlfile );
+ // return this;
+}
+
+void KMFIPTDoc::registerRuleOptions() {
+ kdDebug() << "KMFIPTDoc::registerRuleOptions()" << endl;
+
+ KStandardDirs std_dir;
+ QStringList files = std_dir.findAllResources(
+ "data", "kmyfirewall/ruleoptions/kmfruleoption*.xml", false, true );
+
+ for ( QStringList::Iterator it = files.begin(); it != files.end(); ++it ) {
+ kdDebug() << "Found Option XML File: " << *it << endl;
+ QString xmlfile = *it;
+ QFile document( xmlfile );
+ QDomDocument domTree;
+ if ( !document.open( IO_ReadOnly ) ) {
+ kdDebug() << "ERROR: Can't read XML ruole option definition" << endl;
+ return;
+ }
+ if ( !domTree.setContent( &document ) ) {
+ kdDebug() << "ERROR: XML corrupted in file: " << xmlfile << endl;
+ document.close();
+ return;
+ }
+ document.close();
+
+ kdDebug() << "############ Start Parsing ############" << endl;
+ IPTRuleOption::readRuleOptionDefinition( domTree );
+ kdDebug() << "########## Finished Parsing ###########" << endl;
+ }
+}
+
+}
diff --git a/kmyfirewall/core/kmfiptdoc.h b/kmyfirewall/core/kmfiptdoc.h
new file mode 100644
index 0000000..37f530f
--- /dev/null
+++ b/kmyfirewall/core/kmfiptdoc.h
@@ -0,0 +1,201 @@
+//
+// C++ Interface: kmfiptdoc
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFIPTDOC_H
+#define KMFIPTDOC_H
+
+#include "kmfdoc.h"
+#include "kmfrulesetdoc.h"
+
+// qt includes
+#include <qdict.h>
+#include <qvaluelist.h>
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qobject.h>
+
+// kde includes
+#include <kurl.h>
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+
+//project includes
+#include "iptchain.h"
+#include "iptrule.h"
+#include "iptruleoption.h"
+#include "iptable.h"
+#include "netfilterobject.h"
+
+/**
+ *@author Christian Hubinger
+ */
+class KURL;
+namespace KMF {
+class KMFCompilerInterface;
+class KMFErrorHandler;
+class KMFError;
+
+class KMFTarget;
+/**
+@author Christian Hubinger
+*/
+
+class KDE_EXPORT KMFIPTDoc : public KMFDoc, public KMFRulesetDoc {
+public:
+ /** Creates an empty document */
+ KMFIPTDoc( NetfilterObject*, const char*, KMFTarget* );
+// KMFIPTDoc( NetfiletObject*, const char* );
+ ~KMFIPTDoc();
+
+ /** Compiles the document to an iptables script */
+ const QString& compile();
+
+// /** Writes the shellscrip that contains the iptables commands to settup
+// the firewall to file.
+// If file = QString::null a SaveAs dialog will popup. */
+ // KMFError* createFirewallScript( const QString& file = QString::null );
+
+ /** loads the ruleset defined by the KURL object */
+ virtual void parseDocument( const KURL&, QStringList& errors );
+
+ /** Get the File dialog filter string for the document type */
+ virtual const QString& getFileDialogFilter();
+
+ /** loads the ruleset defined by the QDomDocument object */
+ virtual void loadXML( const QDomDocument&, QStringList& errors );
+
+ /** loads the ruleset defined by the QDomNode object */
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+/* virtual void setDescription( const QString& ); */
+// virtual void setName( const QString& );
+
+ virtual int type();
+
+ /** Returns true if the document is in it's initial state.
+ e.g. no rules, no user chains etc. */
+ bool isEmpty();
+
+ /** resets the document to the initial values */
+ void clear();
+
+
+ // document get/set options
+ /** Set if we use the filter chain */
+ void setUseFilter( bool on );
+
+ /** Get if we use the filter chain */
+ bool useFilter() const {
+ return m_use_filter;
+ };
+
+ /** Set if we use the nat chain */
+ void setUseNat( bool on );
+
+ /** Get if we use the nat chain */
+ bool useNat() const {
+ return m_use_nat;
+ };
+
+ /** Set if we use the mangle chain */
+ void setUseMangle( bool on );
+
+ /** Get if we use the mangle chain */
+ bool useMangle() const {
+ return m_use_mangle;
+ };
+
+ /** Set if ip forwarding e.g. routing should be enabled */
+ void setUseIPFwd( bool on );
+
+ /** Get if ip forwarding e.g. routing should be enabled */
+ bool useIPFwd() const {
+ return m_use_ipfwd;
+ };
+
+ /** Set if the rp_filter should be activated */
+ void setUseRPFilter( bool on );
+
+ /** Get if the rp_filter should be activated */
+ bool useRPFilter() const {
+ return m_use_rp_filter;
+ };
+
+ /** Set if log_martians should be enabled */
+ void setUseMartians( bool on );
+
+ /** Get if log_martians should be enabled */
+ bool useMartians() const {
+ return m_use_martians;
+ };
+
+ /** Set if syn cookies should be enabled */
+ void setUseSynCookies( bool on );
+
+ /** Get if syn cookies should be enabled */
+ bool useSynCookies() const {
+ return m_use_syn_cookies;
+ };
+
+ /** Set if kernel modules need to be loaded */
+ void setUseModules( bool on );
+
+ /** Get if we use the filter chain */
+ bool useModules() const {
+ return m_use_modules;
+ };
+
+ /** Returns the IPTable with the given name if it exists */
+ IPTable* table( const QString& table );
+
+ /** Return DomDocument of this Chain */
+ const QDomDocument& getDOMTree();
+
+
+ /** Read the rule option definitions from the XML files in
+ (data)/kmyfirewall/ruleoptions/kmfruleoption*.xml */
+ void registerRuleOptions();
+
+protected: // data
+ /** Initializes the document with all builtin chains and tables
+ unused builtin chains and tables will be skipped when
+ compiling the ruleset. */
+ void initDoc();
+
+
+private:
+ IPTable* m_ipt_filter;
+ IPTable* m_ipt_nat;
+ IPTable* m_ipt_mangle;
+
+ // document options
+ bool m_use_filter;
+ bool m_use_nat;
+ bool m_use_mangle;
+ bool m_use_ipfwd;
+ bool m_use_rp_filter;
+ bool m_use_martians;
+ bool m_use_syn_cookies;
+ bool m_use_modules;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfnethost.cpp b/kmyfirewall/core/kmfnethost.cpp
new file mode 100644
index 0000000..4677b26
--- /dev/null
+++ b/kmyfirewall/core/kmfnethost.cpp
@@ -0,0 +1,394 @@
+//
+// C++ Implementation: kmfnethost
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfnethost.h"
+#include "kmftarget.h"
+
+// QT includes
+#include <qdom.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "kmfundoengine.h"
+#include "kmfcheckinput.h"
+#include "kmfprotocol.h"
+#include "kmfprotocollibrary.h"
+#include "kmfprotocolusage.h"
+#include "kmfnetzone.h"
+#include "kmfgenericdoc.h"
+#include "kmferror.h"
+#include "ipaddress.h"
+#include "xmlnames.h"
+
+#include <stdlib.h>
+
+namespace KMF {
+
+KMFNetHost::KMFNetHost( NetfilterObject *parent, const char* name, const QString& hostName, KMFNetwork* net ) : KMFTarget( parent, name, hostName, net ) {
+ m_logIncoming = false;
+ m_logOutgoing = false;
+ m_guiName = i18n("New Host");
+ m_address = new IPAddress( 0,0,0,0 );
+ m_limitScale = "minute";
+ m_limitNum = -1;
+ m_protocols.setAutoDelete( false );
+ setName( hostName );
+// m_object_type = NETHOST;
+ if ( KMFNetZone* zone = dynamic_cast<KMFNetZone*> ( parent ) ) {
+ m_zone = zone;
+ m_address->setAddress( m_zone->address()->toString() );
+ } else {
+ kdDebug() << "ERROR: KMFNetHost called with wrong Parent class." << endl;
+ }
+}
+//
+KMFNetHost::~KMFNetHost() {
+ kdDebug() << "KMFNetHost::~KMFNetHost()" << endl;
+ clear();
+}
+
+int KMFNetHost::type() {
+ kdDebug() << "KMFNetHost::type()" << endl;
+ return NetfilterObject::NETHOST;
+}
+void KMFNetHost::clear() {
+ m_protocols.setAutoDelete( true );
+ m_protocols.clear();
+ m_protocols.setAutoDelete( false );
+}
+
+void KMFNetHost::setLogIncoming( bool onoff ) {
+ if ( onoff == m_logIncoming ) {
+ return;
+ }
+ m_logIncoming = onoff;
+ changed();
+}
+
+void KMFNetHost::setLogOutgoing( bool onoff ) {
+ if ( onoff == m_logOutgoing ) {
+ return;
+ }
+ m_logOutgoing = onoff;
+ changed();
+}
+
+void KMFNetHost::setLimit( int num, const QString& scale ) {
+ if ( num < 1 ) {
+ m_limitNum = -1;
+ m_limitScale = "minute";
+ return;
+ }
+ m_limitNum = num;
+ m_limitScale = scale;
+ changed();
+}
+
+bool KMFNetHost::limit() const {
+ if ( m_limitNum > 0 )
+ return true;
+
+ return false;
+}
+
+int KMFNetHost::limitRate() const {
+ return m_limitNum;
+}
+
+const QString& KMFNetHost::limitScale() const {
+ return m_limitScale;
+}
+
+QPtrList<KMFProtocolUsage>& KMFNetHost::protocols() const {
+ QPtrList<KMFProtocolUsage>* ret_val = new QPtrList<KMFProtocolUsage>;
+ *ret_val = m_protocols;
+ return *ret_val;
+}
+
+KMFProtocolUsage* KMFNetHost::findProtocolUsageByProtocolUuid( const QUuid& uuid ) const {
+ kdDebug() << "KMFProtocol* KMFNetHost::findProtocolUsageByProtocolUuid( const QUuid& " << uuid.toString() << " ) const" << endl;
+ if ( (new QUuid(uuid))->isNull() ) {
+ exit(1);
+ }
+
+ QPtrListIterator<KMFProtocolUsage> it(m_protocols);
+ while ( it.current() ) {
+ KMFProtocolUsage *p = it.current();
+ ++it;
+ if ( p->protocol()->uuid() == uuid ) {
+// kdDebug() << "Found Protocol: " << name << endl;
+ return p;
+ }
+ }
+ return 0;
+}
+
+KMFProtocolUsage* KMFNetHost::addProtocolUsage( const QUuid& protocolUuid, const QDomDocument& xml ) {
+ // kdDebug() << "KMFNetHost* KMFNetZone::addProtocolUsage( const QUuid& " << protocolUuid.toString() << ", const QDomDocument& xml )" << endl;
+ if ( protocolUuid.isNull() ) {
+ kdDebug() << "ERROR: protocolUuid.isNull()" << endl;
+ exit(1);
+ }
+
+
+ KMFProtocolUsage* old = findProtocolUsageByProtocolUuid( protocolUuid );
+ if ( old ) {
+ kdDebug() << "WARNING: Ignoreing duplicate protocol entry in zone" << endl;
+ return old;
+ }
+ KMFProtocol* prot = KMFProtocolLibrary::instance()->findProtocolByUuid( protocolUuid );
+ if ( ! prot ) {
+ kdDebug() << "ERROR: No Protocol Found By uuid: " << protocolUuid << endl;
+ return 0;
+ }
+
+ KMFProtocolUsage* new_protocol = prot->createUsage();
+
+ // FIXME: Check For Error
+ QStringList *errors = new QStringList();
+ new_protocol->loadXML( xml, *errors );
+ if ( ! new_protocol->validUsage() ) {
+ kdDebug() << "WARNING: ProtocolUsage parsed from: " << xml.toString() << " is not Valid! Skippin Usage." << endl;
+ return 0;
+ }
+ new_protocol->setProtocol( prot );
+ m_protocols.append( new_protocol );
+ disconnect( new_protocol, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolUsageDeleted( QObject* ) ) );
+ connect( new_protocol, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolUsageDeleted( QObject* ) ) );
+ changed();
+ return new_protocol;
+}
+
+
+void KMFNetHost::delProtocolUsage( KMFProtocolUsage* prot, bool destructive ){
+// kdDebug() << "void KMFNetHost::delProtocol( KMFProtocol* prot )" << endl;
+ QPtrListIterator<KMFProtocolUsage> it( m_protocols );
+ bool deleted = false;
+ while ( it.current() ) {
+ KMFProtocolUsage *p = it.current();
+ kdDebug() << "Comparing protocol: " << prot->uuid() << " with protocol: " << p->uuid() << endl;
+ if ( p->name() == prot->name() ) {
+ kdDebug() << "Delete protocol: " << prot->uuid() << " from host: " << name() << endl;
+ m_protocols.remove( p );
+ if ( destructive ) {
+ p->deleteLater();
+ }
+ deleted = true;
+ }
+ ++it;
+ }
+
+ if ( ! deleted ) {
+ kdDebug() << "WARNING: Couldn't delete protocol: " << prot->name() << " from host: " << name() << endl;
+ }
+ changed();
+}
+
+void KMFNetHost::slotOnProtocolUsageDeleted( QObject* prot ) {
+ kdDebug() << "KMFNetHost::slotOnProtocolUsageDeleted... Host name: " << this->name() << endl;
+ QPtrListIterator<KMFProtocolUsage> it( m_protocols );
+ while ( it.current() ) {
+ KMFProtocolUsage * p = it.current();
+ ++it;
+ if ( p == prot ) {
+ kdDebug() << "Deleting Protocol" << endl;
+ m_protocols.remove( p );
+ p->deleteLater();
+ changed();
+ return;
+ }
+ }
+}
+
+
+
+bool KMFNetHost::protocolInherited( const QUuid& uuid ) const {
+// kdDebug() << "bool KMFNetHost::protocolInherited() const" << endl;
+ if ( ! m_zone )
+ return false;
+
+ if ( uuid.isNull() ) {
+ kdDebug() << "ERROR: KMFNetHost::protocolInherited(): uuid.isNull() == true" << endl;
+ exit(1);
+ }
+
+ QPtrListIterator<KMFProtocolUsage> it( m_zone->protocols() );
+ while ( it.current() ) {
+ KMFProtocolUsage *p = it.current();
+ ++it;
+ if ( p->protocol()->uuid() == uuid ) {
+ kdDebug() << "Found Inherited Protocol: " << p->protocol()->name() << endl;
+ return true;
+ }
+ }
+ return m_zone->protocolInherited( uuid );
+}
+
+const QDomDocument& KMFNetHost::getDOMTree() {
+ kdDebug() << "const QDomDocument& KMFNetHost::getDOMTree() " << endl;
+ QDomDocument doc;
+ QDomElement root = doc.createElement( XML::NetHost_Element );
+ NetfilterObject::saveUuid( root );
+
+ root.setAttribute( XML::Name_Attribute, name() );
+ root.setAttribute( XML::GUIName_Attribute, m_guiName );
+ root.setAttribute( XML::Description_Attribute, description() );
+ root.setAttribute( XML::Address_Attribute, m_address->toString() );
+ if ( logIncoming() ) {
+ root.setAttribute( XML::LogIncoming_Attribute, XML::BoolOn_Value );
+ } else {
+ root.setAttribute( XML::LogIncoming_Attribute, XML::BoolOff_Value );
+ }
+ if ( logOutgoing() ) {
+ root.setAttribute( XML::LogOutgoing_Attribute, XML::BoolOn_Value );
+ } else {
+ root.setAttribute( XML::LogOutgoing_Attribute, XML::BoolOff_Value );
+ }
+
+ root.setAttribute( XML::LimitRate_Attribute, limitRate() );
+ root.setAttribute( XML::LimitScale_Attribute, limitScale() );
+
+ QPtrListIterator<KMFProtocolUsage> it2 ( m_protocols );
+ while ( it2.current() ) {
+ root.appendChild( it2.current()->getDOMTree( ) );
+ ++it2;
+ }
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+void KMFNetHost::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ // kdDebug() << "void KMFNetHost::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML( root, errors );
+}
+void KMFNetHost::loadXML( QDomNode root, QStringList& errors ) {
+ kdDebug() << "void KMFNetHost::loadXML( QDomNode root )" << endl;
+ //QDomElement root = doc.documentElement();
+
+ NetfilterObject::loadUuid( root, errors );
+ QString name = "";
+ QString guiName = "";
+ QString desc = "";
+ QString address = "";
+ QString logIn = "";
+ QString logOut = "";
+ QString limitRate = "";
+ QString limitScale = "";
+
+ name = root.toElement().attribute( XML::Name_Attribute );
+ guiName = root.toElement().attribute( XML::GUIName_Attribute );
+ desc = root.toElement().attribute( XML::Description_Attribute );
+ address = root.toElement().attribute( XML::Address_Attribute );
+ logIn = root.toElement().attribute( XML::LogIncoming_Attribute );
+ logOut = root.toElement().attribute( XML::LogOutgoing_Attribute );
+ limitRate = root.toElement().attribute( XML::LimitRate_Attribute );
+ limitScale = root.toElement().attribute( XML::LimitScale_Attribute );
+
+ if ( logIn == XML::BoolOn_Value ) {
+ m_logIncoming = true;
+ } else {
+ m_logIncoming = false;
+ }
+
+ if ( logOut == XML::BoolOn_Value ) {
+ m_logOutgoing = true;
+ } else {
+ m_logOutgoing = false;
+ }
+ bool ok;
+ int lRate = limitRate.toInt( &ok );
+ if ( ok ) {
+ setLimit( lRate, *( new QString( limitScale ) ) );
+ }
+
+ setDescription( *( new QString( desc ) ) );
+ // setName( *( new QString( name ) ) );
+ setGuiName( *( new QString( guiName ) ) );
+ this->address()->setAddress( address );
+
+ QValueList< KMFProtocolUsage* > xmlDefinedProtocols;
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ if ( curr.isElement() && ( curr.nodeName() == XML::Protocol_Element ) ) {
+ // FIXME: Remove later
+ // keep for compatibility
+ QString name = curr.toElement().attribute( XML::Name_Attribute );
+ QDomDocument protocol_doc;
+ protocol_doc.appendChild( curr.cloneNode(true) );
+ KMFProtocol *protocol = KMFProtocolLibrary::instance()->findProtocolByName( name );
+ if ( ! protocol ) {
+ KMFUndoEngine::instance()->log( i18n("No Protocol Found by name: %1").arg( name ), KMFError::OK, this );
+ continue;
+ }
+
+ KMFProtocolUsage* pu = addProtocolUsage( protocol->uuid(), protocol_doc );
+ if ( pu ) {
+
+ xmlDefinedProtocols.append( pu );
+ }
+ }
+ if ( curr.isElement() && ( curr.nodeName() == XML::ProtocolUsage_Element ) ) {
+ QString protocolUuid = curr.toElement().attribute( XML::ProtocolUuid_Attribute );
+ QDomDocument protocol_doc;
+ protocol_doc.appendChild( curr.cloneNode(true) );
+ KMFProtocolUsage* pu = addProtocolUsage( protocolUuid , protocol_doc );
+ if ( pu ) {
+ xmlDefinedProtocols.append( pu );
+ }
+ }
+ curr = curr.nextSibling();
+ }
+
+ {
+ QPtrList< KMFProtocolUsage >& allprotocols = protocols();
+ QPtrListIterator< KMFProtocolUsage > itAllProtocols( allprotocols );
+ while( itAllProtocols.current() ) {
+ KMFProtocolUsage *oldProtocolUsage = itAllProtocols.current();
+ ++itAllProtocols;
+
+ bool found = false;
+ QValueList< KMFProtocolUsage* >::iterator itProtocols;
+ for( itProtocols = xmlDefinedProtocols.begin(); itProtocols != xmlDefinedProtocols.end() && ! found; ++itProtocols ) {
+ KMFProtocolUsage* pu = *itProtocols;
+ if ( pu == oldProtocolUsage ) {
+ found = true;
+ }
+ }
+
+ if ( ! found ) {
+ KMFUndoEngine::instance()->log( i18n("Removing unused oldProtocolUsage: %1").arg( oldProtocolUsage->name() ), KMFError::OK, this );
+ delProtocolUsage( oldProtocolUsage, true );
+ }
+ }
+ }
+ changed();
+}
+
+}
+
+
+
diff --git a/kmyfirewall/core/kmfnethost.h b/kmyfirewall/core/kmfnethost.h
new file mode 100644
index 0000000..d1f71c6
--- /dev/null
+++ b/kmyfirewall/core/kmfnethost.h
@@ -0,0 +1,104 @@
+//
+// C++ Interface: kmfnethost
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFNETHOST_H
+#define KMFNETHOST_H
+
+#include "kmftarget.h"
+#include "netfilterobject.h"
+
+
+// QT includes
+#include <qptrlist.h>
+#include <qguardedptr.h>
+#include <qstring.h>
+#include <qdom.h>
+#include <quuid.h>
+
+// KDE includes
+#include <kdemacros.h>
+
+
+// Project includes
+
+namespace KMF {
+class KMFGenericDoc;
+class KMFProtocol;
+class KMFProtocolUsage;
+class KMFError;
+class KMFCheckInput;
+class KMFNetZone;
+class IPAddress;
+class KMFNetwork;
+
+/**
+@author Christian Hubinger
+*/
+
+class KDE_EXPORT KMFNetHost : public KMFTarget {
+ Q_OBJECT
+public:
+ KMFNetHost( NetfilterObject *parent, const char* name, const QString& Hostname, KMFNetwork* net );
+ virtual ~KMFNetHost();
+
+ virtual int type();
+ virtual void clear();
+
+ bool logIncoming() {
+ return m_logIncoming;
+ }
+ void setLogIncoming( bool );
+
+ bool logOutgoing() {
+ return m_logOutgoing;
+ }
+ void setLogOutgoing( bool );
+
+ void setLimit( int num, const QString& scale );
+
+ bool limit() const;
+ int limitRate() const;
+ const QString& limitScale() const;
+
+ virtual const QDomDocument& getDOMTree();
+ virtual void loadXML(const QDomDocument&, QStringList& errors );
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+ KMFProtocolUsage* addProtocolUsage( const QUuid& protocolUuid, const QDomDocument& xml );
+
+ void delProtocolUsage( KMFProtocolUsage*, bool destructive = true );
+ bool protocolInherited( const QUuid& uuid ) const;
+ KMFProtocolUsage* findProtocolUsageByProtocolUuid( const QUuid& uuid ) const;
+
+ QPtrList<KMFProtocolUsage>& protocols() const;
+
+protected slots:
+ void slotOnProtocolUsageDeleted( QObject* protocol );
+
+private: // Data
+// int m_maskLen;
+ QPtrList<KMFProtocolUsage> m_protocols;
+ bool m_logIncoming, m_logOutgoing;
+ QString m_limitScale;
+ int m_limitNum;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfnetwork.cpp b/kmyfirewall/core/kmfnetwork.cpp
new file mode 100644
index 0000000..b9ba35e
--- /dev/null
+++ b/kmyfirewall/core/kmfnetwork.cpp
@@ -0,0 +1,317 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfnetwork.h"
+
+// QT includes
+#include <qfile.h>
+#include <qdom.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kio/netaccess.h>
+#include <kio/job.h>
+#include <ktrader.h>
+#include <klibloader.h>
+
+// Project includes
+#include "../version.h"
+#include "kmfcompilerinterface.h"
+#include "kmfplugin.h"
+#include "kmfpluginfactory.h"
+#include "kmferror.h"
+#include "kmfprotocol.h"
+#include "kmfnetzone.h"
+#include "kmftarget.h"
+#include "kmfconfig.h"
+#include "ipaddress.h"
+#include "kmfgenericdoc.h"
+#include "kmfiptdoc.h"
+#include "xmlnames.h"
+
+
+namespace KMF {
+
+KMFNetwork::KMFNetwork( NetfilterObject* parent, const char* name, KMyFirewallInterface* ) : KMFDoc( parent, name ) {
+ kdDebug() << "KMFNetwork::KMFNetwork( QObject *parent, const char *name ) : KMFDoc( parent, name )" << endl;
+
+ m_target = 0;
+ m_myNetwork = 0;
+ m_myNetwork = new KMFNetZone( this, Constants::MyNetwork_Name.latin1(), Constants::MyNetwork_Name );
+ m_myNetwork->setNetwork( this );
+ initDoc();
+ KMFUndoEngine::instance()->clearStacks();
+ KMFUndoEngine::instance()->saved();
+}
+
+
+KMFNetwork::~KMFNetwork() {}
+
+int KMFNetwork::type() {
+// kdDebug() << "IPTRule::type()" << endl;
+ return NetfilterObject::KMFNETWORK;
+}
+
+KMFError* KMFNetwork::exportXMLRuleset( bool promtFile, bool asTemplate ) {
+ kdDebug() << "KMFNetwork::exportXMLRuleset( const KURL& )" << endl;
+ KMFError *err = KMFDoc::exportXMLRuleset( promtFile, asTemplate );
+ KMFUndoEngine::instance()->saved();
+ return err;
+}
+
+KMFError* KMFNetwork::exportXMLRuleset( const KURL& url ) {
+ kdDebug() << "KMFNetwork::exportXMLRuleset( const KURL& )" << endl;
+ KMFError *err = KMFDoc::exportXMLRuleset( url );
+ KMFUndoEngine::instance()->saved();
+ return err;
+}
+
+void KMFNetwork::clear() {
+ kdDebug() << "void KMFNetwork::clear()" << endl;
+ setDescription( i18n("No description available") );
+ m_myNetwork->clear();
+ resetUrl();
+ initDoc();
+}
+
+const QString& KMFNetwork::getFileDialogFilter() {
+ return *( new QString("*.kmfnet|KMyFirewall Network (*.kmfnet)") );
+}
+
+void KMFNetwork::setupDefaultHosts() {
+ kdDebug() << "KMFNetwork::setupDefaultHosts()" << endl;
+ if ( ! m_myNetwork->findTargetByName( Constants::Localhost_Name, true ) ) {
+ kdDebug() << "Creating Localhost" << endl;
+ KMFTarget * localhost = new KMFTarget( m_myNetwork, "My Local Comuter", i18n("My Local Comuter"), this );
+ localhost->setGuiName( i18n("My Local Computer") );
+ localhost->setDescription( i18n("Local copmuter running KMyFirewall") );
+ localhost->setAddress( Constants::Localhost_IP );
+ localhost->setName( Constants::Localhost_Name );
+ localhost->setReadOnly( true );
+
+ m_myNetwork->placeHostInZone( localhost );
+ localhost->setName( Constants::Localhost_Name );
+ localhost->setReadOnly( true );
+ m_myNetwork->refreshNetworkTree();
+ }
+}
+
+
+void KMFNetwork::initDoc() {
+ kdDebug() << "void KMFNetwork::initDoc()" << endl;
+ m_err = new KMFError;
+ // setName( i18n("Unamed Ruleset") );
+ m_url.setFileName( i18n( "Untitled" ) );
+ m_myNetwork->setGuiName( i18n("Gloabl Network") );
+ m_myNetwork->setDescription( i18n("This is the global zone that contains all valid IP addresses.") );
+ m_myNetwork->setZone( IPAddress( 0,0,0,0 ), 0 );
+ m_myNetwork->setReadOnly( true );
+ m_myNetwork->clear();
+ setupDefaultHosts();
+
+ KMFTarget *tg = netzone()->findTargetByName( Constants::Localhost_Name );
+ if ( ! tg ) {
+ kdDebug() << "WARINING: KMFNetwork::initDoc() - netzone()->findTargetByName( 'localhost' ) returned 0" << endl;
+ }
+
+ m_target = tg;
+ kdDebug() << "KMFNetwork::initDoc() - CurrentTarget: " << m_target->name() << endl;
+}
+
+void KMFNetwork::setCurrentTarget( KMFTarget* target ) {
+ if ( ! target ) {
+ kdDebug() << "KMFNetwork::setCurrentTarget( KMFTarget* target ): target was no vailid pointer!" << endl;
+ }
+
+ m_target = target;
+}
+
+KMFDoc* KMFNetwork::currentDoc() {
+ KMFTarget *curr = currentTarget();
+ if ( ! curr ) {
+ kdDebug() << "ERROR: No Current Target Found!!!" << endl;
+ return 0;
+ }
+ KMFDoc *doc = curr->doc();
+ if ( ! doc ) {
+ kdDebug() << "ERROR: Current Target has no Doc assigned Found!!!" << endl;
+ return 0;
+ }
+ return doc;
+}
+
+KMFIPTDoc* KMFNetwork::currentDocAsIPTDoc() {
+ KMFDoc *doc = currentDoc();
+ if ( ! doc ) {
+ kdDebug() << "ERROR: Current Target has no Doc assigned Found!!!" << endl;
+ return 0;
+ }
+ KMFIPTDoc *ret = dynamic_cast<KMFIPTDoc*>( doc );
+ if ( ! ret ) {
+ kdDebug() << "ERROR: Returning 0 KMFNetwork::currentDocAsIPTDoc()" << endl;
+ return 0;
+ }
+
+ return ret;
+}
+
+KMFGenericDoc* KMFNetwork::currentDocAsGenericDoc(){
+ KMFDoc *doc = currentDoc();
+ if ( ! doc ) {
+ kdDebug() << "ERROR: Current Target has no Doc assigned Found!!!" << endl;
+ return 0;
+ }
+ KMFGenericDoc *ret = dynamic_cast<KMFGenericDoc*>( doc );
+ if ( ! ret ) {
+ kdDebug() << "ERROR: Returning 0 KMFNetwork::currentDocAsGenericDoc()" << endl;
+ return 0;
+ }
+ return ret;
+}
+
+KMFTarget* KMFNetwork::currentTarget() {
+ if ( ! m_target ) {
+ // setupDefaultHosts();
+ KMFTarget* tg = m_myNetwork->findTargetByName( Constants::Localhost_Name );
+ if ( ! tg ) {
+ kdDebug() << "ERROR: Retuning 0 KMFNetwork::currentTarget()" << endl;
+ return 0;
+ }
+ m_target = tg;
+ }
+
+ // kdDebug() << "KMFNetwork::currentTarget(): Current Target: " << m_target->name() << endl;
+ return m_target;
+}
+
+bool KMFNetwork::isEmpty() {
+// kdDebug() << "bool KMFNetwork::isEmpty()" << endl;
+ return false;
+}
+
+void KMFNetwork::parseDocument( const KURL& url, QStringList& errors ) {
+ kdDebug() << "KMFDoc* KMFNetwork::parseDocument( const KURL& url )" << endl;
+ QString xmlfile;
+ if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) {
+ clear();
+ m_url.setFileName( i18n( "Untitled" ) );
+ return;
+ }
+
+ if ( !xmlfile.isEmpty() ) {
+// kdDebug() << "Found xmlfile: " << xmlfile << endl;
+ // delete old chainsets if there
+ clear();
+ QFile kmfrsFile( xmlfile );
+ QDomDocument domTree;
+ if ( !kmfrsFile.open( IO_ReadOnly ) ) {
+ return;
+ }
+ if ( !domTree.setContent( &kmfrsFile ) ) {
+ kmfrsFile.close();
+ return;
+ }
+ kmfrsFile.close();
+
+
+ kdDebug() << "############ Start Parsing ############" << endl;
+
+ //FIXME: Preserve object uuids
+ // KMFUndoEngine::instance()->setPreserveObjectUuid( true );
+ loadXML( domTree, errors );
+ // KMFUndoEngine::instance()->setPreserveObjectUuid( false );
+
+ // FIXME: Check errors
+
+ // I'm the one and only network, so set to saved state after load
+ KMFUndoEngine::instance()->clearStacks();
+ KMFUndoEngine::instance()->saved();
+ kdDebug() << "########## Finished Parsing ###########" << endl;
+
+ // setUrl( url );
+ m_url = url;
+ m_newSavePathNeeded = false;
+ emit documentChanged();
+ KIO::NetAccess::removeTempFile( xmlfile );
+ return;
+ }
+ KIO::NetAccess::removeTempFile( xmlfile );
+ return;
+}
+
+const QDomDocument& KMFNetwork::getDOMTree() {
+ // kdDebug() << "const QDomDocument& KMFNetwork::getDOMTree()" << endl;
+ QDomDocument doc( "kmyfirewall-ruleset" );
+ QDomElement root = doc.createElement( XML::KMFNetwork_DocumentElement );
+ NetfilterObject::saveUuid( root );
+ root.setAttribute( XML::Version_Attribute, KMYFIREWALL_VERSION );
+ root.setAttribute( XML::MinVersion_Attribute, "1.1.0" );
+ root.setAttribute( XML::MaxVersion_Attribute, "~" );
+ if ( KMFConfig::useGenericInterface() ) {
+ root.setAttribute( XML::Interface_Attribute, XML::GenericGUIInterface_Value );
+ } else {
+ root.setAttribute( XML::Interface_Attribute, XML::IPTablesGUIInterface_Value );
+ }
+
+ root.appendChild( m_myNetwork->getDOMTree() );
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+void KMFNetwork::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ kdDebug() << "void KMFNetwork::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ if ( root.nodeName() != XML::KMFNetwork_DocumentElement ) {
+ kdDebug() << "!!! ERROR: Wrong XML format " << root.nodeName() << " found !!!" << endl;
+ errors.append( KMFError::getAsString( KMFError::FATAL, i18n("Wrong XML format <b>%1</b> found! Expected kmfnet").arg( root.nodeName() ) ) );
+ return;
+ }
+
+
+ loadXML( root, errors );
+}
+void KMFNetwork::loadXML( QDomNode root, QStringList& errors ) {
+// void KMFNetwork::loadXML( const QDomDocument& doc ) {
+ // kdDebug() << "void KMFNetwork::loadXML( const QDomDocument& )" << endl;
+ // QDomElement root = doc.documentElement();
+ NetfilterObject::loadUuid( root, errors );
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ kdDebug() << "Parsing Node: " << curr.nodeName() << endl;
+ if ( curr.isElement() && curr.nodeName() == XML::NetZone_Element ) {
+ QString name = curr.toElement().attribute( XML::Name_Attribute );
+ if ( name == Constants::MyNetwork_Name ) {
+ kdDebug() << "Parsing netzone: " << curr.toElement().attribute( XML::Name_Attribute ) << endl;
+ m_myNetwork->loadXML( curr, errors );
+ }
+
+ }
+ curr = curr.nextSibling();
+ }
+}
+
+}
+
diff --git a/kmyfirewall/core/kmfnetwork.h b/kmyfirewall/core/kmfnetwork.h
new file mode 100644
index 0000000..458853f
--- /dev/null
+++ b/kmyfirewall/core/kmfnetwork.h
@@ -0,0 +1,115 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFNETWORK_H
+#define KMFNETWORK_H
+
+#include "kmfdoc.h"
+#include "kmfundoengine.h"
+
+// QT includes
+#include <qdom.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+
+// KDE includes
+#include <kurl.h>
+
+// Project includes
+#include "ipaddress.h"
+#include "kmfprotocol.h"
+
+namespace KMF {
+class KMFError;
+class KMFNetZone;
+class KMFTarget;
+class IPAddress;
+class KMFCompilerInterface;
+class KMyFirewallInterface;
+
+/**
+@author Christian Hubinger
+*/
+
+class KDE_EXPORT KMFNetwork : public KMFDoc {
+
+//##### static stuff ####
+public:
+
+
+//##### end static stuff
+
+public:
+ KMFNetwork( NetfilterObject*, const char*, KMyFirewallInterface* app );
+
+ ~KMFNetwork();
+ /** resets the document to the initial values */
+ virtual void clear();
+
+ /** Reeturn if the Network is empty */
+ bool isEmpty();
+
+ /** Return DomDocument of this Chain */
+ const QDomDocument& getDOMTree();
+
+ virtual void loadXML( const QDomDocument&, QStringList& errors );
+ virtual void loadXML( QDomNode, QStringList& errors );
+ virtual int type();
+
+ void parseDocument( const KURL&, QStringList& errors );
+
+ /** Get the File dialog filter string for the document type */
+ virtual const QString& getFileDialogFilter();
+
+ KMFDoc* currentDoc();
+ KMFIPTDoc* currentDocAsIPTDoc();
+ KMFGenericDoc* currentDocAsGenericDoc();
+
+ KMFTarget* currentTarget();
+ void setCurrentTarget( KMFTarget* );
+
+ KMFNetZone* netzone() const {
+ return m_myNetwork;
+ }
+
+ virtual KMFError* exportXMLRuleset( bool promtFile, bool asTemplate );
+
+protected:
+ virtual KMFError* exportXMLRuleset( const KURL& url );
+ void initDoc();
+ void setupDefaultHosts();
+
+private:
+ bool loadProtocolLibrary();
+ bool loadCustomProtocolLibrary();
+// KMFCompilerInterface* compiler();
+
+private: // DATA
+ QGuardedPtr<KMFNetZone> m_myNetwork;
+ QGuardedPtr<KMFTarget> m_target;
+
+/* KMFNetZone *m_myNetwork;
+ KMFTarget *m_target;*/
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfnetzone.cpp b/kmyfirewall/core/kmfnetzone.cpp
new file mode 100644
index 0000000..b666838
--- /dev/null
+++ b/kmyfirewall/core/kmfnetzone.cpp
@@ -0,0 +1,1046 @@
+//
+// C++ Implementation: kmfnetzone
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfnetzone.h"
+
+// QT includes
+#include <qdom.h>
+#include <qvaluelist.h>
+#include <qobject.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "kmfcheckinput.h"
+#include "kmfnetwork.h"
+#include "kmfprotocol.h"
+#include "kmfprotocollibrary.h"
+#include "kmfprotocolusage.h"
+#include "kmfnetwork.h"
+#include "kmfnethost.h"
+#include "kmftarget.h"
+#include "kmfgenericdoc.h"
+#include "kmferror.h"
+#include "ipaddress.h"
+#include "kmfnetzonelist.h"
+#include "netfilterobject.h"
+#include "xmlnames.h"
+
+#include <stdlib.h>
+
+namespace KMF {
+
+KMFNetZone::KMFNetZone( NetfilterObject *parent, const char* name, const QString& zoneName ) : NetfilterObject( parent, name ) {
+ kdDebug() << "KMFNetZone::KMFNetZone( NetfilterObject *parent, const char* name, const QString& zoneName )" << endl;
+ m_doc = 0;
+ m_network = 0;
+ m_zone = 0;
+ m_guiName = i18n( "New Zone" );
+ m_readOnly = false;
+ m_err = new KMFError();
+ m_address = new IPAddress( 0, 0, 0, 0 );
+ m_protocols.setAutoDelete( false );
+ m_zones.setAutoDelete( false );
+ m_hosts.setAutoDelete( false );
+ if ( zoneName.isNull() ) {
+ setName( i18n( "New Zone" ) );
+ } else {
+ setName( zoneName );
+ }
+ if ( KMFNetZone * zone = dynamic_cast<KMFNetZone*> ( parent ) ) {
+ m_zoneType = NODE;
+ m_zone = zone;
+ setZone( *m_zone->address(), m_zone->maskLength() /* , *m_zone->mask() */ );
+ } else if ( KMFGenericDoc * doc = dynamic_cast<KMFGenericDoc*> ( parent ) ) {
+ m_zoneType = ROOT;
+ m_doc = doc;
+ } else if ( KMFNetwork * doc = dynamic_cast<KMFNetwork*> ( parent ) ) {
+ m_zoneType = ROOT;
+ m_network = doc;
+ }
+
+ // kdDebug() << "m_zone" << m_zone << endl;
+ // exit(0);
+}
+
+
+KMFNetZone::~KMFNetZone() {
+ kdDebug() << "~KMFNetZone: Deleting Children" << endl;
+ m_address->setAddress( "0.0.0.0" );
+ clear();
+ delete m_address;
+ delete m_err;
+}
+
+int KMFNetZone::operator==( const KMFNetZone& zone ) {
+ if ( IPAddress::calcLenthToMask( *mask() ) > IPAddress::calcLenthToMask( *zone.mask() ) ) {
+ return 1;
+ } else if ( IPAddress::calcLenthToMask( *mask() ) == IPAddress::calcLenthToMask( *zone.mask() ) ){
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+bool KMFNetZone::isSameZone( KMFNetZone* zone ) {
+ if ( IPAddress::calcLenthToMask( *mask() ) > IPAddress::calcLenthToMask( *zone->mask() ) ) {
+ return false;
+ } else if ( IPAddress::calcLenthToMask( *mask() ) == IPAddress::calcLenthToMask( *zone->mask() ) ){
+ return true;
+ } else {
+ return false;
+ }
+}
+
+int KMFNetZone::type() {
+ // kdDebug() << "KMFNetZone::type()" << endl;
+ return NetfilterObject::NETZONE;
+}
+
+void KMFNetZone::clear() {
+ m_zones.setAutoDelete( true );
+ m_hosts.setAutoDelete( true );
+ m_protocols.setAutoDelete( true );
+
+ m_zones.clear();
+ m_hosts.clear();
+ m_protocols.clear();
+
+ m_zones.setAutoDelete( false );
+ m_hosts.setAutoDelete( false );
+ m_protocols.setAutoDelete( false );
+ changed();
+}
+
+KMFGenericDoc* KMFNetZone::doc() const {
+ if ( m_zoneType == ROOT ) {
+ return m_doc;
+ } else if ( m_zoneType == NODE ) {
+ return m_zone->doc();
+ }
+ return 0;
+}
+
+KMFNetwork* KMFNetZone::network() const {
+ if ( m_zoneType == ROOT ) {
+ return m_network;
+ } else if ( m_zoneType == NODE ) {
+ return m_zone->network();
+ }
+ return 0;
+}
+
+void KMFNetZone::setNetwork( KMFNetwork* net ) {
+ m_network = net;
+}
+
+KMFNetZone* KMFNetZone::zone() const {
+ //kdDebug() << "KMFNetZone::zone()" << endl;
+ /* if ( m_zoneType == NODE ) {
+ return m_zone;
+ }*/
+
+ return m_zone;
+}
+
+KMFNetZone* KMFNetZone::rootZone() {
+ // kdDebug() << "KMFNetZone::rootZone()" << endl;
+ if ( isRootZone() ) {
+ return this;
+ }
+ return zone()->rootZone();
+}
+
+bool KMFNetZone::isRootZone() {
+ // kdDebug() << "bool KMFNetZone::isRootZone(): " << NetfilterObject::name() << endl;
+ if ( ! m_zone || isSameZone( m_zone ) ) {
+ // kdDebug() << "KMFNetZone: " << NetfilterObject::name() << " is a Root Zone" << endl;
+ return true;
+ }
+ return false;
+}
+
+const QString& KMFNetZone::name() {
+ // kdDebug() << "QString& KMFNetZone::name()" << endl;
+ // return "" + uuid();
+
+ const QString& s = generateName( "" );
+ return s;
+}
+
+const QString& KMFNetZone::generateName( const QString& nam ) {
+ // kdDebug() << "QString& KMFNetZone::generateName(" << nam << ")" << endl;
+ if ( ! isRootZone() ) {
+ QString s = "";
+ s.setNum( zone()->zones().find( this ) );
+ return *(new QString( zone()->generateName( "_zone_" + s + "_" + nam )));
+ } else {
+ QString s = "";
+ s.append( NetfilterObject::name() );
+ s.append( nam );
+ // kdDebug() << "QString& KMFNetZone::generateName(" << nam << ") on Root Zone returns: " << s << endl;
+ return *(new QString(s));
+ }
+}
+
+void KMFNetZone::setReadOnly( bool onOff ) {
+ m_readOnly = onOff;
+}
+
+void KMFNetZone::setGuiName( const QString& name ) {
+ if ( name == m_guiName ) {
+ return;
+ }
+ m_guiName = name;
+ changed();
+}
+
+QString KMFNetZone::zoneInfo() {
+ return QString("Zone: guiName: %1 name: %2 objectUuid: %3" ).arg( guiName() ).arg( name() ).arg( uuid() );
+}
+
+void KMFNetZone::setMaskLength( int len ){
+ // kdDebug() << "void KMFNetZone::setMaskLength( int len )" << endl;
+ if ( len < 0 || len > 32 ) {
+ kdDebug() << "ERROR: Mask Lengh invalid: " << len << endl;
+ m_maskLen = -1;
+ return;
+ }
+ if ( m_maskLen == len ) {
+ return;
+ }
+ m_maskLen = len;
+ changed();
+}
+
+QPtrList<KMFProtocolUsage>& KMFNetZone::protocols() const {
+ QPtrList<KMFProtocolUsage>* ret_val = new QPtrList<KMFProtocolUsage>;
+ *ret_val = m_protocols;
+ return *ret_val;
+}
+
+QPtrList<KMFNetZone>& KMFNetZone::zones () const {
+ QPtrList<KMFNetZone>* ret_val = new QPtrList<KMFNetZone>;
+ *ret_val = m_zones;
+ return *ret_val;
+}
+
+QPtrList<KMFTarget>& KMFNetZone::hosts () const {
+ QPtrList<KMFTarget>* ret_val = new QPtrList<KMFTarget>;
+ *ret_val = m_hosts;
+ return *ret_val;
+}
+
+void KMFNetZone::setParentZone( KMFNetZone* zone ) {
+ kdDebug() << "KMFTarget* KMFNetZone::setParentZone( const KMFNetZone* " << ( zone != 0 ? zone->guiName() : "" ) << " in Zone" << guiName() << endl;
+ m_zone = zone;
+ changed();
+}
+
+KMFNetHost* KMFNetZone::findNetHostByName( const QString& name, bool fromRoot ) {
+ KMFTarget* t = findTargetByName( name, fromRoot );
+ if ( t && dynamic_cast<KMFNetHost*>(t) ) {
+ return dynamic_cast<KMFNetHost*>(t);
+ }
+ return 0;
+}
+
+KMFTarget* KMFNetZone::findTargetByName( const QString& name, bool fromRoot ) {
+ kdDebug() << "KMFTarget* KMFNetZone::findTargetByName( const QString& " << name << ", " << fromRoot <<" )" << endl;
+ if ( ! fromRoot ) {
+ return findTargetByName_internal( name );
+ } else {
+ if ( ! isRootZone() ) {
+ return rootZone()->findTargetByName_internal( name );
+ } else {
+ return findTargetByName_internal( name );
+ }
+ }
+}
+
+KMFTarget* KMFNetZone::findTargetByName_internal( const QString& name ) {
+ kdDebug() << "KMFTarget* KMFNetZone::findTargetByName_internal( const QString& " << name << "" << endl;
+ KMFTarget* foundHost = 0;
+ QPtrListIterator<KMFNetZone> it ( m_zones );
+ while ( it.current() ) {
+ KMFNetZone *z = *it;
+ ++it;
+ foundHost = z->findTargetByName_internal( name );
+ if ( foundHost ) {
+ kdDebug() << "KMFNetZone::findTargetByName(..) Found in Child Zone" << endl;
+ return foundHost;
+ }
+ }
+
+ QPtrListIterator<KMFTarget> itHosts ( m_hosts );
+ while ( itHosts.current() ) {
+ KMFTarget *z = *itHosts;
+ ++itHosts;
+ kdDebug() << "KMFNetZone::findTargetByName( " << name << " ) compare with:" << z->name() << endl;
+ if ( z->name() == name ) {
+ kdDebug() << "KMFNetZone::findTargetByName(..) MATCHED" << endl;
+ return z;
+ }
+ }
+
+ return 0;
+}
+
+KMFNetZone* KMFNetZone::findNetZoneByName( const QString& name, bool fromRoot ) {
+ kdDebug() << "KMFTarget* KMFNetZone::findNetZoneByName( const QString& " << name << ", " << fromRoot <<" )" << endl;
+ if ( ! fromRoot ) {
+ return findNetZoneByName_internal( name );
+ } else {
+ if ( ! isRootZone() ) {
+ return rootZone()->findNetZoneByName_internal( name );
+ } else {
+ return findNetZoneByName_internal( name );
+ }
+ }
+}
+
+KMFNetZone* KMFNetZone::findNetZoneByName_internal( const QString& name ) {
+ kdDebug() << "KMFTarget* KMFNetZone::findNetZoneByName_internal( const QString& " << name << "" << endl;
+ KMFNetZone* foundHost = 0;
+ QPtrListIterator<KMFNetZone> it ( m_zones );
+ while ( it.current() ) {
+ KMFNetZone *z = *it;
+ ++it;
+ foundHost = z->findNetZoneByName_internal( name );
+ if ( foundHost ) {
+ kdDebug() << "KMFNetZone::findNetZoneByName(..) Found in Child Zone" << endl;
+ return foundHost;
+ }
+ }
+
+ QPtrListIterator<KMFNetZone> itHosts ( m_zones );
+ while ( itHosts.current() ) {
+ KMFNetZone *z = *itHosts;
+ ++itHosts;
+ kdDebug() << "KMFNetZone::findNetZoneByName( " << name << " ) compare with:" << z->name() << endl;
+ if ( z->name() == name ) {
+ kdDebug() << "KMFNetZone::findNetZoneByName(..) MATCHED" << endl;
+ return z;
+ }
+ }
+
+ return 0;
+}
+
+
+
+
+KMFProtocolUsage* KMFNetZone::findProtocolUsageByProtocolUuid( const QUuid& uuid ) const {
+ kdDebug() << "KMFProtocol* KMFNetZone::findProtocolUsageByProtocolUuid( const QString& " << uuid << " ) const" << endl;
+ if ( (new QUuid(uuid))->isNull() ) {
+ exit(1);
+ }
+
+ QPtrListIterator<KMFProtocolUsage> it( m_protocols );
+ while ( it.current() ) {
+ KMFProtocolUsage * p = it.current();
+ ++it;
+ if ( p->protocol()->uuid() == uuid ) {
+ kdDebug() << "Found Protocol: name=" << p->protocol()->name() << " uuid=" << uuid << endl;
+ return p;
+ }
+ }
+ return 0;
+}
+
+bool KMFNetZone::protocolInherited( const QUuid& uuid ) const {
+ // kdDebug() << "bool KMFNetZone::protocolInherited() const" << endl;
+ if ( m_zoneType != NODE ) {
+ // kdDebug() << "At ROOT node stopping search" << endl;
+ return false;
+ }
+ if ( uuid.isNull() ) {
+ kdDebug() << "ERROR: KMFNetHost::protocolInherited(): uuid.isNull() == true" << endl;
+ exit(1);
+ }
+
+ QPtrListIterator<KMFProtocolUsage> it( m_zone->protocols() );
+ while ( it.current() ) {
+ KMFProtocolUsage * p = it.current();
+ ++it;
+ if ( p->protocol()->uuid() == uuid ) {
+ kdDebug() << "Found Inherited Protocol: " << p->protocol()->name() << endl;
+ return true;
+ }
+ }
+ return m_zone->protocolInherited( uuid );
+}
+
+void KMFNetZone::setZone( const IPAddress& from, int maskLen ) {
+ m_address->setAddress( from.toString() );
+ setMaskLength( maskLen );
+ changed();
+}
+
+
+KMFNetZone* KMFNetZone::addZone( const QString& name, KMFError* err ) {
+// kdDebug() << "KMFProtocol* KMFNetZone::addZone( const QString& name, KMFError* err )" << endl;
+ QPtrListIterator<KMFNetZone> it( m_zones );
+ while ( it.current() ) {
+ KMFNetZone * z = it.current();
+ ++it;
+ if ( z->name() == name ) {
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "Zone %1 already exists, please try again with another name" ).arg( name ) );
+ return 0;
+ }
+ }
+ KMFNetZone* new_zone = new KMFNetZone( this, name.latin1(), name );
+ new_zone->setMaskLength( 32 );
+ new_zone->address()->setAddress( 255, 255, 255, 255 );
+ new_zone->setParentZone( this );
+ new_zone->setNetwork( network() );
+ m_zones.append( new_zone );
+ err->setErrType( KMFError::OK );
+ changed();
+ return new_zone;
+}
+
+void KMFNetZone::delZone( KMFNetZone* zone, bool destructive ) {
+// kdDebug() << "void KMFNetZone::delZone( KMFNetZone* z )" << endl;
+ m_zones.remove( zone );
+ if ( destructive ) {
+ zone->deleteLater();;
+ }
+ changed();
+}
+
+
+
+
+KMFProtocolUsage* KMFNetZone::addProtocolUsage( const QUuid& protocolUuid, const QDomDocument& xml ) {
+ kdDebug() << "KMFProtocol* KMFNetZone::addProtocol( const QUuid& " << protocolUuid << " , const QDomDocument& " << xml.toString() << " )" << endl;
+
+ if ( protocolUuid.isNull() ) {
+ exit(1);
+ }
+
+ KMFProtocolUsage* old = findProtocolUsageByProtocolUuid( protocolUuid );
+ if ( old ) {
+ kdDebug() << "WARNING: Ignoreing duplicate protocol entry in zone, Returning existing" << endl;
+ return old;
+ }
+
+ KMFProtocol* prot = KMFProtocolLibrary::instance()->findProtocolByUuid( protocolUuid );
+ if ( ! prot ) {
+ kdDebug() << "ERROR: No Protocol Found By uuid: " << protocolUuid << endl;
+ return 0;
+ }
+
+ KMFProtocolUsage* new_protocol = prot->createUsage();
+ QStringList *errors = new QStringList();
+ new_protocol->loadXML( xml, *errors );
+
+ // FIXME: Check Errors
+ if ( ! new_protocol->validUsage() ) {
+ kdDebug() << "WARNING: ProtocolUsage parsed from: " << xml.toString() << " is not Valid! Skippin Usage." << endl;
+ return 0;
+ }
+ new_protocol->setProtocol( prot );
+ m_protocols.append( new_protocol );
+ disconnect( new_protocol, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolUsageDeleted( QObject* ) ) );
+ connect( new_protocol, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolUsageDeleted( QObject* ) ) );
+ changed();
+ return new_protocol;
+}
+
+void KMFNetZone::delProtocolUsage( KMFProtocolUsage* prot, bool destructive ) {
+ QPtrListIterator<KMFProtocolUsage> it( m_protocols );
+ bool deleted = false;
+ while ( it.current() ) {
+ KMFProtocolUsage * p = it.current();
+ ++it;
+ if ( p->name() == prot->name() ) {
+ kdDebug() << "Deleting Protocol: " << p->name() << " from zone: " << name() << endl;
+ m_protocols.remove( p );
+ if ( destructive ) {
+ p->deleteLater();
+ }
+ deleted = true;
+ changed();
+ }
+ }
+ if ( ! deleted ) {
+ kdDebug() << "WARNING: Couldn't delete protocol: " << prot->name() << " from zone: " << name() << endl;
+ }
+}
+
+void KMFNetZone::slotOnProtocolUsageDeleted( QObject* prot ) {
+ kdDebug() << "KMFNetZone::slotOnProtocolUsageDeleted... Zone name: " << this->name() << endl;
+ QPtrListIterator<KMFProtocolUsage> it( m_protocols );
+ while ( it.current() ) {
+ KMFProtocolUsage * p = it.current();
+ ++it;
+ if ( p == prot ) {
+ kdDebug() << "Deleting Protocol" << endl;
+ m_protocols.remove( p );
+ p->deleteLater();
+ changed();
+ return;
+ }
+ }
+}
+
+KMFNetZone* KMFNetZone::placeZoneInZone( KMFNetZone* zone ) {
+// kdDebug() << "KMFNetZone::placeZoneInZone_internal... Zone name: " << this->name() << endl;
+ if ( zone->zone() ) {
+ zone->zone()->delZone( zone, false );
+ }
+// kdDebug() << "Placing zone: " << zone->name() << " in zone: " << name() << " GUIName: " << guiName() << endl;
+ zone->setParentZone( this );
+ zone->setNetwork( network() );
+ if ( ! zone->readOnly() ) {
+ QString hostnum;
+ hostnum = hostnum.setNum( m_zones.count() + 1 );
+/* QString host_name = "zone_" + this->name() + "_" + hostnum;
+ zone->setName( host_name );*/
+ }
+ m_zones.append( zone );
+ changed();
+ return zone;
+}
+
+QString KMFNetZone::toString() {
+ QString ret = QString(
+ "Zone: " + address()->toString() +
+ "/%1" +
+ " name: " + NetfilterObject::name() +
+ " GUIName: " + guiName() ).arg(maskLength()) ;
+
+ return ret;
+}
+
+
+// KMFTarget* KMFNetZone::placeHostInZone( KMFTarget* host ) {
+// kdDebug() << "KMFNetZone::placeHostInZone..." << " Zone name: " << this->name() << endl;
+// return placeHostInZone_internal( host );
+// }
+
+
+KMFTarget* KMFNetZone::placeHostInZone( KMFTarget* host ) {
+/* QString s = name();
+
+
+// kdDebug() << "KMFNetZone::placeHostInZone_internal..." << " Zone name: " << name() << endl;
+ */
+
+ /*
+ kdDebug() << "s: " << s << endl;
+
+
+ kdDebug() << "asdasdg" << endl;*/
+
+
+ if ( host->zone() ) {
+ host->zone()->delHost( host, false );
+ }
+ kdDebug() << "Placing zhostone: " << host->name() << " in zone: " << this->name() << endl;
+ host->setParentZone( this );
+ if ( ! host->readOnly() ) {
+ QString hostnum;
+ hostnum = hostnum.setNum( m_hosts.count() + 1 );
+ QString host_name = "host_" + this->name() + "_" + hostnum;
+ host->setName( host_name );
+ }
+ m_hosts.append( host );
+ changed();
+ return host;
+}
+
+void KMFNetZone::refreshNetworkTree() {
+ kdDebug() << "KMFNetZone::refreshNetworkTree()" << endl;
+
+ // QPtrList<KMFNetZone>* allZones = new QPtrList<KMFNetZone>();
+ KMFNetZoneList* allZones = new KMFNetZoneList();
+ kdDebug() << "Fetch All Zones..." << endl;
+ getAllZones( rootZone(), allZones );
+ allZones->sort();
+ kdDebug() << "Found " << allZones->count() << " Zones" << endl;
+
+ // Resort Zones
+ QPtrListIterator<KMFNetZone> it( *allZones );
+// while ( it.current() ) {
+// // kdDebug() << "Found Zone : " << it.current()->toString() << endl;
+// ++it;
+// }
+
+ // Reinsert Zones
+ QPtrListIterator<KMFNetZone> it3( *allZones );
+
+ for( int i = allZones->count() - 1; allZones->count() > 0 && i >= 0; i-- ) {
+ KMFNetZone *currZone = allZones->at(i);
+ // kdDebug() << "currZone: " << currZone->guiName() << endl;
+ for( int j = i - 1; allZones->count() > 1 && j >= 0; j-- ) {
+ KMFNetZone *thisTry = allZones->at(j);
+ if ( thisTry != currZone && ! (
+ ( thisTry->address() == currZone->address() ) == IPAddress::EQUAL &&
+ thisTry->maskLength() == currZone->maskLength()
+ ) &&
+
+
+
+ IPAddress::hostsOnSameNetwork( *thisTry->address(), *currZone->address(), thisTry->maskLength() ) ) {
+ thisTry->placeZoneInZone( currZone );
+ // allZones->remove( thisTry );
+// kdDebug() << "Add Zone: " << currZone->toString() << endl;
+// kdDebug() << "to Zone : " << thisTry->toString() << endl;
+ break;
+ // i--;
+ }
+ }
+ }
+
+ kdDebug() << "Finished Zone Reorder" << endl << endl;
+
+ QPtrList<KMFTarget>* allHosts = new QPtrList<KMFTarget>();
+ kdDebug() << "Fetch All Hosts..." << endl;
+
+
+ for( uint i = 0; i < allZones->count(); i++ ) {
+ QPtrListIterator<KMFTarget> it_hosts( allZones->at(i)->hosts() );
+ while ( it_hosts.current() ) {
+ allHosts->append( it_hosts.current() );
+// kdDebug() << "Found: " << it_hosts.current()->toString() << endl;
+ ++it_hosts;
+ }
+ }
+
+ allZones->sort();
+// kdDebug() << "Found " << allZones->count() << " Zones" << endl;
+
+ // Resort Zones
+ QPtrListIterator<KMFNetZone> it_2( *allZones );
+ while ( it_2.current() ) {
+// kdDebug() << "Found Zone : " << it_2.current()->toString() << endl;
+ ++it_2;
+ }
+
+ for( uint i = 0; i < allHosts->count(); i++ ) {
+ KMFTarget *currHost = allHosts->at(i);
+ for( int j = allZones->count() - 1; allZones->count() > 0 && j >= 0; j-- ) {
+ KMFNetZone *currZone = allZones->at(j);
+ if ( IPAddress::hostsOnSameNetwork( *currZone->address(), *currHost->address(), currZone->maskLength() ) ) {
+ currZone->placeHostInZone( currHost );
+/* kdDebug() << "Add Host: " << currHost->toString() << endl;
+ kdDebug() << "to Zone : " << currZone->toString() << endl;*/
+ break;
+ }
+ }
+ }
+
+ kdDebug() << "Finished Host Reorder" << endl << endl;
+
+
+
+}
+
+// void KMFNetZone::refreshNetworkTree_internal( KMFNetZone *curr ) {
+// kdDebug() << "KMFNetZone::refreshNetworkTree_internal()" << endl;
+//
+//
+//
+// }
+
+void KMFNetZone::getAllZones( KMFNetZone* zone, QPtrList<KMFNetZone>* list ) {
+// kdDebug() << "KMFNetZone::getAllZones(...)" << endl;
+ QPtrListIterator<KMFNetZone> it( zone->zones() );
+ while ( it.current() ) {
+ getAllZones( it.current(), list );
+ ++it;
+ }
+ list->append( zone );
+}
+
+void KMFNetZone::getAllHosts( KMFNetZone* zone, QPtrList<KMFTarget>* list ) {
+// kdDebug() << "KMFNetZone::getAllHosts(...)" << endl;
+ QPtrListIterator<KMFNetZone> it( zone->zones() );
+ while ( it.current() ) {
+ getAllHosts( it.current(), list );
+ ++it;
+ }
+
+ QPtrListIterator<KMFTarget> it2( zone->hosts() );
+ while ( it2.current() ) {
+ list->append( it2.current() );
+ ++it2;
+ }
+}
+
+void KMFNetZone::getAllTargets( KMFNetZone* zone, QPtrList<KMFTarget>* list ) {
+ kdDebug() << "KMFNetZone::getAllTargets(...)" << endl;
+ QPtrListIterator<KMFNetZone> it( zone->zones() );
+ while ( it.current() ) {
+ getAllTargets( it.current(), list );
+ ++it;
+ }
+
+ QPtrListIterator<KMFTarget> it2( zone->hosts() );
+ while ( it2.current() ) {
+ if ( it2.current()->type() == NetfilterObject::KMFTARGET ) {
+ list->append( it2.current() );
+ }
+ ++it2;
+ }
+}
+
+KMFNetHost* KMFNetZone::addNetHost( const QString& name, const QDomDocument& xml ) {
+ kdDebug() << "KMFProtocol* KMFNetHost::addNetHost( const QString& name, const QDomDocument& xml )" << endl;
+ QString hostnum;
+ hostnum = hostnum.setNum( m_hosts.count() + 1 );
+ QString host_name = "nethost_" + this->name() + "_" + hostnum;
+ KMFNetHost* new_host = new KMFNetHost( this, host_name.latin1(), host_name, network() );
+ if ( ! new_host ) {
+ kdDebug() << "ERROR couldn't create Host" << endl;
+ return 0;
+ }
+ kdDebug() << "xml.toString(): " << xml.toString() << endl;
+ QStringList *errors = new QStringList();
+ new_host->loadXML( xml, *errors );
+ // FIXME: Check Errors
+ if ( ! new_host->readOnly() ) {
+ new_host->setName( host_name );
+ new_host->setGuiName( name );
+ }
+ KMFNetHost *retHost = dynamic_cast<KMFNetHost *> ( placeHostInZone( new_host ) );
+ if ( ! retHost ) {
+ kdDebug() << "ERROR: couldn't place host!" << endl;
+ }
+ changed();
+ return retHost;
+}
+
+KMFTarget* KMFNetZone::addTarget( const QString& name, const QDomDocument& xml ) {
+ kdDebug() << "KMFProtocol* KMFNetHost::addTarget( const QString& name, const QDomDocument& xml )" << endl;
+ QString hostnum;
+ hostnum = hostnum.setNum( hosts().count() + 1 );
+ QString host_name = "target_" + this->name() + "_" + hostnum;
+ KMFTarget* new_host = new KMFTarget( this , host_name.latin1(), host_name, network() );
+ if ( ! new_host ) {
+ kdDebug() << "ERROR couldn't create Host" << endl;
+ return 0;
+ }
+ kdDebug() << xml.toString() << endl;
+ QStringList *errors = new QStringList();
+ new_host->loadXML( xml, *errors );
+ // FIXME: Check Errors
+ if ( ! new_host->readOnly() ) {
+ new_host->setName( host_name );
+ new_host->setGuiName( name );
+ }
+ KMFTarget *retHost = dynamic_cast<KMFTarget *> ( placeHostInZone( new_host ) );
+ if ( ! retHost ) {
+ kdDebug() << "ERROR: couldn't place host!" << endl;
+ }
+ changed();
+ return retHost;
+}
+
+void KMFNetZone::delHost( KMFTarget* host, bool destructive ) {
+ QPtrListIterator<KMFTarget> it( m_hosts );
+ bool deleted = false;
+ while ( it.current() ) {
+ KMFTarget * p = it.current();
+ ++it;
+ if ( p == host ) {
+ m_hosts.remove( p );
+ if ( destructive ) {
+ host->deleteLater();
+ }
+ deleted = true;
+ changed();
+ }
+ }
+ if ( !deleted ) {
+ kdDebug() << "WARNING: Couldn't delete host: " << host->name() << " from zone: " << name() << endl;
+ }
+}
+
+const QDomDocument& KMFNetZone::getDOMTree() {
+ // kdDebug() << "const QDomDocument& KMFNetZone::getDOMTree() " << endl;
+ QDomDocument doc;
+ QDomElement root = doc.createElement( XML::NetZone_Element );
+ NetfilterObject::saveUuid( root );
+ root.setAttribute( XML::Name_Attribute, name() );
+ root.setAttribute( XML::GUIName_Attribute, guiName() );
+ root.setAttribute( XML::Description_Attribute, description() );
+ root.setAttribute( XML::ReadOnly_Attribute, readOnly() ? XML::BoolOn_Value : XML::BoolOff_Value );
+
+ QDomElement from = doc.createElement( XML::FromIP_Element );
+ root.appendChild( from );
+ QString num;
+ from.setAttribute( XML::Address_Attribute, address()->toString() );
+
+ QDomElement mask = doc.createElement( XML::NetMask_Element );
+ root.appendChild( mask );
+ mask.setAttribute( XML::Address_Attribute, maskLength() );
+
+ QPtrListIterator<KMFNetZone> it ( m_zones );
+ while ( it.current() ) {
+ root.appendChild( it.current() ->getDOMTree( ) );
+ ++it;
+ }
+
+ QPtrListIterator<KMFProtocolUsage> it2 ( m_protocols );
+ while ( it2.current() ) {
+ root.appendChild( it2.current() ->getDOMTree( ) );
+ ++it2;
+ }
+
+ QPtrListIterator<KMFTarget> it3 ( m_hosts );
+ while ( it3.current() ) {
+ root.appendChild( it3.current() ->getDOMTree( ) );
+ ++it3;
+ }
+
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+void KMFNetZone::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ // kdDebug() << "void KMFNetZone::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML( root, errors );
+}
+void KMFNetZone::loadXML( QDomNode root, QStringList& errors ) {
+// void KMFNetZone::loadXML( const QDomDocument& doc ) {
+ kdDebug() << "void KMFNetZone::loadXML( QDomNode root )" << endl;
+ NetfilterObject::loadUuid ( root, errors );
+// QDomElement root = doc.documentElement();
+ QString name = "";
+ QString guiName = "";
+ QString desc = "";
+ QString readonly = "";
+
+ name = root.toElement().attribute( XML::Name_Attribute );
+ guiName = root.toElement().attribute( XML::GUIName_Attribute );
+ desc = root.toElement().attribute( XML::Description_Attribute );
+ readonly = root.toElement().attribute( XML::ReadOnly_Attribute );
+ setDescription( *( new QString( desc ) ) );
+ // if (
+ setName( *( new QString( name ) ) );
+ setGuiName( *( new QString( guiName ) ) );
+
+ if ( readonly == XML::BoolOn_Value ) {
+ setReadOnly( true );
+ } else {
+ setReadOnly( false );
+ }
+
+ QValueList< KMFNetZone* > xmlDefinedZones;
+ QValueList< KMFTarget* > xmlDefinedTargets;
+ QValueList< KMFProtocolUsage* > xmlDefinedProtocols;
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ if ( curr.isElement() && ( curr.nodeName() == XML::FromIP_Element || curr.nodeName() == XML::NetMask_Element ) ) {
+ QString addr = curr.toElement().attribute( XML::Address_Attribute );
+ if ( curr.nodeName() == XML::FromIP_Element )
+ m_address->setAddress( addr );
+ if ( curr.nodeName() == XML::NetMask_Element ) {
+ bool ok;
+ int len = addr.toInt( &ok );
+ if ( ok ) {
+ setMaskLength( len );
+ } else {
+ kdDebug() << "Parsing mask failed" << endl;
+ }
+ }
+ }
+
+ if ( curr.isElement() && ( curr.nodeName() == XML::NetZone_Element ) ) {
+ QString name = "";
+ name = curr.toElement().attribute( XML::Name_Attribute );
+ kdDebug() << "KMFNetZone: parsing netzone: " << curr.toElement().attribute( XML::Name_Attribute ) << endl;
+ QDomDocument zone_doc;
+ zone_doc.appendChild( curr.cloneNode( true ) );
+
+ KMFNetZone *z = 0;
+ z = findNetZoneByName( name, true );
+ if ( ! z ) {
+ kdDebug() << "KMFNetZone: loadXML() - INFO: Zone: " << name << " not found in document, Will Create It." << endl;
+ z = addZone( name, m_err );
+ }
+ if ( z ) {
+ z->loadXML( curr, errors );
+ xmlDefinedZones.append( z );
+ }
+ }
+ if ( curr.isElement() && ( curr.nodeName() == XML::Protocol_Element ) ) {
+ // FIXME: Remove later
+ // Keep that for compatiblity
+ QString name = "";
+ name = curr.toElement().attribute( XML::Name_Attribute );
+ kdDebug() << "KMFNetZone: parsing protocol: " << curr.toElement().attribute( XML::Name_Attribute ) << endl;
+ QDomDocument protocol_doc;
+ protocol_doc.appendChild( curr.cloneNode( true ) );
+
+ KMFProtocol *p = KMFProtocolLibrary::instance()->findProtocolByName( name );
+ if ( ! p ) {
+ KMFUndoEngine::instance()->log( i18n("No Protocol Found by name: %1").arg( name ), KMFError::NORMAL, this );
+ continue;
+ }
+
+
+ KMFProtocolUsage *pu = addProtocolUsage( p->uuid(), protocol_doc );
+ if ( ! pu ) {
+ pu = findProtocolUsageByProtocolUuid( p->uuid() );
+ }
+ KMFUndoEngine::instance()->log( i18n("Adding xml protocol: %1").arg( pu->name() ), KMFError::OK, this );
+ xmlDefinedProtocols.append( pu );
+ }
+ if ( curr.isElement() && ( curr.nodeName() == XML::ProtocolUsage_Element ) ) {
+ QString protocolUuid = curr.toElement().attribute( XML::ProtocolUuid_Attribute );
+ kdDebug() << "KMFNetZone: parsing protocol: " << curr.toElement().attribute( XML::Name_Attribute ) << endl;
+ QDomDocument protocol_doc;
+ protocol_doc.appendChild( curr.cloneNode( true ) );
+ KMFProtocolUsage *pu = addProtocolUsage( protocolUuid, protocol_doc );
+ if ( ! pu ) {
+ pu = findProtocolUsageByProtocolUuid( protocolUuid );
+ }
+ KMFUndoEngine::instance()->log( i18n("Adding xml protocol: %1").arg( pu->name() ), KMFError::OK, this );
+ xmlDefinedProtocols.append( pu );
+
+ }
+ if ( curr.isElement() && ( curr.nodeName() == XML::NetHost_Element ) ) {
+ QString name = "";
+ name = curr.toElement().attribute( XML::Name_Attribute );
+ QDomDocument host_doc;
+ host_doc.appendChild( curr.cloneNode( true ) );
+ KMFNetHost *h = 0;
+ h = findNetHostByName( name, true );
+
+ if ( ! h ) {
+ kdDebug() << "KMFNetZone: loadXML() - INFO: Host: " << name << " not found in document, Will Create It." << endl;
+ h = addNetHost( name, host_doc );
+ }
+ if ( h ) {
+ h->loadXML( curr, errors );
+ xmlDefinedTargets.append( h );
+ }
+ }
+ if ( curr.isElement() && ( curr.nodeName() == XML::Target_Element ) ) {
+ QString name = curr.toElement().attribute( XML::Name_Attribute );
+ kdDebug() << "KMFNetZone: parsing target: " << curr.toElement().attribute( XML::Name_Attribute ) << endl;
+ KMFTarget *h = 0;
+ QDomDocument host_doc;
+ host_doc.appendChild( curr.cloneNode( true ) );
+ h = findTargetByName( name, true );
+ if ( ! h ) {
+ h = addTarget( name, host_doc );
+ }
+ if ( ! h ) {
+ kdDebug() << "KMFNetZone: loadXML() - ERROR: No Localhost found in document" << endl;
+ }
+ if ( h ) {
+ h->loadXML( host_doc, errors );
+ xmlDefinedTargets.append( h );
+ }
+ }
+ curr = curr.nextSibling();
+ }
+
+ {
+ QPtrList< KMFNetZone >& allZones = zones();
+ QPtrListIterator<KMFNetZone> itAllZones( allZones );
+ while( itAllZones.current() ) {
+ KMFNetZone *oldZone = itAllZones.current();
+ ++itAllZones;
+ bool found = false;
+ QValueList< KMFNetZone* >::iterator itZones;
+ for( itZones = xmlDefinedZones.begin(); itZones != xmlDefinedZones.end() && ! found; ++itZones ) {
+
+ KMFNetZone* z = *itZones;
+ if ( z == oldZone ) {
+ found = true;
+ }
+ }
+
+ if ( ! found ) {
+ KMFUndoEngine::instance()->log( i18n("Removing unused Zone: %1").arg( oldZone->guiName() ), KMFError::OK, this );
+ delZone( oldZone, true );
+ }
+ }
+ }
+ {
+ QPtrList< KMFTarget >& allTargets = hosts();
+ QPtrListIterator< KMFTarget > itAllTargets( allTargets );
+ while( itAllTargets.current() ) {
+ KMFTarget *oldTarget = itAllTargets.current();
+ ++itAllTargets;
+
+ bool found = false;
+ QValueList< KMFTarget* >::iterator itTargets;
+ for( itTargets = xmlDefinedTargets.begin(); itTargets != xmlDefinedTargets.end() && ! found; ++itTargets ) {
+ KMFTarget* t = *itTargets;
+ if ( t == oldTarget ) {
+ found = true;
+ }
+ }
+
+ if ( ! found ) {
+ KMFUndoEngine::instance()->log( i18n("Removing unused target: %1").arg( oldTarget->guiName() ), KMFError::OK, this );
+ delHost( oldTarget, true );
+ }
+ }
+ }
+
+
+
+ {
+ QPtrList< KMFProtocolUsage >& allprotocols = protocols();
+ QPtrListIterator< KMFProtocolUsage > itAllProtocols( allprotocols );
+ while( itAllProtocols.current() ) {
+ KMFProtocolUsage *oldProtocoUsagel = itAllProtocols.current();
+ ++itAllProtocols;
+ KMFUndoEngine::instance()->log( i18n("Existing protocol: %1").arg( oldProtocoUsagel->name() ), KMFError::OK, this );
+
+
+ bool found = false;
+ QValueList< KMFProtocolUsage* >::iterator itProtocols;
+ for( itProtocols = xmlDefinedProtocols.begin(); itProtocols != xmlDefinedProtocols.end() && ! found; ++itProtocols ) {
+ KMFProtocolUsage* protocolUsage = *itProtocols;
+ KMFUndoEngine::instance()->log( i18n("Compare with xml protocol: %1").arg( protocolUsage->name() ), KMFError::OK, this );
+ if ( protocolUsage == oldProtocoUsagel ) {
+ found = true;
+ }
+ }
+
+ if ( ! found ) {
+ KMFUndoEngine::instance()->log( i18n("Removing unused protocol: %1").arg( oldProtocoUsagel->name() ), KMFError::OK, this );
+ delProtocolUsage( oldProtocoUsagel, true );
+ // delHost( oldTarget, true );
+ }
+ }
+ }
+
+
+ changed();
+ kdDebug() << "KMFNetZone - finished parsing XML" << endl;
+}
+
+}
diff --git a/kmyfirewall/core/kmfnetzone.h b/kmyfirewall/core/kmfnetzone.h
new file mode 100644
index 0000000..79a59d4
--- /dev/null
+++ b/kmyfirewall/core/kmfnetzone.h
@@ -0,0 +1,185 @@
+//
+// C++ Interface: kmfnetzone
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFNETZONE_H
+#define KMFNETZONE_H
+
+#include "netfilterobject.h"
+
+// QT includes
+#include <qptrlist.h>
+#include <qguardedptr.h>
+#include <qstring.h>
+#include <quuid.h>
+#include <qobject.h>
+
+// KDE includes
+#include <kdemacros.h>
+
+// Project includes
+#include "ipaddress.h"
+
+namespace KMF {
+class KMFGenericDoc;
+class KMFProtocol;
+class KMFProtocolUsage;
+class KMFError;
+class KMFCheckInput;
+class IPAddress;
+class KMFNetHost;
+class KMFTarget;
+class KMFNetwork;
+
+//############ KMFNetZone #############
+class KDE_EXPORT KMFNetZone : public NetfilterObject {
+ Q_OBJECT
+public:
+ KMFNetZone( NetfilterObject *parent, const char* objectname, const QString& name );
+
+ virtual ~KMFNetZone();
+
+ virtual int type();
+ virtual void clear();
+
+ IPAddress* address() const {
+ return m_address;
+ };
+
+ int operator==( const KMFNetZone& );
+
+ bool isSameZone( KMFNetZone* );
+
+ IPAddress* mask() const {
+ IPAddress *addr = new IPAddress();
+ addr->setAddress( IPAddress::calcNetworkMaskFromLength( m_maskLen ).toString() );
+ return addr;
+ };
+
+ int maskLength() const {
+ return m_maskLen;
+ }
+
+ KMFGenericDoc* doc() const;
+ KMFNetwork* network() const;
+
+ KMFNetZone* zone() const;
+ KMFNetZone* rootZone();
+
+ int getZoneType() const {
+ return m_zoneType;
+ };
+
+ const QString& guiName() const {
+ return m_guiName;
+ };
+
+ virtual const QString& name();
+ const QString& generateName( const QString& );
+
+
+ void setGuiName( const QString& );
+
+ void setNetwork( KMFNetwork* );
+ void setZone( const IPAddress& , int );
+ void setParentZone( KMFNetZone* );
+ bool isRootZone();
+
+ void setMaskLength( int );
+
+
+
+ const QDomDocument& getDOMTree();
+ virtual void loadXML(const QDomDocument&, QStringList& errors );
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+ KMFNetZone* addZone( const QString& , KMFError* );
+ void delZone( KMFNetZone*, bool desructive = true );
+
+ KMFProtocolUsage* addProtocolUsage( const QUuid& uuid, const QDomDocument& xml );
+
+ void delProtocolUsage( KMFProtocolUsage*, bool desructive = true );
+
+ KMFNetHost* addNetHost( const QString& name, const QDomDocument& xml );
+ KMFTarget* addTarget( const QString& name, const QDomDocument& xml );
+
+ KMFTarget* findTargetByName( const QString& name, bool fromRoot = true );
+ KMFNetHost* findNetHostByName( const QString& name, bool fromRoot = true );
+ KMFNetZone* findNetZoneByName( const QString& name, bool fromRoot = true );
+
+ void delHost( KMFTarget*, bool desructive = true );
+
+ QPtrList<KMFProtocolUsage>& protocols() const;
+ QPtrList<KMFNetZone>& zones() const;
+ QPtrList<KMFTarget>& hosts() const;
+
+ KMFProtocolUsage* findProtocolUsageByProtocolUuid( const QUuid& uuid ) const;
+
+ bool protocolInherited( const QUuid& uuid ) const;
+
+ KMFTarget* placeHostInZone( KMFTarget* host );
+ KMFNetZone* placeZoneInZone( KMFNetZone* zone );
+ void refreshNetworkTree();
+
+ bool readOnly() const {
+ return m_readOnly;
+ };
+ void setReadOnly( bool );
+
+ QString toString();
+
+ enum { ROOT, NODE } Type;
+
+ void getAllTargets( KMFNetZone* zone, QPtrList<KMFTarget>* list );
+
+protected slots:
+ void slotOnProtocolUsageDeleted( QObject* protocol );
+
+private: // Methods
+ KMFTarget* findTargetByName_internal( const QString& name );
+ KMFNetZone* findNetZoneByName_internal( const QString& name );
+ QString zoneInfo();
+
+ void getAllZones( KMFNetZone* zone, QPtrList<KMFNetZone>* list );
+ void getAllHosts( KMFNetZone* zone, QPtrList<KMFTarget>* list );
+
+
+
+
+private: // Data
+ QGuardedPtr<KMFGenericDoc> m_doc;
+ QGuardedPtr<KMFNetZone> m_zone;
+ QGuardedPtr<KMFNetwork> m_network;
+ IPAddress* m_address;
+
+ QPtrList<KMFProtocolUsage> m_protocols;
+ QPtrList<KMFNetZone> m_zones;
+ QPtrList<KMFTarget> m_hosts;
+ KMFError *m_err;
+ int m_zoneType;
+ int m_maskLen;
+// bool m_deadEnd;
+ QString m_guiName;
+ bool m_readOnly;
+};
+}
+
+
+#endif
diff --git a/kmyfirewall/core/kmfnetzonelist.cpp b/kmyfirewall/core/kmfnetzonelist.cpp
new file mode 100644
index 0000000..11913ba
--- /dev/null
+++ b/kmyfirewall/core/kmfnetzonelist.cpp
@@ -0,0 +1,38 @@
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+#include "kmfnetzonelist.h"
+
+namespace KMF {
+
+KMFNetZoneList::KMFNetZoneList() : QPtrList<KMFNetZone>()
+{
+}
+
+
+KMFNetZoneList::~KMFNetZoneList()
+{
+}
+
+int KMFNetZoneList::compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) {
+ KMFNetZone* z1 = (KMFNetZone*) item1;
+ KMFNetZone* z2 = (KMFNetZone*) item2;
+ // KMFNetZone* z2 = static_cast<KMFNetZone>( *item2 );
+
+ if ( z1->maskLength() > z2->maskLength() ) {
+ return 1;
+ } else if ( z1->maskLength() == z2->maskLength() ){
+ return 0;
+ } else {
+ return -1;
+ }
+
+ return 0;
+}
+
+}
diff --git a/kmyfirewall/core/kmfnetzonelist.h b/kmyfirewall/core/kmfnetzonelist.h
new file mode 100644
index 0000000..aaa28e6
--- /dev/null
+++ b/kmyfirewall/core/kmfnetzonelist.h
@@ -0,0 +1,32 @@
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+#ifndef KMFNETZONELIST_H
+#define KMFNETZONELIST_H
+
+#include <qptrcollection.h>
+#include <qptrlist.h>
+
+#include "kmfnetzone.h"
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+
+namespace KMF {
+class KMFNetZoneList : public QPtrList<KMFNetZone>
+{
+public:
+ KMFNetZoneList();
+
+ ~KMFNetZoneList();
+
+protected:
+ virtual int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 );
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfplugin.cpp b/kmyfirewall/core/kmfplugin.cpp
new file mode 100644
index 0000000..f5fbe30
--- /dev/null
+++ b/kmyfirewall/core/kmfplugin.cpp
@@ -0,0 +1,93 @@
+//
+// C++ Implementation: kmfplugin
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfplugin.h"
+
+// QT includes
+#include <qwidget.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kdebug.h>
+
+// Project includes
+#include "kmyfirewallinterface.h"
+#include "kmfrulesetdoc.h"
+#include "kmfnetwork.h"
+#include "kmfgenericdoc.h"
+#include "kmfiptdoc.h"
+#include "kmfdoc.h"
+#include "kmferror.h"
+
+namespace KMF {
+
+KMFPlugin::KMFPlugin( QObject* parent , const char* name ) : KParts::Plugin( parent , name ) {
+ m_err = new KMFError();
+}
+
+KMFPlugin::~KMFPlugin() {
+ kdDebug() << "Calling Destructor: KMFPlugin::~KMFPlugin()" << endl;
+ delete m_err;
+}
+
+KMFNetwork* KMFPlugin::network() {
+ return KMyFirewallInterface::instance()->network();
+}
+
+KMFDoc* KMFPlugin::doc() {
+ return KMyFirewallInterface::instance()->network()->currentDoc();
+}
+
+KMFGenericDoc* KMFPlugin::genericDoc() {
+ KMFDoc *genDoc = KMyFirewallInterface::instance()->network()->currentDoc();
+ if ( KMFGenericDoc* doc = dynamic_cast<KMFGenericDoc*> ( genDoc ) ) {
+ kdDebug() << "Returning valid KMFGenericDoc pointer" << endl;
+ return doc;
+ }
+ return 0;
+}
+
+KMFIPTDoc* KMFPlugin::iptablesDoc() {
+ KMFDoc *genDoc = KMyFirewallInterface::instance()->network()->currentDoc();
+ if ( KMFIPTDoc* doc = dynamic_cast<KMFIPTDoc*> ( genDoc ) ) {
+ kdDebug() << "Returning KMFIPTDoc doc pointer" << endl;
+ return doc;
+ }
+ return 0;
+}
+
+KMFRulesetDoc* KMFPlugin::rulesetDoc() {
+ KMFDoc *genDoc = KMyFirewallInterface::instance()->network()->currentDoc();
+ if ( KMFRulesetDoc* doc = dynamic_cast<KMFRulesetDoc*> ( genDoc ) ) {
+ kdDebug() << "Returning KMFRulesetDoc doc pointer" << endl;
+ return doc;
+ }
+ return 0;
+}
+
+void KMFPlugin::setOutputWidget( QWidget* wid ) {
+ KMyFirewallInterface::instance()->setOutputWidget( wid );
+}
+
+void KMFPlugin::showEditor() {
+ KMyFirewallInterface::instance()->showEditor();
+}
+
+void KMFPlugin::showOutput() {
+ KMyFirewallInterface::instance()->showOutput();
+}
+
+void KMFPlugin::checkStatus() {
+ KMyFirewallInterface::instance()->checkStatus();
+}
+
+}
+
diff --git a/kmyfirewall/core/kmfplugin.h b/kmyfirewall/core/kmfplugin.h
new file mode 100644
index 0000000..1ce085c
--- /dev/null
+++ b/kmyfirewall/core/kmfplugin.h
@@ -0,0 +1,56 @@
+//
+// C++ Interface: kmfplugin
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFPLUGIN_H
+#define KMFPLUGIN_H
+
+// QT includes
+class QWidget;
+
+#include <qobject.h>
+
+// KDE includes
+#include <kparts/plugin.h>
+
+// Project includes
+
+namespace KMF {
+
+class KMFNetwork;
+class KMFRulesetDoc;
+class KMFGenericDoc;
+class KMFIPTDoc;
+class KMFDoc;
+class KMFError;
+
+/**
+@author Christian Hubinger
+*/
+
+class KDE_EXPORT KMFPlugin : public KParts::Plugin {
+public:
+ KMFPlugin( QObject* parent , const char* name );
+ virtual ~KMFPlugin();
+ void setOutputWidget( QWidget* wid );
+ void showEditor();
+ void showOutput();
+ void checkStatus();
+
+protected:
+ KMFRulesetDoc* rulesetDoc();
+ KMFGenericDoc* genericDoc();
+ KMFIPTDoc* iptablesDoc();
+ KMFNetwork* network();
+ KMFDoc* doc();
+ KMFError* m_err;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfpluginfactory.cpp b/kmyfirewall/core/kmfpluginfactory.cpp
new file mode 100644
index 0000000..089c334
--- /dev/null
+++ b/kmyfirewall/core/kmfpluginfactory.cpp
@@ -0,0 +1,224 @@
+//
+// C++ Implementation: kmfpluginfactory
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+// License: GPL
+//
+#include "kmfpluginfactory.h"
+
+// QT includes
+#include <qobject.h>
+
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <ktrader.h>
+#include <klibloader.h>
+#include <klocale.h>
+#include <kapplication.h>
+// project includes
+#include "kmfcompilerinterface.h"
+#include "kmfruleoptioneditinterface.h"
+#include "kmfruletargetoptioneditinterface.h"
+#include "kmfinstallerinterface.h"
+#include "kmftarget.h"
+#include "kmftargetconfig.h"
+#include "kmferror.h"
+#include "kmfconfig.h"
+
+namespace KMF {
+
+KMFPluginFactory::KMFPluginFactory() {}
+KMFPluginFactory::~KMFPluginFactory() {}
+
+
+KParts::ReadWritePart* KMFPluginFactory::KMFMainView( KParts::MainWindow* parent, KMFError* err ) {
+ err->setErrType( KMFError::OK );
+ QString libName;
+ if ( KMFConfig::useGenericInterface() ) {
+ kdDebug() << "Loading generic GUI" << endl;
+ libName = "libkmfgenericinterfacepart";
+ } else {
+ kdDebug() << "Loading iptables GUI" << endl;
+ libName = "libkmfipteditorpart";
+ }
+
+ KLibFactory * factory = KLibLoader::self() ->factory( libName.latin1() );
+ if ( factory ) {
+ KParts::ReadWritePart * m_ruleeditpart = static_cast<KParts::ReadWritePart *>( factory->create( parent,
+ libName.latin1() , "KParts::ReadWritePart" ) );
+
+ if ( m_ruleeditpart ) {
+ return m_ruleeditpart;
+ }
+ err->setErrType( KMFError::FATAL );
+ err->setErrMsg( i18n( "Could not cast plugin to type: KParts::ReadWritePart." ) );
+ return 0;
+ } else {
+ err->setErrType( KMFError::FATAL );
+ err->setErrMsg( i18n( "Could not find %1 in the library search path." ).arg( libName ) );
+ return 0;
+ }
+ err->setErrType( KMFError::FATAL );
+ err->setErrMsg( i18n( "Could not find libkmfgenericinterfacepart in the library search path." ) );
+ return 0;
+}
+
+
+
+
+
+
+
+QValueList<KMFCompilerInterface*>* KMFPluginFactory::CompilersForInstaller( const QString& osName ) {
+ QValueList<KMFCompilerInterface*> *list = new QValueList<KMFCompilerInterface*>();
+ kdDebug() << "Query: KMyFirewall/Compiler [X-KMyFirewall-Platform] == '" << osName.lower() << "'" << endl;
+ KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/Compiler", "[X-KMyFirewall-Platform] == '" + osName.lower() + "'");
+ KTrader::OfferList::iterator it;
+ if ( offers.empty() ) {
+ kdDebug() << "NO MATCHING PLUGIN FOUND - KMyFirewall/Compiler" << endl;
+ }
+ for ( it = offers.begin(); it != offers.end(); ++it ) {
+ KService::Ptr ptr = *it;
+ KLibFactory *factory = KLibLoader::self()->factory( ptr->library().local8Bit().data() );
+ kdDebug() << KLibLoader::self()->lastErrorMessage() << endl;
+
+ if ( !factory ) {
+ kdDebug() << "Couldn't load plugin: " << ptr->name() << endl;
+ }
+
+ if ( KMFCompilerInterface *part = dynamic_cast<KMFCompilerInterface*> ( factory->create( 0 , "KMFCompilerInterface") ) ) {
+ list->append ( part );
+
+ }
+ }
+ return list;
+}
+
+QPtrList<KMFRuleOptionEditInterface>* KMFPluginFactory::KMFRuleOptionEditors( QObject *parent ){
+ QPtrList<KMFRuleOptionEditInterface> *list = new QPtrList<KMFRuleOptionEditInterface>;
+ KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/RuleOptionEdit");
+ kdDebug() << "Query performed" << endl;
+
+ KTrader::OfferList::iterator it;
+ for ( it = offers.begin(); it != offers.end(); ++it ) {
+ KService::Ptr ptr = *it;
+ kdDebug() << "Found KMFRuleOptionEdit Plugin: " << ptr->name() << "\nLibrary: "<< ptr->library().local8Bit().data() <<endl;
+ KLibFactory *factory = KLibLoader::self()->factory( ptr->library().local8Bit().data() );
+ kdDebug() << "KLibLoader::self()->lastErrorMessage() " << KLibLoader::self()->lastErrorMessage() << endl;
+ if ( !factory ) {
+ kdDebug() << "Couldn't load plugin: " << ptr->name() << endl;
+ }
+ if ( KMFRuleOptionEditInterface *part = dynamic_cast<KMFRuleOptionEditInterface*> ( factory->create( parent , "KMFRuleOptionEditInterface") ) ) {
+ if ( ! part ) {
+ KMessageBox::error(0, "Couldn't load plugin");
+ }
+ list->append( part );
+ kdDebug() << "Initialiesed Plugin." << endl;
+ }
+ }
+ return list;
+}
+
+QPtrList<KMFRuleTargetOptionEditInterface>* KMFPluginFactory::KMFRuleTargetOptionEditors( QObject *parent ) {
+ QPtrList<KMFRuleTargetOptionEditInterface> *list = new QPtrList<KMFRuleTargetOptionEditInterface>;
+ KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/RuleTargetOptionEdit");
+ kdDebug() << "Query performed" << endl;
+
+ KTrader::OfferList::iterator it;
+ for ( it = offers.begin(); it != offers.end(); ++it ) {
+ KService::Ptr ptr = *it;
+ kdDebug() << "Found KMFRuleTargetOptionEdit Plugin: " << ptr->name() << "\nLibrary: "<< ptr->library().local8Bit().data() <<endl;
+ KLibFactory *factory = KLibLoader::self()->factory( ptr->library().local8Bit().data() );
+ kdDebug() << "KLibLoader::self()->lastErrorMessage(): " << KLibLoader::self()->lastErrorMessage() << endl;
+ if ( !factory ) {
+ kdDebug() << "Couldn't load plugin: " << ptr->name() << endl;
+ }
+ if ( KMFRuleTargetOptionEditInterface *part = dynamic_cast<KMFRuleTargetOptionEditInterface*> ( factory->create( parent , "KMFRuleTargetOptionEditInterface") ) ) {
+ if ( ! part ) {
+ KMessageBox::error(0, "Couldn't load plugin");
+ }
+ list->append( part );
+ kdDebug() << "Initialiesed Plugin." << endl;
+ }
+ }
+ return list;
+}
+
+KMFInstallerInterface* KMFPluginFactory::KMFInstaller( KMFTarget* target ) {
+
+ KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/Installer", " [X-KMyFirewall-Platform] == '"+ target->config()->oS().lower() +"'" );
+ kdDebug() << "Query performed" << endl;
+ KService::Ptr ptr = offers.first();
+ KTrader::OfferList::iterator it;
+ if ( offers.empty() ) {
+ kdDebug() << "NO MATCHING PLUGIN FOUND" << endl;
+ return 0;
+ }
+ kdDebug() << "KMFPluginFactory found Plugin: " << ptr->name() << "\nLibrary: "<< ptr->library().local8Bit().data() <<endl;
+ KLibFactory *factory = KLibLoader::self()->factory( ptr->library().local8Bit().data() );
+ kdDebug() << "KLibLoader::self()->lastErrorMessage(): " << KLibLoader::self()->lastErrorMessage() << endl;
+
+ if ( !factory ) {
+ kdDebug() << "Couldn't load plugin: " << ptr->name() << endl;
+ return 0;
+ }
+ if ( KMFInstallerInterface *part = dynamic_cast<KMFInstallerInterface*> ( factory->create( KApplication::kApplication() , "KMFInstallerInterface") )
+ ) {
+ if ( ! part ) {
+ KMessageBox::error(0, "Couldn't load plugin");
+ return 0;
+ }
+// kdDebug() << "Returning KMFInstallerInterface" << endl;
+ return part;
+ }
+ kdDebug() << "Returning 0-Pointer" << endl;
+ return 0;
+}
+
+KMFCompilerInterface* KMFPluginFactory::KMFCompiler( KMFTarget* target ) {
+ kdDebug() << "KMFCompilerInterface* KMFGenericDoc::compiler()" << endl;
+ kdDebug() << "Start query" << endl;
+ KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/Compiler", "[X-KMyFirewall-Language] == '" + target->config()->backend().lower() +"' and [X-KMyFirewall-Platform] == '" + target->config()->oS().lower() + "'" );
+ kdDebug() << "Query performed" << endl;
+ KService::Ptr ptr = offers.first();
+ KTrader::OfferList::iterator it;
+ if ( offers.empty() ) {
+ KMessageBox::error(0, i18n("<qt><b>Could not find a matching compiler plugin.</b></qt>") );
+ kdDebug() << "NO MATCHING PLUGIN FOUND" << endl;
+ return 0;
+ }
+ kdDebug() << "KMFGenericDoc found Plugin: " << ptr->name() << "\nLibrary: "<< ptr->library().local8Bit().data() <<endl;
+ KLibFactory *factory = KLibLoader::self()->factory( ptr->library().local8Bit().data() );
+ kdDebug() << "KLibLoader::self()->lastErrorMessage(): " << KLibLoader::self()->lastErrorMessage() << endl;
+
+ if ( !factory ) {
+ KMessageBox::error( 0, i18n("<qt><b>Compiler plugin could not be loaded.</b></qt>") );
+ kdDebug() << "Couldn't load plugin: " << ptr->name() << endl;
+ return 0;
+ }
+
+ if ( KMFCompilerInterface *part = dynamic_cast<KMFCompilerInterface*> ( factory->create( KApplication::kApplication() , "KMFCompilerInterface" ) ) ) {
+ kdDebug() << "Returning Compiler Plugin." << endl;
+ return part;
+ }
+ return 0;
+}
+
+
+}
+
+
+
+
+
diff --git a/kmyfirewall/core/kmfpluginfactory.h b/kmyfirewall/core/kmfpluginfactory.h
new file mode 100644
index 0000000..2d37963
--- /dev/null
+++ b/kmyfirewall/core/kmfpluginfactory.h
@@ -0,0 +1,57 @@
+//
+// C++ Interface: kmfpluginfactory
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+// License: GPL
+//
+#ifndef KMFPLUGINFACTORY_H
+#define KMFPLUGINFACTORY_H
+
+/**
+@author Christian Hubinger
+*/
+// QT includes
+#include <qstring.h>
+#include <qptrlist.h>
+#include <qvaluelist.h>
+// KDE includes
+// #include <kparts>
+#include <kparts/part.h>
+#include <kparts/mainwindow.h>
+
+class QObject;
+namespace KMF {
+class KMFTarget;
+class KMFError;
+class KMFCompilerInterface;
+class KMFInstallerInterface;
+class KMFRuleOptionEditInterface;
+class KMFRuleTargetOptionEditInterface;
+
+
+class KDE_EXPORT KMFPluginFactory {
+ friend class KMFTarget;
+private:
+ KMFPluginFactory();
+ ~KMFPluginFactory();
+public:
+static QPtrList<KMFRuleOptionEditInterface>* KMFRuleOptionEditors( QObject *parent );
+
+static QPtrList<KMFRuleTargetOptionEditInterface>* KMFRuleTargetOptionEditors( QObject *parent );
+static QValueList<KMFCompilerInterface*>* CompilersForInstaller( const QString& osName );
+
+static KParts::ReadWritePart* KMFMainView( KParts::MainWindow* parent, KMFError* err );
+
+private:
+static KMFCompilerInterface* KMFCompiler( KMFTarget* );
+static KMFInstallerInterface* KMFInstaller( KMFTarget* );
+
+
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfprotocol.cpp b/kmyfirewall/core/kmfprotocol.cpp
new file mode 100644
index 0000000..2fe4dbf
--- /dev/null
+++ b/kmyfirewall/core/kmfprotocol.cpp
@@ -0,0 +1,311 @@
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfprotocol.h"
+
+// QT includes
+#include <qfile.h>
+#include <qdir.h>
+#include <qdom.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kio/netaccess.h>
+#include <kio/job.h>
+#include <ktrader.h>
+#include <klibloader.h>
+#include <ktempfile.h>
+#include <kfileitem.h>
+
+// project includes
+#include "../version.h"
+#include "xmlnames.h"
+#include "kmfundoengine.h"
+#include "kmferror.h"
+#include "kmferrorhandler.h"
+#include "kmfgenericdoc.h"
+#include "kmfnetzone.h"
+#include "kmfnethost.h"
+#include "kmfprotocolcategory.h"
+#include "kmfprotocolusage.h"
+
+namespace KMF {
+
+KMFProtocol::KMFProtocol( KMFProtocolCategory* protCat, const char* name ) : NetfilterObject( protCat, name ) {
+ // kdDebug() << "KMFProtocol::KMFProtocol( NetfilterObject* parent, const char* name )" << endl;
+ m_category = protCat;
+ m_customProtocol = true;
+ m_tcpPorts.clear();
+ m_udpPorts.clear();
+/* m_udpPorts = new QValueList<int>;
+ m_tcpPorts = new QValueList<int>;*/
+}
+
+
+KMFProtocol::~KMFProtocol() {
+ kdDebug() << "KMFProtocol::~KMFProtocol()" << endl;
+ m_tcpPorts.clear();
+ m_udpPorts.clear();
+
+}
+
+int KMFProtocol::type() {
+ // kdDebug() << "KMFProtocol::type()" << endl;
+ return NetfilterObject::PROTOCOL;
+}
+
+void KMFProtocol::clear() {
+ m_tcpPorts.clear();
+ m_udpPorts.clear();
+}
+
+
+void KMFProtocol::setCategory( KMFProtocolCategory* protCat ) {
+
+ m_category = protCat;
+
+}
+
+const QString& KMFProtocol::tcpPortsList() {
+ kdDebug() << "void KMFProtocol::tcpPortsList()" << endl;
+ kdDebug() << "Contains: " << tcpPorts().size() << " ports" << endl;
+ QStringList *l = new QStringList();
+ QValueList<int>::iterator it;
+ for ( it = tcpPorts().begin(); it != tcpPorts().end(); ++it ) {
+ QString s = "";
+ s.setNum( *it );
+ *l << s;
+ }
+
+ return *(new QString( l->join(",") ) );
+}
+
+const QString& KMFProtocol::udpPortsList() {
+ kdDebug() << "void KMFProtocol::udpPortsList()" << endl;
+ kdDebug() << "Contains: " << m_udpPorts.size() << " ports" << endl;
+ QStringList *l = new QStringList();
+ QValueList<int>::iterator it;
+ for ( it = m_udpPorts.begin(); it != m_udpPorts.end(); ++it ) {
+ QString s = "";
+ s.setNum( *it );
+ *l << s;
+ }
+ return *(new QString( l->join(",") ) );
+}
+
+void KMFProtocol::addPort( const QString& port, int protocol ) {
+ // kdDebug() << "void KMFProtocol::addPort( const QString& )" << endl;
+ if ( protocol == UDP && udpPorts().contains( port.toInt() ) == 0 ) {
+ kdDebug() << " + + + Register UDP Port:" << port << endl;
+ udpPorts().append( port.toInt() );
+ qHeapSort( udpPorts() );
+ changed();
+ return;
+ }
+ if ( protocol == TCP && tcpPorts().contains( port.toInt() ) == 0 ) {
+ kdDebug() << " + + + Register TCP Port:" << port << endl;
+ tcpPorts().append( port.toInt() );
+ qHeapSort( tcpPorts() );
+ changed();
+ return;
+ }
+ kdDebug() << "WARNING: ignoring duplicate port entry: " << port << " in protocol: " << name() << endl;
+
+}
+
+void KMFProtocol::delPort( const QString& port, int protocol ) {
+ kdDebug() << "void KMFProtocol::delPort( const QString& )" << endl;
+ if ( protocol == UDP && udpPorts().contains( port.toInt() ) > 0 ) {
+ kdDebug() << "KMFProtocol: " << name() << " Unregister UDP Port:" << port << endl;
+ udpPorts().remove( udpPorts().find( port.toInt() ) );
+ qHeapSort( udpPorts() );
+ changed();
+ } else if ( protocol == TCP && tcpPorts().contains( port.toInt() ) > 0 ) {
+ kdDebug() << "KMFProtocol: " << name() << " Unregister TCP Port:" << port << endl;
+ tcpPorts().remove( tcpPorts().find( port.toInt() ) );
+ qHeapSort( tcpPorts() );
+ changed();
+ } else {
+ kdDebug() << "WARNING: no entry found to remove port: " << port << " from protocol: " << name() << endl;
+ }
+}
+
+void KMFProtocol::setCustomProtocol( bool onoff ){
+// kdDebug() << "void KMFProtocol::setCustomProtocol( bool )" << endl;
+ if( onoff != m_customProtocol ) {
+ m_customProtocol = onoff;
+ changed();
+ }
+}
+
+bool KMFProtocol::isEquivalent( KMFProtocol *other ){
+ kdDebug() << "void KMFProtocol::isEquivalent( KMFProtocol& other )" << endl;
+ kdDebug() << "Comparing: " << name() << " with: " << other->name() << endl;
+ if ( tcpPorts().size() != other->tcpPorts().size() ) {
+ kdDebug() << "Have different TCP port count." << endl;
+ return false;
+ }
+
+ QValueList<int>::iterator itTcp;
+ for( itTcp = tcpPorts().begin(); itTcp != tcpPorts().end(); ++itTcp ) {
+ if ( other->tcpPorts().contains( *itTcp ) == 0 ) {
+ kdDebug() << "TCP port " << *itTcp << " not found in other protocol." << endl;
+ return false;
+ }
+ }
+
+ if ( udpPorts().size() != other->udpPorts().size() ) {
+ kdDebug() << "Have different UDP port count." << endl;
+ return false;
+ }
+ QValueList<int>::iterator itUdp;
+ for( itUdp = udpPorts().begin(); itUdp != udpPorts().end(); ++itUdp ) {
+ if ( other->udpPorts().contains( *itUdp ) == 0 ) {
+ kdDebug() << "UDP port " << *itUdp << " not found in other protocol." << endl;
+ return false;
+ }
+ }
+ kdDebug() << "Protocol: " << name() << " is Equivalent to protocol: " << other->name() << endl;
+ return true;
+}
+
+bool KMFProtocol::replaceTCPPort( int oldPort, int newPort ){
+ kdDebug() << "void KMFProtocol::replaceTCPPort( int " << oldPort << ", int " << newPort << " )" << endl;
+
+ if ( tcpPorts().contains( newPort ) > 0 ) {
+ kdDebug() << "WARNING: ignoring duplicate port entry: " << newPort << " in protocol: " << name() << endl;
+ return false;
+ }
+
+ int index = tcpPorts().findIndex( oldPort );
+ kdDebug() << "Found Port at: " << index << endl;
+ if ( index == -1 ) {
+ kdDebug() << "WARNING: port entry: " << oldPort << "not found in protocol: " << name() << endl;
+ return false;
+ }
+
+ *tcpPorts().at( index ) = newPort;
+ qHeapSort( tcpPorts() );
+ changed();
+ return true;
+}
+bool KMFProtocol::replaceUDPPort( int oldPort, int newPort ){
+ kdDebug() << "void KMFProtocol::replaceUDPPort( int " << oldPort << ", int " << newPort << " )" << endl;
+
+ if ( m_udpPorts.contains( newPort ) > 0 ) {
+ kdDebug() << "WARNING: ignoring duplicate port entry: " << newPort << " in protocol: " << name() << endl;
+ return false;
+ }
+
+ int index = udpPorts().findIndex( oldPort );
+ kdDebug() << "Found Port at: " << index << endl;
+ if ( index == -1 ) {
+ kdDebug() << "WARNING: port entry: " << oldPort << "not found in protocol: " << name() << endl;
+ return false;
+ }
+
+ *udpPorts().at( index ) = newPort;
+ qHeapSort( m_udpPorts );
+ changed();
+ return true;
+}
+
+KMFProtocolUsage *KMFProtocol::createUsage() {
+ KMFProtocolUsage *use = new KMFProtocolUsage( this, "KMFProtocolUsage" );
+ use->setProtocol( this );
+ m_usages.append( use );
+ return use;
+}
+
+const QDomDocument& KMFProtocol::getDOMTree() {
+// kdDebug() << "const QDomDocument& KMFProtocol::getDOMTree()" << endl;
+ QDomDocument doc;
+ QDomElement root = doc.createElement( XML::Protocol_Element );
+ NetfilterObject::saveUuid( root );
+
+ root.setAttribute( XML::Name_Attribute, name() );
+ root.setAttribute( XML::Description_Attribute, description() );
+ QValueList<int>::iterator it;
+ kdDebug() << "Serializte ports: " << udpPortsList() << endl;
+ for ( it = udpPorts().begin(); it != udpPorts().end(); ++it ) {
+ QDomElement port = doc.createElement( XML::Port_Element );
+ root.appendChild( port );
+ port.setAttribute( XML::Num_Attribute,*it);
+ port.setAttribute( XML::Protocol_Attribute , XML::UDP_Value );
+ }
+ kdDebug() << "Serializte ports: " << tcpPortsList() << endl;
+ for ( it = tcpPorts().begin(); it != tcpPorts().end(); ++it ) {
+ QDomElement port = doc.createElement( XML::Port_Element );
+ root.appendChild( port );
+ port.setAttribute( XML::Num_Attribute,*it);
+ port.setAttribute( XML::Protocol_Attribute ,XML::TCP_Value );
+ }
+
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+
+void KMFProtocol::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ // kdDebug() << "void KMFProtocol::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML( root, errors );
+}
+void KMFProtocol::loadXML( QDomNode root, QStringList& errors ) {
+// kdDebug() << "void KMFProtocol::loadXML( QDomNode root )" << endl;
+
+ // Protocols use Fixed Guids
+ NetfilterObject::loadUuid( root, errors );
+
+ QString name = "";
+ QString logging = "";
+ QString desc = "";
+ QString limit = "";
+ QString io = "";
+
+ name = root.toElement().attribute( XML::Name_Attribute );
+ desc = root.toElement().attribute( XML::Description_Attribute );
+
+ setDescription( *( new QString( desc ) ) );
+ setName( *(new QString( name ) ) );
+
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ if ( curr.isElement() && curr.nodeName() == XML::Port_Element ) {
+ QString port = curr.toElement().attribute( XML::Num_Attribute );
+ QString protocol = curr.toElement().attribute( XML::Protocol_Attribute );
+ if ( protocol == XML::UDP_Value ) {
+ addPort( port, UDP );
+ }
+ if ( protocol == XML::TCP_Value ) {
+ addPort( port, TCP );
+ }
+ }
+ curr = curr.nextSibling();
+ }
+ changed();
+}
+
+}
diff --git a/kmyfirewall/core/kmfprotocol.h b/kmyfirewall/core/kmfprotocol.h
new file mode 100644
index 0000000..d47b64b
--- /dev/null
+++ b/kmyfirewall/core/kmfprotocol.h
@@ -0,0 +1,111 @@
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFPROTOCOL_H
+#define KMFPROTOCOL_H
+
+#include "netfilterobject.h"
+
+// QT includes
+#include <qstringlist.h>
+#include <qstring.h>
+#include <qguardedptr.h>
+#include <qptrlist.h>
+#include <qvaluelist.h>
+#include <qmap.h>
+
+// KDE includes
+#include <kdemacros.h>
+#include <kurl.h>
+
+// Project includes
+#include "kmfprotocolcategory.h"
+
+/**
+@author Christian Hubinger
+*/
+
+namespace KMF {
+class KMFGenericDoc;
+class KMFNetZone;
+class KMFError;
+class KMFProtocolCategory;
+class KMFProtocolUsage;
+
+class KDE_EXPORT KMFProtocol : public NetfilterObject {
+ friend class KMFProtocolCategory;
+
+public:
+
+ ~KMFProtocol();
+ virtual int type();
+ virtual void clear();
+
+ void addPort( const QString& , int );
+ void delPort( const QString&, int );
+ void setCustomProtocol( bool );
+ void setCategory( KMFProtocolCategory* );
+
+ virtual const QDomDocument& getDOMTree();
+ virtual void loadXML(const QDomDocument&, QStringList& errors );
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+ bool customProtocol() const {
+ return m_customProtocol;
+ };
+
+ KMFProtocolCategory* category() const {
+ return m_category;
+ }
+
+ QValueList<int>& udpPorts() {
+ return m_udpPorts;
+ }
+
+ QValueList<int>& tcpPorts() {
+ return m_tcpPorts;
+ }
+
+
+ const QString& udpPortsList();
+ const QString& tcpPortsList();
+
+ bool replaceTCPPort( int oldPort, int newPort );
+ bool replaceUDPPort( int oldPort, int newPort );
+
+ bool isEquivalent( KMFProtocol *other );
+
+ enum { TCP, UDP /*, ICMP */ } Protocol;
+
+ KMFProtocolUsage *createUsage();
+
+private:
+ KMFProtocol( KMFProtocolCategory* parent, const char* name );
+
+private:
+ QValueList<KMFProtocolUsage*> m_usages;
+ KMFProtocolCategory* m_category;
+ QValueList<int> m_udpPorts;
+ QValueList<int> m_tcpPorts;
+ bool m_customProtocol;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfprotocolcategory.cpp b/kmyfirewall/core/kmfprotocolcategory.cpp
new file mode 100644
index 0000000..dadfd9a
--- /dev/null
+++ b/kmyfirewall/core/kmfprotocolcategory.cpp
@@ -0,0 +1,239 @@
+//
+// C++ Implementation: kmfprotocolcategory
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfprotocolcategory.h"
+
+// QT includes
+#include <qdom.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "kmfundoengine.h"
+#include "kmfprotocol.h"
+#include "kmfprotocollibrary.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+/* Never Ever Change This Uuids! */
+const QUuid& KMFProtocolCategory::customCategoryUuid() {
+ return *(new QUuid( "{9758012f-e2a0-4594-938f-c154a7078752}" ) );
+};
+const QUuid& KMFProtocolCategory::miscCategoryUuid() {
+ return *(new QUuid( "{02e7113c-535d-447d-8a25-5c9e89fd3f79}" ) );
+};
+
+
+KMFProtocolCategory* KMFProtocolCategory::createCategory( const QString& name ) {
+ KMFProtocolCategory* cat = new KMFProtocolCategory( 0, name.latin1() );
+ cat->setName( name );
+ return cat;
+}
+
+KMFProtocol* KMFProtocolCategory::createProtocol( const QString& name ) {
+ KMFProtocol* prot = new KMFProtocol( this, name.latin1() );
+ addProtocol( prot );
+ return prot;
+}
+
+KMFProtocolCategory* KMFProtocolCategory::getCustomCategory() {
+ KMFProtocolCategory* catCustom = KMFProtocolLibrary::instance()->findCategory( KMFProtocolCategory::customCategoryUuid() );
+ if ( ! catCustom ) {
+ catCustom = KMFProtocolCategory::createCategory( i18n("Custom Protocols") );
+ catCustom->setUuid( KMFProtocolCategory::customCategoryUuid().toString() );
+ }
+ return catCustom;
+}
+
+
+
+KMFProtocolCategory::KMFProtocolCategory ( NetfilterObject* parent, const char* name ) : NetfilterObject ( parent, name ) {
+ // m_protocols;
+}
+
+KMFProtocolCategory::~KMFProtocolCategory() {}
+
+int KMFProtocolCategory::type() {
+ return NetfilterObject::PROTOCOLCATEGORY;
+}
+
+void KMFProtocolCategory::clear() {
+}
+
+
+QValueList<KMFProtocol*>& KMFProtocolCategory::protocols() const {
+ QValueList<KMFProtocol*>* ret_val = new QValueList<KMFProtocol*>;
+ *ret_val = m_protocols;
+ return *ret_val;
+}
+
+
+KMFProtocol* KMFProtocolCategory::findProtocolByName ( const QString& name ) const {
+ // kdDebug() << "KMFProtocol* KMFProtocolCategory::findProtocolByName( const QString& name ) const" << endl;
+ QValueList< KMFProtocol* >::const_iterator it;
+ for ( it = m_protocols.constBegin(); it != m_protocols.constEnd(); ++it ) {
+ KMFProtocol *p = *it;
+ if ( p->name() == name ) {
+ return p;
+ }
+ }
+ return 0;
+}
+KMFProtocol* KMFProtocolCategory::findProtocolByUuid ( const QUuid& uuid ) const {
+// kdDebug() << "KMFProtocol* KMFProtocolCategory::findProtocolByUuid( const QUuid& uuid ) const" << endl;
+ QValueList< KMFProtocol* >::const_iterator it;
+ for ( it = m_protocols.constBegin(); it != m_protocols.constEnd(); ++it ) {
+ KMFProtocol *p = *it;
+ if ( p->uuid() == uuid ) {
+ return p;
+ }
+ }
+ return 0;
+}
+
+KMFProtocol* KMFProtocolCategory::addProtocol ( KMFProtocol* proto ) {
+ // kdDebug() << "KMFProtocol* KMFProtocolCategory::addProtocol( KMFProtocol* " << proto->name() << " )" << endl;
+ // proto->category()->delProtocol( proto );
+ m_protocols.append ( proto );
+ proto->setCategory( this );
+ return proto;
+}
+
+void KMFProtocolCategory::delProtocol ( KMFProtocol* prot, bool destructive = false ) {
+// kdDebug() << "void KMFProtocolCategory::delProtocol( KMFProtocol* prot )" << endl;
+ QValueList<KMFProtocol*>::iterator it;
+ for ( it = m_protocols.begin(); it != m_protocols.end(); ++it ) {
+ KMFProtocol *p = *it;
+ if ( p->name() == prot->name() ) {
+ kdDebug() << "Delete protocol: " << prot->name() << " from category: " << name() << endl;
+ m_protocols.remove( p );
+ if ( destructive ) {
+ p->deleteLater();
+ }
+
+ changed();
+ return;
+
+ }
+ }
+ changed();
+}
+
+void KMFProtocolCategory::slotOnProtocolDeleted( QObject* prot ) {
+ kdDebug() << "KMFProtocolCategory::slotOnProtocolDeleted( QObject* )" << endl;
+ QValueList<KMFProtocol*>::iterator it;
+ for ( it = m_protocols.begin(); it != m_protocols.end(); ++it ) {
+ KMFProtocol *p = *it;
+ if ( p == prot ) {
+ kdDebug() << "Delete protocol from category: " << name() << endl;
+ m_protocols.remove( p );
+ changed();
+ return;
+ }
+ }
+ // deleteLater();
+}
+
+const QDomDocument& KMFProtocolCategory::getDOMTree() {
+ kdDebug() << "const QDomDocument& KMFProtocolCategory::getDOMTree() " << endl;
+ QDomDocument doc;
+ QDomElement root = doc.createElement ( XML::ProtocolCategory_Element );
+ NetfilterObject::saveUuid ( root );
+
+ root.setAttribute ( XML::Name_Attribute, name() );
+ root.setAttribute ( XML::Description_Attribute, description() );
+
+ QValueList< KMFProtocol* >::iterator it;
+ for ( it = m_protocols.begin(); it != m_protocols.end(); ++it ) {
+ KMFProtocol* p = *it;
+ if ( p->customProtocol() ) {
+ root.appendChild ( (*it)->getDOMTree( ) );
+ }
+ }
+ doc.appendChild ( root );
+ return * ( new QDomDocument ( doc ) );
+}
+
+void KMFProtocolCategory::loadXML ( const QDomDocument& doc, QStringList& errors ) {
+ // kdDebug() << "void KMFProtocolCategory::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML ( root, errors );
+}
+
+void KMFProtocolCategory::loadXML ( QDomNode root, QStringList& errors ) {
+// kdDebug() << "void KMFProtocolCategory::loadXML( QDomNode root )" << endl;
+ NetfilterObject::loadUuid ( root, errors );
+
+ setName( root.toElement().attribute ( XML::Name_Attribute ) );
+ setDescription( root.toElement().attribute ( XML::Description_Attribute ) );
+
+ QValueList< KMFProtocol* > xmlDefinedProtocols;
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ if ( curr.isElement() && ( curr.nodeName() == XML::Protocol_Element ) ) {
+ QString name = curr.toElement().attribute ( XML::Name_Attribute );
+ QString uuid = curr.toElement().attribute ( XML::Uuid_Attribute );
+ KMFProtocol *p = findProtocolByUuid( uuid );
+ if ( ! p ) {
+ p = createProtocol( name );
+ kdDebug() << " + + Register Protocol: " << name << " with uuid: " << uuid << endl;
+ QDomDocument protocol;
+ protocol.appendChild( curr.cloneNode( true ) );
+ QStringList *errors = new QStringList();
+ p->loadXML( protocol, *errors );
+ }
+ xmlDefinedProtocols.append ( p );
+ }
+// if ( curr.isElement() && ( curr.nodeName() == XML::ProtocolUsage_Element ) ) {
+// QString uuid = curr.toElement().attribute ( XML::ProtocolUuid_Attribute );
+// KMFProtocol *p = findProtocolByUuid( uuid );
+// if ( ! p ) {
+// p = createProtocol( curr.toElement().attribute ( XML::Name_Attribute ) );
+// QDomDocument protocol;
+// protocol.appendChild( curr.cloneNode( true ) );
+// QStringList *errors = new QStringList();
+// p->loadXML( protocol, *errors );
+// }
+// xmlDefinedProtocols.append ( p );
+// }
+ curr = curr.nextSibling();
+ }
+
+// {
+// QValueList< KMFProtocol* >& allprotocols = protocols();
+// QValueList< KMFProtocol* >::iterator itAllProtocols;
+// for ( itAllProtocols = allprotocols.begin(); itAllProtocols != allprotocols.end(); ++itAllProtocols ) {
+// KMFProtocol *oldProtocol = *itAllProtocols;
+//
+// bool found = false;
+// QValueList< KMFProtocol* >::iterator itProtocols;
+// for ( itProtocols = xmlDefinedProtocols.begin(); itProtocols != xmlDefinedProtocols.end() && ! found; ++itProtocols ) {
+// KMFProtocol* p = *itProtocols;
+// if ( p == oldProtocol ) {
+// found = true;
+// }
+// }
+//
+// if ( ! found ) {
+// KMFUndoEngine::instance()->log ( i18n ( "Removing unused protocol: %1" ).arg ( oldProtocol->name() ), KMFError::OK, this );
+// delProtocol ( oldProtocol );
+// }
+// }
+// }
+ changed();
+}
+
+}
+
+
diff --git a/kmyfirewall/core/kmfprotocolcategory.h b/kmyfirewall/core/kmfprotocolcategory.h
new file mode 100644
index 0000000..5358898
--- /dev/null
+++ b/kmyfirewall/core/kmfprotocolcategory.h
@@ -0,0 +1,86 @@
+//
+// C++ Interface: kmfprotocolcategory
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFPROTOCOLCATEGORY_H
+#define KMFPROTOCOLCATEGORY_H
+
+#include "netfilterobject.h"
+
+// QT includes
+#include <qstringlist.h>
+#include <qstring.h>
+#include <qguardedptr.h>
+#include <qvaluelist.h>
+#include <qmap.h>
+#include <quuid.h>
+#include <qobject.h>
+
+// KDE includes
+#include <kdemacros.h>
+#include <kurl.h>
+
+namespace KMF {
+class KMFProtocol;
+
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+
+class KDE_EXPORT KMFProtocolCategory : public NetfilterObject
+{
+Q_OBJECT
+public:
+ static KMFProtocolCategory* createCategory( const QString& name );
+
+
+ static KMFProtocolCategory* getCustomCategory();
+
+private:
+ static const QUuid& customCategoryUuid();
+ static const QUuid& miscCategoryUuid();
+
+public:
+
+ ~KMFProtocolCategory();
+ KMFProtocol* createProtocol( const QString& name );
+
+ QValueList< KMFProtocol* >& protocols() const;
+
+
+
+ KMFProtocol* findProtocolByUuid( const QUuid& name ) const;
+
+ virtual int type();
+ virtual void clear();
+ virtual const QDomDocument& getDOMTree();
+ virtual void loadXML(const QDomDocument&, QStringList& errors );
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+ void delProtocol( KMFProtocol*, bool destructive /* = false */);
+
+public slots:
+ void slotOnProtocolDeleted( QObject* protocol );
+
+private:
+ KMFProtocol* findProtocolByName( const QString& name ) const;
+
+ KMFProtocol* addProtocol( KMFProtocol* );
+
+
+private: // DATA
+ KMFProtocolCategory( NetfilterObject* parent, const char* name );
+ QString m_icon;
+ QValueList< KMFProtocol* > m_protocols;
+
+
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfprotocollibrary.cpp b/kmyfirewall/core/kmfprotocollibrary.cpp
new file mode 100644
index 0000000..fe42d54
--- /dev/null
+++ b/kmyfirewall/core/kmfprotocollibrary.cpp
@@ -0,0 +1,395 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+#include "kmfprotocollibrary.h"
+
+// QT includes
+#include <qfile.h>
+#include <qdir.h>
+#include <qdom.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kio/netaccess.h>
+#include <kio/job.h>
+#include <ktrader.h>
+#include <klibloader.h>
+#include <ktempfile.h>
+#include <kfileitem.h>
+
+// project includes
+#include "../version.h"
+#include "xmlnames.h"
+#include "kmfundoengine.h"
+#include "kmferror.h"
+#include "kmferrorhandler.h"
+#include "kmfgenericdoc.h"
+#include "kmfnetzone.h"
+#include "kmfnethost.h"
+#include "kmfprotocolcategory.h"
+
+
+
+namespace KMF {
+
+
+/** Static Stuff **/
+KMFProtocolLibrary* KMFProtocolLibrary::m_instance = 0;
+KMFProtocolLibrary* KMFProtocolLibrary::instance() {
+ if ( ! m_instance ) {
+ m_instance = new KMFProtocolLibrary( 0 , "KMFProtocolLibrary");
+ }
+ return m_instance;
+}
+/** End Static Stuff **/
+
+KMFProtocolLibrary::KMFProtocolLibrary( QObject* parent, const char* name ) : QObject( parent, name ) {
+ m_libraryLoaded = false;
+ forceProtocolLibraryReload();
+}
+KMFProtocolLibrary::~KMFProtocolLibrary() {}
+
+QValueList< KMFProtocolCategory* >& KMFProtocolLibrary::protocolCategories() {
+ return m_protocolCategories;
+}
+QValueList<KMFProtocol*>& KMFProtocolLibrary::allProtocols() {
+ m_protocols.clear();
+
+ QValueList<KMFProtocolCategory* >::iterator it;
+ for( it = protocolCategories().begin(); it != protocolCategories().end(); ++it ) {
+ KMFProtocolCategory* cat = *it;
+ QValueList<KMFProtocol*>& currProtocols = cat->protocols();
+ QValueList<KMFProtocol*>::iterator itProt;
+ for( itProt = currProtocols.begin(); itProt != currProtocols.end(); ++itProt ) {
+ m_protocols.append( *itProt );
+ }
+ }
+ return m_protocols;
+}
+
+
+void KMFProtocolLibrary::forceProtocolLibraryReload() {
+ if ( m_libraryLoaded ) {
+ kdDebug() << "\nWARNING: KMFProtocolLibrary allready loaded, soing nothing!\n\n" << endl;
+ return;
+ }
+ kdDebug() << "########### START LOADING PROTOCOL LIBRARY #############" << endl;
+
+ m_protocolCategories.clear();
+ m_protocols.clear();
+
+ KMFError *err = new KMFError();
+ KMFErrorHandler *errH = new KMFErrorHandler( "KMFErrorHandler" );
+
+ KStandardDirs std_dir;
+ QString file = std_dir.findResource( "data", "kmyfirewall/protocols/kmfprotocollibrary.xml" );
+ KURL url;
+ url.setPath( file );
+ kdDebug() << "STD lib at: " << file << endl;
+
+ err->setErrType( KMFError::OK );
+ loadProtocolDefinitionsFromURL( url, err );
+
+ if ( ! errH->showError( err ) ) {
+ return;
+ }
+
+ QValueList<KMFProtocolCategory* >::iterator it;
+ for( it = protocolCategories().begin(); it != protocolCategories().end(); ++it ) {
+ KMFProtocolCategory* cat = *it;
+ QValueList<KMFProtocol*>& currProtocols = cat->protocols();
+ QValueList<KMFProtocol*>::iterator itProt;
+ for( itProt = currProtocols.begin(); itProt != currProtocols.end(); ++itProt ) {
+ KMFProtocol *p = *itProt;
+ p->setCustomProtocol( false );
+ }
+ }
+ kdDebug() << "########### FINISHED LOADING PROTOCOL LIBRARY #############" << endl;
+
+ kdDebug() << "########### START LOADING CUSTOM PROTOCOL LIBRARY #############" << endl;
+ file = std_dir.findResource( "data", "kmyfirewall/protocols/kmfcustomprotocollibrary.xml" );
+
+ url.setPath( file );
+ kdDebug() << "CUSTOM lib at: " << file << endl;
+ // KURL tmpurl = KURL( dir + "protocols/kmfcustomprotocollibrary.xml" );
+ if ( ! KIO::NetAccess::exists( url, false, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "KMFGenericDoc::loadProtocolLibrary() - no custom protocols found." << endl;
+ return;
+ }
+
+
+ err->setErrType( KMFError::OK );
+ loadProtocolDefinitionsFromURL( url, err );
+ if ( err->errType() != KMFError::OK ) {
+ return;
+ }
+
+ kdDebug() << "########### FINISHED LOADING CUSTOM PROTOCOL LIBRARY #############" << endl;
+ m_libraryLoaded = true;
+}
+
+void KMFProtocolLibrary::loadProtocolDefinitionsFromURL( const KURL& url, KMFError* err ) {
+ kdDebug() << "KMFProtocolLibrary::loadProtocolDefinitionsFromURL( const KURL& " << url.fileName() << " )" << endl;
+// QPtrList<KMFProtocol> *prots = new QPtrList<KMFProtocol>();
+
+ KIO::UDSEntry f_props;
+
+ if ( ! KIO::NetAccess::stat( url , f_props, KApplication::kApplication()->mainWidget() ) ) {
+
+ const QString msg = i18n( "<qt><p>The file <b>%1</b> could not be loaded.</p>"
+ "<p>If you are working with files stored on remote computers "
+ "make sure that the network is up and the fileserver running.</qt>" ).arg( url.url() );
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( msg );
+ return;
+ }
+
+ KFileItem *props = new KFileItem( f_props, url );
+ kdDebug() << "Found file permissions: " << props->permissionsString() << endl;
+ if ( !props->isReadable() ) {
+ const QString msg = i18n( "<qt><p>You don't have the permissions to read file: <b>%1</b></p></qt>" ).arg( url.url() );
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( msg );
+ return;
+ }
+
+ QString xmlfile;
+ if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) {
+ const QString msg = i18n( "<qt><p>Could not download file: <b>%1</b></p></qt>" ).arg( url.url() );
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( msg );
+ return;
+ }
+
+ if ( xmlfile.isEmpty() ) {
+ const QString msg = i18n( "<qt><p>No File found at URL: <b>%1</b></p></qt>" ).arg( url.url() );
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( msg );
+ return;
+ }
+
+ QFile kmfrsFile( xmlfile );
+
+ QDomDocument domTree;
+ if ( !kmfrsFile.open( IO_ReadOnly ) ) {
+ kdDebug() << "Couldn't open file" << endl;
+ return;
+ }
+ if ( !domTree.setContent( &kmfrsFile ) ) {
+ kdDebug() << "Couldn't set DomDocument content" << endl;
+ kmfrsFile.close();
+ return;
+ }
+ kmfrsFile.close();
+
+ QDomElement root = domTree.documentElement();
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ // kdDebug() << "Parsing Node: " << curr.nodeName() << endl;
+ if ( curr.isElement() && curr.nodeName() == XML::ProtocolCategory_Element ) {
+ // kdDebug() << "Parsing XML::ProtocolCategory_Element " << endl;
+
+ QString uuid = curr.toElement().attribute( XML::Uuid_Attribute );
+ KMFProtocolCategory *protCat = findCategory( uuid );
+ // kdDebug() << "asghasgh" << endl;
+ if ( ! protCat ) {
+ QString name = curr.toElement().attribute( XML::Name_Attribute );
+ kdDebug() << " + Creating KMFProtocolCategory: " << name << endl;
+ protCat = KMFProtocolCategory::createCategory( name );
+ m_protocolCategories.append( protCat );
+ }
+ QDomDocument protocolCat;
+ protocolCat.appendChild( curr.cloneNode( true ) );
+ QStringList *errors = new QStringList();
+ protCat->loadXML( protocolCat, *errors );
+ // FIXME: Check Errors
+ }
+ curr = curr.nextSibling();
+ }
+
+ kdDebug() << "Finished Parsing Protocol Library: " << url.url() << endl;
+ return;
+}
+
+KMFError* KMFProtocolLibrary::saveProtocolLibrary() {
+ kdDebug() << "KMFProtocolLibrary::saveProtocolLibrary()" << endl;
+ KMFError *err = new KMFError();
+ KStandardDirs std_dir;
+
+ QString saveFile = std_dir.saveLocation( "data", "kmyfirewall" );
+
+ KURL url;
+ url.setPath( saveFile + "protocols/kmfcustomprotocollibrary.xml" );
+
+ QString sDir = saveFile;
+ QDir d0( sDir );
+ if ( ! d0.exists() ) {
+ d0.mkdir( sDir, true );
+ }
+
+ sDir = saveFile + "protocols/";
+ QDir d1( sDir );
+ if ( ! d1.exists() ) {
+ d1.mkdir( sDir, true );
+ }
+
+ KTempFile file;
+
+
+ QDomDocument doc( "kmyfirewall-protocollibrary" );
+ QDomElement root = doc.createElement( "protocollibrary" );
+ root.setAttribute( XML::Version_Attribute, KMYFIREWALL_VERSION );
+ root.setAttribute( XML::MinVersion_Attribute, "1.0.0" );
+ root.setAttribute( XML::MaxVersion_Attribute, "~" );
+
+ QValueList<KMFProtocolCategory* >::iterator it;
+ for( it = protocolCategories().begin(); it != protocolCategories().end(); ++it ) {
+ KMFProtocolCategory* cat = *it;
+ root.appendChild( cat->getDOMTree() );
+ }
+ doc.appendChild( root );
+ // return *( new QString( doc.toString() ) );
+ const QString& xml = doc.toString();
+
+ kdDebug() << "XML: " << xml << endl;
+
+ if ( file.name() != QString::null ) {
+ QFile f( file.name() );
+ f.remove();
+ bool isWriteable = f.open( IO_ReadWrite );
+ if ( isWriteable ) {
+ QTextStream ts( &f );
+ ts << xml << endl;
+ f.flush();
+ f.close();
+
+
+ if ( ! KIO::NetAccess::upload( file.name(), url, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "Coudn't save File: " << url.url() << endl;
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt><p><b>Saving <i>%1</i> Failed.</b></p>"
+ "<p>Please make sure that you have the permissions to write to this Directory.<br>"
+ "If you are working with remotely stored files "
+ "make sure that the target host and the directory is reachable."
+ "</p></qt>" ).arg( url.url() ) );
+ file.unlink();
+ // errH->showError( err );
+ return err;
+
+ }
+ file.unlink();
+ kdDebug() << "\n\nSaved ProtocolLibrary to: " << url.url() << "\n"<< endl;
+ err -> setErrType( KMFError::OK );
+ err -> setErrMsg( "" );
+ // errH->showError( err );
+
+// forceProtocolLibraryReload();
+
+ return err;
+ } else {
+ // generate retrun error object
+ err -> setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "Opening file %1 for writing failed.\n"
+ "Please make sure that you are logged in as root" ).arg( file.name() );
+ err -> setErrMsg( msg );
+ file.unlink();
+ // errH->showError( err );
+ return err;
+ }
+
+ } else {
+ // generate retrun error object
+ err -> setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "Opening file %1 for writing failed.\n"
+ "Please make sure that you are logged in as root" ).arg( file.name() );
+ err -> setErrMsg( msg );
+ file.unlink();
+ // errH->showError( err );
+ return err;
+
+ }
+
+ // generate retrun error object
+ err -> setErrType( KMFError::FATAL );
+ const QString& msg = i18n( "File to save = QString::null. This is a bug." );
+ err -> setErrMsg( msg );
+ file.unlink();
+ // errH->showError( err );
+ return err;
+}
+
+KMFProtocol* KMFProtocolLibrary::findProtocolByName( const QString& name ) {
+// kdDebug() << "QPtrList<KMFProtocol>* KMFProtocol::findProtocol( " << name << " )" << endl;
+ QValueList< KMFProtocol* >& allProtos = allProtocols();
+ QValueList< KMFProtocol* >::iterator it;
+ for( it = allProtos.begin(); it != allProtos.end(); ++it ) {
+ KMFProtocol *p = *it;
+ if ( p->name() == name ) {
+ // kdDebug() << "Found Protocol: " << p->name() << " in KMFProtocol::protocolLIbrary()." << endl;
+ return p;
+ }
+ }
+ kdDebug() << "WARNING: Could not find protocol: " << name << " in KMFProtocol::protocolLIbrary()." << endl;
+ return 0;
+}
+
+KMFProtocol* KMFProtocolLibrary::findProtocolByUuid( const QUuid& uuid ) {
+// kdDebug() << "QPtrList<KMFProtocol>* KMFProtocol::findProtocolByUuid( " << uuid.toString() << " )" << endl;
+ QValueList< KMFProtocol* >& allProtos = allProtocols();
+ QValueList< KMFProtocol* >::iterator it;
+ for( it = allProtos.begin(); it != allProtos.end(); ++it ) {
+ KMFProtocol *p = *it;
+ if ( p->uuid() == uuid ) {
+ // kdDebug() << "Found Protocol: name=" << p->name() << " uuid=" << uuid.toString() << " in KMFProtocol::protocolLIbrary()." << endl;
+ return p;
+ }
+ }
+ kdDebug() << "WARNING: Could not find protocol: " << uuid.toString() << " in KMFProtocol::protocolLIbrary()." << endl;
+ return 0;
+}
+
+KMFProtocol* KMFProtocolLibrary::findEquivalentProtocol( KMFProtocol* comp ) {
+ kdDebug() << "QPtrList<KMFProtocol>* KMFProtocol::findEquivalentProtocol( " << comp->name() << " )" << endl;
+ QValueList< KMFProtocol* >& allProtos = allProtocols();
+ QValueList< KMFProtocol* >::iterator it;
+ for( it = allProtos.begin(); it != allProtos.end(); ++it ) {
+ KMFProtocol *p = *it;
+ if ( p->isEquivalent( comp ) ) {
+ kdDebug() << "Found Equivalent Protocol: " << p->name() << endl;
+ return p;
+ }
+ }
+
+ kdDebug() << "WARNING: No Equivalent Protocol found!" << endl;
+ return 0;
+}
+
+KMFProtocolCategory* KMFProtocolLibrary::findCategory( const QUuid& uuid ) {
+ // kdDebug() << "KMFProtocolCategory* KMFProtocolLibrary::findCategory( const QUuid& " << uuid << " )" << endl;
+ QValueList< KMFProtocolCategory* >::iterator it;
+ for( it = m_protocolCategories.begin(); it != m_protocolCategories.end(); ++it ) {
+ // kdDebug() << "At cat: " << (*it)->name() << " " << (*it)->uuid() << endl;
+ if ( (*it)->uuid() == uuid ) {
+ // kdDebug() << "Returning Found Categroy" << endl;
+ return (*it);
+ }
+ }
+// kdDebug() << "No Categroy Found" << endl;
+ return 0;
+}
+
+}
diff --git a/kmyfirewall/core/kmfprotocollibrary.h b/kmyfirewall/core/kmfprotocollibrary.h
new file mode 100644
index 0000000..4f3fad6
--- /dev/null
+++ b/kmyfirewall/core/kmfprotocollibrary.h
@@ -0,0 +1,71 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+#ifndef KMFKMFPROTOCOLLIBRARY_H
+#define KMFKMFPROTOCOLLIBRARY_H
+
+#include <qobject.h>
+#include <qvaluelist.h>
+#include <qstring.h>
+#include <quuid.h>
+#include <kurl.h>
+
+namespace KMF {
+class KMFError;
+class KMFProtocol;
+class KMFProtocolCategory;
+
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+class KMFProtocolLibrary : public QObject {
+Q_OBJECT
+/** Static Stuff **/
+public:
+ static KMFProtocolLibrary* instance();
+
+private:
+ static KMFProtocolLibrary* m_instance;
+
+/** End Static stuff **/
+public:
+ ~KMFProtocolLibrary();
+
+
+public:
+ // QPtrList<KMFProtocol>* protocolLibrary();
+ KMFError* saveProtocolLibrary();
+ void forceProtocolLibraryReload();
+ void loadProtocolDefinitionsFromURL( const KURL&, KMFError* err );
+ QValueList<KMFProtocolCategory*>& protocolCategories();
+ QValueList<KMFProtocol*>& allProtocols();
+
+ KMFProtocolCategory* findCategory( const QUuid& uuid );
+ KMFProtocol* findProtocolByName( const QString& name );
+ KMFProtocol* findProtocolByUuid( const QUuid& uuid );
+ KMFProtocol* findEquivalentProtocol( KMFProtocol* compare );
+
+private:
+ QValueList< KMFProtocolCategory* > m_protocolCategories;
+ QValueList< KMFProtocol* > m_protocols;
+
+
+private:
+ KMFProtocolLibrary( QObject* parent, const char* name );
+ KMFProtocolLibrary();
+
+ bool m_libraryLoaded;
+
+};
+
+}
+
+#endif
diff --git a/kmyfirewall/core/kmfprotocollibrary.xml b/kmyfirewall/core/kmfprotocollibrary.xml
new file mode 100644
index 0000000..5b4e3b4
--- /dev/null
+++ b/kmyfirewall/core/kmfprotocollibrary.xml
@@ -0,0 +1,238 @@
+<!DOCTYPE kmyfirewall-protocollibrary>
+<protocollibrary maxVersion="~" minVersion="1.0.0" version="1.1.0">
+ <protocolCategory uuid="{6f1ba5f3-1be2-4f56-9398-74dc80bda0bb}" name="Web Browsing" description="Protocols involved in common WWW usage">
+ <protocol uuid="{09b28513-5f46-46ee-a442-6b2e540c6a5f}" name="HTTP" description="Protocol used to browse the WWW." category="WWW" >
+ <port num="80" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{6c47dba8-2dd5-45ae-9ce4-cf14d7fc42e6}" name="HTTPS" description="Protocol used to browse the WWW using SSL/TSL encryption." category="WWW" >
+ <port num="443" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{9239d7d6-fcd0-48b9-9202-fc595f89b9b9}" name="DNS" description="(Protocol used resolve hostnames e.g. www.host.org -> 123.234.121.12)." >
+ <port num="53" protocol="UDP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{33db9de0-15ac-4a8c-9f4b-7802ff64ef3e}" name="Remote Shell" description="Protocols used to open remote shells.">
+ <protocol uuid="{a7e2341b-167b-4f12-b671-eaa0b0f469dc}" name="SSH" description="Protocol used to enable a secure remote shell connection." category="Remote shells">
+ <port num="22" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{d76fa5f6-37a5-4530-a6f6-691f2095c1d9}" name="Telnet" description="Old but popular remote shell protocol. (insecure use SSH instead)" >
+ <port num="23" protocol="TCP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{51ab462a-24ec-4649-962a-b5533a84ac18}" name="E-Mail, Newsgroups" description="Protocols used for sending and receiving of e-mal messages">
+ <protocol uuid="{dc1eb5ca-86f2-4a7e-b56b-52f032819ac6}" name="SMTP" description="Protocol used transprt E-Mail trougth the web." >
+ <port num="25" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{ae28cfaf-5c96-41fc-8519-b6bc4e3342f5}" name="SMTP_SSL" description="Secure version of SMTP using SSL." >
+ <port num="465" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{55cece62-355e-4029-a9bf-b0264eb80e0b}" name="POP3" description="Protocol used recieve e-mail from a Mail Server." >
+ <port num="110" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{c677b408-2bfa-4c36-a5a1-d0bfde62cae0}" name="POP3_SSL" description="Secure version of POP3 using SSL." >
+ <port num="995" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{6b1fe889-6108-4b25-944e-4869e9908ffd}" name="IMAP" description="Protocol used browse/view your mails on the mail server." >
+ <port num="143" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{4b08ff53-4444-4278-9255-9af5cf37beae}" name="IMAP_SSL" description="Secure version of IMAP using SSL." >
+ <port num="585" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{9e39a11c-0b18-4280-b232-ff836b312b4d}" name="NNTP" description="Protocol used to access newsgroups." >
+ <port num="119" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{3fd51a3f-a3a3-44f6-832f-dd1261666acb}" name="NNTP_SSL" description="Secure version of NNTP using SSL." >
+ <port num="563" protocol="TCP" />
+ <port num="563" protocol="UDP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{e49fc900-b648-45c2-9423-169ce802d25e}" name="File Transfer/Sharing" description="Protocols used transfer files over the internet.">
+ <protocol uuid="{de87ac4f-88be-4616-9778-acf573fdc39c}" name="FTP" description="Most common protocol used to download files from internet servers." >
+ <port num="21" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{afb09a80-631c-4174-8418-4261d97450a0}" name="FTP_SSL" description="Secure version of FTP using SSL." >
+ <port num="990" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{9256485b-a4f4-4cd6-84ee-d1fb69aeee4c}" name="SFTP" description="Protocol used transfer files.">
+ <port num="115" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{4e0621ee-af4d-41e4-9fa0-65bd7d714701}" name="TFTP" description="Trivial FTP. Very simple file transfer protocol." >
+ <port num="69" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{e64d66d3-d055-4b66-84a4-1df6f1458ae0}" name="NFS" description="Protocol used to mount remote file sytems." >
+ <port num="2049" protocol="TCP" />
+ <port num="2049" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{d93be2c5-4d4a-4ce6-bc7f-8289b2011b0c}" name="SMB" description="Protocol used by Microsoft's Network Neighbourhood.">
+ <port num="137" protocol="UDP" />
+ <port num="138" protocol="UDP" />
+ <port num="139" protocol="TCP" />
+ <port num="445" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{f6f5c883-7de8-4af7-841e-a7a4530d5e8c}" name="RSYNC" description="Protocol used to syncronice files from a server." >
+ <port num="873" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{73a3b979-6115-4eee-9956-45ccef375151}" name="Kazaa" description="Kazaa P2P file sharing protocol" >
+ <port num="1214" protocol="TCP" />
+ <port num="1214" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{67d450a9-6878-47c4-9fd9-accd247bfcdc}" name="Azureus" description="Bittorrent Protocol used by Azureus needs this port.">
+ <port num="26434" protocol="TCP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{55c628dd-d083-4613-9a1b-fc324cc1becc}" name="Network Services" description="Protocols used for various common network services.">
+ <protocol uuid="{0e0187e9-7a5b-4f8e-9af9-0c2764cc4feb}" name="ECHO" description="ECHO Protocol.">
+ <port num="7" protocol="TCP" />
+ <port num="7" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{a985f860-037e-45d5-b91d-8f93dd6d4491}" name="DAYTIME" description="DAYTIME Protocol.">
+ <port num="13" protocol="TCP" />
+ <port num="13" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{dc92effd-694f-44ae-8c54-cc6dbbaabe04}" name="TIME" description="TIME Protocol.">
+ <port num="37" protocol="TCP" />
+ <port num="37" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{c790d6e9-6683-4e5a-8d4b-0175bd2241fe}" name="WHOIS" description="Protocol used to access the WHOIS servers.">
+ <port num="43" protocol="TCP" />
+ <port num="43" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{4e65b0c9-d532-4bb0-99dd-351a313f18bc}" name="DHCP/BOOTP" description="Protocol used to dynamicaly configure host in a network.">
+ <port num="67" protocol="UDP" />
+ <port num="68" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{bc11cb84-5946-4f7d-9f8d-789a0da17efa}" name="DHCP Failover" description="Protocol used to dynamicaly configure host in a network.">
+ <port num="647" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{67b56458-aa38-44e7-b32e-69057a661a59}" name="NTP" description="Protocol used to get the time from a time server.">
+ <port num="123" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{2d5b54d6-1296-4cb7-b359-fce7ee423379}" name="SNMP" description="Simple Network Management Protocol.">
+ <port num="161" protocol="UDP" />
+ <port num="161" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{26fd1609-e4cd-4e89-8b3f-78a78f6da3cd}" name="SNMPTRAP" description="SNMPTRAP.">
+ <port num="162" protocol="UDP" />
+ <port num="162" protocol="TCP" />
+ </protocol>
+
+ </protocolCategory>
+
+ <protocolCategory uuid="{ac3c0e86-310a-48e6-ae86-52157c15ba7f}" name="Chat and Instant Messaing Services" description="Protocols used for char and instant messaging systems e.g. IRC, IM etc.">
+ <protocol uuid="{454c16bb-bdb8-4a6c-881f-ddb1931c3c23}" name="IRC" description="Protocol used for chat and message transfer using the old irc networks.">
+ <port num="194" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{39d851d2-a08e-4653-80c7-e00211170ee7}" name="Yahoo Messenger" description="Protocol by the Yahoo messenger services.">
+ <port num="5050" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{f0a18817-b932-4fba-b4af-0085af1558c9}" name="ICQ/AOL Messenger" description="Protocol by the ICQ and AOL messenger services.">
+ <port num="5050" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{abfca5e5-e91f-4c01-b4dd-868c805fe7e3}" name="ICQ_SSL" description="Secure version of ICQ using SSL.">
+ <port num="6679" protocol="TCP" />
+ <port num="6697" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{980a8f02-28f4-4220-9560-8c2f00422cae}" name="Jabber/XMPP" description="Protocol by the Jabber/XMPP messenger services.">
+ <port num="5222" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{1f155b17-3f2e-4735-aadc-97a4f3744538}" name="Jabber/XMPP SSL" description="Secure version of Jabber/XMPP using SSL.">
+ <port num="5223" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{e6df6657-5d61-4c54-a5b8-bf96a88c4c24}" name="Jabber/XMPP Server Connections" description="Protocol by the Jabber/XMPP messenger services.">
+ <port num="5269" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{8a698332-656d-4a2b-8b45-c7e9857ff2b1}" name="Jabber/XMPP File Transfer" description="Protocol by the Jabber/XMPP messenger services.">
+ <port num="8010" protocol="TCP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{5103b012-2d50-4f1b-b13a-1ec30db78c9d}" name="Directory Services" description="Protocols used access online diectory services.">
+ <protocol uuid="{41aff138-3a8b-4ae6-b88f-59f77050607e}" name="LDAP" description="Protocol used by most Directory services like OpenLDAP or Microsofts Active Directory.">
+ <port num="389" protocol="UDP" />
+ <port num="389" protocol="TCP" />
+ </protocol>
+ <protocol uuid="{332ce223-a033-4085-82de-c484ab9c0ffb}" name="LDAPS" description="Secure (SSL/TSL) version of the LDAP protocol used by most Directory services like OpenLDAP or Microsofts Active Directory.">
+ <port num="636" protocol="UDP" />
+ <port num="636" protocol="TCP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{279a7732-0d10-4bb8-b3bc-7f4704cf3ad0}" name="VPN" description="Protocols used for secure WAN connections.">
+ <protocol uuid="{5c5408c1-e1db-49c4-9ed5-4649b6fb2818}" name="ISAKMP" description="IPsec - Internet Security Association and Key Management Protocol." >
+ <port num="500" protocol="TCP" />
+ <port num="500" protocol="UDP" />
+ </protocol>
+
+ <protocol uuid="{43d98ecc-dd17-483b-9149-4a7c05707ec5}" name="OpenVPN" description="Open SSL based VPN protocol." >
+ <port num="1194" protocol="UDP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{9a0d727c-f03f-46da-a753-066ef46bf520}" name="Authentification" description="Protocols used for authentification.">
+ <protocol uuid="{3e4d8f1c-2d71-444a-8daf-fc0646048431}" name="Kerberos" description="Secure Authetification Protocol." >
+ <port num="88" protocol="TCP" />
+ <port num="88" protocol="UDP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{065a29d7-255b-4433-9fc1-36067bd1f25d}" name="Printing" description="Protocols used for printer connections.">
+ <protocol uuid="{2eb017f7-12ae-4672-a342-4519fdef4998}" name="CUPS" description="Common Unix Printing System." >
+ <port num="631" protocol="TCP" />
+ </protocol>
+
+ <protocol uuid="{c6984b12-34fa-49dd-ae00-90bd44a67b41}" name="LPD" description="Older but still in use printing protocol." >
+ <port num="515" protocol="TCP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{0f4127da-70ef-4b72-8c06-c9b90806b6d6}" name="Souce Control Systems" description="Protocols used by source control/versioning systems.">
+ <protocol uuid="{2bcbcffc-f90c-4bf3-94eb-76034e9a2730}" name="Subversion" description="Source Control System used by many open source projects." >
+ <port num="3690" protocol="TCP" />
+ </protocol>
+ </protocolCategory>
+
+ <protocolCategory uuid="{02e7113c-535d-447d-8a25-5c9e89fd3f79}" name="Misc" description="Protocols that are not catgorized yet">
+ <protocol uuid="{5ed56bef-a516-4679-8379-0bde2cdb00d9}" name="Avahi" description="Service discovery protocol for local networks" >
+ <port num="5353" protocol="UDP" />
+ </protocol>
+ </protocolCategory>
+ <protocolCategory uuid="{9758012f-e2a0-4594-938f-c154a7078752}" name="Custom Protocols" description="Protocols defined and Maintained by the user" />
+
+</protocollibrary>
diff --git a/kmyfirewall/core/kmfprotocolusage.cpp b/kmyfirewall/core/kmfprotocolusage.cpp
new file mode 100644
index 0000000..31cc243
--- /dev/null
+++ b/kmyfirewall/core/kmfprotocolusage.cpp
@@ -0,0 +1,257 @@
+//
+// C++ Implementation: kmfprotocolusage
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfprotocolusage.h"
+
+// QT includes
+#include <qfile.h>
+#include <qdir.h>
+#include <qdom.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kio/netaccess.h>
+#include <kio/job.h>
+#include <ktrader.h>
+#include <klibloader.h>
+#include <ktempfile.h>
+#include <kfileitem.h>
+
+// project includes
+#include "../version.h"
+#include "kmfprotocol.h"
+#include "kmfprotocollibrary.h"
+#include "kmferror.h"
+#include "kmferrorhandler.h"
+#include "kmfgenericdoc.h"
+#include "kmfnetzone.h"
+#include "kmfnethost.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+KMFProtocolUsage::KMFProtocolUsage( NetfilterObject* parent, const char* name ) : NetfilterObject( parent, name ) {
+ m_protocol = 0;
+ m_limit_interval = "minute";
+ m_limit = -1;
+ m_log = false;
+}
+
+
+KMFProtocolUsage::~KMFProtocolUsage()
+{
+}
+
+const QString& KMFProtocolUsage::name() {
+// kdDebug() << "KMFProtocolUsage::name()" << endl;
+ if ( ! m_protocol ) {
+ kdDebug() << "ERROR: No Protocol Stored in KMFProtocolUsage instance!" << endl;
+ return *( new QString( "ERROR: No Protocol Stored in KMFProtocolUsage instance!") );
+ }
+ return protocol()->name();
+}
+
+const QString& KMFProtocolUsage::description() {
+// kdDebug() << "KMFProtocolUsage::description()" << endl;
+ if ( ! m_protocol ) {
+ kdDebug() << "ERROR: No Protocol Stored in KMFProtocolUsage instance!" << endl;
+ return *( new QString( "ERROR: No Protocol Stored in KMFProtocolUsage instance!") );
+ }
+ return protocol()->description();
+}
+
+int KMFProtocolUsage::type() {
+ //kdDebug() << "KMFProtocolUsage::type()" << endl;
+ return NetfilterObject::PROTOCOLUSAGE;
+}
+void KMFProtocolUsage::clear() {
+ m_limit_interval = "minute";
+ m_limit = -1;
+ m_log = false;
+}
+
+void KMFProtocolUsage::setProtocol( KMFProtocol* p ) {
+ // kdDebug() << "KMFProtocolUsage::setProtocol( KMFProtocol* " << p->name() << " )" << endl;
+ m_protocol = p;
+
+ disconnect( m_protocol, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolDeleted( QObject* ) ) );
+ connect( m_protocol, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolDeleted( QObject* ) ) );
+}
+
+void KMFProtocolUsage::slotOnProtocolDeleted( QObject* ) {
+ kdDebug() << "KMFProtocolUsage::slotOnProtocolDeleted( QObject* )" << endl;
+ deleteLater();
+}
+
+
+bool KMFProtocolUsage::validUsage() {
+
+ return m_protocol ? true : false;
+}
+
+void KMFProtocolUsage::setIO ( int io ) {
+ m_io = io;
+}
+
+void KMFProtocolUsage::setLimitInterval( const QString& interval ) {
+ // kdDebug() << "void KMFProtocolUsage::setLimitInterval( const QString& )" << endl;
+ if ( m_limit_interval == interval ) {
+ return;
+ }
+ m_limit_interval = interval;
+ changed();
+}
+
+void KMFProtocolUsage::setLimit( int limit ){
+ // kdDebug() << "void KMFProtocolUsage::setLimit( int )" << endl;
+ if ( m_limit == limit ) {
+ return;
+ }
+ m_limit = limit;
+ changed();
+}
+
+void KMFProtocolUsage::setLogging( bool onoff ) {
+ // kdDebug() << "void KMFProtocolUsage::setLimit( int )" << endl;
+ if ( m_log == onoff ) {
+ return;
+ }
+ m_log = onoff;
+ changed();
+}
+
+const QDomDocument& KMFProtocolUsage::getDOMTree() {
+ // kdDebug() << "const QDomDocument& KMFProtocolUsage::getDOMTree()" << endl;
+ QDomDocument doc;
+ QDomElement root = doc.createElement( XML::ProtocolUsage_Element );
+ NetfilterObject::saveUuid( root );
+ // root.setAttribute( "protocolName", protocol()->name() );
+ root.setAttribute( XML::ProtocolUuid_Attribute, protocol()->uuid().toString() );
+
+ if ( logging() ) {
+ root.setAttribute( XML::Logging_Attribute, XML::Yes_Value );
+ } else {
+ root.setAttribute( XML::Logging_Attribute, XML::No_Value );
+ }
+
+ if ( io() == INCOMING ) {
+ root.setAttribute( XML::IO_Attribute, XML::Incoming_Value );
+ }
+ if ( io() == OUTGOING ) {
+ root.setAttribute( XML::IO_Attribute, XML::Outgoing_Value );
+ }
+
+ QString lim = "";
+ lim = lim.setNum( m_limit );
+ lim += "/" + m_limit_interval;
+ root.setAttribute( XML::Limit_Attribute, lim );
+
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+
+void KMFProtocolUsage::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ // kdDebug() << "void KMFProtocolUsage::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML( root, errors );
+}
+void KMFProtocolUsage::loadXML( QDomNode root, QStringList& errors ) {
+ kdDebug() << "void KMFProtocolUsage::loadXML( QDomNode root )" << endl;
+ NetfilterObject::loadUuid ( root, errors );
+ QString protocolName = "";
+ QString protocolUuid = "";
+ QString logging = "";
+ QString desc = "";
+ QString limit = "";
+
+ QString io = "";
+ // protocolName = "";
+
+
+ if ( root.toElement().hasAttribute( XML::ProtocolUuid_Attribute ) ) {
+ protocolUuid = root.toElement().attribute( XML::ProtocolUuid_Attribute );
+ } /*else if ( root.toElement().hasAttribute( "protocolName" ) ) {
+ protocolName = root.toElement().attribute( "protocolName" );
+ } */else if ( root.toElement().hasAttribute( XML::Name_Attribute ) ) {
+ protocolName = root.toElement().attribute( XML::Name_Attribute );
+ } else {
+ kdDebug() << "ERROR: NO Protocol name found for Protocol usage!" << endl;
+ errors.append( KMFError::getAsString( KMFError::NORMAL, i18n( "No Protocol reference found for ProtocolUsage !" ) ) );
+ return;
+ }
+
+
+ if ( ! protocolUuid.isEmpty() ) {
+// kdDebug() << "Using Protocol Uuid!" << endl;
+ KMFProtocol* prot = KMFProtocolLibrary::instance()->findProtocolByUuid( *( new QUuid( protocolUuid ) ) );
+ if ( ! prot ) {
+ errors.append( KMFError::getAsString( KMFError::NORMAL, i18n( "Could not find Protocol: %1 in protocol Library" ).arg( protocolUuid ) ) );
+ kdDebug() << "ERROR: Could not find Protocol: " << protocolUuid << " in protocol Library" << endl;
+ return;
+ }
+ setProtocol( prot );
+ } else {
+ // kdDebug() << "Using Protocol Name!" << endl;
+ errors.append( KMFError::getAsString( KMFError::WARNING, i18n( "Using Protocol Name! As Reference in Protocol Usage." ) ) );
+
+ KMFProtocol* prot = KMFProtocolLibrary::instance()->findProtocolByName( protocolName );
+ if ( ! prot ) {
+ errors.append( KMFError::getAsString( KMFError::NORMAL, i18n( "Could not find Protocol: %1 in protocol Library" ).arg( protocolName ) ) );
+ kdDebug() << "ERROR: Could not find Protocol: " << protocolName << " in protocol Library" << endl;
+ return;
+ }
+ setProtocol( prot );
+ }
+
+
+
+ if ( root.toElement().hasAttribute( XML::Logging_Attribute ) ) {
+ logging = root.toElement().attribute( XML::Logging_Attribute );
+ if ( logging == XML::Yes_Value ) {
+ setLogging(true);
+ } else {
+ setLogging(false);
+ }
+ }
+ if ( root.toElement().hasAttribute( XML::IO_Attribute ) ) {
+ io = root.toElement().attribute( XML::IO_Attribute );
+
+ if ( io == XML::Incoming_Value) {
+ m_io = INCOMING;
+ } else {
+ m_io = OUTGOING;
+ }
+ }
+
+ if ( root.toElement().hasAttribute( XML::Limit_Attribute ) ) {
+ limit = root.toElement().attribute( XML::Limit_Attribute );
+ int pos = limit.find('/');
+ QString limi = limit.left( pos );
+ QString limit_interval = limit.right( limit.length() - pos -1 );
+
+ bool ok;
+ int lim = limi.toInt( &ok );
+ if ( ok ) {
+ m_limit = lim;
+ }
+ m_limit_interval = limit_interval;
+ }
+ changed();
+}
+
+}
diff --git a/kmyfirewall/core/kmfprotocolusage.h b/kmyfirewall/core/kmfprotocolusage.h
new file mode 100644
index 0000000..35cb6e7
--- /dev/null
+++ b/kmyfirewall/core/kmfprotocolusage.h
@@ -0,0 +1,94 @@
+//
+// C++ Interface: kmfprotocolusage
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFPROTOCOLUSAGE_H
+#define KMFPROTOCOLUSAGE_H
+
+#include "netfilterobject.h"
+
+// QT includes
+#include <qstringlist.h>
+#include <qstring.h>
+#include <qguardedptr.h>
+#include <qptrlist.h>
+#include <qmap.h>
+#include <qobject.h>
+// KDE includes
+#include <kdemacros.h>
+#include <kurl.h>
+
+// Project includes
+#include "kmfprotocol.h"
+
+namespace KMF {
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+
+class KMFProtocolUsage : public NetfilterObject {
+ friend class KMFProtocol;
+Q_OBJECT
+public:
+
+ ~KMFProtocolUsage();
+
+ void setProtocol( KMFProtocol* );
+ KMFProtocol *protocol() const {
+ return m_protocol;
+ }
+
+ virtual int type();
+ virtual void clear();
+
+ virtual const QString& name();
+ virtual const QString& description();
+
+ bool validUsage();
+
+ void setLimitInterval( const QString& );
+ void setLimit( int );
+
+ int limit() const {
+ return m_limit;
+ };
+
+ const QString& limitInterval() const {
+ return m_limit_interval;
+ };
+
+ void setLogging( bool );
+ bool logging() const {
+ return m_log;
+ };
+
+ enum { OUTGOING, INCOMING } IO;
+ void setIO ( int );
+ int io() const {
+ return m_io;
+ };
+
+ const QDomDocument& getDOMTree();
+ virtual void loadXML(const QDomDocument&, QStringList& errors );
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+public slots:
+ void slotOnProtocolDeleted( QObject* protocol );
+
+private:
+ KMFProtocolUsage( NetfilterObject* parent, const char* name );
+ QGuardedPtr<KMFProtocol> m_protocol;
+ QString m_limit_interval;
+ int m_limit;
+ int m_protocolType, m_io;
+ bool m_log;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfruleeditinterface.cpp b/kmyfirewall/core/kmfruleeditinterface.cpp
new file mode 100644
index 0000000..6033832
--- /dev/null
+++ b/kmyfirewall/core/kmfruleeditinterface.cpp
@@ -0,0 +1,26 @@
+//
+// C++ Implementation: kmfruleeditinterface
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+// License: GPL
+//
+#include "kmfruleeditinterface.h"
+
+#include <kdebug.h>
+namespace KMF {
+
+KMFRuleEditInterface::KMFRuleEditInterface(){
+ kdDebug() << "KMFRuleEditInterface::KMFRuleEditInterface()" << endl;
+}
+
+KMFRuleEditInterface::~KMFRuleEditInterface() {
+ kdDebug() << "KMFRuleEditInterface::~KMFRuleEditInterface()" << endl;
+}
+
+}
diff --git a/kmyfirewall/core/kmfruleeditinterface.h b/kmyfirewall/core/kmfruleeditinterface.h
new file mode 100644
index 0000000..5dd2e18
--- /dev/null
+++ b/kmyfirewall/core/kmfruleeditinterface.h
@@ -0,0 +1,35 @@
+//
+// C++ Interface: kmfruleeditinterface
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+// License: GPL
+//
+#ifndef KMFRULEEDITINTERFACE_H
+#define KMFRULEEDITINTERFACE_H
+
+#include <qptrlist.h>
+
+#include <kdemacros.h>
+/**
+@author Christian Hubinger
+*/
+class QString;
+namespace KMF {
+
+
+
+class KDE_EXPORT KMFRuleEditInterface{
+public:
+ KMFRuleEditInterface();
+ virtual ~KMFRuleEditInterface();
+ virtual void addRuleOption(QString*, QPtrList< QString >* ) = 0;
+ virtual void addRuleTargetOption(QString*, QPtrList< QString >* ) = 0;
+ virtual void showOverview() = 0;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfruleoptioneditinterface.cpp b/kmyfirewall/core/kmfruleoptioneditinterface.cpp
new file mode 100644
index 0000000..3f8c798
--- /dev/null
+++ b/kmyfirewall/core/kmfruleoptioneditinterface.cpp
@@ -0,0 +1,30 @@
+// C++ Implementation: kmfplugin
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruleoptioneditinterface.h"
+
+// QT includes
+
+// KDE includes
+#include <kdebug.h>
+// Project includes
+
+namespace KMF {
+
+KMFRuleOptionEditInterface::KMFRuleOptionEditInterface(QObject *parent, const char* name ) : KMFPlugin( parent, name ) {
+ kdDebug() << "KMFRuleOptionEditInterface::KMFRuleOptionEditInterface()" << endl;
+}
+
+KMFRuleOptionEditInterface::~KMFRuleOptionEditInterface() {
+ kdDebug() << "KMFRuleOptionEditInterface::~KMFRuleOptionEditInterface()" << endl;
+}
+
+}
+
diff --git a/kmyfirewall/core/kmfruleoptioneditinterface.h b/kmyfirewall/core/kmfruleoptioneditinterface.h
new file mode 100644
index 0000000..f6c7f24
--- /dev/null
+++ b/kmyfirewall/core/kmfruleoptioneditinterface.h
@@ -0,0 +1,25 @@
+#ifndef __KMFRULOPTIONEEDITINTERFACE_H
+#define __KMFRULOPTIONEEDITINTERFACE_H
+
+#include <qobject.h>
+#include <qstring.h>
+#include <qptrlist.h>
+
+#include "kmfplugin.h"
+
+
+namespace KMF {
+class IPTRule;
+
+class KDE_EXPORT KMFRuleOptionEditInterface : public KMFPlugin {
+public:
+ KMFRuleOptionEditInterface(QObject *parent = 0, const char* name = 0);
+ virtual ~KMFRuleOptionEditInterface();
+ virtual void loadRule( IPTRule* ) = 0;
+ virtual QWidget* editWidget() = 0;
+ virtual const QString& optionEditName() const = 0;
+ virtual const QString& description() const = 0;
+};
+}
+
+#endif // __KMFRULEEDITINTERFACE_H
diff --git a/kmyfirewall/core/kmfrulesetdoc.cpp b/kmyfirewall/core/kmfrulesetdoc.cpp
new file mode 100644
index 0000000..3006d88
--- /dev/null
+++ b/kmyfirewall/core/kmfrulesetdoc.cpp
@@ -0,0 +1,104 @@
+//
+// C++ Implementation: kmfrulesetdoc
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfrulesetdoc.h"
+
+
+// QT includes
+#include <qfile.h>
+#include <qdom.h>
+
+
+// KDE includes
+#include <klocale.h>
+#include <kdebug.h>
+
+// Project Inclueds
+#include "kmftarget.h"
+#include "kmftargetconfig.h"
+#include "kmfnetwork.h"
+#include "kmfundoengine.h"
+#include "kmferror.h"
+
+namespace KMF {
+
+KMFRulesetDoc::KMFRulesetDoc( KMFTarget* target )
+{
+ kdDebug() << "KMFRulesetDoc::KMFRulesetDoc( KMFTarget* target )" << endl;
+
+ setTarget( target );
+}
+
+
+KMFRulesetDoc::~KMFRulesetDoc()
+{
+}
+
+KMFTarget* KMFRulesetDoc::target() {
+ return m_target;
+}
+
+void KMFRulesetDoc::setTarget( KMFTarget* target ) {
+ m_target = target;
+}
+
+KMFNetwork* KMFRulesetDoc::network(){
+ if ( ! m_target ) {
+ kdDebug() << "ERROR: network() - target == 0 " << endl;
+ return 0;
+ }
+ KMFNetwork *n = target()->network();
+ if ( ! n ) {
+ kdDebug() << "ERROR: network() - target()->network() == 0 " << endl;
+ return 0;
+ }
+ return n;
+}
+
+KMFError* KMFRulesetDoc::createFirewallScript( const QString& fi ) {
+ KMFError* m_err = new KMFError();
+ QString file;
+ file = fi;
+ if ( file.isEmpty() ) {
+ kdDebug() << "Cant open output file" << endl;
+ m_err->setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "Opening file for writing failed.\n"
+ "Please make sure that you are logged in as root." );
+ m_err->setErrMsg( msg );
+ return m_err;
+
+ }
+
+ QFile f( file );
+ f.remove();
+ bool gotit = f.open( IO_ReadWrite );
+ if ( ! gotit ) {
+ m_err->setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "Opening file for writing failed.\n"
+ "Please make sure that you are logged in as root." );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+
+ QTextStream ts( &f );
+ QString s;
+ kdDebug() << "########### start compiling ###########" << endl;
+ ts << compile() << endl;
+ kdDebug() << "########### Finished compiling ###########" << endl;
+ f.flush();
+ f.close();
+ m_err->setErrType( KMFError::OK );
+ const QString& msg = "";
+ m_err->setErrMsg( msg );
+ return m_err;
+}
+
+}
diff --git a/kmyfirewall/core/kmfrulesetdoc.h b/kmyfirewall/core/kmfrulesetdoc.h
new file mode 100644
index 0000000..66296de
--- /dev/null
+++ b/kmyfirewall/core/kmfrulesetdoc.h
@@ -0,0 +1,61 @@
+//
+// C++ Interface: kmfrulesetdoc
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULESETDOC_H
+#define KMFRULESETDOC_H
+
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+
+//QT Includes
+#include <qguardedptr.h>
+
+// KDE includes
+#include <kdemacros.h>
+
+namespace KMF {
+class KMFTarget;
+class KMFNetwork;
+class KMFError;
+
+class KDE_EXPORT KMFRulesetDoc{
+public:
+ KMFRulesetDoc( KMFTarget* );
+
+ virtual ~KMFRulesetDoc();
+ KMFTarget* target();
+ KMFNetwork* network();
+ void setTarget( KMFTarget* );
+
+ /** return a QString containing the documents script to
+ setup the firewall configuration */
+ virtual const QString& compile() = 0;
+
+ /** Writes the shellscrip that contains the iptables commands to settup
+ the firewall to file.
+ If file = QString::null a SaveAs dialog will popup. */
+ KMFError* createFirewallScript( const QString& fi );
+
+protected:
+
+
+private:
+ KMFRulesetDoc();
+
+
+
+private: // DATA
+ QGuardedPtr<KMFTarget> m_target;
+
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfruletargetoptioneditinterface.cpp b/kmyfirewall/core/kmfruletargetoptioneditinterface.cpp
new file mode 100644
index 0000000..2ea2bc9
--- /dev/null
+++ b/kmyfirewall/core/kmfruletargetoptioneditinterface.cpp
@@ -0,0 +1,36 @@
+//
+// C++ Implementation: kmfruletragetoptioneditinterface
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruletargetoptioneditinterface.h"
+
+namespace KMF {
+
+KMFRuleTargetOptionEditInterface::KMFRuleTargetOptionEditInterface(QObject *parent, const char *name)
+ : KMFRuleOptionEditInterface(parent, name) {
+ // m_managedTargets << "DNAT" << "SNAT";
+
+}
+
+
+KMFRuleTargetOptionEditInterface::~KMFRuleTargetOptionEditInterface() {}
+bool KMFRuleTargetOptionEditInterface::manageTarget( const QString& target ) const {
+ bool found = false;
+ for ( uint i = 0; i < m_managedTargets.count(); i++ ) {
+ QString currTarget = *m_managedTargets.at( i );
+ if ( currTarget == target )
+ found = true;
+ }
+ return found;
+
+}
+
+}
+
diff --git a/kmyfirewall/core/kmfruletargetoptioneditinterface.h b/kmyfirewall/core/kmfruletargetoptioneditinterface.h
new file mode 100644
index 0000000..4e7faaa
--- /dev/null
+++ b/kmyfirewall/core/kmfruletargetoptioneditinterface.h
@@ -0,0 +1,41 @@
+//
+// C++ Interface: kmfruletragetoptioneditinterface
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULETARGETOPTIONEDITINTERFACE_H
+#define KMFRULETARGETOPTIONEDITINTERFACE_H
+
+#include "kmfruleoptioneditinterface.h"
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include <kdemacros.h>
+
+/**
+@author Christian Hubinger
+*/
+namespace KMF {
+class KDE_EXPORT KMFRuleTargetOptionEditInterface : public KMFRuleOptionEditInterface {
+public:
+ KMFRuleTargetOptionEditInterface(QObject *parent = 0, const char *name = 0);
+
+ virtual ~KMFRuleTargetOptionEditInterface();
+
+ virtual bool manageTarget( const QString& ) const;
+ virtual bool setTarget( const QString& ) = 0;
+
+protected:
+ QStringList m_managedTargets;
+
+
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmftarget.cpp b/kmyfirewall/core/kmftarget.cpp
new file mode 100644
index 0000000..b49fc12
--- /dev/null
+++ b/kmyfirewall/core/kmftarget.cpp
@@ -0,0 +1,386 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008
+*/
+
+#include "kmftarget.h"
+
+
+// QT includes
+#include <qwidget.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <ktrader.h>
+#include <kstandarddirs.h>
+#include <kio/netaccess.h>
+#include <kmessagebox.h>
+
+// Project Inclueds
+#include "ipaddress.h"
+#include "kmferror.h"
+#include "kmfnetzone.h"
+#include "kmfnetwork.h"
+#include "kmftargetconfig.h"
+#include "kmfconfig.h"
+#include "kmfdoc.h"
+#include "kmfiptdoc.h"
+#include "kmfgenericdoc.h"
+#include "kmfrulesetdoc.h"
+#include "kmfinstallerinterface.h"
+#include "kmfcompilerinterface.h"
+#include "kmfpluginfactory.h"
+#include "kprocesswrapper.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+KMFTarget::KMFTarget( NetfilterObject *parent, const char* name, const QString&, KMFNetwork* net ) : NetfilterObject( parent, name ) {
+ kdDebug() << "KMFTarget::KMFTarget( NetfilterObject *parent, const QString& name )" << endl;
+ m_network = net;
+ m_address = new IPAddress( 0,0,0,0 );
+ m_ssh_port = 22;
+ m_zone = 0;
+ m_config = new KMFTargetConfig( this, name );
+ m_doc = 0;
+
+ m_readOnly = false;
+}
+
+KMFTarget::~KMFTarget() {
+ kdDebug() << "KMFTarget::~KMFTarget()" << endl;
+ delete m_address;
+ if ( m_doc ) {
+ m_doc->deleteLater();
+ }
+}
+
+void KMFTarget::ensureDoc() {
+ if ( m_doc == 0 ) {
+ if ( KMFConfig::useGenericInterface() ) {
+ kdDebug() << "Creating new KMFGenericDoc( this, KMFGenericDoc, this )" << endl;
+ m_doc = new KMFGenericDoc( this, "KMFGenericDoc", this );
+ } else {
+ kdDebug() << "Creating new KMFIPTDoc( this, KMFIPTDoc, this )" << endl;
+ m_doc = new KMFIPTDoc( this, "KMFIPTDoc", this );
+ }
+ }
+}
+
+void KMFTarget::clear() {
+ if( m_doc ) {
+ m_doc->clear();
+ }
+}
+
+KMFDoc* KMFTarget::doc() {
+ ensureDoc();
+ return m_doc;
+}
+
+
+KMFNetwork* KMFTarget::network() {
+ kdDebug() << "KMFTarget::network()" << endl;
+ return m_network;
+}
+
+QString KMFTarget::toString() {
+ QString ret = QString(
+ "Host: " + address()->toString() +
+ " name: " + NetfilterObject::name() +
+ " GUIName: " + guiName() );
+ return ret;
+}
+
+bool KMFTarget::isLocalhost() {
+ return NetfilterObject::name() == Constants::Localhost_Name;
+}
+
+bool KMFTarget::isLocalExecuteTarget() {
+ return ( NetfilterObject::name() == Constants::Localhost_Name && ! KMFConfig::useSSHForLocalhost() );
+}
+
+QString KMFTarget::toFriendlyString() {
+ QString ret = QString( guiName() + " [" + address()->toString() +"]" );
+ return ret;
+}
+
+KMFTargetConfig *KMFTarget::config() {
+ return m_config;
+}
+
+KMFInstallerInterface* KMFTarget::installer() {
+ return KMFPluginFactory::KMFInstaller( this );
+}
+KMFCompilerInterface* KMFTarget::compiler() {
+ return KMFPluginFactory::KMFCompiler( this );
+}
+
+KMFRulesetDoc* KMFTarget::rulesetDoc() {
+// return dynamic_cast<KMFRulesetDoc*>( this );
+ ensureDoc();
+ return dynamic_cast<KMFRulesetDoc*>( m_doc );
+}
+
+int KMFTarget::type() {
+// kdDebug() << "KMFTarget::type()" << endl;
+ return NetfilterObject::KMFTARGET;
+}
+
+void KMFTarget::setSSHPort( int port ) {
+ m_ssh_port = port;
+}
+
+void KMFTarget::setReadOnly( bool onOff ) {
+ m_readOnly = onOff;
+}
+
+
+void KMFTarget::setGuiName( const QString& name){
+ if ( !name.isNull() && !name.isEmpty() && m_guiName != name ) {
+ m_guiName = name;
+ changed();
+ }
+}
+
+void KMFTarget::setAddress( const QString& addr ) {
+ m_address->setAddress( addr );
+ changed();
+}
+
+void KMFTarget::setParentZone( KMFNetZone* zone ){
+ m_zone = zone;
+ changed();
+}
+
+
+
+bool KMFTarget::isCurrentTarget() {
+ kdDebug() << "KMFTarget::isCurrentTarget()" << endl;
+ if ( ! zone() ) {
+ kdDebug() << "zone() == 0" << endl;
+ return false;
+ }
+ if ( ! zone()->network() ) {
+ kdDebug() << "zone()->network() == 0" << endl;
+ return false;
+ }
+ return ( zone()->network()->currentTarget()->uuid() == this->uuid() );
+}
+
+const QString& KMFTarget::name() {
+ // kdDebug() << "QString& KMFTarget::name()" << endl;
+ if ( ! zone() || readOnly() ) {
+ return NetfilterObject::name();
+ }
+
+ int index = 0;
+ bool found = false;
+ KMFNetZone *z = zone();
+ QPtrListIterator<KMFTarget> it( z->hosts() );
+ while ( it.current() && ! found ) {
+ if ( it.current() == this ) {
+ found = true;
+ }
+ index++;
+ ++it;
+ }
+ const QString& s = zone()->name() + "_target_"+ QString::number( index );
+ return *( new QString(s) );
+}
+
+const QString& KMFTarget::getFishUrl() {
+ QString addr = isLocalhost() ? "localhost" : m_address->toString();
+ return *( new QString("fish://root@" + addr + ":" + QString::number( m_ssh_port ) ) );
+}
+
+KMFError* KMFTarget::tryAutoConfiguration() {
+ kdDebug() << "KMFError* KMFTarget::tryAutoConfiguration()" << endl;
+ KMFError* err = new KMFError();
+
+ if ( isLocalExecuteTarget() ) {
+ KProcessWrapper::instance()->slotStartLocalJob( "autoconf", "uname", false, true );
+ } else {
+ KProcessWrapper::instance()->slotStartRemoteJob( "autoconf", "uname", rulesetDoc()->target() );
+ }
+ if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+ kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( KProcessWrapper::instance()->stdErr() );
+ return err;
+ }
+ QString retValUname = KProcessWrapper::instance()->stdCombined();
+ kdDebug() << "Found OS: " << retValUname << endl;
+
+ config()->setOS( retValUname.lower().remove( "\n" ).remove( " " ) );
+
+ QString path = "kmyfirewall/scripts/installer/";
+ path.append( config()->oS().lower() );
+ path.append( "/autoconfighelper.sh" );
+ kdDebug() << "Search Path: " << path << endl;
+ QString localFile = KGlobal::dirs() ->findResource( "data", path );
+
+ if ( ! KIO::NetAccess::exists( localFile, false, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "No autoconfigure script found for os: " << config()->oS() << endl;
+ emit sigTargetChanged( this );
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n("No autoconfigure script found for os: %1").arg( config()->oS() ) );
+ return err;
+ }
+
+ if ( isLocalExecuteTarget() ) {
+ KProcessWrapper::instance()->slotStartLocalJob( "autoconf", localFile, false, true );
+ } else {
+ KProcessWrapper::instance()->slotStartRemoteJob( "autoconf", localFile, rulesetDoc()->target() );
+ }
+
+
+ if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+ kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( KProcessWrapper::instance()->stdErr() );
+ return err;
+ }
+ QString retVal = KProcessWrapper::instance()->stdCombined();
+ kdDebug() << "AutoConf XML: \n"<< retVal << endl;
+ QDomDocument doc;
+ doc.setContent( retVal );
+ QStringList errors;
+
+ config()->setDistribution( "" );
+ config()->setIPTPath( "" );
+ config()->setInitPath( "" );
+ config()->setInterfaces( "" );
+ config()->setModprobePath( "" );
+ config()->setRcDefaultPath( "" );
+ config()->loadXML( doc, errors );
+
+
+ emit sigTargetChanged( this );
+ err->setErrType( KMFError::OK );
+ err->setErrMsg( "" );
+ return err;
+}
+
+// void KMFTarget::slotProcessFinished( const QString& jobName, int status, bool exitedNormal, const QString& stdOut, const QString& stdErr, const QString& completeOut ) {
+// kdDebug() << "KMFTarget::slotProcessFinished( const QString& jobName, int status, bool exitedNormal, const QString& stdOut, const QString& stdErr, const QString& completeOut )" << endl;
+//
+// disconnect(
+// KProcessWrapper::instance(),
+// SIGNAL( sigProcessFinished(
+// const QString&,
+// int,
+// bool,
+// const QString&,
+// const QString& ,
+// const QString& ) ),
+// this,
+// SLOT( slotProcessFinished(
+// const QString&,
+// int,
+// bool,
+// const QString&,
+// const QString&,
+// const QString& ) ) );
+//
+//
+// const QString& ret = completeOut;
+// kdDebug() << "Got Output: " << ret << endl;
+//
+// QDomDocument doc;
+// doc.setContent( ret );
+// QStringList errors;
+//
+// config()->setDistribution( "" );
+// config()->setIPTPath( "" );
+// config()->setInitPath( "" );
+// config()->setInterfaces( "" );
+// config()->setModprobePath( "" );
+// config()->setRcDefaultPath( "" );
+//
+// config()->loadXML( doc, errors );
+//
+// emit sigTargetChanged( this );
+// }
+
+const QDomDocument& KMFTarget::getDOMTree() {
+ // kdDebug() << "const QDomDocument& KMFTarget::getDOMTree() " << endl;
+ QDomDocument doc;
+
+ QDomElement root = doc.createElement( XML::Target_Element );
+ NetfilterObject::saveUuid( root );
+ root.setAttribute( XML::Name_Attribute, name() );
+ root.setAttribute( XML::GUIName_Attribute, m_guiName );
+ root.setAttribute( XML::Description_Attribute, description() );
+ root.setAttribute( XML::Address_Attribute, m_address->toString() );
+ root.setAttribute( XML::SSHPort_Attribute, sshPort() );
+
+ root.setAttribute( XML::ReadOnly_Attribute, readOnly() ? XML::BoolOn_Value : XML::BoolOff_Value );
+
+ root.appendChild( config()->getDOMTree( ) );
+
+ // QDomElement root = getDOM();
+ ensureDoc();
+ root.appendChild( m_doc->getDOMTree().documentElement() );
+ doc.appendChild( root );
+ return *( new QDomDocument( doc ) );
+}
+
+void KMFTarget::loadXML( const QDomDocument& doc, QStringList& errors ) {
+ kdDebug() << "void KMFTarget::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML( root, errors );
+}
+void KMFTarget::loadXML( QDomNode root, QStringList& errors ) {
+ kdDebug() << "void KMFTarget::loadXML( const QDomDocument& )" << endl;
+ NetfilterObject::loadUuid ( root, errors );
+ QString name = "";
+ QString guiName = "";
+ QString desc = "";
+ QString address = "";
+ QString readonly = "";
+ QString sshPort = "";
+
+ name = root.toElement().attribute( XML::Name_Attribute );
+
+ setDescription( root.toElement().attribute( XML::Description_Attribute ) );
+ setGuiName( root.toElement().attribute( XML::GUIName_Attribute ) );
+ setAddress( root.toElement().attribute( XML::Address_Attribute ) );
+ if ( root.toElement().hasAttribute( XML::SSHPort_Attribute ) ) {
+ setSSHPort( root.toElement().attribute( XML::SSHPort_Attribute ).toUInt() );
+ }
+ if ( root.toElement().attribute( XML::ReadOnly_Attribute ) == XML::BoolOn_Value ) {
+ setReadOnly( true );
+ } else {
+ setReadOnly( false );
+ }
+
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ if ( curr.isElement() && ( curr.nodeName() == XML::TargetConfig_Element ) ) {
+ kdDebug() << "void KMFTarget::loadXML( ) - parse targetconfig " << endl;
+ config()->loadXML( curr, errors );
+ }
+ if ( curr.isElement() &&
+ ( ( curr.nodeName() == XML::GenericDoc_DocumentElement ) || ( curr.nodeName() == XML::IPTDoc_DocumentElement ) ) ) {
+ kdDebug() << "void KMFTarget::loadXML( ) - parse ruleset: " << curr.nodeName() << endl;
+ ensureDoc();
+ m_doc->loadXML( curr, errors );
+ }
+ curr = curr.nextSibling();
+ }
+ kdDebug() << "void KMFTarget::loadXML( ) - My Config: " << toString() << endl;
+ changed();
+}
+
+}
+
diff --git a/kmyfirewall/core/kmftarget.h b/kmyfirewall/core/kmftarget.h
new file mode 100644
index 0000000..50819c6
--- /dev/null
+++ b/kmyfirewall/core/kmftarget.h
@@ -0,0 +1,128 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008
+*/
+#ifndef KMFTARGET_H
+#define KMFTARGET_H
+
+#include "netfilterobject.h"
+
+// QT includes
+
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qdom.h>
+
+// KDE includes
+#include <kdemacros.h>
+#include <kprocess.h>
+
+// Project includes
+#include "kmfnetzone.h"
+
+#include "xmlnames.h"
+class QWidget;
+
+namespace KMF {
+class IPAddress;
+class KMFError;
+class KMFTargetConfig;
+class KMFDoc;
+class KMFNetwork;
+class KMFRulesetDoc;
+class KMFProcessWrapper;
+class KMFInstallerInterface;
+class KMFCompilerInterface;
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+
+class KDE_EXPORT KMFTarget : public NetfilterObject {
+ Q_OBJECT
+public:
+ KMFTarget( NetfilterObject *parent, const char* name, const QString& targetName, KMFNetwork* net );
+
+ ~KMFTarget();
+
+ virtual int type();
+ virtual void clear();
+
+ virtual const QDomDocument& getDOMTree();
+ virtual void loadXML(const QDomDocument&, QStringList& errors );
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+ KMFNetZone* zone() const {
+ return m_zone;
+ }
+
+ bool isLocalhost();
+ bool isLocalExecuteTarget();
+
+ const QString& guiName() const {
+ return m_guiName;
+ };
+ void setGuiName( const QString& );
+
+ const QString& name();
+
+ IPAddress* address() {
+ return m_address;
+ };
+
+ void setAddress( const QString& );
+
+ int sshPort() const {
+ return m_ssh_port;
+ };
+
+ void setSSHPort( int );
+
+ bool readOnly() const {
+ return m_readOnly;
+ };
+ void setReadOnly( bool );
+
+ bool isCurrentTarget();
+ KMFNetwork* network();
+
+ void setParentZone( KMFNetZone* );
+ KMFError* tryAutoConfiguration();
+
+ KMFTargetConfig* config();
+
+ QString toString();
+ QString toFriendlyString();
+ const QString& getFishUrl();
+
+
+ KMFDoc* doc();
+
+ KMFRulesetDoc* rulesetDoc();
+ KMFInstallerInterface* installer();
+ KMFCompilerInterface* compiler();
+
+ protected:
+ QGuardedPtr<KMFNetZone> m_zone;
+ IPAddress *m_address;
+ int m_ssh_port;
+ QString m_guiName;
+
+ private:
+ void ensureDoc();
+ KMFTargetConfig *m_config;
+ KMFDoc *m_doc;
+ KMFNetwork *m_network;
+ bool m_readOnly;
+ QString m_allOut;
+ signals:
+ void sigTargetChanged( KMFTarget* );
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmftargetconfig.cpp b/kmyfirewall/core/kmftargetconfig.cpp
new file mode 100644
index 0000000..990028d
--- /dev/null
+++ b/kmyfirewall/core/kmftargetconfig.cpp
@@ -0,0 +1,240 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008
+*/
+#include "kmftargetconfig.h"
+
+// QT includes
+#include <qstring.h>
+#include <qdom.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "kmftarget.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+KMFTargetConfig::KMFTargetConfig ( KMFTarget* target, const char* name ) : NetfilterObject ( target, name ) {
+ m_target = target;
+ m_OS = "linux";
+ m_Backend = "iptables";
+}
+
+KMFTargetConfig::~KMFTargetConfig() {}
+
+
+int KMFTargetConfig::type() {
+ // kdDebug() << "KMFTargetConfig::type()" << endl;
+ return NetfilterObject::KMFTARGETCONFIG;
+}
+
+void KMFTargetConfig::clear() {
+}
+
+bool KMFTargetConfig::isValid() const {
+ if (
+ distribution().isEmpty() ||
+ IPTPath().isEmpty() ||
+ initPath().isEmpty() ||
+ modprobePath().isEmpty() ||
+ rcDefaultPath().isEmpty() /* ||
+ interfaces().isEmpty() */
+ ) {
+ kdDebug() << "KMFTargetConfig::isValid() " << false << endl;
+ return false;
+ } else {
+ kdDebug() << "KMFTargetConfig::isValid() " << true << endl;
+ return true;
+ }
+}
+
+void KMFTargetConfig::setBackend ( const QString & v ) {
+ if ( m_Backend == v ) {
+ return;
+ }
+ m_Backend = v;
+ changed();
+}
+
+void KMFTargetConfig::setInterfaces ( const QStringList & v ) {
+ if ( m_Interfaces == v ) {
+ return;
+ }
+ m_Interfaces = v;
+ changed();
+}
+
+void KMFTargetConfig::setModprobePath ( const QString & v ) {
+ if ( m_ModprobePath == v ) {
+ return;
+ }
+ m_ModprobePath = v;
+ changed();
+}
+
+void KMFTargetConfig::setIPTPath ( const QString & v ) {
+ if ( m_IPTPath == v ) {
+ return;
+ }
+ m_IPTPath = v;
+ changed();
+}
+
+void KMFTargetConfig::setRcDefaultPath ( const QString & v ) {
+ if ( m_RcDefaultPath == v ) {
+ return;
+ }
+ m_RcDefaultPath = v;
+ changed();
+}
+
+void KMFTargetConfig::setInitPath ( const QString & v ) {
+ if ( m_InitPath == v ) {
+ return;
+ }
+ m_InitPath = v;
+ changed();
+}
+
+void KMFTargetConfig::setDistribution ( const QString & v ) {
+ if ( m_Distribution == v ) {
+ return;
+ }
+ m_Distribution = v;
+ changed();
+}
+
+void KMFTargetConfig::setOS ( const QString & v ) {
+ if ( m_OS == v ) {
+ return;
+ }
+ m_OS = v;
+ changed();
+}
+
+const QDomDocument& KMFTargetConfig::getDOMTree() {
+ // kdDebug() << "const QDomDocument& KMFTargetConfig::getDOMTree() " << endl;
+ QDomDocument doc;
+ QDomElement root = doc.createElement ( XML::TargetConfig_Element );
+ NetfilterObject::saveUuid( root );
+ root.setAttribute ( XML::Name_Attribute, name() );
+ root.setAttribute ( XML::Description_Attribute, description() );
+
+ QStringList ints = interfaces();
+ for ( QStringList::Iterator it = ints.begin(); it != ints.end(); ++it ) {
+ QDomElement interface = doc.createElement ( XML::Interface_Element );
+ interface.setAttribute ( XML::Name_Attribute, *it );
+ root.appendChild ( interface );
+ }
+
+ QDomElement os = doc.createElement ( XML::OS_Element );
+ os.setAttribute ( XML::Name_Attribute, oS().lower() );
+ root.appendChild ( os );
+
+ QDomElement el_backend = doc.createElement ( XML::BackEnd_Element );
+ el_backend.setAttribute ( XML::Name_Attribute, backend().lower() );
+ root.appendChild ( el_backend );
+
+ QDomElement el_distribution = doc.createElement ( XML::Distribution_Element );
+ el_distribution.setAttribute ( XML::Name_Attribute, distribution() );
+ root.appendChild ( el_distribution );
+
+ QDomElement el_initPath = doc.createElement ( XML::InitPath_Element );
+ el_initPath.setAttribute ( XML::Name_Attribute, initPath() );
+ root.appendChild ( el_initPath );
+
+ QDomElement el_IPTPath = doc.createElement ( XML::IPTPath_Element );
+ el_IPTPath.setAttribute ( XML::Name_Attribute, IPTPath() );
+ root.appendChild ( el_IPTPath );
+
+ QDomElement el_modprobePath = doc.createElement ( XML::ModprobePath_Element );
+ el_modprobePath.setAttribute ( XML::Name_Attribute, modprobePath() );
+ root.appendChild ( el_modprobePath );
+
+ QDomElement el_rcDefaultPath = doc.createElement ( XML::RcDefaultPath_Element );
+ el_rcDefaultPath.setAttribute ( XML::Name_Attribute, rcDefaultPath() );
+ root.appendChild ( el_rcDefaultPath );
+ doc.appendChild ( root );
+ return * ( new QDomDocument ( doc ) );
+}
+
+void KMFTargetConfig::loadXML ( const QDomDocument& doc, QStringList& errors ) {
+ kdDebug() << "void KMFTargetConfig::loadXML( const QDomDocument& )" << endl;
+ QDomElement root = doc.documentElement();
+ loadXML ( root, errors );
+}
+
+void KMFTargetConfig::loadXML ( QDomNode root, QStringList& errors ) {
+ kdDebug() << "void KMFTargetConfig::loadXML( QDomNode root )" << endl;
+ NetfilterObject::loadUuid ( root, errors );
+ QDomDocument protocol_doc;
+ protocol_doc.appendChild ( root.cloneNode ( true ) );
+ kdDebug() << "XML: " << protocol_doc.toString() << endl;
+
+
+ QString name = "";
+ QString desc = "";
+
+ setDescription ( root.toElement().attribute ( XML::Description_Attribute ) );
+ setName ( root.toElement().attribute ( XML::Name_Attribute ) );
+
+ m_Interfaces.clear();
+
+ QDomNode curr = root.firstChild();
+ while ( !curr.isNull() ) {
+ if ( curr.isElement() ) {
+ kdDebug() << "Parsing Node: " << curr.nodeName() << endl;
+ if ( ( curr.nodeName() == XML::Interface_Element ) ) {
+ m_Interfaces.append ( curr.toElement().attribute ( XML::Name_Attribute ) );
+ } else if ( ( curr.nodeName() == XML::OS_Element ) ) {
+ setOS ( curr.toElement().attribute ( XML::Name_Attribute ) );
+ } else if ( ( curr.nodeName() == XML::BackEnd_Element ) ) {
+ setBackend ( curr.toElement().attribute ( XML::Name_Attribute ) );
+ } else if ( ( curr.nodeName() == XML::Distribution_Element ) ) {
+ setDistribution ( curr.toElement().attribute ( XML::Name_Attribute ) );
+ } else if ( ( curr.nodeName() == XML::InitPath_Element ) ) {
+ setInitPath ( curr.toElement().attribute ( XML::Name_Attribute ) );
+ } else if ( ( curr.nodeName() == XML::IPTPath_Element ) ) {
+ setIPTPath ( curr.toElement().attribute ( XML::Name_Attribute ) );
+ } else if ( ( curr.nodeName() == XML::ModprobePath_Element ) ) {
+ setModprobePath ( curr.toElement().attribute ( XML::Name_Attribute ) );
+ } else if ( ( curr.nodeName() == XML::RcDefaultPath_Element ) ) {
+ setRcDefaultPath ( curr.toElement().attribute ( XML::Name_Attribute ) );
+ } else {
+ // FIXME: Check Fro Errors
+ kdDebug() << "KMFTargetConfig::loadXML - ERROR: unknown tag: " << curr.nodeName() << " inoring tag!" << endl;
+ }
+ }
+ curr = curr.nextSibling();
+ }
+ kdDebug() << "Parsed Config: " << toString() << endl;
+ changed();
+}
+
+QString KMFTargetConfig::toString() {
+ QString s = QString (
+ "Interfaces: " + m_Interfaces.join ( "," ) + "\n" +
+ "OS: " + oS() + "\n" +
+ "backend: " + backend() + "\n" +
+ "distribution: " + distribution() + "\n" +
+ "initPath: " + initPath() + "\n" +
+ "IPTPath: " + IPTPath() + "\n" +
+ "modprobePath: " + modprobePath() + "\n" +
+ "rcDefaultPath: " + rcDefaultPath() );
+ return s;
+
+}
+
+}
+
diff --git a/kmyfirewall/core/kmftargetconfig.h b/kmyfirewall/core/kmftargetconfig.h
new file mode 100644
index 0000000..fb2ec8e
--- /dev/null
+++ b/kmyfirewall/core/kmftargetconfig.h
@@ -0,0 +1,188 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008
+*/
+#ifndef KMFTARGETCONFIG_H
+#define KMFTARGETCONFIG_H
+
+
+// QT includes
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qdom.h>
+#include <qobject.h>
+
+
+#include <qstring.h>
+
+// KDE includes
+#include <kdemacros.h>
+#include <kurl.h>
+
+// Project includes
+#include "netfilterobject.h"
+
+namespace KMF {
+class KMFTarget;
+
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+ */
+
+class KDE_EXPORT KMFTargetConfig : public NetfilterObject {
+ public:
+ KMFTargetConfig( KMFTarget* target, const char* name );
+
+ virtual ~KMFTargetConfig();
+
+ virtual int type();
+ virtual void clear();
+
+ virtual const QDomDocument& getDOMTree();
+ virtual void loadXML(const QDomDocument&, QStringList& errors );
+ virtual void loadXML( QDomNode, QStringList& errors );
+
+ /**
+ Get the target object for this configuration
+ */
+ KMFTarget* target() const {
+ return m_target;
+ }
+
+ /**
+ Set Which OS are we using.
+ */
+ void setOS( const QString & v );
+
+ /**
+ Get Which OS are we using.
+ */
+ const QString& oS() const {
+ return m_OS;
+ }
+
+ /**
+ Set Firewalling backend name.
+ */
+ void setBackend( const QString & );
+
+ /**
+ Get Firewalling backend name.
+ */
+ const QString& backend() const {
+ return m_Backend;
+ }
+
+
+ /**
+ Set What kind of ditribution are we using.
+ */
+ void setDistribution( const QString & v );
+
+ /**
+ Get What kind of ditribution are we using.
+ */
+ const QString& distribution() const {
+ return m_Distribution;
+ }
+
+ /**
+ Set Path to the init scripts
+ */
+ void setInitPath( const QString & v );
+
+ /**
+ Get Path to the init scripts
+ */
+ const QString& initPath() const {
+ return m_InitPath;
+ }
+
+ /**
+ Set Path to the default runlevel directory.
+ */
+ void setRcDefaultPath( const QString & v );
+
+ /**
+ Get Path to the default runlevel directory.
+ */
+ const QString& rcDefaultPath() const {
+ return m_RcDefaultPath;
+ }
+
+ /**
+ Set Path to iptables binary.
+ */
+ void setIPTPath( const QString & v );
+
+ /**
+ Get Path to iptables binary.
+ */
+ const QString& IPTPath() const {
+ return m_IPTPath;
+ }
+
+ /**
+ Set Path to the modprobe binary.
+ */
+ void setModprobePath( const QString & v );
+
+ /**
+ Get Path to the modprobe binary.
+ */
+ const QString& modprobePath() const {
+ return m_ModprobePath;
+ }
+
+
+
+ /**
+ Set Network interfaces
+ */
+ void setInterfaces( const QStringList & v );
+
+ /**
+ Get Network interfaces
+ */
+ QStringList& interfaces() {
+ return m_Interfaces;
+ }
+
+ /**
+ Get Indicator if the config is valid
+ */
+ bool isValid() const;
+
+ QString toString();
+
+private:
+ KMFTarget* m_target;
+
+ QString m_targetName;
+ KURL m_configFile;
+
+ // GENERAL
+ QString m_OS;
+ QString m_Backend;
+
+ // PATHS
+ QString m_Distribution;
+ QString m_InitPath;
+ QString m_RcDefaultPath;
+ QString m_IPTPath;
+ QString m_ModprobePath;
+ QString m_CurrentGenericConfiguration;
+ QString m_CurrentIPTConfiguration;
+
+ // INTERFACES
+ QStringList m_Interfaces;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmftransaction.cpp b/kmyfirewall/core/kmftransaction.cpp
new file mode 100644
index 0000000..1ac2900
--- /dev/null
+++ b/kmyfirewall/core/kmftransaction.cpp
@@ -0,0 +1,81 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008
+*/
+#include "kmftransaction.h"
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "netfilterobject.h"
+#include "kmfundoengine.h"
+
+namespace KMF {
+
+KMFTransaction::KMFTransaction( const QString& transactionName, NetfilterObject* highestAffectedObject ) {
+ m_transactionName = transactionName;
+ m_uuID = QUuid::createUuid();
+ m_objectUuid = highestAffectedObject->uuid();
+ m_undoXML = highestAffectedObject->getXMLSniplet();
+ kdDebug() << "Created " << toString() << endl;
+}
+
+KMFTransaction::~KMFTransaction() {}
+
+void KMFTransaction::commit() {
+ NetfilterObject* obj = NetfilterObject::findObject( m_objectUuid );
+ if ( ! obj ) {
+ return;
+ }
+ m_redoXML = obj->getXMLSniplet();
+}
+
+NetfilterObject* KMFTransaction::undo() {
+ NetfilterObject* obj = NetfilterObject::findObject( m_objectUuid );
+ if ( ! obj ) {
+ KMFUndoEngine::instance()->log( i18n("KMFTransaction::undo() No object found with uuid: %1").arg( m_objectUuid ), KMFError::WARNING, 0 );
+ return 0;
+ }
+ if( m_undoXML.isNull() ) {
+ return 0;
+ }
+ QDomDocument doc;
+ doc.setContent( m_undoXML );
+ QStringList * errors = new QStringList();
+ obj->loadXML( doc, *errors );
+ return obj;
+}
+
+NetfilterObject* KMFTransaction::redo() {
+ NetfilterObject* obj = NetfilterObject::findObject( m_objectUuid );
+ if ( ! obj ) {
+ KMFUndoEngine::instance()->log( i18n("KMFTransaction::redo() No object found with uuid: %1").arg( m_objectUuid ), KMFError::WARNING, 0 );
+ return 0;
+ }
+ if ( m_redoXML.isNull() ) {
+ return 0;
+ }
+ QDomDocument doc;
+ doc.setContent( m_redoXML );
+ QStringList * errors = new QStringList();
+ obj->loadXML( doc, *errors );
+ return obj;
+}
+
+const QString& KMFTransaction::toString() {
+ QString s = "";
+ s.append( i18n("Transaction: %1 uuid: %2\n" ).arg( name() ).arg( uuid().toString() ) );
+ s.append( i18n("-- Changed ObjectUuid: %1").arg( m_objectUuid.toString() ) );
+ return *( new QString( s ) );
+}
+
+}
diff --git a/kmyfirewall/core/kmftransaction.h b/kmyfirewall/core/kmftransaction.h
new file mode 100644
index 0000000..b88f088
--- /dev/null
+++ b/kmyfirewall/core/kmftransaction.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008
+*/
+#ifndef KMFTRANSACTION_H
+#define KMFTRANSACTION_H
+
+#include "qdict.h"
+#include "qvaluelist.h"
+#include "qptrlist.h"
+#include "qstring.h"
+#include "qobject.h"
+#include "quuid.h"
+#include "qguardedptr.h"
+
+
+namespace KMF {
+class NetfilterObject;
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+
+class KMFTransaction{
+ friend class KMFUndoEngine;
+ public:
+ KMFTransaction( const QString& transactionName, NetfilterObject* );
+ ~KMFTransaction();
+ const QString& name() const {
+ return m_transactionName;
+ };
+
+ const QUuid& objectUuid() const {
+ return m_objectUuid;
+ };
+
+ const QUuid& uuid() const {
+ return m_uuID;
+ };
+ const QString& toString();
+
+ const QString& undoXML() const {
+ return m_undoXML;
+ };
+
+ const QString& redoXML() const {
+ return m_redoXML;
+ };
+
+ private:
+ KMFTransaction();
+ void commit();
+ NetfilterObject* undo();
+ NetfilterObject* redo();
+
+ private:
+ QString m_transactionName;
+ // int m_objectID;
+ QUuid m_objectUuid;
+
+ QUuid m_uuID;
+ QString m_undoXML;
+ QString m_redoXML;
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmfundoengine.cpp b/kmyfirewall/core/kmfundoengine.cpp
new file mode 100644
index 0000000..696e5f6
--- /dev/null
+++ b/kmyfirewall/core/kmfundoengine.cpp
@@ -0,0 +1,250 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008
+*/
+#include "kmfundoengine.h"
+
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+
+#include "kmftransaction.h"
+#include "kmferror.h"
+#include "kmyfirewallinterface.h"
+#include "kmfappstate.h"
+
+namespace KMF {
+
+//########## KMFUndoEngine ##############
+//#### static stuff
+KMFUndoEngine* KMFUndoEngine::m_instance = 0;
+KMFUndoEngine* KMFUndoEngine::instance() {
+ if ( ! m_instance ) {
+ m_instance = new KMFUndoEngine( 0 , "KMFUndoEngine" );
+ }
+
+ return m_instance;
+}
+//##### end static stuff
+
+KMFUndoEngine::KMFUndoEngine( QObject* parent, const char* name ) : QObject( parent, name ) {
+ MAX_UNDO = 10;
+ m_in_transaction = false;
+ is_saved = true;
+// m_transactionName = "";
+ m_app = 0;
+}
+
+KMFUndoEngine::~KMFUndoEngine() {}
+
+void KMFUndoEngine::setMaxUndo ( uint num ) {
+ MAX_UNDO = num;
+}
+
+// void KMFUndoEngine::setPreserveObjectUuid( bool onOff ) {
+// // m_preserveObjectUuid = onOff;
+// }
+
+bool KMFUndoEngine::inTransaction() {
+ return m_in_transaction;
+};
+
+void KMFUndoEngine::setKMFInterface( KMyFirewallInterface *app ) {
+ m_app = app;
+}
+
+QValueList< KMFTransaction* >& KMFUndoEngine::undoTransactions() {
+ return m_undo_transactionObjects;
+}
+
+QValueList< KMFTransaction* >& KMFUndoEngine::redoTransactions() {
+ return m_redo_transactionObjects;
+}
+
+KMFTransaction * KMFUndoEngine::findTransction( const QUuid& uuid ) {
+ QValueList< KMFTransaction* >::iterator it;
+ for ( it = m_undo_transactionObjects.begin(); it != m_undo_transactionObjects.end(); ++it ) {
+ if ( (*it)->uuid() == uuid ) {
+ return *it;
+ }
+ }
+ for ( it = m_redo_transactionObjects.begin(); it != m_redo_transactionObjects.end(); ++it ) {
+ if ( (*it)->uuid() == uuid ) {
+ return *it;
+ }
+ }
+ kdDebug() << "Not TRansaction found by uuid: " << uuid.toString() << endl;
+ return 0;
+}
+
+void KMFUndoEngine::saved() {
+ kdDebug() << "void KMFUndoEngine::startTransaction()" << endl;
+ is_saved = true;
+}
+
+bool KMFUndoEngine::isSaved() {
+ // kdDebug() << "void KMFUndoEngine::isSaved() -> " << is_saved << endl;
+ return is_saved;
+}
+
+void KMFUndoEngine::log( const QString& msg, int kmfErrorType = KMFError::NORMAL, NetfilterObject* obj = 0 ) {
+ QString m = msg;
+ QString s = "";
+ if ( obj ) {
+ m.prepend( i18n("<i>%1:</i> ").arg( obj->name() ) );
+ }
+ s.append( KMFError::getAsString( kmfErrorType, m ) );
+ emit sigLog( *( new QString(s) ) );
+}
+
+void KMFUndoEngine::changed ( const QUuid& id ) {
+ NetfilterObject* obj = NetfilterObject::findObject ( id );
+ if ( ! obj ) {
+ log( i18n("Change non exiting object id: %1.").arg( id ), KMFError::FATAL );
+ return;
+ }
+ is_saved = false;
+ if ( m_app && KMFAppState::upAndRunning() ) {
+ m_app->updateCaption();
+ }
+ if ( ! m_in_transaction ) {
+ // log( i18n("Change object: %1 without transaction.").arg( obj->name() ), KMFError::WARNING );
+ return;
+ }
+
+ NetfilterObject *highestAffected = NetfilterObject::findObject( m_currentTransaction->objectUuid() );
+ if ( ! highestAffected || obj != highestAffected && ! obj->isChildOf( highestAffected->uuid() ) ) {
+ log( i18n("Change object: %1 outside of declared highestAffectedObject: %2 in transaction: %3.").arg( obj->name() ).arg( highestAffected->name() ).arg( m_currentTransaction->name() ), KMFError::WARNING );
+ }
+}
+
+void KMFUndoEngine::clearStacks() {
+ m_undo_transactionObjects.clear();
+ m_redo_transactionObjects.clear();
+ if ( m_app && KMFAppState::upAndRunning() ) {
+ m_app->enableUndo ( false );
+ m_app->enableRedo ( false );
+ }
+ emit sigStackChanged();
+}
+
+void KMFUndoEngine::startTransaction ( NetfilterObject* highestAffectedObject, const QString& name ) {
+ kdDebug() << "void KMFUndoEngine::startTransaction( const QString& " << name << " )" << endl;
+ m_in_transaction = true;
+ m_currentTransaction = new KMFTransaction( name, highestAffectedObject );
+}
+
+void KMFUndoEngine::abortTransaction() {
+ kdDebug() << "void KMFUndoEngine::abortTransaction()" << endl;
+ if ( ! m_in_transaction ) {
+ log( "KMFUndoEngine::abortTransaction() - No active Transaction!", KMFError::NORMAL, 0 );
+ return;
+ }
+ m_in_transaction = false;
+ delete m_currentTransaction;
+ m_currentTransaction = 0;
+}
+
+void KMFUndoEngine::endTransaction() {
+ kdDebug() << "void KMFUndoEngine::endTransaction()" << endl;
+ if ( ! m_in_transaction || ! m_currentTransaction ) {
+ log( "KMFUndoEngine::endTransaction() - No active Transaction!", KMFError::NORMAL, 0 );
+ return;
+ }
+ m_currentTransaction->commit();
+ m_undo_transactionObjects.append( m_currentTransaction );
+
+ while ( m_undo_transactionObjects.count() > KMFUndoEngine::maxUndo() ) {
+ m_undo_transactionObjects.pop_front();
+ }
+
+ if ( m_undo_transactionObjects.empty() ) {
+ m_app->enableUndo ( false );
+ m_app->enableRedo ( false );
+ } else {
+ m_app->enableUndo ( true );
+ }
+
+ m_in_transaction = false;
+ m_currentTransaction = 0;
+ emit sigStackChanged();
+ return;
+}
+
+
+QValueList< NetfilterObject* >& KMFUndoEngine::undo() {
+ QValueList< NetfilterObject* > *affected = new QValueList< NetfilterObject* >;
+
+ kdDebug() << "void KMFUndoEngine::undo()" << endl;
+ if ( m_undo_transactionObjects.empty() ) {
+ kdDebug() << "No undo transactions available" << endl;
+ m_app->enableUndo ( false );
+ return *affected;
+ }
+
+ KMFTransaction* transaction = m_undo_transactionObjects.back();
+ NetfilterObject *obj = transaction->undo();
+ if ( obj ) {
+ affected->append( obj );
+ }
+ m_undo_transactionObjects.pop_back();
+ m_redo_transactionObjects.append ( transaction );
+
+ if ( m_redo_transactionObjects.empty() ) {
+ m_app->enableRedo ( false );
+ } else {
+ m_app->enableRedo ( true );
+ }
+
+ if ( m_undo_transactionObjects.empty() ) {
+ kdDebug() << "No More undo transactions available" << endl;
+ m_app->enableUndo ( false );
+ }
+ emit sigStackChanged();
+ return *affected;
+}
+
+
+
+QValueList< NetfilterObject* >& KMFUndoEngine::redo() {
+ kdDebug() << "void KMFIPTDoc::redo()" << endl;
+ QValueList< NetfilterObject* > *affected = new QValueList< NetfilterObject* >;
+ if ( m_redo_transactionObjects.empty() ) {
+ kdDebug() << "No undo transactions available" << endl;
+ m_app->enableRedo ( false );
+ return *affected;
+ }
+
+ KMFTransaction* transaction = m_redo_transactionObjects.back();
+ NetfilterObject *obj = transaction->redo();
+ if ( obj ) {
+ affected->append( obj );
+ }
+
+ m_redo_transactionObjects.pop_back();
+ m_undo_transactionObjects.append ( transaction );
+ if ( m_undo_transactionObjects.empty() ) {
+ m_app->enableUndo ( false );
+ } else {
+ m_app->enableUndo ( true );
+ }
+
+ if ( m_redo_transactionObjects.empty() ) {
+ kdDebug() << "No More redo transactions available" << endl;
+ m_app->enableRedo ( false );
+ }
+ emit sigStackChanged();
+ return *affected;
+}
+
+}
diff --git a/kmyfirewall/core/kmfundoengine.h b/kmyfirewall/core/kmfundoengine.h
new file mode 100644
index 0000000..2872ebb
--- /dev/null
+++ b/kmyfirewall/core/kmfundoengine.h
@@ -0,0 +1,147 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008
+*/
+#ifndef KMFUNDOENGINE_H
+#define KMFUNDOENGINE_H
+
+
+// qt includes
+#include "qdict.h"
+#include "qvaluelist.h"
+#include "qptrlist.h"
+#include "qstring.h"
+#include "qobject.h"
+
+// project includes
+#include "kmftransaction.h"
+#include "netfilterobject.h"
+// #include "kmfnetwork.h"
+#include "kmferror.h"
+
+namespace KMF {
+class KMyFirewallInterface;
+class KMFTransaction;
+class KMFNetwork;
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+
+class KMFUndoEngine : public QObject {
+ Q_OBJECT
+
+ friend class KMFTransaction;
+ friend class KMFNetwork;
+ friend class KMFProtocol;
+ friend class KMFProtocolCategory;
+ friend class KMFProtocolLibrary;
+//############# Beginn static stuff ##############
+public:
+ /** return the one and only instance */
+ static KMFUndoEngine* instance();
+private:
+ static KMFUndoEngine* m_instance;
+
+//############# End static stuff ##############
+protected:
+ uint MAX_UNDO;
+public:
+ ~KMFUndoEngine();
+
+ /** Set the numbers of undo/redo steps stored */
+ void setMaxUndo( uint );
+
+ /** Get the numbers of undo/redo steps stored */
+ uint maxUndo() {
+ return MAX_UNDO;
+ };
+
+ /** Start a transaction e.g. collection of changes that will
+ be tracked to allow undo/redo */
+ void startTransaction( NetfilterObject* /* highestAffectedObject */, const QString& name );
+
+ /** Abort a started transaction */
+ void abortTransaction();
+
+ /** Hold list of available undo transaction objects */
+ QValueList< KMFTransaction* >& undoTransactions();
+
+ /** Hold list of available redo transaction objects */
+ QValueList< KMFTransaction* >& redoTransactions();
+
+ /** find the transaction with id in undo/redo lists */
+ KMFTransaction * findTransction( const QUuid& id );
+
+ /** End a transaction e.g. collection of changes that will
+ be tracked to allow undo/redo */
+ void endTransaction();
+
+ /** Check if we are inside a transaction */
+ bool inTransaction();
+
+ /** store the provided id in the changes list. */
+ void changed( const QUuid& id );
+
+ /** Remove all stored transacation */
+ void clearStacks();
+
+ /** Check if the doc is saved */
+ bool isSaved();
+ void saved();
+
+ /** Undo last transaction, return list of affected objects */
+ QValueList< NetfilterObject* >& undo();
+
+ /** Redo last undo-transaction, return list of affected objects */
+ QValueList< NetfilterObject* >& redo();
+
+ /** Set the ap instance */
+ void setKMFInterface( KMyFirewallInterface *app );
+
+ /** log message entry */
+ void log( const QString&, int kmfErrorType /* = KMFError::NORMAL */, NetfilterObject* /* obj = 0 */ );
+
+// bool preserveObjectUuid() const {
+// // return m_preserveObjectUuid;
+// return true;
+// }
+
+protected:
+ KMyFirewallInterface *m_app;
+
+private:
+// QString m_transactionName;
+ bool m_in_transaction;
+ bool is_saved;
+// bool m_preserveObjectUuid;
+
+ QValueList< KMFTransaction* > m_undo_transactionObjects;
+ QValueList< KMFTransaction* > m_redo_transactionObjects;
+
+// QValueList<int> m_changed_objects;
+// NetfilterObject *m_highestAffectedObject;
+ KMFTransaction *m_currentTransaction;
+
+private:
+ KMFUndoEngine();
+ KMFUndoEngine( QObject*, const char* );
+
+ /** Make the loadXML in NEtfilterObject load the uuid from xml */
+// void setPreserveObjectUuid( bool onOff );
+
+
+
+
+signals:
+ void sigStackChanged();
+ void sigLog( const QString& );
+};
+}
+#endif
diff --git a/kmyfirewall/core/kmyfirewallinterface.cpp b/kmyfirewall/core/kmyfirewallinterface.cpp
new file mode 100644
index 0000000..6d2c6e9
--- /dev/null
+++ b/kmyfirewall/core/kmyfirewallinterface.cpp
@@ -0,0 +1,45 @@
+//
+// C++ Implementation: kmyfirewallinterface
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+
+#include "kmyfirewallinterface.h"
+
+#include <kdebug.h>
+
+#include <stdlib.h>
+
+namespace KMF {
+KMyFirewallInterface* KMyFirewallInterface::m_instance = 0;
+KMyFirewallInterface::KMyFirewallInterface() {
+ if ( m_instance ) {
+ kdDebug() << "ERROR: Duplicate creation of KMyFirewallInterface" << endl;
+ exit( 1 );
+
+ }
+ m_instance = this;
+}
+KMyFirewallInterface::~KMyFirewallInterface() {}
+
+KMyFirewallInterface* KMyFirewallInterface::instance() {
+ return m_instance;
+}
+
+}
diff --git a/kmyfirewall/core/kmyfirewallinterface.h b/kmyfirewall/core/kmyfirewallinterface.h
new file mode 100644
index 0000000..afaec4b
--- /dev/null
+++ b/kmyfirewall/core/kmyfirewallinterface.h
@@ -0,0 +1,64 @@
+//
+// C++ Interface: kmyfirewallinterface
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMYFIREWALLINTERFACE_H
+#define KMYFIREWALLINTERFACE_H
+
+/**
+@author Christian Hubinger
+*/
+
+#include <qobject.h>
+#include <kdemacros.h>
+
+class QWidget;
+
+namespace KMF {
+class KMFProcOut;
+class KMFDoc;
+class KMFNetwork;
+class KMFCompilerPlugin;
+
+
+class KDE_EXPORT KMyFirewallInterface {
+public:
+ KMyFirewallInterface();
+ virtual ~KMyFirewallInterface();
+// virtual KMFDoc* doc() = 0;
+ virtual KMFNetwork* network() = 0;
+ virtual void showEditor() = 0;
+ virtual void showOutput() = 0;
+ virtual void setOutputWidget( QWidget* wid ) = 0;
+ virtual void checkStatus() = 0;
+ virtual void updateCaption() = 0;
+ virtual void enableUndo( bool ) = 0;
+ virtual void enableRedo( bool ) = 0;
+
+public:
+ static KMyFirewallInterface* instance();
+
+private:
+ static KMyFirewallInterface* m_instance;
+
+
+};
+}
+#endif
diff --git a/kmyfirewall/core/kprocesswrapper.cpp b/kmyfirewall/core/kprocesswrapper.cpp
new file mode 100644
index 0000000..782b70a
--- /dev/null
+++ b/kmyfirewall/core/kprocesswrapper.cpp
@@ -0,0 +1,248 @@
+//
+// C++ Implementation: kprocesswrapper
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2008
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kprocesswrapper.h"
+
+// QT Includes
+#include <qwidget.h>
+#include <quuid.h>
+#include <qfile.h>
+#include <qtextstream.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kprocess.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kurl.h>
+#include <ktempfile.h>
+#include <kio/netaccess.h>
+
+// Project includes
+#include "kmftarget.h"
+
+namespace KMF {
+
+//########## KMFUndoEngine ##############
+//#### static stuff
+KProcessWrapper* KProcessWrapper::m_instance = 0;
+KProcessWrapper* KProcessWrapper::instance() {
+ if ( ! m_instance ) {
+ m_instance = new KProcessWrapper( KApplication::kApplication()->mainWidget() , "KProcessWrapper" );
+ }
+ return m_instance;
+}
+//##### end static stuff
+
+
+
+KProcessWrapper::KProcessWrapper( QObject* parent, const char* name ) : QObject( parent, name ) {
+ m_stderrbuf = new QString( "" );
+ m_stdoutbuf = new QString( "" );
+ m_childproc = new KProcess();
+ m_status = -1;
+ m_exitedNormal = false;
+
+ connect( m_childproc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), this, SLOT( slotReceivedOutput( KProcess*, char*, int ) ) );
+ connect( m_childproc, SIGNAL( receivedStderr( KProcess*, char*, int ) ), this, SLOT( slotReceivedError( KProcess*, char*, int ) ) );
+ connect( m_childproc, SIGNAL( processExited( KProcess* ) ), this, SLOT( slotProcessExited( KProcess* ) ) ) ;
+}
+
+KProcessWrapper::~KProcessWrapper()
+{
+}
+
+void KProcessWrapper::slotStartLocalJob( const QString& jobName, const QString& command, bool useKdeSu , bool synchronous = false ) {
+ kdDebug() << "Start Local Job: " << jobName << " " << command << endl;
+ kdDebug() << "synchronous: " << synchronous << endl;
+ m_jobName = jobName;
+ *m_stdoutbuf = "";
+ *m_stderrbuf = "";
+ m_allOut = "";
+ m_stdOut = "";
+ m_stdErr = "";
+ QString localScriptFile = command;
+ KTempFile *f = new KTempFile();
+ if ( ! KIO::NetAccess::exists( localScriptFile, false, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "KProcessWrapper::slotStartLocalJob(...) - creating temporary script file." << endl;
+ QTextStream *ts = f->textStream();
+ *ts << command << endl;
+ f->sync();
+ f->close();
+ localScriptFile = f->name();
+ }
+
+
+ m_childproc->clearArguments();
+ if ( useKdeSu ) {
+ *m_childproc << "kdesu" << "-t" << "-i" << "kmyfirewall" << "--noignorebutton" << "-d" << "-c" << localScriptFile;
+ } else {
+ *m_childproc << "bash" << localScriptFile;
+ }
+ if ( synchronous ) {
+ m_childproc->start( KProcess::Block, KProcess::AllOutput );
+ } else {
+ m_childproc->start( KProcess::NotifyOnExit, KProcess::AllOutput );
+ }
+ f->unlink();
+ delete f;
+}
+
+void KProcessWrapper::slotStartRemoteJob( const QString& jobName, const QString& scriptFile, KMFTarget* execHost ) {
+ QString localScriptFile = scriptFile;
+ m_jobName = jobName;
+ *m_stdoutbuf = "";
+ *m_stderrbuf = "";
+ m_allOut = "";
+ m_stdOut = "";
+ m_stdErr = "";
+ KTempFile *f = new KTempFile();
+ if ( ! KIO::NetAccess::exists( scriptFile, false, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "KProcessWrapper::slotStartRemoteJob(...) - creating temporary script file." << endl;
+ QTextStream *ts = f->textStream();
+ *ts << scriptFile << endl;
+ f->sync();
+ f->close();
+ localScriptFile = f->name();
+ }
+
+
+ QUuid uuid = QUuid::createUuid();
+ KURL remFileUrl( execHost->getFishUrl() + "/tmp/" + uuid.toString() );
+ kdDebug() << "UPLOADING: Temporary script file: " << localScriptFile << " to: " << remFileUrl.url() << endl;
+
+ if ( ! KIO::NetAccess::upload( localScriptFile, remFileUrl, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "ERROR: Could not upload temp file." << endl;
+ m_exitedNormal = false;
+ m_status = 1;
+ m_stdErr = i18n( "Could not upload the temporary comand script file." );
+ // m_allOut = m_stdErr;
+ m_stdOut = "";
+ emit sigProcessFinished( m_jobName, m_status, m_exitedNormal, m_stdOut, m_stdErr, m_allOut );
+
+
+ return;
+ }
+ f->unlink();
+ delete f;
+
+ QString cmd = "bash /tmp/" + uuid.toString();
+ kdDebug() << "Execute: " << cmd << " at: " << execHost->getFishUrl() << endl;
+ const QString& ret = KIO::NetAccess::fish_execute( execHost->getFishUrl(), cmd, KApplication::kApplication()->mainWidget() );
+ if ( ! KIO::NetAccess::del( remFileUrl, KApplication::kApplication()->mainWidget() ) ) {
+ m_exitedNormal = false;
+ m_status = 1;
+ m_stdErr = i18n( "Could not delete the temporary comand script file." );
+ // m_allOut = m_stdErr;
+ m_stdOut = "";
+ emit sigProcessFinished( m_jobName, m_status, m_exitedNormal, m_stdOut, m_stdErr, m_allOut );
+ return;
+ }
+ kdDebug() << "Got Output:" << ret << endl;
+
+
+ const QString& resultVal = ret.right( ret.find( "\n###RESULT:" ) + 10 );
+ kdDebug() << "resultVal: " << resultVal << endl;
+ m_status = 0;
+ if ( ret.contains( "###RESULT: 0" ) == 0 ) {
+ m_status = 1;
+ }
+
+
+ const QString& retNew = ret.left( ret.find( "\n###RESULT:" ) );
+
+ kdDebug() << "Real Output: " << retNew << endl;
+
+ m_allOut = retNew;
+ m_stdErr = retNew;
+ m_stdOut = retNew;
+
+ m_exitedNormal = true;
+
+
+ emit sigProcessFinished( m_jobName, m_status, m_exitedNormal, retNew, retNew, retNew );
+}
+
+
+
+void KProcessWrapper::slotKillJob() {
+ kdDebug() << "void KProcessWrapper::killJob()" << endl;
+ m_childproc->kill();
+}
+
+void KProcessWrapper::slotReceivedOutput( KProcess *, char *buffer, int buflen ) {
+ kdDebug() << "KProcessWrapper::slotReceivedOutput( KProcess *, char *buffer, int buflen )" << endl;
+ if ( !m_stderrbuf->isEmpty() ) {
+ m_allOut.append( *m_stderrbuf );
+ m_stdErr.append( *m_stderrbuf );
+ emit sigReceivedStdErr( m_jobName, *m_stderrbuf );
+ *m_stderrbuf = "";
+ }
+
+ *m_stdoutbuf += QString::fromLatin1( buffer, buflen );
+ m_allOut.append( *m_stdoutbuf );
+ m_stdOut.append( *m_stdoutbuf );
+
+ emit sigReceivedStdOut( m_jobName, *m_stdoutbuf );
+ *m_stdoutbuf = "";
+
+
+// int pos;
+// while ( ( pos = m_stdoutbuf->find( '\n' ) ) != -1 ) {
+// QString line = m_stdoutbuf->left( pos );
+// m_allOut.append( *m_stdoutbuf );
+// m_stdOut.append( *m_stdoutbuf );
+// m_stdoutbuf->remove( 0, pos + 1 );
+// }
+}
+
+void KProcessWrapper::slotReceivedError( KProcess *, char *buffer, int buflen ) {
+ kdDebug() << "KProcessWrapper::slotReceivedError( KProcess *, char *buffer, int buflen )" << endl;
+ // Flush stdout buffer
+ if ( !m_stdoutbuf->isEmpty() ) {
+ // Do What
+ m_allOut.append( *m_stdoutbuf );
+ m_stdOut.append( *m_stdoutbuf );
+ *m_stdoutbuf = "";
+ }
+
+ *m_stderrbuf += QString::fromLatin1( buffer, buflen );
+ m_allOut.append( *m_stderrbuf );
+ m_stdErr.append( *m_stderrbuf );
+ *m_stderrbuf = "";
+
+/* int pos;
+ while ( ( pos = m_stderrbuf->find( '\n' ) ) != -1 ) {
+ QString line = m_stderrbuf->left( pos );
+ m_allOut.append( line );
+ m_stdErr.append( line );
+ m_stderrbuf->remove( 0, pos + 1 );
+ }*/
+}
+
+void KProcessWrapper::slotProcessExited( KProcess* ) {
+ kdDebug() << "KProcessWrapper::slotProcessExited()" << endl;
+ m_status = m_childproc->exitStatus();
+ m_exitedNormal = m_childproc->normalExit();
+
+
+ emit sigProcessFinished( m_jobName, m_status, m_exitedNormal, m_stdOut, m_stdErr, m_allOut );
+ return;
+}
+
+
+//##
+
+
+
+
+
+} // end namespace KMF
diff --git a/kmyfirewall/core/kprocesswrapper.h b/kmyfirewall/core/kprocesswrapper.h
new file mode 100644
index 0000000..b64e74f
--- /dev/null
+++ b/kmyfirewall/core/kprocesswrapper.h
@@ -0,0 +1,104 @@
+//
+// C++ Interface: kprocesswrapper
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2008
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFKPROCESSWRAPPER_H
+#define KMFKPROCESSWRAPPER_H
+
+
+// QT Includes
+#include <qobject.h>
+#include <qstring.h>
+
+// KDE includes
+
+
+class KProcess;
+
+// Project includes
+namespace KMF {
+class KMFTarget;
+
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+class KProcessWrapper : public QObject {
+Q_OBJECT
+
+//############# Beginn static stuff ##############
+public:
+ /** return the one and only instance */
+ static KProcessWrapper* instance();
+private:
+ static KProcessWrapper* m_instance;
+
+//############# End static stuff ##############
+
+public:
+ KProcessWrapper( QObject*, const char* );
+
+ ~KProcessWrapper();
+
+ bool isRunning();
+
+ const QString& jobName() const {
+ return m_jobName;
+ }
+ const QString& stdOut() const {
+ return m_stdOut;
+ }
+ const QString& stdErr() const {
+ return m_stdErr;
+ }
+ const QString& stdCombined() const {
+ return m_allOut;
+ }
+ const int exitStatus() const {
+ return m_status;
+ }
+ const bool exitedNormal() const {
+ return m_exitedNormal;
+ }
+
+public slots:
+ void slotKillJob();
+
+ void slotStartLocalJob( const QString& jobName, const QString& command, bool useKdeSu /* = false */, bool synchronous /* = false */);
+ void slotStartRemoteJob( const QString& jobName, const QString& scriptFile, KMFTarget* execHost );
+
+protected slots:
+ void slotReceivedOutput( KProcess*, char*, int );
+ void slotReceivedError( KProcess*, char*, int );
+ void slotProcessExited( KProcess* );
+
+
+private:
+ QString* m_stderrbuf;
+ QString* m_stdoutbuf;
+
+ QString m_jobName;
+ QString m_allOut;
+ int m_status;
+ bool m_exitedNormal;
+
+ QString m_stdOut;
+ QString m_stdErr;
+ KProcess* m_childproc;
+
+signals:
+ void sigProcessFinished( const QString& jobName, int status, bool exitedNormal, const QString& stdOut, const QString& stdErr, const QString& completeOut );
+
+ void sigReceivedStdOut( const QString& jobName, const QString& stdOut );
+ void sigReceivedStdErr( const QString& jobName, const QString& stdOut );
+};
+
+}
+
+#endif
diff --git a/kmyfirewall/core/netfilterobject.cpp b/kmyfirewall/core/netfilterobject.cpp
new file mode 100644
index 0000000..28f532a
--- /dev/null
+++ b/kmyfirewall/core/netfilterobject.cpp
@@ -0,0 +1,205 @@
+/***************************************************************************
+ begin : Thu Apr 24 2003
+ copyright : (C) 2003 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "netfilterobject.h"
+
+// KDE includes
+#include <klocale.h>
+#include <kdebug.h>
+
+// project includes
+#include "kmfdoc.h"
+#include "kmftarget.h"
+#include "kmfnethost.h"
+#include "kmfnetzone.h"
+#include "kmfprotocol.h"
+#include "iptrule.h"
+#include "iptable.h"
+#include "iptchain.h"
+#include "iptruleoption.h"
+#include "kmfundoengine.h"
+#include "xmlnames.h"
+
+namespace KMF {
+
+//########### static stuff
+QMap<QUuid, NetfilterObject*>* NetfilterObject::m_uuid_dict = new QMap<QUuid, NetfilterObject*>;
+
+NetfilterObject* NetfilterObject::findObject( const QUuid& uuid ) {
+ QMap<QUuid, NetfilterObject*>::iterator it = getUuidObjectDict()->find( uuid );
+ if ( it != getUuidObjectDict()->end() ) {
+ return (*it);
+ }
+ return 0;
+}
+
+int NetfilterObject::objectCount( int type ) {
+ if ( type == -1 ) {
+ return m_uuid_dict->count();
+ }
+
+ int count = 0;
+ QMap<QUuid, NetfilterObject*>::Iterator it;
+ for ( it = m_uuid_dict->begin(); it != m_uuid_dict->end(); ++it ) {
+ if ( it.data() && it.data()->type() == type ) {
+ count++;
+ }
+ }
+ return count;
+}
+
+
+//########### end static stuff
+
+NetfilterObject::NetfilterObject( NetfilterObject *parent, const char* name ) : QObject( parent, name ) {
+ // kdDebug() << "NetfilterObject::( NetfilterObject *parent " << name << " )" << endl;
+ m_uuid = QUuid::createUuid();
+ m_parent = parent;
+ m_name = i18n( "Untitled" );
+ m_desc = i18n( "No Description Available" );
+ m_uuid_dict->insert( uuid(), this, true );
+ // kdDebug() << "Created NetfilterObject: " << uuid() << endl;
+}
+
+NetfilterObject::~NetfilterObject() {
+ m_uuid_dict->remove( m_uuid );
+ if ( m_uuid_dict->contains( m_uuid ) ) {
+ kdDebug() << "Could not delete object from NetfilterObject::m_uuid_dict" << endl;
+
+ }
+}
+
+void NetfilterObject::setUuid( const QUuid& newUuid ) {
+ if ( newUuid.isNull() ) {
+ return;
+ }
+
+ QUuid toSetUuid = newUuid;
+
+ while ( m_uuid != toSetUuid && m_uuid_dict->contains( toSetUuid ) ) {
+ kdDebug() << "NetfilterObject::setUuid( " << toSetUuid << ") new uuid allready in use! Generating new!" << endl;
+ toSetUuid = QUuid::createUuid();
+ }
+
+ m_uuid_dict->remove( m_uuid );
+ if ( m_uuid_dict->contains( m_uuid ) ) {
+ kdDebug() << "Could not delete object from NetfilterObject::m_uuid_dict" << endl;
+ }
+
+// kdDebug() << "NetfilterObject: " << uuid() << "->setUuid " << toSetUuid << endl;
+ m_uuid = toSetUuid;
+
+ m_uuid_dict->insert( m_uuid, this, true );
+}
+
+void NetfilterObject::setParent( NetfilterObject *parent ) {
+ if ( ! parent || parent == m_parent ) {
+ return;
+ }
+ m_parent = parent;
+ changed();
+}
+
+bool NetfilterObject::isChildOf( const QUuid& id ) {
+ if ( ! m_parent ) {
+ // kdDebug() << "NetfilterObject: " << name() << ":" << uuid() << " ->isChildOf( " << id << " ) - No More Parent return: false" << endl;
+ return false;
+ }
+ if ( m_parent->uuid() == id ) {
+ // kdDebug() << "NetfilterObject: " << name() << ":" << uuid() << " ->isChildOf( " << id << " ) - Parent Matched return: true" << endl;
+ return true;
+ }
+ return m_parent->isChildOf( id );
+}
+
+int NetfilterObject::getLevel() {
+ // kdDebug() << "NetfilterObject::getLevel()" << endl;
+ int lev = 0;
+ getLevel( lev );
+ return lev;
+}
+
+void NetfilterObject::getLevel( int& currlevel ) {
+ // kdDebug() << "NetfilterObject::getLevel( int *currlevel )" << endl;
+ if ( m_parent ) {
+ currlevel++;
+ m_parent->getLevel( currlevel );
+ }
+}
+
+const QString& NetfilterObject::name() {
+ // kdDebug() << "const QString& NetfilterObject::name()" << endl;
+ return m_name;
+}
+
+
+void NetfilterObject::setName( const QString& name ) {
+ //kdDebug() << "const QString& NetfilterObject::setName( const QString& " << name << " )" << endl;
+ if ( name.isNull() || name == m_name ) {
+ return;
+ }
+ m_name = name;
+ changed();
+}
+
+const QString& NetfilterObject::description() {
+ return m_desc;
+}
+
+void NetfilterObject::setDescription( const QString& desc ) {
+ if ( desc.isNull() ) {
+ return;
+ }
+ if ( desc == m_desc ) {
+ return;
+ }
+ m_desc = desc;
+ changed();
+}
+
+const QString& NetfilterObject::getXMLSniplet() {
+// kdDebug() << "const QString& NetfilterObject::getXMLsniplet()" << endl;
+ QDomDocument tmp_doc = getDOMTree();
+ const QString& xml = tmp_doc.toString();
+ // kdDebug() << "Creted XML:\n" << xml << "\n" << endl;
+ return *( new QString( xml ) );
+}
+
+void NetfilterObject::loadUuid( QDomNode& node, QStringList& errors ) {
+ if ( ! node.toElement().hasAttribute( XML::Uuid_Attribute ) ) {
+ errors.append( KMFError::getAsString( KMFError::WARNING, i18n( "No uuid saved in node %1" ).arg( node.nodeName () ) ) );
+ return;
+ }
+// if ( KMFUndoEngine::instance()->preserveObjectUuid() ) {
+ const QString& newUuid = node.toElement().attribute( XML::Uuid_Attribute );
+ if ( newUuid.isEmpty() ) {
+ errors.append( KMFError::getAsString( KMFError::WARNING, i18n( "No uuid saved in node %1" ).arg( node.nodeName () ) ) );
+ return;
+ }
+ // KMFUndoEngine::instance()->log( i18n( "Overwrite my uuid: %1 with %2" ).arg( uuid().toString() ).arg( newUuid ), KMFError::OK, this );
+ setUuid( newUuid );
+// }
+
+}
+void NetfilterObject::saveUuid( QDomNode& node ) {
+ node.toElement().setAttribute( XML::Uuid_Attribute, uuid().toString() );
+}
+
+void NetfilterObject::changed() {
+ // kdDebug() << "void NetfilterObject::changed() : m_object_id " << uuid() << endl;
+ KMFUndoEngine::instance()->changed( uuid() );
+}
+
+}
diff --git a/kmyfirewall/core/netfilterobject.h b/kmyfirewall/core/netfilterobject.h
new file mode 100644
index 0000000..5734c76
--- /dev/null
+++ b/kmyfirewall/core/netfilterobject.h
@@ -0,0 +1,173 @@
+/***************************************************************************
+ begin : Thu Apr 24 2003
+ copyright : (C) 2003 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef NETFILTEROBJECT_H
+#define NETFILTEROBJECT_H
+
+// QT includes
+#include <qobject.h>
+#include <qstring.h>
+#include <qdom.h>
+#include <qptrlist.h>
+#include <qintdict.h>
+#include <qmap.h>
+#include <quuid.h>
+#include <qstringlist.h>
+#include <qguardedptr.h>
+#include <kdemacros.h>
+
+// KDE includes
+
+// Project includes
+
+namespace KMF {
+class KMFDoc;
+class KMFUndoEngine;
+
+/** NetfilterObject ist the base class for (allmost) all data classes
+ used within KMF. It defines the needed prperties and methods to
+ allow things undo/redo, unique object id's etc. */
+
+class KDE_EXPORT NetfilterObject : public QObject {
+
+// friend class KMFNetwork;
+friend class KMFUndoEngine;
+friend class KMFTransaction;
+friend class KMFProtocolCategory;
+
+ //############# Beginn static stuff ##############
+
+public:
+ static NetfilterObject* findObject( const QUuid& uuid );
+ static int objectCount( int type );
+private:
+ static QMap<QUuid, NetfilterObject*>* getUuidObjectDict() {
+ return m_uuid_dict;
+ };
+
+// DATA
+private:
+ static QMap<QUuid, NetfilterObject*>* m_uuid_dict;
+
+ //############# End static stuff ##############
+
+public:
+ NetfilterObject( NetfilterObject*, const char* name );
+ virtual ~NetfilterObject();
+
+private:
+ NetfilterObject();
+ NetfilterObject( QObject* );
+
+public:
+ /** Known object types */
+ enum {
+ TABLE = 0,
+ CHAIN = 1,
+ RULE = 2,
+ RULEOPTION = 3,
+ PROTOCOL = 4,
+ NETZONE = 5,
+ NETHOST = 6,
+ KMFTARGET = 7,
+ KMFTARGETCONFIG = 8,
+ PROTOCOLUSAGE = 9,
+ IPTABLES_RULESET = 10,
+ GENERIC_RULESET = 11,
+ KMFNETWORK = 12,
+ PROTOCOLCATEGORY = 13
+ };
+
+ /** Get All living objects of the given Type */
+ // const QValueList<NetfilterObject*>& getAllOfType( int type );
+
+ /** Sets the Neame of the Object */
+ virtual void setName( const QString& );
+
+ /** return the object uuid */
+ const QUuid& uuid() const {
+ return m_uuid;
+ };
+
+ /** Retrun the Object's name */
+ virtual const QString& name();
+
+
+ /** reset type */
+ virtual void clear() = 0;
+
+ /** return the object type */
+ virtual int type() = 0;
+
+ /** Return the Object's nesting level within the NetfilterObject Tree */
+ int getLevel();
+
+ /** Return the Object's Description */
+ virtual const QString& description();
+
+ /** Set Description for this Object */
+ virtual void setDescription( const QString& );
+
+ /** Return DomDocument of this Object */
+ virtual const QDomDocument& getDOMTree() = 0;
+
+ /** Return String representation of the DomDocument generated
+ by const QDomDocument& getDOMTree() */
+ virtual const QString& getXMLSniplet();
+
+ /** Load configuration from the given QDdomDocument */
+ virtual void loadXML( const QDomDocument&, QStringList& errors ) = 0;
+
+ /** Load configuration from the given QDdomDocument */
+ virtual void loadXML( QDomNode, QStringList& errors ) = 0;
+
+ /** Set the parent object */
+ void setParent( NetfilterObject* );
+
+ /** check if the object is a (indirect) child of the object
+ with the given id */
+ bool isChildOf( const QUuid& uuid );
+
+ /** set the changed flag, and calling changed( int id ) in the parent
+ object with it's own id */
+ void changed();
+
+ /** Get the Parent object */
+ NetfilterObject* parentObj() const {
+ return m_parent;
+ }
+
+protected:
+ /** read the uuid from the dom node if needed */
+ void loadUuid( QDomNode&, QStringList& errors );
+
+ /** write the uuid to the dom node */
+ void saveUuid( QDomNode& );
+
+private:
+ /** Return the Object's nesting level within the NetfilterObject Tree walking the tree up */
+ void getLevel( int& currlevel );
+
+ /** Sets the UUID of the Object */
+ void setUuid( const QUuid& );
+
+private:
+ QGuardedPtr<NetfilterObject> m_parent;
+ QString m_name;
+ QString m_desc;
+ QUuid m_uuid;
+};
+}
+#endif
diff --git a/kmyfirewall/core/xmlnames.cpp b/kmyfirewall/core/xmlnames.cpp
new file mode 100644
index 0000000..bd1b2a1
--- /dev/null
+++ b/kmyfirewall/core/xmlnames.cpp
@@ -0,0 +1,151 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+#include "xmlnames.h"
+
+namespace KMF {
+
+// Document Elements
+const QString& XML::GenericDoc_DocumentElement = "kmfgrs";
+const QString& XML::IPTDoc_DocumentElement = "kmfrs";
+const QString& XML::KMFNetwork_DocumentElement = "kmfnet";
+
+// Elements
+const QString& XML::Protocol_Element = "protocol";
+const QString& XML::Table_Element = "table";
+const QString& XML::Chain_Element = "chain";
+const QString& XML::Rule_Element = "rule";
+const QString& XML::RuleOption_Element = "ruleoption";
+const QString& XML::RuleOptionValue_Element = "ruleoptionvalue";
+const QString& XML::Logging_Element = "logging";
+const QString& XML::Target_Element = "target";
+const QString& XML::ProtocolUsage_Element = "protocolusage";
+const QString& XML::Port_Element = "port";
+const QString& XML::Abstract_Element = "abstract";
+const QString& XML::ICMP_Element = "icmp";
+const QString& XML::NAT_Element = "nat";
+const QString& XML::NetHost_Element = "nethost";
+const QString& XML::NetZone_Element = "netzone";
+const QString& XML::FromIP_Element = "fromIP";
+const QString& XML::NetMask_Element = "netMask";
+const QString& XML::ProtocolCategory_Element = "protocolCategory";
+const QString& XML::Interface_Element = "interface";
+const QString& XML::OS_Element = "os";
+const QString& XML::BackEnd_Element = "backend";
+const QString& XML::Distribution_Element = "distribution";
+const QString& XML::InitPath_Element = "initPath";
+const QString& XML::IPTPath_Element = "IPTPath";
+const QString& XML::ModprobePath_Element = "modprobePath";
+const QString& XML::RcDefaultPath_Element = "rcDefaultPath";
+const QString& XML::TargetConfig_Element = "targetconfig";
+
+
+
+
+
+// Attributes
+const QString& XML::Protocol_Attribute = "protocol";
+const QString& XML::Uuid_Attribute = "uuid";
+const QString& XML::Name_Attribute = "name";
+const QString& XML::Description_Attribute = "description";
+const QString& XML::GUIName_Attribute = "guiName";
+const QString& XML::Address_Attribute = "address";
+const QString& XML::ReadOnly_Attribute = "readonly";
+const QString& XML::Type_Attribute = "type";
+const QString& XML::TargetOption_Attribute = "targetoption";
+const QString& XML::BuiltIn_Attribute = "builtin";
+const QString& XML::DefaultTarget_Attribute = "default_target";
+const QString& XML::Logging_Attribute = "logging";
+const QString& XML::Target_Attribute = "target";
+const QString& XML::Prefix_Attribute = "prefix";
+const QString& XML::Limit_Attribute = "limit";
+const QString& XML::Burst_Attribute = "burst";
+const QString& XML::IO_Attribute = "io";
+const QString& XML::ProtocolUuid_Attribute = "protocolUuid";
+const QString& XML::Enabled_Attribute = "enabled";
+const QString& XML::CustomRule_Attribute = "custom_rule";
+const QString& XML::Num_Attribute = "num";
+const QString& XML::Version_Attribute = "version";
+const QString& XML::MinVersion_Attribute = "minVersion";
+const QString& XML::MaxVersion_Attribute = "maxVersion";
+const QString& XML::RestrictOutgoingConnections_Attribute = "restrictOutgoingConnections";
+const QString& XML::AllowIncomingConnections_Attribute = "allowIncomingConnections";
+const QString& XML::LogIncoming_Attribute = "logIncoming";
+const QString& XML::LogOutgoing_Attribute = "logOutgoing";
+const QString& XML::LimitRate_Attribute = "limitRate";
+const QString& XML::LimitScale_Attribute = "limitScale";
+const QString& XML::SSHPort_Attribute = "sshPort";
+
+
+// Network
+const QString& XML::Interface_Attribute = "interface";
+
+// GENERIC DOC
+const QString& XML::LogDropped_Attribute = "logDropped";
+const QString& XML::LimitLog_Attribute = "limitLog";
+const QString& XML::LogPrefix_Attribute = "logPrefix";
+const QString& XML::AllowPingReply_Attribute = "allowPingReply";
+const QString& XML::LimitPingReply_Attribute = "limitPingReply";
+const QString& XML::UseNat_Attribute = "useNat";
+const QString& XML::UseMasquerade_Attribute = "useMasquerade";
+const QString& XML::NatAddress_Attribute = "natAddress";
+const QString& XML::OutgoingInterface_Attribute = "outgoingInterface";
+
+// IPTDOC
+const QString& XML::UseFilter_Attribute = "use_filter";
+const QString& XML::Use_Nat_Attribute = "use_nat";
+const QString& XML::UseMangle_Attribute = "use_mangle";
+const QString& XML::UseModules_Attribute = "use_modules";
+const QString& XML::UseRpFilter_Attribute = "use_rp_filter";
+const QString& XML::UseIPFwd_Attribute = "use_ipfwd";
+const QString& XML::UseSynCookies_Attribute = "use_syn_cookies";
+const QString& XML::UseMartians_Attribute = "use_martians";
+
+
+// Values
+const QString& XML::Yes_Value = "yes";
+const QString& XML::No_Value = "no";
+const QString& XML::BoolOn_Value = "bool:on";
+const QString& XML::BoolOff_Value = "bool:off";
+const QString& XML::Undefined_Value = "UNDEFINED";
+const QString& XML::Incoming_Value = "INCOMING";
+const QString& XML::Outgoing_Value = "OUTGOING";
+const QString& XML::UDP_Value = "UDP";
+const QString& XML::TCP_Value = "TCP";
+const QString& XML::IPTablesGUIInterface_Value = "iptables";
+const QString& XML::GenericGUIInterface_Value = "generic";
+
+
+// Constants
+
+const QString& Constants::Localhost_Name = "localhost";
+const QString& Constants::Localhost_IP = "127.0.0.1";
+const QString& Constants::MyNetwork_Name = "mynetwork";
+const QString& Constants::FilterTable_Name = "filter";
+const QString& Constants::NatTable_Name = "nat";
+const QString& Constants::MangleTable_Name = "mangle";
+
+const QString& Constants::InputChain_Name = "INPUT";
+const QString& Constants::OutputChain_Name = "OUTPUT";
+const QString& Constants::ForwardChain_Name = "FORWARD";
+const QString& Constants::PreRoutingChain_Name = "PREROUTING";
+const QString& Constants::PostRoutingChain_Name = "POSTROUTING";
+
+const QString& Constants::StartFirewallJob_Name = "start_firewall_job";
+const QString& Constants::StopFirewallJob_Name = "stop_firewall_job";
+const QString& Constants::InstallFirewallJob_Name = "install_firewall_job";
+const QString& Constants::UninstallFirewallJob_Name = "uninstall_firewall_job";
+const QString& Constants::ShowConfigJob_Name = "show_config_job";
+// const QString& Constants::KdeSu_Cmd = "kdesu -t -i kmyfirewall -d -c ";
+
+}
+
diff --git a/kmyfirewall/core/xmlnames.h b/kmyfirewall/core/xmlnames.h
new file mode 100644
index 0000000..4cbfb61
--- /dev/null
+++ b/kmyfirewall/core/xmlnames.h
@@ -0,0 +1,163 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2008
+*/
+#ifndef XMLNAMES_H
+#define XMLNAMES_H
+
+#include <qstring.h>
+
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+namespace KMF {
+
+class XML {
+ private:
+ XML();
+
+ public:
+ ~XML();
+ // Document Elements
+ static const QString& GenericDoc_DocumentElement;
+ static const QString& IPTDoc_DocumentElement;
+ static const QString& KMFNetwork_DocumentElement;
+
+ // Elements
+ static const QString& Table_Element;
+ static const QString& Chain_Element;
+ static const QString& Rule_Element;
+ static const QString& RuleOption_Element;
+ static const QString& RuleOptionValue_Element;
+ static const QString& Protocol_Element;
+ static const QString& ProtocolUsage_Element;
+ static const QString& ProtocolCategory_Element;
+ static const QString& Logging_Element;
+ static const QString& Target_Element;
+ static const QString& TargetConfig_Element;
+ static const QString& Port_Element;
+ static const QString& Abstract_Element;
+ static const QString& ICMP_Element;
+ static const QString& NAT_Element;
+ static const QString& NetHost_Element;
+ static const QString& NetZone_Element;
+ static const QString& FromIP_Element;
+ static const QString& NetMask_Element;
+ static const QString& Interface_Element;
+ static const QString& OS_Element;
+ static const QString& BackEnd_Element;
+ static const QString& Distribution_Element;
+ static const QString& InitPath_Element;
+ static const QString& IPTPath_Element;
+ static const QString& ModprobePath_Element;
+ static const QString& RcDefaultPath_Element;
+
+
+
+ // Attributes
+ static const QString& Uuid_Attribute;
+ static const QString& Name_Attribute;
+ static const QString& Description_Attribute;
+ static const QString& GUIName_Attribute;
+ static const QString& Protocol_Attribute;
+ static const QString& Address_Attribute;
+ static const QString& ReadOnly_Attribute;
+ static const QString& Type_Attribute;
+ static const QString& TargetOption_Attribute;
+ static const QString& BuiltIn_Attribute;
+ static const QString& DefaultTarget_Attribute;
+ static const QString& Logging_Attribute;
+ static const QString& Target_Attribute;
+ static const QString& Prefix_Attribute;
+ static const QString& Limit_Attribute;
+ static const QString& Burst_Attribute;
+ static const QString& IO_Attribute;
+ static const QString& ProtocolUuid_Attribute;
+ static const QString& Enabled_Attribute;
+ static const QString& CustomRule_Attribute;
+ static const QString& Num_Attribute;
+ static const QString& Version_Attribute;
+ static const QString& MinVersion_Attribute;
+ static const QString& MaxVersion_Attribute;
+ static const QString& RestrictOutgoingConnections_Attribute;
+ static const QString& AllowIncomingConnections_Attribute;
+ static const QString& LogDropped_Attribute;
+ static const QString& LimitLog_Attribute;
+ static const QString& LogPrefix_Attribute;
+ static const QString& AllowPingReply_Attribute;
+ static const QString& LimitPingReply_Attribute;
+ static const QString& UseNat_Attribute;
+ static const QString& UseMasquerade_Attribute;
+ static const QString& NatAddress_Attribute;
+ static const QString& OutgoingInterface_Attribute;
+ static const QString& UseFilter_Attribute;
+ static const QString& Use_Nat_Attribute;
+ static const QString& UseMangle_Attribute;
+ static const QString& UseModules_Attribute;
+ static const QString& UseRpFilter_Attribute;
+ static const QString& UseIPFwd_Attribute;
+ static const QString& UseSynCookies_Attribute;
+ static const QString& UseMartians_Attribute;
+ static const QString& LogIncoming_Attribute;
+ static const QString& LogOutgoing_Attribute;
+ static const QString& LimitRate_Attribute;
+ static const QString& LimitScale_Attribute;
+ static const QString& Interface_Attribute;
+ static const QString& SSHPort_Attribute;
+ //Values
+ static const QString& Yes_Value;
+ static const QString& No_Value;
+ static const QString& BoolOn_Value;
+ static const QString& BoolOff_Value;
+ static const QString& Undefined_Value;
+ static const QString& Incoming_Value;
+ static const QString& Outgoing_Value;
+ static const QString& UDP_Value;
+ static const QString& TCP_Value;
+
+ static const QString& IPTablesGUIInterface_Value;
+ static const QString& GenericGUIInterface_Value;
+};
+
+
+
+
+class Constants {
+ private:
+ Constants();
+ public:
+ ~Constants();
+ static const QString& Localhost_Name;
+ static const QString& Localhost_IP;
+ static const QString& MyNetwork_Name;
+ static const QString& FilterTable_Name;
+ static const QString& NatTable_Name;
+ static const QString& MangleTable_Name;
+
+ static const QString& InputChain_Name;
+ static const QString& OutputChain_Name;
+ static const QString& ForwardChain_Name;
+ static const QString& PreRoutingChain_Name;
+ static const QString& PostRoutingChain_Name;
+
+ static const QString& StartFirewallJob_Name;
+ static const QString& StopFirewallJob_Name;
+ static const QString& InstallFirewallJob_Name;
+ static const QString& UninstallFirewallJob_Name;
+ static const QString& ShowConfigJob_Name;
+
+};
+
+}
+#endif
+
+
+
+
diff --git a/kmyfirewall/genericinterface/Makefile.am b/kmyfirewall/genericinterface/Makefile.am
new file mode 100644
index 0000000..df0dc7e
--- /dev/null
+++ b/kmyfirewall/genericinterface/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = $(all_includes) -I../core -I../ipteditor -I../kmfwidgets
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfgenericinterfacepart.la
+
+partrcdir = $(kde_datadir)/kmfgenericinterfacepart
+partrc_DATA = kmfgenericinterfacepartui.rc
+
+libkmfgenericinterfacepart_la_LDFLAGS = -module -no-undefined $(all_libraries) \
+ $(KDE_PLUGIN)
+libkmfgenericinterfacepart_la_LIBADD = \
+ $(LIB_KPARTS) ../kmfwidgets/libkmfwidgets.la ../core/libkmfcore.la
+
+libkmfgenericinterfacepart_la_SOURCES = kmfgenericinterface.cpp \
+ kmfgenericinterface_part.cpp kmfgenericinterfaceprotocol.cpp kmfgenericinterfacenat.cpp \
+ kmfgenericinterfacehost.cpp kmfgenericinterfacelogging.cpp kmyfirewallgenericinterfacelogging.ui \
+ kmfgenericinterfaceicmp.cpp kmyfirewallgenericinterfaceicmp.ui \
+ kmyfirewallgenericinterfacehostwidget.ui kmyfirewallgenericinterfacenatwidget.ui \
+ kmyfirewallgenericinterfaceprotocolwidget.ui
+
+noinst_HEADERS = kmfgenericinterface.h kmfgenericinterface_part.h \
+ kmfgenericinterfaceprotocol.h kmfgenericinterfacenat.h kmfgenericinterfacehost.h \
+ kmfgenericinterfacelogging.h kmfgenericinterfaceicmp.h
diff --git a/kmyfirewall/genericinterface/kmfgenericinterface.cpp b/kmyfirewall/genericinterface/kmfgenericinterface.cpp
new file mode 100644
index 0000000..1be07d7
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterface.cpp
@@ -0,0 +1,237 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfgenericinterface.h"
+
+// qt includes
+#include <qstring.h>
+#include <qlayout.h>
+#include <qtabwidget.h>
+
+// kde includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+
+
+// project includes
+#include "../core/kmfnetwork.h"
+#include "../core/kmfgenericdoc.h"
+
+#include "../kmfwidgets/kmfmynetworkwidget.h"
+#include "kmfgenericinterfaceprotocol.h"
+//#include "kmfgenericinterfaceeditprotocol.h"
+#include "kmfgenericinterfacenat.h"
+#include "kmfgenericinterfacehost.h"
+#include "kmfgenericinterfacelogging.h"
+#include "kmfgenericinterfaceicmp.h"
+
+namespace KMF {
+
+KMFGenericInterface::KMFGenericInterface( QWidget *parent, const char *name ) : KJanusWidget( parent, name, KJanusWidget::IconList ) {
+ connect( this,SIGNAL( aboutToShowPage( QWidget* ) ),
+ this,SLOT( slotPageChanged( QWidget* ) ) );
+ loadIcons();
+
+ //###################### My Network Widget ###################################
+ myNetworkFrame = addPage(i18n("My Network"), i18n("Define and configure the firewall host you like to configure"), icon_zone_page );
+ m_myNetworkWidget = new KMFMyNetworkWidget( myNetworkFrame, "m_myNetworkWidget" );
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_myNetworkWidget, SLOT( slotUpdateView() ) );
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_myNetworkWidget, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ connect( m_myNetworkWidget, SIGNAL( sigActiveTargetChanged() ), this, SIGNAL( sigTargetChanged() ) );
+
+ QGridLayout *myNetworkLayout = new QGridLayout( myNetworkFrame, 1, 1, 2, 2 );
+ myNetworkLayout->addWidget( m_myNetworkWidget,0,0 );
+
+ //###################### Access Control PAGE #################################
+ protocolFrame = addPage(i18n("Access Control"), i18n("Access configuration for incoming and outgoing connections"), icon_protocol_page );
+
+ m_protocolPageZones = new KMFGenericInterfaceProtocol( protocolFrame, "m_protocolPageIncoming");
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_protocolPageZones, SLOT( slotUpdateView() ) );
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_protocolPageZones, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ QGridLayout *protocoLayout = new QGridLayout( protocolFrame, 1, 1, 2, 2 );
+ protocoLayout->addWidget( m_protocolPageZones,0,0 );
+
+ //###################### HOSTS PAGE ###################################
+ hostFrame = addPage(i18n("Special Hosts"), i18n("Define Hosts that should be treated specially."), icon_host_page );
+ m_hostPage = new KMFGenericInterfaceHost(hostFrame,"m_hostPageTrusted");
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_hostPage, SLOT( slotUpdateView() ) );
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_hostPage, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ QGridLayout *hostLayout = new QGridLayout( hostFrame, 1, 1, 2, 2 );
+ hostLayout->addWidget( m_hostPage,0,0 );
+
+ //###################### ICMP PAGE #################################
+ icmpFrame = addPage(i18n("ICMP Options"), i18n("Define how ICMP packets should be handled."), icon_icmp_page );
+ QGridLayout *icmpLayout = new QGridLayout( icmpFrame, 1, 1, 2, 2 );
+ m_icmpPage = new KMFGenericInterfaceIcmp(icmpFrame,"m_icmpPage");
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_icmpPage, SLOT( slotUpdateView() ) );
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_icmpPage, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ icmpLayout->addWidget( m_icmpPage,0,0 );
+
+
+ //###################### NAT PAGE ###################################
+ natFrame = addPage(i18n("NAT Configuration"), i18n("Configure NAT (Network Address Translation) here."), icon_nat_page );
+ QGridLayout *natLayout = new QGridLayout( natFrame, 1, 1, 2, 2 );
+ m_natPage = new KMFGenericInterfaceNat(natFrame,"m_natPage");
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_natPage, SLOT( slotUpdateView() ) );
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_natPage, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ natLayout->addWidget( m_natPage,0,0 );
+
+ //###################### LOGGING PAGE ###################################
+ logFrame = addPage(i18n("Logging"), i18n("Configure your firewall's logging behavior here."), icon_logging_page );
+ QGridLayout *logLayout = new QGridLayout( logFrame, 1, 1, 2, 2 );
+ m_loggingPage = new KMFGenericInterfaceLogging(logFrame,"m_loggingPage");
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_loggingPage, SLOT( slotUpdateView() ) );
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_loggingPage, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ logLayout->addWidget( m_loggingPage,0,0 );
+
+ setEnabled( false );
+}
+
+KMFGenericInterface::~KMFGenericInterface() {}
+
+void KMFGenericInterface::loadDoc( KMFNetwork* doc ) {
+ kdDebug() << "void KMFGenericInterface::loadDoc( KMFGenericDoc* )" << endl;
+ if ( ! doc ) {
+ setEnabled( false );
+ return;
+ }
+ setEnabled( true );
+ m_network = doc;
+
+ m_myNetworkWidget->setNetwork( m_network );
+ m_myNetworkWidget->slotUpdateView();
+ m_myNetworkWidget->parent();
+
+ m_protocolPageZones->loadDoc( m_network );
+ m_protocolPageZones->slotUpdateView();
+
+ m_hostPage->loadDoc( m_network );
+ m_hostPage->slotUpdateView();
+
+// m_protocolPageEditProtocol->loadDoc( m_network );
+// m_protocolPageEditProtocol->slotUpdateView();
+
+ m_icmpPage->loadDoc( m_network );
+ m_icmpPage->slotUpdateView();
+
+ m_natPage->loadDoc( m_network );
+ m_natPage->slotUpdateView();
+
+ m_loggingPage->loadDoc( m_network );
+ m_loggingPage->slotUpdateView();
+}
+
+/*
+void KMFGenericInterface::slotUpdateView( NetfilterObject* obj ) {
+ kdDebug() << "KMFGenericInterface::slotUpdateView( NetfilterObject* )" << endl;
+ if ( ! m_network ) {
+ setEnabled( false );
+ return;
+ }
+ m_myNetworkWidget->slotUpdateView( obj );
+
+ m_protocolPageZones->slotUpdateView( obj );
+
+ m_hostPage->slotUpdateView( obj );
+
+ m_icmpPage->slotUpdateView( obj );
+
+ m_natPage->slotUpdateView( obj );
+
+ m_loggingPage->slotUpdateView( obj );
+}
+
+void KMFGenericInterface::slotUpdateView() {
+ if ( ! m_network ) {
+ setEnabled( false );
+ return;
+ }
+ m_myNetworkWidget->slotUpdateView();
+
+ m_protocolPageZones->slotUpdateView();
+
+ m_hostPage->slotUpdateView();
+
+ m_icmpPage->slotUpdateView();
+
+ m_natPage->slotUpdateView();
+
+ m_loggingPage->slotUpdateView();
+}
+*/
+
+void KMFGenericInterface::slotPageChanged( QWidget* /*wid*/ ){
+ kdDebug() << "KMFGenericInterface::slotPageChanged( QWidget* )" << endl;
+ emit sigUpdateView();
+ // slotUpdateView();
+}
+
+void KMFGenericInterface::loadIcons() {
+ kdDebug() << "void KMFGenericInterface::loadIcons()" << endl;
+ KIconLoader *loader = KGlobal:: iconLoader();
+ QString icon_name;
+
+ icon_name = "network";
+ icon_zone_page = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "services";
+ icon_protocol_page = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "nfs_unmount";
+ icon_edit_protocol_page = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "pipe";
+ icon_icmp_page = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "log";
+ icon_logging_page = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "network_local";
+ icon_host_page = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "filesaveas";
+ icon_nat_page = loader->loadIcon( icon_name, KIcon::Desktop );
+}
+
+}
+
+#include "kmfgenericinterface.moc"
diff --git a/kmyfirewall/genericinterface/kmfgenericinterface.h b/kmyfirewall/genericinterface/kmfgenericinterface.h
new file mode 100644
index 0000000..9853a35
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterface.h
@@ -0,0 +1,100 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFGENERICINTERFACE_H
+#define KMFGENERICINTERFACE_H
+
+#include <kjanuswidget.h>
+
+/**
+@author Christian Hubinger
+*/
+
+// QT includes
+#include <qpixmap.h>
+#include <qguardedptr.h>
+
+class QFrame;
+class QVBox;
+class QTabWidget;
+
+// KDE includes
+
+
+
+// Project includes
+namespace KMF {
+class KMFGenericInterfaceProtocol;
+class KMFGenericInterfaceNat;
+class KMFGenericInterfaceHost;
+class KMFGenericInterfaceLogging;
+class KMFGenericInterfaceEditProtocol;
+class KMFGenericInterfaceIcmp;
+class KMFGenericDoc;
+class KMFNetwork;
+class KMFMyNetworkWidget;
+class NetfilterObject;
+
+class KMFGenericInterface : public KJanusWidget {
+ Q_OBJECT
+public:
+
+ KMFGenericInterface( QWidget *parent = 0, const char *name = 0 );
+ ~KMFGenericInterface();
+
+ void loadDoc( KMFNetwork* );
+
+
+private slots:
+ void slotPageChanged( QWidget* );
+// void slotUpdateView();
+// void slotUpdateView( NetfilterObject* );
+
+private:
+ void loadIcons();
+
+signals:
+ void sigUpdateView();
+ void sigUpdateView( NetfilterObject* );
+ void sigTargetChanged();
+
+private:
+ KMFMyNetworkWidget *m_myNetworkWidget;
+ KMFGenericInterfaceProtocol *m_protocolPageZones;
+ KMFGenericInterfaceEditProtocol *m_protocolPageEditProtocol;
+ KMFGenericInterfaceNat *m_natPage;
+ KMFGenericInterfaceHost *m_hostPage;
+ KMFGenericInterfaceLogging *m_loggingPage;
+ KMFGenericInterfaceIcmp *m_icmpPage;
+
+ QGuardedPtr<KMFNetwork> m_network;
+
+ QFrame *myNetworkFrame, *zoneFrame, *protocolFrame, *editProtocolFrame,*icmpFrame, *hostFrame,*natFrame, *logFrame;
+
+ QPixmap icon_zone_page, icon_protocol_page,
+ icon_edit_protocol_page, icon_icmp_page,
+ icon_logging_page, icon_host_page, icon_nat_page;
+
+
+};
+}
+#endif
diff --git a/kmyfirewall/genericinterface/kmfgenericinterface_part.cpp b/kmyfirewall/genericinterface/kmfgenericinterface_part.cpp
new file mode 100644
index 0000000..1da06a9
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterface_part.cpp
@@ -0,0 +1,258 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001
+*/
+
+
+#include "kmfgenericinterface_part.h"
+
+
+// QT includes
+#include <qlabel.h>
+
+// KDE includes
+#include <kinstance.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <klocale.h>
+#include <kaboutdata.h>
+#include <kmessagebox.h>
+#include <kiconloader.h>
+#include <kparts/genericfactory.h>
+
+// Project includes
+#include "kmfgenericinterface.h"
+
+#include "../core/kmfnetwork.h"
+
+#include "../kmfwidgets/kmfmainwindow.h"
+namespace KMF {
+KMFGenericInterfacePart::KMFGenericInterfacePart( QWidget *parentWidget, const char * widgetName ,
+ QObject *parent, const char *name,
+ const QStringList & /*args*/ )
+ : KParts::ReadWritePart( parent, name ) {
+ setInstance( KMFGenericInterfacePartFactory::instance() );
+
+ m_genericinterface = new KMFGenericInterface( parentWidget, widgetName );
+
+
+ m_app = dynamic_cast<KMFMainWindow*>( parent );
+ if ( ! m_app ) {
+ KMessageBox::error(0,"Oops wrong parent class found for kmfinstallerplugin!!!");
+ }
+
+ m_genericinterface->loadDoc( m_app->network() );
+ connect( m_genericinterface, SIGNAL( sigTargetChanged() ),
+ this, SLOT( slotTargetChanged() ) );
+
+ connect( m_app, SIGNAL( sigUpdateView() ),
+ m_genericinterface, SIGNAL( sigUpdateView() ) );
+
+ connect( m_app, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_genericinterface, SIGNAL( sigUpdateView( NetfilterObject* ) ) );
+
+ connect( m_app, SIGNAL( sigEnableActions( bool ) ),
+ this, SLOT( slotEnableActions( bool ) ) );
+
+
+ m_actionGoMyNetwork = new KAction( i18n( "&My Network" ), QIconSet( BarIcon( "network", KMFGenericInterfacePartFactory::instance() ) ),
+ 0 , this, SLOT( slotGoMyNetwork() ), actionCollection(), "my_network" );
+
+ m_actionGoAccessControl = new KAction( i18n( "&Access Control" ), QIconSet( BarIcon( "services", KMFGenericInterfacePartFactory::instance() ) ),
+ 0 , this, SLOT( slotGoAccessControl() ), actionCollection(), "access_control" );
+
+
+ m_actionGoSpecialHosts = new KAction( i18n( "&Special Hosts Control" ), QIconSet( BarIcon( "network_local", KMFGenericInterfacePartFactory::instance() ) ),
+ 0 , this, SLOT( slotGoSpecialHosts() ), actionCollection(), "special_hosts" );
+
+
+ m_actionGoICMPOptions = new KAction( i18n( "&ICMP Options" ), QIconSet( BarIcon( "pipe", KMFGenericInterfacePartFactory::instance() ) ),
+ 0 , this, SLOT( slotGoICMPOptions() ), actionCollection(), "icmp_options" );
+
+
+ m_actionGoNATConfiguration = new KAction( i18n( "&NAT Configuration" ), QIconSet( BarIcon( "filesaveas", KMFGenericInterfacePartFactory::instance() ) ),
+ 0 , this, SLOT( slotGoNATConfiguration() ), actionCollection(), "nat_configuration" );
+
+ m_actionGoLogging = new KAction( i18n( "&Logging" ), QIconSet( BarIcon( "log", KMFGenericInterfacePartFactory::instance() ) ),
+ 0 , this, SLOT( slotGoLogging() ), actionCollection(), "logging_options" );
+
+
+ setWidget( m_genericinterface );
+ setXMLFile( "kmfgenericinterfacepartui.rc" );
+
+ // we are read-write by default
+ setReadWrite( true );
+
+ // we are not modified since we haven't done anything yet
+ setModified( false );
+
+}
+
+KMFGenericInterfacePart::~KMFGenericInterfacePart() {
+ closeURL();
+}
+
+void KMFGenericInterfacePart::slotTargetChanged() {
+ m_app->updateCaption();
+}
+
+void KMFGenericInterfacePart::setReadWrite( bool rw ) {
+ ReadWritePart::setReadWrite( rw );
+}
+
+void KMFGenericInterfacePart::slotGoMyNetwork() {
+ kdDebug() << "slotGoMyNetwork()" << endl;
+ m_genericinterface->showPage( 0 );
+}
+
+void KMFGenericInterfacePart::slotGoAccessControl() {
+ kdDebug() << "slotGoAccessControl()" << endl;
+ m_genericinterface->showPage( 1 );
+}
+
+void KMFGenericInterfacePart::slotGoSpecialHosts() {
+ kdDebug() << "slotGoSpecialHosts()" << endl;
+ m_genericinterface->showPage( 2 );
+}
+
+void KMFGenericInterfacePart::slotGoICMPOptions() {
+ kdDebug() << "slotGoICMPOptions()" << endl;
+ m_genericinterface->showPage( 3 );
+}
+
+void KMFGenericInterfacePart::slotGoNATConfiguration() {
+ kdDebug() << "slotGoNATConfiguration()" << endl;
+ m_genericinterface->showPage( 4 );
+}
+
+void KMFGenericInterfacePart::slotGoLogging() {
+ kdDebug() << "slotGoLogging()" << endl;
+ m_genericinterface->showPage( 5 );
+}
+
+
+void KMFGenericInterfacePart::setModified( bool modified ) {
+ // get a handle on our Save action and make sure it is valid
+// KAction * save = actionCollection() ->action( KStdAction::stdName( KStdAction::Save ) );
+// if ( !save )
+// return ;
+//
+// // if so, we either enable or disable it based on the current
+// // state
+// if ( modified )
+// save->setEnabled( true );
+// else
+// save->setEnabled( false );
+
+ // in any event, we want our parent to do it's thing
+ ReadWritePart::setModified( modified );
+}
+
+bool KMFGenericInterfacePart::openFile() {
+ // m_file is always local so we can use QFile on it
+ // QFile file(m_file);
+ // if (file.open(IO_ReadOnly) == false)
+ // return false;
+ //
+ // // our example widget is text-based, so we use QTextStream instead
+ // // of a raw QDataStream
+ // QTextStream stream(&file);
+ // QString str;
+ // while (!stream.eof())
+ // str += stream.readLine() + "\n";
+ //
+ // file.close();
+ //
+ // // now that we have the entire file, display it
+ // // m_widget->setText(str);
+ //
+ // // just for fun, set the status bar
+ // emit setStatusBarText( m_url.prettyURL() );
+
+ return true;
+}
+
+bool KMFGenericInterfacePart::saveFile() {
+ // if we aren't read-write, return immediately
+ /* if (isReadWrite() == false)
+ return false;
+
+ // m_file is always local, so we use QFile
+ QFile file(m_file);
+ if (file.open(IO_WriteOnly) == false)
+ return false;
+
+ // use QTextStream to dump the text to the file
+ QTextStream stream(&file);
+ stream << m_widget->text();
+
+ file.close();
+ */
+ return true;
+}
+
+void KMFGenericInterfacePart::slotEnableActions( bool ) {
+ kdDebug() << "void KMFGenericInterfacePart::slotEnableActions( bool )" << endl;
+}
+
+// bool KMFGenericInterfacePart::closeURL()
+// {
+// return true;
+// }
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+KInstance* KMFGenericInterfacePartFactory::s_instance = 0L;
+KAboutData* KMFGenericInterfacePartFactory::s_about = 0L;
+
+KMFGenericInterfacePartFactory::KMFGenericInterfacePartFactory()
+ : KParts::Factory() {}
+
+KMFGenericInterfacePartFactory::~KMFGenericInterfacePartFactory() {
+ delete s_instance;
+ delete s_about;
+
+ s_instance = 0L;
+}
+
+KParts::Part* KMFGenericInterfacePartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name,
+ const char *classname, const QStringList& args) {
+ // Create an instance of our Part
+ KMFGenericInterfacePart * obj = new KMFGenericInterfacePart( parentWidget, widgetName, parent, name ,args );
+
+ // See if we are to be read-write or not
+ if ( QCString( classname ) == "KParts::ReadOnlyPart" )
+ obj->setReadWrite( false );
+
+ return obj;
+}
+
+KInstance* KMFGenericInterfacePartFactory::instance() {
+ if ( !s_instance ) {
+ s_about = new KAboutData( "kmfgenericinterfacepart", I18N_NOOP( "kmfgenericinterfacepartPart" ), "0.1" );
+ s_about->addAuthor( "Christian Hubinger", 0, "chubinger@irrsinnig.org" );
+ s_instance = new KInstance( s_about );
+ }
+ return s_instance;
+}
+
+extern "C" {
+ void* init_libkmfgenericinterfacepart() {
+ return new KMFGenericInterfacePartFactory;
+ }
+}
+
+}
+
+#include "kmfgenericinterface_part.moc"
diff --git a/kmyfirewall/genericinterface/kmfgenericinterface_part.h b/kmyfirewall/genericinterface/kmfgenericinterface_part.h
new file mode 100644
index 0000000..d86c120
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterface_part.h
@@ -0,0 +1,111 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001
+*/
+
+
+#ifndef __kmfgenericinterface_part_h__
+#define __kmfgenericinterface_part_h__
+
+#include <klibloader.h>
+#include <kparts/part.h>
+#include <kparts/factory.h>
+
+class KInstance;
+class KAboutData;
+class QLabel;
+class KAction;
+class KActionMenu;
+
+namespace KMF {
+class KMFMainWindow;
+class KMFGenericInterface;
+
+class KMFGenericInterfacePart: public KParts::ReadWritePart {
+ Q_OBJECT
+public:
+ KMFGenericInterfacePart( QWidget *parent, const char *name, QObject *parentObject, const
+ char *nameOb,
+ const QStringList & /*args*/ );
+ virtual ~KMFGenericInterfacePart();
+ static KAboutData *createAboutData();
+
+ /**
+ * This is a virtual function inherited from KParts::ReadWritePart.
+ * A shell will use this to inform this Part if it should act
+ * read-only
+ */
+ virtual void setReadWrite( bool rw );
+
+ /**
+ * Reimplemented to disable and enable Save action
+ */
+ virtual void setModified( bool modified );
+public slots:
+ void slotEnableActions( bool );
+ void slotGoAccessControl();
+ void slotGoMyNetwork();
+ void slotGoSpecialHosts();
+ void slotGoICMPOptions();
+ void slotGoNATConfiguration();
+ void slotGoLogging();
+
+ void slotTargetChanged();
+
+
+
+
+protected:
+ /**
+ * This must be implemented by each part
+ */
+ virtual bool openFile();
+
+ /**
+ * This must be implemented by each read-write part
+ */
+ virtual bool saveFile();
+
+private:
+ KMFMainWindow *m_app;
+
+ KMFGenericInterface *m_genericinterface;
+ KAction* m_actionGoMyNetwork;
+ KAction* m_actionGoAccessControl;
+ KAction* m_actionGoSpecialHosts;
+ KAction* m_actionGoICMPOptions;
+ KAction* m_actionGoNATConfiguration;
+ KAction* m_actionGoLogging;
+
+/*signals:
+ void sigUpdateView();*/
+};
+
+
+
+class KMFGenericInterfacePartFactory : public KParts::Factory
+{
+ Q_OBJECT
+public:
+ KMFGenericInterfacePartFactory();
+ virtual ~KMFGenericInterfacePartFactory();
+ virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name,
+ const char *classname, const QStringList &args );
+ static KInstance* instance();
+
+private:
+ static KInstance* s_instance;
+ static KAboutData* s_about;
+};
+}
+#endif
+
+
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfacehost.cpp b/kmyfirewall/genericinterface/kmfgenericinterfacehost.cpp
new file mode 100644
index 0000000..aa72c4c
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfacehost.cpp
@@ -0,0 +1,519 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfgenericinterfacehost.h"
+
+// QT includes
+#include <qstring.h>
+#include <qcheckbox.h>
+#include <qtextedit.h>
+#include <qlabel.h>
+#include <qtimer.h>
+
+// KDE includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <klistview.h>
+#include <kpopupmenu.h>
+#include <kpushbutton.h>
+#include <kiconloader.h>
+#include <knuminput.h>
+#include <kmessagebox.h>
+#include <kstdguiitem.h>
+
+// Project includes
+#include "../core/kmfnetwork.h"
+#include "../core/kmfgenericdoc.h"
+#include "../core/kmfnetzone.h"
+#include "../core/kmfnethost.h"
+
+#include "../kmfwidgets/kmflistviewitem.h"
+
+namespace KMF {
+KMFGenericInterfaceHost::KMFGenericInterfaceHost( QWidget *parent, const char *name, WFlags f )
+ : KMyFirewallGenericInterfaceHostWidget( parent, name, f ) {
+ m_lv_zones->setFullWidth( true );
+ m_contextMenu = new KPopupMenu( this, "Popup" );
+ m_contextMenu->hide();
+ loadIcons();
+ connect( m_lv_zones, SIGNAL( pressed( QListViewItem* ) ) ,
+ this, SLOT( slotNewItemSelected( QListViewItem* ) ) );
+ connect( m_lv_zones, SIGNAL( contextMenuRequested ( QListViewItem*, const QPoint&, int ) ),
+ this, SLOT( slotZoneRBM( QListViewItem*, const QPoint&, int ) ) );
+ connect( m_lv_zones, SIGNAL( itemRenamed ( QListViewItem *, int, const QString & ) ) ,
+ this, SLOT( slotHostRenamed( QListViewItem*, int , const QString & ) ) );
+
+ connect( m_sb_host_1, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+ connect( m_sb_host_2, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+ connect( m_sb_host_3, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+ connect( m_sb_host_4, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+
+ connect( m_host_desc, SIGNAL( textChanged() ),
+ this, SLOT( slotHostDescChanged() ) );
+
+ connect( c_log_in, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotLoggingChanged( bool ) ) );
+ connect( c_log_out, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotLoggingChanged( bool ) ) );
+
+ b_newHost->setIconSet( icon_new );
+ b_delHost->setIconSet( icon_del );
+
+ connect( b_newHost, SIGNAL( clicked() ),
+ this, SLOT( slotNewHost() ) );
+
+ connect( b_delHost, SIGNAL( clicked() ),
+ this, SLOT( slotDelHost() ) );
+}
+
+
+KMFGenericInterfaceHost::~KMFGenericInterfaceHost() {}
+
+// void KMFGenericInterfaceHost::slotDisable() {
+// }
+
+void KMFGenericInterfaceHost::slotUpdateView( NetfilterObject* ) {
+ kdDebug() << "KMFGenericInterfaceHost::slotUpdateView( NetfilterObject* )" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceHost::slotUpdateView() {
+ kdDebug() << "KMFGenericInterfaceHost::slotUpdateView()" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+
+ m_lv_zones->clear();
+ itemTrustedHosts = new KMFListViewItem( m_lv_zones, 0, m_doc->currentDocAsGenericDoc()-> trustedHostsZone() );
+ itemMaliciousHosts = new KMFListViewItem( m_lv_zones, 0, m_doc->currentDocAsGenericDoc()->maliciousHostsZone() );
+ itemBadServers = new KMFListViewItem( m_lv_zones, 0, m_doc->currentDocAsGenericDoc()->badServersHostsZone() );
+ itemBadClients = new KMFListViewItem( m_lv_zones, 0, m_doc->currentDocAsGenericDoc()->badClientsHostsZone() );
+
+ itemTrustedHosts->deleteChildren();
+ itemTrustedHosts->setupZoneView();
+
+ itemMaliciousHosts->deleteChildren();
+ itemMaliciousHosts->setupZoneView();
+
+ itemBadServers->deleteChildren();
+ itemBadServers->setupZoneView();
+
+ itemBadClients->deleteChildren();
+ itemBadClients->setupZoneView();
+
+ KMFListViewItem* it = 0;
+ if ( m_host ) {
+ it = findKMFItem( m_host->uuid() );
+ } else if ( m_zone ) {
+ it = findKMFItem( m_zone->uuid() );
+ }
+ if ( it ) {
+ m_lv_zones->setSelected( it, true );
+ slotNewItemSelected( it );
+ }
+}
+
+/*!
+ \fn KMFGenericInterfaceHost::loadDoc( KMFGenericDoc* )
+ */
+void KMFGenericInterfaceHost::loadDoc( KMFNetwork* doc ) {
+ kdDebug() << "void KMFGenericInterfaceHost::loadDoc( KMFGenericDoc* )" << endl;
+ m_doc = doc;
+ slotUpdateView();
+}
+
+/*!
+ \fn KMFGenericInterfaceHost::slotAddHost()
+ */
+void KMFGenericInterfaceHost::slotNewHost() {
+ kdDebug() << "void KMFGenericInterfaceHost::slotNewHost()" << endl;
+ if ( m_zone ) {
+
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone,
+ i18n( "Add new host to zone: %1." ).arg( m_zone->guiName() )
+ );
+ KMFNetHost * host = m_zone->addNetHost( i18n("New Host"), *(new QDomDocument() ) );
+ if ( host ) {
+ host->setGuiName( i18n("New Host") );
+ KMFListViewItem* it = findKMFItem( i18n("New Host"), host->uuid() );
+ if ( it ) {
+ it->setRenameEnabled( 0, true );
+ it->startRename( 0 );
+ }
+ m_host = host;
+ m_zone = host->zone();
+ KMFUndoEngine::instance()->endTransaction();
+ slotUpdateView();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+ }
+}
+
+/*!
+ \fn KMFGenericInterfaceHost::slotDelHost()
+ */
+void KMFGenericInterfaceHost::slotDelHost() {
+ kdDebug() << "void KMFGenericInterfaceHost::slotDelHost()" << endl;
+ if ( ! m_host || ! m_zone )
+ return;
+ if ( KMessageBox::questionYesNo(this, i18n("<qt>Are you sure that you want to delete host "
+ "<b>%1</b> from <b>%2</b>?</qt>").arg(m_host->guiName() ).arg( m_zone->guiName() ),
+ i18n("Are you sure?"), KStdGuiItem::yes(), KStdGuiItem::cancel(),
+ "genericgui_hostpage_hostdelete") == KMessageBox::Yes ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone,
+ i18n( "Delete host: %1 from zone: %2." ).arg( m_host->guiName() ).arg( m_zone->guiName() )
+ );
+ m_zone->delHost( m_host );
+ m_host = 0;
+ KMFUndoEngine::instance()->endTransaction();
+ slotUpdateView();
+ }
+}
+
+/*!
+ \fn KMFGenericInterfaceHost::slotNewItemSelected( QListViewItem* )
+ */
+void KMFGenericInterfaceHost::slotNewItemSelected( QListViewItem* item ){
+ kdDebug() << "void KMFGenericInterfaceHost::slotNewItemSelected( QListViewItem* )" << endl;
+ if ( ! item )
+ return ;
+ KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item );
+ if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETZONE ) {
+ m_host = 0;
+ m_zone = kmfitem->zone();
+ m_sb_host_1->setEnabled(false);
+ m_sb_host_2->setEnabled(false);
+ m_sb_host_3->setEnabled(false);
+ m_sb_host_4->setEnabled(false);
+ m_host_desc->setReadOnly( true );
+ c_log_in->setEnabled(false);
+ c_log_out->setEnabled(false);
+ c_log_in->setChecked( false );
+ c_log_out->setChecked( false );
+ m_host_desc->clear();
+ } else if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETHOST ) {
+ m_host = kmfitem->host();
+ m_zone = kmfitem->host()->zone();
+ m_sb_host_1->setEnabled(true);
+ m_sb_host_2->setEnabled(true);
+ m_sb_host_3->setEnabled(true);
+ m_sb_host_4->setEnabled(true);
+ m_sb_host_1->blockSignals(true);
+ m_sb_host_2->blockSignals(true);
+ m_sb_host_3->blockSignals(true);
+ m_sb_host_4->blockSignals(true);
+ m_sb_host_1->setValue( m_host->address()->getDigit( 0 ) );
+ m_sb_host_2->setValue( m_host->address()->getDigit( 1 ) );
+ m_sb_host_3->setValue( m_host->address()->getDigit( 2 ) );
+ m_sb_host_4->setValue( m_host->address()->getDigit( 3 ) );
+ m_sb_host_1->blockSignals(false);
+ m_sb_host_2->blockSignals(false);
+ m_sb_host_3->blockSignals(false);
+ m_sb_host_4->blockSignals(false);
+ m_host_desc->setText( m_host->description() );
+ m_host_desc->setReadOnly( false );
+ c_log_in->setEnabled(true);
+ c_log_out->setEnabled(true);
+ c_log_in->setChecked( m_host->logIncoming() );
+ c_log_out->setChecked( m_host->logOutgoing() );
+ l_currHost->setText( i18n( "Host: %1").arg( m_host->guiName() ) );
+
+ } else {
+ kdDebug() << "KMFGenericInterfaceHost::slotNewItemSelected( QListViewItem* item ): WARNING unknown ListView Type!!!" << endl;
+ }
+
+}
+
+/*!
+ \fn KMFGenericInterfaceHost::slotRenameHost()
+ */
+void KMFGenericInterfaceHost::slotRenameHost() {
+ kdDebug() << "void KMFGenericInterfaceHost::slotRenameHost()" << endl;
+ if ( m_host ) {
+ KMFListViewItem* it = findKMFItem( m_host->guiName(), m_host->uuid() );
+ if ( it ) {
+ it->setRenameEnabled( 0, true );
+ it->startRename( 0 );
+ }
+ }
+}
+
+void KMFGenericInterfaceHost::slotHostRenamed( QListViewItem* item, int , const QString& text ) {
+ kdDebug() << "void KMFGenericInterfaceHost::slotHostRenamed( QListViewItem* item, int , const QString& text )" << endl;
+
+ if ( ! item || text.isNull() )
+ return ;
+
+ QString newName = text.simplifyWhiteSpace();
+
+ KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item );
+ if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETHOST ) {
+ m_host = kmfitem->host();
+ m_zone = kmfitem->host()->zone();
+ if ( newName == m_host->guiName() ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Rename host: %1 to %2." ).arg( m_host->guiName() ).arg( newName )
+ );
+ m_host->setGuiName( newName );
+ KMFUndoEngine::instance()->endTransaction();
+ kdDebug() << "Setting GuiName: " << m_host->guiName() << "\ninternal Name: " << m_host->name() << endl;
+ slotUpdateView();
+ }
+
+}
+void KMFGenericInterfaceHost::slotAddressChanged( const QString& ) {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotAddressChanged( const QString& )" << endl;
+ if ( ! m_host )
+ return;
+
+ QString address = "[" + m_sb_host_1->text() + "." +
+ m_sb_host_2->text() + "." +
+ m_sb_host_3->text() + "." +
+ m_sb_host_4->text() + "]";
+
+ if ( address == m_host->address()->toString() ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Change address of host: %1." ).arg( m_host->guiName() )
+ );
+ m_host->address()->setAddress( m_sb_host_1->text() +"."+
+ m_sb_host_2->text()+"."+
+ m_sb_host_3->text()+"."+
+ m_sb_host_4->text() );
+ KMFUndoEngine::instance()->endTransaction();
+
+ KMFListViewItem *it = findKMFItem( m_host->guiName(), m_host->uuid() );
+ if ( it ) {
+ it->setText( 1 , "[" + address +"]" );
+ }
+}
+
+void KMFGenericInterfaceHost::slotHostDescChanged() {
+ kdDebug() << "void KMFGenericInterfaceHost::slotHostDescChanged()" << endl;
+ if ( ! m_host ) {
+ return;
+ }
+ if ( m_host_desc->text().simplifyWhiteSpace() == m_host->description() ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Edit documentation of host: %1" ).arg( m_host->guiName() )
+ );
+ m_host->setDescription( m_host_desc->text().simplifyWhiteSpace() );
+ KMFUndoEngine::instance()->endTransaction();
+
+}
+
+void KMFGenericInterfaceHost::slotLoggingChanged( bool ) {
+ kdDebug() << "void KMFGenericInterfaceHost::slotLoggingChanged( bool )" << endl;
+ if ( ! m_host ) {
+ return;
+ }
+ if ( c_log_in->isChecked() != m_host->logIncoming() ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Edit logging option of host: %1" ).arg( m_host->guiName() )
+ );
+ m_host->setLogIncoming( c_log_in->isChecked() );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ if ( m_host->logOutgoing() != c_log_out->isChecked() ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Edit logging option of host: %1" ).arg( m_host->guiName() )
+ );
+ m_host->setLogOutgoing( c_log_out->isChecked() );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+
+}
+
+/*!
+ \fn KMFGenericInterfaceHost::slotRBM( QListViewItem*, const QPoint&, int )
+ */
+void KMFGenericInterfaceHost::slotZoneRBM( QListViewItem* item, const QPoint& point, int ){
+ kdDebug() << "void KMFGenericInterfaceHost::slotRBM( QListViewItem*, const QPoint&, int )" << endl;
+ if ( ! item )
+ return ;
+ KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item );
+ if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETZONE ) {
+ kdDebug() << "Setting up Zone RBM:" << endl;
+ m_host = 0;
+ m_zone = 0;
+ m_zone = kmfitem->zone();
+ if ( m_zone ) {
+ m_contextMenu->clear();
+ QString name = m_zone->name();
+ QString lab_str = i18n("Special Host Type: %1").arg( m_zone->guiName() );
+ m_contextMenu->insertTitle( icon_chain, lab_str );
+ m_contextMenu->insertItem( icon_new, i18n( "New Host..." ), this, SLOT( slotNewHost() ) );
+ m_contextMenu->popup( point );
+ }
+ } else if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETHOST ) {
+ m_host = 0;
+ m_zone = 0;
+ m_host = kmfitem->host();
+ m_zone = kmfitem->host()->zone();
+ if ( m_host ) {
+ m_contextMenu->clear();
+ QString name = m_zone->name();
+ QString lab_str = i18n("Special Host: %1").arg( m_host->guiName() );
+ m_contextMenu->insertTitle( icon_chain, lab_str );
+ m_contextMenu->insertItem( icon_new, i18n( "New Host..." ), this, SLOT( slotNewHost() ) );
+ m_contextMenu->insertItem( icon_rename, i18n( "Rename Host..." ), this, SLOT( slotRenameHost() ) );
+ m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( icon_del, i18n( "Delete Host" ), this, SLOT( slotDelHost() ) );
+
+ m_contextMenu->popup( point );
+
+ }
+ }
+}
+
+KMFListViewItem* KMFGenericInterfaceHost::findKMFItem( const QString& text, const QUuid& obj_id ) {
+ if ( obj_id.isNull() )
+ return 0;
+ QListViewItemIterator it( m_lv_zones );
+ while ( it.current() ) {
+ QListViewItem * qitem = it.current();
+ ++it;
+ KMFListViewItem * item = 0;
+ item = dynamic_cast<KMFListViewItem*> ( qitem );
+ if ( item ) {
+ if ( item->text( 0 ) == text && item->uuid() == obj_id )
+ return item;
+ } else {
+ kdDebug() << "CAST ERROR: Item not of type KMFListViewItem" << endl;
+ }
+ }
+// kdDebug() << "Couldn't find Item " << text << " column: " << column << ", int obj_id: " << obj_id << endl;
+ return 0;
+}
+KMFListViewItem* KMFGenericInterfaceHost::findKMFItem( const QUuid& obj_id ) {
+ if ( obj_id.isNull() )
+ return 0;
+ QListViewItemIterator it( m_lv_zones );
+ while ( it.current() ) {
+ QListViewItem * qitem = it.current();
+ ++it;
+ KMFListViewItem * item = 0;
+ item = dynamic_cast<KMFListViewItem*> ( qitem );
+ if ( item ) {
+ if ( item->uuid() == obj_id )
+ return item;
+ } else {
+ kdDebug() << "CAST ERROR: Item not of type KMFListViewItem" << endl;
+ }
+ }
+// kdDebug() << "Couldn't find Item " << text << " column: " << column << ", int obj_id: " << obj_id << endl;
+ return 0;
+}
+
+void KMFGenericInterfaceHost::loadIcons() {
+ kdDebug() << "void KMFGenericInterfa::loadIcons()" << endl;
+ KIconLoader *loader = KGlobal:: iconLoader();
+ QString icon_name;
+
+ icon_name = "up";
+ icon_up = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "down";
+ icon_down = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editdelete";
+ icon_del = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filenew";
+ icon_new = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "edit";
+ icon_edit = loader->loadIcon( icon_name, KIcon::Small );
+
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "text";
+ icon_rename = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "rule-22";
+ icon_rule = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "view_tree";
+ icon_chain = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "reject";
+ icon_reject = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "target";
+ icon_target = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "stop";
+ icon_drop = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "button_ok";
+ icon_accept = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filesaveas";
+ icon_log = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "undo";
+ icon_return = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editclear";
+ icon_cmd = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "pipe";
+ icon_queue = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editcopy";
+ icon_copy = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "forward";
+ icon_move = loader->loadIcon( icon_name, KIcon::Small );
+
+}
+
+}
+
+#include "kmfgenericinterfacehost.moc"
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfacehost.h b/kmyfirewall/genericinterface/kmfgenericinterfacehost.h
new file mode 100644
index 0000000..84f28cc
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfacehost.h
@@ -0,0 +1,103 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFGENERICINTERFACEHOST_H
+#define KMFGENERICINTERFACEHOST_H
+
+#include "kmyfirewallgenericinterfacehostwidget.h"
+
+/**
+@author Christian Hubinger
+*/
+
+// QT includes
+
+#include <qstring.h>
+#include <qguardedptr.h>
+#include <qpixmap.h>
+#include <quuid.h>
+
+class QListViewItem;
+
+// KDE includes
+
+class KPopupMenu;
+
+namespace KMF {
+// Project Includes
+class KMFNetwork;
+class KMFGenericDoc;
+class KMFNetZone;
+class KMFNetHost;
+class KMFListViewItem;
+class NetfilterObject;
+
+class KMFGenericInterfaceHost : public KMyFirewallGenericInterfaceHostWidget {
+ Q_OBJECT
+public:
+ KMFGenericInterfaceHost( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+
+ ~KMFGenericInterfaceHost();
+
+public:
+ void loadDoc( KMFNetwork* );
+
+public slots:
+ void slotUpdateView();
+ void slotUpdateView( NetfilterObject* );
+
+private slots:
+ void slotZoneRBM( QListViewItem*, const QPoint&, int );
+ void slotNewHost();
+ void slotDelHost();
+ void slotNewItemSelected( QListViewItem* );
+ void slotRenameHost();
+ void slotHostRenamed( QListViewItem*, int , const QString & );
+ void slotAddressChanged( const QString& );
+ void slotHostDescChanged();
+ void slotLoggingChanged( bool );
+ // void slotDisable();
+
+private:
+ void loadIcons();
+ KMFListViewItem* findKMFItem( const QString& text, const QUuid& obj_id );
+ KMFListViewItem* findKMFItem( const QUuid& obj_id );
+
+ QGuardedPtr<KMFNetZone> m_zone;
+ QGuardedPtr<KMFNetHost> m_host;
+ QGuardedPtr<KMFNetwork> m_doc;
+ KPopupMenu* m_contextMenu;
+
+ KMFListViewItem *itemTrustedHosts;
+ KMFListViewItem *itemMaliciousHosts;
+ KMFListViewItem *itemBadServers;
+ KMFListViewItem *itemBadClients;
+
+
+
+ QPixmap icon_up, icon_down, icon_del, icon_edit, icon_rule, icon_filter, icon_rename,
+ icon_chain, icon_log, icon_accept, icon_drop, icon_cmd, icon_reject, icon_return,
+ icon_target, icon_queue, icon_new, icon_copy, icon_move;
+
+};
+}
+#endif
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfaceicmp.cpp b/kmyfirewall/genericinterface/kmfgenericinterfaceicmp.cpp
new file mode 100644
index 0000000..a867715
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfaceicmp.cpp
@@ -0,0 +1,110 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfgenericinterfaceicmp.h"
+
+// QT includes
+#include <qstring.h>
+#include <qcheckbox.h>
+
+// KDE includes
+#include <klocale.h>
+#include <kdebug.h>
+
+// Project includes
+#include "../core/kmfnetwork.h"
+#include "../core/kmfgenericdoc.h"
+
+namespace KMF {
+KMFGenericInterfaceIcmp::KMFGenericInterfaceIcmp( QWidget *parent, const char *name, WFlags f )
+ : KMyFirewallGenericInterfaceIcmp( parent, name, f ) {
+connect( c_allow_ping, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotEnablePingReplyToggled( bool ) ) );
+connect( c_limit_ping, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotEnablePingReplyLimitToggled( bool ) ) );
+}
+
+
+KMFGenericInterfaceIcmp::~KMFGenericInterfaceIcmp() {}
+
+void KMFGenericInterfaceIcmp::slotUpdateView( NetfilterObject* ) {
+ kdDebug() << "KMFGenericInterfaceIcmp::slotUpdateView( NetfilterObject* )" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceIcmp::slotUpdateView() {
+ kdDebug() << "KMFGenericInterfaceIcmp::slotUpdateView()" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+ c_allow_ping->setChecked( m_doc->currentDocAsGenericDoc()->allowPingReply() );
+ c_limit_ping->setChecked( m_doc->currentDocAsGenericDoc()->limitPingReply() );
+
+}
+void KMFGenericInterfaceIcmp::loadDoc( KMFNetwork* doc ) {
+ kdDebug() << "void KMFGenericInterfaceIcmp::loadDoc( KMFGenericDoc* )" << endl;
+ m_doc = doc;
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceIcmp::slotEnablePingReplyToggled( bool onoff ) {
+ kdDebug() << "KMFGenericInterfaceIcmp::slotEnablePingReplyToggled( bool onoff )" << endl;
+ if ( m_doc->currentDocAsGenericDoc()->allowPingReply() == onoff ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc(),
+ i18n( "%1 ping reply." ).arg( onoff ? i18n( "Allow" ) : i18n( "Supress" ) )
+ );
+ if ( onoff ) {
+ m_doc->currentDocAsGenericDoc()->setAllowPingReply( onoff );
+ if ( c_limit_ping->isChecked() ) {
+ m_doc->currentDocAsGenericDoc()->setLimitPingReply( onoff );
+ }
+ } else {
+ m_doc->currentDocAsGenericDoc()->setAllowPingReply( onoff );
+ }
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+void KMFGenericInterfaceIcmp::slotEnablePingReplyLimitToggled( bool onoff ) {
+ kdDebug() << "KMFGenericInterfaceIcmp::slotEnablePingReplyLimitToggled( bool onoff )" << endl;
+ if ( m_doc->currentDocAsGenericDoc()->limitPingReply() == onoff ) {
+ return;
+ }
+
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc(),
+ i18n( "%1 limit ping reply." ).arg( onoff ? i18n( "Enable") : i18n( "Disable" ) )
+ );
+ m_doc->currentDocAsGenericDoc()->setLimitPingReply( onoff );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+}
+
+#include "kmfgenericinterfaceicmp.moc"
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfaceicmp.h b/kmyfirewall/genericinterface/kmfgenericinterfaceicmp.h
new file mode 100644
index 0000000..62841d3
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfaceicmp.h
@@ -0,0 +1,60 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFGENERICINTERFACEICMP_H
+#define KMFGENERICINTERFACEICMP_H
+
+#include <kmyfirewallgenericinterfaceicmp.h>
+
+// QT Includes
+#include <qguardedptr.h>
+
+/**
+@author Christian Hubinger
+*/
+namespace KMF {
+class KMFGenericDoc;
+class KMFNetwork;
+class NetfilterObject;
+
+class KMFGenericInterfaceIcmp : public KMyFirewallGenericInterfaceIcmp {
+ Q_OBJECT
+public:
+ KMFGenericInterfaceIcmp( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+
+ ~KMFGenericInterfaceIcmp();
+
+void loadDoc( KMFNetwork* doc );
+
+public slots:
+ void slotUpdateView();
+ void slotUpdateView( NetfilterObject* );
+
+private slots:
+ void slotEnablePingReplyToggled( bool );
+ void slotEnablePingReplyLimitToggled( bool );
+
+private:
+ QGuardedPtr<KMFNetwork> m_doc;
+};
+}
+#endif
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfacelogging.cpp b/kmyfirewall/genericinterface/kmfgenericinterfacelogging.cpp
new file mode 100644
index 0000000..9b065a9
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfacelogging.cpp
@@ -0,0 +1,125 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfgenericinterfacelogging.h"
+
+// QT includes
+#include <qstring.h>
+#include <qcheckbox.h>
+#include <qtimer.h>
+
+// KDE includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <krestrictedline.h>
+
+// Project includes
+#include "../core/kmfnetwork.h"
+#include "../core/kmfgenericdoc.h"
+namespace KMF {
+KMFGenericInterfaceLogging::KMFGenericInterfaceLogging( QWidget *parent, const char *name, WFlags f )
+ : KMyFirewallGenericInterfaceLogging( parent, name, f ) {
+ connect( m_c_log, SIGNAL( toggled( bool ) ),
+ this,SLOT( slotLoggingChanged( bool ) ) );
+
+ connect( m_c_limitLog, SIGNAL( toggled( bool ) ),
+ this,SLOT( slotLimitChanged( bool ) ) );
+
+ connect( m_le_logPrefix, SIGNAL( textChanged( const QString & ) ),
+ this,SLOT ( slotLogPrefixChanged( const QString & ) ) );
+}
+
+
+KMFGenericInterfaceLogging::~KMFGenericInterfaceLogging() {}
+
+void KMFGenericInterfaceLogging::slotUpdateView( NetfilterObject* ) {
+ kdDebug() << "KMFGenericInterfaceLogging::slotUpdateView( NetfilterObject* )" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceLogging::slotUpdateView() {
+ kdDebug() << "KMFGenericInterfaceLogging::slotUpdateView()" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+ m_c_log->setChecked( m_doc->currentDocAsGenericDoc()-> logDropped() );
+ m_c_limitLog->setChecked( m_doc->currentDocAsGenericDoc()->limitLog() );
+
+ if ( m_doc->currentDocAsGenericDoc()->logPrefix() != m_le_logPrefix->text().simplifyWhiteSpace() ) {
+ m_le_logPrefix->setText( m_doc->currentDocAsGenericDoc()->logPrefix() );
+ }
+}
+
+/*!
+ \fn KMFGenericInterfaceLogging::loadDoc( KMFGenricDoc* )
+ */
+void KMFGenericInterfaceLogging::loadDoc( KMFNetwork* doc ) {
+ kdDebug() << "void KMFGenericInterfaceLogging::loadDoc( KMFGenericDoc* )" << endl;
+ m_doc = doc;
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceLogging::slotLoggingChanged( bool onoff ) {
+ if ( m_doc->currentDocAsGenericDoc()->logDropped() == onoff ) {
+ return;
+ }
+
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc(),
+ i18n( "%1 logging of dropped packets." ).arg( onoff ? i18n( "Enable" ) : i18n( "Disable" ) )
+ );
+ m_doc->currentDocAsGenericDoc()->setLogDropped( onoff );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+void KMFGenericInterfaceLogging::slotLimitChanged( bool onoff ) {
+ if ( m_doc->currentDocAsGenericDoc()->limitLog() == onoff ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc(),
+ i18n( "%1 logging limit." ).arg( onoff ? i18n( "Enable" ) : i18n( "Disable" ) )
+ );
+ m_doc->currentDocAsGenericDoc()->setLimitLog( onoff );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+void KMFGenericInterfaceLogging::slotLogPrefixChanged( const QString & ) {
+ if ( m_doc->currentDocAsGenericDoc()->logPrefix() == m_le_logPrefix->text().simplifyWhiteSpace() ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc(),
+ i18n( "Change logging prefix to %1." ).arg( m_le_logPrefix->text().simplifyWhiteSpace() )
+ );
+ m_doc->currentDocAsGenericDoc()->setLogPrefix( m_le_logPrefix->text().simplifyWhiteSpace() );
+ KMFUndoEngine::instance()->endTransaction();
+
+}
+
+}
+#include "kmfgenericinterfacelogging.moc"
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfacelogging.h b/kmyfirewall/genericinterface/kmfgenericinterfacelogging.h
new file mode 100644
index 0000000..8fa62d1
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfacelogging.h
@@ -0,0 +1,67 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFGENERICINTERFACELOGGING_H
+#define KMFGENERICINTERFACELOGGING_H
+
+#include <kmyfirewallgenericinterfacelogging.h>
+
+/**
+@author Christian Hubinger
+*/
+
+// QT includes
+#include <qstring.h>
+#include <qguardedptr.h>
+
+class QTimer;
+
+namespace KMF {
+class KMFNetwork;
+class KMFGenericDoc;
+class NetfilterObject;
+
+class KMFGenericInterfaceLogging : public KMyFirewallGenericInterfaceLogging {
+ Q_OBJECT
+public:
+ KMFGenericInterfaceLogging( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+
+ ~KMFGenericInterfaceLogging();
+
+
+public slots:
+ void slotUpdateView();
+ void slotUpdateView( NetfilterObject* );
+
+public:
+ void loadDoc( KMFNetwork* );
+
+private slots:
+ void slotLoggingChanged( bool );
+ void slotLimitChanged( bool );
+ void slotLogPrefixChanged( const QString & );
+
+private:
+ QGuardedPtr<KMFNetwork> m_doc;
+};
+}
+#endif
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfacenat.cpp b/kmyfirewall/genericinterface/kmfgenericinterfacenat.cpp
new file mode 100644
index 0000000..7393d8f
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfacenat.cpp
@@ -0,0 +1,200 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfgenericinterfacenat.h"
+
+
+// QT includes
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qcheckbox.h>
+#include <qlistview.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kcombobox.h>
+#include <knuminput.h>
+#include <klistview.h>
+
+// Project includes
+#include "../core/kmfnetwork.h"
+#include "../core/kmftarget.h"
+#include "../core/kmftargetconfig.h"
+#include "../core/kmfgenericdoc.h"
+#include "../core/kmfconfig.h"
+namespace KMF {
+KMFGenericInterfaceNat::KMFGenericInterfaceNat( QWidget *parent, const char *name, WFlags f )
+ : KMyFirewallGenericInterfaceNATWidget( parent, name, f ) {
+
+connect( m_c_enable_nat, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotNatEnabled( bool ) ) );
+connect( m_c_use_masquerade, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotMasqueradeEnabled( bool ) ) );
+
+
+connect( m_sb_addr_1, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+connect( m_sb_addr_2, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+connect( m_sb_addr_3, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+connect( m_sb_addr_4, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+
+connect( m_cb_external_interface, SIGNAL( activated( const QString& ) ),
+ this, SLOT( slotExternalInterfaceChanged( const QString& ) ) );
+}
+
+
+KMFGenericInterfaceNat::~KMFGenericInterfaceNat() {}
+
+void KMFGenericInterfaceNat::slotUpdateView( NetfilterObject* ) {
+ kdDebug() << "KMFGenericInterfaceNat::slotUpdateView( NetfilterObject* )" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+ slotUpdateView();
+}
+void KMFGenericInterfaceNat::slotUpdateView() {
+ kdDebug() << "void KMFGenericInterfaceNat::slotUpdateView()" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+ m_c_enable_nat->setChecked( m_doc->currentDocAsGenericDoc()->useNat() );
+ m_c_use_masquerade->setChecked( m_doc->currentDocAsGenericDoc()->useMasquerade() );
+// m_c_restrict_nat->setChecked( m_doc->restrictNat() );
+ m_sb_addr_1->blockSignals( true );
+ m_sb_addr_2->blockSignals( true );
+ m_sb_addr_3->blockSignals( true );
+ m_sb_addr_4->blockSignals( true );
+ m_sb_addr_1->setValue( m_doc->currentDocAsGenericDoc()->natAddress()->getDigit( 0 ) );
+ m_sb_addr_2->setValue( m_doc->currentDocAsGenericDoc()->natAddress()->getDigit( 1 ) );
+ m_sb_addr_3->setValue( m_doc->currentDocAsGenericDoc()->natAddress()->getDigit( 2 ) );
+ m_sb_addr_4->setValue( m_doc->currentDocAsGenericDoc()->natAddress()->getDigit( 3 ) );
+ kdDebug() << "Setting Address Fields to: " << m_doc->currentDocAsGenericDoc()->natAddress()->getDigit( 0 ) << "." <<
+ m_doc->currentDocAsGenericDoc()->natAddress()->getDigit( 1 ) << "." << m_doc->currentDocAsGenericDoc()->natAddress()->getDigit( 2 ) << "." <<
+ m_doc->currentDocAsGenericDoc()->natAddress()->getDigit( 3 ) << endl;
+ m_sb_addr_1->blockSignals( false );
+ m_sb_addr_2->blockSignals( false );
+ m_sb_addr_3->blockSignals( false );
+ m_sb_addr_4->blockSignals( false );
+
+ QStringList interfaces = m_doc->currentTarget()->config()->interfaces();
+ m_cb_external_interface->clear();
+ m_cb_external_interface->insertStringList( interfaces );
+
+ QString interf = m_doc->currentDocAsGenericDoc()->outgoingInterface();
+
+ interf = m_doc->currentDocAsGenericDoc()->outgoingInterface();
+ bool found = false;
+ int i = 0;
+ for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end() && ! found; ++it ) {
+ if ( *it == interf ) {
+ m_cb_external_interface->setCurrentItem( i );
+ }
+ i++;
+ }
+
+}
+
+/*!
+ \fn KMFGenericInterfaceNat::loadDoc( KMFGenericDoc* )
+ */
+void KMFGenericInterfaceNat::loadDoc( KMFNetwork* doc ) {
+ kdDebug() << "void KMFGenericInterfaceNat::loadDoc( KMFGenericDoc* )" << endl;
+ m_doc = doc;
+ slotUpdateView();
+}
+
+
+/*!
+ \fn KMFGenericInterfaceNat::slotNatEnabled( bool )
+ */
+void KMFGenericInterfaceNat::slotNatEnabled( bool onoff ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc(),
+ i18n( "%1 NAT." ).arg( onoff ? i18n( "Enable" ) : i18n( "Disable" ) )
+ );
+
+ m_doc->currentDocAsGenericDoc()->setUseNat( onoff );
+ m_doc->currentDocAsGenericDoc()->setOutgoingInterface( m_cb_external_interface->currentText () );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+/*!
+ \fn KMFGenericInterfaceNat::slotMasqueradeEnabled( bool )
+ */
+void KMFGenericInterfaceNat::slotMasqueradeEnabled( bool onoff ) {
+ if ( m_doc->currentDocAsGenericDoc()->useMasquerade() == onoff ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc(),
+ i18n( "%1 MASQUERADE target for NAT." ).arg( onoff ? i18n( "Enable" ) : i18n( "Disable" ) )
+ );
+ m_doc->currentDocAsGenericDoc()->setUseMasquerade( onoff );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+
+/*!
+ \fn KMFGenericInterfaceNat::slotAddressChanged( const QString& )
+ */
+void KMFGenericInterfaceNat::slotAddressChanged( const QString& ) {
+ QString address = "" + m_sb_addr_1->text() + "." + m_sb_addr_2->text() + "." + m_sb_addr_3->text() + "." + m_sb_addr_4->text();
+ if ( address == m_doc->currentDocAsGenericDoc()->natAddress()->toString() ) {
+ return;
+ }
+
+ kdDebug() << "Updating NAT external address to: " << address << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc(),
+ i18n( "Set NAT adddress to %1." ).arg( address )
+ );
+ m_doc->currentDocAsGenericDoc()->natAddress()->setAddress( m_sb_addr_1->value(),
+ m_sb_addr_2->value(),
+ m_sb_addr_3->value(),
+ m_sb_addr_4->value() );
+ KMFUndoEngine::instance()->endTransaction();
+}
+/*!
+ \fn KMFGenericInterfaceNat::slotOutgoingInterfaceChanged( const QString& )
+ */
+void KMFGenericInterfaceNat::slotExternalInterfaceChanged( const QString& str ) {
+ if ( m_doc->currentDocAsGenericDoc()->outgoingInterface() == str ) {
+ return;
+ }
+
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc(),
+ i18n( "Change NAT outgoing interface to %1." ).arg( str )
+ );
+ m_doc->currentDocAsGenericDoc()->setOutgoingInterface( str );
+ KMFUndoEngine::instance()->endTransaction();
+ slotUpdateView();
+}
+
+}
+#include "kmfgenericinterfacenat.moc"
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfacenat.h b/kmyfirewall/genericinterface/kmfgenericinterfacenat.h
new file mode 100644
index 0000000..efd1a6e
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfacenat.h
@@ -0,0 +1,66 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFGENERICINTERFACENAT_H
+#define KMFGENERICINTERFACENAT_H
+
+#include <kmyfirewallgenericinterfacenatwidget.h>
+
+// QT Includes
+#include <qguardedptr.h>
+
+/**
+@author Christian Hubinger
+*/
+
+namespace KMF {
+class KMFNetwork;
+class KMFGenericDoc;
+class NetfilterObject;
+
+class KMFGenericInterfaceNat : public KMyFirewallGenericInterfaceNATWidget {
+ Q_OBJECT
+public:
+ KMFGenericInterfaceNat( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+
+ ~KMFGenericInterfaceNat();
+signals:
+
+
+public slots:
+ void slotUpdateView();
+ void slotUpdateView( NetfilterObject* );
+
+public:
+ void loadDoc( KMFNetwork* );
+
+
+private:
+ QGuardedPtr<KMFNetwork> m_doc;
+
+ private slots: void slotAddressChanged( const QString& );
+ private slots: void slotMasqueradeEnabled( bool );
+ private slots: void slotNatEnabled( bool );
+ private slots: void slotExternalInterfaceChanged( const QString& );
+};
+}
+#endif
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfacepartui.rc b/kmyfirewall/genericinterface/kmfgenericinterfacepartui.rc
new file mode 100644
index 0000000..14db18f
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfacepartui.rc
@@ -0,0 +1,16 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kmfgenericinterfacepart" version="1">
+ <MenuBar>
+ <Menu name="go"><text>&amp;Go</text>
+ <Action name="my_network"/>
+ <Action name="access_control"/>
+ <Action name="special_hosts"/>
+ <Action name="icmp_options"/>
+ <Action name="nat_configuration"/>
+ <Action name="logging_options"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
+
+<!-- libraryname="libkmfgenericinterfacepart" -->
+
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfaceprotocol.cpp b/kmyfirewall/genericinterface/kmfgenericinterfaceprotocol.cpp
new file mode 100644
index 0000000..ea688ed
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfaceprotocol.cpp
@@ -0,0 +1,681 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfgenericinterfaceprotocol.h"
+
+// QT includes
+#include <qlistview.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qgroupbox.h>
+#include <qwidgetstack.h>
+#include <qtextedit.h>
+#include <qtimer.h>
+
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kcombobox.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kinputdialog.h>
+#include <knuminput.h>
+
+// Project includes
+#include "../core/kmfnetwork.h"
+#include "../core/kmfgenericdoc.h"
+#include "../core/kmfprotocol.h"
+#include "../core/kmfprotocolusage.h"
+#include "../core/kmfnetzone.h"
+#include "../core/kmfnethost.h"
+#include "../core/kmferror.h"
+
+#include "../kmfwidgets/kmflistviewitem.h"
+#include "../kmfwidgets/kmfchecklistitem.h"
+#include "../kmfwidgets/kmfnetworkwidget.h"
+#include "../kmfwidgets/kmfnethostpropertieswidget.h"
+#include "../kmfwidgets/kmfprotocolpropertieswidget.h"
+#include "../kmfwidgets/kmfprotocollistview.h"
+
+namespace KMF {
+KMFGenericInterfaceProtocol::KMFGenericInterfaceProtocol( QWidget *parent, const char *name, WFlags f ) : KMyFirewallGenericInterfaceProtocolWidget( parent, name, f ) {
+ loadIcons();
+ m_contextMenu = new KPopupMenu( this, "m_contextMenu" );
+// m_lv_protocols->setFullWidth( true );
+
+ // Network Widget
+ m_network_widget = new KMFNetworkWidget( m_widgetStack, "m_network_widget" );
+ m_widgetStack->addWidget( m_network_widget );
+ connect( m_network_widget,SIGNAL( sigZoneChanged( KMFNetZone* ) ),
+ this,SLOT( slotZoneChanged( KMFNetZone* ) ) );
+
+ // Host widget
+ m_nethostProperties_widget = new KMFNetHostPropertiesWidget( m_widgetStack, "m_nethostProperties_widget" );
+ m_widgetStack->addWidget( m_nethostProperties_widget );
+
+ connect( m_nethostProperties_widget, SIGNAL( sigHostAddressChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+
+ // Protocol Widget
+ m_protocolProperties_widget = new KMFProtocolPropertiesWidget( m_widgetStack, "m_protocolProperties_widget" );
+ m_widgetStack->addWidget( m_protocolProperties_widget );
+
+
+ // Protociol List View
+ m_protocolLIstView = new KMFProtocolListView( m_protocolsFrame, "m_protocolLIstView" );
+
+ QGridLayout *grid = new QGridLayout( m_protocolsFrame, 1, 1 );
+ grid->addWidget( m_protocolLIstView, 0, 0 );
+
+ connect( m_protocolLIstView,SIGNAL( sigProtocolClicked( KMFProtocolUsage*, bool ) ),
+ this, SLOT( slotProtocolClicked( KMFProtocolUsage*, bool ) ) );
+
+ connect( m_protocolLIstView,SIGNAL( sigProtocolCategoryClicked( KMFProtocolCategory* ) ),
+ this, SLOT ( slotProtocolCategoryClicked( KMFProtocolCategory* ) ) );
+
+ // Zone view
+ connect( m_lv_zones, SIGNAL( pressed( QListViewItem* ) ) ,
+ this, SLOT( slotNewItemSelected( QListViewItem* ) ) );
+
+ connect( m_lv_zones, SIGNAL( contextMenuRequested ( QListViewItem*, const QPoint&, int ) ),
+ this, SLOT( slotZoneRBM( QListViewItem*, const QPoint&, int ) ) );
+
+ connect( m_lv_zones, SIGNAL( itemRenamed ( QListViewItem *, int, const QString & ) ) ,
+ this, SLOT( slotRenameItem( QListViewItem *, int, const QString & ) ) );
+
+ // Main win
+ connect( m_c_restrictOutgoing, SIGNAL( clicked() ),
+ this, SLOT( slotRestrictionChanged() ) );
+
+ connect( m_c_allowIncoming, SIGNAL( clicked() ),
+ this, SLOT( slotRestrictionChanged() ) );
+
+ connect( m_zoneSelect, SIGNAL( activated( const QString& ) ),
+ this, SLOT( slotCurrentZoneChanged( const QString& ) ) );
+
+ m_zone = 0;
+ m_type = -1;
+ m_protocolUsage = 0;
+}
+
+
+KMFGenericInterfaceProtocol::~KMFGenericInterfaceProtocol() {}
+
+void KMFGenericInterfaceProtocol::loadDoc( KMFNetwork *net ) {
+ kdDebug() << "void KMFGenericInterfaceProtocol::loadDoc( KMFGenericDoc* doc )" << endl;
+ m_doc = net;
+ m_doc->currentDocAsGenericDoc()->incomingZone();
+ m_zoneSelect->clear();
+ m_zoneSelect->insertItem( i18n("Incoming Zone") );
+ m_zoneSelect->insertItem( i18n("Outgoing Zone") );
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceProtocol::slotUpdateView( NetfilterObject* ) {
+ kdDebug() << "KMFGenericInterfaceProtocol::slotUpdateView( NetfilterObject* )" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceProtocol::slotUpdateView() {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotUpdateView()" << endl;
+ if ( ! m_doc ) {
+ kdDebug() << "WRINING: m_doc == 0" << endl;
+ return;
+ }
+ m_lv_zones->clear();
+ m_protocolLIstView->loadProtocols();
+ m_protocolLIstView->setEnabled( false );
+
+ m_c_allowIncoming->blockSignals( true );
+ m_c_restrictOutgoing->blockSignals( true );
+ m_c_allowIncoming->setChecked( m_doc->currentDocAsGenericDoc()->allowIncomingConnections() );
+ m_c_restrictOutgoing->setChecked( m_doc->currentDocAsGenericDoc()->restrictOutgoingConnections() );
+ m_c_allowIncoming->blockSignals( false );
+ m_c_restrictOutgoing->blockSignals( false );
+
+ QString zone = m_zoneSelect->currentText();
+ if ( zone == i18n("Incoming Zone") ) {
+ kdDebug() << "Showing Incoming Zone" << endl;
+ KMFListViewItem *item = new KMFListViewItem( m_lv_zones, 0, m_doc->currentDocAsGenericDoc()->incomingZone() );
+ item->setupZoneView();
+ } else if ( zone == i18n("Outgoing Zone") ) {
+ kdDebug() << "Showing Outgoing Zone" << endl;
+ KMFListViewItem *item2 = new KMFListViewItem( m_lv_zones, 0, m_doc->currentDocAsGenericDoc()->outgoingZone() );
+ item2->setupZoneView();
+ }
+
+ if ( ! m_doc->currentDocAsGenericDoc()->allowIncomingConnections() && ! m_doc->currentDocAsGenericDoc()->restrictOutgoingConnections() ) {
+ m_lv_zones->setEnabled( false );
+ m_protocolLIstView->setEnabled( false );
+ m_widgetStack->setEnabled( false );
+ return;
+ }
+
+ m_lv_zones->setEnabled( true );
+ // m_protocolLIstView->setEnabled( true );
+ m_widgetStack->setEnabled( true );
+
+ if ( m_host ) {
+ if ( KMFListViewItem *item = findItem( m_host->uuid() ) ) {
+ m_lv_zones->setSelected( item, true );
+ }
+ } else if ( m_zone ) {
+ if ( KMFListViewItem *item = findItem( m_zone->uuid() ) ) {
+ m_lv_zones->setSelected( item, true );
+ }
+ }
+ m_lv_zones->setSorting( 0 , false );
+}
+
+void KMFGenericInterfaceProtocol::slotRestrictionChanged() {
+ m_doc->currentDocAsGenericDoc()->setRestrictOutgoingConnections( m_c_restrictOutgoing->isChecked() );
+ m_doc->currentDocAsGenericDoc()->setAllowIncomingConnections( m_c_allowIncoming->isChecked() );
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceProtocol::slotCurrentZoneChanged( const QString& ) {
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceProtocol::slotNewItemSelected( QListViewItem* item ) {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotNewItemSelected( QListViewItem* item )" << endl;
+ if ( ! item ) {
+ m_protocolLIstView->setEnabled( false );
+ return ;
+ }
+ m_protocolUsage = 0;
+ m_zone = 0;
+ m_host = 0;
+
+ KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item );
+ if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETZONE ) {
+ kdDebug() << "Selected NETZONE" << endl;
+ m_widgetStack->raiseWidget( m_network_widget );
+ m_zone = kmfitem->zone();
+ if ( m_zone ) {
+ kdDebug() << "kmfitem->zone() pointer is valid" << endl;
+ kmfitem->setText( 0,m_zone->guiName() );
+ kmfitem->setText( 1, "[" + m_zone->address()->toString() + i18n("/%1]").arg( m_zone->maskLength() ) );
+ m_protocolLIstView->setZone( m_zone );
+ m_protocolLIstView->setEnabled( true );
+ m_network_widget->loadZone( m_zone );
+
+ if ( m_zone->name() == "incoming_world" || m_zone->name() == "outgoing_world" || m_zone->readOnly() ) {
+ m_network_widget->allowEdit( false );
+ } else {
+ m_network_widget->allowEdit( true );
+ }
+
+ }
+ } else if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETHOST ) {
+ kdDebug() << "Selected NETHOST" << endl;
+ m_widgetStack->raiseWidget( m_nethostProperties_widget );
+ m_host = kmfitem->host();
+ m_zone = m_host->zone();
+ if ( m_host ) {
+ kdDebug() << "kmfitem->host() pointer is valid" << endl;
+ m_nethostProperties_widget->loadHost( m_host );
+ m_protocolLIstView->setEnabled( true );
+ m_protocolLIstView->setHost( m_host );
+ }
+ } else {
+ m_protocolLIstView->setEnabled( false );
+ }
+ kdDebug() << "Laving slotNewItemSelected()" << endl;
+}
+
+void KMFGenericInterfaceProtocol::slotZoneRBM( QListViewItem* item, const QPoint& point, int ) {
+ if ( ! item )
+ return ;
+ KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item );
+ if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETZONE ) {
+ kdDebug() << "Setting up Zone RBM:" << endl;
+ m_host = 0;
+ m_zone = 0;
+ m_zone = kmfitem->zone();
+ if ( m_zone ) {
+ m_contextMenu->clear();
+ QString name = m_zone->name();
+ QString lab_str = i18n("Zone: %1").arg( m_zone->guiName() );
+ m_contextMenu->insertTitle( icon_chain, lab_str );
+ m_contextMenu->insertItem( icon_new, i18n( "Add Host..." ), this, SLOT( slotAddHost() ) );
+
+
+ m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( icon_new, i18n( "Add Zone..." ), this, SLOT( slotAddZone() ) );
+ if ( m_zone->name() != "incoming_world" && m_zone->name() != "outgoing_world" ) {
+ m_contextMenu->insertItem( icon_rename, i18n( "Rename Zone..." ), this, SLOT( slotRenameZone() ) );
+ m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( icon_del, i18n( "Delete Zone" ), this, SLOT( slotDelZone() ) );
+ }
+
+ m_contextMenu->popup( point );
+ }
+ } else if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETHOST ) {
+ kdDebug() << "Setting up Host RBM:" << endl;
+ m_host = 0;
+ m_host = kmfitem->host();
+ if ( m_host ) {
+ m_contextMenu->clear();
+ QString name = m_host->name();
+ QString lab_str = i18n("Host: %1").arg( m_host->guiName() );
+ m_contextMenu->insertTitle( icon_chain, lab_str );
+ m_contextMenu->insertItem( icon_rename, i18n( "Rename Host..." ), this, SLOT( slotRenameHost() ) );
+ m_contextMenu->insertItem( icon_rename, i18n( "Delete Host..." ), this, SLOT( slotDelHost() ) );
+ m_contextMenu->popup( point );
+ }
+ }
+}
+
+void KMFGenericInterfaceProtocol::slotProtocolClicked( KMFProtocolUsage* protUsage, bool onOff ) {
+ kdDebug() << " KMFGenericInterfaceProtocol::slotProtocolClicked( KMFProtocolUsage* protUsage, bool onOff )" << endl;
+ if ( ! protUsage || ! m_zone ) {
+ kdDebug() << "WARNING: no protUsage selected" << endl;
+ return ;
+ }
+ m_widgetStack->raiseWidget( m_protocolProperties_widget );
+ if ( m_zone && ! m_host ) {
+ if ( onOff ) {
+ m_protocolUsage = 0;
+ if ( KMFProtocolUsage* pro = m_zone->findProtocolUsageByProtocolUuid( protUsage->protocol()->uuid() ) ) {
+ m_protocolUsage = pro;
+ } else {
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone,
+ i18n("Add protocol %1 to zone %2.").arg( protUsage->protocol()->name() ).arg( m_zone->guiName() )
+ );
+ KMFProtocolUsage * pro = m_zone->addProtocolUsage( protUsage->protocol()->uuid(), protUsage->protocol()->getDOMTree() );
+
+ if ( pro ) {
+ kdDebug() << "Added Protocol to zone: " << m_zone-> name() << endl;
+ m_protocolUsage = pro;
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+ }
+
+ if ( m_protocolUsage ) {
+ m_protocolProperties_widget->loadProtocolUsage( m_protocolUsage );
+ }
+ } else {
+ m_protocolProperties_widget->loadProtocol( protUsage->protocol() );
+ if ( m_zone->findProtocolUsageByProtocolUuid( protUsage->protocol()->uuid() ) ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone,
+ i18n("Delete protocol %1 from zone %2.").arg( protUsage->protocol()->name() ).arg( m_zone->guiName() )
+ );
+ m_zone->delProtocolUsage( protUsage );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ }
+
+ } else if ( m_host ) {
+ if ( onOff ) {
+ m_protocolUsage = 0;
+
+ if ( KMFProtocolUsage* pro = m_host->findProtocolUsageByProtocolUuid( protUsage->protocol()->uuid() ) ) {
+ m_protocolUsage = pro;
+ } else {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n("Add protocol %1 to host %2.").arg( protUsage->protocol()->name() ).arg( m_host->guiName() )
+ );
+ KMFProtocolUsage * pro = m_host->addProtocolUsage( protUsage->protocol()->uuid(), protUsage->protocol() ->getDOMTree() );
+
+ if ( pro ) {
+ kdDebug() << "Added Protocol to host: " << m_host-> name() << endl;
+ m_protocolUsage = pro;
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+ }
+ if ( m_protocolUsage ) {
+ m_protocolProperties_widget->loadProtocolUsage( m_protocolUsage );
+ }
+ } else {
+ m_protocolProperties_widget->loadProtocol( protUsage->protocol() );
+ if ( m_host->findProtocolUsageByProtocolUuid( protUsage->protocol()->uuid() ) ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n("Delete protocol %1 from host %2.").arg( protUsage->protocol()->name() ).arg( m_host->guiName() )
+ );
+ m_host->delProtocolUsage( protUsage );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ }
+ }
+}
+
+void KMFGenericInterfaceProtocol::slotProtocolCategoryClicked( KMFProtocolCategory* protCat ) {
+ kdDebug() << " KMFGenericInterfaceProtocol::slotProtocolCategoryClicked( KMFProtocolUsage* protUsage, bool onOff )" << endl;
+ if ( ! protCat ) {
+ return;
+ }
+
+ m_widgetStack->raiseWidget( m_protocolProperties_widget );
+ m_protocolProperties_widget->loadProtocolCategory( protCat );
+}
+
+
+
+
+void KMFGenericInterfaceProtocol::slotAddZone() {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotAddZone()" << endl;
+ bool ok;
+ QString name = KInputDialog::getText(i18n("New Zone"), i18n("Zone Name"),i18n("NewZone"), &ok, this );
+ if ( !ok )
+ return;
+
+
+ if ( m_zoneSelect->currentText() == i18n("Incoming Zone") ) {
+ QString s = "";
+ s = s.setNum( m_doc->currentDocAsGenericDoc()->incomingZone()->zones().count() );
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc()->incomingZone(),
+ i18n("Add Zone %1 to Incoming Zone").arg( name )
+ );
+ KMFNetZone * zone = m_doc->currentDocAsGenericDoc()->incomingZone()->addZone( "" + m_doc->currentDocAsGenericDoc()->incomingZone()->name() + "_z_" + s, new KMFError() );
+ if ( zone ) {
+ zone->setGuiName( name );
+ m_doc->currentDocAsGenericDoc()->incomingZone()->refreshNetworkTree();
+ KMFUndoEngine::instance()->endTransaction();
+ slotUpdateView();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+
+ } else if ( m_zoneSelect->currentText() == i18n("Outgoing Zone") ) {
+ QString s = "";
+ s = s.setNum( m_doc->currentDocAsGenericDoc()->outgoingZone()->zones().count() );
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc->currentDocAsGenericDoc()->outgoingZone(),
+ i18n("Add Zone %1 to Outgoing Zone.").arg( name )
+ );
+
+ KMFNetZone * zone = m_doc->currentDocAsGenericDoc()->outgoingZone()->addZone( "" + m_doc->currentDocAsGenericDoc()->outgoingZone()->name() + "_z_" + s, new KMFError() );
+ if ( zone ) {
+ zone->setGuiName( name );
+ m_doc->currentDocAsGenericDoc()->outgoingZone()->refreshNetworkTree();
+ KMFUndoEngine::instance()->endTransaction();
+ slotUpdateView();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+ }
+
+
+}
+
+void KMFGenericInterfaceProtocol::slotDelZone() {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotDelZone()" << endl;
+ if ( ! m_zone )
+ return;
+ if ( m_zone->name() != "incoming_world" || m_zone->name() != "outgoing_world" ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone->zone(),
+ i18n("Delete zone %1 from zone %2.").arg( m_zone->guiName() ).arg( m_zone->zone()->guiName() )
+ );
+ m_zone->zone()->delZone( m_zone );
+ m_zone = 0;
+ m_doc->currentDocAsGenericDoc()->incomingZone()->refreshNetworkTree();
+ m_doc->currentDocAsGenericDoc()->outgoingZone()->refreshNetworkTree();
+ KMFUndoEngine::instance()->endTransaction();
+ slotUpdateView();
+ }
+}
+
+void KMFGenericInterfaceProtocol::slotAddHost() {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotAddHost()" << endl;
+ bool ok;
+ QString name = KInputDialog::getText( i18n("New Host"), i18n("Host Name"),i18n("New Host"), &ok, this );
+ if ( !ok )
+ return;
+
+ if ( m_zone ) {
+ QString s = "";
+ s = s.setNum( m_zone->hosts().count() );
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone,
+ i18n("Add Host %1 to Zone: %2").arg( name ).arg( m_zone->guiName() )
+ );
+ KMFNetHost * host = m_zone->addNetHost( "" + m_zone->name() + "_h_" + s, * (new QDomDocument() ) );
+ if ( host ) {
+ host->setGuiName( name );
+ KMFUndoEngine::instance()->endTransaction(); m_doc->currentDocAsGenericDoc()->incomingZone()->refreshNetworkTree();
+ m_doc->currentDocAsGenericDoc()->outgoingZone()->refreshNetworkTree();
+ slotUpdateView();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+ }
+}
+
+void KMFGenericInterfaceProtocol::slotDelHost() {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotDelHost()" << endl;
+ if ( ! m_zone || ! m_host )
+ return;
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone,
+ i18n("Delete host %1 from zone: %2").arg( m_host->guiName() ).arg( m_zone->guiName() )
+ );
+ m_zone->delHost( m_host );
+ m_host = 0;
+ m_doc->currentDocAsGenericDoc()->incomingZone()->refreshNetworkTree();
+ m_doc->currentDocAsGenericDoc()->outgoingZone()->refreshNetworkTree();
+ KMFUndoEngine::instance()->endTransaction();
+ slotUpdateView();
+}
+
+KMFListViewItem* KMFGenericInterfaceProtocol::findItem( const QUuid& obj_id ) {
+ kdDebug() << "KMFListViewItem* KMFGenericInterfaceProtocol::findItem( int obj_id )" << endl;
+ QListViewItem* root = m_lv_zones->firstChild();
+ if ( ! root )
+ return 0;
+ QListViewItem* item = root->firstChild();
+ while ( item ) {
+// item->setText( 0, item->text(0) +"_searched" );
+ if ( KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item ) ) {
+ kdDebug() << "kmfitem->uuid(): " << kmfitem->uuid() <<
+ " obj_id: " << obj_id << endl;
+
+ if ( kmfitem->uuid() == obj_id ) {
+ kdDebug() << "MATCHED" << endl;
+ return kmfitem;
+ }
+ }
+ item = item->itemBelow();
+ }
+ return 0;
+}
+
+// void KMFGenericInterfaceProtocol::slotAddressChanged( int, int, int, int ) {
+//
+//
+//
+// }
+
+void KMFGenericInterfaceProtocol::slotAddressChanged( const QString& ) {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotAddressChanged( const QString& )" << endl;
+ if ( ! m_host ) {
+ return;
+ }
+ slotUpdateView();
+ if ( KMFListViewItem *item = findItem( m_host->uuid() ) ) {
+ item->setText( 1, "[" + m_host->address()->toString() + "]" );
+ }
+}
+
+void KMFGenericInterfaceProtocol::slotZoneChanged( KMFNetZone* z ) {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotZoneChanged( KMFNetZone* z )" << endl;
+ if ( KMFListViewItem *item = findItem( z->uuid() ) ) {
+ kdDebug() << "Updating item" << endl;
+ item->setText( 1, "[" + z->address()->toString() + i18n("/%1]").arg( z->maskLength() ) );
+ }
+ m_doc->currentDocAsGenericDoc()->incomingZone()->refreshNetworkTree();
+ m_doc->currentDocAsGenericDoc()->outgoingZone()->refreshNetworkTree();
+ slotUpdateView();
+
+}
+
+
+void KMFGenericInterfaceProtocol::slotRenameZone() {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotRenameZone()" << endl;
+ if ( ! m_zone )
+ return;
+ if ( KMFListViewItem* item = findItem( m_zone->uuid() ) ) {
+ item->setRenameEnabled( 0 ,true );
+ item->startRename(0);
+ }
+}
+
+void KMFGenericInterfaceProtocol::slotRenameHost() {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotRenameHost()" << endl;
+ if ( ! m_host )
+ return;
+ if ( KMFListViewItem* item = findItem( m_host->uuid() ) ) {
+ item->setRenameEnabled( 0 ,true );
+ item->startRename(0);
+ }
+}
+
+void KMFGenericInterfaceProtocol::slotRenameItem( QListViewItem* item, int, const QString& name ) {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotRenameItem( QListViewItem* item, int, const QString& name )" << endl;
+ if ( ! item )
+ return;
+
+ if ( name.isEmpty() ) {
+ slotUpdateView();
+ return;
+ }
+
+ if ( KMFListViewItem *kmfitem = dynamic_cast<KMFListViewItem*> (item) ) {
+ if ( kmfitem->type() == NetfilterObject::NETZONE ) {
+ KMFUndoEngine::instance()->startTransaction(
+ kmfitem->zone(),
+ i18n("Rename zone %1 to %2.").arg( kmfitem->zone()->guiName() ).arg( name )
+ );
+
+ kmfitem->zone()->setGuiName( name );
+ kdDebug() << "Renaming Zone: " << kmfitem->zone()->name() << endl;
+ KMFUndoEngine::instance()->endTransaction();
+ slotUpdateView();
+ return;
+ }
+ }
+
+ if ( KMFListViewItem *kmfitem = dynamic_cast<KMFListViewItem*> (item) ) {
+ if ( kmfitem->type() == NetfilterObject::NETHOST ) {
+ KMFUndoEngine::instance()->startTransaction(
+ kmfitem->host(),
+ i18n("Rename host %1 to %2.").arg( kmfitem->host()->guiName() ).arg( name )
+ );
+ kmfitem->host()->setGuiName( name );
+ kdDebug() << "Renaming Host: " << kmfitem->host()->name() << endl;
+ KMFUndoEngine::instance()->endTransaction();
+ slotUpdateView();
+ return;
+ }
+ }
+
+}
+
+void KMFGenericInterfaceProtocol::loadIcons() {
+ kdDebug() << "void KMFGenericInterfa::loadIcons()" << endl;
+ KIconLoader *loader = KGlobal:: iconLoader();
+ QString icon_name;
+
+ icon_name = "up";
+ icon_up = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "down";
+ icon_down = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editdelete";
+ icon_del = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filenew";
+ icon_new = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "edit";
+ icon_edit = loader->loadIcon( icon_name, KIcon::Small );
+
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "text";
+ icon_rename = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "rule-22";
+ icon_rule = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "view_tree";
+ icon_chain = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "reject";
+ icon_reject = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "target";
+ icon_target = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "stop";
+ icon_drop = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "button_ok";
+ icon_accept = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filesaveas";
+ icon_log = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "undo";
+ icon_return = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editclear";
+ icon_cmd = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "pipe";
+ icon_queue = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editcopy";
+ icon_copy = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "forward";
+ icon_move = loader->loadIcon( icon_name, KIcon::Small );
+
+}
+
+}
+#include "kmfgenericinterfaceprotocol.moc"
diff --git a/kmyfirewall/genericinterface/kmfgenericinterfaceprotocol.h b/kmyfirewall/genericinterface/kmfgenericinterfaceprotocol.h
new file mode 100644
index 0000000..9f4d277
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmfgenericinterfaceprotocol.h
@@ -0,0 +1,121 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFGENERICINTERFACEPROTOCOL_H
+#define KMFGENERICINTERFACEPROTOCOL_H
+
+#include <kmyfirewallgenericinterfaceprotocolwidget.h>
+
+// QT includes
+class QListViewItem;
+
+
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qguardedptr.h>
+#include <qpixmap.h>
+#include <quuid.h>
+
+// KDE includes
+class KPopupMenu;
+
+// Project includes
+#include "../core/kmfprotocol.h"
+#include "../core/kmfprotocolusage.h"
+#include "../core/kmfprotocolcategory.h"
+
+
+class QCheckBox;
+class QTextEdit;
+
+/*class KMFErrorHandler;*/
+
+namespace KMF {
+class KMFNetwork;
+class KMFGenericDoc;
+class KMFNetZone;
+class KMFListViewItem;
+class KMFNetHost;
+class KMFNetworkWidget;
+class KMFNetHostPropertiesWidget;
+class KMFProtocolPropertiesWidget;
+class KMFProtocolListView;
+
+class KMFGenericInterfaceProtocol : public KMyFirewallGenericInterfaceProtocolWidget {
+ Q_OBJECT
+public:
+ KMFGenericInterfaceProtocol( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+
+ ~KMFGenericInterfaceProtocol();
+ void loadDoc( KMFNetwork* );
+
+// void setType( int );
+// enum { INCOMING, OUTGOING };
+
+public slots:
+ void slotUpdateView();
+ void slotUpdateView( NetfilterObject* );
+
+private slots:
+// void slotNewProtocolSelected( QListViewItem* );
+ void slotNewItemSelected( QListViewItem* );
+ void slotZoneRBM( QListViewItem*, const QPoint&, int );
+ void slotAddZone();
+ void slotDelZone();
+ void slotAddHost();
+ void slotDelHost();
+ void slotAddressChanged( const QString& );
+ void slotZoneChanged( KMFNetZone* );
+ void slotCurrentZoneChanged( const QString& );
+ void slotRenameZone();
+ void slotRenameHost();
+ void slotRenameItem( QListViewItem* item, int, const QString& name );
+ void slotRestrictionChanged();
+ void slotProtocolClicked( KMFProtocolUsage*, bool );
+ void slotProtocolCategoryClicked( KMFProtocolCategory* );
+private:
+ void loadIcons();
+ KMFListViewItem* findItem( const QUuid& obj_id );
+
+private:
+ QGuardedPtr<KMFNetwork> m_doc;
+
+ KPopupMenu* m_contextMenu;
+
+ KMFNetworkWidget *m_network_widget;
+ KMFNetHostPropertiesWidget *m_nethostProperties_widget;
+ KMFProtocolPropertiesWidget *m_protocolProperties_widget;
+ KMFProtocolListView *m_protocolLIstView;
+
+ QPtrList<KMFNetZone> m_zones;
+ QGuardedPtr<KMFProtocolUsage> m_protocolUsage;
+ QGuardedPtr<KMFNetZone> m_zone;
+ QGuardedPtr<KMFNetHost> m_host;
+
+ int m_type;
+ QPixmap icon_up, icon_down, icon_del, icon_edit, icon_rule, icon_filter, icon_rename,
+ icon_chain, icon_log, icon_accept, icon_drop, icon_cmd, icon_reject, icon_return,
+ icon_target, icon_queue, icon_new, icon_copy, icon_move;
+
+};
+}
+#endif
diff --git a/kmyfirewall/genericinterface/kmyfirewallgenericinterfacehostwidget.ui b/kmyfirewall/genericinterface/kmyfirewallgenericinterfacehostwidget.ui
new file mode 100644
index 0000000..4a42f27
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmyfirewallgenericinterfacehostwidget.ui
@@ -0,0 +1,306 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallGenericInterfaceHostWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallGenericInterfaceHostWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>668</width>
+ <height>401</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Hosts</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>groupBox6_5</cstring>
+ </property>
+ <property name="title">
+ <string>Host Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>c_log_out</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Log outgoing packets</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>c_log_in</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Log incoming packets</string>
+ </property>
+ </widget>
+ <widget class="QTextEdit" row="2" column="0">
+ <property name="name">
+ <cstring>m_host_desc</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Notes:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout19</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>IP:</string>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_5</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_4_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_3_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_4</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>l_currHost</cstring>
+ </property>
+ <property name="text">
+ <string>Host:</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="0" column="2">
+ <property name="name">
+ <cstring>b_delHost</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>b_newHost</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="KListView" row="0" column="0">
+ <column>
+ <property name="text">
+ <string>Host</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>IP</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_lv_zones</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>12</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/genericinterface/kmyfirewallgenericinterfaceicmp.ui b/kmyfirewall/genericinterface/kmyfirewallgenericinterfaceicmp.ui
new file mode 100644
index 0000000..a0c5db0
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmyfirewallgenericinterfaceicmp.ui
@@ -0,0 +1,178 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallGenericInterfaceIcmp</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallGenericInterfaceIcmp</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>564</width>
+ <height>366</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>ICMP</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>80</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox2_2</cstring>
+ </property>
+ <property name="title">
+ <string>ICMP Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>401</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel3_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;&lt;b&gt;By limiting the ping requests you allow past your firewall, you can avoid DoS (Denial of Service) attacks.&lt;/b&gt;&lt;br&gt;
+Those attacks are based on the fact that every computer can only handle a limited number of open connections.
+A DoS attack is mostly performed by a lot of hosts connecting to the victim host until it gives up.&lt;/p&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="1">
+ <property name="name">
+ <cstring>c_limit_ping</cstring>
+ </property>
+ <property name="text">
+ <string>Limit replies </string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>c_allow_ping</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Reply to echo-requests</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>381</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel2_3_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;The so-called &lt;b&gt;Ping&lt;/b&gt; is an ICMP packet that is sent to a host to check if it's running or not.&lt;br&gt;
+If you disable "Reply to echo-request", your computer will be invisible for most of the common programs used to hack/crack hosts on the Internet.&lt;br&gt;
+However, there are a lot of network programs that use ping requests to find and check the connections to their client/server host.&lt;/p&gt;</string>
+ </property>
+ <property name="textFormat">
+ <enum>RichText</enum>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>c_allow_ping</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_limit_ping</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_allow_ping</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel3_2_2_2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/genericinterface/kmyfirewallgenericinterfacelogging.ui b/kmyfirewall/genericinterface/kmyfirewallgenericinterfacelogging.ui
new file mode 100644
index 0000000..395950d
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmyfirewallgenericinterfacelogging.ui
@@ -0,0 +1,194 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallGenericInterfaceLogging</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallGenericInterfaceLogging</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>682</width>
+ <height>366</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Logging</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>81</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox3_2</cstring>
+ </property>
+ <property name="title">
+ <string>Logging</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;Logging dropped packets will allow you to have a look at the
+packets (source/destination IP/port, etc.) that tried to pass your
+firewall unsuccessfully.&lt;br&gt;
+This is very useful if any damage has been caused by an attack
+and you want to find the person responsible.&lt;br&gt;
+The entries are written to the system's main log file
+(usually /var/log/messages).&lt;p&gt;</string>
+ </property>
+ <property name="textFormat">
+ <enum>RichText</enum>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>381</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>m_c_log</cstring>
+ </property>
+ <property name="text">
+ <string>Log dropped packets</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel5_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;The logprefix is a string that is prepended to the lines written to your log file to help you find the lines you need.&lt;/p&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop|AlignLeft</set>
+ </property>
+ <property name="vAlign" stdset="0">
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="KRestrictedLine" row="2" column="1">
+ <property name="name">
+ <cstring>m_le_logPrefix</cstring>
+ </property>
+ <property name="maxLength">
+ <number>18</number>
+ </property>
+ <property name="validChars">
+ <string>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ: </string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="1">
+ <property name="name">
+ <cstring>m_c_limitLog</cstring>
+ </property>
+ <property name="text">
+ <string>Limit logged packets</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel3_3_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;Avoid "Denial of Service" attacks by limiting logging.&lt;/p&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_c_log</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_c_limitLog</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_c_log</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel3_3_2_2_2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_c_log</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_le_logPrefix</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_c_log</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel5_2_2_2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>krestrictedline.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/genericinterface/kmyfirewallgenericinterfacenatwidget.ui b/kmyfirewall/genericinterface/kmyfirewallgenericinterfacenatwidget.ui
new file mode 100644
index 0000000..9fa259f
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmyfirewallgenericinterfacenatwidget.ui
@@ -0,0 +1,293 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallGenericInterfaceNATWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallGenericInterfaceNATWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>690</width>
+ <height>762</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel7</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;You can make your firewall act as a NAT router here.&lt;br&gt;
+By enabling NAT you can provide your Internet connection to other hosts that
+are using your computer a their default gateway.&lt;/p&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>m_c_enable_nat</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enable NAT (Network Address Translation)</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>NAT options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel8</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;By using the MASQUERADE target you are able to setup NAT without needing to have a static IP address. This is normaly the case for cheap DSL, Cable or Modem internet connections.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_gb_nat_ip</cstring>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>5</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Public IP:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout19</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_addr_1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_addr_2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_4_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_addr_3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_3_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_addr_4</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_c_use_masquerade</cstring>
+ </property>
+ <property name="text">
+ <string>Use the &amp;MASQUERADE target for NAT</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>&lt;p&gt;Enable this if you don't have a static IP address.&lt;br&gt;Normaly this is the case for dial-in connections using a modem of ISDN line&lt;p&gt;</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>m_cb_external_interface</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel3_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Network interface connected to the Internet:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_c_enable_nat</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>groupBox4</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_c_use_masquerade</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_gb_nat_ip</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_c_use_masquerade</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_sb_addr_1</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_c_use_masquerade</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_sb_addr_2</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_c_use_masquerade</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_sb_addr_3</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_c_use_masquerade</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_sb_addr_4</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>kcombobox.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/genericinterface/kmyfirewallgenericinterfaceprotocolwidget.ui b/kmyfirewall/genericinterface/kmyfirewallgenericinterfaceprotocolwidget.ui
new file mode 100644
index 0000000..05f3ce6
--- /dev/null
+++ b/kmyfirewall/genericinterface/kmyfirewallgenericinterfaceprotocolwidget.ui
@@ -0,0 +1,215 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallGenericInterfaceProtocolWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallGenericInterfaceProtocolWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>511</width>
+ <height>449</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Protocols</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox25</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>8</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Access Control Configuration</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Edit zone:</string>
+ </property>
+ </widget>
+ <widget class="QWidgetStack" row="3" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>m_widgetStack</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>qt_dead_widget_m_protocolOptions</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>qt_dead_widget_m_zoneOptions</cstring>
+ </property>
+ <attribute name="id">
+ <number>1</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>qt_dead_widget_m_hostOptions</cstring>
+ </property>
+ <attribute name="id">
+ <number>2</number>
+ </attribute>
+ </widget>
+ </widget>
+ <widget class="QSplitter" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>splitter5</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Object</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Atributes</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_lv_zones</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>12</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>m_protocolsFrame</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_c_allowIncoming</cstring>
+ </property>
+ <property name="text">
+ <string>Allow Incoming Connections</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="2">
+ <property name="name">
+ <cstring>m_c_restrictOutgoing</cstring>
+ </property>
+ <property name="text">
+ <string>Restrict Outgoing Connections</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_zoneSelect</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/installer/Makefile.am b/kmyfirewall/installer/Makefile.am
new file mode 100644
index 0000000..a212845
--- /dev/null
+++ b/kmyfirewall/installer/Makefile.am
@@ -0,0 +1,23 @@
+SUBDIRS = linux
+# SUBDIRS = linux openbsd
+
+INCLUDES = $(all_includes) -I$(srcdir)/../core -I../kmfwidgets -I$(srcdir)/../kmfwidgets
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfinstallerplugin.la
+pluginsdir = $(kde_datadir)/kmyfirewall/kpartplugins
+plugins_DATA = kmfinstallerpluginui.rc
+
+partdesktopdir = $(kde_servicetypesdir)
+partdesktop_DATA = kmfinstallerplugin.desktop
+
+libkmfinstallerplugin_la_LDFLAGS = -module -no-undefined $(all_libraries) \
+ $(KDE_PLUGIN)
+
+libkmfinstallerplugin_la_SOURCES = kmfinstallerplugin.cpp
+noinst_HEADERS = kmfinstallerplugin.h
+
+libkmfinstallerplugin_la_LIBADD = \
+ ../kmfwidgets/libkmfwidgets.la ../core/libkmfcore.la $(LIB_KPARTS)
+
+templatedir = $(kde_datadir)/kmyfirewall/
+template_DATA = README.InstallerPackage.txt
diff --git a/kmyfirewall/installer/README.InstallerPackage.txt b/kmyfirewall/installer/README.InstallerPackage.txt
new file mode 100644
index 0000000..e51c039
--- /dev/null
+++ b/kmyfirewall/installer/README.InstallerPackage.txt
@@ -0,0 +1,7 @@
+KMyFirewall Installer Package
+
+To install the firewall script into the boot system run
+sh ./install.sh
+
+To uninstall call it with the uninstall parameter
+sh ./install.sh uninstall
diff --git a/kmyfirewall/installer/kmfinstallerplugin.cpp b/kmyfirewall/installer/kmfinstallerplugin.cpp
new file mode 100644
index 0000000..e1f9623
--- /dev/null
+++ b/kmyfirewall/installer/kmfinstallerplugin.cpp
@@ -0,0 +1,453 @@
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001
+*/
+
+
+#include "kmfinstallerplugin.h"
+
+
+// QT includes
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qmultilineedit.h>
+#include <qiconset.h>
+#include <qdatetime.h>
+
+// KDE includes
+#include <kinstance.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <ktrader.h>
+#include <kstandarddirs.h>
+#include <kio/netaccess.h>
+
+// Project includes
+#include "../core/kmfconfig.h"
+#include "../core/kmfdoc.h"
+#include "../core/kmfprotocol.h"
+#include "../core/kmfrulesetdoc.h"
+#include "../core/kmftarget.h"
+#include "../core/kmftargetconfig.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmfiptdoc.h"
+#include "../core/kmferror.h"
+#include "../core/kmferrorhandler.h"
+#include "../core/kmfgenericdoc.h"
+#include "../core/kmfpluginfactory.h"
+#include "../core/kmfcompilerinterface.h"
+#include "../core/kmfinstallerinterface.h"
+#include "../core/kprocesswrapper.h"
+#include "../core/xmlnames.h"
+
+#include "../kmfwidgets/kmfmainwindow.h"
+#include "../kmfwidgets/kmfprocout.h"
+#include "../kmfwidgets/kmfselectactivetarget.h"
+
+#include "linux/kmfiptinstaller.h"
+
+namespace KMF {
+
+KMFInstallerPlugin::KMFInstallerPlugin( QObject *parent, const char *name )
+ : KMFPlugin( parent, name ) {
+
+ m_docType = -1;
+ KMFMainWindow* app = 0;
+ app = dynamic_cast<KMFMainWindow*>( parent );
+ if ( ! app ) {
+ KMessageBox::error( 0, "Oops wrong parent class found for kmfinstallerplugin!!!" );
+ }
+ m_doc = app->network()->currentDoc();
+
+// m_installerPlugin = 0;
+ m_execWidget = 0;
+ m_actionStopFw = new KAction( i18n( "&Reset IPTables" ), "decrypted",
+ 0, this, SLOT( slotStopFirewall() ), actionCollection(), "reset_iptables" );
+
+ m_actionRunFw = new KAction( i18n( "Run Fir&ewall" ), "encrypted",
+ 0, this, SLOT( slotStartFirewall() ), actionCollection(), "run_firewall" );
+
+ m_actionPreviewScript = new KAction( i18n( "&Preview Script" ), "mime_txt",
+ 0 , this, SLOT( slotShowScript() ), actionCollection(), "preview_script" );
+
+ m_generateInstallPackage = new KAction( i18n( "&Generate Linux Installation Package" ), "fileexport",
+ 0 , this, SLOT( slotGenerateInstallerPackage() ), actionCollection(), "generate_install_package" );
+
+ m_actionShowConfig = new KAction( i18n( "Show &All Tables" ), "messagebox_info",
+ 0 , this, SLOT( slotShowConfig() ), actionCollection(), "show_ipt_config" );
+
+ m_actionShowFilter = new KAction( i18n( "Show &Filter Table" ), "messagebox_info",
+ 0 , this, SLOT( slotShowFilter() ), actionCollection(), "show_filter" );
+
+ m_actionShowNat = new KAction( i18n( "Show &Nat Table" ), "messagebox_info",
+ 0 , this, SLOT( slotShowNat() ), actionCollection(), "show_nat" );
+
+ m_actionShowMangle = new KAction( i18n( "Show &Mangle Table" ), "messagebox_info",
+ 0 , this, SLOT( slotShowMangle() ), actionCollection(), "show_mangle" );
+
+ m_actionMenu = new KActionMenu( i18n( "Show IPTables Configuration" ), "messagebox_info", this , "show_menu" );
+
+ m_actionMenu->insert( m_actionShowConfig );
+ m_actionMenu->insert( m_actionShowFilter );
+ m_actionMenu->insert( m_actionShowNat );
+ m_actionMenu->insert( m_actionShowMangle );
+ m_actionMenu->setDelayed( false );
+ m_actionMenu->setStickyMenu( true );
+ actionCollection() ->insert( m_actionMenu );
+
+ m_actionInstallFW = new KAction( i18n( "&Install Firewall" ), "down",
+ 0 , this, SLOT( slotInstallFW() ), actionCollection(), "install_firewall" );
+
+ m_actionUninstallFW = new KAction( i18n( "&Uninstall Firewall" ), "up",
+ 0 , this, SLOT( slotUninstallFW() ), actionCollection(), "uninstall_firewall" );
+ setXMLFile( "kmfinstallerpluginui.rc" );
+
+ slotEnableActions( false );
+ connect( app,SIGNAL( sigEnableActions( bool ) ),
+ this, SLOT( slotEnableActions(bool ) ) );
+
+ kdDebug() << "KMFInstallerPlugin: Finished Initialisationn " << endl;
+}
+
+KMFInstallerPlugin::~KMFInstallerPlugin() {}
+
+bool KMFInstallerPlugin::isConfigValid() {
+ bool configValid = false;
+ if ( rulesetDoc() ) {
+ configValid = rulesetDoc()->target()->config()->isValid();
+
+ if ( ! configValid ) {
+ if( KMessageBox::questionYesNo ( 0,
+ i18n( "<qt><p>Do you want KMyFirewall to try to auto configure %1 settings</p></qt>" ).arg( rulesetDoc()->target()->toFriendlyString() ),
+ i18n( "Auto Configure Target" ), KStdGuiItem::yes(), KStdGuiItem::no() ) == KMessageBox::Yes ) {
+ KMFError* err = rulesetDoc()->target()->tryAutoConfiguration();
+ KMFErrorHandler* errH = new KMFErrorHandler( "Target Autoconfiguration" );
+ errH->showError( err );
+
+ if ( ! rulesetDoc()->target()->config()->isValid() ) {
+ KMessageBox::error( KApplication::kApplication()->mainWidget(), i18n("<qt><p>Auto Confguration of: %1 could not determinate all needed setting. You'll need to configure the mmissing settings.</p></qt>").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ } else {
+ KMessageBox::information( KApplication::kApplication()->mainWidget(), i18n("<qt><p>Auto Confguration of: %1 finished successfully.</p></qt>").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ }
+
+ configValid = rulesetDoc()->target()->config()->isValid();
+ delete errH;
+ delete err;
+ }
+ }
+ }
+ return configValid;
+}
+KMFProcOut* KMFInstallerPlugin::execWidget() {
+ if ( m_execWidget )
+ return m_execWidget;
+ kdDebug() << "Need to create new execWidget." << endl;
+ m_execWidget = new KMFProcOut( (KMFMainWindow*) parent(), "KMFProcOut" );
+ return m_execWidget;
+}
+
+
+void KMFInstallerPlugin::generateInstallerPackage( KMFTarget* tg ) {
+ if ( ! isConfigValid() ) {
+ const QString & msg = i18n( "The curemnt target configurations seems to be invalid" );
+ const QString& cap = i18n("Invalid Configuration");
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+
+ if ( rulesetDoc() ) {
+
+
+ KMFInstallerInterface *inst2 = tg->installer();
+ if ( ! inst2 )
+ return;
+
+
+ QString remDir = rulesetDoc()->target()->getFishUrl();
+ remDir.append( "/tmp/" );
+
+ QString path = remDir;
+ path.append( "kmfpackage.kmfpkg" );
+ KURL url( path );
+ KURL remDirUrl( remDir );
+
+ if ( url.fileName().isEmpty() )
+ return;
+
+ if ( KIO::NetAccess::exists( url, false, KApplication::kApplication()->mainWidget() ) ) {
+ QDateTime now = QDateTime::currentDateTime();
+
+ QString backUp;
+ backUp.append( url.url() );
+ backUp.append( "_backup_" );
+ backUp.append( now.toString( "dd.MM.yyyy.hh:mm:ss" ) );
+ KURL newUrl( backUp );
+
+
+ QString backFileName = "kmfpackage.kmfpkg";
+ backUp.append( "_backup_" );
+ backUp.append( now.toString( "dd.MM.yyyy.hh:mm:ss" ) );
+
+
+ KIO::NetAccess::file_move( url, newUrl, 700, true, true, KApplication::kApplication()->mainWidget() );
+ KIO::NetAccess::fish_execute( remDir, "chmod 400 /tmp/" + backFileName, KApplication::kApplication()->mainWidget() );
+ }
+
+ inst2->generateInstallerPackage( tg, url );
+ KIO::NetAccess::fish_execute( remDir, "chmod 700 /tmp/kmfpackage.kmfpkg", KApplication::kApplication()->mainWidget() );
+ }
+}
+
+
+
+// ########## Slots for the Actions ###############
+void KMFInstallerPlugin::slotShowScript() {
+ kdDebug() << "void KMFInstallerPlugin::slotShowScript()" << endl;
+ setOutputWidget( execWidget() );
+ QString script = rulesetDoc()->compile();
+ kdDebug() << "\n\nCompiled Script: " << script << "\n\n" << endl;
+ execWidget()->setText( script, i18n("Show firewall script...") );
+ showOutput();
+}
+
+void KMFInstallerPlugin::slotShowConfig() {
+ kdDebug() << "void KMFInstallerPlugin::slotShowConfig()" << endl;
+ cmdShowRunningConfig( "all" );
+}
+
+void KMFInstallerPlugin::slotShowFilter() {
+ kdDebug() << "void KMFInstallerPlugin::slotShowFilter()" << endl;
+ cmdShowRunningConfig( Constants::FilterTable_Name );
+}
+
+void KMFInstallerPlugin::slotShowNat() {
+ kdDebug() << "void KMFInstallerPlugin::slotShowNat()" << endl;
+ cmdShowRunningConfig( Constants::NatTable_Name );
+}
+
+void KMFInstallerPlugin::slotShowMangle() {
+ kdDebug() << "void KMFInstallerPlugin::slotShowMangle()" << endl;
+ cmdShowRunningConfig( Constants::MangleTable_Name );
+}
+
+void KMFInstallerPlugin::cmdShowRunningConfig( const QString& para ) {
+ if ( ! isConfigValid() ) {
+ const QString & msg = i18n( "The curemnt target configurations seems to be invalid" );
+ const QString& cap = i18n("Invalid Configuration");
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+
+ KMFInstallerInterface *inst2 = rulesetDoc()->target()->installer();
+ if ( ! inst2 )
+ return;
+
+ inst2->cmdShowRunningConfig( para );
+}
+
+
+void KMFInstallerPlugin::slotStopFirewall() {
+ kdDebug() << "void KMFInstallerPlugin::slotStopFirewall() " << endl;
+ if ( ! isConfigValid() ) {
+ const QString & msg = i18n( "The curemnt target configurations seems to be invalid" );
+ const QString& cap = i18n("Invalid Configuration");
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+
+
+ KMFInstallerInterface *inst2 = rulesetDoc()->target()->installer();
+ if ( ! inst2 ) {
+ return;
+ }
+
+ inst2->cmdStopFW();
+}
+
+void KMFInstallerPlugin::slotStartFirewall() {
+ kdDebug() << "void KMFInstallerPlugin::slotStartFirewall()" << endl;
+ if ( ! isConfigValid() ) {
+ const QString & msg = i18n( "The curemnt target configurations seems to be invalid" );
+ const QString& cap = i18n("Invalid Configuration");
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+ if ( rulesetDoc() ) {
+
+ KMFInstallerInterface *inst2 = rulesetDoc()->target()->installer();
+ if ( ! inst2 ) {
+ return;
+ }
+ inst2->cmdRunFW();
+ }
+}
+
+
+void KMFInstallerPlugin::slotInstallFW() {
+ kdDebug() << "void KMFInstallerPlugin::slotInstallFW()" << endl;
+ if ( ! isConfigValid() ) {
+ const QString & msg = i18n( "The curemnt target configurations seems to be invalid" );
+ const QString& cap = i18n("Invalid Configuration");
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+
+
+ KMFInstallerInterface *inst2 = rulesetDoc()->target()->installer();
+ if ( ! inst2 ) {
+ return;
+ }
+ inst2->cmdInstallFW();
+}
+
+void KMFInstallerPlugin::slotUninstallFW() {
+ kdDebug() << "void KMFInstallerPlugin::slotUninstallFW()" << endl;
+ if ( ! isConfigValid() ) {
+ const QString & msg = i18n( "The curemnt target configurations seems to be invalid" );
+ const QString& cap = i18n("Invalid Configuration");
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+
+ KMFInstallerInterface *inst2 = rulesetDoc()->target()->installer();
+ if ( ! inst2 ) {
+ return;
+ }
+ inst2->cmdUninstallFW();
+}
+
+void KMFInstallerPlugin::slotGenerateInstallerPackage() {
+ kdDebug() << "void KMFInstallerPlugin::slotGenerateInstallPackage()" << endl;
+ if ( rulesetDoc() ) {
+ KMFTarget* tg = KMFSelectActiveTarget::selectTarget( network(), i18n("<qt><p>Please select target from which the configuration should be exported into an installation package.</p></qt>") );
+
+ if ( ! tg ) {
+ return;
+ }
+
+
+
+ if ( ! tg->config()->isValid() ) {
+ const QString & msg = i18n( "The target configurations seems to be invalid" );
+ const QString& cap = i18n("Invalid Configuration");
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+
+ KMFInstallerInterface *inst2 = tg->installer();
+ if ( ! inst2 )
+ return;
+
+ QString msg = i18n( "<qt><p>KMyFirewall will create a shell script (*.sh) for you that includes a compressed archieve containing the scripts needed to install the firewall scripts into the boot system of the target computer<br>To install the package make it executabe <b>(e.g. chmod +x mypackage.kmfpkg</b> call the script without any parameter <b>(./mypackage.kmfpkg)</b><br>For other options (e.g. uninstall, extracting etc.) please call the script using the --help parameter <b>(e.g. ./mypackage.kmfpkg --help)</b> to display a detailed option list.</p></qt>" );
+ QString cap = i18n( "Generate Installation Package" );
+ KMessageBox::information( 0, msg, cap, "generate_intsllation_package_howto", 0 );
+
+
+ KURL url = KFileDialog::getSaveURL( ":", "*.kmfpkg|KMyFirewall Installer Package (*.kmfpkg)" );
+
+
+
+
+
+ if ( url.fileName().isEmpty() )
+ return;
+
+ int answer = 0;
+
+ if ( KIO::NetAccess::exists( url, false, KApplication::kApplication()->mainWidget() ) ) {
+ answer = KMessageBox::warningYesNo( 0, i18n( "<qt>File <b>%1</b> already exists!</p>"
+ "<p><b>Overwrite the existing file?</b></p></qt>" ).arg( url.url() ) );
+ if ( answer == KMessageBox::No ) {
+ return;
+ }
+ }
+ inst2->generateInstallerPackage( tg, url );
+
+
+
+ QString remPath = url.protocol();
+ if ( url.isLocalFile() ) {
+ KProcess *proc = new KProcess();
+ *proc << "chmod";
+ *proc << "700" << url.path();
+ proc->start( KProcess::Block );
+ delete proc;
+ proc = 0;
+ kdDebug() << "Set perms for: " << url.path() << endl;
+ }
+ }
+
+}
+
+
+void KMFInstallerPlugin::slotEnableActions( bool ) {
+// if ( on ) {
+// m_actionStopFw->setEnabled( true );
+// m_actionRunFw->setEnabled( true );
+// m_actionPreviewScript->setEnabled( true );
+// m_actionShowConfig->setEnabled( true );
+// m_actionShowFilter->setEnabled( true );
+// m_actionShowNat->setEnabled( true );
+// m_actionShowMangle->setEnabled( true );
+// m_actionMenu->setEnabled( true );
+// m_actionInstallFW->setEnabled( true );
+// m_actionUninstallFW->setEnabled( true );
+// m_generateInstallPackage->setEnabled( true );
+// } else {
+// m_actionStopFw->setEnabled( false );
+// m_actionRunFw->setEnabled( false );
+// m_actionPreviewScript->setEnabled( false );
+// /* m_actionShowConfig->setEnabled( false );
+// m_actionShowFilter->setEnabled( false );
+// m_actionShowNat->setEnabled( false );
+// m_actionShowMangle->setEnabled( false );
+// m_actionMenu->setEnabled( false );*/
+// m_actionInstallFW->setEnabled( false );
+// m_actionUninstallFW->setEnabled( false );
+// m_generateInstallPackage->setEnabled( false );
+// }
+}
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+KInstance* KMFInstallerPluginFactory::s_instance = 0L;
+
+KMFInstallerPluginFactory::KMFInstallerPluginFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+ s_instance = new KInstance( "KMFInstallerPluginFactory" );
+}
+
+
+
+QObject* KMFInstallerPluginFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFInstallerPlugin( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+extern "C" {
+ void* init_libkmfinstallerplugin() {
+ return new KMFInstallerPluginFactory;
+ }
+}
+
+}
+#include "kmfinstallerplugin.moc"
diff --git a/kmyfirewall/installer/kmfinstallerplugin.desktop b/kmyfirewall/installer/kmfinstallerplugin.desktop
new file mode 100644
index 0000000..687e075
--- /dev/null
+++ b/kmyfirewall/installer/kmfinstallerplugin.desktop
@@ -0,0 +1,55 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=ServiceType
+X-KDE-ServiceType=KMyFirewall/Installer
+X-KDE-Library=libkmfinstallerplugin
+
+Name=KMyFirewall Installer Plugin
+Name[bg]=Приставка-инсталатор на KMyFirewall
+Name[br]=Lugent stalier KMyFirewall
+Name[bs]=KMyFirewall dodatak za instalaciju
+Name[ca]=Connector d'instal·lació per a KMyFirewall
+Name[cs]=Modul instalátoru KMyFirewall
+Name[de]=KMyFirewall Installationsprogramm
+Name[el]=Πρόσθετο εγκατάστασης για το KMyFirewall
+Name[es]=Complemento de instalación de KMyFirewall
+Name[et]=KMyFirewalli paigaldamisplugin
+Name[fr]=Module d'installation de KMyFirewall
+Name[gl]=Extensión de Instalazón de KMyFirewall
+Name[hi]=के-माइ-फायरवाल संस्थापक प्लगइन
+Name[hu]=KMyFirewall telepítőmodul
+Name[it]=Plugin di installazione di KMyFirewall
+Name[ja]=KMyFirewall インストーラ プラグイン
+Name[ka]=KMyFirewall დაყენების მოდული
+Name[nl]=KMyFirewall Installatieplugin
+Name[pa]=KMyFirewall ਇੰਸਟਾਲਰ ਪਲੱਗਿੰਨ
+Name[pl]=Wtyczka instalatora KMyFirewall
+Name[pt]='Plugin' de Instalação do KMyFirewall
+Name[pt_BR]=Plug-in Instaldor par ao KMyFirewall
+Name[ru]=KMyFirewall - Модуль установки
+Name[sr]=KMyFirewall-ов прикључак за инсталирање
+Name[sr@Latn]=KMyFirewall-ov priključak za instaliranje
+Name[sv]=Installationsdel för Min brandvägg
+Name[ta]=KMyதீச்சுவர் நிறுவுபவரைச் சொருகு
+Name[tr]=KMyFirewall Kurulum Eklentisi
+Name[uk]=Втулок встановлення KMyFirewall
+Name[xx]=xxKMyFirewall Installer Pluginxx
+Name[zh_CN]=KMyFirewall 安装程序插件
+Name=KMFInstallerPart
+Name[ca]=KMFPartInstallador
+Name[de]=KMF-Installationskomponente
+Name[fr]=Module KMFInstaller
+Name[hi]=केएमएफ-इंस्टालर-पार्ट
+Name[pt_BR]=Componente KMFInstaller
+Name[sv]=Kmf-installationsdel
+Name[ta]=KMFநிறுவதல் பகுதி
+Name[tr]=KMF Kurulum Parçası
+Name[xx]=xxKMFInstallerPartxx
+Name[zh_CN]=KMF 安装器组件
+
+[PropertyDef::X-KMyFirewall-Platform]
+Type=QString
+
+[PropertyDef::X-KMyFirewall-Language]
+Type=QString
+
diff --git a/kmyfirewall/installer/kmfinstallerplugin.h b/kmyfirewall/installer/kmfinstallerplugin.h
new file mode 100644
index 0000000..5dd2c9b
--- /dev/null
+++ b/kmyfirewall/installer/kmfinstallerplugin.h
@@ -0,0 +1,117 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001
+*/
+
+
+#ifndef _KMFINSATLLERPART_H_
+#define _KMFINSATLLERPART_H_
+
+
+#include <qstring.h>
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+// Project Includes
+#include "../core/kmfplugin.h"
+class QWidget;
+class QPainter;
+class KURL;
+class KAction;
+class KActionMenu;
+class KInstance;
+
+namespace KMF {
+
+class KMFDoc;
+class KMFProcOut;
+class KMFCompilerInterface;
+class KMyFirewall;
+class KMFCompilerPlugin;
+class KMFTarget;
+
+
+/**
+ * @author Christian Hubinger <chubinger@irrsinnig.org>
+ */
+class KMFInstallerPlugin : public KMFPlugin {
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ KMFInstallerPlugin( QObject *parent, const char *name );
+
+ /**
+ * Destructor
+ */
+ virtual ~KMFInstallerPlugin();
+
+
+
+public slots:
+ void slotEnableActions( bool );
+
+public slots:
+ void slotStopFirewall();
+ void slotStartFirewall();
+ void slotShowScript();
+ void slotShowConfig();
+ void slotShowFilter();
+ void slotShowNat();
+ void slotShowMangle();
+ void slotInstallFW();
+ void slotUninstallFW();
+ void slotGenerateInstallerPackage();
+
+
+private:
+// bool isLocalTarget();
+ bool isConfigValid();
+
+ void generateInstallerPackage( KMFTarget* );
+ void cmdShowRunningConfig( const QString& );
+
+private:
+ KMFDoc* m_doc;
+ KAction* m_actionStopFw;
+ KAction* m_actionRunFw;
+ KAction* m_actionPreviewScript;
+ KAction* m_actionShowConfig;
+ KAction* m_actionShowFilter;
+ KAction* m_actionShowNat;
+ KAction* m_actionShowMangle;
+ KActionMenu* m_actionMenu;
+ KAction* m_actionInstallFW;
+ KAction* m_actionUninstallFW;
+ KAction* m_generateInstallPackage;
+ enum { IPT, GENERIC };
+ int m_docType;
+ KMFProcOut *m_execWidget;
+ KMFProcOut* execWidget();
+};
+
+class KMFInstallerPluginFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFInstallerPluginFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFInstallerPluginFactory() {
+ delete s_instance;
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+private:
+ static KInstance* s_instance;
+};
+}
+#endif // _KMFINSATLLERPART_H_
diff --git a/kmyfirewall/installer/kmfinstallerpluginui.rc b/kmyfirewall/installer/kmfinstallerpluginui.rc
new file mode 100644
index 0000000..3a9e177
--- /dev/null
+++ b/kmyfirewall/installer/kmfinstallerpluginui.rc
@@ -0,0 +1,38 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kmfinstallerplugin" library="libkmfinstallerplugin" version="1">
+<MenuBar>
+ <Menu name="file">
+ <Menu name="export_script_menu">
+ <Action name="generate_install_package"/>
+ </Menu>
+ </Menu>
+ <Menu name="run">
+ <Action name="run_firewall"/>
+ <Action name="reset_iptables"/>
+ <Separator lineSeparator="true"/>
+ <Action name="preview_script"/>
+ <Action name="show_menu"/>
+ <Separator lineSeparator="true"/>
+ <Action name="install_firewall"/>
+ <Action name="uninstall_firewall"/>
+ <Separator lineSeparator="true"/>
+ <!-- Action name="generate_install_package"/ -->
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Separator lineSeparator="true"/>
+ <Action name="run_firewall"/>
+ <Action name="reset_iptables"/>
+ <Separator lineSeparator="true"/>
+ <Action name="preview_script"/>
+
+ <Action name="show_menu"/>
+ <Separator lineSeparator="true"/>
+ <Action name="install_firewall"/>
+ <Action name="uninstall_firewall"/>
+ <Separator lineSeparator="true"/>
+</ToolBar>
+</kpartgui>
+
+
+
diff --git a/kmyfirewall/installer/linux/Makefile.am b/kmyfirewall/installer/linux/Makefile.am
new file mode 100644
index 0000000..2858f0c
--- /dev/null
+++ b/kmyfirewall/installer/linux/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes) -I../../core -I../../kmfwidgets -I../../libkmfplugins
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfinstaller_linux.la
+libkmfinstaller_linux_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) \
+ $(all_libraries)
+libkmfinstaller_linux_la_SOURCES = kmfiptinstaller.cpp
+libkmfinstaller_linux_la_LIBADD = \
+ ../../kmfwidgets/libkmfwidgets.la ../../core/libkmfcore.la $(LIB_KPARTS)
+
+noinst_HEADERS = kmfiptinstaller.h
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfinstaller_linux.desktop
+
+# Install script
+scriptdir = $(kde_datadir)/kmyfirewall/scripts/installer/linux
+script_DATA = kmfinstall.sh kmfpkginstall.sh installpackage.sh autoconfighelper.sh
diff --git a/kmyfirewall/installer/linux/autoconfighelper.sh b/kmyfirewall/installer/linux/autoconfighelper.sh
new file mode 100644
index 0000000..3dfca77
--- /dev/null
+++ b/kmyfirewall/installer/linux/autoconfighelper.sh
@@ -0,0 +1,264 @@
+#!/bin/sh
+#
+# %coypright%
+#
+# Please report bugs to: %maintainer%
+#
+# %license%
+#
+# Configuration guessing script for KMyFirewall %version%
+# This is an automatic generated file DO NOT EDIT
+#
+# Exaple output
+# <targetconfig name="Untitled" description="No Description Available" >
+# <interface name="eth0" />
+# <interface name="lo" />
+# <os name="linux" />
+# <backend name="iptables" />
+# <distribution name="sysv" />
+# <initPath name="/etc/init.d" />
+# <IPTPath name="/sbin/iptables" />
+# <modprobePath name="/sbin/modprobe" />
+# <rcDefaultPath name="/etc/rc2.d" />
+# </targetconfig>
+#
+
+REQUIREDOS="Linux"
+REQUIREDTOOLS="bash stat ifconfig grep sort cut"
+INERACTIVE="0"
+XMLCONFIG=""
+DIST="sysv"
+
+
+checkRequirements() {
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "Checking system requirements"
+ fi
+
+ OS=`uname`
+ if [ "$OS" != "$REQUIREDOS" ]; then
+
+ echo
+ echo "ERROR: Wrong OS: $OS"
+ echo "ERROR: This scripts is written for $REQUIREDOS"
+ echo
+ exit 1
+ fi
+
+ for PROG in $REQUIREDTOOLS; do
+ if [ "$INERACTIVE" = "1" ]; then
+ echo -n "Checking for $PROG...\t\t "
+ fi
+ PROGPATH=""
+ PROGNAME="which"
+ SEARCH="/bin /sbin /usr/bin /usr/sbin"
+ for s in $SEARCH; do
+ if [ -e "$s/$PROGNAME" ]; then
+ PROGPATH="$s/$PROGNAME";
+ fi
+ done
+
+ if [ "$PROGPATH" != "" ]; then
+ PROGPATH=`which $PROG`
+ if [ "$?" != "0" ]; then
+ echo
+ echo "ERROR: $PROG not found. Installation aborted!"
+ echo
+ exit 1
+ fi
+ if [ "$INERACTIVE" = "1" ]; then
+ echo " found $PROG at $PROGPATH"
+ fi
+ else
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "Requirement Checks Faild"
+ fi
+ fi
+ done
+ if [ "$INERACTIVE" = "1" ]; then
+ echo
+ fi
+}
+
+
+
+writeXmlHeader() {
+ XMLCONFIG=$XMLCONFIG"<targetconfig name=\"Untitled\" description=\"No Description Available\"><os name=\"linux\" /><backend name=\"iptables\" />";
+}
+
+writeXmlFooter() {
+ XMLCONFIG=$XMLCONFIG"</targetconfig>";
+}
+
+
+checkDist() {
+ if [ -e /etc/slackware-version ]; then
+ setslakware;
+ return;
+ fi
+
+ if [ -e /usr/bin/emerge ]; then
+ setgentoo;
+ return;
+ fi
+ setSysv
+}
+
+setSlakware() {
+ #echo "Set To Slackware"
+ DIST="slackware"
+ XMLCONFIG=$XMLCONFIG"<distribution name=\"slackware\" />";
+}
+
+setGentoo() {
+ #echo "Set To Gentoo"
+ DIST="gentoo"
+ XMLCONFIG=$XMLCONFIG"<distribution name=\"gentoo\" />";
+}
+
+setSysv() {
+ #echo "Set To SysV"
+ DIST="sysv"
+ XMLCONFIG=$XMLCONFIG"<distribution name=\"sysv\" />";
+}
+
+setIPTables() {
+ PROGNAME="iptables"
+ SEARCH="/bin /sbin /usr/bin /usr/sbin"
+ for s in $SEARCH; do
+ if [ -e "$s/$PROGNAME" ]; then
+ XMLCONFIG=$XMLCONFIG"<IPTPath name=\"$s/$PROGNAME\" />";
+ fi
+
+ done
+}
+
+setModprobe() {
+ PROGNAME="modprobe"
+ SEARCH="/ /bin /sbin /usr/bin /usr/sbin"
+ for s in $SEARCH; do
+ if [ -e "$s/$PROGNAME" ]; then
+ XMLCONFIG=$XMLCONFIG"<modprobePath name=\"$s/$PROGNAME\" />";
+ fi
+
+ done
+}
+
+setInitDir() {
+ SEARCH="/init.d /etc/init.d /etc/sbin.d"
+ for s in $SEARCH; do
+ if [ -e "$s" ]; then
+ XMLCONFIG=$XMLCONFIG"<initPath name=\"$s\" />";
+ fi
+
+ done
+}
+
+setDefaultRunlevelDir() {
+ if [ -e /etc/debian_version ]; then
+ XMLCONFIG=$XMLCONFIG"<rcDefaultPath name=\"/etc/rc2.d\" />";
+ return
+ fi
+
+ SEARCH="/etc/runlevels/default/ /etc/init.d/rc5.d /etc/rc5.d /sbin/rc5.d"
+
+ for s in $SEARCH; do
+ if [ -d "$s" ]; then
+ XMLCONFIG=$XMLCONFIG"<rcDefaultPath name=\"$s\" />";
+ return
+ fi
+ done
+}
+
+setInterfaces() {
+ RET=`/sbin/ifconfig | grep ' Link' | cut -f1 -d' ' | sort`
+ for i in $RET; do
+ # echo "Found Interface: $i"
+ XMLCONFIG=$XMLCONFIG"<interface name=\"$i\" />";
+ done
+}
+
+returnXml() {
+ echo $XMLCONFIG
+}
+
+printHello() {
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "KMyFirewall Auto Configuration Helper"
+ echo "Please report bugs to: %maintainer%"
+ echo
+ fi
+}
+
+printHelp() {
+ echo "Usage: $0 [-q] { --install | --uninstall | --reinstall | --extract | --start | --stop | --help }"
+ echo
+ echo "Switches"
+ echo " -q"
+ echo " Do not require any user interaction."
+ echo
+# echo "Options:"
+# echo " install|--install|-i"
+# echo " Install the configuration."
+# echo " The installed firewall scrip will be automaticaly run at system boot."
+# echo
+# echo " uninstall|--uninstall|-u"
+# echo " Uninstall the configuration form the system."
+# echo
+# echo " reinstall|--reinstall|-r"
+# echo " Re-Installs the configuration e.g. the same as install.sh uninstall"
+# echo " followed by install.sh install"
+# echo
+# echo " extract|--extract|-e"
+# echo " Only extract the installation files."
+# echo " The firewall will not be installed."
+# echo
+# echo " start|--start|-s"
+# echo " Only extract the installation files and."
+# echo " runs the firewall script."
+# echo " The firewall will not be installed."
+# echo
+# echo " stop|--stop|-c"
+# echo " Only extract the installation files and."
+# echo " stops the firewall script."
+# echo " The firewall will not be installed."
+# echo
+# echo " help|--help|-h"
+# echo " Print this help message"
+# echo
+}
+
+#
+# Execution starts here
+#
+
+printHello
+
+COMMAND=$1
+
+if [ "$COMMAND" = "-q" ]; then
+ COMMAND="$2"
+ INERACTIVE="0";
+fi
+
+case $COMMAND in
+
+ help|--help|-h)
+ printHelp
+ ;;
+
+ *)
+ checkRequirements
+ writeXmlHeader
+ checkDist
+ setIPTables
+ setModprobe
+ setInitDir
+ setDefaultRunlevelDir
+ setInterfaces
+ writeXmlFooter
+ returnXml
+ ;;
+esac
+
+exit 0 \ No newline at end of file
diff --git a/kmyfirewall/installer/linux/installpackage.sh b/kmyfirewall/installer/linux/installpackage.sh
new file mode 100644
index 0000000..d2d00ee
--- /dev/null
+++ b/kmyfirewall/installer/linux/installpackage.sh
@@ -0,0 +1,295 @@
+#!/bin/sh
+#
+# %coypright%
+#
+# Please report bugs to: %maintainer%
+#
+# %license%
+#
+# Installer Package script for KMyFirewall %version%
+# This is an automatic generated file DO NOT EDIT
+
+DATA="%data%"
+
+REQUIREDTOOLS="bash stat openssl tar gzip"
+EXTRACTDIR="/tmp/kmyfirewall.d"
+CURRDIR=`pwd`
+EXTRACTPATH=$EXTRACTDIR
+
+INERACTIVE="1"
+
+checkRequirements() {
+ USR=`whoami`
+ if [ "$USR" != "root" ]; then
+ echo
+ echo "This script need to be run as root."
+ echo
+ exit 1;
+ fi
+
+ echo -n "Checking system requirements...\t\t"
+ for PROG in $REQUIREDTOOLS; do
+ if [ "$INERACTIVE" = "1" ]; then
+ echo -n "Checking for $PROG...\t\t "
+ fi
+ PROGPATH=`which $PROG`
+ if [ "$?" != "0" ]; then
+ echo
+ echo "ERROR: $PROG not found. Installation aborted!"
+ echo
+ exit 1
+ fi
+ if [ "$INERACTIVE" = "1" ]; then
+ echo " found $PROG at $PROGPATH"
+ fi
+ done
+ echo "Done"
+}
+
+extract() {
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "Enter the path to the directory used to"
+ echo "extract the installation files"
+ echo
+ echo -n "Extract to [$EXTRACTPATH]: "
+
+ read newpath
+ if [ "$newpath" != "" ]; then
+ EXTRACTDIR=$newpath
+ fi
+ fi
+ EXTRACTPATH=$EXTRACTDIR
+ # EXTRACTPATH=$EXTRACTDIR
+
+ if [ -e $EXTRACTPATH ]; then
+ realydel="n"
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "$EXTRACTPATH allready exists. Do you want to delete it? [y/N]"
+ read realydel
+ else
+ realydel="y"
+ fi
+
+ if [ "$realydel" != "y" ]; then
+ extract
+ else
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "Deleting $EXTRACTPATH..."
+ fi
+ rm -rf "$EXTRACTPATH"
+ fi
+ fi
+
+ echo "Exctracting data to $EXTRACTPATH..."
+ mkdir "$EXTRACTPATH"
+ cd "$EXTRACTPATH"
+
+ touch data.b64
+ for LINE in $DATA; do
+ echo $LINE >> data.b64
+ done
+
+ openssl base64 -d -in data.b64 -out data.tar.gz
+ rm data.b64
+ tar xfz data.tar.gz
+ # cd "$CURRDIR"
+ echo
+}
+
+install() {
+ cd "$EXTRACTPATH"
+
+ if [ "$INERACTIVE" = "1" ]; then
+ bash install.sh --install
+ else
+ bash install.sh -q --install
+ fi
+
+ # cd "$CURRDIR"
+}
+
+uninstall() {
+ cd "$EXTRACTPATH"
+
+ if [ "$INERACTIVE" = "1" ]; then
+ bash install.sh --uninstall
+ else
+ bash install.sh -q --uninstall
+ fi
+ # cd "$CURRDIR"
+}
+
+start() {
+ cd "$EXTRACTPATH"
+
+ if [ "$INERACTIVE" = "1" ]; then
+ bash data/kmyfirewall.sh -v start
+ else
+ bash data/kmyfirewall.sh -v start
+ fi
+
+ # cd "$CURRDIR"
+}
+stop() {
+ cd "$EXTRACTPATH"
+
+ if [ "$INERACTIVE" = "1" ]; then
+ bash data/kmyfirewall.sh -v stop
+ else
+ bash data/kmyfirewall.sh -v stop
+ fi
+
+ # cd "$CURRDIR"
+}
+
+
+reinstall() {
+ cd "$EXTRACTPATH"
+ bash install.sh --reinstall
+ if [ "$INERACTIVE" = "1" ]; then
+ bash install.sh --reinstall
+ else
+ bash install.sh -q --reinstall
+ fi
+ # cd "$CURRDIR"
+}
+
+delpackage() {
+ realydel="y"
+
+ if [ "$INERACTIVE" = "1" ]; then
+ echo -n "Do you want to delete the extracted installation files? [Y/n]: "
+ read realydel
+ fi
+
+ if [ "$realydel" != "n" ]; then
+ # if [ "$INERACTIVE" = "1" ]; then
+ echo -n "Deleting $EXTRACTPATH...\t\t"
+ # fi
+ rm -rf "$EXTRACTPATH"
+ echo "Done"
+ fi
+ echo
+}
+
+copyToInstallDir() {
+ cd "$CURRDIR"
+ echo "Copy installer package to /etc/kmyfirewall/kmfpackage.kmfpkg...\t\t"
+ cp $0 /etc/kmyfirewall/
+ echo "Done"
+}
+
+printHello() {
+ echo "KMyFirewall Installer Package v%version%"
+ echo "Please report bugs to: %maintainer%"
+ echo
+}
+printHelp() {
+ echo "Usage: $0 [-q] { --install | --uninstall | --reinstall | --extract | --start | --stop | --help }"
+ echo
+ echo "Switches"
+ echo " -q"
+ echo " No not require any user interaction."
+ echo
+ echo "Options:"
+ echo " install|--install|-i"
+ echo " Install the configuration."
+ echo " The installed firewall scrip will be automaticaly run at system boot."
+ echo
+ echo " uninstall|--uninstall|-u"
+ echo " Uninstall the configuration form the system."
+ echo
+ echo " reinstall|--reinstall|-r"
+ echo " Re-Installs the configuration e.g. the same as install.sh uninstall"
+ echo " followed by install.sh install"
+ echo
+ echo " extract|--extract|-e"
+ echo " Only extract the installation files."
+ echo " The firewall will not be installed."
+ echo
+ echo " start|--start|-s"
+ echo " Only extract the installation files and."
+ echo " runs the firewall script."
+ echo " The firewall will not be installed."
+ echo
+ echo " stop|--stop|-c"
+ echo " Only extract the installation files and."
+ echo " stops the firewall script."
+ echo " The firewall will not be installed."
+ echo
+ echo " help|--help|-h"
+ echo " Print this help message"
+ echo
+}
+
+#
+# Execution starts here
+#
+
+COMMAND=$1
+
+if [ "$COMMAND" = "-q" ]; then
+ COMMAND="$2"
+ INERACTIVE="0";
+fi
+
+printHello
+
+case $COMMAND in
+ install|--install|-i)
+ checkRequirements
+ extract
+ install
+ delpackage
+ copyToInstallDir
+ ;;
+
+ uninstall|--uninstall|-u)
+ checkRequirements
+ extract
+ # install
+ uninstall
+ delpackage
+ ;;
+
+ reinstall|--reinstall|-r)
+ checkRequirements
+ extract
+ reinstall
+ delpackage
+ copyToInstallDir
+ ;;
+
+ extract|--extract|-e)
+ checkRequirements
+ extract
+ ;;
+
+ start|--start|-s)
+ checkRequirements
+ extract
+ start
+ delpackage
+ copyToInstallDir
+ ;;
+
+ stop|--stop|-c)
+ checkRequirements
+ extract
+ stop
+ delpackage
+ copyToInstallDir
+ ;;
+
+ help|--help|-h)
+ printHelp
+ ;;
+
+ *)
+ checkRequirements
+ extract
+ install
+ delpackage
+ copyToInstallDir
+ ;;
+esac \ No newline at end of file
diff --git a/kmyfirewall/installer/linux/kmfinstall.sh b/kmyfirewall/installer/linux/kmfinstall.sh
new file mode 100644
index 0000000..0753d10
--- /dev/null
+++ b/kmyfirewall/installer/linux/kmfinstall.sh
@@ -0,0 +1,244 @@
+#!/bin/sh
+#
+# %coypright%
+#
+# Please report bugs to: %maintainer%
+#
+# %license%
+#
+# Installer script for KMyFirewall %version%
+# This is an automatic generated file DO NOT EDIT
+#
+
+checkFiles() {
+ if [ ! -d "$INITDIR" ]; then
+ echo "Dirctory $INITDIR not found"
+ exit 1
+ fi
+ if [ "$SYSTEMTYPE" != "slackware" ]; then
+ if [ ! -d "$RUNLEVELDIR" ]; then
+ echo "Dirctory $RUNLEVELDIR not found"
+ exit 1
+ fi
+ fi
+ if [ "$ACTION" = "install" ]; then
+ if [ ! -f "$FWSCRIPT" ]; then
+ echo "File $FWSCRIPT not found"
+ exit 1
+ fi
+ if [ ! -f "$INITSCRIPT" ]; then
+ echo "File $INITSCRIPT not found"
+ exit 1
+ fi
+ fi
+}
+
+installFW() {
+ if [ "$SYSTEMTYPE" = "sysv" ]; then
+ echo "Starting Sys(V) installation"
+
+ if [ ! -d "/etc/kmyfirewall" ]; then
+ echo -n "Create Directory: /etc/kmyfirewall... "
+ mkdir /etc/kmyfirewall || exit 1
+ echo "Done"
+ fi
+
+ echo -n "Copy $FWSCRIPT firewallscript to: /etc/kmyfirewall/kmyfirewall.sh... "
+ cp $FWSCRIPT /etc/kmyfirewall/kmyfirewall.sh || exit 1
+ echo "Done"
+
+ echo -n "Copy $INITSCRIPT initscript to: $INITDIR/kmyfirewall... "
+ cp $INITSCRIPT $INITDIR/kmyfirewall || exit 1
+ echo "Done"
+
+ echo -n "Setting Permissions..."
+ chown root:root /etc/kmyfirewall/kmyfirewall.sh || exit 1
+ chmod 700 /etc/kmyfirewall/kmyfirewall.sh || exit 1
+ chown root:root $INITDIR/kmyfirewall || exit 1
+ chmod 755 $INITDIR/kmyfirewall || exit 1
+ echo "Done"
+
+ echo -n "Creating Links..."
+ ln -sf $INITDIR/kmyfirewall $RUNLEVELDIR/S99kmyfirewall || exit 1
+ ln -sf $INITDIR/kmyfirewall $RUNLEVELDIR/K01kmyfirewall || exit 1
+ echo "Done"
+
+ elif [ "$SYSTEMTYPE" = "gentoo" ]; then
+ echo "Starting Gentoo installation"
+
+ if [ ! -d "/etc/kmyfirewall" ]; then
+ echo -n "Create Directory: /etc/kmyfirewall... "
+ mkdir /etc/kmyfirewall || exit 1
+ echo "Done"
+ fi
+
+ echo -n "Copy firewallscript to: /etc/kmyfirewall/kmyfirewall.sh... "
+ cp $FWSCRIPT /etc/kmyfirewall/kmyfirewall.sh || exit 1
+ echo "Done"
+
+ echo -n "Copy initscript to: $INITDIR... "
+ cp $INITSCRIPT $INITDIR/kmyfirewall || exit 1
+ echo "Done"
+
+ echo -n "Setting Permissions..."
+ chown root:root /etc/kmyfirewall/kmyfirewall.sh || exit 1
+ chmod 700 /etc/kmyfirewall/kmyfirewall.sh || exit 1
+ chown root:root $INITDIR/kmyfirewall || exit 1
+ chmod 755 $INITDIR/kmyfirewall || exit 1
+ echo "Done"
+
+ echo -n "running rc-update... "
+ rc-update add kmyfirewall default
+ echo "Done"
+
+
+ elif [ "$SYSTEMTYPE" = "slackware" ]; then
+ echo "Starting Slackware instalation"
+
+ if [ ! -d "/etc/kmyfirewall" ]; then
+ echo -n "Create Directory: /etc/kmyfirewall... "
+ mkdir /etc/kmyfirewall || exit 1
+ echo "Done"
+ fi
+ echo -n "Copy firewallscript to /etc/rc.d/rc.firewall"
+ cp $FWSCRIPT /etc/rc.d/rc.firewall || exit 1
+ echo "Done."
+
+ echo -n "Setting Permissions..."
+ chown root:root /etc/rc.d/rc.firewall || exit 1
+ chmod 755 /etc/rc.d/rc.firewall || exit 1
+ echo "Done"
+
+ echo -n "Deleting temporary files..."
+ rm -f $FWSCRIPT || exit 1
+ rm -f $INITSCRIPT || exit 1
+ echo "Done"
+ fi
+}
+
+uninstallFW() {
+ if [ ! -d "/etc/kmyfirewall/" ]; then
+ echo "No KMyFirewall installation found."
+ return
+ fi
+
+
+ if [ "$SYSTEMTYPE" = "sysv" ]; then
+ echo "Starting Sys(V) deinstallation"
+
+ echo -n "Delete scriptdir: /etc/kmyfirewall... "
+ rm -rf /etc/kmyfirewall/ || exit 1
+ echo "Done"
+
+ echo -n "Delete link: $RUNLEVELDIR/S99kmyfirewall... "
+ rm -f $RUNLEVELDIR/S99kmyfirewall || exit 1
+ echo "Done"
+
+ echo -n "Delete link: $RUNLEVELDIR/K01kmyfirewall... "
+ rm -f $RUNLEVELDIR/K01kmyfirewall || exit 1
+ echo "Done"
+
+ echo -n "Delete initscript: $INITDIR/kmyfirewall... "
+ rm -f $INITDIR/kmyfirewall || exit 1
+ echo "Done"
+
+ elif [ "$SYSTEMTYPE" = "gentoo" ]; then
+ echo "Starting Gentoo deinstallation"
+
+ echo -n "Calling rc-update del kmyfirewall... "
+ rc-update del kmyfirewall
+ echo "Done"
+
+ echo -n "Delete initscript: $INITDIR/kmyfirewall... "
+ rm -f $INITDIR/kmyfirewall || exit 1
+ echo "Done"
+
+ echo -n "Delete scriptdir: /etc/kmyfirewall... "
+ rm -rf /etc/kmyfirewall/ || exit 1
+ echo "Done"
+
+ elif [ "$SYSTEMTYPE" = "slackware" ]; then
+ echo "Starting Slackware uninstall"
+ echo -n "Removing firewall start scripts...."
+ rm /etc/rc.d/*firewall*
+ echo "Done."
+ fi
+}
+
+# Execution starts here
+if [ "$1" = "" ]; then
+ echo "ERROR: Variable ACTION not defined"
+ exit 1
+fi
+ACTION=$1
+#echo "Action: $ACTION"
+
+if [ "$2" = "" ]; then
+ echo "ERROR: Variable SYSTEMTYPE not defined"
+ exit 1
+fi
+SYSTEMTYPE=$2
+#echo "Systemtype: $SYSTEMTYPE"
+
+if [ "$3" = "" ]; then
+ echo "ERROR: Variable INITDIR not defined"
+ exit 1
+fi
+INITDIR=$3
+#echo "Initdir: $INITDIR"
+
+if [ "$4" = "" ]; then
+ echo "ERROR: Variable RUNLEVELDIR not defined"
+ exit 1
+fi
+RUNLEVELDIR=$4
+#echo "Runleveldir: $RUNLEVELDIR"
+
+if [ "$ACTION" = "install" ]; then
+ if [ "$5" = "" ]; then
+ echo "ERROR: Variable INITSCRIPT not defined"
+ exit 1
+ fi
+ INITSCRIPT=$5
+ #echo "Initscript: $INITSCRIPT"
+
+ if [ "$6" = "" ]; then
+ echo "ERROR: Variable FWSCRIPT not defined"
+ exit 1
+ fi
+ FWSCRIPT=$6
+ #echo "FWscript: $FWSCRIPT"
+fi
+
+checkFiles
+
+case $ACTION in
+ install)
+ installFW
+ ;;
+
+ uninstall)
+ uninstallFW
+ ;;
+
+ *)
+ echo "Usage: kmfinstall.sh { install | uninstall }"
+ exit 1
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/kmyfirewall/installer/linux/kmfinstaller_linux.desktop b/kmyfirewall/installer/linux/kmfinstaller_linux.desktop
new file mode 100644
index 0000000..9a0c653
--- /dev/null
+++ b/kmyfirewall/installer/linux/kmfinstaller_linux.desktop
@@ -0,0 +1,62 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall Installer for Linux
+Name[bg]=Инсталираща програма за KMyFirewall под Линукс
+Name[br]=Stalier KMyFirewall evit Linux
+Name[ca]=Instal·lador per a Linux de KMyFirewall
+Name[cs]=Linuxový instalátor KMyFirewall
+Name[da]=KMyFirewall Installatør for Linux
+Name[de]=KMyFirewall Installationsprogramm für Linux
+Name[el]=Εγκατάσταση του KMyFirewall για το Linux
+Name[es]=Instalador de KMyFirewall para GNU/Linux
+Name[et]=KMyFirewalli paigaldaja Linuxile
+Name[fr]=Installeur de KMyFirewall pour Linux
+Name[gl]=Instalador de KMyFirewall para Linux
+Name[hi]=लिनक्स के लिए के-माइ-फायरवाल संस्थापक
+Name[it]=Installatore di KMyFirewall per Linux
+Name[ja]=Linux のための KMyFirewall インストーラ
+Name[ka]=KMyFirewall დამყენებელი ლინუქსისთვის
+Name[nl]=KMyfirewall-installatie voor Linux
+Name[pa]=ਲੀਨਕਸ ਲਈ KMyFirewall ਇੰਸਟਾਲਰ
+Name[pl]=Instalator KMyFirewall dla Linuksa
+Name[pt]='Plugin' de Instalação do KMyFirewall para Linux
+Name[pt_BR]=Instalador do KMyFirewall para Linux
+Name[ru]=KMyFirewall - Установка для Linux
+Name[sr]=KMyFirewall-ов инсталатер за Linux
+Name[sr@Latn]=KMyFirewall-ov instalater za Linux
+Name[sv]=Min brandvägg installation för Linux
+Name[ta]=லினஸ் KMyதீச்சுவர் நிறுவுபவர்
+Name[tr]=Linux için KMyFirewall Kurulum Programı
+Name[uk]=Встановлювач KMyFirewall для Linux
+Name[xx]=xxKMyFirewall Installer for Linuxxx
+Comment=Plugin for installing an iptables scriptfile
+Comment[bg]=Приставка за инсталиране на скриптови файлове на iptables
+Comment[ca]=Connector per instal·lar un fitxer script de iptables
+Comment[cs]=Modul pro instalaci skriptového souboru iptables
+Comment[da]=Plugin til at installere en iptables scriptfil
+Comment[de]=Modul zur Installation eine Skriptdatei
+Comment[el]=Πρόσθετο εγκατάστασης ενός αρχείου σεναρίου iptables
+Comment[es]=Complemento para instalar un fichero script de iptables
+Comment[et]=Plugin IPTablesi skriptifaili paigaldamiseks
+Comment[fr]=Module pour l'installation d'un fichier script iptables
+Comment[gl]=Extensión para instalar un guión de iptables
+Comment[hi]=आईपी-टेबल्स स्क्रिप्ट-फाइल संस्थापना करने हेतु प्लगइन
+Comment[it]=Plugin per installare un file script di iptables
+Comment[ja]=iptables スクリプトファイルをインストールするためのプラグイン
+Comment[ka]=iptables scriptfile-ის დამყენებელი მოდული
+Comment[nl]=Plugin voor het installeren van een iptables-scriptbestand
+Comment[pl]=Wtyczka do instalowania skryptu iptables
+Comment[pt]='Plugin' para instalar um ficheiro iptables
+Comment[pt_BR]=Plug-in para a instalação de um arquivo de scripts do iptables
+Comment[sr]=Прикључак за инсталирање iptables фајлова скрипти
+Comment[sr@Latn]=Priključak za instaliranje iptables fajlova skripti
+Comment[sv]=Insticksprogram för att installera en skriptfil för IP-tabeller
+Comment[tr]=iptables betik dosyası kurmak için eklenti
+Comment[uk]=Втулок для встановлення скриптфайла iptables
+Comment[xx]=xxPlugin for installing an iptables scriptfilexx
+X-KDE-Library=libkmfinstaller_linux
+ServiceTypes=KMyFirewall/Installer
+X-KMyFirewall-Platform=linux
+
diff --git a/kmyfirewall/installer/linux/kmfiptinstaller.cpp b/kmyfirewall/installer/linux/kmfiptinstaller.cpp
new file mode 100644
index 0000000..c3e8f87
--- /dev/null
+++ b/kmyfirewall/installer/linux/kmfiptinstaller.cpp
@@ -0,0 +1,1170 @@
+/***************************************************************************
+begin : Mon Jan 28 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+// QT includes
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qstring.h>
+#include <qmessagebox.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qtextstream.h>
+#include <qsizepolicy.h>
+//KDE includes
+#include <kurl.h>
+#include <kstandarddirs.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <ktempfile.h>
+#include <kmessagebox.h>
+#include <kiconloader.h>
+#include <kio/netaccess.h>
+#include <ktar.h>
+#include <kmdcodec.h>
+
+// STD includes
+// #include <iostream>
+
+//My Includes
+#include "../../version.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfconfig.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmferrorhandler.h"
+#include "../../core/kmftarget.h"
+#include "../../core/kmftargetconfig.h"
+#include "../../core/kmfnetzone.h"
+#include "../../core/kprocesswrapper.h"
+#include "../../core/kmfpluginfactory.h"
+#include "../../core/xmlnames.h"
+
+
+#include "../../kmfwidgets/kmfprocout.h"
+#include "../../kmfwidgets/kmfselectactivetarget.h"
+
+#include "kmfiptinstaller.h"
+
+namespace KMF {
+
+KMFIPTInstaller::KMFIPTInstaller( QObject* parent, const char* name ) : KMFPlugin( parent, name ), KMFInstallerInterface() {
+ m_err = new KMFError();
+ m_err_handler = new KMFErrorHandler( "KMFIPTInstaller" );
+ m_osName = "linux";
+ m_osGUIName = "Linux";
+
+ temp_file = new KTempFile();
+ temp_file2 = new KTempFile();
+ m_execWidget = 0;
+ loadIcons();
+ execWidget();
+}
+
+KMFIPTInstaller::~KMFIPTInstaller() {
+ temp_file->close();
+ temp_file2->close();
+ temp_file->unlink();
+ temp_file2->unlink();
+}
+
+KMFCompilerInterface* KMFIPTInstaller::compiler() {
+ if( ! rulesetDoc() || ! rulesetDoc()->target() ) {
+ kdDebug() << "No Ruleset ofr Target available" << endl;
+ return 0;
+ }
+ KMFCompilerInterface* compiler = rulesetDoc()->target()->compiler();
+ if ( ! compiler ) {
+ return 0;
+ }
+ return compiler;
+}
+
+QValueList<KMFCompilerInterface*>* KMFIPTInstaller::compilers() {
+ return KMFPluginFactory::CompilersForInstaller( osName() );
+}
+
+void KMFIPTInstaller::loadScript( const QString& script ) {
+ m_script = script;
+}
+
+void KMFIPTInstaller::slotCloseWindow() {
+ emit sigHideMe();
+}
+
+KMFProcOut* KMFIPTInstaller::execWidget(){
+ if ( m_execWidget ) {
+ m_execWidget->setText( "", "" );
+ setOutputWidget( m_execWidget );
+ return m_execWidget;
+ }
+ kdDebug() << "Need to create new execWidget." << endl;
+ m_execWidget = new KMFProcOut( 0, "KMFProcOut" );
+ connect( m_execWidget, SIGNAL( sigJobFinished( bool, const QString& ) ),
+ this, SLOT( slotJobFinished( bool, const QString& ) ) );
+ setOutputWidget( m_execWidget );
+ return m_execWidget;
+}
+
+
+void KMFIPTInstaller::slotJobFinished( bool ok, const QString& cmd_name ) {
+ kdDebug() << "void KMFIPTInstaller::slotJobFinished(bool ok,const QString& cmd_name)" << endl;
+ if ( cmd_name == Constants::InstallFirewallJob_Name && ok ) { // installation successful
+ const QString & msg = i18n( "<p>Installation of the firewall finished successfully. "
+ "The firewall will startup during the next reboot.<br>"
+ "If you want the firewall to be started now click <b>OK</b> and then <b>Run Firewall</b>" );
+ const QString& cap = "Install Firewall";
+ KMessageBox::information( 0, msg, cap );
+
+ } else if ( cmd_name == Constants::InstallFirewallJob_Name && !ok ) { // installation failed
+ const QString & msg = i18n( "<p><b>Installation of firewall failed</b><br>"
+ "<p>Please make sure you are logged in as <b>root</b>" );
+ const QString& cap = "Install Firewall";
+ KMessageBox::error( 0, msg, cap );
+ } else if ( cmd_name == Constants::UninstallFirewallJob_Name && ok ) { // uninstallation successful
+ const QString & msg = i18n( "<p>Uninstallation of the firewall finished successfully. "
+ "The firewall will no longer startup during boot.<br>"
+ "If you want the firewall to be stopped now click <b>OK</b> and then <b>Stop Firewall</b>" );
+ const QString& cap = "Install Firewall";
+ KMessageBox::information( 0, msg, cap );
+ } else if ( cmd_name == Constants::UninstallFirewallJob_Name && !ok ) { // uninstallation failed
+ const QString & msg = i18n( "<p><b>Uninstallation of Firewall failed</b><br>"
+ "Please make sure you are logged in as <b>root</b>" );
+ const QString& cap = "Uninstall Firewall";
+ KMessageBox::error( 0, msg, cap );
+ } /*else if ( !ok ) {
+ const QString & msg = i18n( "<p>Execution of <b>%1</b> failed"
+ "<p>Click <b>OK</b> to check your configuration and make sure you are logged in as <b>root</b>" ).arg( cmd_name );
+ const QString& cap = "KMFIPTInstaller";
+ KMessageBox::error( 0, msg, cap );
+ }*/
+ emit sigStatusChanged();
+}
+
+
+
+
+
+
+
+
+void KMFIPTInstaller::cmdRunFW() {
+ kdDebug() << "void KMFIPTInstaller::slotRunFW()" << endl;
+ if ( ! rulesetDoc() ) {
+ kdDebug() << "rulesetDoc() == 0" << endl;
+ return;
+ }
+
+ m_err = rulesetDoc()->createFirewallScript( temp_file->name() );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ return;
+ }
+
+ kdDebug() << "Starting Firewall..." << endl;
+
+ if( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+ if ( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to execute the generated iptables script?</b>"
+ "<p><b>A wrongly configured iptables script may make your computer unusable!</b>"
+ "<p>If your system hangs after you start the firewall, switch to a text "
+ "console (Ctrl+Alt+F1) and run the following commands to reset your iptables "
+ "configuration:"
+ "<p><ul>"
+ "<li>iptables -F </li>"
+ "<li>iptables -X </li>"
+ "<li>iptables -P INPUT ACCEPT </li>"
+ "<li>iptables -P OUTPUT ACCEPT </li>"
+ "<li>iptables -P FORWARD ACCEPT </li>"
+ "<li>iptables -t nat -F </li>"
+ "<li>iptables -t nat -X </li>"
+ "<li>iptables -t nat -P OUTPUT ACCEPT </li>"
+ "<li>iptables -t nat -P PREROUTING ACCEPT </li>"
+ "<li>iptables -t nat -P POSTROUTING ACCEPT </li>"
+ "<li>iptables -t mangle -F </li>"
+ "<li>iptables -t mangle -X </li>"
+ "<li>iptables -t mangle -P INPUT ACCEPT </li>"
+ "<li>iptables -t mangle -P OUTPUT ACCEPT </li>"
+ "<li>iptables -t mangle -P FORWARD ACCEPT </li>"
+ "<li>iptables -t mangle -P PREROUTING ACCEPT </li>"
+ "<li>iptables -t mangle -P POSTROUTING ACCEPT </li></ul>" ),
+ i18n( "Run Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_view_run_fw" ) != KMessageBox::Yes ) {
+ return;
+ }
+
+ QString cmd = "bash " + temp_file->name() + " -v start";
+ // KProcessWrapper::instance()->slotStartLocalJob( "startfirewall", cmd, true, true );
+ setOutputWidget( execWidget() );
+ execWidget()->runCmd( cmd, Constants::StartFirewallJob_Name, i18n("Start Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ), true );
+ showOutput();
+ checkStatus();
+ } else {
+ if( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to execute the generated firewall script on %1?</b>"
+ "<p><b>A wrongly configured firewall script may make your computer unusable! PLease make sure that you have left the SSH port open, otherwise you will no longer be able to remote control the comuter using KMyFirewall or any other SSH client!</b></p>"
+ "<p>If your system hangs after you start the firewall, switch to a text "
+ "console (Ctrl+Alt+F1) and run the following commands to reset your iptables "
+ "configuration:"
+ "<p><ul>"
+ "<li>iptables -F </li>"
+ "<li>iptables -X </li>"
+ "<li>iptables -P INPUT ACCEPT </li>"
+ "<li>iptables -P OUTPUT ACCEPT </li>"
+ "<li>iptables -P FORWARD ACCEPT </li>"
+ "<li>iptables -t nat -F </li>"
+ "<li>iptables -t nat -X </li>"
+ "<li>iptables -t nat -P OUTPUT ACCEPT </li>"
+ "<li>iptables -t nat -P PREROUTING ACCEPT </li>"
+ "<li>iptables -t nat -P POSTROUTING ACCEPT </li>"
+ "<li>iptables -t mangle -F </li>"
+ "<li>iptables -t mangle -X </li>"
+ "<li>iptables -t mangle -P INPUT ACCEPT </li>"
+ "<li>iptables -t mangle -P OUTPUT ACCEPT </li>"
+ "<li>iptables -t mangle -P FORWARD ACCEPT </li>"
+ "<li>iptables -t mangle -P PREROUTING ACCEPT </li>"
+ "<li>iptables -t mangle -P POSTROUTING ACCEPT </li></ul>" ).arg(rulesetDoc()->target()->toFriendlyString() ),
+ i18n( "Install Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_run_fw_remote" ) != KMessageBox::Yes
+ ) {
+ return;
+ }
+
+
+ setOutputWidget( execWidget() );
+ execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+
+ generateInstallerPackage( rulesetDoc()->target() );
+ QString cmd = "cd /tmp/; sh ./kmfpackage.kmfpkg -q --start";
+ KProcessWrapper::instance()->slotStartRemoteJob( Constants::StartFirewallJob_Name, cmd, rulesetDoc()->target() );
+
+ if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+ kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+ KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+ return;
+ }
+
+ setOutputWidget( execWidget() );
+ execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Start Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+ checkStatus();
+ }
+
+}
+
+void KMFIPTInstaller::cmdStopFW() {
+ kdDebug() << "Shutdown Firewall..." << endl;
+ loadScript( rulesetDoc()->compile() );
+ const QString file = temp_file->name();
+ m_err = rulesetDoc()->createFirewallScript( file );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ return;
+ }
+
+ if( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to stop the firewall on %1?</b>"
+ "<p><b>This will leave the computer unprotected!</b></p>" ).arg(rulesetDoc()->target()->toFriendlyString() ),
+ i18n( "Install Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_stop_fw_remote" ) != KMessageBox::Yes
+ ) {
+ return;
+ };
+
+
+ if( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+
+ QString cmd = "bash " + file + " -v stop";
+ setOutputWidget( execWidget() );
+ execWidget()->runCmd( cmd, Constants::StopFirewallJob_Name, i18n("Stop Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ), true );
+ showOutput();
+ checkStatus();
+
+ } else {
+ setOutputWidget( execWidget() );
+ execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+
+ generateInstallerPackage( rulesetDoc()->target() );
+ QString cmd = "cd /tmp/; sh ./kmfpackage.kmfpkg -q --stop";
+ KProcessWrapper::instance()->slotStartRemoteJob( Constants::StopFirewallJob_Name, cmd, rulesetDoc()->target() );
+
+ if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+ kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+ KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+ return;
+ }
+
+ setOutputWidget( execWidget() );
+ execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Stop Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+ checkStatus();
+ }
+}
+
+void KMFIPTInstaller::cmdShowRunningConfig( const QString& para ) {
+ QString cmd = "";
+ if ( para == Constants::FilterTable_Name ) {
+ cmd = cmdShowFilter();
+ } else if ( para == Constants::NatTable_Name ) {
+ cmd = cmdShowNat();
+ } else if ( para == Constants::MangleTable_Name ) {
+ cmd = cmdShowMangle();
+ } else {
+ cmd = cmdShowAll();
+ }
+
+ if( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+ // KProcessWrapper::instance()->slotStartLocalJob( "show_config", cmd, true, true );
+ setOutputWidget( execWidget() );
+ execWidget()->runCmd( cmd,Constants::ShowConfigJob_Name, i18n("Show Table %1 on %2").arg( para ).arg( rulesetDoc()->target()->toFriendlyString() ), true );
+ showOutput();
+
+ } else {
+ setOutputWidget( execWidget() );
+ execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+ KProcessWrapper::instance()->slotStartRemoteJob( Constants::ShowConfigJob_Name, cmd, rulesetDoc()->target() );
+
+ if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+ kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+ KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+ return;
+ }
+
+ setOutputWidget( execWidget() );
+ execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Show Table %1 on %2").arg( para ).arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+ }
+}
+
+
+
+void KMFIPTInstaller::cmdInstallFW() {
+ kdDebug() << "KMFIPTInstaller::slotInstallFW()" << endl;
+ KMFTargetConfig *conf = rulesetDoc()->target()->config();
+
+ if( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to install the firewall on %1?</b>"
+ "<p>This will add the scripts to your init system that are required to "
+ "start your firewall during bootup."
+ "<p><b>Please make sure that the firewall runs properly before you install it.</b>" ).arg( rulesetDoc()->target()->toFriendlyString() ),
+ i18n( "Install Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_view_install_fw" ) != KMessageBox::Yes ) {
+ return;
+ }
+
+ if ( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+ KURL url ( KGlobal::dirs() ->findResource( "appdata", "scripts/installer/linux/kmfinstall.sh" ));
+ QString installscript = url.path();
+
+ if ( installscript.isEmpty() ) {
+ QString msg = i18n( "<p>Unable to find install script <b>kmfinstall.sh</b>"
+ "<p>Please check your installation. Usually this script is installed in "
+ "$KDEDIR/share/apps/kmyfirewall/scripts/installer/linux"
+ "<p>Unable to install the firewall without this script." );
+ QString cap = "KMFIPTInstaller";
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+ kdDebug() << "found Install script: " << installscript << endl;
+ if ( conf->oS() == "linux" && conf->distribution() == "gentoo" ) {
+ QString msg = i18n( "<p>The following files will be created by installing the firewall"
+ "<ul><li>Directory: %1</li>"
+ "<li>File: %2</li>"
+ "<li>File: %3</li>"
+ "<li>Link: %4 -&gt; %5</li></ul></ul>" )
+ .arg( "/etc/kmyfirewall" )
+ .arg( "/etc/kmyfirewall/kmyfirewall.sh" )
+ .arg( conf->IPTPath() + "/kmyfirewall" )
+ .arg( conf->rcDefaultPath() + "/kmyfirewall" )
+ .arg( conf->initPath() + "/kmyfirewall" );
+ QString cap = i18n( "Install Firewall" );
+ KMessageBox::information( 0, msg, cap, "created_install_files", 0 );
+ } else if ( conf->oS() == "linux" ) {
+ QString msg = i18n( "<p>The following files will be created by installing the firewall"
+ "<ul><li>Directory: %1</li>"
+ "<li>File: %2</li>"
+ "<li>File: %3</li>"
+ "<li>Link: %4 -&gt; %5</li>"
+ "<li>Link: %6 -&gt; %7</li></ul></ul>" )
+ .arg( "/etc/kmyfirewall" )
+ .arg( "/etc/kmyfirewall/kmyfirewall.sh" )
+ .arg( conf->initPath() + "/kmyfirewall" )
+ .arg( conf->rcDefaultPath() + "/S99kmyfirewall" )
+ .arg( conf->initPath() + "/kmyfirewall" )
+ .arg( conf->rcDefaultPath() + "/K01kmyfirewall" )
+ .arg( conf->initPath() + "/kmyfirewall" );
+ QString cap = i18n( "Install Firewall" );
+ KMessageBox::information( 0, msg, cap, "created_install_files", 0 );
+ }
+
+ const QString fwscript = temp_file->name();
+ m_err = rulesetDoc()->createFirewallScript( temp_file->name() );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ return;
+ }
+ const QString initscript = temp_file2->name();
+ m_err = createInitScript( initscript, KMFConfig::distribution() );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ return;
+ }
+ QString systemtype;
+ if ( conf->distribution() == "gentoo" )
+ systemtype = "gentoo";
+ else if( conf->distribution() == "slackware" )
+ systemtype = "slackware";
+ else
+ systemtype = "sysv";
+
+ QString cmd = "bash " + installscript + " install " + systemtype + " " + conf->initPath() + " " + conf->rcDefaultPath() + " " + initscript + " " + fwscript;
+ setOutputWidget( execWidget() );
+ execWidget()->runCmd( cmd, Constants::InstallFirewallJob_Name, i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ), true );
+ showOutput();
+ checkStatus();
+ } else {
+ setOutputWidget( execWidget() );
+ execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+
+ generateInstallerPackage( rulesetDoc()->target() );
+ QString cmd = "cd /tmp/; sh ./kmfpackage.kmfpkg -q --install";
+ KProcessWrapper::instance()->slotStartRemoteJob( Constants::InstallFirewallJob_Name, cmd, rulesetDoc()->target() );
+
+ if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+ kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+ KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+ return;
+ }
+
+ setOutputWidget( execWidget() );
+ execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+ checkStatus();
+ }
+
+}
+
+void KMFIPTInstaller::cmdUninstallFW() {
+ kdDebug() << "KMFIPTInstaller::slotUninstallFW()" << endl;
+
+ KMFTargetConfig *conf = rulesetDoc()->target()->config();
+
+ if ( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to uninstall the firewall from %1?</b><br>"
+ "The firewall will no longer start up during boot." ).arg( rulesetDoc()->target()->toFriendlyString() ),
+ i18n( "Uninstall Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_view_uninstall_fw" ) != KMessageBox::Yes ) {
+ return;
+ }
+
+
+ if ( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+ KURL url (KGlobal::dirs() ->findResource( "appdata", "scripts/installer/linux/kmfinstall.sh" ));
+ QString installscript = url.path();
+
+ if ( installscript.isEmpty() ) {
+ const QString & msg = i18n( "<p>Unable to find uninstall script <b>kmfinstall.sh</b>"
+ "<p>Please check your installation. Usually this script is installed in "
+ "$KDEDIR/share/apps/kmyfirewall/scripts/installer/linux"
+ "<p>Unable to uninstall the firewall without this script." );
+ const QString& cap = "KMFIPTInstaller";
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+ kdDebug() << "found Install script: " << installscript << endl;
+ if ( conf->oS() == "linux" && conf->distribution() == "gentoo" ) {
+ QString msg = i18n( "<p>The following files will be removed by uninstalling the firewall"
+ "<ul><li>Directory: %1</li>"
+ "<li>File: %2</li>"
+ "<li>File: %3</li>"
+ "<li>Link: %4 -&gt; %5</li></ul></ul>" )
+ .arg( "/etc/kmyfirewall" )
+ .arg( "/etc/kmyfirewall/kmyfirewall.sh" )
+ .arg( conf->initPath() + "/kmyfirewall" )
+ .arg( conf->rcDefaultPath() + "/kmyfirewall" )
+ .arg( conf->initPath() + "/kmyfirewall" );
+ QString cap = i18n( "Uninstall Firewall" );
+ KMessageBox::information( 0, msg, cap, "removed_uninstall_files", 0 );
+ } else if ( conf->oS() == "linux" ) {
+ QString msg = i18n( "<p>The following files will be removed by uninstalling the firewall"
+ "<ul><li>Directory: %1</li>"
+ "<li>File: %2</li>"
+ "<li>File: %3</li>"
+ "<li>Link: %4 -&gt; %5</li>"
+ "<li>Link: %6 -&gt; %7</li></ul></ul>" )
+ .arg( "/etc/kmyfirewall" )
+ .arg( "/etc/kmyfirewall/kmyfirewall.sh" )
+ .arg( conf->initPath() + "/kmyfirewall" )
+ .arg( conf->rcDefaultPath() + "/S99kmyfirewall" )
+ .arg( conf->initPath() + "/kmyfirewall" )
+ .arg( conf->rcDefaultPath() + "/K01kmyfirewall" )
+ .arg( conf->initPath() + "/kmyfirewall" );
+ QString cap = i18n( "Uninstall Firewall" );
+ KMessageBox::information( 0, msg, cap, "removed_uninstall_files", 0 );
+ }
+
+ QString systemtype;
+ if ( conf->distribution() == "gentoo" )
+ systemtype = "gentoo";
+ else if( conf->distribution() == "slackware" )
+ systemtype = "slackware";
+ else
+ systemtype = "sysv";
+
+ QString cmd = "bash " + installscript + " uninstall " + systemtype + " " + conf->initPath() + " " + conf->rcDefaultPath();
+ // KProcessWrapper::instance()->slotStartLocalJob( "uninstallfirewall", cmd, true, true );
+
+ setOutputWidget( execWidget() );
+ execWidget()->runCmd( cmd, Constants::UninstallFirewallJob_Name, i18n("Uninstall Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ), true );
+ showOutput();
+ checkStatus();
+
+ } else {
+ setOutputWidget( execWidget() );
+ execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+
+ generateInstallerPackage( rulesetDoc()->target() );
+ QString cmd = "cd /tmp/; sh ./kmfpackage.kmfpkg -q --uninstall";
+ KProcessWrapper::instance()->slotStartRemoteJob( Constants::UninstallFirewallJob_Name, cmd, rulesetDoc()->target() );
+
+ if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+ kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+ KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+ return;
+ }
+
+ setOutputWidget( execWidget() );
+ execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Uninstall Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+ showOutput();
+ checkStatus();
+ }
+
+
+}
+
+// void KMFIPTInstaller::cmdShowScript() {
+// kdDebug() << "KMFIPTInstaller::slotShowScript()" << endl;
+// const QString file = temp_file->name();
+// m_err = createFirewallScript( file );
+// if ( m_err_handler->showError( m_err ) ) {
+// if ( !file.isEmpty() ) {
+// QFile f( file );
+// bool isopen = f.open( IO_ReadOnly );
+// if ( isopen ) {
+// QTextStream ts( &f );
+// QString test;
+// while ( !ts.eof() ) {
+// QString s;
+// s = ts.readLine();
+// test.append( s );
+// test.append( "\n" );
+// }
+// f.close();
+// kdDebug() << "Removing Temp script file" << endl;
+// execWidget()->setText( test, i18n("Show firewall script...") );
+// showOutput();
+//
+// return;
+// } else {
+// KMessageBox::sorry( 0, i18n( "Input file %1 could not be opened." ).arg( file ), i18n( "Output Viewer" ) );
+// }
+// } else {
+// KMessageBox::sorry( 0, i18n( "Unable to find input file" ), i18n( "Output Viewer" ) );
+// }
+// }
+// return;
+// }
+
+
+QString KMFIPTInstaller::cmdShowAll() {
+ kdDebug() << "Show Config..." << endl;
+
+ KMFTargetConfig *conf = rulesetDoc()->target()->config();
+
+ QString show_config = " echo Config of Table FILTER:; "
+ "echo;" +
+ conf->IPTPath() + " -L -v -n; "
+ "echo;"
+ "echo;"
+ "echo Config of Table NAT:; "
+ "echo;" +
+ conf->IPTPath() + " -t nat -L -v -n; "
+ "echo;"
+ "echo;"
+ "echo Config of Table MANGLE:; "
+ "echo;" +
+ conf->IPTPath() + " -t mangle -L -v -n ";
+ QString cmd_name = conf->IPTPath() + " -L -v -n; " + conf->IPTPath() + " -t nat -L -v -n; " + conf->IPTPath() + " -t mangle -L -v -n";
+ return show_config;
+}
+
+QString KMFIPTInstaller::cmdShowFilter() {
+ kdDebug() << "Show Config..." << endl;
+ KMFTargetConfig *conf = rulesetDoc()->target()->config();
+
+ kdDebug() << "iptables" << " -t filter -L" << endl;
+ QString show_config = " echo Config of Table FILTER:; "
+ "echo; " +
+ conf->IPTPath() + " -t filter -L -v -n";
+ return show_config;
+}
+
+QString KMFIPTInstaller::cmdShowNat() {
+ kdDebug() << "Show Config..." << endl;
+ KMFTargetConfig *conf = rulesetDoc()->target()->config();
+
+ kdDebug() << "iptables" << " -t nat -L -v -n" << endl;
+ QString show_config = " echo Config of Table NAT:;"
+ "echo;" +
+ conf->IPTPath() +" -t nat -L -v -n";
+ return show_config;
+}
+
+QString KMFIPTInstaller::cmdShowMangle() {
+ kdDebug() << "Show Config..." << endl;
+
+ KMFTargetConfig *conf = rulesetDoc()->target()->config();
+
+ kdDebug() << "iptables" << " -t mangle -L" << endl;
+ QString show_config = " echo Config of Table MANGLE:;"
+ "echo;" +
+ conf->IPTPath() + " -t mangle -L -v -n";
+ return show_config;
+}
+
+
+
+
+// KMFError* KMFIPTInstaller::createFirewallScript( const QString& scriptfile ) {
+// if ( !scriptfile || scriptfile.isEmpty() ) {
+// m_err->setErrType( KMFError::NORMAL );
+// const QString& msg = i18n( "No filename given for script creation." );
+// m_err->setErrMsg( msg );
+// return m_err;
+// }
+// QFile f( scriptfile );
+// f.remove();
+// bool gotit = f.open( IO_ReadWrite );
+// if ( gotit ) {
+// QTextStream ts( &f );
+// ts << m_script << endl;
+// f.flush();
+// f.close();
+// } else {
+// m_err->setErrType( KMFError::NORMAL );
+// const QString& msg = i18n( "<p>Opening file for writing <b>failed</b>."
+// "Please make sure that you are logged in as <b>root</b>." );
+// m_err->setErrMsg( msg );
+// return m_err;
+// }
+// m_err->setErrType( KMFError::OK );
+// const QString& msg = "";
+// m_err->setErrMsg( msg );
+// return m_err;
+// }
+
+
+KMFError* KMFIPTInstaller::createInitScript( const QString& initfile, const QString& systemtype ) {
+ if ( !initfile || initfile.isEmpty() ) {
+ m_err->setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "No filename given for script creation." );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+
+ // kdDebug() << "Writing script to file " << initfile << endl;
+ QFile f( initfile );
+ f.remove();
+ bool gotit = f.open( IO_ReadWrite );
+ if ( gotit ) {
+ QTextStream ts( &f );
+ //Header
+ QString version = KMYFIREWALL_VERSION;
+ QString copyright_string = COPYRIGHT_STRING;
+ QString maintainer = MAINTAINER;
+ QString s;
+ if ( systemtype == "gentoo" ) {
+ kdDebug() << "Writing Gentoo init script." << endl;
+ s = "#!/sbin/runscript\n"
+ "#\n"
+ "# " + copyright_string + "\n"
+ "# mail to: " + maintainer + "\n"
+ "#\n"
+ "# Gentoo Start/Stop script for KMyFirewall " + version + "\n"
+ "# This is an automatic generated file DO NOT EDIT\n"
+ "#\n"
+ "depend() { \n"
+ "\tuse net \n"
+ "}\n"
+ "start() {\n"
+ " /bin/sh /etc/kmyfirewall/kmyfirewall.sh start\n"
+ "\teend $? \n"
+ "}\n\n"
+ "stop () {\n"
+ " /bin/sh /etc/kmyfirewall/kmyfirewall.sh stop\n"
+ "\teend $? \n"
+ "}\n\n";
+ ts << s << endl;
+ } else {
+ kdDebug() << "Writing normal init script." << endl;
+ s = "#!/bin/sh\n"
+ "#\n"
+ "# " + copyright_string + "\n"
+ "# mail to: " + maintainer + "\n"
+ "#\n"
+ "# Start/Stop script for KMyFirewall " + version + "\n"
+ "# This is an automatic generated file DO NOT EDIT\n"
+ "#\n"
+ "status=\"0\"\n"
+ "case $1 in\n"
+ " start)\n"
+ " /bin/sh /etc/kmyfirewall/kmyfirewall.sh start || status=\"1\"\n"
+ " ;;\n\n"
+ " stop)\n"
+ " /bin/sh /etc/kmyfirewall/kmyfirewall.sh stop || status=\"1\"\n"
+ " ;;\n\n"
+ " reload)\n"
+ " /bin/sh /etc/kmyfirewall/kmyfirewall.sh stop || status=\"1\"\n"
+ " /bin/sh /etc/kmyfirewall/kmyfirewall.sh start || status=\"1\"\n"
+ " ;;\n\n"
+ "esac\n"
+ "if [ \"$status\" = \"0\" ]; then\n"
+ " exit 0\n"
+ "else\n"
+ " exit 1\n"
+ "fi\n";
+ ts << s << endl;
+ }
+ f.flush();
+ f.close();
+ } else {
+ m_err->setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "<p>Opening file for writing <b>failed</b>."
+ "Please make sure that you are logged in as <b>root</b>." );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+ m_err->setErrType( KMFError::OK );
+ const QString& msg = "";
+ m_err->setErrMsg( msg );
+ return m_err;
+}
+
+
+void KMFIPTInstaller::writeBase64DataField( const QString& source_file_path, const QString& target_file_path, const QString& data ) {
+QStringList lines;
+ QFile source_file( source_file_path );
+ if ( source_file.open( IO_ReadOnly ) ) {
+ QTextStream stream( &source_file );
+ QString line;
+ int i = 1;
+ while ( !stream.atEnd() ) {
+ line = stream.readLine(); // line of text excluding '\n'
+ i++;
+ kdDebug() << "line.latin1(): " << line.latin1() << endl;
+ lines += line;
+ }
+ source_file.close();
+ } else {
+ m_err->setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "<p>Opening file for %1 reading <b>failed</b>." ).arg( source_file_path );
+ m_err->setErrMsg( msg );
+ }
+
+ QString corrData = data;
+ for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
+ (*it).replace( "%data%", corrData );
+ }
+
+ QFile target_file( target_file_path );
+ if ( target_file.open( IO_WriteOnly ) ) {
+ QTextStream stream( &target_file );
+ int i = 1;
+
+ for ( QStringList::Iterator it2 = lines.begin(); it2 != lines.end(); ++it2 ) {
+ stream << *it2 << "\n";
+ i++;
+ kdDebug() << "(*it2).latin1(): " << (*it2).latin1() << endl;
+ }
+ target_file.close();
+ } else {
+ m_err->setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "<p>Opening file for %1 writing <b>failed</b>." ).arg( target_file_path );
+ m_err->setErrMsg( msg );
+ }
+}
+
+void KMFIPTInstaller::parseFileHeaders( const QString& source_file_path, const QString& target_file_path ) {
+ kdDebug() << "KMFIPTInstaller::parseFileHeaders( const QString& " << source_file_path << ", const QString& " << target_file_path << " )" << endl;
+
+ QString version = KMYFIREWALL_VERSION;
+ QString copyright_string = COPYRIGHT_STRING;
+ QString maintainer = MAINTAINER;
+ QString license = LICENSE;
+
+
+ QStringList lines;
+ QFile source_file( source_file_path );
+ if ( source_file.open( IO_ReadOnly ) ) {
+ QTextStream stream( &source_file );
+ QString line;
+ int i = 1;
+ while ( !stream.atEnd() ) {
+ line = stream.readLine(); // line of text excluding '\n'
+ i++;
+ kdDebug() << "line.latin1(): " << line.latin1() << endl;
+ lines += line;
+ }
+ source_file.close();
+ } else {
+ m_err->setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "<p>Opening file for %1 reading <b>failed</b>." ).arg( source_file_path );
+ m_err->setErrMsg( msg );
+ }
+
+ for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
+ (*it).replace( "%coypright%", copyright_string );
+ (*it).replace( "%version%", version );
+ (*it).replace( "%maintainer%", maintainer );
+ (*it).replace( "%license%", license );
+ }
+
+ QFile target_file( target_file_path );
+ if ( target_file.open( IO_WriteOnly ) ) {
+ QTextStream stream( &target_file );
+ int i = 1;
+
+ for ( QStringList::Iterator it2 = lines.begin(); it2 != lines.end(); ++it2 ) {
+ stream << *it2 << "\n";
+ i++;
+ kdDebug() << "(*it2).latin1(): " << (*it2).latin1() << endl;
+ }
+ target_file.close();
+ } else {
+ m_err->setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "<p>Opening file for %1 writing <b>failed</b>." ).arg( target_file_path );
+ m_err->setErrMsg( msg );
+ }
+}
+
+void KMFIPTInstaller::generateInstallerPackage( KMFTarget* tg ) {
+ if ( rulesetDoc() ) {
+ KMFInstallerInterface *inst2 = tg->installer();
+ if ( ! inst2 )
+ return;
+
+
+ QString remDir = rulesetDoc()->target()->getFishUrl();
+ remDir.append( "/tmp/" );
+
+ QString path = remDir;
+ path.append( "kmfpackage.kmfpkg" );
+ KURL url( path );
+ KURL remDirUrl( remDir );
+
+ if ( url.fileName().isEmpty() )
+ return;
+
+ if ( KIO::NetAccess::exists( url, false, KApplication::kApplication()->mainWidget() ) ) {
+ QDateTime now = QDateTime::currentDateTime();
+
+ QString backUp;
+ backUp.append( url.url() );
+ backUp.append( "_backup_" );
+ backUp.append( now.toString( "dd.MM.yyyy.hh:mm:ss" ) );
+ KURL newUrl( backUp );
+
+
+ QString backFileName = "kmfpackage.kmfpkg";
+ backUp.append( "_backup_" );
+ backUp.append( now.toString( "dd.MM.yyyy.hh:mm:ss" ) );
+
+
+ KIO::NetAccess::file_move( url, newUrl, 700, true, true, KApplication::kApplication()->mainWidget() );
+ KIO::NetAccess::fish_execute( remDir, "chmod 400 /tmp/" + backFileName, KApplication::kApplication()->mainWidget() );
+ }
+
+ inst2->generateInstallerPackage( tg, url );
+ KIO::NetAccess::fish_execute( remDir, "chmod 700 /tmp/kmfpackage.kmfpkg", KApplication::kApplication()->mainWidget() );
+ }
+}
+
+void KMFIPTInstaller::generateInstallerPackage( KMFTarget* target, const KURL& packageURL ) {
+ kdDebug() << "generateInstallerPackage( const KURL& )" << endl;
+
+ KMFTargetConfig *conf = target->config();
+
+ KTempFile *startup_script = new KTempFile();
+ KTempFile *packageArch = new KTempFile();
+ KTempFile *fw_script = new KTempFile();
+ KTempFile *init_script_sysv = new KTempFile();
+ KTempFile *init_script_gentoo = new KTempFile();
+ KTempFile *kmf_intsall = new KTempFile();
+ KTempFile *kmf_pkg_intsall = new KTempFile();
+ KTempFile *kmf_install_package = new KTempFile();
+
+ KURL readme_url ( KGlobal::dirs() ->findResource( "appdata", "README.InstallerPackage.txt" ));
+ if ( readme_url.path().isEmpty() ) {
+ QString msg = i18n( "<p>Unable to find the package README script <b>README.InstallerPackage.txt</b>"
+ "<p>Please check your installation. Usually this file is installed in "
+ "$KDEDIR/share/apps/kmyfirewall/"
+ "<p>The package will be built without the README file." );
+ QString cap = "KMFIPTInstaller";
+ KMessageBox::error( 0, msg, cap );
+ // return;
+ }
+ kdDebug() << "found readme script: " << readme_url.path() << endl;
+
+
+ KURL kmfinstall_url ( KGlobal::dirs() ->findResource( "appdata", "scripts/installer/" + target->config()->oS() + "/kmfinstall.sh" ));
+ if ( kmfinstall_url.path().isEmpty() ) {
+ QString msg = i18n( "<p>Unable to find install script <b>kmfinstall.sh</b>"
+ "<p>Please check your installation. Usually this script is installed in "
+ "$KDEDIR/share/apps/kmyfirewall/scripts/installer/%1"
+ "<p>Unable to install the firewall without this script."
+ ).arg(target->config()->oS());
+ QString cap = "KMFIPTInstaller";
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+ kdDebug() << "found Install script: " << kmfinstall_url.path() << endl;
+
+ parseFileHeaders( kmfinstall_url.path(), kmf_intsall->name() );
+
+
+
+ KURL kmfpgkinstall_url ( KGlobal::dirs() ->findResource( "appdata", "scripts/installer/" + target->config()->oS() + "/kmfpkginstall.sh" ));
+ if ( kmfpgkinstall_url.path().isEmpty() ) {
+ QString msg = i18n( "<p>Unable to find install script <b>kmfinstall.sh</b>"
+ "<p>Please check your installation. Usually this script is installed in "
+ "$KDEDIR/share/apps/kmyfirewall/scripts/installer/%1"
+ "<p>Unable to install the firewall without this script."
+ ).arg(target->config()->oS());
+ QString cap = "KMFIPTInstaller";
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+ kdDebug() << "found PKG Install script: " << kmfpgkinstall_url.path() << endl;
+
+ parseFileHeaders( kmfpgkinstall_url.path(), kmf_pkg_intsall->name() );
+
+
+ KURL kmf_install_package_url ( KGlobal::dirs() ->findResource( "appdata", "scripts/installer/" + target->config()->oS() + "/installpackage.sh" ));
+ if ( kmf_install_package_url.path().isEmpty() ) {
+ QString msg = i18n( "<p>Unable to find install package script <b>installpackage.sh</b>"
+ "<p>Please check your installation. Usually this script is installed in "
+ "$KDEDIR/share/apps/kmyfirewall/scripts/installer/%1"
+ "<p>Unable to install the firewall without this script."
+ ).arg(target->config()->oS());
+ QString cap = "KMFIPTInstaller";
+ KMessageBox::error( 0, msg, cap );
+ return;
+ }
+ kdDebug() << "found PKG Install script: " << kmf_install_package_url.path() << endl;
+
+ parseFileHeaders( kmf_install_package_url.path(), kmf_install_package->name() );
+
+ QString systemtype;
+ if ( conf->distribution() == "gentoo" ) {
+ systemtype = "gentoo";
+ } else if( conf->distribution() == "slackware" ) {
+ systemtype = "slackware";
+ } else {
+ systemtype = "sysv";
+ }
+
+ m_err = rulesetDoc()->createFirewallScript( fw_script->name() );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ return;
+ }
+
+ m_err = createInitScript( init_script_sysv->name(), "sysv" );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ return;
+ }
+
+ m_err = createInitScript( init_script_gentoo->name(), "gentoo" );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ return;
+ }
+
+ QString version = KMYFIREWALL_VERSION;
+ QString copyright_string = COPYRIGHT_STRING;
+ QString maintainer = MAINTAINER;
+
+
+ QFile f( startup_script->name() );
+ bool gotit = f.open( IO_ReadWrite );
+ if ( gotit ) {
+ QTextStream ts( &f );
+ //Header
+ QString s;
+
+ kdDebug() << "Package install script." << endl;
+ s = "#!/bin/sh\n"
+ "#\n"
+ "# " + copyright_string + "\n"
+ "# Please report bugs to: " + maintainer + "\n"
+ "#\n"
+ "# config script for KMyFirewall " + version + " package instsll script\n"
+ "# This is an automatic generated file DO NOT EDIT\n"
+ "#\n" +
+ "# Configuration created for " + target->toFriendlyString() + "\n" +
+ "#\n"
+ "#\n\n";
+ s += "SYSTEMTYPE=" + systemtype + "\n";
+ s += "INITPATH=" + conf->initPath() + "\n";
+ s += "RCDEFAULTPATH=" + conf->rcDefaultPath() + "\n"
+ "INITSCRIPT=data/init_sysv.sh\n"
+ "if [ \"$SYSTEMTYPE\" == \"gentoo\" ]; then\n"
+ " INITSCRIPT=data/init_gentoo.sh\n"
+ "fi\n";
+ ts << s << endl;
+
+ f.flush();
+ f.close();
+ } else {
+ m_err->setErrType( KMFError::NORMAL );
+ const QString& msg = i18n( "<p>Opening file for writing <b>failed</b>."
+ "Please make sure that you are logged in as <b>root</b>." );
+ m_err->setErrMsg( msg );
+ m_err_handler->showError( m_err );
+ kdWarning() << "!!! Opening file for writing failed !!!" << endl;
+ return;
+ }
+
+ KTar *package = new KTar( packageArch->name(), "application/x-gzip" );
+ package->open( IO_WriteOnly );
+
+ package->addLocalFile( readme_url.path(), "README.txt" );
+ kdDebug() << "Wrote tar file: README.txt" << endl;
+
+ package->addLocalFile( startup_script->name(), "install.config" );
+ kdDebug() << "Wrote tar file: install.config" << endl;
+
+ package->addLocalFile( kmf_pkg_intsall->name(), "install.sh" );
+ kdDebug() << "Wrote tar file: install.sh" << endl;
+
+ package->addLocalFile( kmf_intsall->name(), "data/kmfinstall.sh" );
+ kdDebug() << "Wrote tar file: kmfinstall.sh" << endl;
+
+ package->addLocalFile( init_script_sysv->name(), "data/init_sysv.sh" );
+ kdDebug() << "Wrote tar file: data/init_sysv.sh" << endl;
+
+ package->addLocalFile( init_script_gentoo->name(), "data/init_gentoo.sh" );
+ kdDebug() << "Wrote tar file: data/init_gentoo.sh" << endl;
+
+ package->addLocalFile( fw_script->name(), "data/kmyfirewall.sh" );
+ kdDebug() << "Wrote tar file: data/kmyfirewall.sh" << endl;
+ package->close();
+
+ QFile fPackage( packageArch->name() );
+ if ( fPackage.open( IO_ReadOnly ) ) {
+ QByteArray b = fPackage.readAll();
+ QString rawData = KCodecs::base64Encode( b, false );
+ rawData = rawData.replace( '\n', ' ' );
+ QString data;
+ int len = rawData.length();
+ int currPos = 0;
+ bool doit = true;
+
+ while( doit ) {
+ int lineLen = 76;
+ if ( ( len - currPos ) < lineLen ) {
+ lineLen = len - currPos;
+ doit = false;
+ }
+ kdDebug() << "Appending : " << rawData.mid( currPos, lineLen ) << endl;
+ data.append( rawData.mid( currPos, lineLen ) );
+ data.append( " " );
+ currPos += lineLen;
+ }
+
+
+ kdDebug() << "Encoded package: " << data << endl;
+ writeBase64DataField( kmf_install_package->name(), kmf_install_package->name(), data );
+ }
+
+
+
+
+
+ // KIO::NetAccess::upload( packageArch->name(), packageURL, KApplication::kApplication()->mainWidget() );
+ KIO::NetAccess::upload( kmf_install_package->name(), packageURL, KApplication::kApplication()->mainWidget() );
+
+ kdDebug() << "Wrote package: " << packageURL.prettyURL() << endl;
+
+ startup_script->close();
+ packageArch->close();
+ fw_script->close();
+ init_script_sysv->close();
+ init_script_gentoo->close();
+ kmf_intsall->close();
+ kmf_pkg_intsall->close();
+ kmf_install_package->close();
+
+ startup_script->unlink();
+ packageArch->unlink();
+ fw_script->unlink();
+ init_script_sysv->unlink();
+ init_script_gentoo->unlink();
+ kmf_intsall->unlink();
+ kmf_pkg_intsall->unlink();
+ kmf_install_package->unlink();
+}
+
+void KMFIPTInstaller::loadIcons() {
+ kdDebug() << "void KMFIPTInstaller::loadIcons()" << endl;
+ KIconLoader *loader = KGlobal:: iconLoader();
+ QString icon_name;
+ icon_name = "encrypted";
+ icon_run = loader->loadIcon( icon_name, KIcon::Toolbar );
+
+ icon_name = "decrypted";
+ icon_stop = loader->loadIcon( icon_name, KIcon::Toolbar );
+
+ icon_name = "openterm";
+ icon_show = loader->loadIcon( icon_name, KIcon::Toolbar );
+}
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFIPTablesCompilerFactory::s_instance = 0L;
+// KAboutData* KMFIPTablesCompilerFactory::s_about = 0L;
+
+KMFIPTInstallerFactory::KMFIPTInstallerFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFIPTablesCompilerFactory" );
+}
+
+QObject* KMFIPTInstallerFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFIPTInstaller( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFIPTablesCompilerFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFIPTablesCompilerFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfinstaller_linux() {
+ return new KMFIPTInstallerFactory;
+ }
+}
+
+}
+#include "kmfiptinstaller.moc"
diff --git a/kmyfirewall/installer/linux/kmfiptinstaller.h b/kmyfirewall/installer/linux/kmfiptinstaller.h
new file mode 100644
index 0000000..582bc5e
--- /dev/null
+++ b/kmyfirewall/installer/linux/kmfiptinstaller.h
@@ -0,0 +1,137 @@
+/***************************************************************************
+ begin : Mon Jan 28 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef KMFIPTINSTALLER_H
+#define KMFIPTINSTALLER_H
+#include <qobject.h>
+#include <qpixmap.h>
+#include <qstringlist.h>
+
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+
+
+#include "../../core/kmfplugin.h"
+#include "../../core/kmfinstallerinterface.h"
+
+#include "../../kmyfirewall.h"
+class QString;
+class QStringList;
+class QLabel;
+class QPushButton;
+class QGridLayout;
+class KTempFile;
+class KInstance;
+
+
+namespace KMF {
+class KMFProcOut;
+class KMFError;
+class KMFTarget;
+class KMFErrorHandler;
+class KMFCompilerInterface;
+
+class KMFIPTInstaller : public KMFPlugin, public KMFInstallerInterface {
+ Q_OBJECT
+
+public:
+ KMFIPTInstaller( QObject* parent = 0, const char* name = 0 );
+ ~KMFIPTInstaller();
+ virtual void loadScript( const QString& );
+ virtual KMFCompilerInterface* compiler();
+ virtual void cmdRunFW();
+ virtual void cmdStopFW();
+ virtual void cmdInstallFW();
+ virtual void cmdUninstallFW();
+ virtual void cmdShowRunningConfig( const QString& );
+ virtual void generateInstallerPackage( KMFTarget*, const KURL& );
+ virtual const QString& osName() const {
+ return m_osName;
+ }
+ virtual const QString& osGUIName() const {
+ return m_osGUIName;
+ }
+ virtual QValueList<KMFCompilerInterface*>* compilers();
+
+ void generateInstallerPackage( KMFTarget* tg );
+
+
+public slots:
+ void slotCloseWindow();
+ void slotJobFinished( bool, const QString& );
+
+private:
+ void loadIcons();
+ KMFProcOut* execWidget();
+ KMFError* createInitScript( const QString& file, const QString& systemtype );
+
+ QString cmdShowAll();
+ QString cmdShowFilter();
+ QString cmdShowNat();
+ QString cmdShowMangle();
+
+ void parseFileHeaders( const QString& source_file_path, const QString& target_file_path );
+ void writeBase64DataField( const QString& source_file_path, const QString& target_file_path, const QString& data );
+
+
+private: // data
+ QString m_script;
+ QString m_osName;
+ QString m_osGUIName;
+
+ bool fw_is_running;
+ QLabel *m_lrun;
+ QLabel *m_lshow;
+ QLabel *m_lconf;
+ QLabel *m_linstall;
+ QPushButton *m_brun_fw;
+ QPushButton *m_bstop_fw;
+ QPushButton *m_bshow_sript;
+ QPushButton *m_bshow_all;
+ QPushButton *m_bshow_filter;
+ QPushButton *m_bshow_nat;
+ QPushButton *m_bshow_mangle;
+ QPushButton *m_binstall;
+ QPushButton *m_buninstall;
+ QPushButton *m_bclose;
+ QGridLayout *m_layout;
+ QPixmap icon_run, icon_stop, icon_show;
+ KMFError *m_err;
+ KMFErrorHandler *m_err_handler;
+ KTempFile *temp_file, *temp_file2;
+ KMFProcOut *m_execWidget;
+signals:
+ void sigStatusChanged();
+ void sigHideMe();
+ void sigShowMe();
+};
+
+
+
+
+class KMFIPTInstallerFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFIPTInstallerFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFIPTInstallerFactory() {};
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+};
+}
+
+#endif // KMFIPTINSTALLER_H
diff --git a/kmyfirewall/installer/linux/kmfpkginstall.sh b/kmyfirewall/installer/linux/kmfpkginstall.sh
new file mode 100644
index 0000000..901b750
--- /dev/null
+++ b/kmyfirewall/installer/linux/kmfpkginstall.sh
@@ -0,0 +1,195 @@
+#!/bin/sh
+#
+# %coypright%
+#
+# Please report bugs to: %maintainer%
+#
+# %license%
+#
+# Installer script for KMyFirewall %version%
+# This is an automatic generated file DO NOT EDIT
+#
+
+readSetting() {
+# echo "Reading config..."
+ source ./install.config
+}
+
+INERACTIVE="1"
+
+install() {
+ ans="y"
+ echo "Do you want to install this firewall configuration"
+ echo "to be started whenever you boot this computer? [Y/n]"
+
+ if [ "$INERACTIVE" = "1" ]; then
+ read newans
+ fi
+
+ if [ "$newans" = "n" ]; then
+ ans=$newans
+ fi
+
+ if [ "$ans" = "y" ]; then
+ /bin/sh data/kmfinstall.sh install ${SYSTEMTYPE} ${INITPATH} ${RCDEFAULTPATH} ${INITSCRIPT} data/kmyfirewall.sh
+ else
+ echo "Installation aborted!"
+ echo
+ exit 1
+ fi
+}
+
+uninstall() {
+ ans="y"
+ echo "Do you really want to uninstall the KMyFirewall configuration"
+ echo "form this computer? [Y/n]"
+
+ if [ "$INERACTIVE" = "1" ]; then
+ read newans
+ fi
+
+ if [ "$newans" = "n" ]; then
+ ans=$newans
+ fi
+
+ if [ "$ans" = "y" ]; then
+ /bin/sh data/kmfinstall.sh uninstall ${SYSTEMTYPE} ${INITPATH} ${RCDEFAULTPATH}
+ else
+ echo "Uninstallation aborted!"
+ echo
+ exit 1
+
+ fi
+}
+
+askRun() {
+ ans="y"
+
+ echo "Run the script? [Y/n]"
+ if [ "$INERACTIVE" = "1" ]; then
+ read newans
+ fi
+
+ if [ "$newans" = "n" ]; then
+ ans=$newans
+ fi
+
+ if [ "$ans" = "y" ]; then
+ run
+ else
+ echo
+ echo "!!! YOUR SYSTEM STAYS UNPROTECTED !!!"
+ echo
+ echo "You need to manualy start the firewall after intsllation"
+ echo "to appy the configurtion you have installed."
+ echo
+ echo "Run: '${INITPATH}/kmyfirewall start' to start the firewall"
+ fi
+}
+
+run() {
+ ${INITPATH}/kmyfirewall start
+}
+
+askStop() {
+ ans="n"
+ echo "Flush all rules? [y/N]"
+ if [ "$INERACTIVE" = "1" ]; then
+ read ans
+ else
+ ans="y"
+ fi
+
+ if [ "$ans" = "y" ]; then
+ stop
+ fi
+}
+
+
+stop() {
+ if [ -e "${INITPATH}/kmyfirewall" ]; then
+ ${INITPATH}/kmyfirewall stop
+ elif [ -e "/tmp/kmyfirewall.d/data/kmyfirewall.sh" ]; then
+ /bin/sh /tmp/kmyfirewall.d/data/kmyfirewall.sh -v stop
+ fi
+
+ echo
+ echo "!!! YOU SYSTEM IS NOW UNPROTECTED !!!"
+ echo
+}
+
+printHello() {
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "KMyFirewall Package Installer v%version%"
+ echo "Please report bugs to: %maintainer%"
+ echo
+ fi
+}
+printHelp() {
+ echo "Usage: install.sh [-q] { --install | --uninstall | --reinstall | --help }"
+ echo
+ echo "Switches:"
+ echo " -q"
+ echo " No not require any user interaction"
+ echo
+ echo "Options:"
+ echo " install|--install|-i"
+ echo " Install the configuration."
+ echo " The installed firewall scrip will be automaticaly run at system boot."
+ echo
+ echo " uninstall|--uninstall|-u"
+ echo " Uninstall the configuration form the system."
+ echo
+ echo " reinstall|--reinstall|-r"
+ echo " Re-Installs the configuration e.g. the same as install.sh uninstall"
+ echo " followed by install.sh install"
+ echo
+ echo " help|--help|-h"
+ echo " Print this help message"
+ echo
+}
+
+#
+# Execution starts here
+#
+
+readSetting
+
+
+COMMAND=$1
+
+if [ "$COMMAND" = "-q" ]; then
+ COMMAND=$2
+ INERACTIVE="0";
+fi
+
+printHello
+
+case $COMMAND in
+ install|--install|-i)
+ install
+ askRun
+ ;;
+
+ uninstall|--uninstall|-u)
+ askStop
+ uninstall
+ ;;
+
+ reinstall|--reinstall|--r)
+ askStop
+ uninstall
+ install
+ askRun
+ ;;
+
+ help|--help|-h)
+ printHelp
+ ;;
+
+ *)
+ install
+ askRun
+ ;;
+esac
+
diff --git a/kmyfirewall/installer/openbsd/Makefile b/kmyfirewall/installer/openbsd/Makefile
new file mode 100644
index 0000000..e060a45
--- /dev/null
+++ b/kmyfirewall/installer/openbsd/Makefile
@@ -0,0 +1,822 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 483858 $
+# kmyfirewall/installer/openbsd/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+
+
+srcdir = .
+top_srcdir = ../../..
+
+pkgdatadir = $(datadir)/kmyfirewall-1.1.1
+pkglibdir = $(libdir)/kmyfirewall-1.1.1
+pkgincludedir = $(includedir)/kmyfirewall-1.1.1
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = /usr/bin/install -c -p
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i486-pc-linux-gnu
+host_triplet = i486-pc-linux-gnu
+target_triplet = i486-pc-linux-gnu
+subdir = kmyfirewall/installer/openbsd
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(kde_moduledir)" \
+ "$(DESTDIR)$(partdesktopdir)" "$(DESTDIR)$(scriptdir)"
+kde_moduleLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(kde_module_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libkmfinstaller_openbsd_la_DEPENDENCIES = \
+ ../../kmfwidgets/libkmfwidgets.la ../../core/libkmfcore.la \
+ $(am__DEPENDENCIES_1)
+am_libkmfinstaller_openbsd_la_OBJECTS = kmfpfinstaller.lo
+#>- libkmfinstaller_openbsd_la_OBJECTS = \
+#>- $(am_libkmfinstaller_openbsd_la_OBJECTS)
+#>+ 5
+libkmfinstaller_openbsd_la_final_OBJECTS = libkmfinstaller_openbsd_la.all_cpp.lo
+libkmfinstaller_openbsd_la_nofinal_OBJECTS = kmfpfinstaller.lo\
+kmfpfinstaller.moc.lo
+libkmfinstaller_openbsd_la_OBJECTS = $(libkmfinstaller_openbsd_la_nofinal_OBJECTS)
+#libkmfinstaller_openbsd_la_OBJECTS = $(libkmfinstaller_openbsd_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+#>- $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+#>+ 2
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libkmfinstaller_openbsd_la_SOURCES)
+DIST_SOURCES = $(libkmfinstaller_openbsd_la_SOURCES)
+partdesktopDATA_INSTALL = $(INSTALL_DATA)
+scriptDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(partdesktop_DATA) $(script_DATA)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = ${SHELL} /home/agi/debian/kmyfirewall/kmyfirewall-1.1.1/admin/missing --run aclocal-1.9
+AMDEP_FALSE = #
+AMDEP_TRUE =
+AMTAR = ${SHELL} /home/agi/debian/kmyfirewall/kmyfirewall-1.1.1/admin/missing --run tar
+AR = ar
+ARTSCCONFIG = /usr/bin/artsc-config
+AUTOCONF = $(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure
+AUTODIRS =
+AUTOHEADER = ${SHELL} /home/agi/debian/kmyfirewall/kmyfirewall-1.1.1/admin/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/agi/debian/kmyfirewall/kmyfirewall-1.1.1/admin/missing --run automake-1.9
+AWK = gawk
+CC = i486-linux-gnu-gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DNDEBUG -O2 -Wall -g -O2 -Wformat-security -Wmissing-format-attribute
+CONF_FILES = $(top_srcdir)/./admin/configure.in.min $(top_srcdir)/configure.in.in
+CPP = i486-linux-gnu-gcc -E
+CPPFLAGS = -DQT_THREAD_SUPPORT -D_REENTRANT
+CXX = i486-linux-gnu-g++
+CXXCPP = i486-linux-gnu-g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common
+CYGPATH_W = echo
+DCOPIDL = /usr/bin/dcopidl
+DCOPIDL2CPP = /usr/bin/dcopidl2cpp
+DCOPIDLNG = /usr/bin/dcopidlng
+DCOP_DEPENDENCIES = $(DCOPIDL) $(DCOPIDLNG)
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+ECHO = echo
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /bin/grep -E
+ENABLE_PERMISSIVE_FLAG = -fpermissive
+EXEEXT =
+F77 =
+FFLAGS =
+FRAMEWORK_COREAUDIO =
+GMSGFMT = /usr/bin/msgfmt
+GREP = /bin/grep
+HAVE_GCC_VISIBILITY = 0
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL} $(INSTALL_STRIP_FLAG)
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
+KCFG_DEPENDENCIES = $(KCONFIG_COMPILER)
+KCONFIG_COMPILER = /usr/bin/kconfig_compiler
+KDECONFIG = /usr/bin/kde-config
+KDE_CHECK_PLUGIN = $(KDE_PLUGIN) -rpath $(libdir)
+KDE_EXTRA_RPATH =
+KDE_INCLUDES = -I/usr/include/kde
+KDE_LDFLAGS = -L/usr/lib
+KDE_MT_LDFLAGS =
+KDE_MT_LIBS = -lpthread
+KDE_NO_UNDEFINED = -Wl,--no-undefined -Wl,--allow-shlib-undefined
+KDE_PLUGIN = -avoid-version -module -no-undefined $(KDE_NO_UNDEFINED) $(KDE_RPATH) $(KDE_MT_LDFLAGS)
+KDE_RPATH =
+KDE_USE_CLOSURE_FALSE =
+KDE_USE_CLOSURE_TRUE = #
+KDE_USE_FINAL_FALSE =
+KDE_USE_FINAL_TRUE = #
+KDE_USE_FPIE = -fPIE
+KDE_USE_NMCHECK_FALSE =
+KDE_USE_NMCHECK_TRUE = #
+KDE_USE_PIE = -pie
+KDE_XSL_STYLESHEET = /usr/share/apps/ksgmltools2/customization/kde-chunk.xsl
+LDFLAGS =
+LDFLAGS_AS_NEEDED =
+LDFLAGS_NEW_DTAGS =
+LIBCOMPAT =
+LIBCRYPT = -lcrypt
+LIBDL = -ldl
+LIBJPEG = -ljpeg
+LIBOBJS =
+LIBPNG = -lpng -lz -lm
+LIBPTHREAD = -lpthread
+LIBRESOLV = -lresolv
+LIBS =
+LIBSM = -lSM -lICE
+LIBSOCKET =
+LIBTOOL = $(SHELL) $(top_builddir)/libtool --silent
+LIBUCB =
+LIBUTIL = -lutil
+LIBZ = -lz
+LIB_KAB = -lkab
+LIB_KABC = -lkabc
+LIB_KDECORE = -lkdecore
+LIB_KDED =
+LIB_KDEPIM = -lkdepim
+LIB_KDEPRINT = -lkdeprint
+LIB_KDEUI = -lkdeui
+LIB_KDNSSD = -lkdnssd
+LIB_KFILE = -lkio
+LIB_KFM =
+LIB_KHTML = -lkhtml
+LIB_KIMPROXY = -lkimproxy
+LIB_KIO = -lkio
+LIB_KJS = -lkjs
+LIB_KNEWSTUFF = -lknewstuff
+LIB_KPARTS = -lkparts
+LIB_KSPELL = -lkspell
+LIB_KSYCOCA = -lkio
+LIB_KUNITTEST = -lkunittest
+LIB_KUTILS = -lkutils
+LIB_POLL =
+LIB_QPE =
+LIB_QT = -lqt-mt $(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) -lpthread
+LIB_SMB = -lsmb
+LIB_X11 = -lX11 $(LIBSOCKET)
+LIB_XEXT = -lXext
+LIB_XRENDER =
+LN_S = ln -s
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /home/agi/debian/kmyfirewall/kmyfirewall-1.1.1/admin/missing --run makeinfo
+MAKEKDEWIDGETS =
+MCOPIDL = /usr/bin/mcopidl
+MEINPROC = /usr/bin/meinproc
+MOC = /usr/share/qt3/bin/moc
+MSGFMT = /usr/bin/msgfmt
+NOOPT_CFLAGS = -O0
+NOOPT_CXXFLAGS = -O0
+OBJEXT = o
+PACKAGE = kmyfirewall-1.1.1
+PACKAGE_BUGREPORT =
+PACKAGE_NAME =
+PACKAGE_STRING =
+PACKAGE_TARNAME =
+PACKAGE_VERSION =
+PATH_SEPARATOR = :
+PERL = /usr/bin/perl
+QTE_NORTTI =
+QT_INCLUDES = -I/usr/share/qt3/include
+QT_LDFLAGS = -L/usr/share/qt3/lib
+RANLIB = ranlib
+SET_MAKE =
+SHELL = /bin/sh
+STRIP = strip
+TOPSUBDIRS = KMFIPTInterface KMFSysTray doc kmyfirewall pics templates
+UIC = /usr/share/qt3/bin/uic -L $(kde_widgetdir) -nounload
+UIC_TR = tr2i18n
+USER_INCLUDES =
+USER_LDFLAGS =
+USE_EXCEPTIONS = -fexceptions
+USE_RTTI =
+USE_THREADS =
+VERSION = 3.5.6
+WOVERLOADED_VIRTUAL =
+XGETTEXT = /usr/bin/xgettext
+XMKMF =
+XMLLINT = /usr/bin/xmllint
+X_EXTRA_LIBS =
+X_INCLUDES = -I.
+X_LDFLAGS =
+X_PRE_LIBS =
+X_RPATH =
+ac_ct_CC =
+ac_ct_CXX =
+ac_ct_F77 =
+all_includes = -I/usr/include/kde -I/usr/share/qt3/include -I.
+all_libraries = -L/usr/share/qt3/lib
+am__fastdepCC_FALSE = #
+am__fastdepCC_TRUE =
+am__fastdepCXX_FALSE = #
+am__fastdepCXX_TRUE =
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = ${exec_prefix}/bin
+build = i486-pc-linux-gnu
+build_alias = i486-linux-gnu
+build_cpu = i486
+build_os = linux-gnu
+build_vendor = pc
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = i486-pc-linux-gnu
+host_alias = i486-linux-gnu
+host_cpu = i486
+host_os = linux-gnu
+host_vendor = pc
+htmldir = ${docdir}
+include_ARTS_FALSE = #
+include_ARTS_TRUE =
+include_x11_FALSE = #
+include_x11_TRUE =
+includedir = /usr/include/kde
+infodir = /usr/share/info
+install_sh = /home/agi/debian/kmyfirewall/kmyfirewall-1.1.1/admin/install-sh
+kde_appsdir = ${datadir}/applnk
+kde_bindir = ${exec_prefix}/bin
+kde_confdir = /etc/kde3
+kde_datadir = ${datadir}/apps
+kde_htmldir = /usr/share/doc/kde/HTML
+kde_icondir = ${datadir}/icons
+kde_includes = /usr/include/kde
+kde_kcfgdir = ${datadir}/config.kcfg
+kde_libraries = /usr/lib
+kde_libs_htmldir = /usr/share/doc/kde/HTML
+kde_libs_prefix = /usr
+kde_locale = ${datadir}/locale
+kde_mimedir = ${datadir}/mimelnk
+kde_moduledir = ${libdir}/kde3
+kde_qtver = 3
+kde_servicesdir = ${datadir}/services
+kde_servicetypesdir = ${datadir}/servicetypes
+kde_sounddir = ${datadir}/sounds
+kde_styledir = ${libdir}/kde3/plugins/styles
+kde_templatesdir = ${datadir}/templates
+kde_wallpaperdir = ${datadir}/wallpapers
+kde_widgetdir = /usr/lib/kde3/plugins/designer
+kdeinitdir = $(kde_moduledir)
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = /usr/share/man
+mkdir_p = mkdir -p --
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr
+program_transform_name = s,x,x,
+psdir = ${docdir}
+qt_includes = /usr/share/qt3/include
+qt_libraries = /usr/share/qt3/lib
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+sysconfdir = /etc
+target = i486-pc-linux-gnu
+target_alias =
+target_cpu = i486
+target_os = linux-gnu
+target_vendor = pc
+unsermake_enable_pch_FALSE =
+unsermake_enable_pch_TRUE = #
+x_includes = .
+x_libraries = /usr/lib
+xdg_appsdir = ${datadir}/applications/kde
+xdg_directorydir = ${datadir}/desktop-directories
+xdg_menudir = ${sysconfdir}/xdg/menus
+INCLUDES = $(all_includes) -I../../core -I../../kmfwidgets -I../../libkmfplugins
+#>- METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfinstaller_openbsd.la
+#>- libkmfinstaller_openbsd_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) \
+#>- $(all_libraries)
+#>+ 2
+libkmfinstaller_openbsd_la_LDFLAGS = -module -no-undefined $(KDE_NO_UNDEFINED) $(KDE_PLUGIN) \
+ $(all_libraries)
+
+libkmfinstaller_openbsd_la_SOURCES = kmfpfinstaller.cpp
+libkmfinstaller_openbsd_la_LIBADD = \
+ ../../kmfwidgets/libkmfwidgets.la ../../core/libkmfcore.la $(LIB_KPARTS)
+
+noinst_HEADERS = kmfpfinstaller.h
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfinstaller_openbsd.desktop
+
+# Install script
+scriptdir = $(kde_datadir)/kmyfirewall/scripts/installer/openbsd
+script_DATA = autoconfighelper.sh
+#>- all: all-am
+#>+ 1
+all: docs-am all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+#>- @for dep in $?; do \
+#>- case '$(am__configure_deps)' in \
+#>- *$$dep*) \
+#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+#>- && exit 0; \
+#>- exit 1;; \
+#>- esac; \
+#>- done; \
+#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu kmyfirewall/installer/openbsd/Makefile'; \
+#>- cd $(top_srcdir) && \
+#>- $(AUTOMAKE) --gnu kmyfirewall/installer/openbsd/Makefile
+#>+ 12
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu kmyfirewall/installer/openbsd/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu kmyfirewall/installer/openbsd/Makefile
+ cd $(top_srcdir) && perl admin/am_edit kmyfirewall/installer/openbsd/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-kde_moduleLTLIBRARIES: $(kde_module_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(kde_moduledir)" || $(mkdir_p) "$(DESTDIR)$(kde_moduledir)"
+ @list='$(kde_module_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(kde_moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(kde_moduledir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(kde_moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(kde_moduledir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-kde_moduleLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(kde_module_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(kde_moduledir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(kde_moduledir)/$$p"; \
+ done
+
+clean-kde_moduleLTLIBRARIES:
+ -test -z "$(kde_module_LTLIBRARIES)" || rm -f $(kde_module_LTLIBRARIES)
+ @list='$(kde_module_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+#>- libkmfinstaller_openbsd.la: $(libkmfinstaller_openbsd_la_OBJECTS) $(libkmfinstaller_openbsd_la_DEPENDENCIES)
+#>+ 2
+#libkmfinstaller_openbsd.la: libkmfinstaller_openbsd.la.closure $(libkmfinstaller_openbsd_la_OBJECTS) $(libkmfinstaller_openbsd_la_DEPENDENCIES)
+libkmfinstaller_openbsd.la: $(libkmfinstaller_openbsd_la_OBJECTS) $(libkmfinstaller_openbsd_la_DEPENDENCIES)
+ $(CXXLINK) -rpath $(kde_moduledir) $(libkmfinstaller_openbsd_la_LDFLAGS) $(libkmfinstaller_openbsd_la_OBJECTS) $(libkmfinstaller_openbsd_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+include ./$(DEPDIR)/kmfpfinstaller.Plo
+
+.cpp.o:
+ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+# source='$<' object='$@' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-partdesktopDATA: $(partdesktop_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(partdesktopdir)" || $(mkdir_p) "$(DESTDIR)$(partdesktopdir)"
+ @list='$(partdesktop_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(partdesktopDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(partdesktopdir)/$$f'"; \
+ $(partdesktopDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(partdesktopdir)/$$f"; \
+ done
+
+uninstall-partdesktopDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(partdesktop_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(partdesktopdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(partdesktopdir)/$$f"; \
+ done
+install-scriptDATA: $(script_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(scriptdir)" || $(mkdir_p) "$(DESTDIR)$(scriptdir)"
+ @list='$(script_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(scriptDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(scriptdir)/$$f'"; \
+ $(scriptDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(scriptdir)/$$f"; \
+ done
+
+uninstall-scriptDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(script_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(scriptdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(scriptdir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(kde_moduledir)" "$(DESTDIR)$(partdesktopdir)" "$(DESTDIR)$(scriptdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean clean-am
+
+#>- clean-am: clean-generic clean-kde_moduleLTLIBRARIES clean-libtool \
+#>- mostlyclean-am
+#>+ 2
+clean-am: clean-metasources clean-closures clean-bcheck clean-final clean-generic clean-kde_moduleLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+#>- install-data-am: install-kde_moduleLTLIBRARIES install-partdesktopDATA \
+#>- install-scriptDATA
+#>+ 2
+install-data-am: install-partdesktopDATA \
+ install-scriptDATA
+
+#>- install-exec-am:
+#>+ 1
+install-exec-am: install-kde_moduleLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-kde_moduleLTLIBRARIES \
+ uninstall-partdesktopDATA uninstall-scriptDATA
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-kde_moduleLTLIBRARIES clean-libtool ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am \
+ install-kde_moduleLTLIBRARIES install-man \
+ install-partdesktopDATA install-scriptDATA install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am \
+ uninstall-kde_moduleLTLIBRARIES uninstall-partdesktopDATA \
+ uninstall-scriptDATA
+
+ # kmfinstall.sh kmfpkginstall.sh installpackage.sh
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 8
+libkmfinstaller_openbsd.la.closure: $(libkmfinstaller_openbsd_la_OBJECTS) $(libkmfinstaller_openbsd_la_DEPENDENCIES)
+ @echo "int main() {return 0;}" > libkmfinstaller_openbsd_la_closure.cpp
+ @$(LTCXXCOMPILE) -c libkmfinstaller_openbsd_la_closure.cpp
+ $(CXXLINK) libkmfinstaller_openbsd_la_closure.lo $(libkmfinstaller_openbsd_la_LDFLAGS) $(libkmfinstaller_openbsd_la_OBJECTS) $(libkmfinstaller_openbsd_la_LIBADD) $(LIBS)
+ @rm -f libkmfinstaller_openbsd_la_closure.* libkmfinstaller_openbsd.la.closure
+ @echo "timestamp" > libkmfinstaller_openbsd.la.closure
+
+
+#>+ 3
+kmfpfinstaller.moc.cpp: $(srcdir)/kmfpfinstaller.h
+ $(MOC) $(srcdir)/kmfpfinstaller.h -o kmfpfinstaller.moc.cpp
+
+#>+ 2
+mocs: kmfpfinstaller.moc.cpp
+
+#>+ 3
+clean-metasources:
+ -rm -f kmfpfinstaller.moc.cpp
+
+#>+ 2
+KDE_DIST=kmfinstaller_openbsd.desktop Makefile.in autoconfighelper.sh Makefile.am
+
+#>+ 3
+clean-closures:
+ -rm -f libkmfinstaller_openbsd.la.closure
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu kmyfirewall/installer/openbsd/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu kmyfirewall/installer/openbsd/Makefile
+ cd $(top_srcdir) && perl admin/am_edit kmyfirewall/installer/openbsd/Makefile.in
+
+
+#>+ 21
+clean-bcheck:
+ rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+ @for i in ; do \
+ if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+ echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+ echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+ echo "$$i"; \
+ if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+ rm -f $$i.bchecktest.cc; exit 1; \
+ fi ; \
+ echo "" >> $$i.bchecktest.cc.class; \
+ perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+ rm -f a.out; \
+ fi ; \
+ done
+
+
+#>+ 11
+libkmfinstaller_openbsd_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/kmfpfinstaller.cpp kmfpfinstaller.moc.cpp
+ @echo 'creating libkmfinstaller_openbsd_la.all_cpp.cpp ...'; \
+ rm -f libkmfinstaller_openbsd_la.all_cpp.files libkmfinstaller_openbsd_la.all_cpp.final; \
+ echo "#define KDE_USE_FINAL 1" >> libkmfinstaller_openbsd_la.all_cpp.final; \
+ for file in kmfpfinstaller.cpp kmfpfinstaller.moc.cpp ; do \
+ echo "#include \"$$file\"" >> libkmfinstaller_openbsd_la.all_cpp.files; \
+ test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libkmfinstaller_openbsd_la.all_cpp.final; \
+ done; \
+ cat libkmfinstaller_openbsd_la.all_cpp.final libkmfinstaller_openbsd_la.all_cpp.files > libkmfinstaller_openbsd_la.all_cpp.cpp; \
+ rm -f libkmfinstaller_openbsd_la.all_cpp.final libkmfinstaller_openbsd_la.all_cpp.files
+
+#>+ 3
+clean-final:
+ -rm -f libkmfinstaller_openbsd_la.all_cpp.cpp
+
+#>+ 3
+final:
+ $(MAKE) libkmfinstaller_openbsd_la_OBJECTS="$(libkmfinstaller_openbsd_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+ $(MAKE) libkmfinstaller_openbsd_la_OBJECTS="$(libkmfinstaller_openbsd_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+ $(MAKE) libkmfinstaller_openbsd_la_OBJECTS="$(libkmfinstaller_openbsd_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+ $(MAKE) libkmfinstaller_openbsd_la_OBJECTS="$(libkmfinstaller_openbsd_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+ -rm -f *.rpo
+
+#>+ 3
+nmcheck:
+nmcheck-am: nmcheck
diff --git a/kmyfirewall/installer/openbsd/Makefile.am b/kmyfirewall/installer/openbsd/Makefile.am
new file mode 100644
index 0000000..ac43767
--- /dev/null
+++ b/kmyfirewall/installer/openbsd/Makefile.am
@@ -0,0 +1,18 @@
+INCLUDES = $(all_includes) -I../../core -I../../kmfwidgets -I../../libkmfplugins
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfinstaller_openbsd.la
+libkmfinstaller_openbsd_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) \
+ $(all_libraries)
+libkmfinstaller_openbsd_la_SOURCES = kmfpfinstaller.cpp
+libkmfinstaller_openbsd_la_LIBADD = \
+ ../../kmfwidgets/libkmfwidgets.la ../../core/libkmfcore.la $(LIB_KPARTS)
+
+noinst_HEADERS = kmfpfinstaller.h
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfinstaller_openbsd.desktop
+
+# Install script
+scriptdir = $(kde_datadir)/kmyfirewall/scripts/installer/openbsd
+script_DATA = autoconfighelper.sh
+ # kmfinstall.sh kmfpkginstall.sh installpackage.sh
diff --git a/kmyfirewall/installer/openbsd/autoconfighelper.sh b/kmyfirewall/installer/openbsd/autoconfighelper.sh
new file mode 100644
index 0000000..b9d0f1e
--- /dev/null
+++ b/kmyfirewall/installer/openbsd/autoconfighelper.sh
@@ -0,0 +1,205 @@
+#!/bin/sh
+#
+# %coypright%
+#
+# Please report bugs to: %maintainer%
+#
+# %license%
+#
+# Configuration guessing script for KMyFirewall %version%
+# This is an automatic generated file DO NOT EDIT
+#
+# Exaple output
+# <targetconfig name="Untitled" description="No Description Available" >
+# <interface name="eth0" />
+# <interface name="lo" />
+# <os name="linux" />
+# <backend name="iptables" />
+# <distribution name="sysv" />
+# <initPath name="/etc/init.d" />
+# <IPTPath name="/sbin/iptables" />
+# <modprobePath name="/sbin/modprobe" />
+# <rcDefaultPath name="/etc/rc2.d" />
+# </targetconfig>
+#
+
+REQUIREDOS="OpenBSD"
+REQUIREDTOOLS="ifconfig grep sort cut"
+INERACTIVE="0"
+XMLCONFIG=""
+
+
+
+checkRequirements() {
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "Checking system requirements"
+ fi
+
+ OS=`uname`
+ if [ "$OS" != "$REQUIREDOS" ]; then
+
+ echo
+ echo "ERROR: Wrong OS: $OS"
+ echo "ERROR: This scripts is written for $REQUIREDOS"
+ echo
+ exit 1
+ fi
+
+ for PROG in $REQUIREDTOOLS; do
+ if [ "$INERACTIVE" = "1" ]; then
+ echo -n "Checking for $PROG...\t\t "
+ fi
+ PROGPATH=""
+ PROGNAME="which"
+ SEARCH="/bin /sbin /usr/bin /usr/sbin"
+ for s in $SEARCH; do
+ if [ -e "$s/$PROGNAME" ]; then
+ PROGPATH="$s/$PROGNAME";
+ fi
+ done
+
+ if [ "$PROGPATH" != "" ]; then
+ PROGPATH=`which $PROG`
+ if [ "$?" != "0" ]; then
+ echo
+ echo "ERROR: $PROG not found. Installation aborted!"
+ echo
+ exit 1
+ fi
+ if [ "$INERACTIVE" = "1" ]; then
+ echo " found $PROG at $PROGPATH"
+ fi
+ else
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "Requirement Checks Faild"
+ fi
+ fi
+ done
+ if [ "$INERACTIVE" = "1" ]; then
+ echo
+ fi
+}
+
+
+
+writeXmlHeader() {
+ XMLCONFIG=$XMLCONFIG"<targetconfig name=\"Untitled\" description=\"No Description Available\"><os name=\"openbsd\" /><backend name=\"pf\" />";
+}
+
+writeXmlFooter() {
+ XMLCONFIG=$XMLCONFIG"</targetconfig>";
+}
+
+
+checkDist() {
+ XMLCONFIG=$XMLCONFIG"<distribution name=\"UNDEFINED\" />";
+}
+
+setIPTables() {
+ XMLCONFIG=$XMLCONFIG"<IPTPath name=\"UNDEFINED\" />";
+}
+
+setModprobe() {
+ XMLCONFIG=$XMLCONFIG"<modprobePath name=\"UNDEFINED\" />";
+}
+
+setInitDir() {
+ XMLCONFIG=$XMLCONFIG"<initPath name=\"UNDEFINED\" />";
+}
+
+setDefaultRunlevelDir() {
+ XMLCONFIG=$XMLCONFIG"<rcDefaultPath name=\"UNDEFINED\" />";
+}
+
+setInterfaces() {
+ RET=`/sbin/ifconfig -a | grep 'flags' | grep 'UP' | cut -f1 -d':' | sort`
+ for i in $RET; do
+ # echo "Found Interface: $i"
+ XMLCONFIG=$XMLCONFIG"<interface name=\"$i\" />";
+ done
+}
+
+returnXml() {
+ echo $XMLCONFIG
+}
+
+printHello() {
+ if [ "$INERACTIVE" = "1" ]; then
+ echo "KMyFirewall Auto Configuration Helper"
+ echo "Please report bugs to: %maintainer%"
+ echo
+ fi
+}
+
+printHelp() {
+ echo "Usage: $0 [-q] { --install | --uninstall | --reinstall | --extract | --start | --stop | --help }"
+ echo
+ echo "Switches"
+ echo " -q"
+ echo " Do not require any user interaction."
+ echo
+# echo "Options:"
+# echo " install|--install|-i"
+# echo " Install the configuration."
+# echo " The installed firewall scrip will be automaticaly run at system boot."
+# echo
+# echo " uninstall|--uninstall|-u"
+# echo " Uninstall the configuration form the system."
+# echo
+# echo " reinstall|--reinstall|-r"
+# echo " Re-Installs the configuration e.g. the same as install.sh uninstall"
+# echo " followed by install.sh install"
+# echo
+# echo " extract|--extract|-e"
+# echo " Only extract the installation files."
+# echo " The firewall will not be installed."
+# echo
+# echo " start|--start|-s"
+# echo " Only extract the installation files and."
+# echo " runs the firewall script."
+# echo " The firewall will not be installed."
+# echo
+# echo " stop|--stop|-c"
+# echo " Only extract the installation files and."
+# echo " stops the firewall script."
+# echo " The firewall will not be installed."
+# echo
+# echo " help|--help|-h"
+# echo " Print this help message"
+# echo
+}
+
+#
+# Execution starts here
+#
+
+printHello
+
+COMMAND=$1
+
+if [ "$COMMAND" = "-q" ]; then
+ COMMAND="$2"
+ INERACTIVE="0";
+fi
+
+case $COMMAND in
+
+ help|--help|-h)
+ printHelp
+ ;;
+
+ *)
+ checkRequirements
+ writeXmlHeader
+ checkDist
+ setIPTables
+ setModprobe
+ setInitDir
+ setDefaultRunlevelDir
+ setInterfaces
+ writeXmlFooter
+ returnXml
+ ;;
+esac
+
+exit 0 \ No newline at end of file
diff --git a/kmyfirewall/installer/openbsd/kmfinstaller_openbsd.desktop b/kmyfirewall/installer/openbsd/kmfinstaller_openbsd.desktop
new file mode 100644
index 0000000..6e84bc8
--- /dev/null
+++ b/kmyfirewall/installer/openbsd/kmfinstaller_openbsd.desktop
@@ -0,0 +1,18 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall Installer for OpenBSD
+Name[it]=Installatore di KMyFirewall per OpenBSD
+Name[pt]='Plugin' de Instalação do KMyFirewall para OpenBSD
+Name[pt_BR]='Plugin' de Instalação do KMyFirewall para OpenBSD
+Name[sv]=Min brandvägg installation för OpenBSD
+Comment=Plugin for installing an pf scriptfile
+Comment[it]=Plugin per installare un file script pf
+Comment[pt]='Plugin' para instalar um ficheiro do 'pf'
+Comment[pt_BR]='Plugin' para instalar um ficheiro do 'pf'
+Comment[sv]=Insticksprogram för att installera en pf-skriptfil
+X-KDE-Library=libkmfinstaller_openbsd
+ServiceTypes=KMyFirewall/Installer
+X-KMyFirewall-Platform=openbsd
+
diff --git a/kmyfirewall/installer/openbsd/kmfpfinstaller.cpp b/kmyfirewall/installer/openbsd/kmfpfinstaller.cpp
new file mode 100644
index 0000000..198f26c
--- /dev/null
+++ b/kmyfirewall/installer/openbsd/kmfpfinstaller.cpp
@@ -0,0 +1,1130 @@
+/***************************************************************************
+begin : Mon Jan 28 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfpfinstaller.h"
+
+// QT includes
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qstring.h>
+#include <qmessagebox.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qtextstream.h>
+#include <qsizepolicy.h>
+//KDE includes
+#include <kurl.h>
+#include <kstandarddirs.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <ktempfile.h>
+#include <kmessagebox.h>
+#include <kiconloader.h>
+#include <kio/netaccess.h>
+#include <ktar.h>
+#include <kmdcodec.h>
+
+// STD includes
+// #include <iostream>
+
+//My Includes
+#include "../../version.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfconfig.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmferrorhandler.h"
+#include "../../core/kmftarget.h"
+#include "../../core/kmftargetconfig.h"
+#include "../../core/kmfnetzone.h"
+#include "../../core/kprocesswrapper.h"
+#include "../../core/kmfpluginfactory.h"
+#include "../../core/kmfcompilerinterface.h"
+#include "../../core/xmlnames.h"
+#include "../../core/kmfgenericdoc.h"
+
+#include "../../kmfwidgets/kmfprocout.h"
+#include "../../kmfwidgets/kmfselectactivetarget.h"
+
+namespace KMF {
+
+KMFPFInstaller::KMFPFInstaller( QObject* parent, const char* name ) : KMFPlugin( parent, name ), KMFInstallerInterface() {
+ m_err = new KMFError();
+ m_osName = "openbsd";
+ m_osGUIName = "OpenBSD";
+
+/* m_err_handler = new KMFErrorHandler( "KMFPFInstaller" );
+ temp_file = new KTempFile();
+ temp_file2 = new KTempFile();
+ m_execWidget = 0;
+ // m_kdesuCommand = Constants::KdeSu_Cmd + " -i kmyfirewall -d -c ";
+ loadIcons();
+ execWidget();*/
+}
+
+KMFPFInstaller::~KMFPFInstaller() {
+/* temp_file->close();
+ temp_file2->close();
+ temp_file->unlink();
+ temp_file2->unlink();*/
+}
+
+KMFCompilerInterface* KMFPFInstaller::compiler() {
+ if( ! rulesetDoc() || ! rulesetDoc()->target() ) {
+ kdDebug() << "No Ruleset or Target available" << endl;
+ return 0;
+ }
+
+ KMFCompilerInterface* compiler = rulesetDoc()->target()->compiler();
+ if ( ! compiler ) {
+ return 0;
+ }
+ return compiler;
+}
+QValueList<KMFCompilerInterface*>* KMFPFInstaller::compilers() {
+ return KMFPluginFactory::CompilersForInstaller( osName() );
+}
+
+// void KMFPFInstaller::loadDoc( KMFIPTDoc *doc ) {
+// // m_doc = doc;
+// }
+
+// void KMFPFInstaller::loadScript( const QString& script ) {
+// // m_script = script;
+// }
+
+// bool KMFPFInstaller::isLocalTarget() {
+// if ( rulesetDoc() ) {
+// return rulesetDoc()->target()->isLocalExecuteTarget();
+// }
+// return false;
+// }
+
+// void KMFPFInstaller::slotCloseWindow() {
+// emit sigHideMe();
+// }
+
+KMFProcOut* KMFPFInstaller::execWidget(){
+ if ( m_execWidget ) {
+ m_execWidget->setText( "", "" );
+ setOutputWidget( m_execWidget );
+ return m_execWidget;
+ }
+ kdDebug() << "Need to create new execWidget." << endl;
+ m_execWidget = new KMFProcOut( 0, "KMFProcOut" );
+ connect( m_execWidget, SIGNAL( sigJobFinished( bool, const QString& ) ),
+ this, SLOT( slotJobFinished( bool, const QString& ) ) );
+ setOutputWidget( m_execWidget );
+ return m_execWidget;
+}
+
+
+// void KMFPFInstaller::slotJobFinished( bool ok, const QString& cmd_name ) {
+// kdDebug() << "void KMFPFInstaller::slotJobFinished(bool ok,const QString& cmd_name)" << endl;
+// if ( cmd_name == Constants::InstallFirewallJob_Name && ok ) { // installation successful
+// const QString & msg = i18n( "<p>Installation of the firewall finished successfully. "
+// "The firewall will startup during the next reboot.<br>"
+// "If you want the firewall to be started now click <b>OK</b> and then <b>Run Firewall</b>" );
+// const QString& cap = "Install Firewall";
+// KMessageBox::information( 0, msg, cap );
+//
+// } else if ( cmd_name == Constants::InstallFirewallJob_Name && !ok ) { // installation failed
+// const QString & msg = i18n( "<p><b>Installation of firewall failed</b><br>"
+// "<p>Please make sure you are logged in as <b>root</b>" );
+// const QString& cap = "Install Firewall";
+// KMessageBox::error( 0, msg, cap );
+// } else if ( cmd_name == Constants::UninstallFirewallJob_Name && ok ) { // uninstallation successful
+// const QString & msg = i18n( "<p>Uninstallation of the firewall finished successfully. "
+// "The firewall will no longer startup during boot.<br>"
+// "If you want the firewall to be stopped now click <b>OK</b> and then <b>Stop Firewall</b>" );
+// const QString& cap = "Install Firewall";
+// KMessageBox::information( 0, msg, cap );
+// } else if ( cmd_name == Constants::UninstallFirewallJob_Name && !ok ) { // uninstallation failed
+// const QString & msg = i18n( "<p><b>Uninstallation of Firewall failed</b><br>"
+// "Please make sure you are logged in as <b>root</b>" );
+// const QString& cap = "Uninstall Firewall";
+// KMessageBox::error( 0, msg, cap );
+// } /*else if ( !ok ) {
+// const QString & msg = i18n( "<p>Execution of <b>%1</b> failed"
+// "<p>Click <b>OK</b> to check your configuration and make sure you are logged in as <b>root</b>" ).arg( cmd_name );
+// const QString& cap = "KMFPFInstaller";
+// KMessageBox::error( 0, msg, cap );
+// }*/
+// emit sigStatusChanged();
+// }
+
+
+
+
+
+
+
+
+void KMFPFInstaller::cmdRunFW() {
+// kdDebug() << "void KMFPFInstaller::slotRunFW()" << endl;
+// loadScript( rulesetDoc()->compile() );
+// const QString file = temp_file->name();
+// m_err = createFirewallScript( file );
+// if ( ! m_err_handler->showError( m_err ) ) {
+// return;
+// }
+//
+// kdDebug() << "Starting Firewall..." << endl;
+//
+// if( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+// if ( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to execute the generated iptables script?</b>"
+// "<p><b>A wrongly configured iptables script may make your computer unusable!</b>"
+// "<p>If your system hangs after you start the firewall, switch to a text "
+// "console (Ctrl+Alt+F1) and run the following commands to reset your iptables "
+// "configuration:"
+// "<p><ul>"
+// "<li>iptables -F </li>"
+// "<li>iptables -X </li>"
+// "<li>iptables -P INPUT ACCEPT </li>"
+// "<li>iptables -P OUTPUT ACCEPT </li>"
+// "<li>iptables -P FORWARD ACCEPT </li>"
+// "<li>iptables -t nat -F </li>"
+// "<li>iptables -t nat -X </li>"
+// "<li>iptables -t nat -P OUTPUT ACCEPT </li>"
+// "<li>iptables -t nat -P PREROUTING ACCEPT </li>"
+// "<li>iptables -t nat -P POSTROUTING ACCEPT </li>"
+// "<li>iptables -t mangle -F </li>"
+// "<li>iptables -t mangle -X </li>"
+// "<li>iptables -t mangle -P INPUT ACCEPT </li>"
+// "<li>iptables -t mangle -P OUTPUT ACCEPT </li>"
+// "<li>iptables -t mangle -P FORWARD ACCEPT </li>"
+// "<li>iptables -t mangle -P PREROUTING ACCEPT </li>"
+// "<li>iptables -t mangle -P POSTROUTING ACCEPT </li></ul>" ),
+// i18n( "Run Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_view_run_fw" ) != KMessageBox::Yes ) {
+// return;
+// }
+//
+// QString cmd = "bash " + file + " -v start";
+// // KProcessWrapper::instance()->slotStartLocalJob( "startfirewall", cmd, true, true );
+// setOutputWidget( execWidget() );
+// execWidget()->runCmd( cmd, Constants::StartFirewallJob_Name, i18n("Start Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ), true );
+// showOutput();
+// checkStatus();
+// } else {
+// if( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to execute the generated firewall script on %1?</b>"
+// "<p><b>A wrongly configured firewall script may make your computer unusable! PLease make sure that you have left the SSH port open, otherwise you will no longer be able to remote control the comuter using KMyFirewall or any other SSH client!</b></p>"
+// "<p>If your system hangs after you start the firewall, switch to a text "
+// "console (Ctrl+Alt+F1) and run the following commands to reset your iptables "
+// "configuration:"
+// "<p><ul>"
+// "<li>iptables -F </li>"
+// "<li>iptables -X </li>"
+// "<li>iptables -P INPUT ACCEPT </li>"
+// "<li>iptables -P OUTPUT ACCEPT </li>"
+// "<li>iptables -P FORWARD ACCEPT </li>"
+// "<li>iptables -t nat -F </li>"
+// "<li>iptables -t nat -X </li>"
+// "<li>iptables -t nat -P OUTPUT ACCEPT </li>"
+// "<li>iptables -t nat -P PREROUTING ACCEPT </li>"
+// "<li>iptables -t nat -P POSTROUTING ACCEPT </li>"
+// "<li>iptables -t mangle -F </li>"
+// "<li>iptables -t mangle -X </li>"
+// "<li>iptables -t mangle -P INPUT ACCEPT </li>"
+// "<li>iptables -t mangle -P OUTPUT ACCEPT </li>"
+// "<li>iptables -t mangle -P FORWARD ACCEPT </li>"
+// "<li>iptables -t mangle -P PREROUTING ACCEPT </li>"
+// "<li>iptables -t mangle -P POSTROUTING ACCEPT </li></ul>" ).arg(rulesetDoc()->target()->toFriendlyString() ),
+// i18n( "Install Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_run_fw_remote" ) != KMessageBox::Yes
+// ) {
+// return;
+// }
+//
+//
+// setOutputWidget( execWidget() );
+// execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+//
+// generateInstallerPackage( rulesetDoc()->target() );
+// QString cmd = "cd /tmp/; sh ./kmfpackage.kmfpkg -q --start";
+// KProcessWrapper::instance()->slotStartRemoteJob( Constants::StartFirewallJob_Name, cmd, rulesetDoc()->target() );
+//
+// if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+// kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+// KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+// return;
+// }
+//
+// setOutputWidget( execWidget() );
+// execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Start Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+// checkStatus();
+// }
+//
+}
+
+void KMFPFInstaller::cmdStopFW() {
+// kdDebug() << "Shutdown Firewall..." << endl;
+// loadScript( rulesetDoc()->compile() );
+// const QString file = temp_file->name();
+// m_err = createFirewallScript( file );
+// if ( ! m_err_handler->showError( m_err ) ) {
+// return;
+// }
+//
+// if( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to stop the firewall on %1?</b>"
+// "<p><b>This will leave the computer unprotected!</b></p>" ).arg(rulesetDoc()->target()->toFriendlyString() ),
+// i18n( "Install Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_stop_fw_remote" ) != KMessageBox::Yes
+// ) {
+// return;
+// };
+//
+//
+// if( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+//
+// QString cmd = "bash " + file + " -v stop";
+// setOutputWidget( execWidget() );
+// execWidget()->runCmd( cmd, Constants::StopFirewallJob_Name, i18n("Stop Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ), true );
+// showOutput();
+// checkStatus();
+//
+// } else {
+// setOutputWidget( execWidget() );
+// execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+//
+// generateInstallerPackage( rulesetDoc()->target() );
+// QString cmd = "cd /tmp/; sh ./kmfpackage.kmfpkg -q --stop";
+// KProcessWrapper::instance()->slotStartRemoteJob( Constants::StopFirewallJob_Name, cmd, rulesetDoc()->target() );
+//
+// if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+// kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+// KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+// return;
+// }
+//
+// setOutputWidget( execWidget() );
+// execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Stop Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+// checkStatus();
+// }
+}
+
+void KMFPFInstaller::cmdShowRunningConfig( const QString& para ) {
+// QString cmd = "";
+// if ( para == Constants::FilterTable_Name ) {
+// cmd = cmdShowFilter();
+// } else if ( para == Constants::NatTable_Name ) {
+// cmd = cmdShowNat();
+// } else if ( para == Constants::MangleTable_Name ) {
+// cmd = cmdShowMangle();
+// } else {
+// cmd = cmdShowAll();
+// }
+//
+// if( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+// // KProcessWrapper::instance()->slotStartLocalJob( "show_config", cmd, true, true );
+// setOutputWidget( execWidget() );
+// execWidget()->runCmd( cmd,Constants::ShowConfigJob_Name, i18n("Show Table %1 on %2").arg( para ).arg( rulesetDoc()->target()->toFriendlyString() ), true );
+// showOutput();
+//
+// } else {
+// setOutputWidget( execWidget() );
+// execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+// KProcessWrapper::instance()->slotStartRemoteJob( Constants::ShowConfigJob_Name, cmd, rulesetDoc()->target() );
+//
+// if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+// kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+// KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+// return;
+// }
+//
+// setOutputWidget( execWidget() );
+// execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Show Table %1 on %2").arg( para ).arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+// }
+}
+//
+
+
+void KMFPFInstaller::cmdInstallFW() {
+// kdDebug() << "KMFPFInstaller::slotInstallFW()" << endl;
+// KMFTargetConfig *conf = rulesetDoc()->target()->config();
+//
+// if( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to install the firewall on %1?</b>"
+// "<p>This will add the scripts to your init system that are required to "
+// "start your firewall during bootup."
+// "<p><b>Please make sure that the firewall runs properly before you install it.</b>" ).arg( rulesetDoc()->target()->toFriendlyString() ),
+// i18n( "Install Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_view_install_fw" ) != KMessageBox::Yes ) {
+// return;
+// }
+//
+// if ( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+// KURL url ( KGlobal::dirs() ->findResource( "appdata", "scripts/installer/linux/kmfinstall.sh" ));
+// QString installscript = url.path();
+//
+// if ( installscript.isEmpty() ) {
+// QString msg = i18n( "<p>Unable to find install script <b>kmfinstall.sh</b>"
+// "<p>Please check your installation. Usually this script is installed in "
+// "$KDEDIR/share/apps/kmyfirewall/scripts/installer/linux"
+// "<p>Unable to install the firewall without this script." );
+// QString cap = "KMFPFInstaller";
+// KMessageBox::error( 0, msg, cap );
+// return;
+// }
+// kdDebug() << "found Install script: " << installscript << endl;
+// if ( conf->oS() == "linux" && conf->distribution() == "gentoo" ) {
+// QString msg = i18n( "<p>The following files will be created by installing the firewall"
+// "<ul><li>Directory: %1</li>"
+// "<li>File: %2</li>"
+// "<li>File: %3</li>"
+// "<li>Link: %4 -&gt; %5</li></ul></ul>" )
+// .arg( "/etc/kmyfirewall" )
+// .arg( "/etc/kmyfirewall/kmyfirewall.sh" )
+// .arg( conf->IPTPath() + "/kmyfirewall" )
+// .arg( conf->rcDefaultPath() + "/kmyfirewall" )
+// .arg( conf->initPath() + "/kmyfirewall" );
+// QString cap = i18n( "Install Firewall" );
+// KMessageBox::information( 0, msg, cap, "created_install_files", 0 );
+// } else if ( conf->oS() == "linux" ) {
+// QString msg = i18n( "<p>The following files will be created by installing the firewall"
+// "<ul><li>Directory: %1</li>"
+// "<li>File: %2</li>"
+// "<li>File: %3</li>"
+// "<li>Link: %4 -&gt; %5</li>"
+// "<li>Link: %6 -&gt; %7</li></ul></ul>" )
+// .arg( "/etc/kmyfirewall" )
+// .arg( "/etc/kmyfirewall/kmyfirewall.sh" )
+// .arg( conf->initPath() + "/kmyfirewall" )
+// .arg( conf->rcDefaultPath() + "/S99kmyfirewall" )
+// .arg( conf->initPath() + "/kmyfirewall" )
+// .arg( conf->rcDefaultPath() + "/K01kmyfirewall" )
+// .arg( conf->initPath() + "/kmyfirewall" );
+// QString cap = i18n( "Install Firewall" );
+// KMessageBox::information( 0, msg, cap, "created_install_files", 0 );
+// }
+//
+// const QString fwscript = temp_file->name();
+// m_err = createFirewallScript( fwscript );
+// if ( ! m_err_handler->showError( m_err ) ) {
+// return;
+// }
+// const QString initscript = temp_file2->name();
+// m_err = createInitScript( initscript, KMFConfig::distribution() );
+// if ( ! m_err_handler->showError( m_err ) ) {
+// return;
+// }
+// QString systemtype;
+// if ( conf->distribution() == "gentoo" )
+// systemtype = "gentoo";
+// else if( conf->distribution() == "slackware" )
+// systemtype = "slackware";
+// else
+// systemtype = "sysv";
+//
+// QString cmd = "bash " + installscript + " install " + systemtype + " " + conf->initPath() + " " + conf->rcDefaultPath() + " " + initscript + " " + fwscript;
+// // KProcessWrapper::instance()->slotStartLocalJob( "installfirewall", cmd, true, true );
+//
+// setOutputWidget( execWidget() );
+// execWidget()->runCmd( cmd, Constants::InstallFirewallJob_Name, i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ), true );
+// showOutput();
+// checkStatus();
+// } else {
+// setOutputWidget( execWidget() );
+// execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+//
+// generateInstallerPackage( rulesetDoc()->target() );
+// QString cmd = "cd /tmp/; sh ./kmfpackage.kmfpkg -q --install";
+// KProcessWrapper::instance()->slotStartRemoteJob( Constants::InstallFirewallJob_Name, cmd, rulesetDoc()->target() );
+//
+// if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+// kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+// KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+// return;
+// }
+//
+// setOutputWidget( execWidget() );
+// execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+// checkStatus();
+// }
+//
+}
+
+void KMFPFInstaller::cmdUninstallFW() {
+// kdDebug() << "KMFPFInstaller::slotUninstallFW()" << endl;
+//
+// KMFTargetConfig *conf = rulesetDoc()->target()->config();
+//
+// if ( KMessageBox::questionYesNo ( 0 , i18n( "<p><b>Are you sure you want to uninstall the firewall from %1?</b><br>"
+// "The firewall will no longer start up during boot." ).arg( rulesetDoc()->target()->toFriendlyString() ),
+// i18n( "Uninstall Firewall" ), KStdGuiItem::yes(), KStdGuiItem::no(), "output_view_uninstall_fw" ) != KMessageBox::Yes ) {
+// return;
+// }
+//
+//
+// if ( rulesetDoc()->target()->isLocalExecuteTarget() ) {
+// KURL url (KGlobal::dirs() ->findResource( "appdata", "scripts/installer/linux/kmfinstall.sh" ));
+// QString installscript = url.path();
+//
+// if ( installscript.isEmpty() ) {
+// const QString & msg = i18n( "<p>Unable to find uninstall script <b>kmfinstall.sh</b>"
+// "<p>Please check your installation. Usually this script is installed in "
+// "$KDEDIR/share/apps/kmyfirewall/scripts/installer/linux"
+// "<p>Unable to uninstall the firewall without this script." );
+// const QString& cap = "KMFPFInstaller";
+// KMessageBox::error( 0, msg, cap );
+// return;
+// }
+// kdDebug() << "found Install script: " << installscript << endl;
+// if ( conf->oS() == "linux" && conf->distribution() == "gentoo" ) {
+// QString msg = i18n( "<p>The following files will be removed by uninstalling the firewall"
+// "<ul><li>Directory: %1</li>"
+// "<li>File: %2</li>"
+// "<li>File: %3</li>"
+// "<li>Link: %4 -&gt; %5</li></ul></ul>" )
+// .arg( "/etc/kmyfirewall" )
+// .arg( "/etc/kmyfirewall/kmyfirewall.sh" )
+// .arg( conf->initPath() + "/kmyfirewall" )
+// .arg( conf->rcDefaultPath() + "/kmyfirewall" )
+// .arg( conf->initPath() + "/kmyfirewall" );
+// QString cap = i18n( "Uninstall Firewall" );
+// KMessageBox::information( 0, msg, cap, "removed_uninstall_files", 0 );
+// } else if ( conf->oS() == "linux" ) {
+// QString msg = i18n( "<p>The following files will be removed by uninstalling the firewall"
+// "<ul><li>Directory: %1</li>"
+// "<li>File: %2</li>"
+// "<li>File: %3</li>"
+// "<li>Link: %4 -&gt; %5</li>"
+// "<li>Link: %6 -&gt; %7</li></ul></ul>" )
+// .arg( "/etc/kmyfirewall" )
+// .arg( "/etc/kmyfirewall/kmyfirewall.sh" )
+// .arg( conf->initPath() + "/kmyfirewall" )
+// .arg( conf->rcDefaultPath() + "/S99kmyfirewall" )
+// .arg( conf->initPath() + "/kmyfirewall" )
+// .arg( conf->rcDefaultPath() + "/K01kmyfirewall" )
+// .arg( conf->initPath() + "/kmyfirewall" );
+// QString cap = i18n( "Uninstall Firewall" );
+// KMessageBox::information( 0, msg, cap, "removed_uninstall_files", 0 );
+// }
+//
+// QString systemtype;
+// if ( conf->distribution() == "gentoo" )
+// systemtype = "gentoo";
+// else if( conf->distribution() == "slackware" )
+// systemtype = "slackware";
+// else
+// systemtype = "sysv";
+//
+// QString cmd = "bash " + installscript + " uninstall " + systemtype + " " + conf->initPath() + " " + conf->rcDefaultPath();
+// // KProcessWrapper::instance()->slotStartLocalJob( "uninstallfirewall", cmd, true, true );
+//
+// setOutputWidget( execWidget() );
+// execWidget()->runCmd( cmd, Constants::UninstallFirewallJob_Name, i18n("Uninstall Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ), true );
+// showOutput();
+// checkStatus();
+//
+// } else {
+// setOutputWidget( execWidget() );
+// execWidget()->setText( i18n("Please wait while the scripts are uploaded and executed..."), i18n("Install Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+//
+// generateInstallerPackage( rulesetDoc()->target() );
+// QString cmd = "cd /tmp/; sh ./kmfpackage.kmfpkg -q --uninstall";
+// KProcessWrapper::instance()->slotStartRemoteJob( Constants::UninstallFirewallJob_Name, cmd, rulesetDoc()->target() );
+//
+// if ( KProcessWrapper::instance()->exitStatus() != 0 ) {
+// kdDebug() << "ERROR:" << KProcessWrapper::instance()->stdErr() << endl;
+// KMessageBox::error( 0, KProcessWrapper::instance()->stdCombined() );
+// return;
+// }
+//
+// setOutputWidget( execWidget() );
+// execWidget()->setText( KProcessWrapper::instance()->stdOut(), i18n("Uninstall Firewall on %1").arg( rulesetDoc()->target()->toFriendlyString() ) );
+// showOutput();
+// checkStatus();
+// }
+//
+//
+}
+
+
+
+// QString KMFPFInstaller::cmdShowAll() {
+// kdDebug() << "Show Config..." << endl;
+//
+// KMFTargetConfig *conf = rulesetDoc()->target()->config();
+//
+// QString show_config = " echo Config of Table FILTER:; "
+// "echo;" +
+// conf->IPTPath() + " -L -v -n; "
+// "echo;"
+// "echo;"
+// "echo Config of Table NAT:; "
+// "echo;" +
+// conf->IPTPath() + " -t nat -L -v -n; "
+// "echo;"
+// "echo;"
+// "echo Config of Table MANGLE:; "
+// "echo;" +
+// conf->IPTPath() + " -t mangle -L -v -n ";
+// QString cmd_name = conf->IPTPath() + " -L -v -n; " + conf->IPTPath() + " -t nat -L -v -n; " + conf->IPTPath() + " -t mangle -L -v -n";
+// return show_config;
+// }
+
+// QString KMFPFInstaller::cmdShowFilter() {
+// kdDebug() << "Show Config..." << endl;
+// KMFTargetConfig *conf = rulesetDoc()->target()->config();
+//
+// kdDebug() << "iptables" << " -t filter -L" << endl;
+// QString show_config = " echo Config of Table FILTER:; "
+// "echo; " +
+// conf->IPTPath() + " -t filter -L -v -n";
+// return show_config;
+// }
+
+// QString KMFPFInstaller::cmdShowNat() {
+// kdDebug() << "Show Config..." << endl;
+// KMFTargetConfig *conf = rulesetDoc()->target()->config();
+//
+// kdDebug() << "iptables" << " -t nat -L -v -n" << endl;
+// QString show_config = " echo Config of Table NAT:;"
+// "echo;" +
+// conf->IPTPath() +" -t nat -L -v -n";
+// return show_config;
+// }
+
+// QString KMFPFInstaller::cmdShowMangle() {
+// kdDebug() << "Show Config..." << endl;
+//
+// KMFTargetConfig *conf = rulesetDoc()->target()->config();
+//
+// kdDebug() << "iptables" << " -t mangle -L" << endl;
+// QString show_config = " echo Config of Table MANGLE:;"
+// "echo;" +
+// conf->IPTPath() + " -t mangle -L -v -n";
+// return show_config;
+// }
+
+
+
+
+
+
+
+// KMFError* KMFPFInstaller::createInitScript( const QString& initfile, const QString& systemtype ) {
+// if ( !initfile || initfile.isEmpty() ) {
+// m_err->setErrType( KMFError::NORMAL );
+// const QString& msg = i18n( "No filename given for script creation." );
+// m_err->setErrMsg( msg );
+// return m_err;
+// }
+//
+// // kdDebug() << "Writing script to file " << initfile << endl;
+// QFile f( initfile );
+// f.remove();
+// bool gotit = f.open( IO_ReadWrite );
+// if ( gotit ) {
+// QTextStream ts( &f );
+// //Header
+// QString version = KMYFIREWALL_VERSION;
+// QString copyright_string = COPYRIGHT_STRING;
+// QString maintainer = MAINTAINER;
+// QString s;
+// if ( systemtype == "gentoo" ) {
+// kdDebug() << "Writing Gentoo init script." << endl;
+// s = "#!/sbin/runscript\n"
+// "#\n"
+// "# " + copyright_string + "\n"
+// "# mail to: " + maintainer + "\n"
+// "#\n"
+// "# Gentoo Start/Stop script for KMyFirewall " + version + "\n"
+// "# This is an automatic generated file DO NOT EDIT\n"
+// "#\n"
+// "depend() { \n"
+// "\tuse net \n"
+// "}\n"
+// "start() {\n"
+// " /bin/sh /etc/kmyfirewall/kmyfirewall.sh start\n"
+// "\teend $? \n"
+// "}\n\n"
+// "stop () {\n"
+// " /bin/sh /etc/kmyfirewall/kmyfirewall.sh stop\n"
+// "\teend $? \n"
+// "}\n\n";
+// ts << s << endl;
+// } else {
+// kdDebug() << "Writing normal init script." << endl;
+// s = "#!/bin/sh\n"
+// "#\n"
+// "# " + copyright_string + "\n"
+// "# mail to: " + maintainer + "\n"
+// "#\n"
+// "# Start/Stop script for KMyFirewall " + version + "\n"
+// "# This is an automatic generated file DO NOT EDIT\n"
+// "#\n"
+// "status=\"0\"\n"
+// "case $1 in\n"
+// " start)\n"
+// " /bin/sh /etc/kmyfirewall/kmyfirewall.sh start || status=\"1\"\n"
+// " ;;\n\n"
+// " stop)\n"
+// " /bin/sh /etc/kmyfirewall/kmyfirewall.sh stop || status=\"1\"\n"
+// " ;;\n\n"
+// " reload)\n"
+// " /bin/sh /etc/kmyfirewall/kmyfirewall.sh stop || status=\"1\"\n"
+// " /bin/sh /etc/kmyfirewall/kmyfirewall.sh start || status=\"1\"\n"
+// " ;;\n\n"
+// "esac\n"
+// "if [ \"$status\" = \"0\" ]; then\n"
+// " exit 0\n"
+// "else\n"
+// " exit 1\n"
+// "fi\n";
+// ts << s << endl;
+// }
+// f.flush();
+// f.close();
+// } else {
+// m_err->setErrType( KMFError::NORMAL );
+// const QString& msg = i18n( "<p>Opening file for writing <b>failed</b>."
+// "Please make sure that you are logged in as <b>root</b>." );
+// m_err->setErrMsg( msg );
+// return m_err;
+// }
+// m_err->setErrType( KMFError::OK );
+// const QString& msg = "";
+// m_err->setErrMsg( msg );
+// return m_err;
+// }
+
+
+// void KMFPFInstaller::writeBase64DataField( const QString& source_file_path, const QString& target_file_path, const QString& data ) {
+// QStringList lines;
+// QFile source_file( source_file_path );
+// if ( source_file.open( IO_ReadOnly ) ) {
+// QTextStream stream( &source_file );
+// QString line;
+// int i = 1;
+// while ( !stream.atEnd() ) {
+// line = stream.readLine(); // line of text excluding '\n'
+// i++;
+// kdDebug() << "line.latin1(): " << line.latin1() << endl;
+// lines += line;
+// }
+// source_file.close();
+// } else {
+// m_err->setErrType( KMFError::NORMAL );
+// const QString& msg = i18n( "<p>Opening file for %1 reading <b>failed</b>." ).arg( source_file_path );
+// m_err->setErrMsg( msg );
+// }
+//
+// QString corrData = data;
+// for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
+// (*it).replace( "%data%", corrData );
+// }
+//
+// QFile target_file( target_file_path );
+// if ( target_file.open( IO_WriteOnly ) ) {
+// QTextStream stream( &target_file );
+// int i = 1;
+//
+// for ( QStringList::Iterator it2 = lines.begin(); it2 != lines.end(); ++it2 ) {
+// stream << *it2 << "\n";
+// i++;
+// kdDebug() << "(*it2).latin1(): " << (*it2).latin1() << endl;
+// }
+// target_file.close();
+// } else {
+// m_err->setErrType( KMFError::NORMAL );
+// const QString& msg = i18n( "<p>Opening file for %1 writing <b>failed</b>." ).arg( target_file_path );
+// m_err->setErrMsg( msg );
+// }
+// }
+
+// void KMFPFInstaller::parseFileHeaders( const QString& source_file_path, const QString& target_file_path ) {
+// kdDebug() << "KMFPFInstaller::parseFileHeaders( const QString& " << source_file_path << ", const QString& " << target_file_path << " )" << endl;
+//
+// QString version = KMYFIREWALL_VERSION;
+// QString copyright_string = COPYRIGHT_STRING;
+// QString maintainer = MAINTAINER;
+// QString license = LICENSE;
+//
+//
+// QStringList lines;
+// QFile source_file( source_file_path );
+// if ( source_file.open( IO_ReadOnly ) ) {
+// QTextStream stream( &source_file );
+// QString line;
+// int i = 1;
+// while ( !stream.atEnd() ) {
+// line = stream.readLine(); // line of text excluding '\n'
+// i++;
+// kdDebug() << "line.latin1(): " << line.latin1() << endl;
+// lines += line;
+// }
+// source_file.close();
+// } else {
+// m_err->setErrType( KMFError::NORMAL );
+// const QString& msg = i18n( "<p>Opening file for %1 reading <b>failed</b>." ).arg( source_file_path );
+// m_err->setErrMsg( msg );
+// }
+//
+// for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
+// (*it).replace( "%coypright%", copyright_string );
+// (*it).replace( "%version%", version );
+// (*it).replace( "%maintainer%", maintainer );
+// (*it).replace( "%license%", license );
+// }
+//
+// QFile target_file( target_file_path );
+// if ( target_file.open( IO_WriteOnly ) ) {
+// QTextStream stream( &target_file );
+// int i = 1;
+//
+// for ( QStringList::Iterator it2 = lines.begin(); it2 != lines.end(); ++it2 ) {
+// stream << *it2 << "\n";
+// i++;
+// kdDebug() << "(*it2).latin1(): " << (*it2).latin1() << endl;
+// }
+// target_file.close();
+// } else {
+// m_err->setErrType( KMFError::NORMAL );
+// const QString& msg = i18n( "<p>Opening file for %1 writing <b>failed</b>." ).arg( target_file_path );
+// m_err->setErrMsg( msg );
+// }
+// }
+
+// void KMFPFInstaller::generateInstallerPackage( KMFTarget* tg ) {
+// if ( rulesetDoc() ) {
+// KMFTargetConfig *conf = tg->config();
+//
+// KMFPFInstallerInterface *inst2 = KMFPluginFactory::KMFPFInstaller(
+// conf->oS(), conf->backend(), parent() );
+// if ( ! inst2 )
+// return;
+// inst2->loadScript( rulesetDoc()->compile() );
+//
+// QString remDir = rulesetDoc()->target()->getFishUrl();
+// remDir.append( "/tmp/" );
+//
+// QString path = remDir;
+// path.append( "kmfpackage.kmfpkg" );
+// KURL url( path );
+// KURL remDirUrl( remDir );
+//
+// if ( url.fileName().isEmpty() )
+// return;
+//
+// if ( KIO::NetAccess::exists( url, false, KApplication::kApplication()->mainWidget() ) ) {
+// QDateTime now = QDateTime::currentDateTime();
+//
+// QString backUp;
+// backUp.append( url.url() );
+// backUp.append( "_backup_" );
+// backUp.append( now.toString( "dd.MM.yyyy.hh:mm:ss" ) );
+// KURL newUrl( backUp );
+//
+//
+// QString backFileName = "kmfpackage.kmfpkg";
+// backUp.append( "_backup_" );
+// backUp.append( now.toString( "dd.MM.yyyy.hh:mm:ss" ) );
+//
+//
+// KIO::NetAccess::file_move( url, newUrl, 700, true, true, KApplication::kApplication()->mainWidget() );
+// KIO::NetAccess::fish_execute( remDir, "chmod 400 /tmp/" + backFileName, KApplication::kApplication()->mainWidget() );
+// }
+//
+// inst2->generateInstallerPackage( tg, url );
+// KIO::NetAccess::fish_execute( remDir, "chmod 700 /tmp/kmfpackage.kmfpkg", KApplication::kApplication()->mainWidget() );
+// }
+// }
+
+void KMFPFInstaller::generateInstallerPackage( KMFTarget* target, const KURL& packageURL ) {
+ kdDebug() << "generateInstallerPackage( const KURL& )" << endl;
+//
+// KMFTargetConfig *conf = target->config();
+//
+// KTempFile *startup_script = new KTempFile();
+// KTempFile *packageArch = new KTempFile();
+// KTempFile *fw_script = new KTempFile();
+// KTempFile *init_script_sysv = new KTempFile();
+// KTempFile *init_script_gentoo = new KTempFile();
+// KTempFile *kmf_intsall = new KTempFile();
+// KTempFile *kmf_pkg_intsall = new KTempFile();
+// KTempFile *kmf_install_package = new KTempFile();
+//
+// KURL readme_url ( KGlobal::dirs() ->findResource( "appdata", "README.InstallerPackage.txt" ));
+// // QString readme_txt = readme_url.path();
+// if ( readme_url.path().isEmpty() ) {
+// QString msg = i18n( "<p>Unable to find the package README script <b>README.InstallerPackage.txt</b>"
+// "<p>Please check your installation. Usually this file is installed in "
+// "$KDEDIR/share/apps/kmyfirewall/"
+// "<p>The package will be built without the README file." );
+// QString cap = "KMFPFInstaller";
+// KMessageBox::error( 0, msg, cap );
+// // return;
+// }
+// kdDebug() << "found readme script: " << readme_url.path() << endl;
+//
+//
+// KURL kmfinstall_url ( KGlobal::dirs() ->findResource( "appdata", "scripts/installer/" + target->config()->oS() + "/kmfinstall.sh" ));
+// if ( kmfinstall_url.path().isEmpty() ) {
+// QString msg = i18n( "<p>Unable to find install script <b>kmfinstall.sh</b>"
+// "<p>Please check your installation. Usually this script is installed in "
+// "$KDEDIR/share/apps/kmyfirewall/scripts/installer/" + target->config()->oS() + ""
+// "<p>Unable to install the firewall without this script." );
+// QString cap = "KMFPFInstaller";
+// KMessageBox::error( 0, msg, cap );
+// return;
+// }
+// kdDebug() << "found Install script: " << kmfinstall_url.path() << endl;
+//
+// parseFileHeaders( kmfinstall_url.path(), kmf_intsall->name() );
+//
+//
+//
+// KURL kmfpgkinstall_url ( KGlobal::dirs() ->findResource( "appdata", "scripts/installer/" + target->config()->oS() + "/kmfpkginstall.sh" ));
+// if ( kmfpgkinstall_url.path().isEmpty() ) {
+// QString msg = i18n( "<p>Unable to find install script <b>kmfinstall.sh</b>"
+// "<p>Please check your installation. Usually this script is installed in "
+// "$KDEDIR/share/apps/kmyfirewall/scripts/installer/" + target->config()->oS() + ""
+// "<p>Unable to install the firewall without this script." );
+// QString cap = "KMFPFInstaller";
+// KMessageBox::error( 0, msg, cap );
+// return;
+// }
+// kdDebug() << "found PKG Install script: " << kmfpgkinstall_url.path() << endl;
+//
+// parseFileHeaders( kmfpgkinstall_url.path(), kmf_pkg_intsall->name() );
+//
+//
+// KURL kmf_install_package_url ( KGlobal::dirs() ->findResource( "appdata", "scripts/installer/" + target->config()->oS() + "/installpackage.sh" ));
+// if ( kmf_install_package_url.path().isEmpty() ) {
+// QString msg = i18n( "<p>Unable to find install package script <b>installpackage.sh</b>"
+// "<p>Please check your installation. Usually this script is installed in "
+// "$KDEDIR/share/apps/kmyfirewall/scripts/installer/" + target->config()->oS() + ""
+// "<p>Unable to install the firewall without this script." );
+// QString cap = "KMFPFInstaller";
+// KMessageBox::error( 0, msg, cap );
+// return;
+// }
+// kdDebug() << "found PKG Install script: " << kmf_install_package_url.path() << endl;
+//
+// parseFileHeaders( kmf_install_package_url.path(), kmf_install_package->name() );
+//
+// QString systemtype;
+// if ( conf->distribution() == "gentoo" ) {
+// systemtype = "gentoo";
+// } else if( conf->distribution() == "slackware" ) {
+// systemtype = "slackware";
+// } else {
+// systemtype = "sysv";
+// }
+//
+// // const QString initscript_sysv = init_script_sysv->name();
+// // const QString initscript_gentoo = init_script_gentoo->name();
+// // const QString fwscript = fw_script->name();
+// m_err = createFirewallScript( fw_script->name() );
+// if ( ! m_err_handler->showError( m_err ) ) {
+// return;
+// }
+//
+// m_err = createInitScript( init_script_sysv->name(), "sysv" );
+// if ( ! m_err_handler->showError( m_err ) ) {
+// return;
+// }
+//
+// m_err = createInitScript( init_script_gentoo->name(), "gentoo" );
+// if ( ! m_err_handler->showError( m_err ) ) {
+// return;
+// }
+//
+// QString version = KMYFIREWALL_VERSION;
+// QString copyright_string = COPYRIGHT_STRING;
+// QString maintainer = MAINTAINER;
+//
+//
+// QFile f( startup_script->name() );
+// bool gotit = f.open( IO_ReadWrite );
+// if ( gotit ) {
+// QTextStream ts( &f );
+// //Header
+// QString s;
+//
+// kdDebug() << "Package install script." << endl;
+// s = "#!/bin/sh\n"
+// "#\n"
+// "# " + copyright_string + "\n"
+// "# Please report bugs to: " + maintainer + "\n"
+// "#\n"
+// "# config script for KMyFirewall " + version + " package instsll script\n"
+// "# This is an automatic generated file DO NOT EDIT\n"
+// "#\n" +
+// "# Configuration created for " + target->toFriendlyString() + "\n" +
+// "#\n"
+// "#\n\n";
+// s += "SYSTEMTYPE=" + systemtype + "\n";
+// s += "INITPATH=" + conf->initPath() + "\n";
+// s += "RCDEFAULTPATH=" + conf->rcDefaultPath() + "\n"
+// "INITSCRIPT=data/init_sysv.sh\n"
+// "if [ \"$SYSTEMTYPE\" == \"gentoo\" ]; then\n"
+// " INITSCRIPT=data/init_gentoo.sh\n"
+// "fi\n";
+// ts << s << endl;
+//
+// f.flush();
+// f.close();
+// } else {
+// m_err->setErrType( KMFError::NORMAL );
+// const QString& msg = i18n( "<p>Opening file for writing <b>failed</b>."
+// "Please make sure that you are logged in as <b>root</b>." );
+// m_err->setErrMsg( msg );
+// m_err_handler->showError( m_err );
+// kdWarning() << "!!! Opening file for writing failed !!!" << endl;
+// return;
+// }
+//
+// KTar *package = new KTar( packageArch->name(), "application/x-gzip" );
+// package->open( IO_WriteOnly );
+//
+// package->addLocalFile( readme_url.path(), "README.txt" );
+// kdDebug() << "Wrote tar file: README.txt" << endl;
+//
+// package->addLocalFile( startup_script->name(), "install.config" );
+// kdDebug() << "Wrote tar file: install.config" << endl;
+//
+// package->addLocalFile( kmf_pkg_intsall->name(), "install.sh" );
+// kdDebug() << "Wrote tar file: install.sh" << endl;
+//
+// package->addLocalFile( kmf_intsall->name(), "data/kmfinstall.sh" );
+// kdDebug() << "Wrote tar file: kmfinstall.sh" << endl;
+//
+// package->addLocalFile( init_script_sysv->name(), "data/init_sysv.sh" );
+// kdDebug() << "Wrote tar file: data/init_sysv.sh" << endl;
+//
+// package->addLocalFile( init_script_gentoo->name(), "data/init_gentoo.sh" );
+// kdDebug() << "Wrote tar file: data/init_gentoo.sh" << endl;
+//
+// package->addLocalFile( fw_script->name(), "data/kmyfirewall.sh" );
+// kdDebug() << "Wrote tar file: data/kmyfirewal.sh" << endl;
+// package->close();
+//
+// QFile fPackage( packageArch->name() );
+// if ( fPackage.open( IO_ReadOnly ) ) {
+// QByteArray b = fPackage.readAll();
+// QString rawData = KCodecs::base64Encode( b, false );
+// rawData = rawData.replace( '\n', ' ' );
+// QString data;
+// int len = rawData.length();
+// int currPos = 0;
+// bool doit = true;
+//
+// while( doit ) {
+// int lineLen = 76;
+// if ( ( len - currPos ) < lineLen ) {
+// lineLen = len - currPos;
+// doit = false;
+// }
+// kdDebug() << "Appending : " << rawData.mid( currPos, lineLen ) << endl;
+// data.append( rawData.mid( currPos, lineLen ) );
+// data.append( " " );
+// currPos += lineLen;
+// }
+//
+//
+// kdDebug() << "Encoded package: " << data << endl;
+// writeBase64DataField( kmf_install_package->name(), kmf_install_package->name(), data );
+// }
+//
+//
+//
+//
+//
+// // KIO::NetAccess::upload( packageArch->name(), packageURL, KApplication::kApplication()->mainWidget() );
+// KIO::NetAccess::upload( kmf_install_package->name(), packageURL, KApplication::kApplication()->mainWidget() );
+//
+// kdDebug() << "Wrote package: " << packageURL.prettyURL() << endl;
+//
+// startup_script->close();
+// packageArch->close();
+// fw_script->close();
+// init_script_sysv->close();
+// init_script_gentoo->close();
+// kmf_intsall->close();
+// kmf_pkg_intsall->close();
+// kmf_install_package->close();
+//
+// startup_script->unlink();
+// packageArch->unlink();
+// fw_script->unlink();
+// init_script_sysv->unlink();
+// init_script_gentoo->unlink();
+// kmf_intsall->unlink();
+// kmf_pkg_intsall->unlink();
+// kmf_install_package->unlink();
+}
+
+//
+// void KMFPFInstaller::loadIcons() {
+// kdDebug() << "void KMFPFInstaller::loadIcons()" << endl;
+// KIconLoader *loader = KGlobal:: iconLoader();
+// QString icon_name;
+// icon_name = "encrypted";
+// icon_run = loader->loadIcon( icon_name, KIcon::Toolbar );
+//
+// icon_name = "decrypted";
+// icon_stop = loader->loadIcon( icon_name, KIcon::Toolbar );
+//
+// icon_name = "openterm";
+// icon_show = loader->loadIcon( icon_name, KIcon::Toolbar );
+// }
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFIPTablesCompilerFactory::s_instance = 0L;
+// KAboutData* KMFIPTablesCompilerFactory::s_about = 0L;
+
+KMFPFInstallerFactory::KMFPFInstallerFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFIPTablesCompilerFactory" );
+}
+
+QObject* KMFPFInstallerFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFPFInstaller( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFIPTablesCompilerFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFIPTablesCompilerFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfinstaller_openbsd() {
+ return new KMFPFInstallerFactory;
+ }
+}
+
+}
+
diff --git a/kmyfirewall/installer/openbsd/kmfpfinstaller.h b/kmyfirewall/installer/openbsd/kmfpfinstaller.h
new file mode 100644
index 0000000..5b562f2
--- /dev/null
+++ b/kmyfirewall/installer/openbsd/kmfpfinstaller.h
@@ -0,0 +1,116 @@
+/***************************************************************************
+ begin : Mon Jan 28 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef KMFPFINSTALLER_H
+#define KMFPFINSTALLER_H
+#include <qobject.h>
+#include <qpixmap.h>
+#include <qstringlist.h>
+
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+
+
+#include "../../core/kmfplugin.h"
+#include "../../core/kmfinstallerinterface.h"
+
+#include "../../kmyfirewall.h"
+
+class QString;
+class QLabel;
+class QPushButton;
+class QGridLayout;
+class KTempFile;
+class KInstance;
+
+
+namespace KMF {
+
+class KMFProcOut;
+class KMFError;
+class KMFTarget;
+class KMFErrorHandler;
+class KMFCompilerInterface;
+
+class KMFPFInstaller : public KMFPlugin, public KMFInstallerInterface {
+ Q_OBJECT
+
+public:
+ KMFPFInstaller( QObject* parent = 0, const char* name = 0 );
+ ~KMFPFInstaller();
+ virtual KMFCompilerInterface* compiler();
+ virtual void cmdRunFW();
+ virtual void cmdStopFW();
+ virtual void cmdInstallFW();
+ virtual void cmdUninstallFW();
+ virtual void cmdShowRunningConfig( const QString& );
+ virtual void generateInstallerPackage( KMFTarget*, const KURL& );
+ virtual const QString& osName() const {
+ return m_osName;
+ }
+ virtual const QString& osGUIName() const {
+ return m_osGUIName;
+ }
+ virtual QValueList<KMFCompilerInterface*>* compilers();
+
+
+
+public slots:
+
+
+private: // functions
+ QString m_osName;
+ QString m_osGUIName;
+ KMFProcOut* execWidget();
+
+/* void loadIcons();
+
+ KMFError* createInitScript( const QString& file, const QString& systemtype );
+
+
+ QString cmdShowAll();
+ QString cmdShowFilter();
+ QString cmdShowNat();
+ QString cmdShowMangle();
+ void installRemote();
+
+
+ void parseFileHeaders( const QString& source_file_path, const QString& target_file_path );
+ void writeBase64DataField( const QString& source_file_path, const QString& target_file_path, const QString& data );*/
+
+
+private:
+ KMFProcOut *m_execWidget;
+ QString m_script;
+
+};
+
+
+
+
+class KMFPFInstallerFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFPFInstallerFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFPFInstallerFactory() {};
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+};
+}
+
+#endif // KMFPFINSTALLER_H
diff --git a/kmyfirewall/ipteditor/Makefile.am b/kmyfirewall/ipteditor/Makefile.am
new file mode 100644
index 0000000..3c83753
--- /dev/null
+++ b/kmyfirewall/ipteditor/Makefile.am
@@ -0,0 +1,34 @@
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes) -I../kmfwidgets -I../core
+
+METASOURCES = AUTO
+#########################################################################
+# KPART SECTION
+#########################################################################
+
+
+# this is where the desktop file will go
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfipteditorpart.desktop
+
+# this is where the part's XML-GUI resource file goes
+partrcdir = $(kde_datadir)/kmfipteditorpart
+partrc_DATA = kmfipteditorpartui.rc
+kde_module_LTLIBRARIES = libkmfipteditorpart.la
+
+libkmfipteditorpart_la_SOURCES = kmfchainedit.cpp kmfnewchaindlg.cpp kmfruleedit.cpp kmfipteditorpart.cpp kmyfirewallchaineditor.ui kmyfirewallchaineditornewchain.ui kmyfirewallruleeditor.ui
+
+noinst_HEADERS = kmfchainedit.h kmfnewchaindlg.h kmfruleedit.h kmfipteditorpart.h
+
+libkmfipteditorpart_la_LDFLAGS = -module -no-undefined $(all_libraries) \
+ $(KDE_PLUGIN)
+libkmfipteditorpart_la_LIBADD = \
+ $(LIB_KPARTS) ../kmfwidgets/libkmfwidgets.la ../core/libkmfcore.la
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_frag_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_frag_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_frag_option.xml
+
diff --git a/kmyfirewall/ipteditor/kmfchainedit.cpp b/kmyfirewall/ipteditor/kmfchainedit.cpp
new file mode 100644
index 0000000..5518019
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfchainedit.cpp
@@ -0,0 +1,252 @@
+/***************************************************************************
+ begin : Sat Mar 2 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "kmfchainedit.h"
+#include "kmfchainedit.moc"
+
+
+//QT includes
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qframe.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qlistbox.h>
+#include <qlcdnumber.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qinputdialog.h>
+#include <qtabwidget.h>
+
+// KDE includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+
+// Project Includes
+#include "../core/xmlnames.h"
+#include "../core/kmfiptdoc.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmfundoengine.h"
+
+// #include "../kmyfirewall.h"
+
+
+
+
+
+namespace KMF {
+KMFChainEdit::KMFChainEdit( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallChainEditor( parent, name, fl ) {}
+KMFChainEdit::~KMFChainEdit() {}
+
+void KMFChainEdit::loadChain( IPTChain* chain ) {
+ kdDebug() << "void KMFChainEdit::editChain(IPTChain* ch)" << endl;
+ c_has_default_target->setChecked( false );
+ c_enable_log->setChecked( false );
+ c_log_limit->setChecked( false );
+ c_log_burst->setChecked( false );
+ c_log_prefix ->setChecked( false );
+ // t_log_prefix->clear();
+ m_tabWidget->setCurrentPage( 0 );
+
+ if ( ! chain ) {
+ setEnabled(false);
+ } else {
+ setEnabled(true);
+ m_chain = chain;
+ l_chain_name->setText( m_chain->name() );
+ l_chain_table->setText( m_chain->table() ->name() );
+ QPtrList<IPTRule> list_rules = m_chain->chainRuleset();
+ QPtrList<IPTRule> list_feeds = m_chain->chainFeeds();
+ QPtrList<IPTRule> list_fwds = m_chain->chainFwds();
+
+ int num_rules = list_rules.count();
+ int num_feeds = list_feeds.count();
+ int num_fwds = list_fwds.count();
+
+ kdDebug() << "num_rules = " << num_rules << endl;
+ kdDebug() << "num_FEEDS = " << num_feeds << endl;
+ kdDebug() << "num_fwds = " << num_fwds << endl;
+
+ lcd_rules->display( num_rules );
+ lcd_feeds->display( num_feeds );
+ lcd_fwds->display( num_fwds );
+
+ kdDebug() << "Found Chain " << m_chain->name() << endl;
+ // show default target
+ if ( m_chain->isBuildIn() ) {
+ cb_target->clear();
+ cb_target->insertItem( "ACCEPT" );
+ cb_target->insertItem( "DROP" );
+ QString tg = m_chain->defaultTarget();
+ if ( tg == "ACCEPT" )
+ cb_target->setCurrentItem( 0 );
+ if ( tg == "DROP" )
+ cb_target->setCurrentItem( 1 );
+ c_has_default_target->setChecked( false );
+ } else if ( m_chain->hasDefaultTarget() ) {
+ cb_target->clear();
+ cb_target->insertItem( "ACCEPT" );
+ cb_target->insertItem( "DROP" );
+ c_has_default_target->setEnabled( true );
+ c_has_default_target->setChecked( true );
+ QString tg = m_chain->defaultTarget();
+ if ( tg == "ACCEPT" )
+ cb_target->setCurrentItem( 0 );
+ if ( tg == "DROP" )
+ cb_target->setCurrentItem( 1 );
+ } else {
+ c_has_default_target->setEnabled( true );
+ c_has_default_target->setChecked( false );
+ connect( c_has_default_target, SIGNAL( toggled( bool ) ), cb_target, SLOT( setEnabled( bool ) ) );
+ cb_target->clear();
+ cb_target->insertItem( "ACCEPT" );
+ cb_target->insertItem( "DROP" );
+ cb_target->setEnabled( false );
+ }
+ // show logging settings
+ bool logging = false;
+ QString log_limit = "";
+ QString log_prefix = "";
+ QString log_burst = "";
+ logging = m_chain->logging();
+ log_limit = m_chain->logLimit();
+ log_prefix = m_chain->logPrefix();
+ log_burst = m_chain->logBurst();
+ if ( logging ) {
+ c_enable_log->setChecked( true );
+ if ( ! log_prefix.isEmpty() && log_prefix != XML::Undefined_Value ) {
+ kdDebug() << "Found Log Prefix: " << log_prefix << endl;
+ c_log_prefix->setChecked( true );
+ t_log_prefix->setText( log_prefix );
+ } else {
+ c_log_prefix->setChecked( false );
+ }
+ if ( !log_limit.isEmpty() && log_limit != XML::Undefined_Value ) {
+ c_log_limit->setChecked( true );
+ int i = log_limit.find( "/" );
+ QString str_num = log_limit.left( i );
+ QString interval = log_limit.remove( 0, i + 1 );
+ if ( interval == "second" ) {
+ cb_interval->setCurrentItem( 0 );
+ } else if ( interval == "minute" ) {
+ cb_interval->setCurrentItem( 1 );
+ } else if ( interval == "hour" ) {
+ cb_interval->setCurrentItem( 2 );
+ } else {
+ KMessageBox::sorry( this, i18n( "Your config is not valid; it appears to be a bug." ) );
+ c_log_limit->setChecked( false );
+ }
+ sb_limit->setValue( str_num.toInt() );
+ kdDebug() << "Found Log Limit: " << str_num << "/" << interval << endl;
+ if ( ! log_burst.isEmpty() && log_burst != XML::Undefined_Value ) {
+ c_log_burst->setChecked( true );
+ sb_burst->setValue( log_burst.toInt() );
+ } else {
+ c_log_burst->setChecked( false );
+ // sb_burst->setValue( 5 );
+ }
+ } else {
+ c_log_limit->setChecked( false );
+ }
+ } else {
+ c_enable_log->setChecked( false );
+ c_log_prefix->setChecked( false );
+ c_log_limit->setChecked( false );
+ c_log_burst->setChecked( false );
+ }
+ }
+}
+
+
+
+void KMFChainEdit::accept() {
+ kdDebug() << "KMyFirewallChainEditor::slotSaveChainChanges()" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_chain,
+ i18n( "Edit Chain: %1 properties" ).arg( m_chain->name() )
+ );
+ bool log = c_enable_log->isChecked();
+ bool log_limit = c_log_limit->isChecked();
+ bool log_prefix = c_log_prefix->isChecked();
+ bool log_burst = c_log_burst->isChecked();
+
+ QString target = cb_target->currentText();
+ kdDebug() << "Try to set Target to : " << target << endl;
+
+ if ( m_chain->isBuildIn() ) {
+ m_chain->setDefaultTarget( target );
+ } else if ( c_has_default_target->isChecked() ) {
+ m_chain->hasCustomDefaultTarget( true );
+ m_chain->setDefaultTarget( target );
+ } else
+ m_chain->hasCustomDefaultTarget( false );
+
+ QString str_log_limit = XML::Undefined_Value;
+ QString str_log_prefix = XML::Undefined_Value;
+ QString str_log_burst = XML::Undefined_Value;
+ if ( log ) {
+ kdDebug() << "You wanna Loga a little bit" << endl;
+ // set log limit
+ if ( log_prefix && ! t_log_prefix->text().isEmpty() ) {
+ str_log_prefix = t_log_prefix->text();
+ kdDebug() << "You wanna have as log prefix: " << str_log_prefix << endl;
+ }
+ if ( log_limit ) { // set log limit
+ QString str_limit_num = sb_limit->text();
+ QString str_interval = cb_interval->currentText();
+ str_log_limit = str_limit_num + "/" + str_interval;
+ kdDebug() << "You wanna have " << str_log_limit << " as Logging limit" << endl;
+
+ if ( log_burst ) {
+ str_log_burst = sb_burst->text();
+ } else {
+ str_log_burst = XML::Undefined_Value;
+ }
+ } else {
+ str_log_limit = XML::Undefined_Value;
+ }
+ m_chain->setDropLogging( true, str_log_limit, str_log_burst, str_log_prefix );
+ } else { // disable chain_logging
+ str_log_limit = XML::Undefined_Value;
+ str_log_prefix = XML::Undefined_Value;
+ str_log_burst = XML::Undefined_Value;
+ m_chain->setDropLogging( false, str_log_limit, str_log_burst, str_log_prefix );
+ }
+
+ m_chain->table()->changed();
+ emit sigDocumentChanged();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+}
+
+void KMFChainEdit::slotHelp() {
+ kdDebug() << "void KMFChainEdit::slotHelp()" << endl;
+ kapp->invokeHelp( "chains" );
+}
+void KMFChainEdit::reject() {
+ kdDebug() << "void KMFChainEdit::reject()" << endl;
+ emit sigHideMe();
+}
+
+}
diff --git a/kmyfirewall/ipteditor/kmfchainedit.h b/kmyfirewall/ipteditor/kmfchainedit.h
new file mode 100644
index 0000000..f0ee87c
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfchainedit.h
@@ -0,0 +1,48 @@
+/***************************************************************************
+ begin : Sat Mar 2 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFCHAINEDIT_H
+#define KMFCHAINEDIT_H
+#include <qobject.h>
+#include <qwidget.h>
+#include "../core/kmfdoc.h"
+#include "../core/iptchain.h"
+#include "kmyfirewallchaineditor.h"
+/**
+ *@author Christian Hubinger
+ */
+
+namespace KMF {
+class KMFChainEdit : public KMyFirewallChainEditor {
+ Q_OBJECT
+public:
+ KMFChainEdit( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFChainEdit();
+
+ void loadChain( IPTChain* );
+public slots:
+ void accept();
+ void reject();
+ void slotHelp();
+private:
+ IPTChain* m_chain;
+
+signals:
+ void documentChanged( KMFIPTDoc& );
+ void sigDocumentChanged();
+ void sigHideMe();
+};
+}
+#endif
diff --git a/kmyfirewall/ipteditor/kmfipteditorpart.cpp b/kmyfirewall/ipteditor/kmfipteditorpart.cpp
new file mode 100644
index 0000000..f4956d9
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfipteditorpart.cpp
@@ -0,0 +1,308 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001
+*/
+
+#include "kmfipteditorpart.h"
+
+
+// QT includes
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qmultilineedit.h>
+
+
+// KDE includes
+#include <kinstance.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kaccel.h>
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kiconloader.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// Project includes
+#include "kmfruleedit.h"
+#include "../core/kmyfirewallinterface.h"
+#include "../kmfwidgets/kmfmainwindow.h"
+#include "../kmfwidgets/kmfiptdocoptions.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmfdoc.h"
+#include "../core/kmfiptdoc.h"
+namespace KMF {
+KMFIPTEditorPart::KMFIPTEditorPart( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name )
+ : KParts::ReadWritePart( parent, name ) {
+ KMFMainWindow *app = 0;
+ // we need an instance
+ setInstance( KMFIPTEditorPartFactory::instance() );
+
+
+ app = dynamic_cast<KMFMainWindow*>( parent );
+ if ( ! app ) {
+ KMessageBox::error(0,"Oops wrong parent class found for kmfinstallerplugin!!!");
+ }
+
+ // this should be your custom internal widget
+ m_ruleedit = new KMFRuleEdit( parentWidget, widgetName );
+ m_ruleedit->setKMFMainWindow( app );
+ m_ruleedit->setFocusPolicy( QWidget::ClickFocus );
+
+ m_editdoc = new KMFIPTDocOptions( parentWidget , "m_editdoc" );
+ m_editdoc->hide();
+
+ m_ruleedit->loadDoc( app->network() );
+ m_editdoc->loadDoc( app->network()->currentDocAsIPTDoc() );
+
+ connect( app, SIGNAL( sigUpdateView() ),
+ m_ruleedit, SLOT( slotUpdateView() ) );
+
+ connect( app, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_ruleedit, SIGNAL( sigUpdateView( NetfilterObject* ) ) );
+
+ connect( app, SIGNAL( sigEnableActions( bool ) ),
+ this, SLOT( slotEnableActions( bool ) ) );
+
+ connect ( m_editdoc, SIGNAL( sigConfigChanged() ),
+ m_ruleedit, SLOT( slotUpdateView() ) );
+
+ // notify the part that this is our internal widget
+ setWidget( m_ruleedit );
+
+ m_actionEditChain = new KAction( i18n( "&Edit Chain" ), QIconSet( BarIcon( "configure_toolbars", KMFIPTEditorPartFactory::instance() ) ),
+ 0 , this, SLOT( slotEditChain() ), actionCollection(), "edit_chain" );
+
+ m_actionNewChain = new KAction( i18n( "Add New Chain..." ), QIconSet( BarIcon( "view_tree", KMFIPTEditorPartFactory::instance() ) ),
+ 0 , this, SLOT( slotNewChain() ), actionCollection(), "new_chain" );
+
+ m_actionDelChain = new KAction( i18n( "Delete Chain" ), QIconSet( BarIcon( "editdelete", KMFIPTEditorPartFactory::instance() ) ),
+ 0 , this, SLOT( slotDelChain() ), actionCollection(), "del_chain" );
+
+
+ m_actionNewRule = new KAction( i18n( "Add New Rule..." ), QIconSet( KGlobal:: iconLoader()->loadIcon( "rule", KIcon::Toolbar ) ) ,
+ KStdAccel::shortcut(KStdAccel::New) , this, SLOT( slotNewRule() ), actionCollection(), "new_rule" );
+
+// m_actionNewRule->setIconSet( QIconSet( loader->loadIcon( "rule-22", KIcon::User ) ) );
+
+ m_actionDelRule = new KAction( i18n( "Delete Rule" ), QIconSet( BarIcon( "editdelete", KMFIPTEditorPartFactory::instance() ) ),
+ KStdAccel::shortcut(KStdAccel::DeleteWordBack), this, SLOT( slotDelRule() ), actionCollection(), "del_rule" );
+
+ m_actionEditDocOptions = new KAction( i18n( "&Configure Firewall Options..." ), "configure", 0 , this, SLOT( slotEditDocOptions() ),
+ actionCollection(), "edit_doc_options" );
+
+
+ m_actionEditNetwork = new KAction( i18n( "&Configure the Network" ), QIconSet( BarIcon( "configure_toolbars", KMFIPTEditorPartFactory::instance() ) ), 0 , this, SLOT( slotEditNetwork() ),
+ actionCollection(), "edit_network" );
+
+
+ // set our XML-UI resource file
+ setXMLFile( "kmfipteditorpartui.rc" );
+
+ // we are read-write by default
+ setReadWrite( true );
+
+ // we are not modified since we haven't done anything yet
+ setModified( false );
+}
+
+KMFIPTEditorPart::~KMFIPTEditorPart() {}
+
+void KMFIPTEditorPart::setReadWrite( bool rw ) {
+ // notify your internal widget of the read-write state
+
+ ReadWritePart::setReadWrite( rw );
+}
+
+void KMFIPTEditorPart::slotEditDocOptions() {
+ KMFMainWindow* app = dynamic_cast<KMFMainWindow*>( parent() );
+ if ( ! app ) {
+ KMessageBox::error(0,"Oops wrong parent class found for KMFIPTEditorPart!!!");
+ return;
+ }
+ m_editdoc->loadDoc( app->network()->currentDocAsIPTDoc() );
+ m_editdoc ->show();
+}
+
+
+void KMFIPTEditorPart::slotEditChain() {
+ m_ruleedit->slotEditChain();
+}
+
+void KMFIPTEditorPart::slotNewChain() {
+ m_ruleedit->slotAddChain();
+}
+
+void KMFIPTEditorPart::slotDelChain() {
+ m_ruleedit->slotDelChain();
+}
+
+void KMFIPTEditorPart::slotNewRule() {
+ m_ruleedit->slotAddRule();
+}
+
+void KMFIPTEditorPart::slotDelRule() {
+ m_ruleedit->slotDelRule();
+}
+
+void KMFIPTEditorPart::slotEditNetwork() {
+ kdDebug() << "KMFIPTEditorPart::slotEditNetwork()" << endl;
+ m_ruleedit->slotEditNetwork();
+}
+
+
+//###########################################
+void KMFIPTEditorPart::setModified( bool modified ) {
+ // get a handle on our Save action and make sure it is valid
+ KAction * save = actionCollection() ->action( KStdAction::stdName( KStdAction::Save ) );
+ if ( !save )
+ return ;
+
+ // if so, we either enable or disable it based on the current
+ // state
+ if ( modified )
+ save->setEnabled( true );
+ else
+ save->setEnabled( false );
+
+ // in any event, we want our parent to do it's thing
+ ReadWritePart::setModified( modified );
+}
+
+bool KMFIPTEditorPart::openFile() {
+ // m_file is always local so we can use QFile on it
+ // QFile file(m_file);
+ // if (file.open(IO_ReadOnly) == false)
+ // return false;
+ //
+ // // our example widget is text-based, so we use QTextStream instead
+ // // of a raw QDataStream
+ // QTextStream stream(&file);
+ // QString str;
+ // while (!stream.eof())
+ // str += stream.readLine() + "\n";
+ //
+ // file.close();
+ //
+ // // now that we have the entire file, display it
+ // // m_widget->setText(str);
+ //
+ // // just for fun, set the status bar
+ // emit setStatusBarText( m_url.prettyURL() );
+
+ return true;
+}
+
+bool KMFIPTEditorPart::saveFile() {
+ // if we aren't read-write, return immediately
+ /* if (isReadWrite() == false)
+ return false;
+
+ // m_file is always local, so we use QFile
+ QFile file(m_file);
+ if (file.open(IO_WriteOnly) == false)
+ return false;
+
+ // use QTextStream to dump the text to the file
+ QTextStream stream(&file);
+ stream << m_widget->text();
+
+ file.close();
+ */
+ return true;
+}
+
+void KMFIPTEditorPart::fileOpen() {
+ // this slot is called whenever the File->Open menu is selected,
+ // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
+ // button is clicked
+ /* QString file_name = KFileDialog::getOpenFileName();
+
+ if (file_name.isEmpty() == false)
+ openURL(file_name);*/
+}
+
+void KMFIPTEditorPart::fileSaveAs() {
+ // this slot is called whenever the File->Save As menu is selected,
+ /* QString file_name = KFileDialog::getSaveFileName();
+ if (file_name.isEmpty() == false)
+ saveAs(file_name);*/
+}
+
+void KMFIPTEditorPart::slotEnableActions( bool on ) {
+ if ( on ) {
+ m_actionEditChain->setEnabled( true );
+ m_actionNewChain->setEnabled( true );
+ m_actionNewRule->setEnabled( true );
+ m_actionDelChain->setEnabled( true );
+ m_actionDelRule->setEnabled( true );
+ m_actionEditDocOptions->setEnabled( true );
+ } else {
+ m_actionEditChain->setEnabled( false );
+ m_actionNewChain->setEnabled( false );
+ m_actionNewRule->setEnabled( false );
+ m_actionDelChain->setEnabled( false );
+ m_actionDelRule->setEnabled( false );
+ m_actionEditDocOptions->setEnabled( false );
+
+ }
+}
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+
+KInstance* KMFIPTEditorPartFactory::s_instance = 0L;
+KAboutData* KMFIPTEditorPartFactory::s_about = 0L;
+
+KMFIPTEditorPartFactory::KMFIPTEditorPartFactory()
+ : KParts::Factory() {}
+
+KMFIPTEditorPartFactory::~KMFIPTEditorPartFactory() {
+ delete s_instance;
+ delete s_about;
+
+ s_instance = 0L;
+}
+
+KParts::Part* KMFIPTEditorPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name,
+ const char *classname, const QStringList& ) {
+ // Create an instance of our Part
+ KMFIPTEditorPart * obj = new KMFIPTEditorPart( parentWidget, widgetName, parent, name );
+
+ // See if we are to be read-write or not
+ if ( QCString( classname ) == "KParts::ReadOnlyPart" )
+ obj->setReadWrite( false );
+
+ return obj;
+}
+
+KInstance* KMFIPTEditorPartFactory::instance() {
+ if ( !s_instance ) {
+ s_about = new KAboutData( "kmfipteditorpart", I18N_NOOP( "kmfipteditorpartPart" ), "0.1" );
+ s_about->addAuthor( "Christian Hubinger", 0, "chubinger@irrsinnig.org" );
+ s_instance = new KInstance( s_about );
+ }
+ return s_instance;
+}
+
+extern "C" {
+ void* init_libkmfipteditorpart() {
+ return new KMFIPTEditorPartFactory;
+ }
+}
+
+}
+
+#include "kmfipteditorpart.moc"
diff --git a/kmyfirewall/ipteditor/kmfipteditorpart.desktop b/kmyfirewall/ipteditor/kmfipteditorpart.desktop
new file mode 100644
index 0000000..2c87a25
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfipteditorpart.desktop
@@ -0,0 +1,15 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Name=KMFIPTEditorPart
+Name[fr]=Module d'éditeur KMFIPT
+Name[hi]=केएमएफ़आईपीटी-एडिटर-पार्ट
+Name[pt_BR]=Componente Editor KMFIP
+Name[sv]=IPT-editordel för Min brandvägg
+Name[ta]=KMFIPTதொகுபி பகுதி
+Name[tr]=KMF IPT Düzenleyici Parçası
+Name[xx]=xxKMFIPTEditorPartxx
+Name[zh_CN]=KMFip 规则表编辑器组件
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
+ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart
+X-KDE-Library=libkkmfipteditoprat
diff --git a/kmyfirewall/ipteditor/kmfipteditorpart.h b/kmyfirewall/ipteditor/kmfipteditorpart.h
new file mode 100644
index 0000000..c188a52
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfipteditorpart.h
@@ -0,0 +1,124 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001
+*/
+
+#ifndef _KMFIPTEDITORPART_H_
+#define _KMFIPTEDITORPART_H_
+
+#include <kparts/part.h>
+#include <kparts/factory.h>
+
+class QWidget;
+class QPainter;
+class KURL;
+class KAction;
+class KActionMenu;
+class KInstance;
+class KAboutData;
+
+namespace KMF {
+class KMFRuleEdit;
+class KMFIPTDoc;
+class KMFIPTDocOptions;
+
+/**
+ * This is a "Part". It that does all the real work in a KPart
+ * application.
+ *
+ * @short Main Part
+ * @author Chris <chubinger@irrsinnig.org>
+ * @version 0.1
+ */
+
+class KMFIPTEditorPart : public KParts::ReadWritePart
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ KMFIPTEditorPart(QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name);
+
+ /**
+ * Destructor
+ */
+ virtual ~KMFIPTEditorPart();
+
+ /**
+ * This is a virtual function inherited from KParts::ReadWritePart.
+ * A shell will use this to inform this Part if it should act
+ * read-only
+ */
+ virtual void setReadWrite(bool rw);
+
+ /**
+ * Reimplemented to disable and enable Save action
+ */
+ virtual void setModified(bool modified);
+
+protected:
+ /**
+ * This must be implemented by each part
+ */
+ virtual bool openFile();
+
+ /**
+ * This must be implemented by each read-write part
+ */
+ virtual bool saveFile();
+
+public slots:
+ void slotEnableActions( bool );
+
+protected slots:
+ void fileOpen();
+ void fileSaveAs();
+ void slotEditChain();
+ void slotNewChain();
+ void slotDelChain();
+ void slotNewRule();
+ void slotDelRule();
+ void slotEditDocOptions();
+ void slotEditNetwork();
+
+private:
+ KMFRuleEdit *m_ruleedit;
+ KMFIPTDoc* m_doc;
+ KMFIPTDocOptions *m_editdoc;
+ KAction* m_actionEditNetwork;
+ KAction* m_actionEditChain;
+ KAction* m_actionNewChain;
+ KAction* m_actionNewRule;
+ KAction* m_actionDelChain;
+ KAction* m_actionDelRule;
+ KAction* m_actionEditDocOptions;
+};
+
+
+class KMFIPTEditorPartFactory : public KParts::Factory
+{
+ Q_OBJECT
+public:
+ KMFIPTEditorPartFactory();
+ virtual ~KMFIPTEditorPartFactory();
+ virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name,
+ const char *classname, const QStringList &args );
+ static KInstance* instance();
+
+private:
+ static KInstance* s_instance;
+ static KAboutData* s_about;
+};
+
+}
+#endif // _KMFRULEEDITPART_H_
diff --git a/kmyfirewall/ipteditor/kmfipteditorpartui.rc b/kmyfirewall/ipteditor/kmfipteditorpartui.rc
new file mode 100644
index 0000000..4321120
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfipteditorpartui.rc
@@ -0,0 +1,29 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kmfipteditorpart" version="1">
+<MenuBar>
+ <Menu name="network"><text>&amp;My Network</text>
+ <Action name="edit_network" />
+ </Menu>
+ <Menu name="iptables"><text>&amp;IPTables</text>
+ <Action name="new_rule"/>
+ <Action name="del_rule"/>
+ <Separator lineSeparator="true"/>
+ <Action name="new_chain"/>
+ <Action name="del_chain"/>
+ <Separator lineSeparator="true"/>
+ <Action name="edit_chain"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="edit_network" />
+ <Separator lineSeparator="true"/>
+ <Action name="edit_doc_options"/>
+ <Action name="new_rule"/>
+ <Separator lineSeparator="true"/>
+ <Action name="new_chain"/>
+ <Action name="edit_chain"/>
+</ToolBar>
+</kpartgui>
+
+
+
diff --git a/kmyfirewall/ipteditor/kmfnewchaindlg.cpp b/kmyfirewall/ipteditor/kmfnewchaindlg.cpp
new file mode 100644
index 0000000..feff7ce
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfnewchaindlg.cpp
@@ -0,0 +1,115 @@
+/***************************************************************************
+ begin : Sat Mar 9 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfnewchaindlg.h"
+
+// qt includes
+#include <qstring.h>
+#include <qradiobutton.h>
+#include <qlineedit.h>
+#include <qnamespace.h>
+#include <qevent.h>
+
+// kde includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+
+// my includes
+#include "../core/xmlnames.h"
+#include "../core/kmfdoc.h"
+#include "../core/kmfiptdoc.h"
+#include "../core/kmferror.h"
+#include "../core/kmfcheckinput.h"
+#include "../core/kmferrorhandler.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmfundoengine.h"
+namespace KMF {
+KMFNewChainDlg::KMFNewChainDlg ( QWidget *parent, const char *name, bool modal, WFlags fl ) : KMyFirewallChainEditorNewChain ( parent, name, modal, fl ) {
+ kmfdoc = 0;
+ m_err = new KMFError();
+ m_err_handler = new KMFErrorHandler ( "KMFNewChainDlg" );
+ m_check_input = new KMFCheckInput();
+}
+
+KMFNewChainDlg::~KMFNewChainDlg() {}
+
+void KMFNewChainDlg::keyPressEvent ( QKeyEvent * e ) {
+ // kdDebug() << "KMFNewChainDlg::keyPressEvent ( QKeyEvent * " << e->key() << ")" << endl;
+ if ( e->key() == Qt::Key_Enter ||
+ e->key() == Qt::Key_Return ) {
+ accept();
+ e-> accept();
+ }
+ if ( e->key() == Qt::Key_Escape ||
+ e->key() == Qt::Key_Backspace ) {
+ QDialog::reject();
+ e-> accept();
+ }
+}
+
+void KMFNewChainDlg::loadDoc ( KMFIPTDoc* doc ) {
+ kmfdoc = doc;
+}
+/** No descriptions */
+void KMFNewChainDlg::accept() {
+ if ( kmfdoc == 0 ) {
+ KMessageBox::error ( 0, i18n ( "KMFNewChainDlg: kmfdoc = 0. This happened because of a bug." ) );
+ return ;
+ }
+ QStringList StringList;
+ QString name = t_name->text();
+ QString target = "DROP";
+ if ( !name.isEmpty() ) {
+ m_check_input->checkInput ( name, "CHAINNAME", m_err );
+ if ( ! m_err_handler->showError ( m_err ) ) {
+ return;
+ }
+
+ IPTChain* chain = 0;
+ QString table = Constants::FilterTable_Name;
+ if ( c_filter->isChecked() ) {
+ table = Constants::FilterTable_Name;
+ } else if ( c_nat->isChecked() ) {
+ table = Constants::NatTable_Name;
+ } else if ( c_mangle->isChecked() ) {
+ table = Constants::MangleTable_Name;
+ } else {
+ return;
+ }
+
+ KMFUndoEngine::instance()->startTransaction (
+ kmfdoc->table ( table ),
+ i18n ( "Added Chain: %1 to Table: %1" ).arg ( name ).arg ( table )
+ );
+ chain = kmfdoc->table ( table )->addChain ( name, target, false, m_err );
+ if ( m_err_handler->showError ( m_err ) ) {
+ kmfdoc->table ( table )->changed();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigUpdateView();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ return;
+ }
+ QDialog::accept();
+ } else {
+ KMessageBox::sorry ( 0, i18n ( "You must set a name for your chain." ) );
+ return;
+ }
+}
+
+}
+
+#include "kmfnewchaindlg.moc"
diff --git a/kmyfirewall/ipteditor/kmfnewchaindlg.h b/kmyfirewall/ipteditor/kmfnewchaindlg.h
new file mode 100644
index 0000000..e5c09bc
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfnewchaindlg.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ begin : Sat Mar 9 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFNEWCHAINDLG_H
+#define KMFNEWCHAINDLG_H
+
+#include <qwidget.h>
+#include <qstringlist.h>
+#include "kmyfirewallchaineditornewchain.h"
+#include <qevent.h>
+/**
+ *@author Christian Hubinger
+ */
+
+
+namespace KMF {
+class KMFIPTDoc;
+class KMFError;
+class KMFErrorHandler;
+class KMFCheckInput;
+
+class KMFNewChainDlg : public KMyFirewallChainEditorNewChain {
+ Q_OBJECT
+public:
+ KMFNewChainDlg( QWidget *parent = 0, const char *name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~KMFNewChainDlg();
+ void loadDoc( KMFIPTDoc* doc );
+
+public slots: // Public slots
+ /** No descriptions */
+ void accept();
+
+private:
+ KMFIPTDoc* kmfdoc;
+ KMFError* m_err;
+ KMFErrorHandler* m_err_handler;
+ KMFCheckInput* m_check_input;
+
+protected:
+ virtual void keyPressEvent ( QKeyEvent * e );
+
+
+signals:
+ void sigUpdateView();
+
+};
+}
+#endif
diff --git a/kmyfirewall/ipteditor/kmfruleedit.cpp b/kmyfirewall/ipteditor/kmfruleedit.cpp
new file mode 100644
index 0000000..39a95a2
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfruleedit.cpp
@@ -0,0 +1,1517 @@
+/***************************************************************************
+begin : Thu Feb 7 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "kmfruleedit.h"
+
+//KDE includes
+#include <kled.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kpopupmenu.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+#include <klistbox.h>
+#include <kpushbutton.h>
+#include <kcombobox.h>
+#include <ktrader.h>
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+
+//QT includes
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qheader.h>
+#include <qsplitter.h>
+
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qinputdialog.h>
+#include <qlabel.h>
+#include <qmessagebox.h>
+#include <qgroupbox.h>
+#include <qsize.h>
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+#include <qwidgetstack.h>
+
+// project includes
+#include "../core/xmlnames.h"
+#include "../core/kmfdoc.h"
+#include "../core/kmfiptdoc.h"
+#include "../core/kmfnetwork.h"
+#include "../core/iptchain.h"
+#include "../core/iptrule.h"
+#include "../core/kmfcheckinput.h"
+#include "../core/kmferror.h"
+#include "../core/kmferrorhandler.h"
+#include "../core/kmfconfig.h"
+#include "../core/kmfpluginfactory.h"
+#include "../core/kmfappstate.h"
+#include "../core/kmyfirewallinterface.h"
+#include "../core/kmfruleoptioneditinterface.h"
+#include "../core/kmfruletargetoptioneditinterface.h"
+
+
+#include "../kmfwidgets/kmflistview.h"
+#include "../kmfwidgets/kmfmynetworkwidget.h"
+#include "../kmfwidgets/kmflistviewitem.h"
+#include "../kmfwidgets/kmfobjectinfo.h"
+#include "../kmfwidgets/kmfmainwindow.h"
+
+#include "kmfchainedit.h"
+#include "kmfnewchaindlg.h"
+namespace KMF {
+KMFRuleEdit::KMFRuleEdit( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallRuleEditor( parent, name, fl ), KMFRuleEditInterface() {
+ if ( !name )
+ setName( "KMFRuleEdit" );
+ m_lastDisplayDoc = 0;
+ loadIcons();
+ m_editPlugins.clear();
+ b_move_up->setPixmap( icon_up );
+ b_move_down->setPixmap( icon_down );
+ // need to remove dummy page from QTDesigner ;-)
+ m_ws_target_opt->removeWidget( page );
+
+ m_err = new KMFError();
+ m_err_handler = new KMFErrorHandler( "KMFRuleEdit" );
+ kb_optSelect->clear();
+ connect( kb_optSelect, SIGNAL( activated( int ) ) , this, SLOT( slotNewOptionType( int ) ) );
+
+ m_lv_table_filter = new KMFListView( m_widgetStack, "m_lv_table_filter" );
+ m_lv_table_filter->show();
+
+ connect( m_lv_table_filter, SIGNAL( contextMenuRequested ( QListViewItem*, const QPoint&, int ) ),
+ this, SLOT( slotRuleRBM( QListViewItem*, const QPoint&, int ) ) );
+
+ connect( m_lv_table_filter, SIGNAL( itemRenamed ( QListViewItem*, int, const QString& ) ),
+ this, SLOT( slotRenameRule( QListViewItem*, int, const QString& ) ) );
+
+ connect( m_lv_table_filter, SIGNAL( clicked( QListViewItem* ) ),
+ this, SLOT( slotNewItemSelected( QListViewItem* ) ) );
+
+// connect( this, SIGNAL( sigUpdateView() ),
+// m_lv_table_filter, SLOT( slotUpdateView() ) );
+
+ m_widgetStack->addWidget( m_lv_table_filter );
+
+
+ m_lv_table_nat = new KMFListView( m_widgetStack, "m_lv_table_nat" );
+ m_lv_table_nat->show();
+
+ connect( m_lv_table_nat, SIGNAL( contextMenuRequested ( QListViewItem*, const QPoint&, int ) ),
+ this, SLOT( slotRuleRBM( QListViewItem*, const QPoint&, int ) ) );
+
+ connect( m_lv_table_nat, SIGNAL( itemRenamed ( QListViewItem*, int, const QString& ) ),
+ this, SLOT( slotRenameRule( QListViewItem*, int, const QString& ) ) );
+
+ connect( m_lv_table_nat, SIGNAL( clicked( QListViewItem* ) ),
+ this, SLOT( slotNewItemSelected( QListViewItem* ) ) );
+
+ m_widgetStack->addWidget( m_lv_table_nat );
+
+ m_lv_table_mangle = new KMFListView( m_widgetStack, "m_lv_table_mangle" );
+ m_lv_table_mangle->show();
+
+ connect( m_lv_table_mangle, SIGNAL( contextMenuRequested ( QListViewItem*, const QPoint&, int ) ),
+ this, SLOT( slotRuleRBM( QListViewItem*, const QPoint&, int ) ) );
+
+ connect( m_lv_table_mangle, SIGNAL( itemRenamed ( QListViewItem*, int, const QString& ) ),
+ this, SLOT( slotRenameRule( QListViewItem*, int, const QString& ) ) );
+
+ connect( m_lv_table_mangle, SIGNAL( clicked( QListViewItem* ) ),
+ this, SLOT( slotNewItemSelected( QListViewItem* ) ) );
+
+
+
+ m_widgetStack->addWidget( m_lv_table_mangle );
+
+ m_splitter->setResizeMode( gb_options, QSplitter::KeepSize );
+
+ m_editchain = new KMFChainEdit( this, "chianditor", 0 );
+ kdDebug() << "CONNECTING CHAINEDITOR" << endl;
+ connect( m_editchain, SIGNAL( sigHideMe() ),
+ this, SLOT( slotShowOverview() ) );
+ m_widgetStack->addWidget( m_editchain );
+
+
+ m_object_info = new KMFObjectInfo( this, "rule info" );
+ connect( m_object_info, SIGNAL( sigHideMe() ),
+ this, SLOT( slotShowOverview() ) );
+
+ m_widgetStack->addWidget( m_object_info );
+
+ m_new_chain = new KMFNewChainDlg();
+ connect( m_new_chain, SIGNAL( sigUpdateView() ),
+ this, SIGNAL( sigUpdateView() ) );
+
+ m_myNetworkWidget = new KMFMyNetworkWidget( this, "KMFMyNetworkWidget" );
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_myNetworkWidget, SLOT( slotUpdateView() ) );
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_myNetworkWidget, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ connect( m_myNetworkWidget, SIGNAL( sigActiveTargetChanged() ), this, SLOT( slotUpdateView() ) );
+ m_myNetworkWidget->hide(); //close( false );
+
+ m_check_input = new KMFCheckInput();
+ m_contextMenu = new KPopupMenu( this );
+
+ connect( cb_log_rule, SIGNAL( clicked() ),
+ this, SLOT( slotLogRuleChanged() ) );
+ connect( cb_disable_rule, SIGNAL( clicked() ),
+ this, SLOT( slotEnableRuleChanged() ) );
+ rb_filter->setChecked( true );
+
+ loadPlugins();
+
+ m_rule = 0;
+ m_chain = 0;
+ m_table = 0;
+ m_network = 0;
+ m_widgetStack->show();
+ // slotNewTableSelected();
+ // slotShowOverview();
+ adjustSize();
+ show();
+}
+
+KMFRuleEdit::~KMFRuleEdit() {}
+
+void KMFRuleEdit::setKMFMainWindow( KMFMainWindow* win ) {
+ m_app = win;
+}
+
+void KMFRuleEdit::slotSelectionInvalid() {
+ m_rule = 0;
+ m_chain = 0;
+ m_table = 0;
+}
+
+void KMFRuleEdit::loadDoc( KMFNetwork* network ) {
+ kdDebug() << "void KMFRuleEdit::loadDoc(KMFIPTDoc* doc)" << endl;
+ if ( network == 0 ) {
+ m_err->setErrType(KMFError::NORMAL );
+ const QString& msg = i18n( "KMFRuleEdit:::loadDoc(KMFIPTDoc* doc)\n"
+ "KMFIPTDoc* doc == 0. This is a bug." );
+ m_err->setErrMsg( msg );
+ m_err_handler->showError( m_err );
+ setEnabled( false );
+ return ;
+ }
+
+ if ( !isEnabled() ) {
+ setEnabled( true );
+ }
+ m_network = network;
+ m_myNetworkWidget->setNetwork( m_network );
+
+ rb_filter->setEnabled( m_network->currentDocAsIPTDoc()->useFilter() );
+ rb_mangle->setEnabled( m_network->currentDocAsIPTDoc()->useMangle() );
+ rb_nat->setEnabled( m_network->currentDocAsIPTDoc()->useNat() );
+ if ( m_network->currentDocAsIPTDoc()->useModules() ) {
+ m_led_modules->setColor( green );
+ m_led_modules->on();
+ } else {
+ m_led_modules->setColor( red );
+ m_led_modules->off();
+ }
+
+ if ( m_network->currentDocAsIPTDoc()->useIPFwd() ) {
+ m_led_fwd->setColor( green );
+ m_led_fwd->on();
+ } else {
+ m_led_fwd->setColor( red );
+ m_led_fwd->off();
+ }
+
+ if ( m_network->currentDocAsIPTDoc()->useSynCookies() ) {
+ m_led_syn->setColor( green );
+ m_led_syn->on();
+ } else {
+ m_led_syn->setColor( red );
+ m_led_syn->off();
+ }
+
+ if ( m_network->currentDocAsIPTDoc()->useRPFilter() ) {
+ m_led_rp->setColor( green );
+ m_led_rp->on();
+ } else {
+ m_led_rp->setColor( red );
+ m_led_rp->off();
+ }
+
+ if ( m_network->currentDocAsIPTDoc()->useMartians() ) {
+ m_led_martians->setColor( green );
+ m_led_martians->on();
+ } else {
+ m_led_martians->setColor( red );
+ m_led_martians->off();
+ }
+
+
+
+ IPTable *filter = 0;
+ filter = m_network->currentDocAsIPTDoc()->table( Constants::FilterTable_Name );
+ if ( filter ) {
+ m_lv_table_filter->clearAllItems();
+ m_lv_table_filter->slotLoadNode( filter );
+ }
+
+// IPTable *def = 0;
+ IPTable *nat = 0;
+ nat = m_network->currentDocAsIPTDoc()->table( Constants::NatTable_Name );
+ if ( nat ) {
+ m_lv_table_nat->clearAllItems();
+ m_lv_table_nat->slotLoadNode( nat );
+ }
+
+ IPTable *mangle = 0;
+ mangle = m_network->currentDocAsIPTDoc()->table( Constants::MangleTable_Name );
+ if ( mangle ) {
+ m_lv_table_mangle->clearAllItems();
+ m_lv_table_mangle->slotLoadNode( mangle );
+ }
+
+ m_rule = 0;
+ m_chain = 0;
+ m_table = 0;
+
+ enableRuleEdit( false );
+ slotShowOverview();
+ // if ( KMFAppState::upAndRunning() ) {
+ rb_filter->setChecked( true );
+ slotNewTableSelected();
+ emit sigUpdateView();
+ //}
+}
+
+void KMFRuleEdit::slotLoadDocument( KMFNetwork* network ) {
+ kdDebug() << "KMFRuleEdit::slotLoadDocument( KMFNetwork* network )" << endl;
+ slotShowOverview();
+ loadDoc( network );
+}
+
+
+void KMFRuleEdit::loadPlugins() {
+ kdDebug() << "KMFRuleEdit::loadPlugins()" << endl;
+
+ QPtrListIterator<KMFRuleOptionEditInterface> it( *KMFPluginFactory::KMFRuleOptionEditors( this ) );
+ while( it.current() ) {
+ registerRuleOptionPlugin( it.current() );
+ ++it;
+ }
+
+ QPtrListIterator<KMFRuleTargetOptionEditInterface> it2( *KMFPluginFactory::KMFRuleTargetOptionEditors( this ) );
+ while( it2.current() ) {
+ registerRuleTargetOptionPlugin( it2.current() );
+ ++it2;
+ }
+
+}
+
+void KMFRuleEdit::registerRuleOptionPlugin( KMFRuleOptionEditInterface* edit ) {
+ m_widgetStack->addWidget( edit->editWidget() );
+ m_editPlugins.append( edit );
+ kb_optSelect->insertItem( i18n("Edit %1").arg( edit->optionEditName() ) );
+}
+
+void KMFRuleEdit::registerRuleTargetOptionPlugin( KMFRuleTargetOptionEditInterface* edit ) {
+ m_ws_target_opt->addWidget( edit->editWidget() );
+ m_editTargetPlugins.append( edit );
+}
+
+
+
+KMFListView* KMFRuleEdit::currTableView() {
+ if ( rb_filter->isChecked() && rb_filter->isEnabled() ) {
+ return m_lv_table_filter;
+ } else if ( rb_nat->isChecked() && rb_nat->isEnabled() ) {
+ return m_lv_table_nat;
+ } else if ( rb_mangle->isChecked() && rb_mangle->isEnabled() ) {
+ return m_lv_table_mangle;
+ } else {
+ kdDebug() << "ERROR: currTableView() returning fallbvack table: filter !!!" << endl;
+ return m_lv_table_filter;
+ }
+}
+
+
+
+
+
+void KMFRuleEdit::slotNewTableSelected() {
+ kdDebug() << "void KMFRuleEdit::slotNewTableSelected()" << endl;
+ if ( ! m_network->currentDocAsIPTDoc() ) {
+ setEnabled( false );
+ return ;
+ }
+ QString table = Constants::FilterTable_Name;
+ if ( !rb_filter->isEnabled() )
+ rb_filter->setChecked( false );
+ if ( !rb_nat->isEnabled() )
+ rb_nat->setChecked( false );
+ if ( !rb_mangle->isEnabled() )
+ rb_mangle->setChecked( false );
+
+
+ if ( rb_filter->isChecked() && rb_filter->isEnabled() ) {
+ table = Constants::FilterTable_Name;
+ kdDebug() << "Enabling Filter View" << endl;
+ setCurrTableView( m_lv_table_filter );
+ } else if ( rb_nat->isChecked() && rb_nat->isEnabled() ) {
+ setEnabled( true );
+ table = Constants::NatTable_Name;
+ setCurrTableView( m_lv_table_nat );
+ } else if ( rb_mangle->isChecked() && rb_mangle->isEnabled() ) {
+ setEnabled( true );
+ table = Constants::MangleTable_Name;
+ setCurrTableView( m_lv_table_mangle );
+ } else {
+ setEnabled( true );
+ table = Constants::FilterTable_Name;
+ setCurrTableView( m_lv_table_filter );
+ return;
+ }
+
+ IPTable *tab = m_network->currentDocAsIPTDoc()->table( table );
+ if ( tab == 0 ) {
+ setEnabled( false );
+ kdDebug() << "Table: " << table << " not found in document!!" << table << endl;
+ return ;
+ }
+
+ m_table = tab;
+ slotShowOverview();
+}
+void KMFRuleEdit::setCurrTableView( KMFListView* lv ) {
+ kdDebug() << "void KMFRuleEdit::setCurrTableView( KMFListView* lv )" << endl;
+ if ( lv == m_lv_table_filter ) {
+ setEnabled( true );
+ kdDebug() << "Enabling Filter View" << endl;
+ m_lv_table_filter->setEnabled( true );
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_filter, SLOT( slotUpdateView() ) );
+
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_filter, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ kdDebug() << "Disabling Nat View" << endl;
+ m_lv_table_nat->setEnabled( false );
+ disconnect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_nat, SLOT( slotUpdateView() ) );
+ disconnect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_nat, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ kdDebug() << "Disabling Mangle View" << endl;
+ m_lv_table_mangle->setEnabled( false );
+ disconnect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_mangle, SLOT( slotUpdateView() ) );
+ disconnect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_mangle, SLOT( slotUpdateView( NetfilterObject* ) ) );
+ } else if ( lv == m_lv_table_nat ) {
+ setEnabled( true );
+ kdDebug() << "Disabling Filter View" << endl;
+ m_lv_table_filter->setEnabled( false );
+ disconnect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_filter, SLOT( slotUpdateView() ) );
+ disconnect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_filter, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ kdDebug() << "Enabling Nat View" << endl;
+ m_lv_table_nat->setEnabled( true );
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_nat, SLOT( slotUpdateView() ) );
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_nat, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ kdDebug() << "Disabling Mangle View" << endl;
+ m_lv_table_mangle->setEnabled( false );
+ disconnect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_mangle, SLOT( slotUpdateView() ) );
+ disconnect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_mangle, SLOT( slotUpdateView( NetfilterObject* ) ) );
+ } else if ( lv == m_lv_table_mangle ) {
+ setEnabled( true );
+
+ kdDebug() << "Disabling Filter View" << endl;
+ m_lv_table_filter->setEnabled( false );
+ disconnect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_filter, SLOT( slotUpdateView() ) );
+ disconnect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_filter, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ kdDebug() << "Disabling Nat View" << endl;
+ m_lv_table_nat->setEnabled( false );
+ disconnect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_mangle, SLOT( slotUpdateView() ) );
+ disconnect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_mangle, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ kdDebug() << "Enabling Mangle View" << endl;
+ m_lv_table_mangle->setEnabled( true );
+ connect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_mangle, SLOT( slotUpdateView() ) );
+ connect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_mangle, SLOT( slotUpdateView( NetfilterObject* ) ) );
+ } else if ( ! lv ){
+ kdDebug() << "Disabling Filter View" << endl;
+ m_lv_table_filter->setEnabled( false );
+ disconnect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_filter, SLOT( slotUpdateView() ) );
+ disconnect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_filter, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ kdDebug() << "Disabling Nat View" << endl;
+ m_lv_table_nat->setEnabled( false );
+ disconnect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_mangle, SLOT( slotUpdateView() ) );
+ disconnect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_mangle, SLOT( slotUpdateView( NetfilterObject* ) ) );
+
+ kdDebug() << "Disabling Mangle View" << endl;
+ m_lv_table_mangle->setEnabled( false );
+ disconnect( this, SIGNAL( sigUpdateView() ),
+ m_lv_table_mangle, SLOT( slotUpdateView() ) );
+ disconnect( this, SIGNAL( sigUpdateView( NetfilterObject* ) ),
+ m_lv_table_mangle, SLOT( slotUpdateView( NetfilterObject* ) ) );
+ }
+}
+
+void KMFRuleEdit::slotNewItemSelected( QListViewItem* item ) {
+ kdDebug() << "KMFRuleEdit::slotNewItemSelected( QListViewItem* item )" << endl;
+ if ( ! item )
+ return ;
+ if ( KMFListViewItem * kmf_item = dynamic_cast<KMFListViewItem*>( item ) ) {
+ IPTRuleOption * opt = 0;
+ switch( kmf_item->type() ) {
+ case NetfilterObject::TABLE:
+ m_rule = 0;
+ m_chain = 0;
+ m_table = kmf_item->table();
+ slotEditRule();
+ break;
+ case NetfilterObject::CHAIN:
+ m_rule = 0;
+ m_chain = kmf_item->chain();
+ m_table = m_chain->table();
+ slotEditRule();
+ break;
+ case NetfilterObject::RULE:
+ m_rule = kmf_item->rule();
+ m_chain = m_rule->chain();
+ m_table = m_rule->chain() ->table();
+ slotEditRule();
+ break;
+ case NetfilterObject::RULEOPTION:
+ opt = kmf_item->ruleOption();
+ m_rule = opt->rule();
+ m_chain = opt->rule() ->chain();
+ m_table = opt->rule() ->chain() ->table();
+ slotEditRule();
+ break;
+ default:
+ kdDebug() << "Strange? KMFListViewItem * kmf_item>type() NOT VALID" << endl;
+ m_rule = 0;
+ m_chain = 0;
+ m_table = 0;
+ break;
+ }
+ }
+}
+
+void KMFRuleEdit::slotAddRule() {
+ kdDebug() << "KMFRuleEdit::slotAddRule()" << endl;
+ if ( ! m_chain ) {
+ KMessageBox::sorry( this, i18n( "<qt>No Chain Found to add the Rule.<br>"
+ "Please make sure that you selected a Chain or Rule before you try to add a Rule." ),
+ i18n( "Sorry" ) );
+ return ;
+ }
+ bool ok = FALSE;
+ const QString greeting = i18n( "New Rule" );
+ const QString label = i18n( "Please enter a name for the new rule:" );
+ QString text = QInputDialog::getText( greeting, label, QLineEdit::Normal, QString::null, &ok, this, "dsa" );
+ if ( ok && !text.isEmpty() ) {
+ kdDebug() << "Adding Rule Named: " << text << endl;
+ QString ch = m_chain->name();
+ kdDebug() << "For Chain: " << ch << endl;
+ QString tab = m_chain->table() ->name();
+ kdDebug() << "In Table: " << tab << endl;
+ QString target = "ACCEPT";
+ kdDebug() << "With Target: " << target << endl;
+ if ( !text.isEmpty() && !ch.isEmpty() && !tab.isEmpty() && !target.isEmpty() ) {
+ m_check_input->checkInput( text, "RULENAME", m_err );
+ if ( m_err_handler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_chain,
+ i18n( "Add Rule: %1 to Chain: %2" ).arg( text ).arg( m_chain->name() )
+ );
+
+ IPTRule *inserted = m_chain->addRule( text, m_err );
+ if ( m_err_handler->showError( m_err ) ) {
+ if ( m_rule ) {
+ m_chain->moveRule( inserted, ( m_rule->ruleNum() ) -inserted->ruleNum() );
+ }
+// m_network->changed();
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+
+ m_rule = inserted;
+ emit sigUpdateView( m_chain );
+ }
+ } else {
+ KMessageBox::sorry( this, i18n( "An error occurred while trying to setup a new rule." ), i18n( "Rule Editor" ) );
+ }
+ }
+}
+
+void KMFRuleEdit::slotAddChain() {
+ if ( m_table ) {
+ m_new_chain->loadDoc( m_table->kmfDoc() );
+ m_new_chain->exec();
+ }
+}
+
+void KMFRuleEdit::slotDelChain() {
+ kdDebug() << "void KMFView::slotDelChain()" << endl;
+ if ( ! m_chain ) {
+ KMessageBox::sorry( this, i18n( "<qt>No Chain Found for deleting.<br>"
+ "Please make sure that you selected a Chain or Rule before you try to delete the current chain." ),
+ i18n( "Sorry" ) );
+ return ;
+ }
+
+ if ( m_chain->isBuildIn() ) {
+ KMessageBox::sorry( this, i18n( "<qt><b>Cannot delete built-in chain: %1</b><br>"
+ "Built-in chains cannot be deleted; you can only delete chains "
+ "that you have defined yourself." ).arg( m_chain->name() ),
+ i18n( "Sorry" ) );
+ return ;
+ }
+ int doit = KMessageBox::questionYesNo ( this , i18n( "<p>Are you sure that you want to delete "
+ "chain: <b>%1</b> from table: <b>%2</b>?<br>"
+ "<b>Note:</b> By deleting the chain all rules that belong "
+ "to the chain will be deleted too." ).arg( m_chain ->name() ).arg( m_chain ->table() ->name() ),
+ i18n( "Delete Chain" ), KStdGuiItem::yes(), KStdGuiItem::no(), "main_view_delete_chain" );
+ kdDebug() << "Message Box returned: " << doit << endl;
+ if ( doit == 3 ) {
+ kdDebug() << "Try to delete Chain" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_table,
+ i18n( "Delete Chain: %1 from Table: %2").arg( m_chain->name() ).arg( m_chain->table()->name() )
+ );
+ m_err = m_network->currentDocAsIPTDoc()->table( m_chain->table()->name() )->delChain( m_chain );
+ if ( m_err_handler ->showError( m_err ) ) {
+ emit sigUpdateView( m_chain->table() );
+ m_chain = 0;
+ m_rule = 0;
+ m_table = 0;
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+
+ }
+}
+
+void KMFRuleEdit::slotEditRule() {
+ m_ws_target_opt->setEnabled(false);
+ if ( ! KMFAppState::upAndRunning() /* || ! KMFAppState::hasOpenDoc() */ ) {
+ slotSelectionInvalid();
+ return;
+ }
+
+
+ if ( m_rule ) {
+ l_editing_rule->setText( "<b>Chain: </b>" + m_rule->chain()->name() + "<br><b>Rule: </b>" + m_rule->name() );
+ kb_optSelect->setEnabled( true );
+ cb_log_rule ->setEnabled( true );
+ cb_disable_rule ->setEnabled( true );
+ cb_target ->setEnabled( true );
+ cb_frag ->setEnabled( true );
+ QString target = m_rule->target();
+ cb_target->clear();
+ const QStringList& list = m_rule->availableTargets();
+ cb_target->insertStringList( list );
+ bool found = false;
+ for ( int i = 0; i < cb_target->count() && ! found; i++ ) {
+ if ( !cb_target->text( i ).isNull() && cb_target->text( i ) == m_rule->target( ) ) {
+ cb_target->setCurrentItem( i );
+ found = true;
+ }
+ }
+
+ slotEditTargetOption();
+ IPTRuleOption *opt = m_rule->getOptionForName( "frag_opt" );
+ if ( !opt->isEmpty() ) {
+ QStringList vals = opt->getValues();
+ if ( *vals.at( 0 ) == XML::BoolOn_Value && *vals.at( 0 ) == XML::BoolOff_Value ) {
+ cb_frag->setChecked( true );
+ cb_frag_inv->setChecked( false );
+ } else if ( *vals.at( 0 ) == XML::BoolOff_Value && *vals.at( 1 ) == XML::BoolOn_Value ) {
+ cb_frag->setChecked( true );
+ cb_frag_inv->setChecked( true );
+ } else {
+ cb_frag->setChecked( false );
+ cb_frag_inv->setChecked( false );
+ }
+ } else {
+ cb_frag->setChecked( false );
+ cb_frag_inv->setChecked( false );
+ }
+
+ cb_disable_rule->setChecked( ! m_rule->enabled() );
+ cb_log_rule->setChecked( m_rule->logging() );
+ enableRuleEdit( true );
+
+ //*********************************
+ } else if ( m_chain ) {
+ l_editing_rule->setText( "<b>Chain: </b>" + m_chain->name() + "<br><b>Rule: </b>No rule selected" );
+ kb_optSelect->setEnabled( false );
+ cb_log_rule ->setEnabled( false );
+ cb_disable_rule ->setEnabled( false );
+ cb_target ->setEnabled( false );
+ cb_frag ->setEnabled( false );
+ m_ws_target_opt->setEnabled( false );
+ enableRuleEdit( false );
+ } else {
+ l_editing_rule->setText( "<b>Chain: </b>No chain selected<br><b>Rule: </b>No rule selected" );
+ kb_optSelect->setEnabled( false );
+ cb_log_rule ->setEnabled( false );
+ cb_disable_rule ->setEnabled( false );
+ cb_target ->setEnabled( false );
+ cb_frag ->setEnabled( false );
+ m_ws_target_opt->setEnabled( false );
+ enableRuleEdit( false );
+ }
+}
+
+void KMFRuleEdit::enableRuleEdit( bool on ) {
+ if ( on ) {
+ b_move_up->setEnabled( true );
+ b_move_down->setEnabled( true );
+ kb_optSelect->setEnabled( true );
+ cb_log_rule ->setEnabled( true );
+ cb_disable_rule ->setEnabled( true );
+ cb_target ->setEnabled( true );
+ cb_frag ->setEnabled( true );
+ } else {
+ kb_optSelect->setEnabled( false );
+ b_move_up->setEnabled( false );
+ b_move_down->setEnabled( false );
+ cb_log_rule ->setEnabled( false );
+ cb_disable_rule ->setEnabled( false );
+ cb_target ->setEnabled( false );
+ cb_frag ->setEnabled( false );
+ m_ws_target_opt->setEnabled( false );
+ }
+}
+
+void KMFRuleEdit::slotMoveRuleDown() {
+ kdDebug() << "KMFRuleEdit::slotMoveRuleDown()" << endl;
+ moveRuleInChain( 1 );
+// if ( m_rule && kb_optSelect->isEnabled() ) {
+// KMFUndoEngine::instance()->startTransaction(
+// m_chain,
+// i18n("Move Rule: %1 down").arg( m_rule->name() )
+// );
+// m_chain->saveState();
+// if ( m_chain->moveRule( m_rule, 1 ) ) {
+// m_rule->chain()->changed();
+// KMFListViewItem* item = currTableView()->findKMFItem( m_rule->name(), 2, m_rule->uuid() );
+// if ( item ) {
+// currTableView()->setSelected( item, true );
+// }
+// item->loadNetfilterObject( m_rule );
+// emit sigUpdateView( m_rule->chain() );
+// KMFUndoEngine::instance()->endTransaction();
+// } else {
+// KMFUndoEngine::instance()->abortTransaction();
+// }
+//
+// }
+}
+
+void KMFRuleEdit::slotMoveRuleUp() {
+ kdDebug() << "KMFRuleEdit::slotMoveRuleUp()" << endl;
+ moveRuleInChain( -1 );
+// if ( m_rule && kb_optSelect->isEnabled() ) {
+// KMFListViewItem* item = currTableView() ->findKMFItem( m_rule->name(),2, m_rule->uuid() );
+// if ( item ) {
+// KMFUndoEngine::instance()->startTransaction(
+// m_chain,
+// i18n("Move Rule: %1 up").arg( m_rule->name() )
+// );
+// m_chain->saveState();
+// if ( m_chain->moveRule( m_rule, -1 ) ) {
+// m_rule->chain()->changed();
+// currTableView()->setSelected( item, true );
+// item->loadNetfilterObject( m_rule );
+// emit sigUpdateView( m_rule->chain() );
+// }
+// KMFUndoEngine::instance()->endTransaction();
+// }
+// }
+}
+
+void KMFRuleEdit::moveRuleInChain( int amount ) {
+ if ( m_rule && kb_optSelect->isEnabled() ) {
+ const QString& transMsg = i18n("Move Rule: %1 %2").arg( m_rule->name() ).arg( amount > 0 ? "down" : "up" );
+ KMFListViewItem* item = currTableView()->findKMFItem( m_rule->name(),2, m_rule->uuid() );
+ if ( item ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_chain,
+ transMsg.arg( m_rule->name() )
+ );
+ if ( m_chain->moveRule( m_rule, -1 ) ) {
+ m_rule->chain()->changed();
+ currTableView()->setSelected( item, true );
+ item->loadNetfilterObject( m_rule );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigUpdateView( m_rule->chain() );
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+
+ }
+ }
+}
+
+void KMFRuleEdit::slotDelRule() {
+ kdDebug() << "KMFRuleEdit::slotDelRule()" << endl;
+ if ( ! m_rule || ! m_chain ) {
+ KMessageBox::sorry( this, i18n( "<qt>No Rule defined to delete.<br>"
+ "Please make sure that you selected a Rule before you try to delete one." ),
+ i18n( "Sorry" ) );
+ return ;
+ } else {
+ int doit = KMessageBox::questionYesNo ( this , i18n( "<p>Are you sure that you want to delete "
+ "rule: <b>%1</b> from chain: <b>%2</b>?</p>").arg( m_rule->name() ).arg( m_rule->chain() ->name() ),
+ i18n( "Delete Rule" ), KStdGuiItem::yes(), KStdGuiItem::no(), "rule_edit_delete_rule" );
+ kdDebug() << "Message Box returned: " << doit << endl;
+ if ( doit == 3 ) { // OK clicked
+ kdDebug() << "clicked ok" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_chain,
+ i18n("Delete Rule: %1 from Chain: %2").arg( m_rule->name() ).arg( m_chain->name() )
+ );
+ m_err = m_chain->delRule( m_rule );
+ if ( m_err_handler->showError( m_err ) ) {
+ kdDebug() << "KMFRuleEdit::slotDelRule()\nCalling: m_network->currentDocAsIPTDoc()->updateView()" << endl;
+ m_rule = 0;
+ slotEditRule();
+ KMFUndoEngine::instance()->endTransaction();
+ if ( m_chain ) {
+ emit sigUpdateView( m_chain );
+ } else {
+ emit sigUpdateView();
+ }
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+ }
+ }
+}
+void KMFRuleEdit::showOverview() {
+ slotShowOverview();
+}
+
+void KMFRuleEdit::slotShowOverview() {
+ kdDebug() << "KMFRuleEdit::slotShowOverview()" << endl;
+ if ( rb_filter->isChecked() ) {
+ m_widgetStack->raiseWidget( m_lv_table_filter );
+ } else if ( rb_nat->isChecked() ) {
+ m_widgetStack->raiseWidget( m_lv_table_nat );
+ } else if ( rb_mangle->isChecked() ) {
+ m_widgetStack->raiseWidget( m_lv_table_mangle );
+ }
+/* if ( m_network->currentDocAsIPTDoc() ) {
+ KMFUndoEngine::instance()->endTransaction();
+ }*/
+ if ( m_table ) {
+ kdDebug() << "emit KMFRuleEdit::sigUpdateView()" << endl;
+ emit sigUpdateView();
+ }
+ slotEditRule();
+}
+
+void KMFRuleEdit::slotNewOptionType( int index ) {
+ kdDebug() << "KMFRuleEdit::slotNewOptionType( index " << index << " )" << endl;
+ if ( index > -1 ) {
+ slotEditRule();
+ if ( ! m_rule )
+ return;
+ m_editPlugins.at( index )->loadRule( m_rule );
+ m_widgetStack->raiseWidget( m_editPlugins.at( index )->editWidget() );
+ }
+}
+
+
+
+// void KMFRuleEdit::slotEditCustomOpt() {
+/* kdDebug() << "KMFRuleEdit::slotEditTosOpt()" << endl;
+ slotEditRule();
+ if ( ! m_rule )
+ return;
+ KMessageBox::information ( this , i18n( "<qt><p>You are about to define custom options for this rule.<br>"
+ "There will be <b>no sanity checks</b> for your input, so please make sure "
+ "that your options are working and the syntax is correct.</p></qt>" ),
+ i18n( "Information" ), "custom_option_warning" );
+ m_custom_opt->loadRule( m_rule );
+ m_widgetStack->raiseWidget( m_custom_opt );*/
+// }
+
+void KMFRuleEdit::slotEditRuleInfo() {
+ slotEditRule();
+ if ( ! m_rule )
+ return;
+ m_object_info->loadNetfilterObject( m_rule );
+ m_widgetStack->raiseWidget( m_object_info );
+}
+
+void KMFRuleEdit::slotEditChainInfo() {
+ slotEditRule();
+ if ( ! m_chain )
+ return;
+ m_object_info->loadNetfilterObject( m_chain );
+ m_widgetStack->raiseWidget( m_object_info );
+}
+
+void KMFRuleEdit::slotEditTargetOption() {
+ kdDebug() << "void KMFRuleEdit::slotEditTargetOption()\n Target: " << cb_target->currentText() << endl;
+ if ( ! m_rule )
+ return;
+ QString target = cb_target->currentText();
+ QPtrListIterator<KMFRuleTargetOptionEditInterface> it( m_editTargetPlugins );
+ m_ws_target_opt->setEnabled( false );
+ while ( it.current() ) {
+ KMFRuleTargetOptionEditInterface *edit = it.current();
+ ++it;
+ if ( edit->manageTarget( target ) ) {
+ m_ws_target_opt->setEnabled( true );
+ edit->setTarget( target );
+ edit->loadRule( m_rule );
+ m_ws_target_opt->raiseWidget( edit->editWidget() );
+ return;
+ }
+ }
+
+
+
+
+
+// if ( target == "LOG" ) {
+// m_ws_target_opt->setEnabled( true );
+// m_tglog ->loadRule( m_rule );
+// m_ws_target_opt->raiseWidget( m_tglog );
+// } else if ( target == "SNAT" ) {
+// m_ws_target_opt->setEnabled( true );
+// m_tgnat ->setMode( true );
+// m_tgnat ->loadRule( m_rule );
+// m_ws_target_opt->raiseWidget( m_tgnat );
+// } else if ( target == "DNAT" ) {
+// m_ws_target_opt->setEnabled( true );
+// m_tgnat ->setMode( false );
+// m_tgnat ->loadRule( m_rule );
+// m_ws_target_opt->raiseWidget( m_tgnat );
+// } else if ( target == "TOS" ) {
+// m_ws_target_opt->setEnabled( true );
+// m_tosed->setType( "SETTOS" );
+// m_tosed->loadRule( m_rule );
+// m_ws_target_opt->raiseWidget( m_tosed );
+// } else if ( target == "REJECT" ) {
+// m_ws_target_opt->setEnabled( true );
+// m_tosed->setType( "REJECTTYPE" );
+// m_tosed->loadRule( m_rule );
+// m_ws_target_opt->raiseWidget( m_tosed );
+// } else if ( target == "MARK" ) {
+// m_ws_target_opt->setEnabled( true );
+// m_tgmark->loadRule( m_rule );
+// m_ws_target_opt->raiseWidget( m_tgmark );
+// } else {
+// m_ws_target_opt->setEnabled( false );
+// }
+}
+
+
+void KMFRuleEdit::slotEditChain() {
+ kdDebug() << "void KMFRuleEdit::slotEditChain()" << endl;
+ if ( ! m_chain )
+ return;
+ m_editchain -> loadChain( m_chain );
+ m_widgetStack->raiseWidget( m_editchain );
+}
+
+void KMFRuleEdit::slotEditNetwork() {
+ kdDebug() << "void KMFRuleEdit::slotEditNewtwork()" << endl;
+ // kdDebug() << "Parent is: " << parent()->className() << endl;
+// KMFMyNetworkWidget *wid = new KMFMyNetworkWidget( this, "name" );
+// wid->setNetwork( m_network );
+// wid->slotUpdateView();
+/* connect( wid, SIGNAL( sigActiveTargetChanged() ), this, SLOT( slotUpdateView() ) );*/
+ m_myNetworkWidget->slotUpdateView();
+ m_app->setOutputWidget( m_myNetworkWidget );
+ m_app->showOutput();
+}
+
+// Slots For Rule Edit Changes
+void KMFRuleEdit::slotFragChanged() {
+ kdDebug() << "KMFRuleEdit::slotFragChanged(bool frag)" << endl;
+ if ( !m_rule )
+ return ;
+ bool frag = cb_frag->isChecked();
+ bool frag_inv = cb_frag_inv->isChecked();
+
+ QPtrList<QString>* vals = new QPtrList<QString>;
+ QString* cmd = new QString( "frag_opt" );
+ if ( frag ) {
+ if ( frag_inv ) {
+ vals->append( new QString( XML::BoolOff_Value ) );
+ vals->append( new QString( XML::BoolOn_Value ) );
+ } else {
+ vals->append( new QString( XML::BoolOn_Value ) );
+ vals->append( new QString( XML::BoolOff_Value ) );
+ }
+ } else {
+ vals->append( new QString( XML::BoolOff_Value ) );
+ vals->append( new QString( XML::BoolOff_Value ) );
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n( "Edit Rule: %1 Fragment option" ).arg( m_rule->name() )
+ );
+ m_rule->addRuleOption( *cmd, *vals );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigUpdateView( m_rule );
+}
+
+void KMFRuleEdit::slotLogRuleChanged() {
+ if ( !m_rule )
+ return ;
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n( "Edit Rule: %1 Log option" ).arg( m_rule->name() )
+ );
+ if ( cb_log_rule->isChecked() ) {
+ m_rule->setLogging( true );
+ } else {
+ m_rule->setLogging( false );
+ }
+// m_network->changed();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigUpdateView( m_rule );
+}
+
+void KMFRuleEdit::slotEnableRuleChanged() {
+ if ( !m_rule )
+ return ;
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n( "Edit Rule: %1 enabled state" ).arg( m_rule->name() )
+ );
+ if ( cb_disable_rule->isChecked() ) {
+ m_rule->setEnabled( false );
+ } else {
+ m_rule->setEnabled( true );
+ }
+// m_network->changed();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigUpdateView( m_rule );
+ slotEditRule();
+}
+
+void KMFRuleEdit::slotTargetChanged( const QString & tg ) {
+ kdDebug() << "KMFRuleEdit::slotTargetChanged(const QString&)" << endl;
+ if ( !m_rule )
+ return ;
+
+ if ( !tg.isEmpty() ) {
+ if ( tg == m_rule->chain() ->name() ) {
+ KMessageBox::sorry( this, i18n( "<qt><p>Sorry, you <b>cannot</b> set the target of this rule to be its own chain. "
+ "Constructing endless loops is not allowed.</qt>" ) );
+ return ;
+ }
+ if ( m_rule->target() == "LOG" || m_rule->target() == "REJECT" ||
+ m_rule->target() == "SNAT" || m_rule->target() == "DNAT" ||
+ m_rule->target() == "MARK" || m_rule->target() == "TOS" ) {
+ int ans = KMessageBox::questionYesNo( this, i18n( "<qt>By changing the Target of the Rule all previous"
+ " defined <b>Target Options</b> will be deleted.<br>"
+ "Click <b>Continue</b> to change the Target.<br>"
+ "Click <b>Cancel</b> keep your current Target. </qt>" ), i18n( "Warning" ), KStdGuiItem::cont(), KStdGuiItem::cancel(), "change_target_option_warning" );
+ kdDebug() << "KMessageBox:: Returned" << ans << endl;
+ switch ( ans ) {
+
+ case 3:
+ kdDebug() << "Clicked Continue" << endl;
+ if ( m_rule->target() != tg ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n( "Change Rule: %1 target from: %2 to: %3" ).arg( m_rule->name() ).arg( m_rule->target() ).arg( tg )
+ );
+ m_rule->setTarget( tg );
+ emit sigUpdateView( m_rule->chain()->table() );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ break;
+ case 2:
+ kdDebug() << "Canceled Target Change" << endl;
+ slotEditRule();
+ slotEditTargetOption();
+ return ;
+ break;
+ }
+ } else {
+ if ( m_rule->target() != tg ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n( "Change Rule: %1 target from: %2 to: %3" ).arg( m_rule->name() ).arg( m_rule->target() ).arg( tg )
+ );
+ m_rule->setTarget( tg );
+ emit sigUpdateView( m_rule->chain()->table() );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ }
+ slotEditTargetOption();
+ }
+}
+
+void KMFRuleEdit::addRuleOption(QString* name, QPtrList< QString >* values){
+ slotAddRuleOption( name, values );
+}
+
+void KMFRuleEdit::slotAddRuleOption( QString * name, QPtrList<QString>* values ) {
+ kdDebug() << "KMFRuleEdit::slotAddRuleOption(QString* name, QPtrList<QString>* values)" << endl;
+ m_rule->addRuleOption( *name, *values );
+ emit sigUpdateView( m_rule );
+}
+
+void KMFRuleEdit::addRuleTargetOption(QString* name, QPtrList< QString >* values ){
+ slotAddTargetOption( name, values );
+}
+
+void KMFRuleEdit::slotAddTargetOption( QString * name, QPtrList<QString>* values ) {
+ kdDebug() << "KMFRuleEdit::slotAddTargetOption(QString* name, QPtrList<QString>* values)" << endl;
+ m_rule->addTargetOption( *name, *values );
+ emit sigUpdateView( m_rule );
+}
+
+void KMFRuleEdit::slotRuleRBM( QListViewItem * item, const QPoint & point, int ) {
+ kdDebug() << "void KMFRuleEdit::RBM(QListViewItem* item, const QPoint & point, int)" << endl;
+ if ( ! item ) {
+ if ( m_table ) {
+ createRBM( m_table );
+ m_contextMenu->popup( point );
+ } else {
+ return ;
+ }
+ }
+ if ( KMFListViewItem * tmp_item = dynamic_cast<KMFListViewItem*>( item ) ) {
+ slotNewItemSelected( item );
+ if ( ( tmp_item->type() == NetfilterObject::RULE || tmp_item->type() == NetfilterObject::RULEOPTION )&& m_rule ) {
+ createRBM( m_rule );
+ m_contextMenu->popup( point );
+ } else if ( tmp_item->type() == NetfilterObject::CHAIN && m_chain ) {
+ createRBM( m_chain );
+ m_contextMenu->popup( point );
+ } else if ( tmp_item->type() == NetfilterObject::TABLE && m_table ) {
+ createRBM( m_table );
+ m_contextMenu->popup( point );
+ } else {
+ m_contextMenu->clear();
+ }
+ } else {
+ kdDebug() << "CAST ERROR: KMFRuleEdit::slotRuleRBM(...) " << endl;
+ }
+}
+
+
+void KMFRuleEdit::createRBM( NetfilterObject* obj ) {
+ kdDebug() << "void createRBM( IPTChain* ){" << endl;
+ if ( ! obj )
+ return;
+ switch( obj->type() ) {
+ case NetfilterObject::TABLE:
+ if ( IPTable* table = dynamic_cast<IPTable*> ( obj ) ) {
+ m_contextMenu->clear();
+ QString name = table->name();
+ QString lab_str = i18n("Table: %1").arg( name );
+
+ m_contextMenu->insertTitle( lab_str );
+ m_contextMenu->insertItem( icon_new, i18n( "Add Chain..." ), this, SLOT( slotAddChain() ) );
+ }
+ break;
+ case NetfilterObject::CHAIN:
+ if ( IPTChain* chain = dynamic_cast<IPTChain*> ( obj ) ) {
+ m_contextMenu->clear();
+ QString name = chain->name();
+ QString lab_str = i18n("Chain: %1").arg( name );
+
+ m_contextMenu->insertTitle( icon_chain, lab_str );
+ m_contextMenu->insertItem( icon_new, i18n( "Add Rule..." ), this, SLOT( slotAddRule() ) );
+ m_contextMenu->insertSeparator();
+ if ( ! chain->isBuildIn() )
+ m_contextMenu->insertItem( icon_edit, i18n( "Chain Documentation" ), this, SLOT( slotEditChainInfo() ) );
+ m_contextMenu->insertItem( icon_new, i18n( "Add Chain..." ), this, SLOT( slotAddChain() ) );
+ m_contextMenu->insertItem( icon_edit, i18n( "Edit Chain" ), this, SLOT( slotEditChain() ) );
+ if ( ! chain->isBuildIn() )
+ m_contextMenu->insertItem( icon_del, i18n( "Delete Chain" ), this, SLOT( slotDelChain() ) );
+ }
+ case NetfilterObject::RULE:
+ if ( IPTRule* rule = dynamic_cast<IPTRule*> ( obj ) ) {
+ m_contextMenu->clear();
+ QString name = rule->name();
+ QString lab_str = i18n("Rule: %1").arg( name );
+ m_contextMenu->insertTitle( icon_rule, lab_str );
+
+ KPopupMenu *sub_edit = new KPopupMenu( m_contextMenu );
+ sub_edit->insertTitle( i18n( "Edit Rule Option" ) );
+ for( uint i = 0; i < m_editPlugins.count(); i++ ) {
+ sub_edit->insertItem( icon_edit, i18n( "Edit %1" ).arg(m_editPlugins.at(i)->optionEditName() ), i );
+ }
+ connect( sub_edit,SIGNAL(activated( int ) ),
+ this,SLOT(slotNewOptionType( int ) ) );
+ m_contextMenu->insertItem( i18n( "Edit Rule Option" ), sub_edit );
+ // m_contextMenu->insertItem( icon_new, i18n( "Add Rule..." ), this, SLOT( slotAddRule() ) );
+ m_contextMenu->insertItem( icon_new, i18n( "Insert Rule..." ), this, SLOT( slotAddRule() ) );
+// m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( icon_del, i18n( "Delete Rule" ), this, SLOT( slotDelRule() ) );
+ m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( icon_rename, i18n( "Rename Rule" ), this, SLOT( slotRenameRule() ) );
+ m_contextMenu->insertItem( icon_edit, i18n( "Rule Documentation" ), this, SLOT( slotEditRuleInfo() ) );
+ m_contextMenu->insertItem( icon_up, i18n( "Move Up" ), this, SLOT( slotMoveRuleUp() ) );
+ m_contextMenu->insertItem( icon_down, i18n( "Move Down" ), this, SLOT( slotMoveRuleDown() ) );
+ m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( icon_edit, i18n( "Edit Chain" ), this, SLOT( slotEditChain() ) );
+ if ( ! rule->chain()->isBuildIn() )
+ m_contextMenu->insertItem( icon_del, i18n( "Delete Chain" ), this, SLOT( slotDelChain() ) );
+ m_contextMenu->insertSeparator();
+
+ KPopupMenu *sub_copy = new KPopupMenu( m_contextMenu );
+ connect( sub_copy, SIGNAL( activated( int ) ), this, SLOT( slotCopyRule( int ) ) );
+ sub_copy->insertTitle( i18n( "Copy to Chain" ) );
+ QPtrList<IPTChain> chains = m_table ->chains();
+ for ( uint i = 0; i < chains.count(); i++ ) {
+ QString tmp_name = chains.at( i ) ->name();
+ sub_copy->insertItem( tmp_name, i );
+ }
+ m_contextMenu->insertItem( icon_copy, i18n( "Copy Rule" ), sub_copy );
+
+ KPopupMenu *sub_move = new KPopupMenu( m_contextMenu );
+ connect( sub_move, SIGNAL( activated( int ) ), this, SLOT( slotMoveRule( int ) ) );
+ sub_move->insertTitle( i18n( "Move to Chain" ) );
+ QPtrList<IPTChain> chains2 = m_table->chains();
+ for ( uint i = 0; i < chains2.count(); i++ ) {
+ QString tmp_name = chains2.at( i ) ->name();
+ sub_move->insertItem( tmp_name, i );
+ }
+ m_contextMenu->insertItem( icon_move, i18n( "Move Rule" ), sub_move );
+ }
+ }
+}
+
+
+void KMFRuleEdit::slotMoveRule( int index ) {
+ kdDebug() << "void KMFRuleEdit::slotCopyRule( int )" << endl;
+ kdDebug() << "Move Rule to Chain Nr: " << index << endl;
+ IPTChain *chain_target = 0;
+ chain_target = m_network->currentDocAsIPTDoc()->table( m_table->name() ) ->chains().at( index );
+ if ( chain_target ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule->chain()->table(),
+ i18n( "Move Rule: %1 from Chain: %2 to Chain: %3" ).arg( m_rule->name() ).arg( m_rule->chain()->name() ).arg( chain_target->name() )
+ );
+ m_err = m_rule->chain()->table()->moveRuleToChain( m_rule, chain_target );
+ if ( m_err_handler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigUpdateView( chain_target->table() );
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+ }
+}
+
+void KMFRuleEdit::slotCopyRule( int index ) {
+ kdDebug() << "void KMFRuleEdit::slotCopyRule( int )" << endl;
+ kdDebug() << "Move Rule to Chain Nr: " << index << endl;
+ IPTChain *chain_target = 0;
+ chain_target = m_network->currentDocAsIPTDoc()->table( m_table->name() ) ->chains().at( index );
+ if ( chain_target ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule->chain() ->table(),
+ i18n( "Copy Rule: %1 from Chain: %2 to Chain: %3" ).arg( m_rule->name() ).arg( m_rule->chain()->name() ).arg( chain_target->name() )
+ );
+ m_err = m_rule->chain() ->table() ->copyRuleToChain( m_rule, chain_target );
+ if ( m_err_handler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigUpdateView( chain_target->table() );
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+ }
+}
+
+void KMFRuleEdit::slotRenameRule() {
+ if ( ! m_rule )
+ return;
+ if ( KMFListViewItem* rule_item = currTableView()->findKMFItem( m_rule->name(),2,m_rule->uuid() ) ) {
+
+ rule_item->startRename(2);
+ }
+}
+
+void KMFRuleEdit::slotRenameRule( QListViewItem* , int, const QString& name ) {
+ kdDebug() << "void KMFRuleEdit::slotRenameRule( QListViewItem* item, int, const QString& name )" << endl;
+ if ( name.isNull() || name.isEmpty() ) {
+ kdDebug() << "Rename rejected: Name was NULL or empty" << endl;
+ return;
+ }
+
+// if ( ! m_rule ) {
+// kdDebug() << "Rename rejected: m_rule == 0:" << endl;
+// return;
+// }
+
+ if ( KMFListViewItem* rule_item = currTableView()->findKMFItem( name ,2,m_rule->uuid() ) ) {
+ kdDebug() << "Found Rule Item: " << name << " ID " << m_rule->uuid() << endl;
+ QPtrList<IPTRule>& rules = rule_item->rule()->chain()->chainRuleset();
+ IPTRule *rule = 0;
+ for ( rule = rules.first(); rule; rule = rules.next() ) {
+ if ( rule->name() == name ) {
+ KMessageBox::sorry( this, i18n( "<qt><p>Sorry, there is already a rule named: <b>%1</b> in the chain.<br>"
+ "Please make sure that the new rule name is unique in its chain.</qt>" ).arg( name ) );
+ rule_item->setText( 2, rule_item->rule()->name() );
+ emit sigUpdateView( rule_item->rule()->chain() );
+ return ;
+ }
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ rule_item->rule(),
+ i18n( "Rename Rule: %1 to %2").arg( rule_item->rule()->name() ).arg( name )
+ );
+
+ QString origName = rule_item->rule()->name();
+ m_err = rule_item->rule()->setRuleName( name );
+ if ( m_err_handler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ rule_item->setText( 2, origName );
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+
+ emit sigUpdateView( rule_item->rule()->chain()->table() );
+ }
+}
+
+void KMFRuleEdit::slotUpdateView() {
+ kdDebug() << "void KMFRuleEdit::slotUpdateView()" << endl;
+ if ( ! m_network ) {
+ kdDebug() << "ERROR: m_network is null" << endl;
+ return;
+ }
+
+ kdDebug() << "upAndRunning(): " << KMFAppState::upAndRunning() << endl;
+ slotSelectionInvalid();
+
+ bool reload = true;
+ if ( ! m_lastDisplayDoc ) {
+ m_lastDisplayDoc = m_network->currentDocAsIPTDoc();
+ }
+ if ( m_lastDisplayDoc == m_network->currentDocAsIPTDoc() ) {
+ if ( ! m_network->newSavePathNeeded() ) {
+ kdDebug() << "IPTDoc still the same." << endl;
+ reload = false;
+ }
+ } else {
+ kdDebug() << "IPTDoc changed." << endl;
+ m_lastDisplayDoc = m_network->currentDocAsIPTDoc();
+ // reload = true;
+ }
+
+ IPTable *filter = 0;
+ filter = m_network->currentDocAsIPTDoc()->table( Constants::FilterTable_Name );
+ if ( filter ) {
+ if ( reload ) m_lv_table_filter->clearAllItems();
+ m_lv_table_filter->slotLoadNode( filter );
+ }
+
+ IPTable *nat = 0;
+ nat = m_network->currentDocAsIPTDoc()->table( Constants::NatTable_Name );
+ if ( nat ) {
+ if ( reload ) m_lv_table_nat->clearAllItems();
+ m_lv_table_nat->slotLoadNode( nat );
+ }
+
+ IPTable *mangle = 0;
+ mangle = m_network->currentDocAsIPTDoc()->table( Constants::MangleTable_Name );
+ if ( mangle ) {
+ if ( reload ) m_lv_table_mangle->clearAllItems();
+ m_lv_table_mangle->slotLoadNode( mangle );
+ }
+
+ rb_filter->setEnabled( m_network->currentDocAsIPTDoc()->useFilter() );
+ rb_mangle->setEnabled( m_network->currentDocAsIPTDoc()->useMangle() );
+ rb_nat->setEnabled( m_network->currentDocAsIPTDoc()->useNat() );
+
+
+ if ( m_network->currentDocAsIPTDoc()->useModules() ) {
+ m_led_modules->setColor( green );
+ m_led_modules->on();
+ } else {
+ m_led_modules->setColor( red );
+ m_led_modules->off();
+ }
+
+ if ( m_network->currentDocAsIPTDoc()->useIPFwd() ) {
+ m_led_fwd->setColor( green );
+ m_led_fwd->on();
+ } else {
+ m_led_fwd->setColor( red );
+ m_led_fwd->off();
+ }
+
+ if ( m_network->currentDocAsIPTDoc()->useSynCookies() ) {
+ m_led_syn->setColor( green );
+ m_led_syn->on();
+ } else {
+ m_led_syn->setColor( red );
+ m_led_syn->off();
+ }
+
+ if ( m_network->currentDocAsIPTDoc()->useRPFilter() ) {
+ m_led_rp->setColor( green );
+ m_led_rp->on();
+ } else {
+ m_led_rp->setColor( red );
+ m_led_rp->off();
+ }
+
+ if ( m_network->currentDocAsIPTDoc()->useMartians() ) {
+ m_led_martians->setColor( green );
+ m_led_martians->on();
+ } else {
+ m_led_martians->setColor( red );
+ m_led_martians->off();
+ }
+
+// setCurrTableView( currTableView() );
+
+ if ( ! rb_filter->isEnabled() && ! rb_nat->isEnabled() ) {
+ rb_mangle->setChecked( true );
+ setCurrTableView( m_lv_table_mangle );
+ } else if ( ! rb_filter->isEnabled() && ! rb_mangle->isEnabled() ) {
+ rb_nat->setChecked( true );
+ setCurrTableView( m_lv_table_nat );
+ } else if ( ! rb_nat->isEnabled() && ! rb_mangle->isEnabled() ) {
+ rb_filter->setChecked( true );
+ setCurrTableView( m_lv_table_filter );
+ }
+
+ emit sigUpdateView();
+ m_app->updateCaption();
+// slotEditRule();
+}
+
+/*
+ * Main event handler. Reimplemented to handle application
+ * font changes
+ */
+bool KMFRuleEdit::event( QEvent* ev ) {
+ bool ret = QWidget::event( ev );
+ if ( ev->type() == QEvent::ApplicationFontChange ) {}
+ return ret;
+}
+
+void KMFRuleEdit::slotHelp() {
+ kdDebug() << "void KMFRuleEdit::slotHelp()" << endl;
+ kapp->invokeHelp( "rules" );
+}
+void KMFRuleEdit::loadIcons() {
+ kdDebug() << "void KMFRuleEdit::loadIcons()" << endl;
+ KIconLoader *loader = KGlobal:: iconLoader();
+ QString icon_name;
+
+ icon_name = "up";
+ icon_up = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "down";
+ icon_down = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editdelete";
+ icon_del = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filenew";
+ icon_new = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "edit";
+ icon_edit = loader->loadIcon( icon_name, KIcon::Small );
+
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "text";
+ icon_rename = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "rule-22";
+ icon_rule = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "view_tree";
+ icon_chain = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "reject";
+ icon_reject = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "target";
+ icon_target = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "stop";
+ icon_drop = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "button_ok";
+ icon_accept = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filesaveas";
+ icon_log = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "undo";
+ icon_return = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editclear";
+ icon_cmd = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "pipe";
+ icon_queue = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editcopy";
+ icon_copy = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "forward";
+ icon_move = loader->loadIcon( icon_name, KIcon::Small );
+
+}
+
+}
+
+#include "kmfruleedit.moc"
diff --git a/kmyfirewall/ipteditor/kmfruleedit.h b/kmyfirewall/ipteditor/kmfruleedit.h
new file mode 100644
index 0000000..d524c0c
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfruleedit.h
@@ -0,0 +1,171 @@
+/***************************************************************************
+ begin : Thu Feb 7 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDIT_H
+#define KMFRULEEDIT_H
+#include "kmyfirewallruleeditor.h"
+
+// qt includes
+#include <qvariant.h>
+#include <qdialog.h>
+#include <qpixmap.h>
+#include <qstring.h>
+#include <qvaluelist.h>
+#include <qguardedptr.h>
+
+// kde includes
+#include <kconfig.h>
+#include <kiconloader.h>
+#include <kstandarddirs.h>
+
+// project includes
+#include "../core/kmfruleeditinterface.h"
+class QListViewItem;
+class KListViewItem;
+class QString;
+class KPopupMenu;
+
+namespace KMF {
+class KMFIPTDoc;
+class KMFNetwork;
+class KMFListView;
+class KMFListViewItem;
+class NetfilterObject;
+class IPTRule;
+class IPTChain;
+class IPTable;
+class KMFErrorHandler;
+class KMFError;
+class KMFCheckInput;
+class KMFChainEdit;
+class KMFNewChainDlg;
+class KMFObjectInfo;
+class KMFRuleOptionEditInterface;
+class KMFRuleTargetOptionEditInterface;
+class KMFMainWindow;
+class KMFMyNetworkWidget;
+
+class KMFRuleEdit : public KMyFirewallRuleEditor, public KMFRuleEditInterface {
+ Q_OBJECT
+
+public:
+ KMFRuleEdit( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFRuleEdit();
+ IPTRule* currRule() const {
+ return m_rule;
+ };
+
+ void loadDoc( KMFNetwork* network );
+ void editChain( IPTChain* );
+ void addRuleOption(QString*, QPtrList< QString >* );
+ void addRuleTargetOption(QString*, QPtrList< QString >* );
+ void showOverview();
+ void setKMFMainWindow( KMFMainWindow* win );
+
+public slots:
+ void slotAddRule();
+ void slotEditRule();
+ void slotDelRule();
+ void slotAddChain();
+ void slotDelChain();
+ void slotEditChain();
+ void slotEditNetwork();
+ void slotLoadDocument( KMFNetwork* network );
+ void slotUpdateView();
+ void slotSelectionInvalid();
+
+protected:
+ bool event( QEvent* );
+
+private:
+ // members
+ void createRBM( NetfilterObject* );
+ void loadIcons();
+ void enableRuleEdit( bool on );
+ KMFListView* currTableView();
+ void setCurrTableView( KMFListView* );
+ void loadPlugins();
+ void registerRuleOptionPlugin( KMFRuleOptionEditInterface* );
+ void registerRuleTargetOptionPlugin( KMFRuleTargetOptionEditInterface* );
+
+ // data
+ KMFIPTDoc *m_lastDisplayDoc;
+
+ KMFMyNetworkWidget *m_myNetworkWidget;
+ KMFObjectInfo *m_object_info;
+ KMFChainEdit *m_editchain;
+ KMFNewChainDlg *m_new_chain;
+ KMFListView *m_lv_table_filter, *m_lv_table_nat, *m_lv_table_mangle;
+ QGuardedPtr<KMFNetwork> m_network;
+ QGuardedPtr<IPTRule> m_rule;
+ QGuardedPtr<IPTChain> m_chain;
+ QGuardedPtr<IPTable> m_table;
+
+
+ QPtrList<KMFRuleOptionEditInterface> m_editPlugins;
+ QPtrList<KMFRuleTargetOptionEditInterface> m_editTargetPlugins;
+
+ KMFError *m_err;
+ KMFErrorHandler *m_err_handler;
+ KMFCheckInput *m_check_input;
+ KMFMainWindow *m_app;
+ KPopupMenu *m_contextMenu;
+ QPixmap icon_up, icon_down, icon_del, icon_edit, icon_rule, icon_filter, icon_rename,
+ icon_chain, icon_log, icon_accept, icon_drop, icon_cmd, icon_reject, icon_return,
+ icon_target, icon_queue, icon_new, icon_copy, icon_move;
+
+
+private slots:
+ void slotNewItemSelected( QListViewItem* );
+
+
+ void slotRuleRBM( QListViewItem*, const QPoint &, int );
+ void slotRenameRule();
+ void slotRenameRule( QListViewItem*, int, const QString& );
+ void slotNewOptionType( int index );
+ void slotShowOverview();
+
+ void slotEditRuleInfo();
+ void slotEditChainInfo();
+ void slotEditTargetOption();
+
+
+ void slotFragChanged();
+ void slotLogRuleChanged();
+ void slotEnableRuleChanged();
+ void slotTargetChanged( const QString& );
+
+ void slotNewTableSelected();
+
+ void slotAddRuleOption( QString*, QPtrList<QString>* );
+ void slotAddTargetOption( QString*, QPtrList<QString>* );
+
+ void slotMoveRuleUp();
+ void slotMoveRuleDown();
+ void slotMoveRule( int );
+ void slotCopyRule( int );
+
+ void slotHelp();
+
+private:
+ void moveRuleInChain( int );
+
+ signals:
+ void sigFragToggled();
+ void sigUpdateView();
+ void sigUpdateView( NetfilterObject* );
+};
+}
+#endif // KMFRULEEDIT_H
diff --git a/kmyfirewall/ipteditor/kmfruleoption_frag_option.xml b/kmyfirewall/ipteditor/kmfruleoption_frag_option.xml
new file mode 100644
index 0000000..6e8906d
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmfruleoption_frag_option.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+ <ruleoptiondefinition name="frag_opt" guiName="Match Fragments" >
+ <option guiName="Match First Fragment" command=" -f" />
+ <option guiName="Match Other Fragments" command=" ! -f" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ipteditor/kmyfirewallchaineditor.ui b/kmyfirewall/ipteditor/kmyfirewallchaineditor.ui
new file mode 100644
index 0000000..b79ddcf
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmyfirewallchaineditor.ui
@@ -0,0 +1,893 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallChainEditor</class>
+<author>Christian Hubinger</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallChainEditor</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>572</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Chain Editor</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox6</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Chain Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="6">
+ <property name="name">
+ <cstring>Layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Working on chain:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>l_chain_name</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>CHAINNAME</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>in table:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>l_chain_table</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>filter</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1_5_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Chain rules:</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="1" column="1">
+ <property name="name">
+ <cstring>lcd_rules</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="numDigits">
+ <number>2</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>Flat</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>TextLabel1_5</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Chain feeds:</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="1" column="3">
+ <property name="name">
+ <cstring>lcd_feeds</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="numDigits">
+ <number>2</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>Flat</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="4">
+ <property name="name">
+ <cstring>TextLabel1_4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Chain forwards:</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" row="1" column="5">
+ <property name="name">
+ <cstring>lcd_fwds</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="numDigits">
+ <number>2</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>Flat</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>layout36</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer9_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>110</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>110</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QTabWidget" row="1" column="0">
+ <property name="name">
+ <cstring>m_tabWidget</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Policy</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>gb_target</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="title">
+ <string>Configure Default Policy</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>cb_target</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>c_has_default_target</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Define default policy</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel6_2</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Please set the default policy for your chain:</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>User defined chains do not have any "Default Policy" set because the packets return to the chain from which this chain is fed, right after the rule that fed the chain. If you want your user defined chains to act like built-in chains, enable the option "Define Default Policy" and set the policy to your needs.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel7</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>The Default Policy decides what to do with Packets that do not match any of the rules defined for the Chain.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Logging</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>gb_logging</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Logging</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignBottom|AlignTop|AlignLeft</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_enable_log</cstring>
+ </property>
+ <property name="text">
+ <string>Enable chain drop logging</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>l_logging_2</cstring>
+ </property>
+ <property name="text">
+ <string>Here you can decide whether you would like to log all packets that did not match any rule at the end of the chain.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop|AlignLeft</set>
+ </property>
+ <property name="vAlign" stdset="0">
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>c_log_prefix</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Use a log prefix:</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>t_log_prefix</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxLength">
+ <number>29</number>
+ </property>
+ <property name="frame">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_log_burst</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Burst limit:</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_log_limit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Limit logging: </string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>sb_burst</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>5</number>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>sb_limit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>60</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel8_2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>/</string>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>second</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>minute</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>hour</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>cb_interval</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>c_enable_log</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_log_limit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallChainEditor</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallChainEditor</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>kPushButton5</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallChainEditor</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>c_enable_log</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_log_burst</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_enable_log</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_log_prefix</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_log_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_limit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_log_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_interval</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_log_burst</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_burst</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_log_prefix</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_log_prefix</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_log_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel8_2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_enable_log</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>groupBox4</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>kPushButton5</tabstop>
+ <tabstop>b_help</tabstop>
+ <tabstop>b_ok</tabstop>
+ <tabstop>m_tabWidget</tabstop>
+ <tabstop>c_has_default_target</tabstop>
+ <tabstop>cb_target</tabstop>
+ <tabstop>c_enable_log</tabstop>
+ <tabstop>c_log_limit</tabstop>
+ <tabstop>c_log_burst</tabstop>
+ <tabstop>c_log_prefix</tabstop>
+ <tabstop>t_log_prefix</tabstop>
+ <tabstop>sb_burst</tabstop>
+ <tabstop>sb_limit</tabstop>
+ <tabstop>cb_interval</tabstop>
+</tabstops>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/ipteditor/kmyfirewallchaineditornewchain.ui b/kmyfirewall/ipteditor/kmyfirewallchaineditornewchain.ui
new file mode 100644
index 0000000..77e221b
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmyfirewallchaineditornewchain.ui
@@ -0,0 +1,263 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>KMyFirewallChainEditorNewChain</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KMyFirewallChainEditorNewChain</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>385</width>
+ <height>174</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New Chain</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>9</pointsize>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="text">
+ <string>Please define a unique (in the table) name and decide which table this chain should be added to.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox13</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Name</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLineEdit" row="0" column="0">
+ <property name="name">
+ <cstring>t_name</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxLength">
+ <number>33</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Table</string>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>c_filter</cstring>
+ </property>
+ <property name="text">
+ <string>filter</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>c_nat</cstring>
+ </property>
+ <property name="text">
+ <string>nat</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>c_mangle</cstring>
+ </property>
+ <property name="text">
+ <string>mangle</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>Layout28</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_cancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>79</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>b_cancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallChainEditorNewChain</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallChainEditorNewChain</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotOk()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/ipteditor/kmyfirewallruleeditor.ui b/kmyfirewall/ipteditor/kmyfirewallruleeditor.ui
new file mode 100644
index 0000000..0049086
--- /dev/null
+++ b/kmyfirewall/ipteditor/kmyfirewallruleeditor.ui
@@ -0,0 +1,757 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditor</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditor</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>483</width>
+ <height>447</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Rule Editor</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QSplitter" row="0" column="0">
+ <property name="name">
+ <cstring>m_splitter</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>gb_options</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>l_editing_rule</cstring>
+ </property>
+ <property name="text">
+ <string>Editing Rule</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignLeft</set>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="1">
+ <property name="name">
+ <cstring>buttonGroup6</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>rb_filter</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>filter</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>rb_nat</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>nat</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>rb_mangle</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>mangle</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Table:&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout14</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLed" row="1" column="1">
+ <property name="name">
+ <cstring>m_led_modules</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="state">
+ <enum>Off</enum>
+ </property>
+ <property name="look">
+ <enum>Sunken</enum>
+ </property>
+ <property name="darkFactor">
+ <number>600</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="2">
+ <property name="name">
+ <cstring>textLabel1_2_3_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Log martians:</string>
+ </property>
+ </widget>
+ <widget class="KLed" row="1" column="3">
+ <property name="name">
+ <cstring>m_led_rp</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="state">
+ <enum>Off</enum>
+ </property>
+ <property name="look">
+ <enum>Sunken</enum>
+ </property>
+ <property name="darkFactor">
+ <number>600</number>
+ </property>
+ </widget>
+ <widget class="KLed" row="2" column="1">
+ <property name="name">
+ <cstring>m_led_fwd</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="state">
+ <enum>Off</enum>
+ </property>
+ <property name="look">
+ <enum>Sunken</enum>
+ </property>
+ <property name="darkFactor">
+ <number>600</number>
+ </property>
+ </widget>
+ <widget class="KLed" row="2" column="3">
+ <property name="name">
+ <cstring>m_led_martians</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="state">
+ <enum>Off</enum>
+ </property>
+ <property name="look">
+ <enum>Sunken</enum>
+ </property>
+ <property name="darkFactor">
+ <number>600</number>
+ </property>
+ </widget>
+ <widget class="KLed" row="0" column="3">
+ <property name="name">
+ <cstring>m_led_syn</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="state">
+ <enum>Off</enum>
+ </property>
+ <property name="look">
+ <enum>Sunken</enum>
+ </property>
+ <property name="darkFactor">
+ <number>600</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>textLabel1_2_3_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Syncookies:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>textLabel1_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>RP-Filter:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1_2_8</cstring>
+ </property>
+ <property name="text">
+ <string>IP forwarding:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;FW options:&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2_3_2</cstring>
+ </property>
+ <property name="text">
+ <string>Load modules:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="7" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout23</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel8</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Fragments:</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>cb_frag</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel9</cstring>
+ </property>
+ <property name="text">
+ <string>Invert:</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>cb_frag_inv</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KComboBox" row="6" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>kb_optSelect</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="5" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>cb_disable_rule</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>cb_log_rule</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Disable rule:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Log matching packets:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout20</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Move rule in chain:</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>b_move_up</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>b_move_down</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="8" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout21</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel10</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Target:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>cb_target</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="autoResize">
+ <bool>true</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QWidgetStack" row="9" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_ws_target_opt</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ </widget>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidgetStack">
+ <property name="name">
+ <cstring>m_widgetStack</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>cb_frag</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditor</receiver>
+ <slot>slotFragChanged()</slot>
+ </connection>
+ <connection>
+ <sender>cb_frag_inv</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditor</receiver>
+ <slot>slotFragChanged()</slot>
+ </connection>
+ <connection>
+ <sender>cb_target</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>KMyFirewallRuleEditor</receiver>
+ <slot>slotTargetChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>cb_frag</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_frag_inv</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>rb_filter</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditor</receiver>
+ <slot>slotNewTableSelected()</slot>
+ </connection>
+ <connection>
+ <sender>rb_nat</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditor</receiver>
+ <slot>slotNewTableSelected()</slot>
+ </connection>
+ <connection>
+ <sender>rb_mangle</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditor</receiver>
+ <slot>slotNewTableSelected()</slot>
+ </connection>
+ <connection>
+ <sender>b_move_down</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditor</receiver>
+ <slot>slotMoveRuleDown()</slot>
+ </connection>
+ <connection>
+ <sender>b_move_up</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditor</receiver>
+ <slot>slotMoveRuleUp()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>rb_filter</tabstop>
+ <tabstop>cb_disable_rule</tabstop>
+ <tabstop>cb_log_rule</tabstop>
+ <tabstop>kb_optSelect</tabstop>
+ <tabstop>cb_frag</tabstop>
+ <tabstop>cb_frag_inv</tabstop>
+ <tabstop>cb_target</tabstop>
+</tabstops>
+<slots>
+ <slot>slotAddRule()</slot>
+ <slot>slotDelRule()</slot>
+ <slot>slotEditIPopt()</slot>
+ <slot>slotEditIntOpt()</slot>
+ <slot>slotEditLimitOpt()</slot>
+ <slot>slotEditMacOpt()</slot>
+ <slot>slotEditProtOpt()</slot>
+ <slot>slotEditRule()</slot>
+ <slot>slotEditStateOpt()</slot>
+ <slot>slotEditTargetOpt()</slot>
+ <slot>slotEditTargetOption()</slot>
+ <slot>slotEditTosOpt()</slot>
+ <slot>slotFragChanged()</slot>
+ <slot>slotHelp()</slot>
+ <slot>slotMoveRuleDown()</slot>
+ <slot>slotMoveRuleUp()</slot>
+ <slot>slotNewChainSelected( int )</slot>
+ <slot>slotNewTableSelected()</slot>
+ <slot>slotSaveConfig()</slot>
+ <slot>slotSaveRuleChanges()</slot>
+ <slot>slotTargetChanged( const QString &amp; )</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kled.h</includehint>
+ <includehint>kled.h</includehint>
+ <includehint>kled.h</includehint>
+ <includehint>kled.h</includehint>
+ <includehint>kled.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfconfigdialog.cpp b/kmyfirewall/kmfconfigdialog.cpp
new file mode 100644
index 0000000..2450d65
--- /dev/null
+++ b/kmyfirewall/kmfconfigdialog.cpp
@@ -0,0 +1,415 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+#include "kmfconfigdialog.h"
+#include "kmfconfigdialog.moc"
+
+// QT includes
+#include <qstring.h>
+#include <qframe.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+#include <qregexp.h>
+#include <qmessagebox.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kurlrequester.h>
+#include <kguiitem.h>
+#include <kpushbutton.h>
+#include <knuminput.h>
+#include <klistbox.h>
+#include <kcombobox.h>
+#include <kiconloader.h>
+#include <kglobal.h>
+#include <kmessagebox.h>
+#include <klistview.h>
+#include <ktrader.h>
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+
+
+// Project includes
+#include "core/kmfdoc.h"
+#include "core/kmfprotocollibrary.h"
+#include "core/kmfconfig.h"
+#include "core/kmftarget.h"
+#include "core/kmftargetconfig.h"
+#include "core/kmfnetwork.h"
+
+#include "kmfwidgets/kmfchecklistoutput.h"
+#include "kmfwidgets/kmfinterfacewidget.h"
+#include "kmfwidgets/kmfmynetworkwidget.h"
+#include "kmfwidgets/kmfgenericinterfaceeditprotocol.h"
+
+#include "core/kmfcompilerinterface.h"
+#include "core/xmlnames.h"
+
+namespace KMF {
+KMFConfigDialog::KMFConfigDialog( QWidget *parent, const char *name, bool modal ) : KDialogBase( IconList, i18n( "Configure" ), Ok | Apply | Cancel,
+ Ok, parent, name, modal, true ) {
+ loadIcons();
+
+ m_backends = new QPtrList<QStringList>;
+ setupGeneral();
+ setupCustomProtocols();
+ setupListView();
+ setupPlugins();
+ checkPlugins();
+ slotReadConfig();
+ setBaseSize( 800, 600 );
+}
+
+KMFConfigDialog::~KMFConfigDialog() {}
+
+void KMFConfigDialog::setNetwork( KMFNetwork* net ) {
+ m_network = net;
+ m_protocolPageEditProtocol->loadDoc( net );
+ m_protocolPageEditProtocol->slotUpdateView();
+}
+
+void KMFConfigDialog::slotApply() {
+ kdDebug() << "void KMFConfigDialog::slotApply()" << endl;
+ slotSaveConfig();
+ KMFConfig::writeConfig();
+ emit sigConfigChanged();
+}
+
+void KMFConfigDialog::accept() {
+ kdDebug() << "void KMFConfigDialog::accept()" << endl;
+ slotSaveConfig();
+ KMFConfig::writeConfig();
+ emit sigConfigChanged();
+ QDialog::accept();
+}
+
+void KMFConfigDialog::reject() {
+ kdDebug() << "void KMFConfigDialog::reject()" << endl;
+}
+
+void KMFConfigDialog::exec() {
+ QDialog::exec();
+}
+
+void KMFConfigDialog::convertConfig() {
+ kdDebug() << "void KMFConfigDialog::convertConfig()" << endl;
+ const QString & msg = i18n( "<qt><p><b>Importing installation target Settings</b><br>"
+ "The settings will be applied to the <b>My Local Computer</b> Host. Remote hosts must be configureed seperately.</p></qt>" );
+ if( KMessageBox::questionYesNo( this, msg ) != 3 ) {
+ return;
+ }
+
+
+ m_network->currentTarget();
+ KMFTargetConfig *conf = m_network->netzone()->findTargetByName( Constants::Localhost_Name )->config();
+ conf->setOS( KMFConfig::oS().lower() );
+ conf->setBackend( KMFConfig::backend().lower() );
+ conf->setDistribution( KMFConfig::distribution() );
+ conf->setIPTPath( KMFConfig::iPTPath() );
+ conf->setInitPath( KMFConfig::initPath() );
+ conf->setModprobePath( KMFConfig::modprobePath() );
+ conf->setRcDefaultPath( KMFConfig::rcDefaultPath() );
+ conf->setInterfaces( KMFConfig::interfaces() );
+ KMFConfig::setConfigurationConverted( true );
+
+ KMFConfig::writeConfig();
+
+ const QString & msg2 = i18n( "<qt><p><b>Configuration Imported!</b><br>"
+ "The current configuration was imported to <b>My Local Computer</b>.<br>"
+ "Please check the imported configuration before you install the firewall</qt>" );
+ KMessageBox::information( this, msg2, i18n( "Information" ) );
+}
+
+void KMFConfigDialog::slotReadConfig() {
+ KMFConfig::self()->readConfig();
+
+ m_cb_show_splash->setChecked( KMFConfig::showSplash() );
+ m_cb_generic_interface->setChecked( KMFConfig::useGenericInterface() );
+
+ m_cb_show_desc->setChecked( KMFConfig::showDocumentation() );
+ m_cb_show_cmds->setChecked( KMFConfig::showCommandLine() );
+ m_cb_show_objectID->setChecked( KMFConfig::showObjectID() );
+ m_cb_useSSHForLocalhost->setChecked( KMFConfig::useSSHForLocalhost() );
+ m_sb_max_undo->setValue( KMFConfig::maxUndo() );
+}
+
+
+void KMFConfigDialog::slotSaveConfig() {
+ KMFConfig::setFirstRun( false );
+ KMFConfig::setShowSplash( m_cb_show_splash->isChecked() );
+
+ KMFConfig::setUseGenericInterface( m_cb_generic_interface->isChecked() );
+
+ KMFConfig::setShowDocumentation( m_cb_show_desc->isChecked() );
+ KMFConfig::setShowCommandLine( m_cb_show_cmds->isChecked() );
+ KMFConfig::setShowObjectID( m_cb_show_objectID->isChecked() );
+
+ KMFConfig::setShowSelInterface( m_cb_show_selInterface->isChecked() );
+
+ KMFConfig::setMaxUndo( m_sb_max_undo->value() );
+ KMFConfig::setUseSSHForLocalhost( m_cb_useSSHForLocalhost->isChecked() );
+ KMFConfig::self()->writeConfig();
+
+ m_protocolPageEditProtocol->saveProtocols();
+}
+
+void KMFConfigDialog::setupGeneral() {
+ QFrame * page = addPage( i18n( "General Setting" ), QString::null, icon_general );
+ QGridLayout *lay = new QGridLayout( page, 5, 2, 2 );
+ m_cb_show_splash = new QCheckBox( i18n( "Show splash screen on startup" ), page );
+ m_cb_show_splash->setChecked( true );
+ m_cb_show_selInterface = new QCheckBox( i18n( "Show interface selection dialog at startup" ), page );
+ m_cb_show_selInterface->setChecked( KMFConfig::showSelInterface() );
+
+ QGroupBox* gb_generic = new QGroupBox( 2, Qt::Vertical, i18n("Generic Interface"), page, "gb_generic" );
+ /*QLabel *text1 = */new QLabel( i18n( "<qt>By using the Generic Interface the creation of rulesets is much easier but it is not as flexible as the Normal Interface.</qt>" ), gb_generic );
+ m_cb_generic_interface = new QCheckBox( i18n( "Use the Generic Interface" ), gb_generic );
+ m_cb_generic_interface->setChecked( KMFConfig::useGenericInterface() );
+ connect( m_cb_generic_interface, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotEnableGenericInterface( bool ) ) );
+
+ QLabel *text2 = new QLabel( i18n( "<qt>Max. stored Undos:</qt>" ), page );
+ m_sb_max_undo = new KIntSpinBox( 0, 100, 1, 10, 10, page, "spin_box" );
+ m_sb_max_undo->setValue( 10 );
+ m_b_enable_warnings = new KPushButton( i18n( "Reenable All Messages" ), page );
+ m_b_enable_warnings->setFixedHeight( 30 );
+ connect( m_b_enable_warnings, SIGNAL( clicked() ), this, SLOT( slotEnableWarnings() ) );
+
+ QLabel *text3 = new QLabel( i18n( "<qt>By enabling KMyFirewall will communicate with the local computer using SSH. This will enable password keeping (e.g. KWallet support).</qt>" ), page );
+ m_cb_useSSHForLocalhost = new QCheckBox( i18n( "Use SSH for localhost communication" ), page );
+ m_cb_useSSHForLocalhost->setChecked( KMFConfig::useSSHForLocalhost() );
+ // connect( m_cb_useSSHForLocalhost, SIGNAL( toggled( bool ) ), this, SLOT( slotEnableLocalSSHUsage( bool ) ) );
+
+ lay->addMultiCellWidget( gb_generic, 0, 0, 0, 1 );
+
+ lay->addMultiCellWidget( m_cb_show_splash, 1, 1 , 0, 0 );
+ lay->addMultiCellWidget( m_cb_show_selInterface, 1, 1, 1, 1 );
+
+ lay->addMultiCellWidget( m_cb_useSSHForLocalhost, 2, 2, 0, 0, Qt::AlignTop );
+ lay->addMultiCellWidget( text3, 2, 2, 1, 1, Qt::AlignTop );
+
+
+ lay->addMultiCellWidget( text2, 3, 3 , 0, 0 );
+ lay->addMultiCellWidget( m_sb_max_undo, 3, 3, 1, 1 );
+ lay->addMultiCellWidget( m_b_enable_warnings, 4, 4, 0, 1 );
+
+ QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
+ lay->addItem( spacer, 5, 0 );
+
+}
+
+void KMFConfigDialog::setupCustomProtocols(){
+ QFrame* editProtocolFrame = addPage(i18n("Custom Protocols"), i18n("Define your Custom Protocols here"), icon_edit_protocol_page );
+ QGridLayout *editProtocolLayout = new QGridLayout( editProtocolFrame, 1, 1, 2, 2 );
+ m_protocolPageEditProtocol = new KMFGenericInterfaceEditProtocol( editProtocolFrame ,"m_protocolPageEditProtocol");
+ editProtocolLayout->addWidget( m_protocolPageEditProtocol,0,0 );
+}
+
+void KMFConfigDialog::registerCompiler( KMFCompilerInterface* compiler ) {
+ kdDebug() << "KMFConfigDialog::registerCompiler: OS: " << compiler->osGUIName() << " Backend: " << compiler->backendGUIName() << endl;
+ // m_cb_os->insertItem( compiler->osGUIName() );
+ QStringList *stl = new QStringList();
+ stl->append( compiler->osName() );
+ stl->append( compiler->osGUIName() );
+ stl->append( compiler->backendName() );
+ stl->append( compiler->backendGUIName() );
+ m_backends->append( stl );
+}
+
+void KMFConfigDialog::setupListView() {
+ QFrame * page = addPage( i18n( "Listview Preferences" ), QString::null, icon_listview );
+ QGridLayout *lay = new QGridLayout( page, 5, 1, 2 );
+ m_lvp_text1 = new QLabel( i18n( "<qt>Define here if you like to see the documentation "
+ "for tables and built-in chains in the main listview.</qt>" ), page );
+ lay->addWidget( m_lvp_text1, 0, 0 );
+ m_cb_show_desc = new QCheckBox( i18n( "Show documentation for all Objects." ), page );
+ lay->addWidget( m_cb_show_desc, 1, 0 );
+
+ m_lvp_text2 = new QLabel( i18n( "<qt>Turn this box on of you like to see the "
+ "generated iptables command lines in the main listview</qt>" ), page );
+ lay->addWidget( m_lvp_text2, 2, 0 );
+
+ m_cb_show_cmds = new QCheckBox( i18n( "Show iptables commands." ), page );
+ lay->addWidget( m_cb_show_cmds, 3, 0 );
+
+
+ m_lvp_text3 = new QLabel( i18n( "<qt>Enable this to show the internally-used Object IDs in the listview. Mainly useful for debuging.</qt>" ), page );
+ lay->addWidget( m_lvp_text3, 4, 0 );
+
+
+ m_cb_show_objectID = new QCheckBox( i18n( "Show objectIDs." ), page );
+ lay->addWidget( m_cb_show_objectID, 5, 0 );
+
+
+ QLabel *m_lvp_text4 = new QLabel( i18n( "<qt><b>Note:</b> Those settings are only available for the normal interface. This options are disabled when using the generic interface.</qt>" ), page );
+ lay->addWidget( m_lvp_text4, 6, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
+ lay->addItem( spacer, 7, 0 );
+}
+
+void KMFConfigDialog::setupPlugins(){
+ kdDebug() << "\nvoid KMFConfigDialog::setupPlugins()" << endl;
+ QFrame * page = addPage( i18n( "Plugins" ), QString::null, icon_listview );
+ QVBoxLayout *lay = new QVBoxLayout( page );
+ QLabel *text1 = new QLabel( i18n( "<qt>In the list you can see which plugins have been found.</qt>" ), page );
+ lay->addWidget( text1 );
+ m_lv_plugins = new KListView( page );
+ m_lv_plugins->addColumn( i18n("Name") );
+ m_lv_plugins->addColumn( i18n("Description") );
+ m_lv_plugins->addColumn( i18n("Library") );
+ lay->addWidget( m_lv_plugins );
+}
+
+void KMFConfigDialog::checkPlugins() {
+ kdDebug() << "void KMFConfigDialog::checkPlugins()" << endl;
+ m_lv_plugins->clear();
+ KListViewItem *item_installers = new KListViewItem( m_lv_plugins, 0,0 );
+ item_installers->setText( 0, i18n("Installers") );
+ item_installers->setOpen( true );
+
+ KListViewItem *item_compilers = new KListViewItem( m_lv_plugins, 0,0 );
+ item_compilers->setText( 0, i18n("Compilers") );
+ item_compilers->setOpen( true );
+
+ KListViewItem *item_optioneditors = new KListViewItem( m_lv_plugins, 0,0 );
+ item_optioneditors->setText( 0, i18n("Rule Option Editors") );
+ item_optioneditors->setOpen( true );
+
+ KListViewItem *item_targetoptioneditors = new KListViewItem( m_lv_plugins, 0,0 );
+ item_targetoptioneditors->setText( 0, i18n("Rule Target Option Editors") );
+ item_targetoptioneditors->setOpen( true );
+
+ // kdDebug() << "Start query" << endl;
+ KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/Installer");
+ // kdDebug() << "Query performed for KMyFirewall/Installer" << endl;
+ KTrader::OfferList::iterator it;
+ if ( offers.empty() ) {
+ KListViewItem *item = new KListViewItem( item_installers, 0,0);
+ item->setText(0, i18n("No installer plugins found!") );
+ kdDebug() << "NO MATCHING PLUGIN FOUND" << endl;
+ }
+ for ( it = offers.begin(); it != offers.end(); ++it ) {
+ KService::Ptr ptr = *it;
+ KListViewItem *item = new KListViewItem( item_installers, 0,0);
+ item->setText(0, ptr->name() );
+ item->setText(1, ptr->comment() );
+ item->setText(2, ptr->library().local8Bit().data() );
+ }
+
+ KTrader::OfferList offers2 = KTrader::self()->query( "KMyFirewall/Compiler" );
+ // kdDebug() << "Query performed for KMyFirewall/Compiler" << endl;
+ if ( offers2.empty() ) {
+ KListViewItem *item = new KListViewItem( item_compilers, 0,0);
+ item->setText(0, i18n("No compiler plugins found!") );
+ kdDebug() << "NO MATCHING PLUGIN FOUND" << endl;
+ }
+ for ( it = offers2.begin(); it != offers2.end(); ++it ) {
+ KService::Ptr ptr = *it;
+ KListViewItem *item = new KListViewItem( item_compilers, 0,0);
+ item->setText(0, ptr->name() );
+ item->setText(1, ptr->comment() );
+ item->setText(2, ptr->library().local8Bit().data() );
+ // kdDebug() << "Found Plugin: " << ptr->name() << "\nLibrary: "<< ptr->library().local8Bit().data() <<endl;
+ KLibFactory *factory = KLibLoader::self()->factory( ptr->library().local8Bit().data() );
+ kdDebug() << KLibLoader::self()->lastErrorMessage() << endl;
+
+ if ( !factory ) {
+ KMessageBox::error( 0, i18n("<qt><b>Compiler plugin could not be loaded.</b></qt>") );
+ kdDebug() << "Couldn't load plugin: " << ptr->name() << endl;
+ }
+
+ if ( KMFCompilerInterface *part = dynamic_cast<KMFCompilerInterface*> ( factory->create( this , "KMFCompilerInterface") ) ) {
+ // kdDebug() << "Returning Compiler Plugin." << endl;
+ registerCompiler( part );
+ }
+ }
+
+
+
+ KTrader::OfferList offers3 = KTrader::self()->query( "KMyFirewall/RuleOptionEdit" );
+ // kdDebug() << "Query performed for KMyFirewall/RuleOptionEdit" << endl;
+ if ( offers3.empty() ) {
+ KListViewItem *item = new KListViewItem( item_optioneditors, 0,0);
+ item->setText(0, i18n("No RuleOptionEdit plugins found.") );
+ kdDebug() << "NO MATCHING PLUGIN FOUND" << endl;
+ }
+
+ for ( it = offers3.begin(); it != offers3.end(); ++it ) {
+ KService::Ptr ptr = *it;
+ KListViewItem *item = new KListViewItem( item_optioneditors, 0,0);
+ item->setText(0, ptr->name() );
+ item->setText(1, ptr->comment() );
+ item->setText(2, ptr->library().local8Bit().data() );
+ // kdDebug() << "Found Plugin: " << ptr->name() << "\nLibrary: "<< ptr->library().local8Bit().data() <<endl;
+ }
+
+ KTrader::OfferList offers4 = KTrader::self()->query( "KMyFirewall/RuleTargetOptionEdit" );
+ // kdDebug() << "Query performed for KMyFirewall/RuleTargetOptionEdit" << endl;
+ if ( offers4.empty() ) {
+ KListViewItem *item = new KListViewItem( item_targetoptioneditors, 0,0);
+ item->setText(0, i18n("No RuleTargetOptionEdit plugins found.") );
+ kdDebug() << "NO MATCHING PLUGIN FOUND" << endl;
+ }
+ for ( it = offers4.begin(); it != offers4.end(); ++it ) {
+ KService::Ptr ptr = *it;
+ KListViewItem *item = new KListViewItem( item_targetoptioneditors, 0,0);
+ item->setText(0, ptr->name() );
+ item->setText(1, ptr->comment() );
+ item->setText(2, ptr->library().local8Bit().data() );
+ // kdDebug() << "Found Plugin: " << ptr->name() << "\nLibrary: "<< ptr->library().local8Bit().data() <<endl;
+ }
+}
+
+void KMFConfigDialog::slotEnableGenericInterface( bool enable ) {
+ if ( enable != KMFConfig::useGenericInterface() )
+ KMessageBox::information( this, i18n( "<qt>Please not that you have to restart KMyFirewall to make the changes take effect. </qt>" ), QString( "" ), "info_change_interface" );
+}
+
+// void KMFConfigDialog::slotEnableLocalSSHUsage( bool enable ) {
+// KMFConfig::setUseSSHForLocalhost( enable );
+// }
+
+
+void KMFConfigDialog::slotEnableWarnings() {
+ kdDebug() << "KMFConfigDialog::slotEnableWarnings()" << endl;
+ KMessageBox::enableAllMessages();
+ KMessageBox::information( this, i18n( "Reenabled all warnings." ) );
+}
+
+void KMFConfigDialog::loadIcons() {
+ KIconLoader * loader = KGlobal:: iconLoader();
+ QString icon_name;
+
+ icon_name = "about_kde";
+ icon_general = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "folder";
+ icon_paths = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "network";
+ icon_interfaces = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "view_tree";
+ icon_listview = loader->loadIcon( icon_name, KIcon::Desktop );
+
+ icon_name = "nfs_unmount";
+ icon_edit_protocol_page = loader->loadIcon( icon_name, KIcon::Desktop );
+}
+
+}
+
diff --git a/kmyfirewall/kmfconfigdialog.h b/kmyfirewall/kmfconfigdialog.h
new file mode 100644
index 0000000..64cdfec
--- /dev/null
+++ b/kmyfirewall/kmfconfigdialog.h
@@ -0,0 +1,107 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+#ifndef KMFCONFIGDIALOG_H
+#define KMFCONFIGDIALOG_H
+
+#include <qwidget.h>
+#include <kdialogbase.h>
+#include <kconfig.h>
+#include <kglobal.h>
+#include <kprocess.h>
+#include <qstring.h>
+#include <qpixmap.h>
+
+
+#include "core/kmfcompilerinterface.h"
+
+class QFrame;
+class QCheckBox;
+class QRadioButton;
+class QButtonGroup;
+class KURLRequester;
+class KPushButton;
+class KComboBox;
+class KListBox;
+class KIntSpinBox;
+
+namespace KMF {
+class KMFCheckListOutput;
+class KMFInterfaceWidget;
+class KMFMyNetworkWidget;
+class KMFNetwork;
+class KMFGenericInterfaceEditProtocol;
+
+class KMFConfigDialog : public KDialogBase {
+ Q_OBJECT
+
+public:
+ KMFConfigDialog( QWidget *parent = 0, const char *name = 0, bool modal = true );
+ ~KMFConfigDialog();
+ void setNetwork( KMFNetwork* );
+ void registerCompiler( KMFCompilerInterface* );
+ void convertConfig();
+ void exec();
+
+public slots:
+ void slotReadConfig();
+ void slotSaveConfig();
+
+private slots:
+ void slotEnableGenericInterface( bool );
+ void slotEnableWarnings();
+ // void slotEnableLocalSSHUsage( bool enable );
+ void slotApply();
+ void accept();
+ void reject();
+
+private: // members
+ void setupListView();
+ void setupGeneral();
+ void setupCustomProtocols();
+ void setupPlugins();
+ void checkPlugins();
+ void loadIcons();
+
+private: // data
+ KMFNetwork *m_network;
+
+ // General
+ QCheckBox *m_cb_show_splash;
+ QCheckBox *m_cb_show_selInterface;
+ QCheckBox *m_cb_generic_interface;
+ QCheckBox *m_cb_useSSHForLocalhost;
+ KIntSpinBox *m_sb_max_undo;
+ KPushButton *m_b_enable_warnings;
+
+ KMFGenericInterfaceEditProtocol *m_protocolPageEditProtocol;
+
+ // Path widget
+ QPtrList<QStringList> *m_backends;
+
+
+ QPixmap icon_paths, icon_interfaces, icon_general, icon_listview, icon_edit_protocol_page;
+ QFrame * pageGeneric;
+
+ // ListView
+ QCheckBox *m_cb_show_cmds;
+ QCheckBox *m_cb_show_desc;
+ QCheckBox *m_cb_show_objectID;
+ QLabel *m_lvp_text1, *m_lvp_text2, *m_lvp_text3;
+
+ // Plugins
+ KListView *m_lv_plugins;
+signals:
+ void sigConfigChanged();
+};
+}
+#endif
diff --git a/kmyfirewall/kmfdisclaimer.cpp b/kmyfirewall/kmfdisclaimer.cpp
new file mode 100644
index 0000000..9fa2368
--- /dev/null
+++ b/kmyfirewall/kmfdisclaimer.cpp
@@ -0,0 +1,48 @@
+/***************************************************************************
+ begin : Tue Mar 19 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : a9806056@unet.univie.ac.at
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfdisclaimer.h"
+#include "kmyfirewall.h"
+// kde
+#include <kconfig.h>
+#include <ksimpleconfig.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kapplication.h>
+// qt
+#include <qmessagebox.h>
+#include <qfile.h>
+#include <qstring.h>
+#include <qcheckbox.h>
+
+KMFDisclaimer::KMFDisclaimer( QWidget *parent, const char *name, bool modal, WFlags fl ) : KMyFirewallDisclaimer( parent, name, modal, fl ) {}
+KMFDisclaimer::~KMFDisclaimer() {}
+
+void KMFDisclaimer::accept() {
+ KConfig * _config = kapp->config();
+ _config->setGroup( "STARTUP" );
+ if ( c_show->isChecked() ) {
+ _config->writeEntry( "show_disclaimer", "false" );
+ _config->sync();
+ } else {
+ _config->writeEntry( "show_disclaimer", "true" );
+ _config->sync();
+ }
+ QDialog::accept();
+}
+
+#include "kmfdisclaimer.moc"
diff --git a/kmyfirewall/kmfgrs.desktop b/kmyfirewall/kmfgrs.desktop
new file mode 100644
index 0000000..67715a1
--- /dev/null
+++ b/kmyfirewall/kmfgrs.desktop
@@ -0,0 +1,21 @@
+# KDE Config File
+[Desktop Entry]
+Encoding=UTF-8
+Type=MimeType
+MimeType=application/x-kmyfirewall-kmfgrs
+Icon=kmyfirewall
+Patterns=*.kmfgrs;
+DefaultApp=kmyfirewall
+Comment=KMyFirewall Generic Ruleset
+Comment[bg]=Поредица от правила на KMyFirewall
+Comment[es]=Conjunto de reglas genéricas de KMyFirewall
+Comment[et]=KMyFirewalli üldine reeglistik
+Comment[it]=Insieme di regole generiche per KMyFirewall
+Comment[nl]=KMyFirewall generieke regelverzameling
+Comment[pt]=Conjunto de Regras Genérico do KMyFirewall
+Comment[pt_BR]=Conjunto de Regras Genérico do KMyFirewall
+Comment[sr]=KMyFirewall-ов генерички скуп правила
+Comment[sr@Latn]=KMyFirewall-ов генерички скуп правила
+Comment[sv]=Generell regeluppsättning för Min brandvägg
+Comment[xx]=xxKMyFirewall Generic Rulesetxx
+
diff --git a/kmyfirewall/kmfnet.desktop b/kmyfirewall/kmfnet.desktop
new file mode 100644
index 0000000..20b8f01
--- /dev/null
+++ b/kmyfirewall/kmfnet.desktop
@@ -0,0 +1,20 @@
+# KDE Config File
+[Desktop Entry]
+Encoding=UTF-8
+Type=MimeType
+MimeType=application/x-kmyfirewall-kmfnet
+Icon=kmyfirewall
+Patterns=*.kmfnet;
+DefaultApp=kmyfirewall
+Comment=KMyFirewall Network Configuration
+Comment[bg]=Мрежова настройка на KMyFirewall
+Comment[es]=Configuración de red de KMyFirewall
+Comment[et]=KMyFirewalli võrguseadistused
+Comment[it]=Configurazione di rete di KMyFirewall
+Comment[nl]=KMyFirewall netwerkconfiguratie
+Comment[pt]=Configuração da Rede do KMyFirewall
+Comment[pt_BR]=Configuração da Rede do KMyFirewall
+Comment[sr]=KMyFirewall - подешавање мреже
+Comment[sr@Latn]=KMyFirewall - подешавање мреже
+Comment[sv]=Nätverksinställning för Min brandvägg
+Comment[xx]=xxKMyFirewall Network Configurationxx
diff --git a/kmyfirewall/kmfpkg.desktop b/kmyfirewall/kmfpkg.desktop
new file mode 100644
index 0000000..09b38d8
--- /dev/null
+++ b/kmyfirewall/kmfpkg.desktop
@@ -0,0 +1,20 @@
+# KDE Config File
+[Desktop Entry]
+Encoding=UTF-8
+Type=MimeType
+MimeType=application/x-kmyfirewall-kmfpkg
+Icon=kmyfirewall
+Patterns=*.kmfpkg;
+Comment=KMyFirewall Installation Package
+Comment[bg]=Инсталационен пакет на KMyFirewall
+Comment[es]=Paquete de instalación de KMyFirewall
+Comment[et]=KMyFirewalli paigaldamispakett
+Comment[it]=Pacchetto di installazione di KMyFirewall
+Comment[nl]=KMyFirewall-installatiepakket
+Comment[pt]=Pacote de Instalação do KMyFirewall
+Comment[pt_BR]=Pacote de Instalação do KMyFirewall
+Comment[sr]=KMyFirewall-ов инсталациони пакет
+Comment[sr@Latn]=KMyFirewall-ов инсталациони пакет
+Comment[sv]=Installationspaket för Min brandvägg
+Comment[xx]=xxKMyFirewall Installation Packagexx
+
diff --git a/kmyfirewall/kmfrs.desktop b/kmyfirewall/kmfrs.desktop
new file mode 100644
index 0000000..a500067
--- /dev/null
+++ b/kmyfirewall/kmfrs.desktop
@@ -0,0 +1,21 @@
+# KDE Config File
+[Desktop Entry]
+Encoding=UTF-8
+Type=MimeType
+MimeType=application/x-kmyfirewall-kmfrs
+Icon=kmyfirewall
+Patterns=*.kmfrs;
+DefaultApp=kmyfirewall
+Comment=KMyFirewall IPTables Ruleset
+Comment[bg]=Поредица от правила на IPTables за KMyFirewall
+Comment[es]=Conjunto de reglas de IPTables de KMyFirewall
+Comment[et]=KMyFirewalli IPTablesi reeglistik
+Comment[it]=Insieme di regole IPTables per KMyFirewall
+Comment[ms]=Peraturan IPTables KMyFirewall
+Comment[nl]=KMyFirewall IPTables-regelverzameling
+Comment[pt]=Conjunto de Regras do IPTables para o KMyFirewall
+Comment[pt_BR]=Conjunto de Regras do IPTables para o KMyFirewall
+Comment[sr]=KMyFirewall-ов IPTables-ов скуп правила
+Comment[sr@Latn]=KMyFirewall-ов IPTables-ов скуп правила
+Comment[sv]=Regeluppsättning med IP-tabeller för Min brandvägg
+Comment[xx]=xxKMyFirewall IPTables Rulesetxx
diff --git a/kmyfirewall/kmfwidgets/Makefile.am b/kmyfirewall/kmfwidgets/Makefile.am
new file mode 100644
index 0000000..c06a44c
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/Makefile.am
@@ -0,0 +1,38 @@
+INCLUDES = $(all_includes) -I$(srcdir)/../core -I../core -I../ipteditor -I../genericinterface
+METASOURCES = AUTO
+lib_LTLIBRARIES = libkmfwidgets.la
+libkmfwidgets_la_LDFLAGS = -no-undefined $(all_libraries)
+libkmfwidgets_la_LIBADD = \
+ $(LIB_KPARTS) ../core/libkmfcore.la
+
+
+libkmfwidgets_la_SOURCES = kmfchecklistitem.cpp kmfchecklistoutput.cpp \
+ kmfdocumentinfo.cpp kmfgenericinterfaceeditprotocol.cpp kmfgenericinterfaceeditprotocol.h \
+ kmfhostwidget.cpp kmfinterfacewidget.cpp kmfiptdocoptions.cpp kmfiptdocview.cpp \
+ kmfipv4addresswidget.cpp kmflistview.cpp kmflistviewitem.cpp kmfmainwindow.cpp \
+ kmfmultiportwidget.cpp kmfmynetworkwidget.cpp kmfnethostpropertieswidget.cpp \
+ kmfnetworkwidget.cpp kmfnewdocdlg.cpp kmfobjectinfo.cpp kmfportwidget.cpp kmfprocout.cpp \
+ kmfprotocollistview.cpp kmfprotocolpropertieswidget.cpp kmfqtdesignerplugin.cpp \
+ kmfselectactivetarget.cpp kmfselectinterface.cpp kmfsystemsettingslinux.cpp \
+ kmftemplatechooser.cpp kmftransactionlog.cpp kmyfirewalldocumentinfo.ui \
+ kmyfirewallgenericinterfaceeditprotocolwidget.ui kmyfirewallhostwidget.ui kmyfirewallinterfacewidget.ui \
+ kmyfirewalliptdocoptions.ui kmyfirewallipv4adddresswidget.ui kmyfirewallmultiportwidget.ui \
+ kmyfirewallmynetworkwidget.ui kmyfirewallnethostproperties.ui kmyfirewallnetworkwidget.ui \
+ kmyfirewallnewdocument.ui kmyfirewallobjectinfo.ui kmyfirewallportwidget.ui \
+ kmyfirewallprotocollistview.ui kmyfirewallprotocolpropertieswidget.ui kmyfirewallselectactivetarget.ui \
+ kmyfirewallselectinterface.ui kmyfirewallsystemsettingslinux.ui kmyfirewalltemplatechooser.ui \
+ kmyfirewalltransactionlog.ui
+
+
+libkmfwidgetsincludedir = $(includedir)/kmyfirewall/kmfwidgets/
+
+libkmfwidgetsinclude_HEADERS = kmfprocout.h kmflistview.h kmflistviewitem.h \
+ kmfmultiportwidget.h kmfportwidget.h kmfchecklistoutput.h kmfnewdocdlg.h kmfchecklistitem.h \
+ kmfmainwindow.h kmfnetworkwidget.h kmfiptdocoptions.h kmfiptdocoptions.h \
+ kmfobjectinfo.h kmyfirewallselectinterface.h
+
+noinst_HEADERS = kmfdocumentinfo.h kmfhostwidget.h kmfinterfacewidget.h \
+ kmfipv4addresswidget.h kmfmynetworkwidget.h kmfnethostpropertieswidget.h kmfprotocollistview.h \
+ kmfprotocolpropertieswidget.h kmfqtdesignerplugin.h kmfselectactivetarget.h kmfsystemsettingslinux.h \
+ kmftemplatechooser.h kmftransactionlog.h
+
diff --git a/kmyfirewall/kmfwidgets/kmfchecklistitem.cpp b/kmyfirewall/kmfwidgets/kmfchecklistitem.cpp
new file mode 100644
index 0000000..171f1f7
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfchecklistitem.cpp
@@ -0,0 +1,58 @@
+//
+// C++ Implementation: kmfchecklistitem
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfchecklistitem.h"
+
+// QT includes
+
+// KDE includes
+#include <kdebug.h>
+
+// Project includes
+#include "../core/netfilterobject.h"
+#include "../core/kmfprotocol.h"
+#include "../core/kmfprotocolusage.h"
+
+namespace KMF {
+
+KMFCheckListItem::KMFCheckListItem( QListView *parent, QListViewItem *after, const QString& text, Type tt, KMFProtocolUsage* obj ) : QCheckListItem( parent, after, text, tt ) {
+ loadKMFProtocolUsage( obj );
+}
+KMFCheckListItem::KMFCheckListItem( QListViewItem *parent, const QString& text , Type tt, KMFProtocolUsage* obj ) : QCheckListItem( parent, text, tt ) {
+ loadKMFProtocolUsage( obj );
+}
+KMFCheckListItem::KMFCheckListItem( QListViewItem *parent, QListViewItem *after, const QString& text, Type tt, KMFProtocolUsage* obj ) : QCheckListItem( parent, after, text, tt ) {
+ loadKMFProtocolUsage( obj );
+}
+
+KMFCheckListItem::~KMFCheckListItem() {}
+
+
+void KMFCheckListItem::loadKMFProtocolUsage( KMFProtocolUsage* obj ) {
+ if ( KMFProtocolUsage *prot = dynamic_cast<KMFProtocolUsage*> ( obj ) ) {
+ m_protocolUsage = prot;
+ } else {
+ kdDebug() << "ERROR: Given NetfilterObject has wrong type" << endl;
+ }
+}
+
+}
+
diff --git a/kmyfirewall/kmfwidgets/kmfchecklistitem.h b/kmyfirewall/kmfwidgets/kmfchecklistitem.h
new file mode 100644
index 0000000..8d8cc01
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfchecklistitem.h
@@ -0,0 +1,53 @@
+//
+// C++ Interface: kmfchecklistitem
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFCHECKLISTITEM_H
+#define KMFCHECKLISTITEM_H
+
+#include <qlistview.h>
+#include <kdemacros.h>
+
+namespace KMF {
+class KMFProtocol;
+class KMFProtocolUsage;
+class NetfilterObject;
+
+class KDE_EXPORT KMFCheckListItem : public QCheckListItem
+{
+public:
+ KMFCheckListItem( QListViewItem *parent, const QString&, Type tt = Controller, KMFProtocolUsage* = 0 );
+ KMFCheckListItem( QListView *parent, QListViewItem *after, const QString&, Type tt = Controller, KMFProtocolUsage* = 0 );
+ KMFCheckListItem( QListViewItem *parent, QListViewItem *after, const QString&, Type tt = Controller, KMFProtocolUsage* = 0);
+ ~KMFCheckListItem();
+
+
+public:
+ KMFProtocolUsage* protocolUsage() const {
+ return m_protocolUsage;
+ };
+
+private:
+ void loadKMFProtocolUsage( KMFProtocolUsage* );
+
+ KMFProtocolUsage *m_protocolUsage;
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfchecklistoutput.cpp b/kmyfirewall/kmfwidgets/kmfchecklistoutput.cpp
new file mode 100644
index 0000000..3ec367d
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfchecklistoutput.cpp
@@ -0,0 +1,104 @@
+/***************************************************************************
+ begin : Tue Jul 30 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfchecklistoutput.h"
+
+// QT includs
+#include <qlabel.h>
+#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qlistview.h>
+#include <qlayout.h>
+#include <qstring.h>
+
+// kde includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+
+namespace KMF {
+KMFCheckListOutput::KMFCheckListOutput( QWidget *parent, const char *name , bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) {
+ setCaption( "KMyFirewall" );
+ QGridLayout *l_prog = new QGridLayout( this,4,2,6,11 );
+ text = new QLabel( i18n("<qt><b>Trying to guess the system configuration...</b><br>"
+ "If errors are occurring you'll have to setup the configuration yourself."
+ "</qt>"), this);
+ l_prog -> addMultiCellWidget( text, 0, 0, 0, 2 );
+
+ mpb_ok = new QPushButton( this, "Ok" );
+ mpb_ok->setText( i18n( "&Close Window" ) );
+ l_prog -> addMultiCellWidget( mpb_ok, 4, 4, 0, 2 );
+
+ mlb_outputView = new QListView( this, "msg" );
+ mlb_outputView->addColumn( i18n( "Looking For" ) );
+ mlb_outputView->addColumn( i18n( "Found?" ) );
+ mlb_outputView->setSelectionMode( QListView::NoSelection );
+ mlb_outputView->setSorting( -1 );
+ l_prog -> addMultiCellWidget( mlb_outputView, 1, 3, 0, 2 );
+
+
+ connect( mpb_ok, SIGNAL( clicked() ) , this, SLOT( hide() ) );
+ m_currItem = new QListViewItem( mlb_outputView );
+ m_currItem->setText( 0, i18n( "Starting system scan..." ) );
+ loadIcons();
+ this->resize( 450, 450 );
+}
+
+KMFCheckListOutput::~KMFCheckListOutput() {}
+
+void KMFCheckListOutput::appendLine( const QString &txt ) {
+ QListViewItem * item = new QListViewItem( mlb_outputView, m_currItem );
+ item->setMultiLinesEnabled( true );
+ item->setText( 0, txt );
+ m_currItem = item;
+ kdDebug() << "void KMFCheckListOutput::appendLine(QString txt)" << endl;
+}
+
+void KMFCheckListOutput::setStatus( bool ok, const QString &err_msg ) {
+ kdDebug() << "void KMFCheckListOutput::setStatus(bool ok,QString &err_msg)" << endl;
+ if ( ok ) {
+ m_currItem->setPixmap( 1, icon_ok );
+ } else {
+ m_currItem->setPixmap( 1, icon_err );
+ m_currItem->setOpen( true );
+ if ( !err_msg.isEmpty() ) {
+ QListViewItem * item = new QListViewItem( m_currItem );
+ item->setText( 0, err_msg );
+ }
+ }
+}
+
+void KMFCheckListOutput::clearList() {
+ kdDebug() << "void KMFCheckListOutput::clearList()" << endl;
+ mlb_outputView->clear();
+}
+
+void KMFCheckListOutput::loadIcons() {
+ kdDebug() << "void KMFCheckListOutput::loadIcons()" << endl;
+ KIconLoader *loader = KGlobal::iconLoader();
+ QString icon_name;
+
+ icon_name = "stop";
+ icon_err = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "button_ok";
+ icon_ok = loader->loadIcon( icon_name, KIcon::Small );
+
+}
+
+}
+
+#include "kmfchecklistoutput.moc"
diff --git a/kmyfirewall/kmfwidgets/kmfchecklistoutput.h b/kmyfirewall/kmfwidgets/kmfchecklistoutput.h
new file mode 100644
index 0000000..73d8887
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfchecklistoutput.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+ begin : Tue Jul 30 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFCHECKLISTOUTPUT_H
+#define KMFCHECKLISTOUTPUT_H
+
+#include <qdialog.h>
+#include <qpixmap.h>
+#include <kdemacros.h>
+class QLabel;
+class QListView;
+class QListViewItem;
+class QString;
+class QPushButton;
+namespace KMF {
+/**
+ *@author Christian Hubinger
+ */
+
+class KDE_EXPORT KMFCheckListOutput : public QDialog {
+ Q_OBJECT
+public:
+ KMFCheckListOutput( QWidget *parent = 0, const char *name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~KMFCheckListOutput();
+
+ /**
+ Appends one line at the End Of the List
+ */
+ void appendLine( const QString &txt );
+
+ /**
+ Sets the Status of the last created ListItem
+ */
+ void setStatus( bool ok, const QString &err_msg );
+
+ void clearList();
+
+private:
+
+ // Functions
+ void loadIcons();
+
+ // Data
+ QListView *mlb_outputView;
+ QPushButton *mpb_ok;
+ QListViewItem *m_currItem;
+ QPixmap icon_ok;
+ QPixmap icon_err;
+ QLabel *text;
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfdocumentinfo.cpp b/kmyfirewall/kmfwidgets/kmfdocumentinfo.cpp
new file mode 100644
index 0000000..2d8a1fb
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfdocumentinfo.cpp
@@ -0,0 +1,80 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+// License: GPL
+//
+
+
+#include "kmfdocumentinfo.h"
+
+// QT includes
+#include <qstring.h>
+#include <qtextedit.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+
+
+// KDE includes
+#include <kapplication.h>
+#include <kdebug.h>
+
+// project includes
+#include "../core/kmfdoc.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmfundoengine.h"
+namespace KMF {
+KMFDocumentInfo::KMFDocumentInfo(QWidget* parent, const char* name, bool modal, WFlags fl)
+ : KMyFirewallDocumentInfo(parent,name, modal,fl) {
+ connect( b_help, SIGNAL( clicked() ),
+ this, SLOT( slotHelp() ) );
+ connect( b_saveAsTemplate, SIGNAL( clicked() ), this, SLOT( slotSaveAsTemplate() ) );
+
+}
+
+KMFDocumentInfo::~KMFDocumentInfo() {}
+
+void KMFDocumentInfo::slotSaveAsTemplate() {
+ kdDebug() << "slotSaveAsTemplate()" << endl;
+ emit sigSaveAsTemplate();
+}
+
+/*$SPECIALIZATION$*/
+void KMFDocumentInfo::accept() {
+ if ( ! txt_name->text().isNull() ) {
+ m_doc->setName( txt_name->text() );
+// m_doc->changed();
+ // m_doc->network()->changed();
+ }
+
+ if ( ! txt_description->text().isNull() ) {
+ m_doc->setDescription( txt_description->text() );
+// m_doc->changed();
+ // m_doc->network()->changed();
+ }
+
+ QDialog::accept();
+}
+
+void KMFDocumentInfo::loadDoc( KMFDoc* doc ) {
+ m_doc = doc;
+ txt_name->setText( doc->name() );
+ txt_description->setText( doc->description() );
+}
+
+void KMFDocumentInfo::slotHelp() {
+ kdDebug() << "void KMFDocumentInfo::slotHelp()" << endl;
+ kapp->invokeHelp();
+}
+
+
+}
+
+#include "kmfdocumentinfo.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfdocumentinfo.h b/kmyfirewall/kmfwidgets/kmfdocumentinfo.h
new file mode 100644
index 0000000..059d488
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfdocumentinfo.h
@@ -0,0 +1,58 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+// License: GPL
+//
+
+#ifndef KMFDOCUMENTINFO_H
+#define KMFDOCUMENTINFO_H
+
+#include "kmyfirewalldocumentinfo.h"
+
+// QT includes
+
+// KDE includes
+#include <kdemacros.h>
+
+// project includes
+namespace KMF {
+class KMFDoc;
+
+class KDE_EXPORT KMFDocumentInfo : public KMyFirewallDocumentInfo {
+ Q_OBJECT
+
+public:
+ KMFDocumentInfo(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~KMFDocumentInfo();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ void loadDoc( KMFDoc* );
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void accept();
+ void slotSaveAsTemplate();
+ void slotHelp();
+
+private: // data
+ KMFDoc *m_doc;
+
+signals:
+ void sigSaveAsTemplate();
+
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmfgenericinterfaceeditprotocol.cpp b/kmyfirewall/kmfwidgets/kmfgenericinterfaceeditprotocol.cpp
new file mode 100644
index 0000000..45ad652
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfgenericinterfaceeditprotocol.cpp
@@ -0,0 +1,452 @@
+//
+// C++ Implementation: kmfgenericinterfaceeditprotocol
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfgenericinterfaceeditprotocol.h"
+
+// QT includes
+#include <qstring.h>
+#include <qcheckbox.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qdom.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qlistview.h>
+#include <qradiobutton.h>
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#include <qtextedit.h>
+#include <qbuttongroup.h>
+#include <qgroupbox.h>
+#include <qspinbox.h>
+#include <quuid.h>
+#include <qcombobox.h>
+
+// KDE includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kio/netaccess.h>
+#include <kio/job.h>
+#include <ktrader.h>
+#include <klibloader.h>
+#include <klistview.h>
+#include <klistbox.h>
+#include <knuminput.h>
+#include <kpushbutton.h>
+#include <kmessagebox.h>
+#include <ktempfile.h>
+#include <kcombobox.h>
+
+// Project includes
+#include "kmflistviewitem.h"
+#include "../version.h"
+#include "../core/kmfgenericdoc.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmfprotocol.h"
+#include "../core/kmfprotocollibrary.h"
+#include "../core/kmfprotocolcategory.h"
+#include "../core/kmferror.h"
+#include "../core/kmferrorhandler.h"
+
+namespace KMF {
+KMFGenericInterfaceEditProtocol::KMFGenericInterfaceEditProtocol( QWidget *parent, const char *name, WFlags f )
+ : KMyFirewallGenericInterfaceEditProtocolWidget( parent, name, f ) {
+ // m_protocolsLoaded = false;
+// m_protocols.clear();
+
+ connect( m_lv_protocols, SIGNAL( pressed( QListViewItem* ) ) ,
+ this, SLOT( slotNewItemSelected( QListViewItem* ) ) );
+
+ connect( m_lb_tcpPorts, SIGNAL( currentChanged ( QListBoxItem * ) ), this, SLOT( slotCurrentTCPPortChanged( QListBoxItem * ) ) );
+
+ connect( m_lb_udpPorts, SIGNAL( currentChanged ( QListBoxItem * ) ), this, SLOT( slotCurrentUDPPortChanged( QListBoxItem * ) ) );
+
+ // connect( m_sb_port_num, SIGNAL( valueChanged( int ) ), this, SLOT( slotPortVauleChanged( int ) ) );
+
+ connect( m_te_desc, SIGNAL( textChanged() ), this, SLOT( slotNameDescritionChanged() ) );
+ connect( m_le_protocolName , SIGNAL( textChanged( const QString& ) ), this, SLOT( slotNameDescritionChanged() ) );
+ connect( m_rb_tcp, SIGNAL( clicked() ), this, SLOT( slotProtocolTypeChanged() ) );
+ connect( m_rb_udp, SIGNAL( clicked() ), this, SLOT( slotProtocolTypeChanged() ) );
+
+ connect( m_b_add_port, SIGNAL( clicked() ), this, SLOT( slotAddPort() ) );
+ connect( m_b_del_port, SIGNAL( clicked() ), this, SLOT( slotDelPort() ) );
+
+ connect( m_b_new_protocol, SIGNAL( clicked() ), this, SLOT( slotAddProtocol() ) );
+ connect( m_b_del_protocol, SIGNAL( clicked() ), this, SLOT( slotDelProtocol() ) );
+
+ connect( m_cb_showAll,SIGNAL( toggled( bool ) ), this , SLOT( slotUpdateView() ) );
+}
+
+
+KMFGenericInterfaceEditProtocol::~KMFGenericInterfaceEditProtocol() {}
+
+
+
+void KMFGenericInterfaceEditProtocol::slotNewItemSelected( QListViewItem* qit ) {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotNewItemSelected(...)" << endl;
+
+ KMFListViewItem *item = dynamic_cast<KMFListViewItem*> ( qit );
+ if ( ! item ) {
+ kdDebug() << "Item was no KMFListViewItem!" << endl;
+ m_gb_edit->setEnabled( false );
+ m_b_del_protocol->setEnabled( false );
+ return;
+ }
+
+ if ( m_protocol &&
+ item->type() == NetfilterObject::PROTOCOL &&
+ m_protocol->uuid() == item->protocol()->uuid() ) {
+ kdDebug() << "Selected Same Protocal again" << endl;
+ m_gb_edit->setEnabled( m_protocol->customProtocol() );
+ m_b_del_protocol->setEnabled( m_protocol->customProtocol() );
+ return;
+ }
+ if ( item->type() != NetfilterObject::PROTOCOL ) {
+ return;
+ }
+ m_gb_edit->setEnabled( true );
+ m_b_del_protocol->setEnabled( true );
+ m_protocol = item->protocol();
+ updateEdit();
+}
+
+void KMFGenericInterfaceEditProtocol::slotCurrentTCPPortChanged( QListBoxItem * item ) {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotCurrentTCPPortChanged()" << endl;
+ if ( ! item ) {
+ return;
+ }
+
+ m_lb_udpPorts->clearSelection();
+// m_sb_port_num->setValue( item->text().toInt() );
+ m_rb_tcp->setChecked( true );
+
+}
+
+void KMFGenericInterfaceEditProtocol::slotCurrentUDPPortChanged( QListBoxItem * item ) {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotCurrentUDPPortChanged()" << endl;
+ if ( ! item ) {
+ return;
+ }
+ m_lb_tcpPorts->clearSelection();
+/* m_sb_port_num->blockSignals( true );
+ m_sb_port_num->setValue( item->text().toInt() );
+ m_sb_port_num->blockSignals( false );*/
+ m_rb_udp->setChecked( true );
+}
+
+void KMFGenericInterfaceEditProtocol::slotProtocolTypeChanged() {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotProtocolTypeChanged()" << endl;
+ if ( ! m_protocol ) {
+ kdDebug() << "\n\nWARNING: No Protocol Object to save Changes in Memory!!\n\n" << endl;
+ return;
+ }
+
+ m_lb_udpPorts->clearSelection();
+ m_lb_tcpPorts->clearSelection();
+}
+void KMFGenericInterfaceEditProtocol::slotAddPort() {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotAddPort()" << endl;
+ if ( ! m_protocol ) {
+ kdDebug() << "\n\nWARNING: No Protocol Object to save Changes in Memory!!\n\n" << endl;
+ return;
+ }
+
+ m_lb_udpPorts->clearSelection();
+ m_lb_tcpPorts->clearSelection();
+ if ( m_rb_tcp->isChecked() ) {
+ m_protocol->addPort( m_sb_port_num->text(), KMFProtocol::TCP );
+ m_lb_tcpPorts->blockSignals( true );
+ m_lb_tcpPorts->clear();
+ // QStringList l = QStringList::split( ",", m_protocol->tcpPortsList() );
+ m_lb_tcpPorts->insertStringList( QStringList::split( ",", m_protocol->tcpPortsList() ) );
+
+
+ m_lb_tcpPorts->blockSignals( false );
+
+ for( uint i= 0; i< m_lb_tcpPorts->count(); i++ ) {
+ if ( m_lb_tcpPorts->text( i ) == m_sb_port_num->text() ) {
+ m_lb_tcpPorts->setSelected( i, true );
+ }
+ }
+ slotProtocolChanged();
+ } else if ( m_rb_udp->isChecked() ) {
+ m_protocol->addPort( m_sb_port_num->text(), KMFProtocol::UDP );
+ m_lb_udpPorts->blockSignals( true );
+ m_lb_udpPorts->clear();
+// for( uint i= 0; i< m_protocol->udpPorts()->count(); i++ ) {
+// m_lb_udpPorts->insert( *m_protocol->udpPorts().at( i ) );
+// }
+ m_lb_udpPorts->insertStringList( QStringList::split( ",", m_protocol->udpPortsList() ) );
+ m_lb_udpPorts->blockSignals( false );
+
+ for( uint i= 0; i< m_lb_udpPorts->count(); i++ ) {
+ if ( m_lb_udpPorts->text( i ) == m_sb_port_num->text() ) {
+ m_lb_udpPorts->setSelected( i, true );
+ }
+ }
+ slotProtocolChanged();
+ }
+}
+
+void KMFGenericInterfaceEditProtocol::slotDelPort() {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotDelPort()" << endl;
+ if ( m_lb_tcpPorts->selectedItem() ) {
+ m_protocol->delPort( m_lb_tcpPorts->selectedItem()->text(), KMFProtocol::TCP );
+ m_lb_tcpPorts->blockSignals( true );
+ m_lb_tcpPorts->clear();
+ m_lb_tcpPorts->insertStringList( QStringList::split( ",", m_protocol->tcpPortsList() ) );
+ m_lb_tcpPorts->blockSignals( false );
+ if ( m_lb_tcpPorts->count() > 0 ) {
+ m_lb_tcpPorts->setSelected( 0, true );
+ }
+ slotProtocolChanged();
+ } else if ( m_lb_udpPorts->selectedItem() ) {
+ m_protocol->delPort( m_lb_udpPorts->selectedItem()->text(), KMFProtocol::UDP );
+ m_lb_udpPorts->blockSignals( true );
+ m_lb_udpPorts->clear();
+ m_lb_udpPorts->insertStringList( QStringList::split( ",", m_protocol->udpPortsList() ) );
+ m_lb_udpPorts->blockSignals( false );
+ if ( m_lb_udpPorts->count() > 0 ) {
+ m_lb_udpPorts->setSelected( 0, true );
+ }
+ slotProtocolChanged();
+ }
+}
+
+void KMFGenericInterfaceEditProtocol::slotAddProtocol() {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotAddProtocol()" << endl;
+// KMFProtocolCategory* catCustom = KMFProtocol::findCategory( KMFProtocolCategory::customCategoryUuid() );
+// if ( ! catCustom ) {
+// catCustom = KMFProtocolCategory::createCategory( i18n("Custom Protocols") );
+// catCustom->setUuid( KMFProtocolCategory::customCategoryUuid().toString() );
+// }
+
+ KMFProtocol *p = KMFProtocolCategory::getCustomCategory()->createProtocol( i18n("New Protocol") );
+ p->setName( i18n("New Protocol") );
+ p->setCustomProtocol( true );
+ m_protocol = p;
+ slotUpdateView();
+
+// KMFListViewItem *item = new KMFListViewItem( m_lv_protocols, p );
+// item->loadNetfilterObject( p );
+// item->setupProtocolView();
+//
+// m_lv_protocols->setSelected( item, true );
+// slotNewItemSelected( item );
+}
+
+void KMFGenericInterfaceEditProtocol::slotDelProtocol() {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotDelProtocol()" << endl;
+ if ( ! m_protocol ) {
+ return;
+ kdDebug() << "\n\nWARNING: No Protocol Object to save Changes in Memory!!\n\n" << endl;
+ }
+ int doit = KMessageBox::questionYesNo ( this , i18n( "<p>Are you sure that you want to delete "
+ "the protocol: <b>%1</b>?</p>").arg( m_protocol->name() ),
+ i18n( "Delete Protocol" ), KStdGuiItem::yes(), KStdGuiItem::no() /*, "protocol_edit_delete_protocol"*/ );
+
+ // kdDebug() << "Got Answer: " << doit << endl;
+ if ( doit != 3 ) {
+ return;
+ }
+ // FIXME: Casees Mem0ry Leak, but app crashed othwise!
+ m_protocol->category()->delProtocol( m_protocol, false );
+ m_protocol = 0;
+ slotNewItemSelected( 0 );
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceEditProtocol::slotOnProtocolDeleleted( QObject* ) {
+ m_protocol = 0;
+ slotUpdateView();
+ slotNewItemSelected( 0 );
+}
+
+void KMFGenericInterfaceEditProtocol::slotPortVauleChanged( int val ) {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotPortVauleChanged()" << endl;
+ if ( ! m_protocol ) {
+ kdDebug() << "\n\nWARNING: No Protocol Object to save Changes in Memory!!\n\n" << endl;
+ return;
+ }
+
+ QString s = "";
+ s.setNum( val );
+ if ( m_rb_udp->isChecked() ) {
+ QListBoxItem *i = m_lb_udpPorts->selectedItem();
+ if ( ! i ) {
+ return;
+ }
+ QString strVal = "";
+ strVal.setNum( val );
+ if ( m_protocol->replaceUDPPort( i->text().toInt(), val ) ) {
+ m_lb_udpPorts->blockSignals( true );
+ m_lb_udpPorts->clear();
+ m_lb_udpPorts->insertStringList( QStringList::split( ",", m_protocol->udpPortsList() ) );
+
+ for( uint i= 0; i< m_lb_udpPorts->count(); i++ ) {
+ if ( m_lb_udpPorts->text( i ) == strVal ) {
+ m_lb_udpPorts->setSelected( i, true );
+ break;
+ }
+ }
+ m_lb_udpPorts->blockSignals( false );
+ slotProtocolChanged();
+ }
+ } else if ( m_rb_tcp->isChecked() ) {
+ QListBoxItem *i = m_lb_tcpPorts->selectedItem();
+ if ( ! i ) {
+ return;
+ }
+
+ QString strVal = "";
+ strVal.setNum( val );
+
+ if( m_protocol->replaceTCPPort( i->text().toInt(), val ) ) {
+ m_lb_tcpPorts->blockSignals( true );
+ m_lb_tcpPorts->clear();
+ m_lb_tcpPorts->insertStringList( QStringList::split( ",", m_protocol->tcpPortsList() ) );
+ for( uint i= 0; i< m_lb_tcpPorts->count(); i++ ) {
+ if ( m_lb_tcpPorts->text( i ) == strVal ) {
+ m_lb_tcpPorts->setSelected( i, true );
+ break;
+ }
+ }
+ m_lb_tcpPorts->blockSignals( false );
+ slotProtocolChanged();
+ }
+ }
+}
+
+void KMFGenericInterfaceEditProtocol::slotNameDescritionChanged() {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotNameDescritionChanged()" << endl;
+ if ( ! m_protocol ) {
+ kdDebug() << "\n\nWARNING: No Protocol Object to save Changes in Memory!!\n\n" << endl;
+ return;
+ }
+
+ if ( ! m_le_protocolName->text().isEmpty() ) {
+ m_protocol->setName( m_le_protocolName->text().stripWhiteSpace().simplifyWhiteSpace() );
+ }
+ m_protocol->setDescription( m_te_desc->text().stripWhiteSpace().simplifyWhiteSpace() );
+
+ // m_protocol->setCategory( m_cob_
+ slotProtocolChanged();
+}
+
+void KMFGenericInterfaceEditProtocol::slotProtocolChanged() {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotProtocolChanged()" << endl;
+ QListViewItemIterator it( m_lv_protocols );
+ while ( it.current() ) {
+ KMFListViewItem *kit = dynamic_cast<KMFListViewItem*> ( it.current() );
+ if ( kit->type() == NetfilterObject::PROTOCOL &&
+ kit->protocol()->uuid() == m_protocol->uuid() ) {
+ kit->setupProtocolView();
+ kit->setOpen( true );
+ return;
+ }
+ ++it;
+ }
+}
+
+void KMFGenericInterfaceEditProtocol::updateEdit() {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::updateEdit()" << endl;
+ if ( ! m_protocol ) {
+ kdDebug() << "\n\nWARNING: No Protocol Object to save Changes in Memory!!\n\n" << endl;
+ m_gb_edit->setEnabled( false );
+ m_b_del_protocol->setEnabled( false );
+ return;
+ }
+ m_gb_edit->setEnabled( m_protocol->customProtocol() );
+ m_b_del_protocol->setEnabled( m_protocol->customProtocol() );
+
+ m_le_protocolName->blockSignals( true );
+ m_te_desc->blockSignals( true );
+
+ m_le_protocolName->setText( m_protocol->name() );
+ m_te_desc->setText( m_protocol->description() );
+
+ m_le_protocolName->blockSignals( false );
+ m_te_desc->blockSignals( false );
+
+ m_lb_tcpPorts->clear();
+ m_lb_udpPorts->clear();
+ m_lb_tcpPorts->insertStringList( QStringList::split( ",", m_protocol->tcpPortsList() ) );
+ m_lb_udpPorts->insertStringList( QStringList::split( ",", m_protocol->udpPortsList() ) );
+}
+
+void KMFGenericInterfaceEditProtocol::slotUpdateView() {
+ kdDebug() << "void KMFGenericInterfaceEditProtocol::slotUpdateView()" << endl;
+ m_lv_protocols->clear();
+ KMFProtocolCategory::getCustomCategory();
+
+ if ( m_cb_showAll->isChecked() ) {
+ QValueList<KMFProtocolCategory*>& protCats = KMFProtocolLibrary::instance()->protocolCategories();
+ QValueList<KMFProtocolCategory*>::iterator it;
+ for( it = protCats.begin(); it != protCats.end(); ++it ) {
+ KMFProtocolCategory* cat = *it;
+ kdDebug() << "\nSetup Category: Item" << cat->name() << endl;
+
+ KMFListViewItem *item = new KMFListViewItem( m_lv_protocols, cat );
+ item->loadNetfilterObject( cat );
+ item->setupProtocolCategoryView();
+ if ( cat == KMFProtocolCategory::getCustomCategory() ) {
+ item->setOpen( true );
+ }
+ }
+ } else {
+ KMFProtocolCategory* customCat = KMFProtocolCategory::getCustomCategory();
+ KMFListViewItem *item = new KMFListViewItem( m_lv_protocols, customCat );
+ item->loadNetfilterObject( customCat );
+ item->setupProtocolCategoryView();
+ item->setOpen( true );
+ }
+
+ QValueList< KMFProtocol* >& prots = KMFProtocolCategory::getCustomCategory()->protocols();
+ QValueList< KMFProtocol* >::iterator it;
+ for( it = prots.begin(); it != prots.end(); ++it ) {
+ KMFProtocol* p= *it;
+ disconnect( p, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolDeleleted( QObject* ) ) );
+ connect( p, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolDeleleted( QObject* ) ) );
+ }
+
+ setEnabled( true );
+}
+
+
+void KMFGenericInterfaceEditProtocol::loadDoc( KMFNetwork* doc ) {
+ kdDebug() << "void KMFGenericInterfaceLogging::loadDoc( KMFGenericDoc* )" << endl;
+ m_network = doc;
+ slotUpdateView();
+}
+
+void KMFGenericInterfaceEditProtocol::saveProtocols() {
+ kdDebug() << "KMFGenericInterfaceEditProtocol::saveProtocols()" << endl;
+ KMFErrorHandler *errH = new KMFErrorHandler( "KMFErrorHandler" );
+ errH->showError( KMFProtocolLibrary::instance()->saveProtocolLibrary() );
+}
+
+}
+
+#include "kmfgenericinterfaceeditprotocol.moc"
diff --git a/kmyfirewall/kmfwidgets/kmfgenericinterfaceeditprotocol.h b/kmyfirewall/kmfwidgets/kmfgenericinterfaceeditprotocol.h
new file mode 100644
index 0000000..658eb07
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfgenericinterfaceeditprotocol.h
@@ -0,0 +1,90 @@
+//
+// C++ Interface: kmfgenericinterfaceeditprotocol
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFGENERICINTERFACEEDITPROTOCOL_H
+#define KMFGENERICINTERFACEEDITPROTOCOL_H
+
+#include "kmyfirewallgenericinterfaceeditprotocolwidget.h"
+
+// QT Includes
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qguardedptr.h>
+#include <qpixmap.h>
+
+/**
+@author Christian Hubinger
+*/
+
+class QListViewItem;
+class QListBoxItem;
+
+namespace KMF {
+class KMFGenericDoc;
+class KMFNetwork;
+class KMFProtocol;
+class KMFListViewItem;
+class KMFProtocolCategory;
+
+class KMFGenericInterfaceEditProtocol : public KMyFirewallGenericInterfaceEditProtocolWidget {
+ Q_OBJECT
+public:
+ KMFGenericInterfaceEditProtocol( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+
+ ~KMFGenericInterfaceEditProtocol();
+
+ void saveProtocols();
+ // void loadProtocols();
+
+public slots:
+ void slotUpdateView();
+
+protected slots:
+ void slotNewItemSelected( QListViewItem* );
+ void slotCurrentTCPPortChanged( QListBoxItem * );
+ void slotCurrentUDPPortChanged( QListBoxItem * );
+ void slotPortVauleChanged( int );
+ void slotProtocolChanged();
+ void slotNameDescritionChanged();
+ void slotProtocolTypeChanged();
+ void slotAddPort();
+ void slotDelPort();
+ void slotAddProtocol();
+ void slotDelProtocol();
+ void slotOnProtocolDeleleted( QObject* );
+public:
+ void loadDoc( KMFNetwork* );
+
+private: // Methods
+
+ void updateEdit();
+ const QString& getXMLSniplet();
+// KMFProtocolCategory* getCuustomCategotry();
+
+private: // DATA
+ KMFNetwork *m_network;
+ // QPtrList<KMFProtocol> m_protocols;
+ QGuardedPtr<KMFProtocol> m_protocol;
+ // bool m_protocolsLoaded;
+
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfhostwidget.cpp b/kmyfirewall/kmfwidgets/kmfhostwidget.cpp
new file mode 100644
index 0000000..4f3c0e5
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfhostwidget.cpp
@@ -0,0 +1,368 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmfhostwidget.h"
+
+// QT includes
+#include <qtextedit.h>
+#include <qpushbutton.h>
+#include <qcolor.h>
+#include <qlabel.h>
+
+// KDE includes
+#include <kled.h>
+#include <kcombobox.h>
+#include <knuminput.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kio/netaccess.h>
+#include <kapplication.h>
+#include <ktrader.h>
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+
+
+// Project includes
+#include "../core/kmferror.h"
+#include "../core/kmferrorhandler.h"
+#include "../core/xmlnames.h"
+#include "../core/kmftarget.h"
+#include "../core/kmftargetconfig.h"
+#include "../core/kmfundoengine.h"
+#include "../core/kmfcompilerinterface.h"
+#include "../core/kmfinstallerinterface.h"
+namespace KMF {
+KMFHostWidget::KMFHostWidget(QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallHostWidget(parent, name, fl )
+{
+ kdDebug() << "KMFHostWidget::KMFHostWidget(QWidget* parent, const char* name, WFlags fl)" << endl;
+ connect( m_sb_host_0, SIGNAL( valueChanged ( int ) ),
+ this, SLOT( slotAddressChanged( int ) ) );
+ connect( m_sb_host_1, SIGNAL( valueChanged ( int ) ),
+ this, SLOT( slotAddressChanged( int ) ) );
+ connect( m_sb_host_2, SIGNAL( valueChanged ( int ) ),
+ this, SLOT( slotAddressChanged( int ) ) );
+ connect( m_sb_host_3, SIGNAL( valueChanged ( int ) ),
+ this, SLOT( slotAddressChanged( int ) ) );
+
+ connect( m_sb_host_sshPort, SIGNAL( valueChanged ( int ) ),
+ this, SLOT( slotSSHPortChanged( int ) ) );
+
+
+ connect( m_cb_backend, SIGNAL( activated( const QString& ) ),
+ this, SLOT( slotBackaendChanged( const QString& ) ) );
+ connect( m_cb_os, SIGNAL( activated( const QString& ) ),
+ this, SLOT( slotOSChanged( const QString& ) ) );
+
+ connect( m_host_desc, SIGNAL( textChanged() ),
+ this, SLOT( slotDescriptionChanged() ) );
+
+ connect( m_cmd_testSSH, SIGNAL( clicked() ),
+ this, SLOT( slotTestConnection() ) );
+ connect( m_cmd_autoConf, SIGNAL( clicked() ),
+ this, SLOT( slotTryAutoConfiguration() ) );
+}
+
+KMFHostWidget::~KMFHostWidget()
+{
+
+
+}
+
+void KMFHostWidget::InitGUI() {
+ kdDebug() << "KMFHostWidget::InitGUI()" << endl;
+ m_cb_backend->blockSignals( true );
+ m_cb_os->blockSignals( true );
+ m_cb_backend->clear();
+ m_cb_os->clear();
+
+
+ // kdDebug() << "Start query" << endl;
+ KTrader::OfferList offers = KTrader::self()->query( "KMyFirewall/Compiler");
+ // kdDebug() << "Query performed for KMyFirewall/Installer" << endl;
+ KTrader::OfferList::iterator it;
+ if ( offers.empty() ) {
+ kdDebug() << "ERROR: NO MATCHING PLUGIN FOUND" << endl;
+ }
+ for ( it = offers.begin(); it != offers.end(); ++it ) {
+ KService::Ptr ptr = *it;
+ KLibFactory *factory = KLibLoader::self()->factory( ptr->library().local8Bit().data() );
+ kdDebug() << KLibLoader::self()->lastErrorMessage() << endl;
+ if ( !factory ) {
+ KMessageBox::error( 0, i18n("<qt><b>Compiler plugin could not be loaded.</b></qt>") );
+ kdDebug() << "Couldn't load plugin: " << ptr->name() << endl;
+ }
+
+ if ( KMFCompilerInterface *compiler = dynamic_cast<KMFCompilerInterface*> ( factory->create( this , "KMFCompilerInterface") ) ) {
+ m_cb_os->insertItem( compiler->osGUIName() );
+ }
+ }
+ slotOSChanged( m_cb_os->currentText() );
+ m_cb_backend->blockSignals( false );
+ m_cb_os->blockSignals( false );
+}
+
+/*$SPECIALIZATION$*/
+void KMFHostWidget::loadHost( KMFTarget *target ) {
+ kdDebug() << "KMFHostWidget::loadHost( KMFTarget * " + target->guiName() + " )" << endl;
+ m_target = target;
+
+
+ updateView();
+}
+
+
+void KMFHostWidget::updateView() {
+ kdDebug() << "KMFHostWidget::updateView()" << endl;
+ m_sb_host_0->blockSignals( true );
+ m_sb_host_1->blockSignals( true );
+ m_sb_host_2->blockSignals( true );
+ m_sb_host_3->blockSignals( true );
+ m_sb_host_sshPort->blockSignals( true );
+ m_cb_backend->blockSignals( true );
+ m_cb_os->blockSignals( true );
+ m_host_desc->blockSignals( true );
+ m_cmd_testSSH->blockSignals( true );
+ m_led_configStatus->off();
+ if ( m_target ) {
+ m_led_configStatus->on();
+ if ( m_target->config()->isValid() ) {
+ m_led_configStatus->setColor( Qt::green );
+ m_lbl_configStatus->setText( i18n( "Config Ok" ) );
+ } else {
+ m_led_configStatus->setColor( Qt::red );
+ m_lbl_configStatus->setText( i18n( "Invalid Config!" ) );
+ }
+
+
+ m_cb_backend->setEnabled( true );
+ m_cb_os->setEnabled( true );
+ m_host_desc->setEnabled( true );
+ m_cmd_testSSH->setEnabled( true );
+ m_sb_host_sshPort->setEnabled( true );
+ m_cb_backend->setEnabled( true );
+ m_cb_os->setEnabled( true );
+ m_sb_host_0->setEnabled( true );
+ m_sb_host_1->setEnabled( true );
+ m_sb_host_2->setEnabled( true );
+ m_sb_host_3->setEnabled( true );
+ m_cmd_autoConf->setEnabled( true );
+ m_host_desc->setEnabled( true );
+ m_host_desc->setReadOnly( false );
+ if ( m_target->installer() ) {
+ for( int i = 0; i < m_cb_os->count(); i++ ) {
+ if ( m_cb_os->text( i ).lower() == m_target->installer()->osGUIName().lower() ) {
+ m_cb_os->setCurrentItem( i );
+ break;
+ }
+ }
+
+ m_cb_backend->clear();
+ QValueList<KMFCompilerInterface*> *comps = m_target->installer()->compilers();
+ QValueList<KMFCompilerInterface*>::iterator it;
+
+ for ( it = comps->begin(); it != comps->end(); ++it ) {
+ kdDebug() << "Found Compiler: " << (*it)->backendGUIName() << endl;
+ m_cb_backend->insertItem( (*it)->backendGUIName() );
+ }
+
+ for( int i = 0; i < m_cb_backend->count(); i++ ) {
+ if ( m_cb_backend->text( i ).lower() == m_target->compiler()->backendGUIName().lower() ) {
+ m_cb_backend->setCurrentItem( i );
+ break;
+ }
+ }
+ }
+
+ if ( m_target->isLocalhost() ) {
+// m_cmd_testSSH->setEnabled( false );
+// m_sb_host_sshPort->setEnabled( false );
+ m_sb_host_0->setEnabled( false );
+ m_sb_host_1->setEnabled( false );
+ m_sb_host_2->setEnabled( false );
+ m_sb_host_3->setEnabled( false );
+ m_host_desc->setReadOnly( true );
+ }
+
+
+ IPAddress * addr = m_target->address();
+ m_sb_host_0->setValue( addr->getDigit( 0 ) );
+ m_sb_host_1->setValue( addr->getDigit( 1 ) );
+ m_sb_host_2->setValue( addr->getDigit( 2 ) );
+ m_sb_host_3->setValue( addr->getDigit( 3 ) );
+
+ m_sb_host_sshPort->setValue( m_target->sshPort() );
+
+/* m_cb_backend->setCurrentItem( m_target->config()->backend(), false );
+ m_cb_os->setCurrentItem( m_target->config()->oS(), false );*/
+
+ if ( m_host_desc->text().simplifyWhiteSpace() != m_target->description() ) {
+ m_host_desc->setText( m_target->description() );
+ }
+
+ } else {
+ m_sb_host_0->setEnabled( false );
+ m_sb_host_1->setEnabled( false );
+ m_sb_host_2->setEnabled( false );
+ m_sb_host_3->setEnabled( false );
+ m_cb_backend->setEnabled( false );
+ m_cb_os->setEnabled( false );
+ m_sb_host_sshPort->setEnabled( false );
+ m_cmd_testSSH->setEnabled( false );
+ m_host_desc->setEnabled( false );
+ m_cmd_autoConf->setEnabled( false );
+ m_host_desc->setReadOnly( true );
+ }
+
+ m_sb_host_0->blockSignals( false );
+ m_sb_host_1->blockSignals( false );
+ m_sb_host_2->blockSignals( false );
+ m_sb_host_3->blockSignals( false );
+ m_cb_backend->blockSignals( false );
+ m_cb_os->blockSignals( false );
+ m_host_desc->blockSignals( false );
+ m_sb_host_sshPort->blockSignals( false );
+ m_cmd_testSSH->blockSignals( false );
+}
+
+void KMFHostWidget::slotTestConnection() {
+ if ( ! m_target ) {
+ return;
+ }
+ if ( KIO::NetAccess::fish_execute( m_target->getFishUrl(), "ls /",
+ KApplication::kApplication()->mainWidget() ) != 0) {
+ KMessageBox::information( this, i18n("Conneted successfully to: %1").arg( m_target->toFriendlyString() ) );
+ } else {
+ KMessageBox::error( this, i18n("Connetion to: %1 failed!").arg( m_target->toFriendlyString() ) );
+ }
+}
+void KMFHostWidget::slotTryAutoConfiguration(){
+ kdDebug() << "KMFHostWidget::slotTryAutoConfiguration())" << endl;
+ if ( ! m_target ) {
+ return;
+ }
+ KMFError* err = m_target->tryAutoConfiguration();
+ KMFErrorHandler* errH = new KMFErrorHandler( i18n("Auto Confguration of: %1").arg( m_target->toFriendlyString() ) );
+ if ( ! errH->showError( err ) ) {
+ return;
+ }
+ if ( ! m_target->config()->isValid() ) {
+ KMessageBox::error( this, i18n("<qt><p>Auto Confguration of: %1 could not determinate all needed setting. You'll need to configure the mmissing settings.</p></qt>").arg( m_target->toFriendlyString() ) );
+ } else {
+ KMessageBox::information( this, i18n("<qt><p>Auto Confguration of: %1 finished successfully.</p></qt>").arg( m_target->toFriendlyString() ) );
+ }
+ emit sigTargetChanged();
+}
+
+void KMFHostWidget::slotTryAutoConfiguration_Callback( KMFTarget* ) {
+ disconnect( m_target, SIGNAL( sigTargetChanged( KMFTarget* ) ),
+ this,SLOT( slotTryAutoConfiguration_Callback( KMFTarget* ) ) );
+ if ( ! m_target->config()->isValid() ) {
+ KMessageBox::error( 0, i18n("<qt><p>Auto Confguration of: %1 could not determinate all needed setting. You'll need to configure the mmissing settings.</p></qt>").arg( m_target->toFriendlyString() ) );
+ } else {
+ KMessageBox::information( this, i18n("<qt><p>Auto Confguration of: %1 finished successfully.</p></qt>").arg( m_target->toFriendlyString() ) );
+ }
+ emit sigTargetChanged();
+}
+
+void KMFHostWidget::slotAddressChanged( int val ) {
+ kdDebug() << "KMFHostWidget::slotAddressChanged( int " << val << " )" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_target,
+ i18n( "Edit address of target: %1.").arg( m_target->guiName() )
+ );
+ m_target->address()->setAddress(
+ m_sb_host_0->value(),
+ m_sb_host_1->value(),
+ m_sb_host_2->value(),
+ m_sb_host_3->value() );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigTargetChanged();
+
+}
+
+void KMFHostWidget::slotSSHPortChanged( int val ) {
+ kdDebug() << "KMFHostWidget:::slotSSHPortChanged( int " << val << " )" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_target,
+ i18n( "Edit SSH port of target: %1.").arg( m_target->guiName() )
+ );
+ m_target->setSSHPort( val );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigTargetChanged();
+}
+
+
+
+void KMFHostWidget::slotOSChanged( const QString& val ) {
+ kdDebug() << "KMFHostWidget:::slotOSChanged( const QString& " << val << " )" << endl;
+ if ( ! m_target ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_target->config(),
+ i18n( "Edit operation system setting of target: %1.").arg( m_target->guiName() )
+ );
+ m_target->config()->setOS( val.lower() );
+
+ m_cb_backend->blockSignals( true );
+ m_cb_backend->clear();
+ QValueList<KMFCompilerInterface*> *comps = m_target->installer()->compilers();
+ QValueList<KMFCompilerInterface*>::iterator it;
+
+ for ( it = comps->begin(); it != comps->end(); ++it ) {
+ kdDebug() << "Found Compiler: " << (*it)->backendGUIName() << endl;
+ m_cb_backend->insertItem( (*it)->backendGUIName() );
+ }
+ m_cb_backend->blockSignals( false );
+ slotBackaendChanged( m_cb_backend->currentText() );
+
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigTargetChanged();
+}
+
+void KMFHostWidget::slotBackaendChanged( const QString& val ) {
+ kdDebug() << "KMFHostWidget::slotBackaendChanged( const QString& " << val << " )" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_target->config(),
+ i18n( "Edit backend setting of target: %1.").arg( m_target->guiName() )
+ );
+ m_target->config()->setBackend( val.lower() );
+
+
+
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigTargetChanged();
+}
+
+void KMFHostWidget::slotDescriptionChanged() {
+ kdDebug() << "KMFHostWidget::slotDescriptionChanged()" << endl;
+ if ( m_host_desc->text() == m_target->description() ) {
+ kdDebug() << "Description Unchanged" << endl;
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_target,
+ i18n( "Edit documentation of target: %1.").arg( m_target->guiName() )
+ );
+ m_target->setDescription( m_host_desc->text().simplifyWhiteSpace() );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigTargetChanged();
+}
+
+}
+
+#include "kmfhostwidget.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfhostwidget.h b/kmyfirewall/kmfwidgets/kmfhostwidget.h
new file mode 100644
index 0000000..20aaf55
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfhostwidget.h
@@ -0,0 +1,69 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFHOSTWIDGET_H
+#define KMFHOSTWIDGET_H
+
+#include "kmyfirewallhostwidget.h"
+
+#include <qwidget.h>
+#include <kdialogbase.h>
+#include <kconfig.h>
+#include <kglobal.h>
+#include <kprocess.h>
+#include <qstring.h>
+#include <qpixmap.h>
+#include <qguardedptr.h>
+
+namespace KMF {
+class KMFTarget;
+
+class KMFHostWidget : public KMyFirewallHostWidget
+{
+ Q_OBJECT
+
+public:
+ KMFHostWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFHostWidget();
+ /*$PUBLIC_FUNCTIONS$*/
+ void loadHost( KMFTarget *target );
+ void InitGUI();
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+ void updateView();
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void slotAddressChanged( int );
+ void slotSSHPortChanged( int );
+ void slotOSChanged( const QString& );
+ void slotBackaendChanged( const QString& );
+ void slotDescriptionChanged();
+ void slotTestConnection();
+ void slotTryAutoConfiguration();
+ void slotTryAutoConfiguration_Callback( KMFTarget* );
+ signals:
+ void sigTargetChanged();
+
+
+private:
+ QGuardedPtr<KMFTarget> m_target;
+
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmfinterfacewidget.cpp b/kmyfirewall/kmfwidgets/kmfinterfacewidget.cpp
new file mode 100644
index 0000000..e2979b7
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfinterfacewidget.cpp
@@ -0,0 +1,173 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmfinterfacewidget.h"
+
+// QT includes
+#include <qstringlist.h>
+
+// KDE includes
+#include <klocale.h>
+#include <kcombobox.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kurlrequester.h>
+#include <kguiitem.h>
+#include <kpushbutton.h>
+#include <knuminput.h>
+#include <klistbox.h>
+#include <kcombobox.h>
+#include <kiconloader.h>
+#include <kglobal.h>
+#include <kmessagebox.h>
+#include <klistview.h>
+
+// Prokject includes
+#include "../core/kmftarget.h"
+#include "../core/kmftargetconfig.h"
+#include "../core/kmfundoengine.h"
+namespace KMF {
+KMFInterfaceWidget::KMFInterfaceWidget( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallInterfaceWidget( parent, name, fl ) {
+ connect( m_b_add_int, SIGNAL( clicked() ), this, SLOT( slotAddInterface() ) );
+ connect( m_b_del_int, SIGNAL( clicked() ), this, SLOT( slotDelInterface() ) );
+
+ m_cb_int_name->clear();
+ m_cb_int_name->insertItem( "eth" );
+ m_cb_int_name->insertItem( "ppp" );
+ m_cb_int_name->insertItem( "ippp" );
+ m_cb_int_name->insertItem( "ppoe" );
+ m_cb_int_name->insertItem( "wlan" );
+ m_cb_int_name->insertItem( "tun" );
+ m_cb_int_name->insertItem( "tap" );
+ m_cb_int_name->insertItem( "gre" );
+ m_cb_int_name->insertItem( "lo" );
+}
+
+KMFInterfaceWidget::~KMFInterfaceWidget() {}
+
+void KMFInterfaceWidget::loadTarget( KMFTarget* target ) {
+ kdDebug() << "KMFInterfaceWidget::loadTarget( KMFTarget* target )" << endl;
+ m_target = target;
+ updateView();
+}
+
+void KMFInterfaceWidget::updateView(){
+ kdDebug() << "KMFInterfaceWidget::updateView()" << endl;
+ if ( ! m_target ) {
+ return;
+ }
+ KMFTargetConfig *conf = m_target->config();
+ kdDebug() << "Load Config:" << endl;
+ kdDebug() << conf->toString() << endl;
+ m_lb_int->clear();
+ QStringList ints = conf->interfaces();
+ for ( QStringList::Iterator it = ints.begin(); it != ints.end(); ++it ) {
+ QString s = *it;
+ kdDebug() << "Load Interface: " << s << endl;
+ m_lb_int->insertItem( s );
+ }
+}
+
+void KMFInterfaceWidget::slotAddInterface() {
+ QString int_name = m_cb_int_name->currentText();
+ int int_num = m_sb_int_num->value();
+ QString str_num;
+ str_num.setNum( int_num );
+ QString interface = int_name;
+ if ( int_name != "lo" )
+ interface += str_num;
+ for ( uint i = 0;i < m_lb_int->count();i++ ) {
+ QString interf = m_lb_int->text( i );
+ if ( interface == interf ) {
+ KMessageBox::sorry( this, i18n( "You cannot have more then one interface with the same name." ),
+ i18n( "Configuration" ) );
+ return ;
+ }
+ }
+ m_lb_int->insertItem( interface );
+
+
+ KMFUndoEngine::instance()->startTransaction(
+ m_target->config(),
+ i18n( "Edit interfaces for target: %1.").arg( m_target->guiName() )
+ );
+ m_target->config()->setInterfaces( interfaces() );
+ KMFUndoEngine::instance()->endTransaction();
+
+}
+
+void KMFInterfaceWidget::addInterface( const QString& interface ) {
+ for ( uint i = 0;i < m_lb_int->count();i++ ) {
+ QString interf = m_lb_int->text( i );
+ if ( interface == interf ) {
+ KMessageBox::sorry( this, i18n( "You cannot have more then one interface with the same name." ),
+ i18n( "Configuration" ) );
+ return ;
+ }
+ }
+ m_lb_int->insertItem( interface );
+}
+
+void KMFInterfaceWidget::addInterfaces( QStringList interfcaes ) {
+ m_lb_int-> insertStringList( interfcaes );
+}
+
+void KMFInterfaceWidget::slotDelInterface() {
+ int index = m_lb_int->currentItem();
+ if ( index > -1 ) {
+ switch ( QMessageBox::warning( this, i18n( "Configuration" ),
+ i18n( "Are you sure that you want to delete\n"
+ "this interface?\n" ),
+ i18n( "&OK" ), i18n( "&Cancel" ),
+ 0, 2 ) ) {
+
+ case 0: // OK clicked
+ m_lb_int->removeItem( index );
+ KMFUndoEngine::instance()->startTransaction(
+ m_target->config(),
+ i18n( "Edit interfaces for target: %1.").arg( m_target->guiName() )
+ );
+ m_target->config()->setInterfaces( interfaces() );
+ KMFUndoEngine::instance()->endTransaction();
+ break;
+ }
+
+ } else {
+ KMessageBox::sorry( this, i18n( "You have to select an interface first before you can delete it." ),
+ i18n( "Configuration" ) );
+ return ;
+
+ }
+}
+
+void KMFInterfaceWidget::clear() {
+ m_lb_int->clear();
+}
+
+QStringList KMFInterfaceWidget::interfaces() {
+ QStringList ifs;
+ for ( uint i = 0;i < m_lb_int->count();i++ ) {
+ QString interf = m_lb_int->text( i );
+ if ( !interf.isEmpty() ) {
+ kdDebug() << "Found Interface " << interf << endl;
+ ifs << interf;
+ }
+ }
+ return ifs;
+}
+
+}
+#include "kmfinterfacewidget.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfinterfacewidget.h b/kmyfirewall/kmfwidgets/kmfinterfacewidget.h
new file mode 100644
index 0000000..cd898bd
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfinterfacewidget.h
@@ -0,0 +1,63 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFINTERFACEWIDGET_H
+#define KMFINTERFACEWIDGET_H
+
+#include "kmyfirewallinterfacewidget.h"
+
+#include <qstring.h>
+
+#include <qguardedptr.h>
+
+class QStringList;
+
+namespace KMF {
+class KMFTarget;
+
+class KMFInterfaceWidget : public KMyFirewallInterfaceWidget {
+ Q_OBJECT
+
+public:
+ KMFInterfaceWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFInterfaceWidget();
+ /*$PUBLIC_FUNCTIONS$*/
+ void addInterface( const QString& interface );
+ void addInterfaces( QStringList interfaces );
+ void clear();
+
+ void loadTarget( KMFTarget* target );
+
+ QStringList interfaces();
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ void slotDelInterface();
+ void slotAddInterface();
+
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+ void updateView();
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+signals:
+ void sigTargetChanged();
+
+private:
+ QGuardedPtr<KMFTarget> m_target;
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmfiptdocoptions.cpp b/kmyfirewall/kmfwidgets/kmfiptdocoptions.cpp
new file mode 100644
index 0000000..32599b8
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfiptdocoptions.cpp
@@ -0,0 +1,88 @@
+/***************************************************************************
+ begin : Wed Aug 21 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org.orphi.iki
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfiptdocoptions.h"
+
+
+// qt includes
+#include <qcheckbox.h>
+
+// kde includes
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+
+// project includes
+#include "../core/kmfdoc.h"
+#include "../core/kmfiptdoc.h"
+#include "../core/kmfundoengine.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmftarget.h"
+namespace KMF {
+KMFIPTDocOptions::KMFIPTDocOptions( QWidget *parent, const char *name ) : KMyFirewallIPTDocOptions( parent, name ) {}
+
+KMFIPTDocOptions::~KMFIPTDocOptions() {}
+
+void KMFIPTDocOptions::loadDoc( KMFIPTDoc* doc ) {
+ kdDebug() << "void KMFIPTDocOptions::loadDoc(KMFIPTDoc* doc)" << endl;
+ kmfdoc = doc;
+ c_use_filter->setChecked( kmfdoc->useFilter() );
+ c_use_nat->setChecked( kmfdoc->useNat() );
+ c_use_mangle->setChecked( kmfdoc->useMangle() );
+ c_use_ipfwd->setChecked( kmfdoc->useIPFwd() );
+ c_use_rp_filter->setChecked( kmfdoc->useRPFilter() );
+ c_use_martians->setChecked( kmfdoc->useMartians() );
+ c_use_syn_cookies->setChecked( kmfdoc->useSynCookies() );
+ c_use_modules->setChecked( kmfdoc->useModules() );
+}
+void KMFIPTDocOptions::accept() {
+ if ( ! c_use_filter->isChecked() && ! c_use_nat->isChecked() && ! c_use_mangle->isChecked() ) {
+ KMessageBox::sorry(this, i18n("<p>Sorry, you need to use at least one of the three tables -- <b> filter, nat</b> or <b>mangle</b>:<br>it does not make any sense to work on a ruleset where you cannot add any rules.</p>") );
+ return;
+ }
+
+
+ KMFUndoEngine::instance()->startTransaction(
+ kmfdoc,
+ i18n( "Edit document settings for target: %1.").arg( kmfdoc->target()->guiName() )
+ );
+ kmfdoc->setUseFilter( c_use_filter->isChecked() );
+ kmfdoc->setUseNat( c_use_nat->isChecked() );
+ kmfdoc->setUseMangle( c_use_mangle->isChecked() );
+ kmfdoc->setUseIPFwd( c_use_ipfwd->isChecked() );
+ if ( c_use_rp_filter->isChecked() ) {
+ kmfdoc->setUseRPFilter( true );
+ kmfdoc->setUseMartians( c_use_martians->isChecked() );
+ } else {
+ kmfdoc->setUseRPFilter( false );
+ kmfdoc->setUseMartians( false );
+ }
+ kmfdoc->setUseSynCookies( c_use_syn_cookies->isChecked() );
+ kmfdoc->setUseModules( c_use_modules->isChecked() );
+ // kmfdoc->network()->changed();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigConfigChanged();
+ QDialog::accept();
+}
+
+void KMFIPTDocOptions::slotHelp() {
+ kdDebug() << "void KMFIPTDocOptions::slotHelp() {" << endl;
+ kapp->invokeHelp();
+}
+
+}
+#include "kmfiptdocoptions.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfiptdocoptions.h b/kmyfirewall/kmfwidgets/kmfiptdocoptions.h
new file mode 100644
index 0000000..a4dd317
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfiptdocoptions.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+ begin : Wed Aug 21 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org.orphi.iki
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFIPTDOCOPTIONS_H
+#define KMFIPTDOCOPTIONS_H
+
+#include <qwidget.h>
+#include <kdemacros.h>
+#include "kmyfirewalliptdocoptions.h"
+
+/**
+ *@author Christian Hubinger
+ */
+
+class QString;
+
+namespace KMF {
+class KMFIPTDoc;
+
+class KDE_EXPORT KMFIPTDocOptions : public KMyFirewallIPTDocOptions {
+ Q_OBJECT
+public:
+ KMFIPTDocOptions( QWidget *parent = 0, const char *name = 0 );
+ ~KMFIPTDocOptions();
+ void loadDoc( KMFIPTDoc* doc );
+
+public slots:
+ void slotHelp();
+ void accept();
+private:
+ KMFIPTDoc* kmfdoc;
+signals:
+ void sigConfigChanged();
+
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfiptdocview.cpp b/kmyfirewall/kmfwidgets/kmfiptdocview.cpp
new file mode 100644
index 0000000..ee5e91b
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfiptdocview.cpp
@@ -0,0 +1,110 @@
+//
+// C++ Implementation: kmfiptdocview
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfiptdocview.h"
+
+// QT includes
+
+
+// KDE includes
+#include <kdebug.h>
+
+// Project includes
+#include "../core/kmfiptdoc.h"
+#include "../core/kmfdoc.h"
+#include "../core/iptable.h"
+#include "../core/xmlnames.h"
+namespace KMF {
+KMFIPTDocView::KMFIPTDocView(QWidget *parent, const char *name) : QTabWidget(parent, name)
+{
+ loaded = false;
+ m_iptViewFilter = new KMFListView( 0, "view" );
+ m_iptViewNat = new KMFListView( 0, "view" );
+ m_iptViewMangle = new KMFListView( 0, "view" );
+ addTab( m_iptViewFilter, "Filter" );
+ addTab( m_iptViewNat, "Nat" );
+ addTab( m_iptViewMangle, "Mangle" );
+
+ m_iptViewFilter ->setEnabled( true );
+ m_iptViewFilter->clear();
+ m_iptViewFilter->slotUpdateView();
+
+ m_iptViewNat ->setEnabled( true );
+ m_iptViewNat->clear();
+ m_iptViewNat->slotUpdateView();
+
+ m_iptViewMangle ->setEnabled( true );
+ m_iptViewMangle->clear();
+ m_iptViewMangle->slotUpdateView();
+
+ setMinimumSize( 600, 400 );
+}
+
+
+KMFIPTDocView::~KMFIPTDocView()
+{
+}
+
+void KMFIPTDocView::slotLoadDoc( KMFIPTDoc *iptdoc ) {
+ kdDebug() << "void KMFIPTDocView::slotLoadDoc( KMFIPTDoc *iptdoc )" << endl;
+ if ( ! loaded ) {
+ m_iptViewMangle->clear();
+ m_iptViewFilter->slotLoadNode( iptdoc->table( Constants::FilterTable_Name ) );
+ m_iptViewFilter->slotUpdateView();
+ m_iptViewMangle->clear();
+ m_iptViewNat->slotLoadNode( iptdoc->table( Constants::NatTable_Name ) );
+ m_iptViewFilter->slotUpdateView();
+ m_iptViewMangle->clear();
+ m_iptViewMangle->slotLoadNode( iptdoc->table( Constants::MangleTable_Name ) );
+ m_iptViewFilter->slotUpdateView();
+ loaded = true;
+ } else {
+
+ m_iptViewFilter->slotUpdateView( iptdoc->table( Constants::FilterTable_Name ) );
+ m_iptViewFilter->slotUpdateView();
+
+ m_iptViewNat->slotUpdateView( iptdoc->table( Constants::NatTable_Name ) );
+ m_iptViewNat->slotUpdateView();
+
+ m_iptViewMangle->slotUpdateView( iptdoc->table( Constants::MangleTable_Name ) );
+ m_iptViewMangle->slotUpdateView();
+ }
+}
+
+void KMFIPTDocView::slotLoadTable( IPTable* ) {
+
+}
+
+void KMFIPTDocView::close() {
+ kdDebug() << "void KMFIPTDocView::close()" << endl;
+ emit closing();
+ QTabWidget::close();
+}
+
+void KMFIPTDocView::show() {
+ kdDebug() << "void KMFIPTDocView::show()" << endl;
+ emit showing();
+ QTabWidget::show();
+ m_iptViewFilter->slotUpdateView();
+ m_iptViewNat->slotUpdateView();
+ m_iptViewMangle->slotUpdateView();
+}
+
+void KMFIPTDocView::hide() {
+ kdDebug() << "void KMFIPTDocView::hide()" << endl;
+ emit closing();
+ QTabWidget::hide();
+}
+
+
+}
+
+#include "kmfiptdocview.moc"
diff --git a/kmyfirewall/kmfwidgets/kmfiptdocview.h b/kmyfirewall/kmfwidgets/kmfiptdocview.h
new file mode 100644
index 0000000..88093d4
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfiptdocview.h
@@ -0,0 +1,69 @@
+//
+// C++ Interface: kmfiptdocview
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFIPTDOCVIEW_H
+#define KMFIPTDOCVIEW_H
+
+#include <qtabwidget.h>
+
+
+#include "kmflistview.h"
+
+// Project includes
+
+namespace KMF {
+class KMFIPTDoc;
+class IPTable;
+
+/**
+@author Christian Hubinger
+*/
+class KMFIPTDocView : public QTabWidget
+{
+Q_OBJECT
+public:
+ KMFIPTDocView(QWidget *parent = 0, const char *name = 0);
+
+ ~KMFIPTDocView();
+
+KMFListView* filterView() const {
+ return m_iptViewFilter;
+};
+
+KMFListView* natView() const {
+ return m_iptViewNat;
+};
+
+KMFListView* mangleView() const {
+ return m_iptViewMangle;
+};
+
+
+public slots:
+ void slotLoadDoc( KMFIPTDoc* );
+ void slotLoadTable( IPTable* );
+ void close();
+ void show();
+ void hide();
+
+private:
+ KMFListView *m_iptViewFilter;
+ KMFListView *m_iptViewNat;
+ KMFListView *m_iptViewMangle;
+ bool loaded;
+
+signals:
+ void closing();
+ void showing();
+
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfipv4addresswidget.cpp b/kmyfirewall/kmfwidgets/kmfipv4addresswidget.cpp
new file mode 100644
index 0000000..8a19942
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfipv4addresswidget.cpp
@@ -0,0 +1,117 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmfipv4addresswidget.h"
+
+// QT includes
+#include <qlistview.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qgroupbox.h>
+#include <qwidgetstack.h>
+#include <qtextedit.h>
+#include <qtimer.h>
+
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kcombobox.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kinputdialog.h>
+#include <knuminput.h>
+
+// Project includes
+#include "../core/ipaddress.h"
+namespace KMF {
+KMFIPv4AddressWidget::KMFIPv4AddressWidget ( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallIPv4AdddressWidget ( parent,name,fl ) {
+
+// m_address = new IPAddress( 0,0,0,0 );
+ connect( m_sb_from_1, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+ connect( m_sb_from_2, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+ connect( m_sb_from_3, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+ connect( m_sb_from_4, SIGNAL( valueChanged( const QString& ) ),
+ this, SLOT( slotAddressChanged( const QString& ) ) );
+}
+
+KMFIPv4AddressWidget::~KMFIPv4AddressWidget() {}
+
+/*$SPECIALIZATION$*/
+
+void KMFIPv4AddressWidget::loadIPAddress( int d0, int d1, int d2, int d3 ) {
+ kdDebug() << "KMFIPv4AddressWidget::loadIPAddress( "
+ << d0 << "."
+ << d1 << "."
+ << d2 << "."
+ << d3 << " )" << endl;
+
+
+
+ m_sb_from_1->blockSignals( true );
+ m_sb_from_2->blockSignals( true );
+ m_sb_from_3->blockSignals( true );
+ m_sb_from_4->blockSignals( true );
+
+ m_sb_from_1->setValue( d0 );
+ m_sb_from_2->setValue( d1 );
+ m_sb_from_3->setValue( d2 );
+ m_sb_from_4->setValue( d3 );
+
+ m_sb_from_1->blockSignals( false );
+ m_sb_from_2->blockSignals( false );
+ m_sb_from_3->blockSignals( false );
+ m_sb_from_4->blockSignals( false );
+
+ m_sb_from_1->setEnabled( true );
+ m_sb_from_2->setEnabled( true );
+ m_sb_from_3->setEnabled( true );
+ m_sb_from_4->setEnabled( true );
+
+ // m_address->setAddress( d0, d1, d2, d3 );
+}
+
+void KMFIPv4AddressWidget::slotAddressChanged( const QString& ) {
+ kdDebug() << "KMFIPv4AddressWidget::slotAddressChanged( const QString& )" << endl;
+ /*
+ if ( ! m_address ) {
+ return;
+ }
+
+ const QString& newAddr = m_sb_from_1->text() +"."+
+ m_sb_from_2->text() +"."+
+ m_sb_from_3->text() +"."+
+ m_sb_from_4->text();
+ if ( m_address->toString() == newAddr ) {
+ return;
+ }*/
+
+ emit sigAddressChanged(
+ m_sb_from_1->value(),
+ m_sb_from_2->value(),
+ m_sb_from_3->value(),
+ m_sb_from_4->value() );
+}
+
+}
+
+#include "kmfipv4addresswidget.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfipv4addresswidget.h b/kmyfirewall/kmfwidgets/kmfipv4addresswidget.h
new file mode 100644
index 0000000..3ae2a6b
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfipv4addresswidget.h
@@ -0,0 +1,52 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFIPV4ADDRESSWIDGET_H
+#define KMFIPV4ADDRESSWIDGET_H
+
+#include "kmyfirewallipv4adddresswidget.h"
+
+// QT include
+#include <qguardedptr.h>
+
+namespace KMF {
+class IPAddress;
+
+class KMFIPv4AddressWidget : public KMyFirewallIPv4AdddressWidget {
+ Q_OBJECT
+
+ public:
+ KMFIPv4AddressWidget ( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFIPv4AddressWidget();
+ void loadIPAddress( int, int, int, int );
+
+ /*$PUBLIC_FUNCTIONS$*/
+
+ public slots:
+ /*$PUBLIC_SLOTS$*/
+
+ protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+ protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void slotAddressChanged( const QString& );
+
+ private:
+// IPAddress *m_address;
+
+ signals:
+ void sigAddressChanged( int, int, int, int );
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmflistview.cpp b/kmyfirewall/kmfwidgets/kmflistview.cpp
new file mode 100644
index 0000000..072e348
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmflistview.cpp
@@ -0,0 +1,1148 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+
+
+#include "kmflistview.h"
+
+// QT includes
+#include <qstring.h>
+#include <qptrlist.h>
+#include <kiconloader.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kconfig.h>
+
+// Project includes
+#include "../core/netfilterobject.h"
+#include "../core/kmfdoc.h"
+#include "../core/iptable.h"
+#include "../core/iptchain.h"
+#include "../core/iptrule.h"
+#include "../core/iptruleoption.h"
+#include "../core/kmfconfig.h"
+#include "../core/kmfappstate.h"
+#include "../core/xmlnames.h"
+#include "../kmyfirewall.h"
+#include "kmflistviewitem.h"
+namespace KMF {
+KMFListView::KMFListView( QWidget *parent, const char *name ) : KListView( parent, name ) {
+ loadIcons();
+ connect( this, SIGNAL( sigLoadNode( NetfilterObject* ) ),
+ this, SLOT( slotLoadNode( NetfilterObject* ) ) );
+ cast_error = i18n( "ERROR: Wrong ListViewItem Class used!\nThis is no KMFListViewItem" );
+ setSorting(0,true);
+ m_show_desc = true;
+ m_show_cmds = false;
+ m_show_objectID = false;
+ m_NetfilterObject = 0;
+
+
+ addColumn( i18n( "Rule No." ) );
+ addColumn( QString::null );
+ addColumn( i18n( "Value" ) );
+ setSizePolicy( QSizePolicy( ( QSizePolicy::SizeType ) 2, ( QSizePolicy::SizeType ) 2, 0, 0,
+ sizePolicy().hasHeightForWidth() ) );
+ setFrameShape( KListView::StyledPanel );
+ setFrameShadow( KListView::Sunken );
+ setSorting( 0, true );
+ setFullWidth( true );
+ setItemsMovable( true );
+ setDropHighlighter( true );
+ setDropVisualizer( true );
+ setSelectionMode( QListView::Single );
+
+}
+
+
+KMFListView::~KMFListView() {}
+
+void KMFListView::slotLoadNode( NetfilterObject* node ) {
+ kdDebug() << "void KMFListView::loadNode( NetfilterObject* node )" << endl;
+ if ( ! node ) {
+ kdDebug() << "node == 0" << endl;
+ return;
+ }
+ m_NetfilterObject = node;
+
+ if ( m_NetfilterObject->type() == NetfilterObject::TABLE ) {
+ if ( IPTable * table = dynamic_cast<IPTable*> ( node ) ) {
+ bool changed = false;
+ if ( KMFConfig::showDocumentation() ) {
+ if ( ! m_show_desc )
+ changed = true;
+ m_show_desc = true;
+ } else {
+ if ( m_show_desc )
+ changed = true;
+ m_show_desc = false;
+ }
+ if ( KMFConfig::showCommandLine() ) {
+ if ( ! m_show_cmds )
+ changed = true;
+ m_show_cmds = true;
+ } else {
+ if ( m_show_cmds )
+ changed = true;
+ m_show_cmds = false;
+ }
+ if ( KMFConfig::showObjectID() ) {
+ if ( ! m_show_objectID )
+ changed = true;
+ m_show_objectID = true;
+ } else {
+ if ( m_show_objectID )
+ changed = true;
+ m_show_objectID = false;
+ }
+ setUpdatesEnabled( false );
+ setupTableView( table );
+ setUpdatesEnabled( true );
+ sort();
+ triggerUpdate();
+ } else {
+ KMessageBox::error( this, i18n( "Found invalid ListViewItem." ), i18n( "Found invalid ListViewItem." ) );
+ }
+ }
+}
+
+void KMFListView::slotUpdateView() {
+ kdDebug() << "KMFListView::slotUpdateView()." << endl;
+ if ( ! m_NetfilterObject ) {
+ kdDebug() << "m_NetfilterObject = 0" << endl;
+ return ;
+ }
+ if ( ! KMFAppState::upAndRunning() ) {
+ kdDebug() << "Doing Nothing during startup." << endl;
+ this->clearAllItems();
+ return;
+ }
+/* if ( ! KMFAppState::hasOpenDoc() ) {
+ kdDebug() << "No Open doc. disabling view!" << endl;
+ this->clearAllItems();
+ setEnabled( false );
+ return;
+ }*/
+ setEnabled( true );
+ emit sigLoadNode( m_NetfilterObject );
+}
+
+void KMFListView::slotUpdateView( NetfilterObject* obj ) {
+ if ( ! obj )
+ return;
+ if ( ! KMFAppState::upAndRunning() ) {
+ kdDebug() << "Doing Nothing during startup." << endl;
+ this->clearAllItems();
+ return;
+ }
+ if ( obj->type() == NetfilterObject::TABLE ) {
+ if ( ! m_NetfilterObject )
+ return;
+ emit sigLoadNode( m_NetfilterObject );
+ } else if ( obj->type() == NetfilterObject::CHAIN ) {
+ if ( IPTChain* chain = dynamic_cast<IPTChain*>( obj ) ) {
+ if ( KMFListViewItem* item = findKMFItem( chain->name(), 2, chain->uuid() ) ) {
+ if ( KMFListViewItem* parent = dynamic_cast<KMFListViewItem*>( item->parent() ) ) {
+ emit sigLoadNode( m_NetfilterObject );
+// kdDebug() << "Starting update for Chain Item..." << endl;
+ setUpdatesEnabled( false );
+ setupChainView( chain, parent );
+ setUpdatesEnabled( true );
+ triggerUpdate();
+// kdDebug() << "Finished update for Chain Item." << endl;
+ }
+ }
+ }
+ } else if ( obj->type() == NetfilterObject::RULE ) {
+ if ( IPTRule* rule = dynamic_cast<IPTRule*>( obj ) ) {
+ if ( KMFListViewItem* item = findKMFItem( rule->name(), 2, rule->uuid()) ) {
+ if ( KMFListViewItem* parent = dynamic_cast<KMFListViewItem*>( item->parent() ) ) {
+// kdDebug() << "Starting update for Rule Item..." << endl;
+ setUpdatesEnabled( false );
+ setupRuleView( rule, parent );
+ setUpdatesEnabled( true );
+ triggerUpdate();
+// kdDebug() << "Finished update for Rule Item." << endl;
+ }
+ }
+ }
+ }
+}
+
+KMFListViewItem* KMFListView::getRootItem() {
+ KMFListViewItem * item = dynamic_cast<KMFListViewItem*>( firstChild() );
+ if ( item ) {
+ return item;
+ } else {
+ return 0;
+ }
+}
+
+void KMFListView::slotChangeRoot( QListViewItem* /*item*/ ) {
+ // if ( ! item || item == 0)
+ // return;
+ //
+ // if ( KMFListViewItem * tmp_item = dynamic_cast<KMFListViewItem *>( item ) ) {
+ // if ( tmp_item == 0 || ! tmp_item )
+ // return ;
+ // if ( tmp_item->isTopItem() && tmp_item->type() == KMFListViewItem::RULEOPTION )
+ // if ( tmp_item->ruleOption() )
+ // emit sigLoadNode( tmp_item->ruleOption() );
+ // if ( tmp_item->isTopItem() && tmp_item->type() == KMFListViewItem::RULE )
+ // if ( tmp_item->rule() )
+ // emit sigLoadNode( tmp_item->rule() );
+ // if ( tmp_item->isTopItem() && tmp_item->type() == KMFListViewItem::CHAIN )
+ // if ( tmp_item->chain() )
+ // emit sigLoadNode( tmp_item->chain() );
+ // if ( tmp_item->isTopItem() && tmp_item->type() == KMFListViewItem::TABLE )
+ // if ( tmp_item->table() )
+ // emit sigLoadNode( tmp_item->table() );
+ // }
+}
+
+void KMFListView::setupTableView( IPTable* table ) {
+// kdDebug() << "KMFListView::setupTableView(IPTable* table, KMFListViewItem* item )" << endl;
+ if ( ! table )
+ return ;
+ KMFListViewItem* item = 0;
+ item = findKMFItem( table->name(), 2, table->uuid() );
+ if ( ! item ) {
+ item = new KMFListViewItem( this, 0, table );
+ item->setOpen( true );
+ }
+
+ item->sortChildItems( 0, true );
+ item->setTopItem( true );
+ item->setInUse( true );
+ item->setOpen( true );
+ item->setText( 0, i18n( "Table:" ) );
+ item->setPixmap( 0 , icon_table );
+ item->setText( 2, table->name() );
+
+ QPtrList<IPTChain> chains = table->chains();
+ QPtrList<IPTChain> used_chains;
+ for ( int i = chains.count(); i >= 0; i-- ) {
+ IPTChain* chain = 0;
+ chain = chains.at( i );
+ if ( chain ) {
+ used_chains.append ( chain );
+ QString str_obj_id = "";
+ str_obj_id = chain->uuid().toString();
+
+ if ( m_existed_chains.findIndex ( chain->name() + "|" + str_obj_id ) == -1 )
+ m_existed_chains.append ( chain->name() + "|" + str_obj_id );
+
+ if ( ! m_dict_existed_rules.find( chain->uuid() ) ) {
+ m_dict_existed_rules.insert( chain->uuid().toString(), new QStringList );
+ }
+ setupChainView( chain, item );
+ }
+ }
+ if ( ! m_existed_chains.isEmpty() ) {
+ for ( QStringList::Iterator it = m_existed_chains.begin(); it != m_existed_chains.end(); ++it ) {
+ QString existed_chain_name_id = *it;
+ int delimiter = existed_chain_name_id.find( "|" );
+ QString existed_chain_name = existed_chain_name_id.left( delimiter );
+ QString existed_chain_id_str = existed_chain_name_id.right( existed_chain_name_id.length() - delimiter - 1 );
+/* QUuid existed_obj_id = -1;
+ bool ok;
+ existed_obj_id = existed_chain_id_str.toInt( &ok );*/
+ QUuid existed_obj_id( existed_chain_id_str );
+// kdDebug() << "Found Existed Name: " << existed_chain_name << " ID: " << existed_obj_id << endl;
+ bool have = false;
+ QPtrListIterator<IPTChain> it2( used_chains );
+ IPTChain* used_chain = 0;
+ while ( it2.current() ) {
+ used_chain = it2.current();
+// kdDebug() << "Entering: while ( used_chain )" << endl;
+ ++it2;
+ if ( existed_chain_name == used_chain->name() ) {
+// kdDebug() << "Chain: " << used_chain->name() << " already existed:" << endl;
+ have = true;
+ }
+ }
+ if ( ! have ) {
+// kdDebug() << "Chain: " << existed_chain_name << " could not be found" << endl;
+ KMFListViewItem* del_item = findKMFItem( existed_chain_name, 2, existed_obj_id );
+ if ( del_item ) {
+// kdDebug() << "Chain: " << existed_chain_name << " was DELETED:" << endl;
+ delete del_item;
+ }
+ }
+ }
+ }
+
+ m_existed_chains.clear();
+ QPtrListIterator<IPTChain> it3 ( used_chains );
+ while ( it3.current() ) {
+ IPTChain * chain = it3.current();
+ ++it3;
+ QString str_obj_id = chain->uuid().toString();
+ // str_obj_id = str_obj_id.setNum( chain->uuid() );
+
+ m_existed_chains.append( chain->name() + "|" + str_obj_id );
+ }
+
+ KMFListViewItem * item_desc = 0;
+ item_desc = findKMFItem( i18n( "Documentation:" ), 0, table->uuid() );
+
+ if ( !table->description().isEmpty() && m_show_desc ) {
+ if ( ! item_desc ) {
+ item_desc = new KMFListViewItem( item, 0, table );
+ }
+
+ item_desc->setInUse( true );
+ item_desc->setMultiLinesEnabled( true );
+ item_desc->setText( 0, i18n( "Documentation:" ) );
+ item_desc->setPixmap( 1, icon_rename );
+ item_desc->setText( 2, table->description() );
+
+ } else if ( item_desc ) {
+ delete item_desc;
+ }
+
+
+ KMFListViewItem* item_obj_id = 0;
+ item_obj_id = findKMFItem( i18n( "Object ID:" ), 0, table->uuid(),true,item );
+
+ if ( KMFConfig::showObjectID() ) {
+ if ( ! item_obj_id ) {
+ item_obj_id = new KMFListViewItem( item, 0, table );
+ }
+ item_obj_id->setInUse( true );
+ item_obj_id->setText( 0, i18n( "Object ID:" ) );
+ item_obj_id->setText( 2, table->uuid().toString() );
+ } else if ( item_obj_id ) {
+ delete item_obj_id;
+ }
+// kdDebug() << "Sorting Table Item Children..." << endl;
+ item->sort();
+}
+
+void KMFListView::setupChainView( IPTChain* chain, KMFListViewItem* parent ) {
+// kdDebug() << "KMFListView::setupChainView( IPTChain* chain, KMFListViewItem* item )" << endl;
+ if ( ! chain || ! parent )
+ return ;
+
+ KMFListViewItem * item = 0;
+ item = findKMFItem( chain->name(), 2, chain->uuid(), true, parent );
+ if ( ! item ) {
+// kdDebug() << "No Item for Chain: " << chain->name() << " found.\nNeed to create a new one." << endl;
+ item = new KMFListViewItem( parent, 0, chain );
+ }
+ item->sortChildItems( 0, true );
+ item->setTopItem( true );
+ item->setInUse( true );
+ QPixmap icon_null;
+ item->setText( 0, i18n( "Chain:" ) );
+ if ( chain->isBuildIn() ) {
+ item->setPixmap( 0, icon_builtin );
+ } else {
+ item->setPixmap( 0, icon_user );
+ }
+
+ if ( chain->logging() ) {
+ item->setPixmap( 1, icon_log );
+ } else {
+ item->setPixmap( 1, icon_null );
+ }
+ QString chain_name = chain->name();
+ item->setText( 2, chain_name );
+
+
+ KMFListViewItem * i_chain_cmd = 0;
+ i_chain_cmd = findKMFItem( i18n( "Cmd:" ), 0, chain->uuid(), true, item );
+
+ if ( ! chain->isBuildIn() && m_show_cmds ) {
+ if ( ! i_chain_cmd ) {
+ i_chain_cmd = new KMFListViewItem( item , 0, chain );
+ }
+ QString tmp_cmd = chain->createIPTablesChainDefinition();
+ // kdDebug() << "Setting up item: i_chain_cmd" << endl;
+ i_chain_cmd->setInUse( true );
+ i_chain_cmd->setText( 0, i18n( "Cmd:" ) );
+ i_chain_cmd->setPixmap( 0, icon_cmd );
+ i_chain_cmd->setText( 2, tmp_cmd );
+ } else if ( i_chain_cmd ) {
+ delete i_chain_cmd;
+ }
+
+ // logging+++++++++++++++++++++++++++++++++++++++++++++++++++
+ // kdDebug() << "Setting up item: i_chain_log" << endl;
+ bool logging = chain->logging();
+ KMFListViewItem * i_chain_log = 0;
+ i_chain_log = findKMFItem( i18n( "Chain logging:" ), 0, chain->uuid(), true, item );
+
+ if ( ! logging && i_chain_log ) {
+ delete i_chain_log;
+ }
+
+ if ( logging ) {
+ if ( ! i_chain_log ) {
+ i_chain_log = new KMFListViewItem( item, 0, chain );
+ i_chain_log->setOpen( true );
+ }
+ i_chain_log->setInUse( true );
+ i_chain_log->setText( 0, i18n( "Chain logging:" ) );
+ // kdDebug() << "Logging enabled" << endl;
+ // i_chain_log->setPixmap( 1, icon_log );
+ i_chain_log->setText( 2, i18n( "Dropped Packets" ) );
+ QString limit = chain->logLimit();
+ QString prefix = chain->logPrefix();
+ QString burst = chain->logBurst();
+ KMFListViewItem * i_limit = 0;
+ i_limit = findKMFItem( i18n( "Limit rate:" ), 0, chain->uuid(), true, i_chain_log );
+
+
+ if ( ( limit.isEmpty() || limit == XML::Undefined_Value ) && i_limit ) {
+ delete i_limit;
+ } else
+ if ( ! limit.isEmpty() && limit != XML::Undefined_Value ) {
+ if ( ! i_limit ) {
+ i_limit = new KMFListViewItem( i_chain_log, 0, chain );
+ i_limit->setOpen( true );
+ }
+
+ i_limit->setInUse( true );
+ i_limit->setText( 0, i18n( "Limit rate:" ) );
+ i_limit->setText( 2, limit );
+
+ KMFListViewItem * i_burst = 0;
+ i_burst = findKMFItem( i18n( "Limit burst:" ), 0, chain->uuid(), true, i_chain_log );
+
+ if ( ( burst.isEmpty() || burst == XML::Undefined_Value ) && i_burst ) {
+ delete i_burst;
+ }
+
+ if ( ! burst.isEmpty() && burst != XML::Undefined_Value ) {
+ // kdDebug() << "Setting up item: i_burst" << endl;
+ if ( ! i_burst ) {
+ i_burst = new KMFListViewItem( i_chain_log, i_limit, chain );
+ i_burst->setOpen( true );
+ }
+ i_burst->setInUse( true );
+ i_burst->setText( 0, i18n( "Limit burst:" ) );
+ i_burst->setText( 2, burst );
+ }
+ }
+
+ KMFListViewItem* i_prefix = 0;
+ i_prefix = findKMFItem( i18n( "Log prefix:" ), 0, chain->uuid(), true, i_chain_log );
+
+ if ( ( prefix.isEmpty() || prefix == XML::Undefined_Value ) && i_prefix ) {
+ delete i_prefix;
+ }
+
+ if ( ! prefix.isEmpty() && prefix != XML::Undefined_Value ) {
+ // kdDebug() << "Setting up item: i_prefix" << endl;
+ if ( ! i_prefix ) {
+ i_prefix = new KMFListViewItem( i_chain_log, 0, chain );
+ i_prefix->setOpen( true );
+ }
+ i_prefix->setInUse( true );
+ i_prefix->setText( 0, i18n( "Log prefix:" ) );
+ i_prefix->setText( 2, prefix );
+
+ }
+ }
+
+ // // chain feeds++++++++++++++++++++++++++++++++++++++++++++
+ QString str = chain->name();
+ QPtrList<IPTRule> feeds = chain->chainFeeds();
+ bool buildin = chain->isBuildIn();
+ // kdDebug() << "Setting up item: i_chain_feeds" << endl;
+ KMFListViewItem * i_chain_feeds = 0;
+ i_chain_feeds = findKMFItem( i18n( "Chain Feeds:" ), 0, chain->uuid(), true, item );
+ if ( ! i_chain_feeds ) {
+ if ( logging )
+ i_chain_feeds = new KMFListViewItem( item, i_chain_log, chain );
+ else
+ i_chain_feeds = new KMFListViewItem( item, item, chain );
+ i_chain_feeds->setOpen( true );
+ }
+ i_chain_feeds->setText( 0, i18n( "Chain Feeds:" ) );
+ i_chain_feeds->setInUse( true );
+ if ( buildin ) {
+ i_chain_feeds->setText( 2, i18n( "System Feed" ) );
+ } else {
+ int number = feeds.count();
+ QString num_feed = i18n( "1 Feed", "%n Feeds", number );
+ i_chain_feeds->setText( 2, num_feed );
+ i_chain_feeds->setInUse( true );
+ i_chain_feeds->deleteChildren();
+ IPTRule *curr_rule = 0;
+ QPtrList<KMFListViewItem> used_items;
+ if ( ! feeds.isEmpty() ) {
+ i_chain_feeds->setPixmap( 0, icon_feed );
+ QPtrListIterator<IPTRule> it( feeds );
+ while ( it.current() ) {
+ curr_rule = it.current();
+ ++it;
+ KMFListViewItem * item_feeds = new KMFListViewItem( i_chain_feeds, chain );
+ item_feeds->setInUse( true );
+ item_feeds->setText( 0, i18n( "From chain: %1" ).arg( curr_rule->chain() ->name() ) );
+ item_feeds->setPixmap( 2, icon_rule );
+ item_feeds->setText( 2, curr_rule->name() );
+ }
+ }
+ }
+ // //chain fwds++++++++++++++++++++++++++++++++++++++++++++++++
+ QPtrList<IPTRule> fwds = chain->chainFwds();
+
+ // kdDebug() << "Setting up item: i_chain_fwds" << endl;
+ KMFListViewItem * i_chain_fwds = 0;
+ i_chain_fwds = findKMFItem( i18n( "Chain forwards:" ), 0, chain->uuid(), true, item );
+ if ( ! i_chain_fwds ) {
+ i_chain_fwds = new KMFListViewItem( item, i_chain_feeds, chain );
+ i_chain_fwds->setOpen( true );
+ }
+
+ int number2 = fwds.count();
+ QString num_fwd = i18n( "1 Forward", "%n Forwards", number2 );
+ i_chain_fwds->setInUse( true );
+ i_chain_fwds->setText( 0, i18n( "Chain forwards:" ) );
+ i_chain_fwds->setText( 2, num_fwd );
+
+// QPtrList<KMFListViewItem> used_items;
+ i_chain_fwds->deleteChildren();
+ if ( !fwds.isEmpty() ) {
+ i_chain_fwds->setPixmap( 0, icon_fwds );
+ IPTRule * curr_rule;
+ QPtrListIterator<IPTRule> it( fwds );
+ while ( it.current() ) {
+ curr_rule = it.current();
+ ++it;
+ KMFListViewItem * item_fwds = new KMFListViewItem( i_chain_fwds, chain );
+ item_fwds->setInUse( true );
+ item_fwds->setPixmap( 0, icon_rule );
+ item_fwds->setText( 0, i18n( "Rule: %1" ).arg( curr_rule->name() ) );
+ item_fwds->setPixmap( 1, icon_fwd );
+ item_fwds->setText( 2, curr_rule->target() );
+ }
+ }
+
+
+ //########### Start Rules ####################
+ QPtrList<IPTRule> tmp_ruleset = chain->chainRuleset();
+
+ // kdDebug() << "Setting up item: i_chain_allrules" << endl;
+ KMFListViewItem* i_chain_allrules = 0;
+ i_chain_allrules = findKMFItem( i18n( "Rule(s):" ), 0, chain->uuid(), true, item );
+ if ( ! i_chain_allrules ) {
+ i_chain_allrules = new KMFListViewItem( item, i_chain_fwds, chain );
+ i_chain_allrules->setOpen( TRUE );
+ }
+ i_chain_allrules->sortChildItems( 0, true );
+
+ int number3 = tmp_ruleset.count();
+ QString num_rules = i18n( "1 Rule", "%n Rules", number3 );
+ i_chain_allrules->setInUse( true );
+ i_chain_allrules->setText( 0, i18n( "Rule(s):" ) );
+ i_chain_allrules->setPixmap( 0, icon_rule );
+ i_chain_allrules->setText( 2, num_rules );
+
+ QPtrList<IPTRule> used_rules;
+ QStringList *existed_rules = m_dict_existed_rules.find( chain->uuid() );
+
+ if ( existed_rules ) {
+ if ( !tmp_ruleset.isEmpty() ) {
+ IPTRule * curr_rule;
+ for ( curr_rule = tmp_ruleset.last(); curr_rule; curr_rule = tmp_ruleset.prev() ) {
+// kdDebug() << "Entering: for ( curr_rule = tmp_ruleset.last(); curr_rule; curr_rule = tmp_ruleset.prev() )" << endl;
+ used_rules.append( curr_rule );
+ if ( existed_rules->findIndex ( curr_rule->name() + "|" + curr_rule->uuid().toString() ) == -1 ) {
+ existed_rules->append( curr_rule->name() + "|" + curr_rule->uuid().toString() );
+ }
+ setupRuleView( curr_rule , i_chain_allrules );
+ }
+ }
+ if ( ! existed_rules->isEmpty() )
+ for ( QStringList::Iterator it = existed_rules->begin(); it != existed_rules->end(); ++it ) {
+ QString existed_rule_name_id = *it;
+ int delimiter = existed_rule_name_id.find( "|" );
+ QString existed_rule_name = existed_rule_name_id.left( delimiter );
+ QString existed_rule_id_str = existed_rule_name_id.right( existed_rule_name_id.length() - delimiter - 1 );
+ QUuid existed_obj_id( existed_rule_id_str );
+/* bool ok;
+ existed_obj_id = existed_rule_id_str.toInt( &ok );*/
+// kdDebug() << "Found Existed Name: " << existed_rule_name << " ID: " << existed_obj_id << endl;
+ bool have = false;
+ QPtrListIterator<IPTRule> it2( used_rules );
+ IPTRule* used_rule = 0;
+ while ( it2.current() ) {
+ used_rule = it2.current();
+// kdDebug() << "Entering: while ( used_rule )" << endl;
+ ++it2;
+ if ( /*existed_rule_name == used_rule->name() &&*/ existed_obj_id == used_rule->uuid() ) {
+ kdDebug() << "Rule: " << used_rule->name() << " already existed." << endl;
+ have = true;
+ }
+ }
+ if ( ! have ) {
+// kdDebug() << "Rule: " << existed_rule_name << " could not be found" << endl;
+ KMFListViewItem* del_item = findKMFItem( existed_rule_name, 2, existed_obj_id );
+ if ( del_item ) {
+// kdDebug() << "Rule: " << existed_rule_name << " was DELETED:" << endl;
+ delete del_item;
+ } else {
+ del_item = findKMFItem( i18n("Rule"), 0, existed_obj_id, false );
+ if ( del_item ) {
+// kdDebug() << "Rule: " << existed_rule_name << " was DELETED:" << endl;
+ delete del_item;
+ }
+ }
+ }
+ }
+
+ existed_rules->clear();
+
+ QPtrListIterator<IPTRule> it3 ( used_rules );
+ while ( it3.current() ) {
+ IPTRule * rule = it3.current();
+ ++it3;
+ existed_rules->append( rule->name() + "|" + rule->uuid().toString() );
+ }
+ }
+ //########### End Rules ####################
+
+ // default target ++++++++++++++++++++++++++++++++++++
+
+ KMFListViewItem * i_deftg = 0;
+ i_deftg = findKMFItem( i18n( "Target:" ), 0, chain->uuid(), true, item );
+ if ( ! i_deftg ) {
+ i_deftg = new KMFListViewItem( item, i_chain_allrules, chain );
+ }
+
+ if ( ! chain->hasDefaultTarget() ) {
+ delete i_deftg;
+ } else {
+ QString def_tg = chain->defaultTarget();
+ QString cmd = chain->createIPTablesChainDefaultTarget();
+
+ // kdDebug() << "Setting up item: i_deftg" << endl;
+ i_deftg->setInUse( true );
+ i_deftg->setPixmap( 0, icon_target );
+ i_deftg->setText( 0, i18n( "Target:" ) );
+ i_deftg->setText( 2, def_tg );
+ kdDebug() << "Target: " << cmd << endl;
+ if ( def_tg == "DROP" ) {
+ i_deftg->setPixmap( 1, icon_drop );
+ } else if ( def_tg == "ACCEPT" ) {
+ i_deftg->setPixmap( 1, icon_accept );
+ }
+
+ // kdDebug() << "Setting up item: i_deftg_rule" << endl;
+ KMFListViewItem * i_deftg_rule = 0;
+ i_deftg_rule = findKMFItem( i18n( "Policy Cmd:" ), 0, chain->uuid(), true, i_deftg );
+
+ if ( m_show_cmds ) {
+ if ( ! i_deftg_rule ) {
+ i_deftg_rule = new KMFListViewItem( i_deftg, chain );
+ i_deftg_rule->setOpen( false );
+ }
+ i_deftg_rule->setInUse( true );
+ i_deftg_rule->setText( 0, i18n( "Policy Cmd:" ) );
+ i_deftg_rule->setPixmap( 0, icon_cmd );
+ i_deftg_rule->setText( 2, cmd );
+ } else {
+ if ( i_deftg_rule )
+ delete i_deftg_rule;
+ }
+ }
+
+ KMFListViewItem * item_desc = 0;
+ item_desc = findKMFItem( i18n( "Documentation:" ), 0, chain->uuid(), true, item );
+
+ if ( !chain->description().isEmpty() && ! chain->isBuildIn() ) {
+ if ( ! item_desc ) {
+ item_desc = new KMFListViewItem( item, item, chain );
+ }
+ item_desc->setInUse( true );
+ item_desc->setMultiLinesEnabled( true );
+ item_desc->setText( 0, i18n( "Documentation:" ) );
+ item_desc->setPixmap( 1, icon_rename );
+ item_desc->setText( 2, chain->description() );
+
+ } else if( !chain->description().isEmpty() && chain->isBuildIn() && m_show_desc ) {
+ if ( ! item_desc ) {
+ item_desc = new KMFListViewItem( item, item, chain );
+ }
+ item_desc->setInUse( true );
+ item_desc->setMultiLinesEnabled( true );
+ item_desc->setText( 0, i18n( "Documentation:" ) );
+ item_desc->setPixmap( 1, icon_rename );
+ item_desc->setText( 2, chain->description() );
+ } else if ( item_desc ) {
+ delete item_desc;
+ }
+
+ KMFListViewItem* item_obj_id = 0;
+ item_obj_id = findKMFItem( i18n( "Object ID:" ), 0, chain->uuid(),true,item );
+
+ if ( KMFConfig::showObjectID() ) {
+ if ( ! item_obj_id ) {
+ item_obj_id = new KMFListViewItem( item, 0, chain );
+ }
+ item_obj_id->setInUse( true );
+ item_obj_id->setText( 0, i18n( "Object ID:" ) );
+ QString sid = "";
+ item_obj_id->setText( 2, chain->uuid().toString() );
+ } else if ( item_obj_id ) {
+ delete item_obj_id;
+ }
+// kdDebug() << "Sorting Chain Item Children...\n" << endl;
+ item->sort();
+}
+
+void KMFListView::setupRuleView( IPTRule* rule, KMFListViewItem* parent ) {
+// kdDebug() << "KMFListView::setupRuleView( IPTRule* rule, KMFListViewItem* item )" << endl;
+ if ( ! rule || ! parent )
+ return ;
+
+ KMFListViewItem * item = 0;
+ item = findKMFItem( rule->name(), 2, rule->uuid(), true, parent );
+ if ( ! item ) {
+// kdDebug() << "No Item for Rule: " << rule->name() << " found.\nNeed to create a new one." << endl;
+ item = new KMFListViewItem( parent, parent, rule );
+ }
+ item->sortChildItems( 0, true );
+ item->setTopItem( true );
+ item->setInUse( true );
+ QPixmap icon_null;
+ QString rule_name = rule->name();
+ QString rule_target = rule->target();
+ QString rule_cmd = rule->toString();
+
+ QString rule_nr = "";
+ if ( rule->customRule() && rule->enabled() ) {
+ rule_nr = rule_nr + "Custom ";
+ }
+ if ( !rule->enabled() ) {
+ rule_nr = rule_nr + "Disabled ";
+ }
+ rule_nr = rule_nr + "Rule:";
+ QString rule_number = "";
+ rule_number = rule_number.setNum( rule->ruleNum() +1 );
+ rule_nr = rule_nr + " " + rule_number;
+// item->setPixmap( 0, icon_rule );
+ item->setText( 0, rule_nr );
+ if ( ! rule->enabled() )
+ item->setPixmap( 0, icon_disabled );
+ else if ( rule->logging() )
+ item->setPixmap( 0, icon_log );
+ else
+ item->setPixmap( 0, icon_rule );
+
+ item->setText( 1, QString::null );
+ item->setPixmap( 2, icon_null );
+ item->setText( 2, rule_name );
+ item->setRenameEnabled( 2, true );
+
+ // kdDebug() << "There are options defined for the rule " << endl;
+ KMFListViewItem* item_target = 0;
+ item_target = findKMFItem( i18n( "Target:" ), 0, rule->uuid(), true, item );
+ if ( !item_target ) {
+ item_target = new KMFListViewItem( item, 0, rule );
+ }
+ item_target->setInUse( true );
+ item_target->setText( 0, i18n( "Target:" ) );
+ item_target->setPixmap( 0, icon_target );
+ item_target->setText( 2, rule_target );
+ if ( rule_target == "ACCEPT" ) {
+ item_target->setPixmap( 1, icon_accept );
+ } else if ( rule_target == "DROP" ) {
+ item_target->setPixmap( 1, icon_drop );
+ } else if ( rule_target == "LOG" ) {
+ item_target->setPixmap( 1, icon_log );
+ } else if ( rule_target == "REJECT" ) {
+ item_target->setPixmap( 1, icon_reject );
+ } else if ( rule_target == "RETURN" ) {
+ item_target->setPixmap( 1, icon_return );
+ } else if ( rule_target == "QUEUE" ) {
+ item_target->setPixmap( 1, icon_queue );
+ }
+
+ KMFListViewItem* item_cmd = 0;
+ item_cmd = findKMFItem( i18n( "Cmd:" ), 0, rule->uuid(), true, item );
+
+ if ( m_show_cmds ) {
+ if ( ! item_cmd ) {
+ item_cmd = new KMFListViewItem( item, 0, rule );
+ }
+ item_cmd->setInUse( true );
+ item_cmd->setMultiLinesEnabled( true );
+ item_cmd->setText( 0, i18n( "Cmd:" ) );
+ item_cmd->setPixmap( 0, icon_cmd );
+ item_cmd->setText( 2, rule_cmd );
+ } else if ( item_cmd ) {
+ delete item_cmd;
+ }
+
+ //############## Start Rule Options ############
+ QPtrList<QString>* available_options = IPTRuleOption::getAvailableOptionTypes();
+ for ( uint j = 0;j < available_options->count();j++ ) {
+ QString type = "";
+ type = *available_options->at( j );
+ if ( type.isEmpty() )
+ return ;
+
+ IPTRuleOption* opt = 0;
+ opt = rule->getOptionForName( type );
+ if ( ! opt ) {
+ return ;
+ }
+
+// kdDebug() << "Found Option: " << opt->guiName() << " is emty "<< opt->isEmpty() << endl;
+
+ if ( ! opt->isEmpty() ) {
+ if ( !opt->isTargetOption() ) {
+ setupRuleOptionView( opt, item );
+ } else if ( opt->isTargetOption() ) {
+ setupRuleOptionView( opt, item_target );
+ }
+ } else {
+
+ KMFListViewItem * kmfitem = 0;
+ kmfitem = findKMFItem( opt->guiName(), 0, opt->uuid(), true, item );
+ if ( kmfitem ) {
+ delete kmfitem;
+ } else {
+ kmfitem = findKMFItem( opt->guiName(), 0, opt->uuid(), true, item_target );
+ if ( kmfitem ) {
+ delete kmfitem;
+ }
+ }
+
+
+ }
+ }
+ //############## End Rule Options ############
+
+ KMFListViewItem * item_log = 0;
+ item_log = findKMFItem( i18n( "Logging:" ), 0, rule->uuid(),true,item );
+ if ( rule->logging() && ! rule->enabled() ) {
+ if ( ! item_log ) {
+ item_log = new KMFListViewItem( item, 0, rule );
+ }
+ item_log->setInUse( true );
+ item_log->setText( 0, i18n( "Logging:" ) );
+ item_log->setPixmap( 1, icon_log );
+ item_log->setText( 2, i18n( "Logging matching Packets" ) );
+ } else if ( item_log ) {
+ delete item_log;
+ }
+
+
+ KMFListViewItem * item_desc = 0;
+ item_desc = findKMFItem( i18n( "Documentation:" ), 0, rule->uuid(),true,item );
+
+ if ( !rule->description().isEmpty() ) {
+ if ( ! item_desc ) {
+ item_desc = new KMFListViewItem( item, 0, rule );
+ }
+
+ item_desc->setInUse( true );
+ item_desc->setMultiLinesEnabled( true );
+ item_desc->setText( 0, i18n( "Documentation:" ) );
+ item_desc->setPixmap( 1, icon_rename );
+ item_desc->setText( 2, rule->description() );
+
+ } else if ( item_desc ) {
+ delete item_desc;
+ }
+
+ KMFListViewItem* item_obj_id = 0;
+ item_obj_id = findKMFItem( i18n( "Object ID:" ), 0, rule->uuid(),true,item );
+
+ if ( KMFConfig::showObjectID() ) {
+ if ( ! item_obj_id ) {
+ item_obj_id = new KMFListViewItem( item, 0, rule );
+ }
+ item_obj_id->setInUse( true );
+ item_obj_id->setText( 0, i18n( "Object ID:" ) );
+ QString sid = "";
+ item_obj_id->setText( 2, rule->uuid().toString() );
+ } else if ( item_obj_id ) {
+ delete item_obj_id;
+ }
+ item->sort();
+}
+
+void KMFListView::setupRuleOptionView( IPTRuleOption* option, KMFListViewItem* parent ) {
+// kdDebug() << "void KMFListView::setupRuleOptionView( IPTRuleOption* option, KMFListViewItem* parent )" << endl;
+ if ( ! option || ! parent )
+ return ;
+
+ QString type = option->getOptionType();
+ QStringList values = option->getValues();
+ QDict<QStringList>* gui_string_dict = option->getGUIStringDict();
+ QStringList* gui_strings = gui_string_dict->find( type );
+ QString name = "";
+
+ KMFListViewItem * item = 0;
+ item = findKMFItem( option->guiName(), 0, option->uuid(),true,parent );
+
+ if ( values.count() < 1 || option->isEmpty() ) {
+ if ( item ) {
+ delete item;
+ }
+ return;
+ }
+
+ if ( ! item ) {
+// // kdDebug() << "No Item for Option: " << *gui_strings->at( 0 ) << " found.\nCreateing a new one." << endl;
+ item = new KMFListViewItem( parent, parent, option );
+ item->setOpen( true );
+ }
+
+ item->setTopItem( true );
+ item->setInUse( true );
+ item->setPixmap( 0, icon_filter );
+ item->setText( 0, option->guiName() );
+
+ // KMFListViewItem* item_filter = 0;
+ for ( uint i = 0; i < values.count(); i++ ) {
+ QString val = "";
+ val = *values.at( i );
+ if ( val.isNull() )
+ return ;
+
+
+ if ( gui_strings->count() > i /* + 1 */ ) {
+ // if (val == XML::BoolOn_Value)
+ // val = "";
+
+ QString gui_name = "";
+ gui_name = *gui_strings->at( i /* + 1 */ );
+ KMFListViewItem * item_opt = 0;
+ item_opt = findKMFItem( gui_name, 0, option->uuid(),true,item );
+
+ if ( gui_name.isEmpty() || val == XML::Undefined_Value || val.simplifyWhiteSpace().isEmpty() || val == XML::BoolOff_Value ) {
+ if ( item_opt ) {
+ delete item_opt;
+ }
+ } else {
+ if ( ! item_opt ) {
+// kdDebug() << "Creating Item for option Name: " << gui_name << endl;
+ item_opt = new KMFListViewItem( item, 0, option );
+ item_opt->setOpen( true );
+ }
+ if ( val != XML::BoolOn_Value ) {
+ item_opt->setInUse( true );
+ item_opt->setText( 0, gui_name );
+ item_opt->setText( 2, val );
+ } else {
+ item_opt->setInUse( true );
+ item_opt->setText( 0, gui_name );
+ }
+ }
+ }
+ }
+
+ KMFListViewItem *item_obj_id = 0;
+ item_obj_id = findKMFItem( i18n( "Object ID:" ), 0, option->uuid(),true,item );
+ if ( KMFConfig::showObjectID() ) {
+ if ( ! item_obj_id ) {
+ item_obj_id = new KMFListViewItem( item, 0, option );
+ }
+ item_obj_id->setInUse( true );
+ item_obj_id->setText( 0, i18n( "Object ID:" ) );
+ item_obj_id->setText( 2, option->uuid().toString() );
+ } else if ( item_obj_id ) {
+ delete item_obj_id;
+ }
+}
+
+void KMFListView::clearAllItems() {
+// kdDebug() << "void KMFListView::clearAllItems()" << endl;
+/* m_existed_chains.clear();
+ m_dict_existed_rules.clear();*/
+ clear();
+}
+
+KMFListViewItem* KMFListView::findKMFItem( const QString & text, int column, const QUuid& obj_id, bool exact /*= true*/, KMFListViewItem* from_item /*= 0*/ ) {
+ // kdDebug() << "KMFListViewItem* KMFListView::findKMFItem(const QString& text: " << text << ", int column:" << column << ", int obj_id: " << obj_id << ")" << endl;
+ if ( text.isNull() || column < 0 )
+ return 0;
+ if ( from_item ) {
+// from_item->setText(1,"Serching this item");
+ QListViewItemIterator it( from_item );
+ QListViewItem * qitem = 0;
+
+ qitem = from_item->firstChild();
+ while ( qitem ) {
+ KMFListViewItem * item = 0;
+ item = dynamic_cast<KMFListViewItem*> ( qitem );
+ if ( item ) {
+// item->setPixmap(1,icon_accept);
+ if ( obj_id.isNull() ) {
+ if ( item->text( column ) == text ) {
+ return item;
+ }
+ } else {
+ if ( exact ) {
+ if ( item->text( column ) == text && item->uuid() == obj_id )
+ return item;
+ } else {
+ if ( item->text( column ).contains( text ) && item->uuid() == obj_id )
+ return item;
+ }
+ }
+ } else {
+ kdDebug() << "CAST ERROR: Item not of type KMFListViewItem" << endl;
+ return 0;
+ }
+ qitem = qitem->nextSibling();
+ }
+ } else {
+ QListViewItemIterator it( this );
+ while ( it.current() ) {
+ QListViewItem * qitem = it.current();
+ ++it;
+ KMFListViewItem * item = 0;
+ item = dynamic_cast<KMFListViewItem*> ( qitem );
+ if ( item ) {
+ if ( obj_id.isNull() ) {
+ if ( item->text( column ) == text ) {
+ return item;
+ }
+ } else {
+ if ( exact ) {
+ if ( item->text( column ) == text && item->uuid() == obj_id )
+ return item;
+ } else {
+ if ( item->text( column ).contains( text ) && item->uuid() == obj_id )
+ return item;
+ }
+ }
+ } else {
+ kdDebug() << "CAST ERROR: Item not of type KMFListViewItem" << endl;
+ }
+ }
+ }
+// kdDebug() << "Couldn't find Item " << text << " column: " << column << ", int obj_id: " << obj_id << endl;
+ return 0;
+}
+
+KMFListViewItem* KMFListView::findKMFItem( const QString & text1, int column1,const QString & text2, int column2, const QUuid& obj_id ) {
+ // kdDebug() << "KMFListViewItem* KMFListView::findKMFItem(const QString& text: " << text << ", int column:" << column << ", int obj_id: " << obj_id << ")" << endl;
+ if ( text1.isNull() || column1 < 0 || obj_id.isNull() || text2.isNull() || column2 < 0 )
+ return 0;
+
+ QListViewItemIterator it( this );
+ while ( it.current() ) {
+ QListViewItem * qitem = it.current();
+ ++it;
+ KMFListViewItem * item = 0;
+ item = dynamic_cast<KMFListViewItem*> ( qitem );
+ if ( item ) {
+ if ( item->text( column1 ) == text1 && item->text( column2 ) == text2 && item->uuid() == obj_id )
+ return item;
+ } else {
+ kdDebug() << "CAST ERROR: Item not of type KMFListViewItem" << endl;
+ }
+ }
+// kdDebug() << "Couldn't find Item " << text << " column: " << column << ", int obj_id: " << obj_id << endl;
+ return 0;
+}
+
+
+void KMFListView::loadIcons() {
+ kdDebug() << "void KMFListView::loadIcons()" << endl;
+ KIconLoader *loader = KGlobal::iconLoader();
+ QString icon_name;
+
+ icon_name = "up";
+ icon_up = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "down";
+ icon_down = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "ereaser";
+ icon_del = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filenew";
+ icon_new = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "edit";
+ icon_edit = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "rule";
+ icon_rule = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "user_defined";
+ icon_user = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "builtin";
+ icon_builtin = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "table";
+ icon_table = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "text";
+ icon_rename = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "view_tree";
+ icon_chain = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "reject";
+ icon_reject = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "target";
+ icon_target = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "stop";
+ icon_drop = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "button_ok";
+ icon_accept = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filesaveas";
+ icon_log = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "undo";
+ icon_return = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editclear";
+ icon_cmd = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "pipe";
+ icon_queue = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "button_cancel";
+ icon_disabled = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "1rightarrow";
+ icon_fwd = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "2rightarrow";
+ icon_fwds = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "fill";
+ icon_feed = loader->loadIcon( icon_name, KIcon::Small );
+
+}
+
+
+}
+
+#include "kmflistview.moc"
diff --git a/kmyfirewall/kmfwidgets/kmflistview.h b/kmyfirewall/kmfwidgets/kmflistview.h
new file mode 100644
index 0000000..bcc89e8
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmflistview.h
@@ -0,0 +1,91 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+
+#ifndef KMFLISTVIEW_H
+#define KMFLISTVIEW_H
+
+#include <klistview.h>
+
+
+// QT includes
+#include <qptrlist.h>
+#include <qintdict.h>
+#include <qdict.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+#include <qpixmap.h>
+#include <quuid.h>
+#include <qguardedptr.h>
+// Project includes
+
+/**
+@author Christian Hubinger
+*/
+class KListViewItem;
+namespace KMF {
+class NetfilterObject;
+class IPTable;
+class IPTChain;
+class IPTRule;
+class IPTRuleOption;
+class KMFListViewItem;
+
+
+class KDE_EXPORT KMFListView : public KListView {
+ Q_OBJECT
+public:
+ KMFListView( QWidget *parent = 0, const char *name = 0 );
+
+ ~KMFListView();
+
+ KMFListViewItem* getRootItem();
+ void clearAllItems();
+
+public slots:
+ void slotLoadNode( NetfilterObject* );
+ void slotUpdateView();
+ void slotUpdateView( NetfilterObject* );
+ KMFListViewItem* findKMFItem( const QString& text, int column, const QUuid& obj_id, bool exact = true, KMFListViewItem* from = 0 );
+ KMFListViewItem* findKMFItem( const QString& text1, int column1,const QString& text2, int column2, const QUuid& obj_id );
+
+signals:
+ void sigUpdateItem( int );
+
+private:
+ void loadIcons();
+ void setupTableView( IPTable* );
+ void setupChainView( IPTChain*, KMFListViewItem* );
+ void setupRuleView( IPTRule*, KMFListViewItem* );
+ void setupRuleOptionView( IPTRuleOption*, KMFListViewItem* );
+
+private slots:
+ void slotChangeRoot( QListViewItem* );
+
+private: // data
+ QGuardedPtr<NetfilterObject> m_NetfilterObject;
+ IPTable *m_table;
+ QString cast_error;
+
+ QStringList m_existed_chains;
+ QDict< QStringList > m_dict_existed_rules;
+
+ bool m_show_desc, m_show_cmds, m_show_objectID;
+
+ QPixmap icon_up, icon_down, icon_del, icon_edit, icon_rule, icon_filter, icon_rename,
+ icon_chain, icon_log, icon_accept, icon_drop, icon_cmd, icon_reject, icon_return,
+ icon_target, icon_queue, icon_new, icon_disabled, icon_feed, icon_fwd, icon_fwds, icon_user, icon_builtin, icon_table;
+signals:
+ void sigLoadNode( NetfilterObject* );
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmflistviewitem.cpp b/kmyfirewall/kmfwidgets/kmflistviewitem.cpp
new file mode 100644
index 0000000..b58305d
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmflistviewitem.cpp
@@ -0,0 +1,431 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+#include "kmflistviewitem.h"
+
+// QT includes
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kglobal.h>
+
+// Project includes
+#include "../core/xmlnames.h"
+#include "../core/ipaddress.h"
+#include "../core/kmfnetzone.h"
+#include "../core/kmfnethost.h"
+#include "../core/kmftarget.h"
+#include "../core/kmftargetconfig.h"
+#include "../core/kmfprotocol.h"
+#include "../core/kmfprotocolcategory.h"
+#include "../core/iptable.h"
+#include "../core/iptchain.h"
+#include "../core/iptrule.h"
+#include "../core/iptruleoption.h"
+#include "../core/netfilterobject.h"
+namespace KMF {
+KMFListViewItem::KMFListViewItem( KListView *parent, NetfilterObject* obj ) : KListViewItem( parent ) {
+ m_top = false;
+ loadNetfilterObject(obj);
+ m_inUse = false;
+}
+KMFListViewItem::KMFListViewItem( KListView *parent, KListViewItem *after, NetfilterObject* obj ) : KListViewItem( parent, after ) {
+ m_top = false;
+ loadNetfilterObject(obj);
+ m_inUse = false;
+}
+KMFListViewItem::KMFListViewItem( KListViewItem *parent, NetfilterObject* obj ) : KListViewItem( parent ) {
+ m_top = false;
+ loadNetfilterObject(obj);
+ m_inUse = false;
+}
+KMFListViewItem::KMFListViewItem( KListViewItem *parent, KListViewItem *after, NetfilterObject* obj ) : KListViewItem( parent, after ) {
+ m_top = false;
+ loadNetfilterObject(obj);
+ m_inUse = false;
+}
+
+KMFListViewItem::~KMFListViewItem() {
+}
+
+void KMFListViewItem::loadNetfilterObject( NetfilterObject* obj ) {
+ m_object = obj;
+ // m_obj_id = -1;
+ m_table = 0;
+ m_chain = 0;
+ m_rule = 0;
+ m_option = 0;
+ m_zone = 0;
+ m_host = 0;
+ m_target = 0;
+ m_protocol = 0;
+ m_protocolCategory = 0;
+ // m_type = -1;
+ if ( ! obj )
+ return;
+
+ m_obj_id = obj->uuid();
+
+ if ( IPTable *table = dynamic_cast<IPTable*> ( obj ) ) {
+ // m_type = KMFListViewItem::TABLE;
+ m_table = table;
+ } else if ( IPTChain *chain = dynamic_cast<IPTChain*> ( obj ) ) {
+ // m_type = KMFListViewItem::CHAIN;
+ m_chain = chain;
+ } else if ( IPTRule *rule = dynamic_cast<IPTRule*> ( obj ) ) {
+ // m_type = KMFListViewItem::RULE;
+ m_rule = rule;
+ } else if ( IPTRuleOption *opt = dynamic_cast<IPTRuleOption*> ( obj ) ) {
+ // m_type = KMFListViewItem::RULEOPTION;
+ m_option = opt;
+ } else if ( KMFNetZone *zone = dynamic_cast<KMFNetZone*> ( obj ) ) {
+ // m_type = KMFListViewItem::NETZONE;
+ m_zone = zone;
+ } else if ( KMFNetHost *host = dynamic_cast<KMFNetHost*> ( obj ) ) {
+ // m_type = KMFListViewItem::NETHOST;
+ m_host = host;
+ } else if ( KMFTarget *host = dynamic_cast<KMFTarget*> ( obj ) ) {
+ // m_type = KMFListViewItem::KMFTARGET;
+ m_target = host;
+ } else if ( KMFProtocol *prot = dynamic_cast<KMFProtocol*> ( obj ) ) {
+ // m_type = KMFListViewItem::KMFTARGET;
+ // kdDebug() << "KMFListViewItem::loadNetfilterObject(..) - loaded Protocol" << endl;
+ m_protocol = prot;
+ } else if ( KMFProtocolCategory *protCat = dynamic_cast<KMFProtocolCategory*> ( obj ) ) {
+ // m_type = KMFListViewItem::KMFTARGET;
+ // kdDebug() << "KMFListViewItem::loadNetfilterObject(..) - loaded Protocol" << endl;
+ m_protocolCategory = protCat;
+ }
+}
+
+int KMFListViewItem::type() {
+ return m_object->type();
+}
+
+void KMFListViewItem::setTopItem( bool onoff ) {
+ m_top = onoff;
+}
+
+void KMFListViewItem::setInUse( bool onoff ) {
+ if ( ! onoff )
+ setChildrenInUse ( true );
+ m_inUse = onoff;
+}
+
+bool KMFListViewItem::inUse() {
+ bool ret = m_inUse;
+ m_inUse = false;
+ return ret;
+}
+
+
+
+NetfilterObject* KMFListViewItem::netfilterObject() const {
+ return m_object;
+}
+
+void KMFListViewItem::setChildrenInUse( bool onoff ) {
+ KMFListViewItem* item = this;
+ item = dynamic_cast<KMFListViewItem*> ( item->firstChild() );
+ while ( item ){
+ item->setInUse( onoff );
+ item = dynamic_cast<KMFListViewItem*> ( item->nextSibling() );
+ }
+}
+void KMFListViewItem::deleteChildren() {
+ while ( firstChild() ) {
+ kdDebug() << "Deleting Item: " << text(0) << " " << text(2) << endl;
+ delete firstChild();
+ }
+}
+
+
+void KMFListViewItem::setupProtocolView() {
+ kdDebug() << " KMFListViewItem::setupProtocolView()" << endl;
+ if ( ! m_protocol ) {
+ kdDebug() << " KMFListViewItem::setupProtocolView(): m_protocol == 0" << endl;
+ return;
+ }
+
+ while( firstChild() ) {
+ delete firstChild();
+ }
+
+ setPixmap(0, KGlobal:: iconLoader()->loadIcon("kmyfirewall", KIcon::Small ) );
+ setText( 0, protocol()->name() );
+ setText( 1, protocol()->description() );
+ // setOpen( true );
+
+ if ( protocol()->tcpPorts().size() > 0 ) {
+ KMFListViewItem *tcpPorts = new KMFListViewItem( this, 0, protocol() );
+ tcpPorts->loadNetfilterObject( protocol() );
+ tcpPorts->setText( 0, i18n("TCP Ports:") );
+ tcpPorts->setText( 1, protocol()->tcpPortsList() );
+ }
+ if ( protocol()->udpPorts().size() > 0 ) {
+ KMFListViewItem *udpPorts = new KMFListViewItem( this, 0, protocol() );
+ udpPorts->loadNetfilterObject( protocol() );
+ udpPorts->setText( 0, i18n("UDP Ports:") );
+ udpPorts->setText( 1, protocol()->udpPortsList() );
+ }
+
+/* while ( it.current() ) {
+ }*/
+}
+
+
+void KMFListViewItem::setupProtocolCategoryView() {
+ while( firstChild() ) {
+ delete firstChild();
+ }
+
+ setPixmap(0, KGlobal::iconLoader()->loadIcon( "folder" , KIcon::Small ) );
+ setText( 0, protocolCategory()->name() );
+ setText( 1, protocolCategory()->description() );
+
+ QValueList< KMFProtocol* >& prots = protocolCategory()->protocols();
+ QValueList< KMFProtocol* >::iterator it;
+ for( it = prots.begin(); it != prots.end(); ++it ) {
+ KMFListViewItem *prot = new KMFListViewItem( this, 0, (*it) );
+ prot->setupProtocolView();
+ }
+}
+
+void KMFListViewItem::setupTargetView() {
+// if ( target()->isCurrentTarget() ) {
+// setFont( QFont::Bold );
+// } else {
+// setFont( QFont::Bold );
+// }
+ if ( target()->isCurrentTarget() ) {
+ setPixmap(0, KGlobal:: iconLoader()->loadIcon("kmyfirewall", KIcon::Small ) );
+ } else {
+ setPixmap(0, KGlobal:: iconLoader()->loadIcon("enhanced_browsing", KIcon::Small ) );
+ }
+ setText( 0, target()->guiName() );
+ setText( 1,"[" + target()->address()->toString() + "]" );
+ setText( 2, target()->config()->oS() );
+ setText( 3, target()->config()->backend() );
+ setText( 4, target()->description() );
+}
+
+void KMFListViewItem::setupNetHostView() {
+ setPixmap(0, KGlobal:: iconLoader()->loadIcon("home_white", KIcon::Small ) );
+ setText( 0, host()->guiName() );
+ setText( 1,"[" + host()->address()->toString() + "]" );
+
+ if ( host()->name().startsWith("incoming_world") ) {
+ setText( 2,"" + i18n("%1 -> Localhost").arg( host()->guiName() ) );
+ }
+ if ( host()->name().startsWith("outgoing_world") ) {
+ setText( 2, i18n("Localhost -> %1").arg( host()->guiName() ) );
+ }
+}
+
+
+
+void KMFListViewItem::setupZoneView() {
+ kdDebug() << "void KMFListViewItem::setupZoneView()" << endl;
+ if ( type() != NetfilterObject::NETZONE ) {
+ return;
+ }
+ KIconLoader *loader = KGlobal:: iconLoader();
+
+ setText( 0,m_zone->guiName() );
+ if ( m_zone->name() == "incoming_world" || m_zone->name() == "outgoing_world" ) {
+ setPixmap(0, loader->loadIcon("network", KIcon::Small ) );
+ } else {
+ setPixmap(0, loader->loadIcon("network_local", KIcon::Small ) );
+ }
+
+ // if ( m_zone->name().startsWith("incoming_world") || m_zone->name().startsWith("outgoing_world") )
+ setText( 1, "[" + m_zone->address()->toString() + i18n("/%1]").arg( m_zone->maskLength() ) );
+
+/* setText( 2,"" + i18n("%1 -> Localhost").arg( m_zone->guiName() ) );*/
+ setText( 4,"" + m_zone->description() );
+
+ if ( m_zone->name().startsWith("incoming_world") ) {
+ setText( 2,"" + i18n("%1 -> Localhost").arg( m_zone->guiName() ) );
+
+ }
+ if ( m_zone->name().startsWith("outgoing_world") ) {
+ setText( 2, i18n("Localhost -> %1").arg( m_zone->guiName() ) );
+
+ }
+
+ QPtrListIterator<KMFNetZone> it ( m_zone->zones() );
+ while ( it.current() ) {
+ KMFListViewItem *item = new KMFListViewItem( this, 0, it.current() );
+ item->loadNetfilterObject( it.current() );
+ item->setupZoneView();
+ // item->setRenameEnabled( 0, true );
+ setOpen(true);
+ ++it;
+ }
+
+ QPtrListIterator<KMFTarget> it2 ( m_zone->hosts() );
+ while ( it2.current() ) {
+ if ( it2.current()->type() == NetfilterObject::NETHOST ) {
+ KMFNetHost *host = dynamic_cast<KMFNetHost*>( it2.current() );
+ KMFListViewItem *item = new KMFListViewItem( this, 0, host );
+ item->loadNetfilterObject( host );
+ item->setupNetHostView();
+ setOpen(true);
+ } else if ( it2.current()->type() == NetfilterObject::KMFTARGET ) {
+ KMFTarget* target = dynamic_cast<KMFTarget*>( it2.current() );
+ kdDebug() << "Added KMFTarget" << endl;
+ KMFListViewItem *item = new KMFListViewItem( this, 0, target );
+ item->loadNetfilterObject( target );
+ item->setupTargetView();
+ // item->setRenameEnabled( 0, true );
+ setOpen(true);
+ }
+
+
+
+ /*
+ if ( KMFTarget* target = dynamic_cast<KMFTarget*>( it2.current() ) ){
+ kdDebug() << "Added KMFTarget" << endl;
+ KMFListViewItem *item = new KMFListViewItem( this, 0, target );
+ item->loadNetfilterObject( target );
+ item->setupTargetView();
+ // item->setRenameEnabled( 0, true );
+ setOpen(true);
+ } else if ( KMFNetHost *host = dynamic_cast<KMFNetHost*>( it2.current() ) ) {
+ kdDebug() << "Added KMFNetHost" << endl;
+ KMFListViewItem *item = new KMFListViewItem( this, 0, host );
+ item->loadNetfilterObject( host );
+ // item->setRenameEnabled( 0, true );
+ item->setupNetHostView();*/
+
+/* item->setPixmap(0, loader->loadIcon("home_white", KIcon::Small ) );
+ item->setText( 0, host->guiName() );
+ item->setText( 1,"[" + host->address()->toString() + "]" );
+
+ if ( host->name().startsWith("incoming_world") ) {
+ item->setText( 2,"" + i18n("%1 -> Localhost").arg( host->guiName() ) );
+ }
+ if ( host->name().startsWith("outgoing_world") ) {
+ item->setText( 2, i18n("Localhost -> %1").arg( host->guiName() ) );
+ }*/
+// setOpen(true);
+// // ++it2;
+// }
+
+
+
+
+
+// KMFListViewItem *item = new KMFListViewItem( this, 0, it2.current() );
+// item->loadNetfilterObject( it2.current() );
+// item->setPixmap(0, loader->loadIcon("home_white", KIcon::Small ) );
+// item->setText( 0, it2.current()->guiName() );
+// item->setText( 1,"[" + it2.current()->address()->toString() + "]" );
+//
+// if ( it2.current()->name().startsWith("incoming_world") ) {
+// item->setText( 2,"" + i18n("%1 -> Localhost").arg( it2.current()->guiName() ) );
+// }
+// if ( it2.current()->name().startsWith("outgoing_world") ) {
+// item->setText( 2, i18n("Localhost -> %1").arg( it2.current()->guiName() ) );
+// }
+// setOpen(true);
+ ++it2;
+
+ }
+}
+
+QString KMFListViewItem::key( int column, bool ascending ) const {
+// kdDebug() << "QString KMFListViewItem::key( int column, bool ascending )" << endl;
+ if ( ! m_object ) {
+ return QListViewItem::key( column, ascending );
+ }
+
+ if ( m_object->type() == NetfilterObject::TABLE ) {
+ if ( text(0) == i18n("Documentation:") ) {
+ return "0000";
+ }
+ } else if ( m_object->type() == NetfilterObject::CHAIN ) {
+ if ( text(0) == i18n("Documentation:") || text(2) == Constants::InputChain_Name ) {
+ return "0000";
+ } else if ( text(0) == i18n("Chain logging:") || text(2) == Constants::OutputChain_Name ) {
+ return "1111";
+ } else if ( text(0) == i18n("Chain Feeds:") || text(2) == Constants::ForwardChain_Name ) {
+ return "2222";
+ } else if ( text(0) == i18n("Chain forwards:") || text(2) == Constants::PreRoutingChain_Name ) {
+ return "3333";
+ } else if ( text(0) == i18n("Rule(s):") || text(2) == Constants::PostRoutingChain_Name ) {
+ return "4444";
+ } else if ( text(0) == i18n("Cmd:") ) {
+ return "9999";
+ } else if (text(0).contains( i18n("Chain (User-Defined):") ) ) {
+ int index = m_chain->table()->chains().find( m_chain );
+ QString ret = "";
+ return ret.setNum( 5555 + index );
+ }
+ } else if ( m_object->type() == NetfilterObject::RULE ) {
+ if ( text(0) == i18n("Documentation:") ) {
+ return "0000";
+ } else if ( text(0) == i18n("Cmd:") ) {
+ return "8888";
+ } else if ( text(0) == i18n("Target:") ) {
+ return "9999";
+ } else {
+ QString ret = "";
+ ret = ret.setNum( m_rule->ruleNum() );
+ while ( ret.length() < 5 ) {
+ ret.prepend("0");
+ }
+ return ret;
+ }
+ } else if ( m_object->type() == NetfilterObject::RULEOPTION ) {
+ QPtrList<QString>* types = IPTRuleOption::getAvailableOptionTypes();
+ QPtrListIterator< QString > it ( *types );
+ int i = 0;
+ int index = -1;
+ bool finished = false;
+ while ( it.current() && ! finished ) {
+ QString type = *it.current();
+ ++it;
+// kdDebug() << "Checking type: " << type << endl;
+ if ( type == m_option->getOptionType() ) {
+ index = i;
+ finished = true;
+ }
+ i++;
+ }
+ QString ret = "";
+// kdDebug() << "QString KMFListViewItem::key(...) returnd: " << ret << " for ruleoption type: " << m_option->getOptionType() << endl;
+ return ret.setNum( 5555 + index );
+ } else if ( m_object->type() == NetfilterObject::NETZONE ) {
+ if ( m_zone ) {
+ //return "0000";
+ return "0000" + m_zone->guiName();
+ }
+ } else if ( m_object->type() == NetfilterObject::NETHOST ) {
+ if ( m_host ) {
+ // return "1111";
+ return "1111" + m_host->guiName();
+ }
+ } else if ( m_object->type() == NetfilterObject::KMFTARGET ) {
+ if ( m_host ) {
+ // return "1111";
+ return "1111" + m_target->guiName();
+ }
+ }
+
+
+ return QListViewItem::key( column, ascending );
+}
+
+}
diff --git a/kmyfirewall/kmfwidgets/kmflistviewitem.h b/kmyfirewall/kmfwidgets/kmflistviewitem.h
new file mode 100644
index 0000000..6181794
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmflistviewitem.h
@@ -0,0 +1,144 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+#ifndef KMFLISTVIEWITEM_H
+#define KMFLISTVIEWITEM_H
+
+#include "kmflistview.h"
+
+// QT includes
+#include <qstring.h>
+#include <quuid.h>
+#include <qguardedptr.h>
+
+// KDE includes
+
+// Project includes
+
+/**
+@author Christian Hubinger
+*/
+
+namespace KMF {
+class IPTable;
+class IPTChain;
+class IPTRule;
+class IPTRuleOption;
+class NetfilterObject;
+class KMFNetZone;
+class KMFNetHost;
+class KMFTarget;
+class KMFProtocol;
+class KMFProtocolCategory;
+
+class KDE_EXPORT KMFListViewItem : public KListViewItem {
+public:
+ KMFListViewItem( KListView *parent, NetfilterObject* );
+ KMFListViewItem( KListViewItem *parent, NetfilterObject* );
+ KMFListViewItem( KListView *parent, KListViewItem *after, NetfilterObject* );
+ KMFListViewItem( KListViewItem *parent, KListViewItem *after, NetfilterObject* );
+
+ virtual ~KMFListViewItem();
+
+ NetfilterObject* netfilterObject() const;
+
+ IPTable* table() const {
+ return m_table;
+ };
+ IPTChain* chain() const {
+ return m_chain;
+ };
+ IPTRule* rule() const {
+ return m_rule;
+ };
+ IPTRuleOption* ruleOption() const {
+ return m_option;
+ };
+
+ KMFNetZone* zone() const {
+ return m_zone;
+ };
+
+ KMFNetHost* host() const {
+ return m_host;
+ };
+
+ KMFTarget* target() const {
+ return m_target;
+ };
+
+ KMFProtocol* protocol() const {
+ return m_protocol;
+ };
+
+ KMFProtocolCategory* protocolCategory() const {
+ return m_protocolCategory;
+ };
+
+
+ bool isTopItem() const {
+ return m_top;
+ };
+
+ int type();
+
+ const QUuid& uuid() const {
+ return m_obj_id;
+ }
+
+ void setupZoneView();
+ void setupTargetView();
+ void setupNetHostView();
+ void setupProtocolView();
+ void setupProtocolCategoryView();
+
+ void deleteChildren();
+ void setChildrenInUse( bool );
+ void setTopItem( bool );
+ void setInUse( bool );
+ bool inUse();
+ // enum { TABLE = 0, CHAIN = 1, RULE = 2, RULEOPTION = 3 , NETZONE = 4, NETHOST = 5, KMFTARGET = 6 };
+
+ void loadNetfilterObject( NetfilterObject* );
+ virtual QString key( int column, bool ascending ) const;
+
+private:
+/* IPTable *m_table;
+ IPTChain *m_chain;
+ IPTRule *m_rule;
+ IPTRuleOption *m_option;
+ KMFNetZone* m_zone;
+ KMFNetHost* m_host;
+ KMFTarget* m_target;
+ KMFProtocol* m_protocol;
+ KMFProtocolCategory* m_protocolCategory;
+ NetfilterObject* m_object;*/
+
+ QGuardedPtr<IPTable> m_table;
+ QGuardedPtr<IPTChain> m_chain;
+ QGuardedPtr<IPTRule> m_rule;
+ QGuardedPtr<IPTRuleOption> m_option;
+ QGuardedPtr<KMFNetZone> m_zone;
+ QGuardedPtr<KMFNetHost> m_host;
+ QGuardedPtr<KMFTarget> m_target;
+ QGuardedPtr<KMFProtocol> m_protocol;
+ QGuardedPtr<KMFProtocolCategory> m_protocolCategory;
+ QGuardedPtr<NetfilterObject> m_object;
+
+
+ // int m_type;
+ QUuid m_obj_id;
+ bool m_top;
+ bool m_inUse;
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfmainwindow.cpp b/kmyfirewall/kmfwidgets/kmfmainwindow.cpp
new file mode 100644
index 0000000..c8bc0ed
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfmainwindow.cpp
@@ -0,0 +1,30 @@
+//
+// C++ Implementation: kmfmainwindow
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "kmfmainwindow.h"
+namespace KMF {
+KMFMainWindow::KMFMainWindow( QWidget* parent, const char *name ) : KMyFirewallInterface(), KParts::MainWindow( parent, name ) {}
+
+KMFMainWindow::~KMFMainWindow() {}
+
+}
+
+#include "kmfmainwindow.moc"
diff --git a/kmyfirewall/kmfwidgets/kmfmainwindow.h b/kmyfirewall/kmfwidgets/kmfmainwindow.h
new file mode 100644
index 0000000..9c0f3f5
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfmainwindow.h
@@ -0,0 +1,46 @@
+//
+// C++ Interface: kmfmainwindow
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef KMFMAINWINDOW_H
+#define KMFMAINWINDOW_H
+
+#include <kparts/mainwindow.h>
+#include "../core/kmyfirewallinterface.h"
+#include "../core/netfilterobject.h"
+
+/**
+@author Christian Hubinger
+*/
+
+namespace KMF {
+class KDE_EXPORT KMFMainWindow : public KParts::MainWindow, virtual public KMyFirewallInterface {
+ Q_OBJECT
+public:
+
+ KMFMainWindow( QWidget* parent, const char *name );
+ virtual ~KMFMainWindow();
+signals:
+ void sigUpdateView();
+ void sigUpdateView( NetfilterObject*);
+ void sigEnableActions( bool );
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfmultiportwidget.cpp b/kmyfirewall/kmfwidgets/kmfmultiportwidget.cpp
new file mode 100644
index 0000000..fa89a85
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfmultiportwidget.cpp
@@ -0,0 +1,134 @@
+/***************************************************************************
+ begin : Fri Nov 1 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfmultiportwidget.h"
+
+
+#include <qstring.h>
+#include <qspinbox.h>
+#include <qlistbox.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+
+#include <kpushbutton.h>
+
+#include "../core/kmferror.h"
+namespace KMF {
+KMFMultiPortWidget::KMFMultiPortWidget( QWidget *parent, const char *name ) : KMyFirewallMultiPortWidget( parent, name ) {
+ m_err = new KMFError();
+ m_err->setErrType( KMFError::OK );
+ lb_ports->clear();
+ connect( b_add, SIGNAL( clicked() ), this, SLOT( addPort() ) );
+ connect( b_remove, SIGNAL( clicked() ), this, SLOT( removePort() ) );
+ connect( c_use_multiport, SIGNAL( toggled( bool ) ), this, SIGNAL( sigMultiPortChanged( bool ) ) );
+}
+KMFMultiPortWidget::~KMFMultiPortWidget() {}
+
+void KMFMultiPortWidget::addPort() {
+ QString port = "";
+ port.setNum( sb_port->value() );
+ if ( port.isEmpty() )
+ return ;
+ if ( lb_ports->count() > 14 )
+ return ;
+
+ for ( uint i = 0; i < lb_ports->count(); i++ )
+ if ( lb_ports->text( i ) == port )
+ return ;
+
+ lb_ports->insertItem( port );
+}
+
+void KMFMultiPortWidget::addPort( QString& port ) {
+ lb_ports->insertItem( port );
+}
+
+void KMFMultiPortWidget::removePort() {
+ int index = -1;
+ index = lb_ports->currentItem();
+ if ( index > -1 )
+ lb_ports->removeItem( index );
+}
+
+void KMFMultiPortWidget::removePort( int index ) {
+ lb_ports->removeItem( index );
+}
+
+KMFError* KMFMultiPortWidget::getPortString( QString* value ) {
+ for ( uint i = 0; i < lb_ports->count(); i++ ) {
+ if ( !(*value).isEmpty() )
+ value->append( "," );
+ value->append( lb_ports->text( i ) );
+ }
+ if ( value->isEmpty() )
+ return m_err;
+
+ value->stripWhiteSpace();
+ return m_err;
+}
+
+void KMFMultiPortWidget::setType( const QString& type ) {
+ setEnabled( true );
+ c_use_multiport->setChecked( true );
+ if ( type == "src" )
+ rb_src->setChecked( true );
+ if ( type == "dest" )
+ rb_dest->setChecked( true );
+ if ( type == "equ" )
+ rb_equ->setChecked( true );
+
+}
+
+void KMFMultiPortWidget::loadPortString( QString& str ) {
+ if ( str.isEmpty() )
+ return ;
+ lb_ports->clear();
+ int pos = -1;
+ pos = str.find( "," );
+ while ( pos > -1 ) {
+ QString port = str.left( pos );
+ lb_ports->insertItem( port );
+ str = str.right( str.length() - pos - 1 );
+ pos = str.find( "," );
+ }
+ if ( !str.isEmpty() ) {
+ lb_ports->insertItem( str );
+ }
+}
+
+void KMFMultiPortWidget::reset() {
+ c_use_multiport->setChecked( false );
+ rb_src->setChecked( false );
+ rb_dest->setChecked( false );
+ rb_equ->setChecked( false );
+ lb_ports->clear();
+}
+
+
+QString& KMFMultiPortWidget::type() const {
+ QString ret = "src";
+ if ( rb_src->isChecked() )
+ ret = "src";
+ else if ( rb_dest->isChecked() )
+ ret = "dest";
+ else if ( rb_equ->isChecked() )
+ ret = "equ";
+ QString *val = new QString( ret );
+ return *val;
+}
+
+}
+
+#include "kmfmultiportwidget.moc"
diff --git a/kmyfirewall/kmfwidgets/kmfmultiportwidget.h b/kmyfirewall/kmfwidgets/kmfmultiportwidget.h
new file mode 100644
index 0000000..8b1d042
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfmultiportwidget.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ begin : Fri Nov 1 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFMULTIPORTWIDGET_H
+#define KMFMULTIPORTWIDGET_H
+
+#include <qwidget.h>
+#include <kdemacros.h>
+#include "kmyfirewallmultiportwidget.h"
+
+
+class QString;
+
+namespace KMF {
+class KMFError;
+
+/**
+ *@author Christian Hubinger
+ */
+
+class KDE_EXPORT KMFMultiPortWidget : public KMyFirewallMultiPortWidget {
+ Q_OBJECT
+public:
+ KMFMultiPortWidget( QWidget *parent = 0, const char *name = 0 );
+ ~KMFMultiPortWidget();
+
+ KMFError* getPortString( QString* value );
+ void setType( const QString& type );
+ QString& type() const;
+ void loadPortString( QString& );
+ void reset();
+
+private slots:
+ void addPort();
+ void addPort( QString& port );
+ void removePort();
+ void removePort( int index );
+
+private:
+ KMFError *m_err;
+
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfmynetworkwidget.cpp b/kmyfirewall/kmfwidgets/kmfmynetworkwidget.cpp
new file mode 100644
index 0000000..d9d7a2c
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfmynetworkwidget.cpp
@@ -0,0 +1,585 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmfmynetworkwidget.h"
+
+// QT includes
+#include <qstring.h>
+#include <qframe.h>
+#include <qpixmap.h>
+#include <qwidgetstack.h>
+#include <qtextedit.h>
+#include <qlabel.h>
+#include <qlayout.h>
+
+// KDe Includes
+#include <ktabwidget.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <kpopupmenu.h>
+#include <kinputdialog.h>
+
+// Project includes
+#include "kmfhostwidget.h"
+#include "kmfinterfacewidget.h"
+#include "kmfsystemsettingslinux.h"
+#include "kmfnetworkwidget.h"
+
+#include "../core/kmfnetzone.h"
+#include "../core/kmfdoc.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmftarget.h"
+#include "../core/kmftargetconfig.h"
+#include "../core/kmferror.h"
+#include "../kmfwidgets/kmflistviewitem.h"
+
+namespace KMF {
+KMFMyNetworkWidget::KMFMyNetworkWidget(QWidget* parent, const char* name, WFlags fl)
+: KMyFirewallMyNetworkWidget(parent,name,fl)
+{
+ kdDebug() << "Contructor: KMFMyNetworkWidget::KMFMyNetworkWidget(QWidget* parent, const char* name, WFlags fl)" << endl;
+ m_network = 0;
+ m_contextMenu = new KPopupMenu( this, "m_contextMenu" );
+
+ connect( m_lv_zones, SIGNAL( contextMenuRequested ( QListViewItem*, const QPoint&, int ) ),
+ this, SLOT( slotZoneRBM( QListViewItem*, const QPoint&, int ) ) );
+
+ connect( m_lv_zones, SIGNAL( pressed( QListViewItem* ) ) ,
+ this, SLOT( slotNewItemSelected( QListViewItem* ) ) );
+
+ connect( m_lv_zones, SIGNAL( itemRenamed ( QListViewItem *, int, const QString & ) ) ,
+ this, SLOT( slotRenameItem( QListViewItem *, int, const QString & ) ) );
+
+
+
+ loadIcons();
+ setupPropertiesView();
+}
+
+void KMFMyNetworkWidget::saveConfig() {
+ kdDebug() << "KMFMyNetworkWidget::saveConfig()" << endl;
+ m_network->exportXMLRuleset( false, false );
+ // m_network->saveConfig();
+}
+
+void KMFMyNetworkWidget::setNetwork( KMFNetwork* net ) {
+// if ( ! m_network ) {
+// m_network = net;
+//
+// } else {
+ m_network = net;
+ m_lv_zones->clear();
+ KMFListViewItem *it = new KMFListViewItem( m_lv_zones, 0, m_network->netzone() );
+ it->setupZoneView();
+// }
+// m_lv_zones->clear();
+// KMFListViewItem *it = new KMFListViewItem( m_lv_zones, 0, m_network->netzone() );
+// it->setupZoneView();
+}
+
+void KMFMyNetworkWidget::setupPropertiesView() {
+ kdDebug() << "void KMFMyNetworkWidget::setupPropertiesView()" << endl;
+ m_hostProperties = new KMFHostWidget( this, "host widget" );
+ kt_hostProperties->addTab( m_hostProperties, i18n( "General" ) );
+ connect( m_hostProperties, SIGNAL( sigTargetChanged() ),
+ this, SLOT( slotTargetChanged() ) );
+
+ m_hostProperties->InitGUI();
+
+ m_hostInterfaces = new KMFInterfaceWidget( this, "interface widget" );
+ kt_hostProperties->addTab( m_hostInterfaces, i18n( "Interfaces" ) );
+
+ m_hostSettingsLinux = new KMFSystemSettingsLinux( this, "system settings widget" );
+ kt_hostProperties->addTab( m_hostSettingsLinux, i18n( "System Settings" ) );
+
+
+// QWidget *zonePropsWidget = new QWidget( this, "ads" );
+
+
+// QLabel *desc = new QLabel( i18n("<qt>Define your network zone here by defining the Networks IP and netmask.</qt>") , zonePropsWidget, "ad" );
+//
+// QLabel *desc2 = new QLabel( i18n("Zone Documentation:") , zonePropsWidget, "ad" );
+//
+// m_zone_desc = new QTextEdit( zonePropsWidget, "adf" );
+// m_zone_desc->setReadOnly( false );
+// QGridLayout *grid = new QGridLayout( zonePropsWidget, 3,2);
+
+ m_network_widget = new KMFNetworkWidget( this, "m_network_widget" );
+
+ connect( m_network_widget,SIGNAL( sigZoneChanged( KMFNetZone* ) ),
+ this,SLOT( slotZoneChanged( KMFNetZone* ) ) );
+
+// grid->addWidget( m_network_widget, 0,0 );
+// grid->addWidget( m_network_widget, 1,0 );
+// grid->addWidget( desc2,0,1 );
+// grid->addMultiCellWidget( m_zone_desc, 1,2,1,1);
+
+ kt_zoneProperties->addTab( m_network_widget, i18n( "General" ) );
+
+
+}
+
+KMFMyNetworkWidget::~KMFMyNetworkWidget() {
+}
+
+
+void KMFMyNetworkWidget::slotNewItemSelected( QListViewItem* item ) {
+ kdDebug() << "void KMFMyNetworkWidget::slotNewItemSelected( QListViewItem* item )" << endl;
+ if ( ! item )
+ return ;
+ m_zone = 0;
+ m_target = 0;
+
+ m_lv_zones->blockSignals( true );
+ m_lv_zones->clearSelection();
+ m_lv_zones->setSelected( item, true );
+ m_lv_zones->blockSignals( false );
+
+ KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item );
+
+ if ( ! kmfitem ) {
+ kdDebug() << "No Item Selected!" << endl;
+ return;
+ }
+
+ m_hostProperties->setEnabled( false );
+ if ( kmfitem != 0 && kmfitem->netfilterObject()->type() == NetfilterObject::NETZONE ) {
+ kdDebug() << "Selected NETZONE" << endl;
+ m_wsEdit->raiseWidget( ws_pageZoneProperties );
+ // kt_hostProperties->showPage( m_hostProperties );
+ m_zone = kmfitem->zone();
+ if ( m_zone ) {
+// kdDebug() << "kmfitem->zone() pointer is valid" << endl;
+ kmfitem->setText( 0,m_zone->guiName() );
+ kmfitem->setText( 1, "[" + m_zone->address()->toString() + i18n("/%1]").arg( m_zone->maskLength() ) );
+
+ m_network_widget->loadZone( m_zone );
+ if ( m_zone->readOnly() ) {
+ m_network_widget->allowEdit( false );
+ } else {
+ m_network_widget->allowEdit( true );
+ }
+
+ }
+ } else if ( kmfitem != 0 && kmfitem->netfilterObject()->type() == NetfilterObject::KMFTARGET ) {
+ kdDebug() << "Selected KMFTARGET" << endl;
+ m_wsEdit->raiseWidget( ws_pageHostProperties );
+ // kt_hostProperties->showPage( m_hostProperties );
+ m_target = kmfitem->target();
+ if ( m_target ) {
+// kdDebug() << "kmfitem->target() pointer is valid" << endl;
+ m_zone = m_target->zone();
+ m_hostProperties->loadHost( m_target );
+ m_hostProperties->setEnabled( true );
+
+ m_hostInterfaces->loadTarget( m_target );
+
+ if ( m_target->config()->oS() == "linux" ) {
+ kt_hostProperties->setTabEnabled( m_hostSettingsLinux, true );
+ m_hostSettingsLinux->loadTarget( m_target );
+ } else {
+ kt_hostProperties->setTabEnabled( m_hostSettingsLinux, false );
+ }
+
+ kmfitem->setupTargetView();
+ }
+ } else if ( kmfitem != 0 && kmfitem->netfilterObject()->type() == NetfilterObject::NETHOST ) {
+ kdDebug() << "Selected NETHOST" << endl;
+ }
+ kdDebug() << "Laving slotNewItemSelected()" << endl;
+}
+
+void KMFMyNetworkWidget::slotZoneChanged( KMFNetZone* z ) {
+ kdDebug() << "void KMFMyNetworkWidget::slotZoneChanged( KMFNetZone* z )" << endl;
+ if ( KMFListViewItem *item = findItem( z->uuid() ) ) {
+ kdDebug() << "Updating item" << endl;
+ item->setText( 1, "[" + z->address()->toString() + i18n("/%1]").arg( z->maskLength() ) );
+ item->setText( 4, z->description() );
+ }
+
+
+ m_lv_zones->clear();
+ KMFListViewItem *it = new KMFListViewItem( m_lv_zones, 0, m_network->netzone() );
+ it->setupZoneView();
+
+ if ( KMFListViewItem *item = findItem( m_zone->uuid() ) ) {
+ slotNewItemSelected( item );
+ }
+}
+
+
+
+void KMFMyNetworkWidget::slotZoneRBM( QListViewItem* item, const QPoint& point, int ) {
+ if ( ! item )
+ return ;
+ KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item );
+ if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::NETZONE ) {
+ kdDebug() << "Setting up Zone RBM:" << endl;
+ m_target = 0;
+ m_zone = 0;
+ m_zone = kmfitem->zone();
+ if ( m_zone ) {
+ m_contextMenu->clear();
+ QString name = m_zone->name();
+ QString lab_str = i18n("Zone: %1").arg( m_zone->guiName() );
+ m_contextMenu->insertTitle( icon_chain, lab_str );
+ m_contextMenu->insertItem( icon_new, i18n( "Add Host..." ), this, SLOT( slotAddHost() ) );
+
+
+ m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( icon_new, i18n( "Add Zone..." ), this, SLOT( slotAddZone() ) );
+ if ( m_zone->name() != "incoming_world" && m_zone->name() != "outgoing_world" && ! m_zone->readOnly() ) {
+ m_contextMenu->insertItem( icon_rename, i18n( "Rename Zone..." ), this, SLOT( slotRenameZone() ) );
+ m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( icon_del, i18n( "Delete Zone" ), this, SLOT( slotDelZone() ) );
+ }
+
+ m_contextMenu->popup( point );
+ }
+ } else if ( kmfitem != 0 && kmfitem->type() == NetfilterObject::KMFTARGET ) {
+ kdDebug() << "Setting up Host RBM:" << endl;
+ m_target = 0;
+ m_target = kmfitem->target();
+ if ( m_target ) {
+ m_contextMenu->clear();
+ QString name = m_target->name();
+ QString lab_str = i18n("Host: %1").arg( m_target->guiName() );
+ m_contextMenu->insertTitle( icon_chain, lab_str );
+ if ( ! m_target->readOnly() ) {
+ m_contextMenu->insertItem( icon_rename, i18n( "Rename Host..." ), this, SLOT( slotRenameHost() ) );
+ m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( icon_del, i18n( "Delete Host..." ), this, SLOT( slotDelHost() ) );
+ }
+ if ( ! m_target->isCurrentTarget() ) {
+ m_contextMenu->insertSeparator();
+ m_contextMenu->insertItem( KGlobal::iconLoader()->loadIcon( "kmyfirewall", KIcon::Small ), i18n( "Make Active Target..." ), this, SLOT( slotSetActiveTarget() ) );
+ }
+
+ m_contextMenu->popup( point );
+ }
+ }
+}
+
+void KMFMyNetworkWidget::slotSetActiveTarget() {
+ if( ! m_target ) {
+ return;
+ }
+ m_network->setCurrentTarget( m_target );
+ slotUpdateView();
+ emit sigActiveTargetChanged();
+}
+
+void KMFMyNetworkWidget::slotAddHost() {
+ kdDebug() << "void KMFMyNetworkWidget::slotAddHost()" << endl;
+ bool ok;
+ QString name = KInputDialog::getText( i18n("New Host"), i18n("Host Name"),i18n("New Host"), &ok, this );
+ if ( !ok )
+ return;
+
+ if ( m_zone ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_network->netzone(),
+ i18n("Add Target: %1 to Zone: %2").arg( name ).arg( m_zone->guiName() )
+ );
+ QString s = "";
+ s = s.setNum( m_zone->hosts().count() );
+ KMFTarget * host = m_zone->addTarget( "" + m_zone->name() + "_h_" + s, * (new QDomDocument() ) );
+ if ( host ) {
+ host->setGuiName( name );
+ m_target = host;
+ m_network->netzone()->refreshNetworkTree();
+ // m_network->netzone()->changed();
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+
+ }
+ slotUpdateView();
+}
+
+void KMFMyNetworkWidget::slotDelHost() {
+ kdDebug() << "void KMFMyNetworkWidget::slotDelHost()" << endl;
+ if ( ! m_zone || ! m_target )
+ return;
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone,
+ i18n("Delete Target: %1 from Zone: %2").arg( m_target->guiName() ).arg( m_zone->guiName() )
+ );
+ m_zone->delHost( m_target );
+ KMFUndoEngine::instance()->endTransaction();
+ m_target = 0;
+ slotUpdateView();
+}
+
+
+void KMFMyNetworkWidget::slotAddZone() {
+ kdDebug() << "void KMFMyNetworkWidget::slotAddZone()" << endl;
+ bool ok;
+ QString name = KInputDialog::getText(i18n("New Zone"), i18n("Zone Name"),i18n("NewZone"), &ok, this );
+ if ( !ok )
+ return;
+
+ QString s = "";
+ s = s.setNum( m_network->netzone()->zones().count() );
+
+ KMFUndoEngine::instance()->startTransaction(
+ m_network->netzone(),
+ i18n("Add Zone: %1 to Zone: %2").arg( name ).arg( m_network->netzone()->guiName() )
+ );
+
+ KMFNetZone * zone = m_network->netzone()->addZone( "", new KMFError() );
+ if ( zone ) {
+ zone->setGuiName( name );
+
+ m_zone = zone;
+ m_target = 0;
+ m_network->netzone()->refreshNetworkTree();
+ slotUpdateView();
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->abortTransaction();
+ }
+}
+
+void KMFMyNetworkWidget::slotDelZone() {
+ kdDebug() << "void KMFMyNetworkWidget::slotDelZone()" << endl;
+ if ( ! m_zone )
+ return;
+ if ( m_zone->name() != i18n("world") ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone->zone(),
+ i18n("Delete Zone: %1 from Zone: %2").arg( m_zone->guiName() ).arg( m_zone->zone()->guiName() )
+ );
+ m_zone->zone()->delZone( m_zone );
+ m_zone = 0;
+ slotUpdateView();
+ KMFUndoEngine::instance()->endTransaction();
+ }
+}
+
+void KMFMyNetworkWidget::slotRenameItem( QListViewItem* item, int, const QString& name ) {
+ kdDebug() << "void KMFMyNetworkWidget::slotRenameItem( QListViewItem* item, int, const QString& name )" << endl;
+ if ( ! item )
+ return;
+
+ if ( name.isEmpty() ) {
+ slotUpdateView();
+ return;
+ }
+
+ if ( KMFListViewItem *kmfitem = dynamic_cast<KMFListViewItem*> (item) ) {
+ if ( kmfitem->type() == NetfilterObject::NETZONE ) {
+ KMFUndoEngine::instance()->startTransaction(
+ kmfitem->zone(),
+ i18n("Rename Zone: %1 to %3").arg( m_zone->guiName() ).arg( name )
+ );
+
+ kmfitem->zone()->setGuiName( name );
+ kdDebug() << "Renaming Zone: " << kmfitem->zone()->name() << endl;
+ slotUpdateView();
+ KMFUndoEngine::instance()->endTransaction();
+ return;
+ }
+ if ( kmfitem->type() == NetfilterObject::KMFTARGET ) {
+ KMFUndoEngine::instance()->startTransaction(
+ kmfitem->target(),
+ i18n("Rename Host: %1 to %3").arg( m_zone->guiName() ).arg( name )
+ );
+ kmfitem->target()->setGuiName( name );
+ kdDebug() << "Renaming Host: " << kmfitem->target()->name() << endl;
+ slotUpdateView();
+ KMFUndoEngine::instance()->endTransaction();
+ return;
+ }
+ }
+}
+
+void KMFMyNetworkWidget::slotRenameZone() {
+ kdDebug() << "void KMFMyNetworkWidget::slotRenameZone()" << endl;
+ if ( ! m_zone )
+ return;
+ if ( KMFListViewItem* item = findItem( m_zone->uuid() ) ) {
+ item->setRenameEnabled( 0 ,true );
+ item->startRename(0);
+ }
+}
+
+void KMFMyNetworkWidget::slotRenameHost() {
+ kdDebug() << "void KMFMyNetworkWidget::slotRenameHost()" << endl;
+ if ( ! m_target )
+ return;
+ if ( KMFListViewItem* item = findItem( m_target->uuid() ) ) {
+ item->setRenameEnabled( 0 ,true );
+ item->startRename(0);
+ }
+}
+
+void KMFMyNetworkWidget::slotUpdateView( NetfilterObject* ) {
+ kdDebug() << "void KMFMyNetworkWidget::slotUpdateView()" << endl;
+ if ( ! m_network ) {
+ kdDebug() << "WARNING: m_network == 0" << endl;
+ return;
+ }
+ slotUpdateView();
+}
+
+void KMFMyNetworkWidget::slotUpdateView() {
+ kdDebug() << "void KMFMyNetworkWidget::slotUpdateView()" << endl;
+ if ( ! m_network ) {
+ kdDebug() << "WARNING: m_network == 0" << endl;
+ return;
+ }
+
+
+ m_lv_zones->clear();
+ KMFListViewItem *it = new KMFListViewItem( m_lv_zones, 0, m_network->netzone() );
+ it->setupZoneView();
+
+ m_lv_zones->setEnabled( true );
+ if ( m_target ) {
+ if ( KMFListViewItem *item = findItem( m_target->uuid() ) ) {
+ m_lv_zones->setSelected( item, true );
+ slotNewItemSelected( item );
+ }
+
+
+ } else if ( m_zone ) {
+ if ( KMFListViewItem *item = findItem( m_zone->uuid() ) ) {
+
+ m_lv_zones->setSelected( item, true );
+ slotNewItemSelected( item );
+ }
+ }
+ m_lv_zones->setSorting( 0 , false );
+}
+
+void KMFMyNetworkWidget::slotTargetChanged() {
+ kdDebug() << "KMFMyNetworkWidget::slotTargetChanged()" << endl;
+ if ( ! m_target ) {
+ kdDebug() << "m_target == 0" << endl;
+ return;
+ }
+ // m_network->netzone()->placeHostInZone( m_target );
+
+ m_network->netzone()->refreshNetworkTree();
+
+ m_lv_zones->clear();
+ KMFListViewItem *it = new KMFListViewItem( m_lv_zones, 0, m_network->netzone() );
+ it->setupZoneView();
+
+ if ( KMFListViewItem *item = findItem( m_target->uuid() ) ) {
+ slotNewItemSelected( item );
+ }
+ emit sigActiveTargetChanged();
+}
+
+KMFListViewItem* KMFMyNetworkWidget::findItem( const QUuid& obj_id ) {
+ // kdDebug() << "KMFListViewItem* KMFMyNetworkWidget::findItem( int obj_id )" << endl;
+ QListViewItem* root = m_lv_zones->firstChild();
+ if ( ! root )
+ return 0;
+ QListViewItem* item = root->firstChild();
+ while ( item ) {
+ if ( KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item ) ) {
+ // kdDebug() << "\nkmfitem->uuid(): " << kmfitem->uuid() <<
+ // " obj_id: " << obj_id << endl;
+
+ if ( kmfitem->uuid() == obj_id ) {
+ // kdDebug() << "MATCHED" << endl;
+ return kmfitem;
+ }
+ }
+ item = item->itemBelow();
+ }
+ return 0;
+}
+
+
+
+/*$SPECIALIZATION$*/
+void KMFMyNetworkWidget::loadIcons() {
+ kdDebug() << "void KMFGenericInterfa::loadIcons()" << endl;
+ KIconLoader *loader = KGlobal:: iconLoader();
+ QString icon_name;
+
+ icon_name = "up";
+ icon_up = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "down";
+ icon_down = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editdelete";
+ icon_del = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filenew";
+ icon_new = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "edit";
+ icon_edit = loader->loadIcon( icon_name, KIcon::Small );
+
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "text";
+ icon_rename = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "rule-22";
+ icon_rule = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "view_tree";
+ icon_chain = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "reject";
+ icon_reject = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "target";
+ icon_target = loader->loadIcon( icon_name, KIcon::User );
+
+ icon_name = "stop";
+ icon_drop = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "button_ok";
+ icon_accept = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filesaveas";
+ icon_log = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "undo";
+ icon_return = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editclear";
+ icon_cmd = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "filter";
+ icon_filter = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "pipe";
+ icon_queue = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "editcopy";
+ icon_copy = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "forward";
+ icon_move = loader->loadIcon( icon_name, KIcon::Small );
+
+}
+
+}
+
+#include "kmfmynetworkwidget.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfmynetworkwidget.h b/kmyfirewall/kmfwidgets/kmfmynetworkwidget.h
new file mode 100644
index 0000000..97d25f4
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfmynetworkwidget.h
@@ -0,0 +1,107 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFMYNETWORKWIDGET_H
+#define KMFMYNETWORKWIDGET_H
+
+#include "kmyfirewallmynetworkwidget.h"
+
+#include <qwidget.h>
+#include <kdialogbase.h>
+#include <kconfig.h>
+#include <kglobal.h>
+#include <kprocess.h>
+#include <qstring.h>
+#include <qpixmap.h>
+#include <qguardedptr.h>
+#include <quuid.h>
+class KPopupMenu;
+class QTextEdit;
+
+
+namespace KMF {
+class KMFHostWidget;
+class KMFInterfaceWidget;
+class KMFSystemSettingsLinux;
+class KMFNetworkWidget;
+class KMFNetZone;
+class KMFNetwork;
+class KMFTarget;
+class KMFListViewItem;
+class NetfilterObject;
+
+class KMFMyNetworkWidget : public KMyFirewallMyNetworkWidget
+{
+ Q_OBJECT
+
+public:
+ KMFMyNetworkWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFMyNetworkWidget();
+ /*$PUBLIC_FUNCTIONS$*/
+ void saveConfig();
+ void setNetwork( KMFNetwork* );
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ void slotUpdateView();
+ void slotUpdateView( NetfilterObject* );
+signals:
+ void sigActiveTargetChanged();
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void slotZoneRBM( QListViewItem*, const QPoint&, int );
+ void slotNewItemSelected( QListViewItem* );
+ void slotAddHost();
+ void slotDelHost();
+ void slotAddZone();
+ void slotDelZone();
+ void slotRenameItem( QListViewItem* item, int, const QString& name );
+ void slotRenameZone();
+ void slotRenameHost();
+ void slotZoneChanged( KMFNetZone* );
+ void slotTargetChanged();
+ void slotSetActiveTarget();
+
+ private:
+ void setupPropertiesView();
+ void loadIcons();
+ KMFListViewItem* findItem( const QUuid& obj_id );
+
+ private:
+ KMFHostWidget *m_hostProperties;
+ KMFInterfaceWidget *m_hostInterfaces;
+ KMFSystemSettingsLinux *m_hostSettingsLinux;
+
+ QPixmap icon_up, icon_down, icon_del, icon_edit, icon_rule, icon_filter, icon_rename,
+ icon_chain, icon_log, icon_accept, icon_drop, icon_cmd, icon_reject, icon_return,
+ icon_target, icon_queue, icon_new, icon_copy, icon_move;
+
+
+ // KMFNetZone *m_globalzone;
+ // KMFTarget *m_localhost;
+
+ QGuardedPtr<KMFNetwork> m_network;
+ QGuardedPtr<KMFNetZone> m_zone;
+ QGuardedPtr<KMFTarget> m_target;
+
+ // QTextEdit* m_zone_desc;
+ KMFNetworkWidget* m_network_widget;
+ // QWidget *ws_pageZoneProperties;
+ KPopupMenu* m_contextMenu;
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.cpp b/kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.cpp
new file mode 100644
index 0000000..c6efc1a
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.cpp
@@ -0,0 +1,293 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmfnethostpropertieswidget.h"
+
+// QT includes
+#include <qlistview.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qgroupbox.h>
+#include <qwidgetstack.h>
+#include <qtextedit.h>
+#include <qframe.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kcombobox.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kinputdialog.h>
+#include <knuminput.h>
+
+// Project Includes
+#include "../core/kmftarget.h"
+#include "../core/ipaddress.h"
+#include "../core/kmfnethost.h"
+#include "../core/kmfnetzone.h"
+#include "../core/kmfundoengine.h"
+
+#include "kmfipv4addresswidget.h"
+namespace KMF {
+KMFNetHostPropertiesWidget::KMFNetHostPropertiesWidget ( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallNetHostProperties ( parent,name,fl ) {
+
+ m_address_widget = new KMFIPv4AddressWidget( m_frameAddress, "m_address_widget" );
+
+ connect( m_address_widget, SIGNAL( sigAddressChanged( int, int, int, int ) ),
+ this,SLOT( slotAddressChanged( int, int, int, int ) ) );
+
+ connect( m_cb_host_limit, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotHostLimitToggled( bool ) ) );
+
+ connect( m_sb_host_rate, SIGNAL( valueChanged( int ) ),
+ this, SLOT( slotHostLimitValueChanged( int ) ) );
+
+ connect( m_cb_limit_host_interval, SIGNAL( activated( int ) ),
+ this, SLOT( slotHostLimitScaleChanged( int ) ) );
+
+ connect( m_cb_host_log, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotHostLogToggled( bool ) ) );
+
+ connect( m_host_desc, SIGNAL( textChanged() ),
+ this, SLOT( slotDescriptionChanged() ) );
+
+ QGridLayout *grid = new QGridLayout( m_frameAddress, 1, 1 );
+ grid->addWidget( m_address_widget, 0, 0 );
+ m_frameAddress->adjustSize();
+ adjustSize();
+}
+
+KMFNetHostPropertiesWidget::~KMFNetHostPropertiesWidget() {}
+
+void KMFNetHostPropertiesWidget::blockAllSignals( bool onoff ) {
+ m_cb_limit_host_interval->blockSignals( onoff );
+ m_cb_host_limit->blockSignals( onoff );
+ m_sb_host_rate->blockSignals( onoff );
+ m_host_desc->blockSignals( onoff );
+}
+
+void KMFNetHostPropertiesWidget::slotHostDeleted() {
+ setEnabled( false );
+ m_host = 0;
+}
+
+void KMFNetHostPropertiesWidget::loadHost( KMFNetHost* host ) {
+ kdDebug() << "KMFNetHostPropertiesWidget::loadTarget( KMFNetHost* host " << endl;
+ if ( ! host ) {
+ return;
+ }
+
+ if ( m_host ) {
+ disconnect( m_host, SIGNAL( destroyed() ),
+ this,SLOT( slotHostDeleted() ) );
+ }
+
+ m_host = host;
+ connect( m_host, SIGNAL( destroyed() ),
+ this,SLOT( slotHostDeleted() ) );
+ blockAllSignals( true );
+ setEnabled( true );
+ m_address_widget->loadIPAddress(
+ m_host->address()->getDigit( 0 ),
+ m_host->address()->getDigit( 1 ),
+ m_host->address()->getDigit( 2 ),
+ m_host->address()->getDigit( 3 )
+ );
+ if ( m_host->limit() ) {
+ m_cb_host_limit->setChecked( true );
+ m_sb_host_rate->setEnabled( true );
+ m_cb_limit_host_interval->setEnabled( true );
+ m_sb_host_rate->setValue( m_host->limitRate() );
+ kdDebug() << "Found host log scale: " << m_host->limitScale() << endl;
+
+ m_cb_limit_host_interval->blockSignals( true );
+ if ( m_host->limitScale() == "second" ) {
+ m_cb_limit_host_interval->setCurrentItem( 0 );
+ } else if ( m_host->limitScale() == "minute" ) {
+ m_cb_limit_host_interval->setCurrentItem( 1 );
+ } else if ( m_host->limitScale() == "hour" ) {
+ m_cb_limit_host_interval->setCurrentItem( 2 );
+ } else {
+ kdDebug() << "Found illefal value: " << m_host->limitScale() << endl;
+ }
+ m_cb_limit_host_interval->blockSignals( false );
+
+ } else {
+ m_cb_host_limit->setChecked( false );
+ m_sb_host_rate->setEnabled( false );
+ m_cb_limit_host_interval->setEnabled( false );
+ }
+
+ KMFNetZone* parentZone = m_host->zone()->rootZone();
+ if ( parentZone->name() == "incoming_world" ) {
+ m_cb_host_log->setChecked( m_host->logIncoming() );
+ } else if ( parentZone->name() == "outgoing_world" ) {
+ m_cb_host_log->setChecked( m_host->logOutgoing() );
+ }
+
+ if ( m_host_desc->text().simplifyWhiteSpace() != m_host->description() ) {
+ m_host_desc->blockSignals( true );
+ m_host_desc->setText( m_host->description() );
+ m_host_desc->blockSignals( false );
+ }
+ m_host_desc->setReadOnly( false );
+ blockAllSignals( false );
+}
+
+void KMFNetHostPropertiesWidget::slotAddressChanged( int d0, int d1, int d2, int d3 ) {
+ kdDebug() << "KMFNetHostPropertiesWidget::slotAddressChanged( "
+ << d0 << "."
+ << d1 << "."
+ << d2 << "."
+ << d3 << ")" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n("Change address of Host: %1.").arg( m_host->guiName() )
+ );
+ m_host->address()->setAddress( d0, d1, d2, d3 );
+ m_host->zone()->rootZone()->placeHostInZone( m_host );
+ m_host->zone()->rootZone()->refreshNetworkTree();
+ KMFUndoEngine::instance()->endTransaction();
+
+ emit sigHostAddressChanged( m_host->address()->toString() );
+ // emit sigHostChanged( m_host );
+}
+
+
+void KMFNetHostPropertiesWidget::slotHostLogToggled( bool ) {
+ kdDebug() << "void KMFNetHostPropertiesWidget::slotHostLogToggled( bool )" << endl;
+ if ( ! m_host )
+ return;
+ kdDebug() << "Changing host: " << m_host->guiName() << endl;
+
+ KMFNetZone* parentZone = m_host->zone()->rootZone();
+ if ( parentZone->name() == "incoming_world" ) {
+ if ( m_host->logIncoming() == m_cb_host_log->isChecked() ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "%1 logging of incoming packets for host %2." ).arg( m_cb_host_log->isChecked() ? i18n( "Enable" ) : i18n( "Disable" ) ).arg( m_host->guiName() )
+ );
+ m_host->setLogIncoming( m_cb_host_log->isChecked() );
+ KMFUndoEngine::instance()->endTransaction();
+ } else if ( parentZone->name() == "outgoing_world" ) {
+ if ( m_host->logOutgoing() == m_cb_host_log->isChecked() ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "%1 logging of outgoing packets for host %2." ).arg( m_cb_host_log->isChecked() ? i18n( "Enable" ) : i18n( "Disable" ) ).arg( m_host->guiName() )
+ );
+ m_host->setLogOutgoing( m_cb_host_log->isChecked() );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ emit sigHostChanged( m_host );
+}
+
+void KMFNetHostPropertiesWidget::slotHostLimitToggled( bool on ){
+ kdDebug() << "void KMFNetHostPropertiesWidget::slotHostLimitToggled( bool " << on << " )" << endl;
+ if ( ! m_host )
+ return;
+ kdDebug() << "Changing host: " << m_host->guiName() << endl;
+ if ( on ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Enable package limit for host %1." ).arg( m_host->guiName() )
+ );
+ m_host->setLimit( m_sb_host_rate->value(), m_cb_limit_host_interval->currentText() );
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Disable package limit for host %1." ).arg( m_host->guiName() )
+ );
+ m_host->setLimit( -1, m_cb_limit_host_interval->currentText() );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ emit sigHostChanged( m_host );
+}
+
+void KMFNetHostPropertiesWidget::slotHostLimitValueChanged( int ) {
+ kdDebug() << "void KMFNetHostPropertiesWidget::slotHostLimitValueChanged( int )" << endl;
+ if ( ! m_host )
+ return;
+ kdDebug() << "Changing host: " << m_host->guiName() << endl;
+ if ( m_cb_host_limit->isChecked() ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Change package limit for host %1 to %2/%3." ).arg( m_host->guiName() ).arg( m_sb_host_rate->value() ).arg( m_cb_limit_host_interval->currentText() )
+ );
+ m_host->setLimit( m_sb_host_rate->value(), m_cb_limit_host_interval->currentText() );
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Disable package limit for host %1." ).arg( m_host->guiName() )
+ );
+ m_host->setLimit( -1, m_cb_limit_host_interval->currentText() );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ emit sigHostChanged( m_host );
+}
+
+void KMFNetHostPropertiesWidget::slotHostLimitScaleChanged( int ) {
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotHostLimitValueChanged( int )" << endl;
+ if ( ! m_host )
+ return;
+ kdDebug() << "Changing host: " << m_host->guiName() << endl;
+ if ( m_cb_host_limit->isChecked() ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Change package limit for host %1 to %2/%3." ).arg( m_host->guiName() ).arg( m_sb_host_rate->value() ).arg( m_cb_limit_host_interval->currentText() )
+ );
+ m_host->setLimit( m_sb_host_rate->value(), m_cb_limit_host_interval->currentText() );
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Disable package limit for host %1." ).arg( m_host->guiName() )
+ );
+ m_host->setLimit( -1, "" );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ emit sigHostChanged( m_host );
+}
+
+void KMFNetHostPropertiesWidget::slotDescriptionChanged() {
+ kdDebug() << "void KMFNetHostPropertiesWidget::slotDescriptionChanged( const QString& )" << endl;
+ if ( ! m_host ) {
+ return;
+ }
+ QString newTxt = m_host_desc->text().simplifyWhiteSpace();
+ if ( newTxt != m_host->description() ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_host,
+ i18n( "Change documentation of host: %1" ).arg( m_host->guiName() )
+ );
+ m_host->setDescription( newTxt );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ emit sigHostChanged( m_host );
+}
+
+}
+
+#include "kmfnethostpropertieswidget.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.h b/kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.h
new file mode 100644
index 0000000..6eb76d2
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfnethostpropertieswidget.h
@@ -0,0 +1,63 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFNETHOSTPROPERTIESWIDGET_H
+#define KMFNETHOSTPROPERTIESWIDGET_H
+
+#include "kmyfirewallnethostproperties.h"
+
+// QT include
+#include <qguardedptr.h>
+
+namespace KMF {
+class KMFNetHost;
+class KMFIPv4AddressWidget;
+
+class KMFNetHostPropertiesWidget : public KMyFirewallNetHostProperties {
+ Q_OBJECT
+
+ public:
+ KMFNetHostPropertiesWidget ( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFNetHostPropertiesWidget();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ void loadHost( KMFNetHost* );
+ public slots:
+ /*$PUBLIC_SLOTS$*/
+
+ protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+ protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void slotAddressChanged( int, int, int, int );
+ void slotHostLimitToggled( bool );
+ void slotHostLogToggled( bool );
+ void slotHostLimitValueChanged( int );
+ void slotHostLimitScaleChanged( int );
+ void slotDescriptionChanged();
+ void slotHostDeleted();
+
+ private:
+ void blockAllSignals( bool );
+
+ private:
+ QGuardedPtr<KMFNetHost> m_host;
+ KMFIPv4AddressWidget *m_address_widget;
+
+ signals:
+ void sigHostAddressChanged( const QString& );
+ void sigHostChanged( KMFNetHost* );
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmfnetworkwidget.cpp b/kmyfirewall/kmfwidgets/kmfnetworkwidget.cpp
new file mode 100644
index 0000000..627d48f
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfnetworkwidget.cpp
@@ -0,0 +1,180 @@
+//
+// C++ Implementation: kmfnetworkwidget
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfnetworkwidget.h"
+
+// QT includes
+#include <qlabel.h>
+#include <qtextedit.h>
+#include <qevent.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <knuminput.h>
+#include <klocale.h>
+
+// project includes
+#include "../core/kmfundoengine.h"
+
+
+namespace KMF {
+KMFNetworkWidget::KMFNetworkWidget(QWidget *parent, const char *name)
+ : KMyFirewallNetworkWidget(parent, name) {
+ m_allowEdit = true;
+ connect( m_sb_from_1,SIGNAL( valueChanged( const QString& ) ),
+ this,SLOT( slotAddressChanged( const QString& ) ) );
+ connect( m_sb_from_2,SIGNAL( valueChanged( const QString& ) ),
+ this,SLOT( slotAddressChanged( const QString& ) ) );
+ connect( m_sb_from_3,SIGNAL( valueChanged( const QString& ) ),
+ this,SLOT( slotAddressChanged( const QString& ) ) );
+ connect( m_sb_from_4,SIGNAL( valueChanged( const QString& ) ),
+ this,SLOT( slotAddressChanged( const QString& ) ) );
+
+ connect( m_sb_mask,SIGNAL( valueChanged( int ) ),
+ this,SLOT( slotShortMaskChanged( int ) ) );
+
+ connect( m_txt_desc,SIGNAL( textChanged() ),
+ this,SLOT( slotDescriptionChanged() ) );
+
+}
+
+
+KMFNetworkWidget::~KMFNetworkWidget() {}
+
+void KMFNetworkWidget::slotZoneDeleted() {
+ setEnabled( false );
+}
+
+void KMFNetworkWidget::loadZone( KMFNetZone* zone ) {
+ setEnabled( true );
+ blockAllSignals( true );
+ m_zone = zone;
+ connect( m_zone, SIGNAL( destroyed() ), this, SLOT ( slotZoneDeleted() ) );
+
+ m_sb_from_1->setEnabled( true );
+ m_sb_from_2->setEnabled( true );
+ m_sb_from_3->setEnabled( true );
+ m_sb_from_4->setEnabled( true );
+ m_sb_mask->setEnabled( true );
+
+ m_sb_from_1->setValue( zone->address()->getDigit( 0 ) );
+ m_sb_from_2->setValue( zone->address()->getDigit( 1 ) );
+ m_sb_from_3->setValue( zone->address()->getDigit( 2 ) );
+ m_sb_from_4->setValue( zone->address()->getDigit( 3 ) );
+
+ lbl_mask->setText( zone->mask()->toString() );
+ if ( zone->description() != m_txt_desc->text().simplifyWhiteSpace() ) {
+ m_txt_desc->setText( zone->description() );
+ }
+ m_sb_mask->setValue( IPAddress::calcLenthToMask( *zone->mask() ) );
+ blockAllSignals( false );
+}
+
+void KMFNetworkWidget::slotAddressChanged( const QString& ) {
+ kdDebug() << "void KMFNetworkWidget::slotAddressChanged( const QString& )" << endl;
+ if ( ! m_zone ) {
+ return;
+ }
+
+ blockAllSignals( true );
+ if ( m_allowEdit ) {
+
+ const QString& newAddr = m_sb_from_1->text() +"."+
+ m_sb_from_2->text() +"."+
+ m_sb_from_3->text() +"."+
+ m_sb_from_4->text();
+
+ if ( newAddr == m_zone->address()->toString() ) {
+ return;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone->rootZone(),
+ i18n( "Change address of Zone: %1" ).arg( m_zone->guiName() )
+ );
+
+ m_zone->address()->setAddress( m_sb_from_1->value(), m_sb_from_2->value(), m_sb_from_3->value(), m_sb_from_4->value() );
+ m_zone->rootZone()->refreshNetworkTree();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigZoneChanged( m_zone );
+ }
+ blockAllSignals( false );
+
+}
+
+void KMFNetworkWidget::slotShortMaskChanged( int len ) {
+ kdDebug() << "void KMFNetworkWidget::slotShortMaskChanged( const QString& )" << endl;
+ IPAddress addr = IPAddress::calcNetworkMaskFromLength( len );
+ blockAllSignals( true );
+ lbl_mask->setText( addr.toString() );
+ if ( m_allowEdit && m_zone->maskLength() != len ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone->rootZone(),
+ i18n( "Change mask length of Zone: %1" ).arg( m_zone->guiName() )
+ );
+ m_zone->setMaskLength( len );
+ m_zone->rootZone()->refreshNetworkTree();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigZoneChanged( m_zone );
+ }
+ blockAllSignals( false );
+}
+
+void KMFNetworkWidget::slotDescriptionChanged() {
+ kdDebug() << "void KMFNetworkWidget::slotDescriptionChanged( const QString& )" << endl;
+ if ( ! m_zone ) {
+ return;
+ }
+ QString newTxt = m_txt_desc->text().simplifyWhiteSpace();
+ if ( m_allowEdit && newTxt != m_zone->description() ) {
+ blockAllSignals( true );
+ KMFUndoEngine::instance()->startTransaction(
+ m_zone,
+ i18n( "Change documentation of Zone: %1" ).arg( m_zone->guiName() )
+ );
+ m_zone->setDescription( newTxt );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigZoneChanged( m_zone );
+ blockAllSignals( false );
+ }
+}
+
+void KMFNetworkWidget::focusOutEvent( QFocusEvent * e ) {
+ kdDebug() << "void KMFNetworkWidget::focusOutEvent( QFocusEvent * e )" << endl;
+ if ( e->lostFocus() && m_txt_desc->text().simplifyWhiteSpace() != m_zone->description() ) {
+ slotDescriptionChanged();
+ }
+}
+
+void KMFNetworkWidget::blockAllSignals( bool onOff ) {
+ m_sb_from_1->blockSignals( onOff );
+ m_sb_from_2->blockSignals( onOff );
+ m_sb_from_3->blockSignals( onOff );
+ m_sb_from_4->blockSignals( onOff );
+ m_txt_desc->blockSignals( onOff );
+ m_sb_mask->blockSignals( onOff );
+}
+
+void KMFNetworkWidget::allowEdit( bool allow ) {
+ m_allowEdit = allow;
+ m_sb_from_1->setEnabled( allow );
+ m_sb_from_2->setEnabled( allow );
+ m_sb_from_3->setEnabled( allow );
+ m_sb_from_4->setEnabled( allow );
+ m_txt_desc->setEnabled( allow );
+ m_sb_mask->setEnabled( allow );
+}
+
+}
+
+
+
+
+#include "kmfnetworkwidget.moc"
diff --git a/kmyfirewall/kmfwidgets/kmfnetworkwidget.h b/kmyfirewall/kmfwidgets/kmfnetworkwidget.h
new file mode 100644
index 0000000..81357a4
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfnetworkwidget.h
@@ -0,0 +1,65 @@
+//
+// C++ Interface: kmfnetworkwidget
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFNETWORKWIDGET_H
+#define KMFNETWORKWIDGET_H
+
+#include "kmyfirewallnetworkwidget.h"
+
+// QT includes
+#include <qwidget.h>
+#include <qguardedptr.h>
+
+// KDE includes
+#include <kdemacros.h>
+
+// project includes
+#include "../core/kmfnetzone.h"
+#include "../core/ipaddress.h"
+
+class QFocusEvent;
+
+/**
+@author Christian Hubinger
+*/
+
+namespace KMF {
+class KDE_EXPORT KMFNetworkWidget : public KMyFirewallNetworkWidget {
+ Q_OBJECT
+public:
+ KMFNetworkWidget(QWidget *parent = 0, const char *name = 0);
+ ~KMFNetworkWidget();
+
+ void loadZone( KMFNetZone* );
+ void allowEdit( bool );
+private slots:
+ void slotAddressChanged( const QString& );
+ void slotDescriptionChanged();
+ void slotShortMaskChanged( int );
+ void slotZoneDeleted();
+
+protected:
+ void focusOutEvent( QFocusEvent * );
+
+private:
+ void blockAllSignals( bool );
+
+private:
+ QGuardedPtr<KMFNetZone> m_zone;
+ bool m_allowEdit;
+
+
+
+signals:
+ void sigZoneChanged( KMFNetZone* );
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfnewdocdlg.cpp b/kmyfirewall/kmfwidgets/kmfnewdocdlg.cpp
new file mode 100644
index 0000000..bf313a2
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfnewdocdlg.cpp
@@ -0,0 +1,96 @@
+/***************************************************************************
+ begin : Thu Apr 17 2003
+ copyright : (C) 2003 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kapplication.h"
+#include "kmfnewdocdlg.h"
+#include "../version.h"
+#include "kmfnewdocdlg.moc"
+
+// QT includes
+#include "qpixmap.h"
+#include "qpainter.h"
+#include "qlabel.h"
+#include "qstring.h"
+#include "qpushbutton.h"
+#include "qrect.h"
+
+
+// KDE includes
+#include "kstandarddirs.h"
+#include "kdebug.h"
+namespace KMF {
+KMFNewDocDlg::KMFNewDocDlg( QWidget *parent, const char *name, WFlags fl ) : KMyFirewallNewDocument( parent, name, fl ) {
+ KStandardDirs std_dir;
+ QString dir = std_dir.findResource( "data", "kmyfirewall/pics/splash_cut.png" );
+ kdDebug() << "Found Splashscreen at: " << dir << endl;
+
+ QPixmap pic = QPixmap::fromMimeSource( dir );
+ QFont f( "helvetica", 8, QFont::Bold );
+ if ( pic.isNull() )
+ return ;
+ QPainter p( &pic );
+ p.setFont( f );
+ p.setPen( Qt::white );
+ p.drawText( 165, 45, QString( "Version %1" ).arg( KMYFIREWALL_VERSION ) );
+ p.drawText( 93, 215, QString( "%1" ).arg( COPYRIGHT_DATE ) );
+ p.drawText( 70, 230, QString( "%1" ).arg( COPYRIGHT_OWNER ) );
+ if ( pic.isNull() )
+ return ;
+ l_pic->setPixmap( pic );
+ connect( b_cancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( b_close, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( b_empty, SIGNAL( clicked() ), this, SLOT( loadEmpty() ) );
+ connect( b_template, SIGNAL( clicked() ), this, SLOT( loadTemplate() ) );
+ connect( b_load_saved, SIGNAL( clicked() ), this, SLOT( loadSaved() ) );
+ connect( b_help, SIGNAL( clicked() ), this, SLOT( slotHelp() ) );
+ QRect screen = QApplication::desktop() ->screenGeometry();
+ QRect mainRect;
+ screen = QApplication::desktop() ->screenGeometry( QApplication::desktop() ->screenNumber( mainRect.center() ) );
+ move( screen.center() - QPoint( width() / 2, height() / 2 ) );
+}
+
+KMFNewDocDlg::~KMFNewDocDlg() {}
+
+
+
+void KMFNewDocDlg::reject() {
+ close();
+}
+
+void KMFNewDocDlg::loadEmpty() {
+ hide();
+ emit sigNewDocLoadEmpty();
+ close();
+}
+void KMFNewDocDlg::loadWizard() {
+ hide();
+ emit sigNewDocLoadWizard();
+ close();
+}
+void KMFNewDocDlg::loadTemplate() {
+ hide();
+ emit sigNewDocLoadTemplate();
+ close();
+}
+void KMFNewDocDlg::loadSaved() {
+ hide();
+ emit sigNewDocLoadSaved();
+ close();
+}
+void KMFNewDocDlg::slotHelp() {
+ kapp->invokeHelp();
+}
+
+}
diff --git a/kmyfirewall/kmfwidgets/kmfnewdocdlg.h b/kmyfirewall/kmfwidgets/kmfnewdocdlg.h
new file mode 100644
index 0000000..a473a72
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfnewdocdlg.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ begin : Thu Apr 17 2003
+ copyright : (C) 2003 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFNEWDOCDLG_H
+#define KMFNEWDOCDLG_H
+
+#include <qwidget.h>
+#include <kdemacros.h>
+#include "kmyfirewallnewdocument.h"
+
+
+/**
+ *@author Christian Hubinger
+ */
+
+class QKeyEvent;
+namespace KMF {
+class KDE_EXPORT KMFNewDocDlg : public KMyFirewallNewDocument {
+ Q_OBJECT
+public:
+ KMFNewDocDlg(QWidget *parent=0, const char *name=0, WFlags fl = 0);
+ ~KMFNewDocDlg();
+
+
+
+private slots:
+ void reject();
+ void loadEmpty();
+ void loadWizard();
+ void loadTemplate();
+ void loadSaved();
+ void slotHelp();
+signals:
+ void sigNewDocLoadWizard();
+ void sigNewDocLoadTemplate();
+ void sigNewDocLoadSaved();
+ void sigNewDocLoadEmpty();
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfobjectinfo.cpp b/kmyfirewall/kmfwidgets/kmfobjectinfo.cpp
new file mode 100644
index 0000000..5ab4b5c
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfobjectinfo.cpp
@@ -0,0 +1,110 @@
+/***************************************************************************
+ begin : Thu Apr 24 2003
+ copyright : (C) 2003 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfobjectinfo.h"
+
+// KDE Includes
+#include <kdebug.h>
+#include <kapplication.h>
+#include <klocale.h>
+
+// QT includes
+#include <qstring.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qtextedit.h>
+
+// Project includes
+#include "../core/iptrule.h"
+#include "../core/iptchain.h"
+#include "../core/iptable.h"
+#include "../core/kmfdoc.h"
+#include "../core/kmfiptdoc.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmfundoengine.h"
+namespace KMF {
+KMFObjectInfo::KMFObjectInfo(QWidget *parent, const char *name, bool modal ) : KMyFirewallObjectInfo(parent, name, modal) {
+}
+
+KMFObjectInfo::~KMFObjectInfo(){
+}
+
+void KMFObjectInfo::loadNetfilterObject( NetfilterObject* obj ) {
+ if ( ! obj )
+ return;
+ m_netfilter_object = obj;
+ m_doc = 0;
+ switch( m_netfilter_object->type() ) {
+ case NetfilterObject::RULE:
+ m_header->setText( i18n("Rule Documentation") );
+ break;
+ case NetfilterObject::CHAIN:
+ m_header->setText( i18n("Chain Documentation") );
+ break;
+ default:
+ m_header->setText( i18n("Object Documentation") );
+ break;
+ }
+ te_desc->setText( m_netfilter_object->description() );
+}
+
+void KMFObjectInfo::loadKMFDoc( KMFDoc* obj ){
+ if ( ! obj )
+ return;
+ m_doc = obj;
+ m_netfilter_object = 0;
+ m_header->setText( i18n("Firewall Documentation") );
+ te_desc->setText( m_doc->description() );
+}
+
+void KMFObjectInfo::accept() {
+ if ( m_netfilter_object ) {
+ if ( m_netfilter_object->description() != te_desc->text() ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_netfilter_object,
+ i18n("Edit Documentaion for: %1").arg( m_netfilter_object->name() )
+ );
+ m_netfilter_object->setDescription( te_desc->text() );
+ kdDebug() << "Description Changed: " << te_desc->text() << endl;
+ KMFUndoEngine::instance()->endTransaction();
+ }
+ } else if ( m_doc ) {
+ if ( m_doc->description() != te_desc->text() ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_doc,
+ i18n("Edit Documentaion for: %1").arg( m_netfilter_object->name() )
+ );
+ m_doc->setDescription( te_desc->text() );
+ KMFUndoEngine::instance()->endTransaction();
+ kdDebug() << "Description Changed: " << te_desc->text() << endl;
+ }
+ }
+
+ emit sigDocumentChanged();
+ emit sigHideMe();
+}
+
+void KMFObjectInfo::reject() {
+ emit sigHideMe();
+}
+
+void KMFObjectInfo::slotHelp() {
+ kapp->invokeHelp( "rule_documentation" );
+}
+
+}
+
+#include "kmfobjectinfo.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfobjectinfo.h b/kmyfirewall/kmfwidgets/kmfobjectinfo.h
new file mode 100644
index 0000000..0ef0327
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfobjectinfo.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ begin : Thu Apr 24 2003
+ copyright : (C) 2003 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFOBJECTINFO_H
+#define KMFOBJECTINFO_H
+
+#include <qwidget.h>
+#include "kmyfirewallobjectinfo.h"
+
+#include <kdemacros.h>
+
+/**
+ *@author Christian Hubinger
+ */
+namespace KMF {
+class NetfilterObject;
+class KMFDoc;
+
+class KDE_EXPORT KMFObjectInfo : public KMyFirewallObjectInfo {
+ Q_OBJECT
+public:
+ KMFObjectInfo(QWidget *parent=0, const char *name=0, bool modal=false);
+ ~KMFObjectInfo();
+
+ void loadNetfilterObject( NetfilterObject* );
+ void loadKMFDoc( KMFDoc* );
+
+private slots:
+ void accept();
+ void reject();
+ void slotHelp();
+
+private: // data
+ NetfilterObject* m_netfilter_object;
+ KMFDoc* m_doc;
+signals:
+ void sigDocumentChanged();
+ void sigHideMe();
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfportwidget.cpp b/kmyfirewall/kmfwidgets/kmfportwidget.cpp
new file mode 100644
index 0000000..a27bfd3
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfportwidget.cpp
@@ -0,0 +1,294 @@
+/***************************************************************************
+ begin : Fri Nov 1 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfportwidget.h"
+
+#include <qstring.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qlabel.h>
+
+#include <kcombobox.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include "../core/kmferror.h"
+
+namespace KMF {
+KMFPortWidget::KMFPortWidget( QWidget *parent, const char *name ) : KMyFirewallPortWidget( parent, name ) {
+ m_err = new KMFError();
+ m_err->setErrType( KMFError::OK );
+ m_err->setErrMsg( "" );
+ QStringList *l = new QStringList();
+
+ cb_port_name->clear();
+ l->append( "tcpmux" );
+ l->append( "tcpmux" );
+ l->append( "echo" );
+ l->append( "discard" );
+ l->append( "systat" );
+ l->append( "daytime" );
+ l->append( "netstat" );
+ l->append( "qotd" );
+ l->append( "msp" );
+ l->append( "chargen" );
+ l->append( "ftp-data" );
+ l->append( "ftp" );
+ l->append( "fsp" );
+ l->append( "ssh" );
+ l->append( "telnet" );
+ l->append( "smtp" );
+ l->append( "time" );
+ l->append( "rlp" );
+ l->append( "nameserver" );
+ l->append( "whois" );
+ l->append( "re-mail-ck" );
+ l->append( "domain" );
+ l->append( "mtp" );
+ l->append( "bootps" );
+ l->append( "bootpc" );
+ l->append( "tftp" );
+ l->append( "gopher" );
+ l->append( "rje" );
+ l->append( "finger" );
+ l->append( "www" );
+ l->append( "link" );
+ l->append( "kerberos" );
+ l->append( "supdup" );
+ l->append( "hostnames" );
+ l->append( "iso-tsap" );
+ l->append( "csnet-ns" );
+ l->append( "rtelnet" );
+ l->append( "pop2" );
+ l->append( "pop3" );
+ l->append( "sunrpc" );
+ l->append( "auth" );
+ l->append( "sftp" );
+ l->append( "uucp-path" );
+ l->append( "nntp" );
+ l->append( "ntp" );
+ l->append( "pwdgen" );
+ l->append( "netbios-ns" );
+ l->append( "netbios-dgm" );
+ l->append( "netbios-ssn" );
+ l->append( "imap2" );
+ l->append( "snmp" );
+ l->append( "snmp-trap" );
+ l->append( "cmip-man" );
+ l->append( "cmip-agent" );
+ l->append( "mailq" );
+ l->append( "xdmcp" );
+ l->append( "nextstep" );
+ l->append( "bgp" );
+ l->append( "prospero" );
+ l->append( "irc" );
+ l->append( "smux" );
+ l->append( "at-rtmp" );
+ l->append( "at-rtmp" );
+ l->append( "at-nbp" );
+ l->append( "at-echo" );
+ l->append( "at-zis" );
+ l->append( "qmtp" );
+ l->append( "z3950" );
+ l->append( "ipx" );
+ l->append( "imap3" );
+ l->append( "pawserv" );
+ l->append( "zserv" );
+ l->append( "fatserv" );
+ l->append( "rpc2portmap" );
+ l->append( "codaauth2" );
+ l->append( "ulistserv" );
+ l->append( "ldap" );
+ l->append( "https" );
+ l->append( "snpp" );
+ l->append( "saft" );
+ l->append( "npmp-local" );
+ l->append( "npmp-gui" );
+ l->append( "hmmp-ind" );
+ l->append( "ipp" );
+ l->append( "exec" );
+ l->append( "biff" );
+ l->append( "login" );
+ l->append( "who" );
+ l->append( "shell" );
+ l->append( "syslog" );
+ l->append( "printer" );
+ l->append( "talk" );
+ l->append( "ntalk" );
+ l->append( "route" );
+ l->append( "timed" );
+ l->append( "tempo" );
+ l->append( "courier" );
+ l->append( "conference" );
+ l->append( "netnews" );
+ l->append( "netwall" );
+ l->append( "gdomap" );
+ l->append( "gdomap" );
+ l->append( "uucp" );
+ l->append( "klogin" );
+ l->append( "kshell" );
+ l->append( "afpovertcp" );
+ l->append( "remotefs" );
+ l->append( "nntps" );
+ l->append( "submission" );
+ l->append( "ldaps" );
+ l->append( "tinc" );
+ l->append( "silc" );
+ l->append( "kerberos-adm" );
+ l->append( "webster" );
+ l->append( "rsync" );
+ l->append( "ftps-data" );
+ l->append( "ftps" );
+ l->append( "telnets" );
+ l->append( "imaps" );
+ l->append( "ircs" );
+ l->append( "pop3s" );
+ l->append( "socks" );
+ l->append( "mysql" );
+ l->append( "jabber-client" );
+ l->append( "jabber-server" );
+ l->append( "postgres" );
+ l->append( "x11" );
+ l->append( "x11-1" );
+ l->append( "x11-2" );
+ l->append( "x11-3" );
+ l->append( "x11-4" );
+ l->append( "x11-5" );
+ l->append( "x11-6" );
+ l->append( "x11-7" );
+ l->append( "font-service" );
+ l->append( "kerberos4" );
+ l->append( "kerberos_master" );
+ l->append( "passwd_server" );
+ l->append( "krb_prop" );
+ l->append( "krbupdate" );
+ l->append( "kpasswd" );
+ l->append( "swat" );
+ l->append( "kpop" );
+ l->append( "knetd" );
+ l->append( "zephyr-srv" );
+ l->append( "zephyr-clt" );
+ l->append( "zephyr-hm" );
+ l->append( "eklogin" );
+ l->append( "linuxconf" );
+ l->append( "poppassd" );
+ l->sort();
+ cb_port_name-> insertStringList( *l );
+ sb_port1->setMaxValue( 65535 );
+ sb_port2->setMaxValue( 65535 );
+ sb_port1->setMinValue( 1 );
+ sb_port2->setMinValue( 1 );
+}
+
+KMFPortWidget::~KMFPortWidget() {}
+
+KMFError* KMFPortWidget::getPortString( QString* value ) {
+ QString port1 = "";
+ QString port2 = "";
+ QString portname = "";
+ QString ddot = ":";
+ if ( c_port_name->isChecked() ) {
+ portname = cb_port_name->currentText();
+ kdDebug() << "Found portname: " << portname << endl;
+ value->append( portname );
+ kdDebug() << "Return portname: " << *value << endl;
+ m_err->setErrType( KMFError::OK );
+ m_err->setErrMsg( "" );
+ return m_err;
+ } else {
+ port1 = port1.setNum( sb_port1->value() );
+ value->append( port1 );
+ if ( c_portrange->isChecked() ) {
+ port2 = port2.setNum( sb_port2->value() );
+ value->append( ddot );
+ value->append( port2 );
+ }
+
+ if ( c_inv->isChecked() ) {
+ value->prepend( "! " );
+ }
+ m_err->setErrType( KMFError::OK );
+ m_err->setErrMsg( "" );
+ return m_err;
+ }
+ return m_err;
+}
+
+void KMFPortWidget::loadPortString( QString& port ) {
+ kdDebug() << "void KMFPortWidget::loadPortString(QString&)" << endl;
+ kdDebug() << "Try to load PortString: " << port << endl;
+ setEnabled( true );
+ if ( port.startsWith( "! " ) ) {
+ port = port.right( port.length() - 2 );
+ c_inv->setChecked( true );
+ }
+
+ int pos = -1;
+ pos = port.find( ":" );
+ if ( pos > -1 ) {
+ c_port_name->setChecked( false );
+ c_portrange->setChecked( true );
+ sb_port2->setEnabled( true );
+ l_to->setEnabled( true );
+ c_port_name->setEnabled( false );
+
+ QString port1 = port.left( pos );
+ QString port2 = port.right( port.length() - pos - 1 );
+ kdDebug() << "Found Ports: " << port1 << " and " << port2 << endl;
+ int p1, p2;
+ bool bp1, bp2;
+ p1 = port1.toInt( &bp1, 10 );
+ p2 = port2.toInt( &bp2, 10 );
+ if ( p1 )
+ sb_port1->setValue( p1 );
+ if ( p2 )
+ sb_port2->setValue( p2 );
+ } else {
+ kdDebug() << "Found Port: " << port << endl;
+ int p;
+ bool ok;
+ p = port.toInt( &ok, 10 );
+ if ( ok ) {
+ sb_port1->setValue( p );
+ } else {
+ c_port_name->setChecked( true );
+
+// for ( uint i = 0; i < c_port_name->count(); i++ ) {
+// QString tmp_item = c_port_name->text( i );
+// if ( tmp_item == port ) {
+// c_port_name->setCurrentItem( i );
+// }
+// }
+
+
+ cb_port_name->setCurrentText( port );
+
+ }
+ }
+}
+
+void KMFPortWidget::reset() {
+ c_portrange->setChecked( false );
+ c_inv->setChecked( false );
+ l_to->setEnabled( false );
+ c_port_name->setChecked( false );
+ cb_port_name->setCurrentItem( 0 );
+ sb_port1->setValue( 0 );
+ sb_port2->setValue( 0 );
+}
+
+}
+
+#include "kmfportwidget.moc"
diff --git a/kmyfirewall/kmfwidgets/kmfportwidget.h b/kmyfirewall/kmfwidgets/kmfportwidget.h
new file mode 100644
index 0000000..f4a3965
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfportwidget.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ begin : Fri Nov 1 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFPORTWIDGET_H
+#define KMFPORTWIDGET_H
+
+#include <qwidget.h>
+#include <kdemacros.h>
+#include "kmyfirewallportwidget.h"
+
+/**Widget for input of portnumbers, portranges or names
+ *@author Christian Hubinger
+ */
+
+namespace KMF {
+class KMFError;
+
+class KDE_EXPORT KMFPortWidget : public KMyFirewallPortWidget {
+ Q_OBJECT
+public:
+ KMFPortWidget( QWidget *parent = 0, const char *name = 0 );
+ ~KMFPortWidget();
+ KMFError* getPortString( QString* value );
+ void loadPortString( QString& );
+ void reset();
+private:
+ KMFError *m_err;
+
+signals:
+ void sigMultiPortChanged( bool );
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfprocout.cpp b/kmyfirewall/kmfwidgets/kmfprocout.cpp
new file mode 100644
index 0000000..7112468
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfprocout.cpp
@@ -0,0 +1,208 @@
+/***************************************************************************
+ begin : Thu Sep 5 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfprocout.h"
+
+// KDE includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <kstandarddirs.h>
+#include <kpushbutton.h>
+
+
+// QT includes
+#include <qtextbrowser.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qpixmap.h>
+#include <qfont.h>
+
+// Project Includes
+#include "../core/xmlnames.h"
+namespace KMF {
+KMFProcOut::KMFProcOut( QWidget *parent, const char *name, WFlags fl ) : QWidget( parent, name, fl ) {
+ stderrbuf = new QString( "" );
+ stdoutbuf = new QString( "" );
+ m_job_name = XML::Undefined_Value;
+ childproc = new KProcess();
+
+ connect( childproc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), this, SLOT( slotReceivedOutput( KProcess*, char*, int ) ) );
+ connect( childproc, SIGNAL( receivedStderr( KProcess*, char*, int ) ), this, SLOT( slotReceivedError( KProcess*, char*, int ) ) );
+ connect( childproc, SIGNAL( processExited( KProcess* ) ), this, SLOT( slotProcessExited( KProcess* ) ) ) ;
+ initGUI();
+ hide();
+ kdDebug() << "KMFProcOut: Finished initialisation." << endl;
+}
+
+KMFProcOut::~KMFProcOut() {
+ delete childproc;
+}
+
+void KMFProcOut::initGUI() {
+ KIconLoader * loader = KGlobal:: iconLoader();
+ QString icon_name;
+
+ icon_name = "stop";
+ icon_stop = loader->loadIcon( icon_name, KIcon::Small );
+
+ icon_name = "quit";
+ icon_close = loader->loadIcon( icon_name, KIcon::Small );
+
+ m_layout = new QGridLayout( this, 0, 0, 2, 2, "layout" );
+
+ m_lbview = new QTextBrowser( this, "m_lbview" );
+ m_lbview->setTextFormat( RichText );
+
+
+ m_lbview->setFont( QFont( "Nimbus Mono L", 9 ) );
+
+ m_ljob_name = new QLabel( this, "m_ljob_name" );
+ QFont ljob_name_font( m_ljob_name->font() );
+ ljob_name_font.setBold( TRUE );
+ m_ljob_name->setFont( ljob_name_font );
+ m_ljob_name->setFrameShape( QLabel::StyledPanel );
+ m_ljob_name->setFrameShadow( QLabel::Sunken );
+ m_ljob_name->setText( i18n( "Nothing to do yet..." ) );
+
+ m_bkill = new KPushButton( icon_stop, i18n( "Kill Process" ) , this, "m_bkill" );
+ m_bkill->setEnabled( false );
+ connect( m_bkill, SIGNAL( clicked() ), this, SLOT( slotKillJob() ) );
+
+ m_layout->addMultiCellWidget( m_ljob_name, 0, 0, 0, 9 );
+ m_layout->addMultiCellWidget( m_bkill, 0, 0, 9, 10 );
+ m_layout->addMultiCellWidget( m_lbview, 1, 1, 0, 10 );
+}
+
+
+void KMFProcOut::runCmd( const QString& cmd, const QString& job_name, const QString& job_description, bool useKdeSu ) {
+ kdDebug() << "KMFProcOut::runCmd(QString& cmd)"/* << cmd */<< endl;
+ show();
+ m_lbview->clear();
+ m_lbview->setTextFormat( RichText );
+ m_ljob_name->setText( job_description );
+ m_job_name = job_name;
+ startJob( cmd, useKdeSu );
+}
+
+void KMFProcOut::startJob( const QString &cmd, bool useKdeSu ) {
+ m_bkill->setEnabled( true );
+
+ childproc->clearArguments();
+ if( useKdeSu ) {
+ *childproc << "kdesu" << "-t" << "-i" << "kmyfirewall" << "--noignorebutton" << "-d" << "-c" << cmd;
+ } else {
+ *childproc << "bash" << cmd;
+ }
+
+ childproc->start( KProcess::NotifyOnExit, KProcess::AllOutput );
+}
+
+void KMFProcOut::slotKillJob() {
+ kdDebug() << "void KMFProcOut::killJob()" << endl;
+ childproc->kill();
+}
+
+bool KMFProcOut::isRunning() {
+ return childproc->isRunning();
+}
+
+void KMFProcOut::slotReceivedOutput( KProcess *, char *buffer, int buflen ) {
+ // Flush stderr buffer
+ if ( !stderrbuf->isEmpty() ) {
+ insertStderrLine( *stderrbuf );
+ stderrbuf = new QString( "" );
+ }
+
+ *stdoutbuf += QString::fromLatin1( buffer, buflen );
+ int pos;
+ while ( ( pos = stdoutbuf->find( '\n' ) ) != -1 ) {
+ QString line = stdoutbuf->left( pos );
+ insertStdoutLine( line );
+ stdoutbuf->remove
+ ( 0, pos + 1 );
+ }
+}
+
+void KMFProcOut::slotReceivedError( KProcess *, char *buffer, int buflen ) {
+ // Flush stdout buffer
+ if ( !stdoutbuf->isEmpty() ) {
+ insertStdoutLine( *stdoutbuf );
+ stdoutbuf = new QString( "" );
+ }
+
+ *stderrbuf += QString::fromLatin1( buffer, buflen );
+ int pos;
+ while ( ( pos = stderrbuf->find( '\n' ) ) != -1 ) {
+ QString line = stderrbuf->left( pos );
+ insertStderrLine( line );
+ stderrbuf->remove
+ ( 0, pos + 1 );
+ }
+}
+
+void KMFProcOut::slotProcessExited( KProcess * ) {
+ kdDebug() << "KMFProcOut::slotProcessExited()" << endl;
+ emit processExited( childproc );
+ childFinished( childproc->normalExit(), childproc->exitStatus() );
+ return ;
+}
+
+void KMFProcOut::insertStdoutLine( const QString &line ) {
+ m_lbview->append( line + "" );
+}
+
+void KMFProcOut::insertStderrLine( const QString &line ) {
+ const QString & line2 = i18n( "<b>Error:</b> %1" ).arg( line );
+ m_lbview->append( "<font color=\"red\">" + line2 + "</font>" );
+}
+
+void KMFProcOut::childFinished( bool , int status ) {
+ QString stat;
+ stat.setNum( status );
+ const QString& job_name = m_job_name;
+ if ( status != 0 ) {
+ m_lbview->append( i18n( "<br><font color=\"red\"><b>Execution failed</b></font>" ) );
+ m_lbview->append( i18n( "<font color=\"red\"><b>Exit(Code): %1</b></font>" ).arg( stat ) );
+ emit sigJobFinished( false, job_name );
+ } else {
+ m_lbview->append( i18n( "<br><b>Finished successfully</b>" ) );
+ emit sigJobFinished( true, job_name );
+ }
+ m_bkill->setEnabled( false );
+ kdDebug() << "childFinished" << endl;
+ return ;
+}
+
+void KMFProcOut::setText( const QString& str, const QString& commandName ) {
+ kdDebug() << "void KMFProcOut::setText(const QString& text)" << endl;
+// kdDebug() << "Text: " << str << endl;
+ m_ljob_name->setText( commandName );
+ m_lbview->clear();
+ m_lbview->setTextFormat( PlainText );
+ m_lbview->append( str );
+/*
+ QString *text = new QString( str );
+ int pos;
+ while ( ( pos = text->find( '\n' ) ) != -1 && !text->isEmpty() ) {
+ QString line = text->left( pos );
+ insertStdoutLine( line );
+ text->remove( 0, pos + 1 );
+ }*/
+}
+
+}
+
+#include "kmfprocout.moc"
diff --git a/kmyfirewall/kmfwidgets/kmfprocout.h b/kmyfirewall/kmfwidgets/kmfprocout.h
new file mode 100644
index 0000000..64553af
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfprocout.h
@@ -0,0 +1,82 @@
+/***************************************************************************
+ begin : Thu Sep 5 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFPROCOUT_H
+#define KMFPROCOUT_H
+
+// QT includes
+#include <qwidget.h>
+#include <qstring.h>
+#include <qpixmap.h>
+
+// KDE includes
+#include <kprocess.h>
+
+/**
+ *@author Christian Hubinger
+ */
+
+class QLabel;
+class QGridLayout;
+class KPushButton;
+class QTextBrowser;
+namespace KMF {
+class KDE_EXPORT KMFProcOut : public QWidget {
+ Q_OBJECT
+public:
+ KMFProcOut( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFProcOut();
+
+ bool isRunning();
+ void runCmd( const QString& cmd, const QString& job_name, const QString& job_description, bool useKdeSu );
+ void setText( const QString&, const QString& coomandName);
+
+public slots:
+ void slotKillJob();
+
+protected slots:
+ void slotReceivedOutput( KProcess*, char*, int );
+ void slotReceivedError( KProcess*, char*, int );
+ void slotProcessExited( KProcess* );
+
+private:
+
+ void startJob( const QString &dir, bool useKdeSu );
+ // void prepareJob( const QString &dir );
+ void childFinished( bool normal, int status );
+ void insertStderrLine( const QString &line );
+ void insertStdoutLine( const QString &line );
+ void slotSetButtons();
+ void initGUI();
+
+private: // data
+ QString* stderrbuf;
+ QString* stdoutbuf;
+ KProcess* childproc;
+
+ QPixmap icon_stop, icon_close;
+ QString m_job_name;
+ QTextBrowser *m_lbview;
+ QLabel *m_ljob_name;
+ QGridLayout *m_layout;
+ KPushButton *m_bkill;
+
+signals:
+ void processExited( KProcess * );
+ void rowSelected( int row );
+ void sigJobFinished( bool, const QString& );
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfprotocollistview.cpp b/kmyfirewall/kmfwidgets/kmfprotocollistview.cpp
new file mode 100644
index 0000000..fba225d
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfprotocollistview.cpp
@@ -0,0 +1,197 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmfprotocollistview.h"
+
+// QT includes
+#include <qlistview.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qgroupbox.h>
+#include <qwidgetstack.h>
+#include <qtextedit.h>
+#include <qtimer.h>
+
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kcombobox.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kinputdialog.h>
+#include <knuminput.h>
+
+// Project includes
+#include "../core/kmfprotocolcategory.h"
+#include "../core/kmfprotocol.h"
+#include "../core/kmfprotocollibrary.h"
+#include "../core/kmfprotocolusage.h"
+#include "../core/kmfnetzone.h"
+#include "../core/kmfnethost.h"
+#include "../kmfwidgets/kmflistviewitem.h"
+#include "../kmfwidgets/kmfchecklistitem.h"
+namespace KMF {
+KMFProtocolListView::KMFProtocolListView ( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallProtocolListView ( parent,name,fl ) {
+ m_reloading = false;
+ loadProtocols();
+ connect( m_lv_protocols, SIGNAL( pressed( QListViewItem* ) ),
+ this, SLOT( slotNewProtocolSelected( QListViewItem* ) ) );
+
+}
+
+KMFProtocolListView::~KMFProtocolListView() {}
+
+/*$SPECIALIZATION$*/
+void KMFProtocolListView::setHost( KMFNetHost* host ) {
+ setEnabled( true );
+
+ QValueList<KMFProtocol*>& allProts = KMFProtocolLibrary::instance()->allProtocols();
+ QValueList<KMFProtocol*>::iterator it;
+ for( it = allProts.begin(); it != allProts.end(); ++it ) {
+/* QPtrListIterator<KMFProtocol> it( *KMFProtocol::protocolLibrary() );
+ while ( it.current() ) {*/
+ KMFProtocol * prot = *it;
+ QListViewItem *qitem = m_lv_protocols->findItem( prot->name(), 0 );
+ if ( ! qitem ) {
+ kdDebug() << "No item found for protocol: " << prot->name() << endl;
+ }
+
+ KMFCheckListItem *item = dynamic_cast<KMFCheckListItem*>( qitem );
+ if ( ! item ) {
+ kdDebug() << "Item is no KMFCheckListItem" << endl;
+ }
+
+ if ( host->findProtocolUsageByProtocolUuid( prot->uuid() ) ) {
+ item->setOn( true );
+ item->setEnabled( true );
+ }
+ if ( host->protocolInherited( prot->uuid() ) ) {
+ item->setOn( true );
+ item->setEnabled( false );
+ }
+ if ( ! host->findProtocolUsageByProtocolUuid( prot->uuid() ) && ! host->protocolInherited( prot->uuid() ) ) {
+ item->setOn( false );
+ item->setEnabled( true );
+ }
+ }
+}
+void KMFProtocolListView::setZone( KMFNetZone* zone ) {
+ setEnabled( true );
+ QValueList<KMFProtocol*>& allProts = KMFProtocolLibrary::instance()->allProtocols();
+ QValueList<KMFProtocol*>::iterator it;
+ for( it = allProts.begin(); it != allProts.end(); ++it ) {
+ KMFProtocol * prot = *it;
+ QListViewItem *qitem = m_lv_protocols->findItem( prot->name(), 0 );
+ if ( ! qitem ) {
+ kdDebug() << "No item found for protocol: " << prot->name() << endl;
+ }
+
+ KMFCheckListItem *item = dynamic_cast<KMFCheckListItem*>( qitem );
+ if ( ! item ) {
+ kdDebug() << "Item is no KMFCheckListItem" << endl;
+ }
+
+ if ( zone->findProtocolUsageByProtocolUuid( prot->uuid() ) ) {
+ item->setOn( true );
+ item->setEnabled( true );
+ }
+ if ( zone->protocolInherited( prot->uuid() ) ) {
+ item->setOn( true );
+ item->setEnabled( false );
+ }
+ if ( ! zone->findProtocolUsageByProtocolUuid( prot->uuid() ) &&
+ ! zone->protocolInherited( prot->uuid() ) ) {
+ item->setOn( false );
+ item->setEnabled( true );
+ }
+ }
+}
+
+void KMFProtocolListView::loadProtocols() {
+ kdDebug() << "KMFProtocolListView::loadProtocols(" << endl;
+
+ m_reloading = true;
+ QListViewItemIterator listViewIt( m_lv_protocols );
+ while ( listViewIt.current() ) {
+ QListViewItem * qitem = listViewIt.current();
+ ++listViewIt;
+ KMFCheckListItem * item = 0;
+ item = dynamic_cast<KMFCheckListItem*> ( qitem );
+ if( item && item->protocolUsage() ) {
+ item->protocolUsage()->deleteLater();
+ }
+
+ }
+ m_lv_protocols->clear();
+
+
+ setEnabled( false );
+ QValueList<KMFProtocol*>& allProts = KMFProtocolLibrary::instance()->allProtocols();
+ QValueList<KMFProtocol*>::iterator it;
+ for( it = allProts.begin(); it != allProts.end(); ++it ) {
+ KMFProtocol * prot = *it;
+/* disconnect( prot, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolDeleted( QObject* ) ) );
+ connect( prot, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( slotOnProtocolDeleted( QObject* ) ) );*/
+
+ KMFProtocolUsage *protUsage = prot->createUsage();
+ protUsage->setProtocol( prot );
+
+
+
+
+ QString cat = prot->category()->name();
+ QListViewItem *parentItem = m_lv_protocols->findItem( cat, 0 );
+
+ if ( ! parentItem ) {
+ KMFListViewItem *newParentItem = new KMFListViewItem( m_lv_protocols, 0, prot->category() );
+ newParentItem->setText( 0, cat );
+ newParentItem->loadNetfilterObject( prot->category() );
+ newParentItem->setOpen( true );
+ parentItem = newParentItem;
+ }
+
+ KMFCheckListItem *item = new KMFCheckListItem( parentItem, 0 , prot->name() , QCheckListItem::CheckBox, protUsage );
+ item->setText( 0, prot->name() );
+ // item->setText( 1, prot->uuid().toString() );
+ }
+ m_reloading = false;
+}
+
+void KMFProtocolListView::slotOnProtocolDeleted( QObject* ) {
+ if ( m_reloading ) {
+ return;
+ }
+ // loadProtocols();
+}
+
+void KMFProtocolListView::slotNewProtocolSelected( QListViewItem* qitem ) {
+ if ( KMFCheckListItem * item = dynamic_cast<KMFCheckListItem*> ( qitem ) ) {
+ emit sigProtocolClicked( item->protocolUsage(), item->isOn() );
+ } else if ( KMFListViewItem * item = dynamic_cast<KMFListViewItem*> ( qitem ) ){
+ emit sigProtocolCategoryClicked( item->protocolCategory() );
+ }
+}
+
+}
+
+
+#include "kmfprotocollistview.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfprotocollistview.h b/kmyfirewall/kmfwidgets/kmfprotocollistview.h
new file mode 100644
index 0000000..9a21510
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfprotocollistview.h
@@ -0,0 +1,66 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFPROTOCOLLISTVIEW_H
+#define KMFPROTOCOLLISTVIEW_H
+
+#include "kmyfirewallprotocollistview.h"
+
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qguardedptr.h>
+#include <qpixmap.h>
+#include <quuid.h>
+
+
+
+class QListViewItem;
+
+namespace KMF {
+class KMFProtocolUsage;
+class KMFProtocolCategory;
+class KMFNetZone;
+class KMFNetHost;
+
+class KMFProtocolListView : public KMyFirewallProtocolListView {
+ Q_OBJECT
+
+ public:
+ KMFProtocolListView ( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFProtocolListView();
+ /*$PUBLIC_FUNCTIONS$*/
+ void setHost( KMFNetHost* host );
+ void setZone( KMFNetZone* zone );
+ void loadProtocols();
+ public slots:
+ /*$PUBLIC_SLOTS$*/
+
+ protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+ protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void slotNewProtocolSelected( QListViewItem* );
+ void slotOnProtocolDeleted( QObject* );
+
+ private:
+ QGuardedPtr<KMFNetHost> *m_host;
+ QGuardedPtr<KMFNetZone> *m_zone;
+ bool m_reloading;
+
+ signals:
+ void sigProtocolClicked( KMFProtocolUsage*, bool );
+ void sigProtocolCategoryClicked( KMFProtocolCategory* );
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.cpp b/kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.cpp
new file mode 100644
index 0000000..b79e346
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.cpp
@@ -0,0 +1,230 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmfprotocolpropertieswidget.h"
+
+// QT includes
+#include <qlistview.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qgroupbox.h>
+#include <qwidgetstack.h>
+#include <qtextedit.h>
+#include <qframe.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kcombobox.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kinputdialog.h>
+#include <knuminput.h>
+
+// Project Includes
+#include "../core/kmfnethost.h"
+#include "../core/kmfnetzone.h"
+#include "../core/kmfundoengine.h"
+#include "../core/kmfprotocol.h"
+#include "../core/kmfprotocolusage.h"
+#include "../core/kmfprotocolcategory.h"
+namespace KMF {
+KMFProtocolPropertiesWidget::KMFProtocolPropertiesWidget ( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallProtocolPropertiesWidget ( parent,name,fl ) {
+
+ connect( m_cb_limit, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotEnableProtocolLimit( bool ) ) );
+
+ connect( m_sb_limit_rate, SIGNAL( valueChanged( int ) ),
+ this, SLOT( slotSetProtocolLimitRate( int ) ) );
+
+ connect( m_cb_limit_interval, SIGNAL( highlighted( const QString& ) ), this, SLOT( slotSetProtocolLimitInterval( const QString& ) ) );
+
+ connect( m_cb_log, SIGNAL( toggled( bool ) ),
+ this, SLOT( slotEnableProtocolLogging( bool ) ) );
+
+}
+
+KMFProtocolPropertiesWidget::~KMFProtocolPropertiesWidget() {}
+
+/*$SPECIALIZATION$*/
+
+void KMFProtocolPropertiesWidget::slotProtocolDeleted() {
+ m_gb_protocol_option->setEnabled( false );
+ m_gb_protocol_description->setEnabled( true );
+ m_protocolUsage = 0;
+}
+
+void KMFProtocolPropertiesWidget::blockAllSignals( bool onoff ) {
+ m_cb_limit->blockSignals( onoff );
+ m_sb_limit_rate->blockSignals( onoff );
+ m_cb_limit_interval->blockSignals( onoff );
+ m_cb_log->blockSignals( onoff );
+}
+
+void KMFProtocolPropertiesWidget::loadProtocolCategory( KMFProtocolCategory* protCat ) {
+ blockAllSignals( true );
+ m_gb_protocol_option->setEnabled( false );
+ m_gb_protocol_description->setEnabled( true );
+ m_l_protocol_desc->setEnabled( true );
+ QString text = i18n( "<qt><b>Description: </b>%1<br>" ).arg( protCat ->description() );
+ text += "</qt>";
+
+ m_l_protocol_desc->setText( text );
+ blockAllSignals( false );
+}
+
+void KMFProtocolPropertiesWidget::loadProtocol( KMFProtocol* prot ) {
+ blockAllSignals( true );
+ m_gb_protocol_option->setEnabled( false );
+ m_gb_protocol_description->setEnabled( true );
+ m_l_protocol_desc->setEnabled( true );
+ QString text = i18n( "<qt><b>Description: </b>%1<br>" ).arg( prot ->description() );
+ const QString& tcpports = prot->tcpPortsList();
+
+ if ( ! tcpports.isEmpty() ) {
+ text += i18n( "<b>Affected TCP ports: </b>" );
+ text += tcpports;
+ text +="<br>";
+ }
+ const QString& udpports = prot->udpPortsList();
+ if ( ! udpports.isEmpty() ) {
+ text += i18n( "<b>Affected UDP ports: </b>" );
+ text += udpports;
+ }
+ text += "</qt>";
+
+ m_l_protocol_desc->setText( text );
+ blockAllSignals( false );
+}
+
+void KMFProtocolPropertiesWidget::loadProtocolUsage( KMFProtocolUsage* prot ) {
+
+ kdDebug() << "KMFNetHostPropertiesWidget::loadTarget( KMFNetHost* host " << endl;
+ if ( ! prot ) {
+ return;
+ }
+
+ if ( m_protocolUsage ) {
+ disconnect( m_protocolUsage, SIGNAL( destroyed() ),
+ this,SLOT( slotProtocolDeleted() ) );
+ }
+
+ m_protocolUsage = prot;
+ connect( m_protocolUsage, SIGNAL( destroyed() ),
+ this,SLOT( slotProtocolDeleted() ) );
+ setEnabled( true );
+
+ blockAllSignals( true );
+ loadProtocol( m_protocolUsage->protocol() );
+
+ m_gb_protocol_option->setEnabled( true );
+ m_gb_protocol_description->setEnabled( true );
+ m_cb_log->setChecked( m_protocolUsage->logging() );
+ if ( m_protocolUsage ->limit() > 0 ) {
+ m_cb_limit->setChecked( true );
+ m_sb_limit_rate->setValue( m_protocolUsage ->limit() );
+ if ( m_protocolUsage ->limitInterval() == "second" )
+ m_cb_limit_interval->setCurrentItem( 0 );
+ if ( m_protocolUsage ->limitInterval() == "minute" )
+ m_cb_limit_interval->setCurrentItem( 1 );
+ if ( m_protocolUsage ->limitInterval() == "hour" )
+ m_cb_limit_interval->setCurrentItem( 2 );
+ } else {
+ m_cb_limit->setChecked( false );
+ }
+
+ blockAllSignals( false );
+}
+
+void KMFProtocolPropertiesWidget::slotEnableProtocolLimit( bool onoff ) {
+ kdDebug() << "void KMFProtocolPropertiesWidget::slotEnableProtocolLimit( bool )" << endl;
+ if ( ! m_protocolUsage ) {
+ kdDebug() << "WARNING: No Current Protocol activated" << endl;
+ return;
+ }
+ if ( onoff ) {
+ KMFUndoEngine::instance()->startTransaction(
+ m_protocolUsage,
+ i18n("Enable package limit for protocol %1.").arg( m_protocolUsage->name() )
+ );
+ m_protocolUsage->setLimit( m_sb_limit_rate->value() );
+ m_protocolUsage->setLimitInterval( m_cb_limit_interval->currentText() );
+ KMFUndoEngine::instance()->endTransaction();
+ } else {
+ KMFUndoEngine::instance()->startTransaction(
+ m_protocolUsage,
+ i18n("Sisable package limit for protocol %1.").arg( m_protocolUsage->name() )
+ );
+ m_protocolUsage->setLimit( -1 );
+ KMFUndoEngine::instance()->endTransaction();
+ }
+}
+void KMFProtocolPropertiesWidget::slotSetProtocolLimitRate( int rate ){
+ kdDebug() << "void KMFProtocolPropertiesWidget::slotSetProtocolLimitRate( int )" << endl;
+ if ( ! m_protocolUsage ) {
+ kdDebug() << "WARNING: No Current Protocol activated" << endl;
+ return;
+ }
+
+
+ KMFUndoEngine::instance()->startTransaction(
+ m_protocolUsage,
+ i18n("Set package limit for protocol %1 to %2/%3.").arg( m_protocolUsage->name() ).arg( rate ).arg( m_protocolUsage->limitInterval() )
+ );
+ m_protocolUsage->setLimit( rate );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+void KMFProtocolPropertiesWidget::slotSetProtocolLimitInterval( const QString& interval ){
+ kdDebug() << "void KMFProtocolPropertiesWidget::slotSetProtocolLimitInterval( const QString& )" << endl;
+ if ( ! m_protocolUsage ) {
+ kdDebug() << "WARNING: No Current Protocol activated" << endl;
+ return;
+ }
+ if ( interval.isEmpty() ) {
+ return;
+ }
+
+ KMFUndoEngine::instance()->startTransaction(
+ m_protocolUsage,
+ i18n("Set package limit for protocol %1 to %2/%3.").arg( m_protocolUsage->name() ).arg( m_protocolUsage->limit() ).arg( interval )
+ );
+ m_protocolUsage->setLimitInterval( interval );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+void KMFProtocolPropertiesWidget::slotEnableProtocolLogging( bool onoff ){
+ kdDebug() << "void KMFGenericInterfaceProtocol::slotEnableProtocolLogging( bool )" << endl;
+ if ( ! m_protocolUsage ) {
+ kdDebug() << "WARNING: No Current Protocol activated" << endl;
+ return;
+ }
+
+ KMFUndoEngine::instance()->startTransaction(
+ m_protocolUsage,
+ i18n( "%1 logging of dropped packets for protocol %2." ).arg( onoff ? i18n( "Enable" ) : i18n( "Disable" ) ).arg( m_protocolUsage->name() )
+ );
+
+ m_protocolUsage->setLogging( onoff );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+}
+
+#include "kmfprotocolpropertieswidget.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.h b/kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.h
new file mode 100644
index 0000000..d72063b
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfprotocolpropertieswidget.h
@@ -0,0 +1,63 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFPROTOCOLPROPERTIESWIDGET_H
+#define KMFPROTOCOLPROPERTIESWIDGET_H
+
+#include "kmyfirewallprotocolpropertieswidget.h"
+
+
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qguardedptr.h>
+#include <qpixmap.h>
+#include <quuid.h>
+
+namespace KMF {
+class KMFProtocol;
+class KMFProtocolUsage;
+class KMFProtocolCategory;
+
+class KMFProtocolPropertiesWidget : public KMyFirewallProtocolPropertiesWidget {
+ Q_OBJECT
+
+ public:
+ KMFProtocolPropertiesWidget ( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFProtocolPropertiesWidget();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ void loadProtocolUsage( KMFProtocolUsage* );
+ void loadProtocol( KMFProtocol* );
+ void loadProtocolCategory( KMFProtocolCategory* );
+
+ public slots:
+ /*$PUBLIC_SLOTS$*/
+
+ protected:
+ /*$PROTECTED_FUNCTIONS$*/
+ void blockAllSignals( bool );
+
+ protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void slotEnableProtocolLimit( bool );
+ void slotSetProtocolLimitRate( int );
+ void slotSetProtocolLimitInterval( const QString& );
+ void slotEnableProtocolLogging( bool );
+ void slotProtocolDeleted();
+
+ private:
+ QGuardedPtr<KMFProtocolUsage> m_protocolUsage;
+ // QGuardedPtr<KMFProtocolUsage> m_protocol;
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmfqtdesignerplugin.cpp b/kmyfirewall/kmfwidgets/kmfqtdesignerplugin.cpp
new file mode 100644
index 0000000..df65455
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfqtdesignerplugin.cpp
@@ -0,0 +1,73 @@
+//
+// C++ Implementation: kmfqtdesignerplugin
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfqtdesignerplugin.h"
+
+// Qt includes
+
+
+// Prokject includes
+#include "kmfipv4addresswidget.h"
+namespace KMF {
+Q_EXPORT_PLUGIN( KMFQTDesignerPlugin )
+
+KMFQTDesignerPlugin::KMFQTDesignerPlugin()
+ : QWidgetPlugin() {}
+
+
+KMFQTDesignerPlugin::~KMFQTDesignerPlugin() {}
+
+QStringList KMFQTDesignerPlugin::keys() const {
+ QStringList list;
+ list << "KMFIPv4AddressWidget";
+ return list;
+}
+
+QWidget* KMFQTDesignerPlugin::create ( const QString &key, QWidget* parent, const char* name ) {
+ if ( key == "KMFIPv4AddressWidget" )
+ return new KMFIPv4AddressWidget ( parent, name );
+ return 0;
+}
+
+
+QString KMFQTDesignerPlugin::group ( const QString& feature ) const {
+ if ( feature == "KMFIPv4AddressWidget" )
+ return "Input";
+ return QString::null;
+}
+
+QIconSet KMFQTDesignerPlugin::iconSet ( const QString& ) const {
+ return QIconSet ( QPixmap ( "filechooser_pixmap" ) );
+}
+
+QString KMFQTDesignerPlugin::includeFile ( const QString& feature ) const {
+ if ( feature == "KMFIPv4AddressWidget" )
+ return "kmfipv4addresswidget.h";
+ return QString::null;
+}
+
+QString KMFQTDesignerPlugin::toolTip ( const QString& feature ) const {
+ if ( feature == "KMFIPv4AddressWidget" )
+ return "File Chooser Widget";
+ return QString::null;
+}
+
+QString KMFQTDesignerPlugin::whatsThis ( const QString& feature ) const {
+ if ( feature == "KMFIPv4AddressWidget" )
+ return "A widget to change an IPv4 Address";
+ return QString::null;
+}
+
+bool KMFQTDesignerPlugin::isContainer ( const QString& ) const {
+ return FALSE;
+}
+
+}
diff --git a/kmyfirewall/kmfwidgets/kmfqtdesignerplugin.h b/kmyfirewall/kmfwidgets/kmfqtdesignerplugin.h
new file mode 100644
index 0000000..5a2f0ed
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfqtdesignerplugin.h
@@ -0,0 +1,44 @@
+//
+// C++ Interface: kmfqtdesignerplugin
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFQTDESIGNERPLUGIN_H
+#define KMFQTDESIGNERPLUGIN_H
+
+#include <qwidgetplugin.h>
+
+// Qt includes
+#include <qstringlist.h>
+#include <qstring.h>
+#include <qiconset.h>
+#include <qpixmap.h>
+
+// Prokject includes
+/**
+ @author Christian Hubinger <chubinger@irrsinnig.org>
+*/
+namespace KMF {
+class KMFQTDesignerPlugin : public QWidgetPlugin
+{
+public:
+ KMFQTDesignerPlugin();
+ ~KMFQTDesignerPlugin();
+ QStringList keys() const;
+ QWidget* create( const QString &classname, QWidget* parent = 0, const char* name = 0 );
+ QString group( const QString& ) const;
+ QIconSet iconSet( const QString& ) const;
+ QString includeFile( const QString& ) const;
+ QString toolTip( const QString& ) const;
+ QString whatsThis( const QString& ) const;
+ bool isContainer( const QString& ) const;
+
+};
+}
+#endif
diff --git a/kmyfirewall/kmfwidgets/kmfselectactivetarget.cpp b/kmyfirewall/kmfwidgets/kmfselectactivetarget.cpp
new file mode 100644
index 0000000..7802541
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfselectactivetarget.cpp
@@ -0,0 +1,190 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <e9806056@student.tuwien.ac.at>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmfselectactivetarget.h"
+
+// QT includes
+#include <qstring.h>
+#include <qcheckbox.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qdom.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qlistview.h>
+#include <qradiobutton.h>
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#include <qtextedit.h>
+#include <qlabel.h>
+#include <qbuttongroup.h>
+#include <qgroupbox.h>
+#include <qspinbox.h>
+
+// KDE includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kio/netaccess.h>
+#include <kio/job.h>
+#include <ktrader.h>
+#include <klibloader.h>
+#include <klistview.h>
+#include <klistbox.h>
+#include <knuminput.h>
+#include <kpushbutton.h>
+#include <kmessagebox.h>
+#include <ktempfile.h>
+
+// Project includes
+#include "kmflistviewitem.h"
+#include "../version.h"
+#include "../core/kmfnetwork.h"
+#include "../core/kmfdoc.h"
+#include "../core/kmftarget.h"
+
+
+//##### static stuff
+namespace KMF {
+KMFTarget * KMFSelectActiveTarget::selectTarget( KMFNetwork* network, const QString& msg ) {
+ kdDebug() << "KMFTarget * KMFSelectActiveTarget::selectTarget( KMFNetwork* network, const QString& " << msg << " )" << endl;
+ QPtrList<KMFTarget> *list = new QPtrList<KMFTarget>;
+ network->netzone()->getAllTargets( network->netzone(), list );
+ if ( list->count() == 1 ) {
+ return network->currentTarget();
+ }
+
+
+
+ KMFSelectActiveTarget *selTG = new KMFSelectActiveTarget( 0, "KMFSelectActiveTarget",
+ QWidget::WType_Dialog | QWidget::WShowModal
+ );
+ selTG->setMessage( msg );
+ selTG->loadNetwork( network );
+ selTG->exec();
+ KMFTarget *tg = selTG->selectedTarget();
+ if ( tg ) {
+ kdDebug() << "Selected Target: " << tg->guiName() << endl;
+ return tg;
+ }
+ return 0;
+
+}
+
+//##### end static
+
+KMFSelectActiveTarget::KMFSelectActiveTarget ( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : KMyFirewallSelectActiveTarget ( parent,name,modal,fl )
+{
+ m_cmd_ok->setEnabled( false );
+
+ connect( m_lv_zones, SIGNAL( pressed( QListViewItem* ) ) ,
+ this, SLOT( slotNewItemSelected( QListViewItem* ) ) );
+
+ connect( m_lv_zones, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ) ,
+ this, SLOT( slotNewItemDBLClicked( QListViewItem*, const QPoint &, int ) ) );
+
+ connect( m_cmd_cancel, SIGNAL( clicked() ) ,
+ this, SLOT( slotCancel() ) );
+ connect( m_cmd_ok, SIGNAL( clicked() ) ,
+ this, SLOT( slotOk() ) );
+
+ adjustSize();
+}
+
+KMFSelectActiveTarget::~KMFSelectActiveTarget()
+{}
+
+/*$SPECIALIZATION$*/
+
+
+void KMFSelectActiveTarget::loadNetwork( KMFNetwork* net ) {
+ kdDebug() << "KMFSelectActiveTarget::loadNetwork( KMFNetwork* )" << endl;
+ if ( ! net ) {
+ return;
+ }
+ m_network = net;
+ m_lv_zones->clear();
+ KMFListViewItem *it = new KMFListViewItem( m_lv_zones, 0, m_network->netzone() );
+ it->setupZoneView();
+}
+void KMFSelectActiveTarget::setMessage( const QString& msg ) {
+ kdDebug() << "KMFSelectActiveTarget::setMessage( const QString& )" << endl;
+ m_lbl_message->setText( msg );
+}
+void KMFSelectActiveTarget::slotTargetSelected() {
+ kdDebug() << "KMFSelectActiveTarget::slotTargetSelected()" << endl;
+
+
+}
+
+void KMFSelectActiveTarget::slotNewItemDBLClicked( QListViewItem* item, const QPoint &, int ) {
+ slotNewItemSelected( item );
+ if ( m_target ) {
+ slotOk();
+ }
+}
+
+void KMFSelectActiveTarget::slotNewItemSelected( QListViewItem* item ) {
+ kdDebug() << "void KMFMyNetworkWidget::slotNewItemSelected( QListViewItem* item )" << endl;
+ if ( ! item )
+ return ;
+ m_target = 0;
+
+ m_lv_zones->blockSignals( true );
+ m_lv_zones->clearSelection();
+ m_lv_zones->setSelected( item, true );
+ m_lv_zones->blockSignals( false );
+
+ m_cmd_ok->setEnabled( false );
+
+ KMFListViewItem* kmfitem = dynamic_cast<KMFListViewItem*> ( item );
+
+ if ( ! kmfitem ) {
+ kdDebug() << "No Item Selected!" << endl;
+ return;
+ }
+
+ if ( kmfitem != 0 && kmfitem->netfilterObject()->type() == NetfilterObject::KMFTARGET ) {
+ m_target = kmfitem->target();
+ m_lbl_currentTarget->setText( m_target->guiName() );
+ kdDebug() << "Selected Target: " << m_target->guiName() << endl;
+ m_cmd_ok->setEnabled( true );
+ } else {
+ m_lbl_currentTarget->setText( i18n( "No Target Selected" ) );
+ kdDebug() << "No Target Selected" << endl;
+ m_cmd_ok->setEnabled( false );
+ }
+ kdDebug() << "Laving slotNewItemSelected()" << endl;
+}
+
+void KMFSelectActiveTarget::slotCancel() {
+ kdDebug() << "KMFSelectActiveTarget::slotCancel()" << endl;
+ m_target = 0;
+ QDialog::reject();
+}
+void KMFSelectActiveTarget::slotOk() {
+ kdDebug() << "KMFSelectActiveTarget::slotOk()" << endl;
+ QDialog::accept();
+}
+
+KMFTarget *KMFSelectActiveTarget::selectedTarget() {
+ kdDebug() << "KMFSelectActiveTarget::slectedTarget()" << endl;
+ return m_target;
+}
+
+}
+
+#include "kmfselectactivetarget.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfselectactivetarget.h b/kmyfirewall/kmfwidgets/kmfselectactivetarget.h
new file mode 100644
index 0000000..426e17f
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfselectactivetarget.h
@@ -0,0 +1,61 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <e9806056@student.tuwien.ac.at>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFSELECTACTIVETARGET_H
+#define KMFSELECTACTIVETARGET_H
+
+#include "kmyfirewallselectactivetarget.h"
+
+// QT Includes
+#include <qstring.h>
+#include <qguardedptr.h>
+#include <qpoint.h>
+class QListViewItem;
+
+namespace KMF {
+class KMFNetwork;
+class KMFTarget;
+
+class KMFSelectActiveTarget : public KMyFirewallSelectActiveTarget
+{
+ Q_OBJECT
+ public: static KMFTarget* selectTarget( KMFNetwork* network, const QString& msg );
+
+ public:
+ KMFSelectActiveTarget ( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~KMFSelectActiveTarget();
+ /*$PUBLIC_FUNCTIONS$*/
+ void loadNetwork( KMFNetwork* );
+ void setMessage( const QString& );
+ KMFTarget *selectedTarget();
+
+ public slots:
+ /*$PUBLIC_SLOTS$*/
+ void slotTargetSelected();
+ void slotNewItemSelected( QListViewItem* item );
+ void slotNewItemDBLClicked( QListViewItem*, const QPoint &, int );
+ void slotCancel();
+ void slotOk();
+
+ protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+ protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+ private: // DATA
+ KMFNetwork *m_network;
+ QGuardedPtr<KMFTarget> m_target;
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmfselectinterface.cpp b/kmyfirewall/kmfwidgets/kmfselectinterface.cpp
new file mode 100644
index 0000000..96bb3d1
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfselectinterface.cpp
@@ -0,0 +1,117 @@
+//
+// C++ Implementation: %{MODULE}
+//
+// Description:
+//
+//
+// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include "kmfselectinterface.h"
+
+// QT includes
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qcolor.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <kcombobox.h>
+#include <kpushbutton.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kglobal.h>
+#include <kapplication.h>
+
+// Project Includes
+#include "../core/kmfconfig.h"
+namespace KMF {
+KMFSelectInterface::KMFSelectInterface( QWidget *parent, const char *name, bool modal, WFlags fl )
+ : KMyFirewallSelectInterface( parent, name, modal, fl ) {
+ m_cob_interface->setBackgroundMode( PaletteBase, PaletteBase );
+// m_opt_showOnStartup->setBackgroundMode( PaletteButton );
+ m_cob_interface->setBackgroundColor( QColor( 204, 0, 49 ) );
+ m_descs << i18n("<qt><p>The generic interface provides an easy-to-use tool for setting up common personal firewalls or simple network routers.</p></qt>");
+ m_cob_interface->insertItem( i18n("Generic Interface") );
+ m_lbl_descripton->setText( *m_descs.at( 0 ) );
+
+ m_descs << i18n("<qt><p>The IPTable interface is meant to be used by advanced users who like to have full control over the rules generated; as such, the IPTables interface provides an almost 1-1 view on your iptables configuration.</p></qt>");
+ m_cob_interface->insertItem( i18n("IPTables Interface") );
+ KStandardDirs dir;
+ QString filename = dir.findResource( "data", "kmyfirewall/pics/kmf_snapshot_generic_interface.png" );
+ QPixmap *p = new QPixmap( filename );
+ m_pic_screenshot->setPixmap( *p );
+
+
+
+
+
+
+ connect( m_cob_interface, SIGNAL( activated( int ) ), this, SLOT( slotInterfaceChanged( int ) ) );
+ connect( m_cmd_ok, SIGNAL( clicked() ) , this, SLOT( accept() ) );
+ connect( m_cmd_help, SIGNAL( clicked() ) , this, SLOT( help() ) );
+ connect( b_close, SIGNAL( clicked() ) , this, SLOT( reject() ) );
+
+ adjustSize();
+}
+
+KMFSelectInterface::~KMFSelectInterface() {}
+
+/*$SPECIALIZATION$*/
+void KMFSelectInterface::slotInterfaceChanged( int index ) {
+ kdDebug() << "KMFSelectInterface::slotInterfaceChanged( int index )" << endl;
+ m_lbl_descripton->setText( *m_descs.at( index ) );
+
+ KStandardDirs dir;
+ QString filename = "";
+ switch ( index ) {
+ case 0:
+ filename = dir.findResource( "data", "kmyfirewall/pics/kmf_snapshot_generic_interface.png" );
+ break;
+ case 1:
+ filename = dir.findResource( "data", "kmyfirewall/pics/kmf_snapshot_iptables_interface.png" );
+ break;
+ }
+ QPixmap *p = new QPixmap( filename );
+ m_pic_screenshot->setPixmap( *p );
+}
+
+void KMFSelectInterface::accept() {
+ kdDebug() << "KMFSelectInterface::accept()" << endl;
+ kdDebug() << "Found item: " << m_cob_interface->currentItem() << endl;
+ switch ( m_cob_interface->currentItem() ) {
+ case 0:
+ KMFConfig::setUseGenericInterface( true );
+// Config().m_useGenericInterface = true;
+ break;
+ case 1:
+ KMFConfig::setUseGenericInterface( false );
+// Config().m_useGenericInterface = false;
+ break;
+ default:
+ KMFConfig::setUseGenericInterface( true );
+// Config().m_useGenericInterface = true;
+ }
+ KMFConfig::setShowSelInterface( ! m_opt_showOnStartup->isChecked() );
+// Config().m_show_selInterface = ! m_opt_showOnStartup->isChecked();
+// Config().write();
+ KMFConfig::self()->writeConfig();
+ QDialog::accept();
+}
+
+void KMFSelectInterface::help() {
+ kapp->invokeHelp( "gui_interfaces" );
+}
+
+void KMFSelectInterface::reject(){
+ QDialog::reject();
+}
+
+}
+
+#include "kmfselectinterface.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfselectinterface.h b/kmyfirewall/kmfwidgets/kmfselectinterface.h
new file mode 100644
index 0000000..b275ac5
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfselectinterface.h
@@ -0,0 +1,53 @@
+//
+// C++ Interface: %{MODULE}
+//
+// Description:
+//
+//
+// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFSELECTINTERFACE_H
+#define KMFSELECTINTERFACE_H
+
+#include "kmyfirewallselectinterface.h"
+
+// QT Includes
+#include <qstringlist.h>
+
+// KDE Includes
+#include <kdemacros.h>
+
+// Project Includes
+
+
+namespace KMF {
+class KDE_EXPORT KMFSelectInterface : public KMyFirewallSelectInterface {
+ Q_OBJECT
+
+public:
+ KMFSelectInterface( QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags fl = 0 );
+ ~KMFSelectInterface();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void slotInterfaceChanged( int );
+ void accept();
+ void help();
+ void reject();
+private: // DATA
+ QStringList m_descs;
+
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmfsystemsettingslinux.cpp b/kmyfirewall/kmfwidgets/kmfsystemsettingslinux.cpp
new file mode 100644
index 0000000..2eab94b
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfsystemsettingslinux.cpp
@@ -0,0 +1,189 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmfsystemsettingslinux.h"
+
+
+// QT Includes
+#include <qlabel.h>
+
+// KDE includes
+#include <klocale.h>
+#include <kcombobox.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kurlrequester.h>
+#include <kguiitem.h>
+#include <kpushbutton.h>
+#include <knuminput.h>
+#include <klistbox.h>
+#include <kcombobox.h>
+#include <kiconloader.h>
+#include <kglobal.h>
+#include <kmessagebox.h>
+#include <klistview.h>
+
+// Prokject includes
+#include "../core/kmftarget.h"
+#include "../core/kmftargetconfig.h"
+#include "../core/kmfundoengine.h"
+namespace KMF {
+KMFSystemSettingsLinux::KMFSystemSettingsLinux(QWidget* parent, const char* name, WFlags fl)
+: KMyFirewallSystemSettingsLinux(parent,name,fl)
+{
+ m_url_ipt_path->setMode( KFile::Files | KFile::LocalOnly );
+ m_url_mod_path->setMode( KFile::Files | KFile::LocalOnly );
+ m_url_init_path->setMode( KFile::Directory | KFile::LocalOnly );
+ m_url_runlevel_path->setMode( KFile::Directory | KFile::LocalOnly );
+
+ connect( m_url_ipt_path, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( slotSettingChanged() ) );
+ connect( m_url_mod_path, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( slotSettingChanged() ) );
+ connect( m_url_init_path, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( slotSettingChanged() ) );
+ connect( m_url_runlevel_path, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( slotSettingChanged() ) );
+ connect( m_cob_distribution, SIGNAL( activated( const QString& ) ),
+ this, SLOT( slotDistributionChanged() ) );
+}
+
+KMFSystemSettingsLinux::~KMFSystemSettingsLinux()
+{
+}
+
+
+/*$SPECIALIZATION$*/
+void KMFSystemSettingsLinux::loadTarget( KMFTarget* target ) {
+ kdDebug() << "KMFInterfaceWidget::loadTarget( KMFTarget* target )" << endl;
+ m_target = target;
+ updateView();
+}
+
+void KMFSystemSettingsLinux::updateView(){
+ kdDebug() << "KMFInterfaceWidget::updateView()" << endl;
+ if ( ! m_target ) {
+ kdDebug() << "KMFInterfaceWidget::updateView() - ERROR: m_target == 0 " << endl;
+ return;
+ }
+ KMFTargetConfig *conf = m_target->config();
+
+ kdDebug() << "KMFInterfaceWidget::updateView() - config: " << endl;
+ kdDebug() << conf->toString() << endl;
+
+ m_url_ipt_path->blockSignals( true );
+ m_url_mod_path->blockSignals( true );
+ m_url_init_path->blockSignals( true );
+ m_url_runlevel_path->blockSignals( true );
+
+ if ( conf->distribution() == "sysv" ) {
+ m_cob_distribution->setCurrentItem( 0 );
+ } else if ( conf->distribution() == "gentoo" ) {
+ m_cob_distribution->setCurrentItem( 1 );
+ } else if ( conf->distribution() == "slackware" ) {
+ m_cob_distribution->setCurrentItem( 2 );
+ }
+ slotDistributionChanged();
+
+
+
+ kdDebug() << "set conf->IPTPath()" << conf->IPTPath() << endl;
+ m_url_ipt_path->setURL( conf->IPTPath() );
+
+ kdDebug() << "set conf->modprobePath()" << conf->modprobePath() << endl;
+ m_url_mod_path->setURL( conf->modprobePath() );
+
+ kdDebug() << "set conf->initPath()" << conf->initPath() << endl;
+ m_url_init_path->setURL( conf->initPath() );
+
+ kdDebug() << "set conf->rcDefaultPath()" << conf->rcDefaultPath() << endl;
+ m_url_runlevel_path->setURL( conf->rcDefaultPath() );
+
+ m_url_ipt_path->blockSignals( false );
+ m_url_mod_path->blockSignals( false );
+ m_url_init_path->blockSignals( false );
+ m_url_runlevel_path->blockSignals( false );
+}
+
+void KMFSystemSettingsLinux::slotDistributionChanged() {
+ KMFTargetConfig *conf = m_target->config();
+ switch ( m_cob_distribution->currentItem() ) {
+ case 0:
+ conf->setDistribution( "sysv" );
+ m_url_init_path->setShown( true );
+ m_lab_init_path->setShown( true );
+ return;
+ break;
+
+ case 1:
+ conf->setDistribution( "gentoo" );
+ m_url_runlevel_path->setURL( "/etc/runlevels/default/" );
+ m_url_ipt_path->setURL( "/sbin/iptables" );
+ m_url_mod_path->setURL( "/sbin/modprobe" );
+ m_url_init_path->setURL( "/etc/init.d/" );
+ m_url_init_path->setShown( true );
+ m_lab_init_path->setShown( true );
+ break;
+
+ case 2:
+ conf->setDistribution( "slackware" );
+ m_url_runlevel_path->setURL( "/etc/rc.d/" );
+ m_url_ipt_path->setURL( "/usr/sbin/iptables" );
+ m_url_mod_path->setURL( "/usr/sbin/modprobe" );
+ m_url_init_path->setShown( false );
+ m_lab_init_path->setShown( false );
+ break;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ conf,
+ i18n( "Change system settings of target: %1" ).arg( conf->target()->guiName() )
+ );
+ conf->setIPTPath( m_url_ipt_path->url() );
+ conf->setModprobePath( m_url_mod_path->url() );
+ conf->setInitPath( m_url_init_path->url() );
+ conf->setRcDefaultPath( m_url_runlevel_path->url() );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+void KMFSystemSettingsLinux::slotSettingChanged() {
+ kdDebug() << "KMFInterfaceWidget::slotSettingChanged()" << endl;
+ KMFTargetConfig *conf = m_target->config();
+ switch ( m_cob_distribution->currentItem() ) {
+ case 0:
+ conf->setDistribution( "sysv" );
+ break;
+
+ case 1:
+ conf->setDistribution( "gentoo" );
+ break;
+
+ case 2:
+ conf->setDistribution( "slackware" );
+ break;
+ }
+ KMFUndoEngine::instance()->startTransaction(
+ conf,
+ i18n( "Change system settings of target: %1" ).arg( conf->target()->guiName() )
+ );
+ conf->setIPTPath( m_url_ipt_path->url() );
+ conf->setModprobePath( m_url_mod_path->url() );
+ conf->setInitPath( m_url_init_path->url() );
+ conf->setRcDefaultPath( m_url_runlevel_path->url() );
+ KMFUndoEngine::instance()->endTransaction();
+}
+
+}
+
+#include "kmfsystemsettingslinux.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmfsystemsettingslinux.h b/kmyfirewall/kmfwidgets/kmfsystemsettingslinux.h
new file mode 100644
index 0000000..ed8331a
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmfsystemsettingslinux.h
@@ -0,0 +1,57 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2006
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFSYSTEMSETTINGSLINUX_H
+#define KMFSYSTEMSETTINGSLINUX_H
+
+#include "kmyfirewallsystemsettingslinux.h"
+
+#include <qstring.h>
+
+#include <qguardedptr.h>
+
+namespace KMF {
+class KMFTarget;
+
+class KMFSystemSettingsLinux : public KMyFirewallSystemSettingsLinux
+{
+ Q_OBJECT
+
+public:
+ KMFSystemSettingsLinux(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFSystemSettingsLinux();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ void loadTarget( KMFTarget* target );
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+ void updateView();
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void slotSettingChanged();
+ void slotDistributionChanged();
+
+ signals:
+ void sigTargetChanged();
+
+private:
+ QGuardedPtr<KMFTarget> m_target;
+
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmftemplatechooser.cpp b/kmyfirewall/kmfwidgets/kmftemplatechooser.cpp
new file mode 100644
index 0000000..2d989bb
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmftemplatechooser.cpp
@@ -0,0 +1,154 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+// License: GPL
+//
+
+// Qt includes
+#include <qlistbox.h>
+#include <qfile.h>
+#include <qdom.h>
+#include <qlabel.h>
+#include <qdir.h>
+#include <qpushbutton.h>
+
+// KDE includes
+#include <kstandarddirs.h>
+#include <kglobal.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+
+// project includes
+#include "../core/kmfconfig.h"
+#include "xmlnames.h"
+
+#include "kmftemplatechooser.h"
+namespace KMF {
+KMFTemplateChooser::KMFTemplateChooser(QWidget* parent, const char* name, bool modal, WFlags fl) : KMyFirewallTemplateChooser(parent,name, modal,fl) {
+ connect( lb_templates, SIGNAL( highlighted ( int ) ),
+ this, SLOT( slotNewTemplateSelected( int ) ) );
+ connect( lb_templates, SIGNAL( doubleClicked( QListBoxItem* ) ),
+ this, SLOT( slotNewTemplateSelected( QListBoxItem* ) ) );
+ connect( b_help, SIGNAL( clicked() ),
+ this, SLOT( slotHelp() ) );
+
+ parseTemplates();
+ b_accept->setEnabled( false );
+}
+
+KMFTemplateChooser::~KMFTemplateChooser() {}
+
+/*$SPECIALIZATION$*/
+void KMFTemplateChooser::reject() {
+ QDialog::reject();
+}
+
+void KMFTemplateChooser::accept() {
+ if ( lb_templates->currentItem() == -1 ) {
+ KMessageBox::error( this, i18n("No Template selected.") );
+ return;
+ }
+ if ( *m_templateFilePaths.at( lb_templates->currentItem() ) == "-1" ) {
+ // emit sigLoadEmptyDocument();
+ } else {
+ emit sigLoadTemplate( *m_templateFilePaths.at( lb_templates->currentItem() ) );
+ }
+ QDialog::accept();
+}
+
+void KMFTemplateChooser::slotHelp() {
+ // kdDebug() << "void KMFTemplateChooser::slotHelp()" << endl;
+ kapp->invokeHelp();
+}
+
+void KMFTemplateChooser::slotNewTemplateSelected( QListBoxItem* i ){
+ // kdDebug() << "void KMFTemplateChooser::slotNewTemplateSelected( " << index << " )" << endl;
+ slotNewTemplateSelected( lb_templates->index( i ) );
+ accept();
+}
+
+void KMFTemplateChooser::slotNewTemplateSelected( int index ){
+ // kdDebug() << "void KMFTemplateChooser::slotNewTemplateSelected( " << index << " )" << endl;
+ b_accept->setEnabled( true );
+ lbl_description->setText( *m_templateDescriptions.at( index ) );
+}
+
+
+
+void KMFTemplateChooser::parseTemplates(){
+ lb_templates->clear();
+ lbl_description->clear();
+
+ // Add Empty template
+ lb_templates->insertItem( i18n("Empty Ruleset") );
+ m_templateFilePaths.append( "-1" );
+ if ( KMFConfig::useGenericInterface() ) {
+ m_templateDescriptions.append( i18n("Clean Ruleset that does only setup connection tracking e.g block everything not related to connections you initialised.") );
+ } else {
+ m_templateDescriptions.append( i18n("Clean Ruleset that does not do anything. Use this if you like to setup your firewall from scratch.") );
+ }
+
+ KStandardDirs std_dir;
+ QString tmp_dir = std_dir.findResourceDir( "data", "kmyfirewall/templates/" );
+
+ QDir dir( tmp_dir + "/kmyfirewall/templates/" );
+ kdDebug() << "Found Data dir at: " << dir.path() << endl;
+ QString type;
+ if ( KMFConfig::useGenericInterface() ) {
+ type = "*.tkmfgrs";
+ } else {
+ type = "*.tkmfrs";
+ }
+ QStringList templates = dir.entryList( type );
+ if ( templates.isEmpty() ) {
+ KMessageBox::information( this, i18n("No templates (%1) could be found; please check your installation.").arg( type ) );
+ return;
+ }
+ for ( QStringList::Iterator it = templates.begin(); it != templates.end(); ++it ) {
+ parseFile( dir.path() + "/" + *it );
+ }
+}
+
+void KMFTemplateChooser::parseFile( const QString& file ) {
+ // kdDebug() << "Parsing Template: " << file << endl;
+ QFile f( file );
+
+ if ( !f.open( IO_ReadOnly ) ) {
+ KMessageBox::information( this, i18n("Template %1 could not be opened.").arg( file ) );
+ return;
+ }
+
+ QDomDocument doc;
+ if ( !doc.setContent( &f ) ) {
+ f.close();
+ KMessageBox::information( this, i18n("Template %1 is not a valid XML document.").arg( file ) );
+ return;
+ }
+
+ QDomElement root = doc.documentElement();
+ QDomNodeList list = root.elementsByTagName ( XML::Abstract_Element );
+ if ( list.count() == 0 ) {
+ KMessageBox::information( this, i18n("Template %1 does not contain the \"abstract\" tag.").arg( file ) );
+ return;
+ }
+ QDomNode node = list.item( 0 );
+ QString desc = node.toElement().attribute( XML::Description_Attribute );
+ QString name = node.toElement().attribute( XML::Name_Attribute );
+ lb_templates->insertItem( name );
+ m_templateFilePaths.append( file );
+ m_templateDescriptions.append( desc );
+}
+
+}
+
+#include "kmftemplatechooser.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmftemplatechooser.h b/kmyfirewall/kmfwidgets/kmftemplatechooser.h
new file mode 100644
index 0000000..7a25ef0
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmftemplatechooser.h
@@ -0,0 +1,72 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+// License: GPL
+//
+
+#ifndef KMFTEMPLATECHOOSER_H
+#define KMFTEMPLATECHOOSER_H
+
+#include "kmyfirewalltemplatechooser.h"
+
+// Qt includes
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+
+// KDE includes
+#include <kdemacros.h>
+
+// project includes
+
+
+class QListBoxItem;
+namespace KMF {
+class KDE_EXPORT KMFTemplateChooser : public KMyFirewallTemplateChooser {
+ Q_OBJECT
+
+public:
+ KMFTemplateChooser(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~KMFTemplateChooser();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ void setFileExtention( const QString& = "kmfrs" );
+
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ void parseTemplates();
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void reject();
+ virtual void accept();
+ void slotHelp();
+ void slotNewTemplateSelected( int );
+ void slotNewTemplateSelected( QListBoxItem* );
+
+private:
+
+ void parseFile( const QString& );
+
+private: // data
+ QStringList m_templateDescriptions;
+ QStringList m_templateFilePaths;
+
+signals:
+ void sigLoadTemplate( const QString& );
+ void sigLoadEmptyDocument();
+
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmftransactionlog.cpp b/kmyfirewall/kmfwidgets/kmftransactionlog.cpp
new file mode 100644
index 0000000..79f9e4b
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmftransactionlog.cpp
@@ -0,0 +1,278 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "kmftransactionlog.h"
+
+// QT includes
+#include <qstring.h>
+#include <qvaluelist.h>
+#include <qlistview.h>
+#include <qptrlist.h>
+#include <qtimer.h>
+#include <qtextedit.h>
+#include <qtextstream.h>
+#include <qtextbrowser.h>
+
+// KDE includes
+#include <klistview.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kpushbutton.h>
+#include <kpopupmenu.h>
+#include <kprocess.h>
+#include <ktempfile.h>
+
+// project includes
+#include "../core/netfilterobject.h"
+#include "../core/kmfundoengine.h"
+#include "../core/kmftransaction.h"
+namespace KMF {
+KMFTransactionLog* KMFTransactionLog::s_instance = 0;
+KMFTransactionLog* KMFTransactionLog::instance() {
+ if ( ! s_instance ) {
+ s_instance = new KMFTransactionLog( 0, "", 0 );
+
+ }
+
+ return s_instance;
+}
+
+KMFTransactionLog::KMFTransactionLog ( QWidget* parent, const char* name, WFlags fl ) : KMyFirewallTransactionLog ( parent,name,fl ) {
+ m_contextMenu = new KPopupMenu( this, "m_contextMenu" );
+ m_currentTransaction = 0;
+ m_undoXMLFile = new KTempFile();
+ m_undoXMLFile->setAutoDelete( true );
+ m_redoXMLFile = new KTempFile();
+ m_redoXMLFile->setAutoDelete( true );
+
+ connect( m_cmd_clearStacks, SIGNAL( clicked() ),
+ this, SLOT( slotClearStacks() ) );
+ connect( m_cmd_clearLog, SIGNAL( clicked() ),
+ this, SLOT( slotClearLog() ) );
+
+ connect( KMFUndoEngine::instance(), SIGNAL( sigStackChanged() ),
+ this, SLOT( slotUpdateView() ) );
+
+ connect( KMFUndoEngine::instance(), SIGNAL( sigLog( const QString& ) ),
+ this, SLOT( slotLog( const QString& ) ) );
+
+ connect( m_lvUndoTransactions, SIGNAL( contextMenuRequested ( QListViewItem*, const QPoint&, int ) ),
+ this, SLOT( slotZoneRBM( QListViewItem*, const QPoint&, int ) ) );
+
+ connect( m_lvRedoTransactions, SIGNAL( contextMenuRequested ( QListViewItem*, const QPoint&, int ) ),
+ this, SLOT( slotZoneRBM( QListViewItem*, const QPoint&, int ) ) );
+
+ connect( m_cmd_update, SIGNAL( clicked() ),
+ this, SLOT( slotUpdateStatistics() ) );
+
+ m_lvUndoTransactions->setSorting(-1);
+ m_lvUndoTransactions->setSortColumn(-1);
+
+ m_lvRedoTransactions->setSorting(-1);
+ m_lvRedoTransactions->setSortColumn(-1);
+}
+
+KMFTransactionLog::~KMFTransactionLog() {}
+
+void KMFTransactionLog::slotUpdateStatistics() {
+ kdDebug() << "KMFTransactionLog::slotUpdateStatistics()" << endl;
+ m_txt_stats->setText( "" );
+
+ m_txt_stats->append ( "Object count: " + QString::number( NetfilterObject::objectCount( -1 ) ) );
+ m_txt_stats->append ( "\n" );
+
+ m_txt_stats->append ( "KMFNETWORKs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::KMFNETWORK ) ) );
+
+ m_txt_stats->append ( "IPTABLES_RULESETs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::IPTABLES_RULESET ) ) );
+ m_txt_stats->append ( "GENERIC_RULESETs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::GENERIC_RULESET ) ) );
+
+ m_txt_stats->append ( "TABLEs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::TABLE ) ) );
+ m_txt_stats->append ( "CHAINs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::CHAIN ) ) );
+ m_txt_stats->append ( "RULEs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::RULE ) ) );
+ m_txt_stats->append ( "RULEOPTIONs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::RULEOPTION ) ) );
+ m_txt_stats->append ( "PROTOCOLs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::PROTOCOL ) ) );
+ m_txt_stats->append ( "NETZONEs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::NETZONE ) ) );
+ m_txt_stats->append ( "NETHOSTs: " +QString::number( NetfilterObject::objectCount( NetfilterObject::NETHOST ) ) );
+ m_txt_stats->append ( "KMFTARGETs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::KMFTARGET ) ) );
+ m_txt_stats->append ( "KMFTARGETCONFIGs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::KMFTARGETCONFIG ) ) );
+ m_txt_stats->append ( "PROTOCOLUSAGEs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::PROTOCOLUSAGE ) ) );
+
+
+ m_txt_stats->append ( "PROTOCOLCATEGORYs: " + QString::number( NetfilterObject::objectCount( NetfilterObject::PROTOCOLCATEGORY ) ) );
+}
+
+void KMFTransactionLog::slotZoneRBM( QListViewItem* item, const QPoint& point, int ) {
+ if ( ! item ) {
+ kdDebug() << "No item Setelcted" << endl;
+ m_currentTransaction = 0;
+ return;
+ }
+
+
+ QUuid uid( item->text( 1 ) );
+ KMFTransaction *t = KMFUndoEngine::instance()->findTransction( uid );
+ if ( ! t ) {
+ m_currentTransaction = 0;
+ return;
+ }
+
+ m_currentTransaction = t;
+ m_contextMenu->clear();
+ QString name = i18n("Transaction: %1").arg( m_currentTransaction->uuid().toString() );
+ // QString lab_str = i18n("Zone: %1").arg( m_zone->guiName() );
+ m_contextMenu->insertTitle( name );
+ m_contextMenu->insertItem( i18n( "Show XML diff using Kompare" ), this, SLOT( slotShowDiff() ) );
+ m_contextMenu->popup( point );
+
+ if ( m_undoXMLFile ) {
+ m_undoXMLFile->unlink();
+ delete m_undoXMLFile;
+ m_undoXMLFile = 0;
+ }
+ if ( m_redoXMLFile ) {
+ m_redoXMLFile->unlink();
+ delete m_redoXMLFile;
+ m_redoXMLFile = 0;
+ }
+ m_undoXMLFile = new KTempFile();
+ m_undoXMLFile->setAutoDelete( true );
+ m_redoXMLFile = new KTempFile();
+ m_redoXMLFile->setAutoDelete( true );
+
+ QTextStream& sUndo = *m_undoXMLFile->textStream();
+ sUndo << m_currentTransaction->undoXML();
+ m_undoXMLFile->sync();
+
+ QTextStream& sRedo = *m_redoXMLFile->textStream();
+ sRedo << m_currentTransaction->redoXML();
+ m_redoXMLFile->sync();
+}
+
+void KMFTransactionLog::slotShowDiff() {
+ kdDebug() << "KMFTransactionLog::slotShowDiff()" << endl;
+ if ( ! m_currentTransaction ) {
+ return;
+ }
+
+ KProcess* childproc = new KProcess();
+ kdDebug() << "kompare " << m_undoXMLFile->name() << m_redoXMLFile->name() << endl;
+ *childproc << "kompare" << m_undoXMLFile->name() << m_redoXMLFile->name();
+ childproc->start( KProcess::NotifyOnExit, KProcess::NoCommunication );
+}
+
+void KMFTransactionLog::slotKompareExited( KProcess* ) {
+}
+
+void KMFTransactionLog::slotClearStacks() {
+ KMFUndoEngine::instance()->clearStacks();
+ slotUpdateView();
+}
+
+void KMFTransactionLog::slotClearLog() {
+ m_txt_transactionLog->clear();
+}
+void KMFTransactionLog::slotLog( const QString& msg ) {
+ m_txt_transactionLog->append( msg );
+}
+
+void KMFTransactionLog::slotUpdateView() {
+// kdDebug() << "KMFTransactionLog::updateView()" << endl;
+ KListViewItem* last = 0;
+ QValueList< KMFTransaction* > undos = KMFUndoEngine::instance()->undoTransactions();
+ QValueList< KMFTransaction* >::iterator itUndo;
+ for ( itUndo = undos.begin(); itUndo != undos.end(); ++itUndo ) {
+ KMFTransaction* trans = *itUndo;
+ last = setupListItem( trans, m_lvUndoTransactions, last );
+ }
+
+ QPtrList<QListViewItem>* del = new QPtrList<QListViewItem>;
+ del->setAutoDelete( true );
+ QListViewItem* item = m_lvUndoTransactions->firstChild();
+ while( item ) {
+ bool found = false;
+ for ( itUndo = undos.begin(); itUndo != undos.end(); ++itUndo ) {
+ KMFTransaction* trans = *itUndo;
+ if ( trans->uuid().toString() == item->text( 1 ) ) {
+ found = true;
+ }
+ }
+ if ( ! found ) {
+ del->append( item );
+ }
+ item = item->nextSibling();
+ }
+ del->clear();
+
+ last = 0;
+ QValueList< KMFTransaction* > redos = KMFUndoEngine::instance()->redoTransactions();
+ QValueList< KMFTransaction* >::iterator itRedo;
+ for ( itRedo = redos.begin(); itRedo != redos.end(); ++itRedo ) {
+ KMFTransaction* trans = *itRedo;
+ last = setupListItem( trans, m_lvRedoTransactions,last );
+ }
+
+ item = m_lvRedoTransactions->firstChild();
+ while( item ) {
+ bool found = false;
+ for ( itRedo = redos.begin(); itRedo != redos.end(); ++itRedo ) {
+ KMFTransaction* trans = *itRedo;
+ if ( trans->uuid().toString() == item->text( 1 ) ) {
+ found = true;
+ }
+ }
+ if ( ! found ) {
+ del->append( item );
+ }
+ item = item->nextSibling();
+ }
+ del->clear();
+}
+
+KListViewItem* KMFTransactionLog::setupListItem( KMFTransaction* trans, KListView* list, KListViewItem* after ) {
+ // kdDebug() << "Search transaction: " << trans->uuid().toString() << endl;
+ QListViewItem* found = 0;
+
+ found = list->findItem ( trans->uuid().toString(), 1 );
+ if ( found ) {
+ return (KListViewItem*) found;
+ }
+ // kdDebug() << "No Item Found" << endl;
+
+
+ KListViewItem* item = new KListViewItem( list, after );
+ item->setText( 0, trans->name() );
+ item->setText( 1, trans->uuid().toString() );
+
+ KListViewItem* last = 0;
+/* QValueList<int>& objectIds = trans->objectIDs();
+ QValueList<int>::iterator it;
+
+ for ( it = objectIds.begin(); it != objectIds.end(); ++it ) {*/
+ QString obj_uuid = trans->objectUuid().toString();
+ KListViewItem* itemID = new KListViewItem( item, last, "", obj_uuid );
+ last = itemID;
+ NetfilterObject *obj = 0;
+ obj = NetfilterObject::findObject ( obj_uuid );
+ if ( obj ) {
+ itemID->setText( 0, i18n("Object: %1").arg( obj->name() ) );
+ // itemID->setText( 2, obj->name() );
+ // itemID->setText( 3, obj->getXMLSniplet() );
+ }
+// }
+ return item;
+}
+
+}
+
+#include "kmftransactionlog.moc"
+
diff --git a/kmyfirewall/kmfwidgets/kmftransactionlog.h b/kmyfirewall/kmfwidgets/kmftransactionlog.h
new file mode 100644
index 0000000..fe8b432
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmftransactionlog.h
@@ -0,0 +1,72 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef KMFTRANSACTIONLOG_H
+#define KMFTRANSACTIONLOG_H
+
+#include "kmyfirewalltransactionlog.h"
+
+class KPopupMenu;
+class KProcess;
+class KTempFile;
+class KListView;
+class KListViewItem;
+
+namespace KMF {
+class KMFTransaction;
+
+
+class KMFTransactionLog : public KMyFirewallTransactionLog
+{
+ Q_OBJECT
+
+ public: static KMFTransactionLog* instance();
+
+ public:
+
+ ~KMFTransactionLog();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ public slots:
+ /*$PUBLIC_SLOTS$*/
+ void slotUpdateView();
+
+ protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+ protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void slotUpdateStatistics();
+ void slotClearStacks();
+ void slotClearLog();
+ void slotLog( const QString& );
+ void slotZoneRBM( QListViewItem*, const QPoint&, int );
+ void slotShowDiff();
+ void slotKompareExited( KProcess* );
+ private:
+ KMFTransactionLog ( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ KListViewItem* setupListItem( KMFTransaction*, KListView*, KListViewItem*);
+
+ // DATA
+ private:
+ KPopupMenu *m_contextMenu;
+ KMFTransaction* m_currentTransaction;
+ KTempFile *m_undoXMLFile;
+ KTempFile *m_redoXMLFile;
+
+ static KMFTransactionLog* s_instance;
+
+
+};
+}
+#endif
+
diff --git a/kmyfirewall/kmfwidgets/kmyfirewalldocumentinfo.ui b/kmyfirewall/kmfwidgets/kmyfirewalldocumentinfo.ui
new file mode 100644
index 0000000..58d4a79
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewalldocumentinfo.ui
@@ -0,0 +1,184 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallDocumentInfo</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KMyFirewallDocumentInfo</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>681</width>
+ <height>491</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Document Info</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>lbl_description</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Ruleset&amp;nbsp;Description:&lt;/b&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>lbl_name</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Ruleset&amp;nbsp;Name:&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>txt_name</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QTextEdit" row="1" column="1">
+ <property name="name">
+ <cstring>txt_description</cstring>
+ </property>
+ <property name="wordWrap">
+ <enum>WidgetWidth</enum>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <string>F1</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>300</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_saveAsTemplate</cstring>
+ </property>
+ <property name="text">
+ <string>Save as &amp;Template</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Save</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallDocumentInfo</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallDocumentInfo</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallgenericinterfaceeditprotocolwidget.ui b/kmyfirewall/kmfwidgets/kmyfirewallgenericinterfaceeditprotocolwidget.ui
new file mode 100644
index 0000000..a3ccecc
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallgenericinterfaceeditprotocolwidget.ui
@@ -0,0 +1,351 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallGenericInterfaceEditProtocolWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallGenericInterfaceEditProtocolWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>732</width>
+ <height>436</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>KMyFirewallGenericInterfaceEditProtocolWidget</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel6</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;qt&gt;Here you can define custom protocols for the &lt;b&gt;Generic Interface&lt;/b&gt;.&lt;br&gt;
+This required if you like to use a protocol not directely suppotred by KMyFirewall.&lt;/qt&gt;</string>
+ </property>
+ </widget>
+ <widget class="QSplitter">
+ <property name="name">
+ <cstring>splitter4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_cb_showAll</cstring>
+ </property>
+ <property name="text">
+ <string>Show All</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>If checked the list view also contains all protocols that are available by default, not only the ones you defined</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Protocol</string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>false</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Properties</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_lv_protocols</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="showSortIndicator">
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout15</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout14</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>m_b_new_protocol</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Protocol</string>
+ </property>
+ <property name="accel">
+ <string>Alt+N</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>m_b_del_protocol</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Protocol</string>
+ </property>
+ <property name="accel">
+ <string>Alt+D</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>m_gb_edit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>Edit Protocol</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout33</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListBox" row="1" column="1">
+ <property name="name">
+ <cstring>m_lb_udpPorts</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>TCP Ports</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Protocol Description</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel1_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>UDP Ports</string>
+ </property>
+ </widget>
+ <widget class="KListBox" row="1" column="0">
+ <property name="name">
+ <cstring>m_lb_tcpPorts</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>80</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QTextEdit" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_te_desc</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>150</height>
+ </size>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup" row="2" column="0">
+ <property name="name">
+ <cstring>m_bg_protocol</cstring>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>m_rb_tcp</cstring>
+ </property>
+ <property name="text">
+ <string>TCP</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="1">
+ <property name="name">
+ <cstring>m_rb_udp</cstring>
+ </property>
+ <property name="text">
+ <string>UDP</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout27</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>m_le_protocolName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>layout37</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>m_b_add_port</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add Port</string>
+ </property>
+ <property name="accel">
+ <string>Alt+A</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>m_b_del_port</cstring>
+ </property>
+ <property name="text">
+ <string>D&amp;elete Port</string>
+ </property>
+ <property name="accel">
+ <string>Alt+E</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QSpinBox" row="1" column="0">
+ <property name="name">
+ <cstring>m_sb_port_num</cstring>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistbox.h</includehint>
+ <includehint>klistbox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallhostwidget.ui b/kmyfirewall/kmfwidgets/kmyfirewallhostwidget.ui
new file mode 100644
index 0000000..36603ce
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallhostwidget.ui
@@ -0,0 +1,437 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallHostWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallHostWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>416</width>
+ <height>246</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>KMyFirewallHostWidget</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout19_3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_0</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_5</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_4_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_3_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>textLabel3_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>IP Address:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_sshPort</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>22</number>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_cmd_testSSH</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Test SSH Connection</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>textLabel3_3_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>SSH Port:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="2" column="4">
+ <item>
+ <property name="text">
+ <string>Linux</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_cb_os</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="3" column="4">
+ <item>
+ <property name="text">
+ <string>IPTables</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_cb_backend</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel3_3_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Operating System:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel3_3_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Backend:</string>
+ </property>
+ </widget>
+ <widget class="QTextEdit" row="4" column="4" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>m_host_desc</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel1_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Notes:</string>
+ </property>
+ </widget>
+ <spacer row="5" column="1">
+ <property name="name">
+ <cstring>spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>71</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="7" column="1">
+ <property name="name">
+ <cstring>m_lbl_configStatus</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Config Invalid!</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="7" column="4">
+ <property name="name">
+ <cstring>m_cmd_autoConf</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Try Auto Configuration</string>
+ </property>
+ </widget>
+ <spacer row="7" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>241</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KLed" row="7" column="0">
+ <property name="name">
+ <cstring>m_led_configStatus</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="state">
+ <enum>Off</enum>
+ </property>
+ <property name="shape">
+ <enum>Circular</enum>
+ </property>
+ <property name="look">
+ <enum>Flat</enum>
+ </property>
+ <property name="darkFactor">
+ <number>300</number>
+ </property>
+ </widget>
+ <widget class="Line" row="6" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kled.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallinterfacewidget.ui b/kmyfirewall/kmfwidgets/kmyfirewallinterfacewidget.ui
new file mode 100644
index 0000000..094a5f9
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallinterfacewidget.ui
@@ -0,0 +1,152 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallInterfaceWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallInterfaceWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>327</width>
+ <height>192</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>KMyFirewallInterfaceWidget</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>l_int</cstring>
+ </property>
+ <property name="text">
+ <string>Please add your available network Interfaces here:</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>41</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QListBox" row="0" column="2" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>m_lb_int</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Here you can see the currently entered network interfaces</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_b_del_int</cstring>
+ </property>
+ <property name="text">
+ <string>Remove Interface</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_b_add_int</cstring>
+ </property>
+ <property name="text">
+ <string>Add Interface</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="0">
+ <item>
+ <property name="text">
+ <string>eth</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ippp</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ppp</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ppoe</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>lo</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_cb_int_name</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>m_sb_int_num</cstring>
+ </property>
+ <property name="maxValue">
+ <number>10</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewalliptdocoptions.ui b/kmyfirewall/kmfwidgets/kmyfirewalliptdocoptions.ui
new file mode 100644
index 0000000..ff040cf
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewalliptdocoptions.ui
@@ -0,0 +1,402 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallIPTDocOptions</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KMyFirewallIPTDocOptions</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>673</width>
+ <height>649</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Document Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel7</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="text">
+ <string>Here you can configure several general options that your firewall has.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignCenter</set>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>GroupBox58</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>IPTables</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Enable the iptables you like to use in your firewall.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Use tables:</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_use_filter</cstring>
+ </property>
+ <property name="text">
+ <string>Filter</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_use_nat</cstring>
+ </property>
+ <property name="text">
+ <string>Nat</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_use_mangle</cstring>
+ </property>
+ <property name="text">
+ <string>Mangle</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>Layout65</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_cancel</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer45</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>51</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer46</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>GroupBox59</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Misc Kernel Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_use_modules</cstring>
+ </property>
+ <property name="text">
+ <string>Load modules</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Enable this if you compiled iptables as modules&lt;/b&gt;. For details about the required modules, take a look at the iptables man page.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_use_ipfwd</cstring>
+ </property>
+ <property name="text">
+ <string>Use IP forward</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>TextLabel4_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Enable this if your host should act as a router&lt;/b&gt;.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="1">
+ <property name="name">
+ <cstring>TextLabel6_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Enable if you like to use Syn Cookies.&lt;/b&gt; (needs support compiled in the kernel)</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>c_use_syn_cookies</cstring>
+ </property>
+ <property name="text">
+ <string>Enable Syn cookies</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="1">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Enable&lt;/b&gt; if you like to use &lt;b&gt;Reverse Parse Filtering&lt;/b&gt;.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_use_rp_filter</cstring>
+ </property>
+ <property name="text">
+ <string>Use reverse path filter</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_use_martians</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Log dropped packets</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>b_cancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallIPTDocOptions</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallIPTDocOptions</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallIPTDocOptions</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>c_use_rp_filter</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_use_martians</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>b_ok</tabstop>
+ <tabstop>c_use_filter</tabstop>
+ <tabstop>c_use_nat</tabstop>
+ <tabstop>c_use_mangle</tabstop>
+ <tabstop>c_use_modules</tabstop>
+ <tabstop>c_use_ipfwd</tabstop>
+ <tabstop>c_use_syn_cookies</tabstop>
+ <tabstop>c_use_rp_filter</tabstop>
+ <tabstop>c_use_martians</tabstop>
+ <tabstop>b_cancel</tabstop>
+ <tabstop>b_help</tabstop>
+</tabstops>
+<slots>
+ <slot>slotHelp()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallipv4adddresswidget.ui b/kmyfirewall/kmfwidgets/kmyfirewallipv4adddresswidget.ui
new file mode 100644
index 0000000..5e1260f
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallipv4adddresswidget.ui
@@ -0,0 +1,161 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallIPv4AdddressWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallIPv4AdddressWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>371</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form2</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout19</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_from_1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_from_2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_from_3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_from_4</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel3_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>IP Address:</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallmultiportwidget.ui b/kmyfirewall/kmfwidgets/kmyfirewallmultiportwidget.ui
new file mode 100644
index 0000000..0c1ff9b
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallmultiportwidget.ui
@@ -0,0 +1,229 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>KMyFirewallMultiPortWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallMultiPortWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>625</width>
+ <height>190</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MultiPortWidget</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QListBox" row="0" column="3" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>lb_ports</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="2">
+ <property name="name">
+ <cstring>b_remove</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>b_add</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="2" column="2">
+ <property name="name">
+ <cstring>sb_port</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>65335</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="1">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Port:</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="0" column="1" rowspan="2" colspan="2">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>rb_equ</cstring>
+ </property>
+ <property name="text">
+ <string>Equal ports</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>rb_dest</cstring>
+ </property>
+ <property name="text">
+ <string>Destination ports</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>rb_src</cstring>
+ </property>
+ <property name="text">
+ <string>Source ports</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="1" column="0" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;You may filter for up to 15 ports within one rule if you are using the multiport extention.&lt;br&gt;
+Use this to avoid too large (slow) rulesets.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_use_multiport</cstring>
+ </property>
+ <property name="text">
+ <string>Use multiport extention</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>c_use_multiport</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ButtonGroup1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_multiport</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>lb_ports</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_multiport</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel3</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_multiport</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_port</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_multiport</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>b_add</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_multiport</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>b_remove</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<signals>
+ <signal>sigMultiPortChanged(bool)</signal>
+</signals>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>qwidget.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallmynetworkwidget.ui b/kmyfirewall/kmfwidgets/kmyfirewallmynetworkwidget.ui
new file mode 100644
index 0000000..cd639d9
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallmynetworkwidget.ui
@@ -0,0 +1,189 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallMyNetworkWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallMyNetworkWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>686</width>
+ <height>571</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Protocols</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QSplitter" row="0" column="0">
+ <property name="name">
+ <cstring>splitter1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="childrenCollapsible">
+ <bool>false</bool>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Network/Target</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Address/Mask</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>System</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Backend</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_lv_zones</cstring>
+ </property>
+ <property name="resizePolicy">
+ <enum>AutoOneFit</enum>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QWidgetStack">
+ <property name="name">
+ <cstring>m_wsEdit</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>ws_pageHostProperties</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>5</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="KTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>kt_hostProperties</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentPage">
+ <number>-1</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>ws_pageZoneProperties</cstring>
+ </property>
+ <attribute name="id">
+ <number>1</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>5</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="KTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>kt_zoneProperties</cstring>
+ </property>
+ <property name="currentPage">
+ <number>-1</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<slots>
+ <slot>m_lv_zones_itemRenamed( QListViewItem *, int, const QString &amp; )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>ktabwidget.h</includehint>
+ <includehint>ktabwidget.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallnethostproperties.ui b/kmyfirewall/kmfwidgets/kmyfirewallnethostproperties.ui
new file mode 100644
index 0000000..bf025a8
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallnethostproperties.ui
@@ -0,0 +1,234 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallNetHostProperties</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallNetHostProperties</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>642</width>
+ <height>209</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout16</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Host Documentation:</string>
+ </property>
+ </widget>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>m_host_desc</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>m_frameAddress</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>m_gb_host_protocol_option</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Host Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>m_cb_host_log</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Log packets from/for this host</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout9_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_cb_host_limit</cstring>
+ </property>
+ <property name="text">
+ <string>Limit matches</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>m_sb_host_rate</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbl_slash</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>/</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>second</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>minute</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>hour</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_cb_limit_host_interval</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="editable">
+ <bool>false</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_cb_host_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_sb_host_rate</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_cb_host_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_cb_limit_host_interval</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_cb_host_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_lbl_slash</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallnetworkwidget.ui b/kmyfirewall/kmfwidgets/kmyfirewallnetworkwidget.ui
new file mode 100644
index 0000000..0926fbd
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallnetworkwidget.ui
@@ -0,0 +1,330 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallNetworkWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallNetworkWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>633</width>
+ <height>128</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>KMyFirewallNetworkWidget</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout27</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Network:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Mask Length:</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout22</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout19</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_from_1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_from_2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_from_3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_from_4</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout21</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>m_sb_mask</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>32</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>19</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Mask:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>lbl_mask</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>255.255.255.0</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>45</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QTextEdit" row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>m_txt_desc</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Zone Documentation:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Zone Properties:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallnewdocument.ui b/kmyfirewall/kmfwidgets/kmyfirewallnewdocument.ui
new file mode 100644
index 0000000..3da2b6c
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallnewdocument.ui
@@ -0,0 +1,409 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallNewDocument</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallNewDocument</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>580</width>
+ <height>330</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>580</width>
+ <height>330</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>580</width>
+ <height>330</height>
+ </size>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="caption">
+ <string>New Document - KMyFirewall</string>
+ </property>
+ <property name="icon">
+ <pixmap>image0</pixmap>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QFrame" row="0" column="0">
+ <property name="name">
+ <cstring>frame3</cstring>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>l_pic</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image1</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout20</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSplitter">
+ <property name="name">
+ <cstring>splitter3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="text">
+ <string>&lt;h3&gt;New/Open Document&lt;/h3&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_close</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>x</string>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="text">
+ <string>Please choose how you would like to start your new firewall configuration.
+</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>50</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_empty</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;New Empty Configuration</string>
+ </property>
+ <property name="accel">
+ <string>Alt+N</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>&lt;b&gt;Empty Ruleset&lt;/b&gt; lets you start with an completely empty ruleset.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_load_saved</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Load &amp;Saved Configuration...</string>
+ </property>
+ <property name="accel">
+ <string>Alt+S</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Open a save KMyFirewall Ruleset</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_template</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Load Configuration &amp;Template...</string>
+ </property>
+ <property name="accel">
+ <string>Alt+T</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>&lt;b&gt;Loading a Template&lt;/b&gt; will load a Template configuration that may be adopted to the requirements.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_cancel</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<images>
+ <image name="image0">
+ <data format="PNG" length="685">89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff610000027449444154388d6d93bf4b5b5114c73fef47f2a2491c02050d0551323445ec5014151497d2c176f0f7e41fd0a1438538bb75b385824eede4a654688b8a8b62a0b4521d148594686930d568f0477c7d2f2fcdbbb7439e62ad072e9c7beef77c0fe77bee51b8c504c40ea1cb80a8099603db0256ef817d13ab5cbf5cf8fd71b7b7f795d6d6f628108fab6a2482741c9cfd7dce37368ef717175fe6b6b6de3c85f27f045978ec1f1b9bad191808a9800a28aa8a140209b8807372c2b7d1d14fdb3b3b83cfa18887a300f11ccceacdcda17226839bc92032190887110707b85e0cd3241a8b3d09c3e465610d6004a64db8af99269aeb22b359945008bdbd1d717646697d1d676f0f3b9de664610169590fa2b0f2197e6a0262dfe115a088dd5d443a8d383cc4e8e8c0dfda8a1a8950cee7399d9ae26c799962a18004c584aa2578af66a1cbf15a118093cba1363541305811291ca6babf1f6118b8c522977dd74027e0532d88ea97627824d53d3d0407072b01d745f1f9a84f26919eea1ae0875ac0a72a60f9019ff750ddd242cdf0f0d568f3e3e3159e7c1ecdc3f92b056d40d155d8aef2923540334d144da3984c224e4fb16666b8686c24383444b8b5156b6d0d1db0210508bd08ab061c1b704701820d0d0014120910022595c29a9c243c3282717e0e547ed126cc032500bec08b5f208f40e60301595a5a92662221f3208f41dad3d3d29e9890471ee603641ba0feaacf39d0bfc2c70b90bf415a9a269dee6e6981b40c43da7575151fe426147ba10fd0ff598ad71098877747e0ba20c5b5e3822c815c866c5f25d9b8759900c6a0eb213cbb0b9d5550fb07ec1ca456607e0edefe802cb72dd30d53bc89f93c5f7882956f02ff02854c0fcf287a72340000000049454e44ae426082</data>
+ </image>
+ <image name="image1">
+ <data format="XPM.GZ" length="189236">789cecbd47931cb9b2b6b9bfbfe2d8c5eeda587ca9c5621625b25496cad25563b300104068953a73fefc20f07a80d54d9eee668bc34bb20c46b21e028140b83b1c0e1151ffe77ffef5727bf5affff93fffb558f26524ff25433effd7fff8ab2cdbfd3fffeffffdfffdd77f77069d7f755bbd7fb587e3cebf3afffd7ffdd77f6fefff25ffc5e4b0d5e9b66a5e4e2c8f5aad8eaa79b774ac6df96be24eb75b73501177713d1f3a6edbeba5e5b1b95ed6ecbd38b6f57b278e51ff53c3b85e4c89dbc8f79e1bc6fdf663c7f679762be26eb757f3e68cb887fa9273c778fea6fe3e9e27b9211e75873567b165deb45f8e1ca3fd9ff2d1bea46192e7b1637b7fcf776cef2f9afc76c7b7f9dab1ad8f2962d20f678e6d7dfaceb16dbf7743dc47fd6cedd8e66fcf890790cfaae578609f3f271ea2fec594788cfc8d472cc07b9417e6f985bddf89633c0f730cf98886f13cdeab63e8e3c1b16d9f1711b7497e99633ccf237107fae1678ea19fa061dc4f0c88c93e79e9d8de7fd9736cefbf7e26eea1fdcb4be23e9e5fde120fd01e5938b6d78b8478d8eddbfe72ead8dad7aeb9ff08f7cf0f1de3faa63e8efb89a5637bfd2a743cb6f52d8825f2e5d4f1a866857ce9ecf7d4b17dbed9b261b2afc8319eef86b84dd7870d933e73e20ed9f7ad633ccf3d7197ecfbae61dc4f4a62ea9fcc776cefbfe28ead3c9743e23ef58f27e2019e7f7be3d8ca67d9251ea27ece1dc3de668e6dfdfe23f108f25f0e1c5b796e5f88c7e43f0e1ddbeb852016289f4e1d73eb5f18b1ecdafe239be7f5d1de0cfe4db6db5d6bdf7edfb1953fd3c4ddae95a7b8b0ecbbfec71da3ffa50d435eace7d8cac35b13933fddae1c5bf92c8f883b545f733df9a355ec18f63724ee92fe4e1d5bf9c890b847f673e518fadf1093ff6213c7b63d32716cf5b33d211e90fd5e120f21ffd59b632b7fddd43f42fdfcdeb16d1ffbc4b67e56108f697c908eadbeb6b7c49cec69e518feb3d107f54771e9d85e2f94636b0f614eec43ff79233f85f2e5ab63fb3cf99e58e37aaf036e77bad61e02d25fbb0756f43ced410ffde18e78d8b3fa5090976afc4572e118fa970d93fe94632bffb0706cebf7a78e315e2d8869fc5a9e38867d30628a2fbc37c7b6be95766ce5c932e21ef99b23c756fe79d3de3ef99bc0b1bdbf6eea23ffcdb863f4e73bc756ffeb7362f227cb267f44f670e1d8ea43cc88c7a85fef1ddbf685c2b1ad9f37f2e2783eefd2b1d5b7d72216689fd7756caf0f1b7d903fd1678eedf572ec18f159d31e05fb5831c7f02f43628deb79db31c6ff0370bb85fae427b6f69347c46d942f97c45de47bd70dc3fe9207e23eeebf6b37dcb3faf32be261cfea2f5f118f7b886fe8f9da1ce5b790bf76e35fd530d9d7dcb12d1f3c3946bc71e718f57bc414aff9470d53bc72e018f6714adcc4175dc788a746c414af46178eedfd3743c7569f4a10f7693c3c730cff941337f1deb363abbf2424a6f18e3f3bb6ed89c78e31de35f9e42f9309f118f5ad1f1d5bfd474b628a5724770cffb72216789ee4d5b1b58fb4797ef2972b9f98fc9d908e6df9e5c631fc5bf3fc9aec0bf6a38d3d62bc7d736cdbab9afc36ae9713c7b0ff3e7107e5454cdc43be1f340c7bcb7ac47ddcdf27fb33fe16e3af746ced432e8847b05f4ef669ecd9e687642fc69e31ff0a1c5bfdad5f88650ff1a926563df847d28f09c7303ed8f1ca0cff64efdb81638cff878e31fee5c414dfe51bc7e87f5b628acff627c47de86bd927a6f9c626756cdbb71c13933d7a67c434fe46478ead3d2d478eadfde48298fc6bf44acca1eff99098ec4df58825dae74bc756bfbb6bc7567f9b3db14ff1fb8163d8ef9258e3fa79e2d85e1fb4c0c6deacbdec0b628aef58df31e237aacfd89bbd5ef186613ff915719fc66bed18faa1f635e3b978716cf5cdba8e311e93be8dbd61be32706c9f77bf778c7885f4d7d8a32c8905ecd79b38c6f8dbb44fe3fa5c813bed9e7d7e5d11f7c009c9afc3fb789e9de57663afeb1e31c597db4b629a5f6507c4643fdb98b8195f2f1dc31fb51d5b7bd85e1173d8e3362716148f6f897d8ab74ac7d05f414cfe6a49f7370db6f95c3bb6f6c04f89dba4af8898f41f86c414efaba786a14f79e9d8ca637748dc23ff37261e90fe4f1d23fe9a120fa12fe1138f604f22708cf8a8a99fa37cba718cf926c9dfd9439f58c2bef8deb1d5c7e29858a13e35746ceb93b0b776a7d583ff1f39c67843f230f664cbf3257107fece27fd18fbb2f2cbe9f93a7de4abb563ab9facc91ff4ad3e3637c4a33ed693489e1d01f6d1be4e331fe70362097d472362b297f48458c19ec2c8b1d597e81037f115fc5ba7b10fb925ee50ff6bf2bb905f7c46dc43797eecd8ea73f3e018fef28a7848e351ee18f1f40df108fada35f7a7f129b8748cf9d4b963ab6f352516b8dedf11933da8e6fe3eb5ff135b7dc6af8eadfed98a58417f3226d6a89f7f62f82bf8bb8e79605b3e5939b6fa5924c41d940f67c45db2b7ad63f8a737e23eeca3aa88073df8fb8c7844f6d6f018fe2cde137394f76dbce3771b7d899098e2ddb8e718fe7ae3d8ca6fb7271e927c8f8947a48f1131a7fecb1c5b79eb01b184bcf3d031c6c7e6fea49f684bac20aff49158433ec533d8f44ff45fe518f30f8fb883f232720cf9913c1af9eb07e21ef5d79163ab3f963ab6f22e24f100fd337b718cf91ec9a73344791e108fa09ff496780cfd464dfd1cf5c999635b5fc5897d62d85fd728c83eff9aeaef0efbf6f938c6879ee91f569ec19c58507f38710c7dae887dc83b5b38867f98116bc88b53be91b7958fe81193fd8b317117f9fa9998e41b5d12f7a11f71ee18f1c87dc3904f7c4d3c84fc78877884f27cd730caab47e231e495d3f39afe60f5113f350c79e74d7b04ea0f4ac7984f37f529f07ce4d8ca77d1c843f7ad3c4bd85bafdbea637eff4adc417e1239c67cbe4bdcef5bf9c4d077bf991f2c113ff48dbc6d79ffc931ca33c7d0075d6ff461e5233362ea0f814fdc437eee110f201f6fd430e4b33d261e23bfec378c7c7e40cc219ffc8858401f61c7b1956f71472ca9bf5c39b6f22ad6c41a2c5b8e215f7a7e235f6bff61e2d8da6749cf63fa07e2c333e22eca07b163ac6f4d887b285f96c47de827f51c63bc1f13eb01d62fe14ffabdde00f30bb46fd0c87f9d1277c85f33629a2fe9a963abbf7d42dc837fab02e221e4992e1c5b796615f118f22f3bc414dffa2d6201796677c424ff7244ece3fa6ceed8caa3c0f30d8c7cc153c798ff95c46dc8aba0fb35f69e1f13f790afee1c637e7deed83e7f48f232f2b6f25b1c110fa0af4a3a863d6f8987b83eed3ab6f2d6d7c423dc6fdeb497237fd7b4970fb03e52100bd417e4c47280f1b329af07582fc4f831e88d07d80f803d0f3b5df2471b62ea6fe18498e2bdfc9a98e43fcf8815f455cd1d239e85be8646de96d983637b7fd6e47720afa8efd8ca6bd922ee429f72e018e3f398b88febf5c4b1bd3e65c403c86fbe241e92ff3a778cf948423c823ee5a661c873a189c7a83fd9130be46f468e315fbb2396a82f29887db427520d439fcb43c7f03788afccec155c45c46df4e7f0dc31d627ce1cc39ea7c41db427bc24eea2ff2f85635b7ef34cdc877d6c489ebd01f2d7f43cbde1c0ca7b754fccc14bc44b23e3ff6c7bfc07c7d8ff41ff1819fda23f1e1377a18f458f78000eb863cc4742c7567ee1887808f9af72e211f4a3268e115fbe128fc91e7c628efaf30eb1843e9213c756fef31b62d2dfb229af70ffe2c631fc59db31c667e87b64f4097fdf25267d66197107fac973c756fed1a363ac17ed887ba8af62c403e863231d5b79166fc4435cbf4b8847d07774e3d896df917e8cbf407f5e128b8195d7e68258e2fabc2256032b9f0dfc85f11ee012f63936fe18e355424cfa5f6e897bd4ff2531f56ffe424cf1e3aea96f047ded7bc463e853bd3ac6fdc7c41cfa5a4f1d63bcef13fbe0dddcb1d54fd1dc5fc31efc9163ec9751fb9bfe570862d2a7ba20ee425f7ee818ebbb4be21eee1755c47dd4173e3bc6f8754b3c84be962f8eb1fe9613937e977be231ec233d708cf5be805882a343c78877493e46bf98cf6bc78817e8f9fa9d21f61376c4a321d67331def0ee98e47b4fcca1cff4a1611abf0e8905e977edd8ca3f7e2156e005e4c94dff823e4f1ddbfbab1631f59fa24b4cfad0e7c43dd2df89632bbfd58163acf753fb8d3ee04f3f31fa5b877880fbf9d78eb1ffed118f20ef7d9b788cf2d5d8b12d3f97c41cf5e703c788c74ac7e81f97c402cf5336f2f1513e4b1d239e6e9e5f0de1ffe6c41af549c7d0ef1afd8ff75b28bfbf25a6febe7824ee0ead7ef60f8e317ed1f3f787432bff1de251d1e85bc0be44a3cf4d46dc853eaa1631e98b3f10f749bf03c7567e3bdf31e67f3be201f4bfca1cc3ff34f50da97ecfb1bd7f30766cebcbdac463c8d7bb23267df10b6281fa45eed8ca37db3bb6f24b9be757c8d74d7b15e4bf518e21ff39b11e5a7995983f98d90dea2b560da37cf446dc46f9fdc4b1d5d77aed18ebe187c4d4bfcb7be21ee9f3847880eb179fd85e5f0ae2d110ebe99963cc6f305f9046dfb6fce28eb803fd6cde88a9ffad12c7188f5e89fb28bf78718cf1f2807800fd2dee1d5bfdec0f8949dfeb63e211aecfcf1d23bed78ead3e170531f5bfb2691fe95b758925da5b3d3ab6fa49bc8621df4544eca37d8b9858a3bc281b863e7dc85336fa1413e20ef4b15939b6fa5a28e22ed9c390b88ff2e9c031e663c231d6bfa8bd46bf9097768cf97f933fc4fd22e618fbbd3ef16868e5513e138f8756de8b8e63f477d27f5f80c59a58e2fab0c9f78758df84bff5cdf880f5258cd77e13ff6e1b267b488e8829bedd6e1c5bfdc57de231f421ef1cc3ff56c4d47fd71362d2f77c4dec43bf399ed737fd11ebd333c7f077747fa34fccb73ce20ef4959e3ab6fa0ab7c4e45f37c78eedf36eae887ba87fb1231ea07cda778cf585ca31e2cf7be221f4b364c423d4bfa81c63beb724e6d057de3c9f40febcb99f44ff4fcf1d637ef648acc00bf8377fd01adafeb5bc216e43ffdb367187f2af1de37c2dc63bd5f88fbd20e634febe3ac67ea74fdcf4c74b621ff9fb0531f9df70e818fac378a81a7fca2a62d20f7b22ee417ef13331f53fbe251e425efea163f48f73e211e41bbf1153ff29dbc402f255678ee1ef481ea6bf60bd7fe518fd67e018fb93a7c41abc0c1ce3bc00f4ad8c3e20ef56c323accf917c1bfdec22e2ee08eba54df901788bfeaf8d7d235ecc88bbb0cff4d231ce071d13933cd33131f9abc5b563cc770f89c9fee75be211ca7b53c7d8cf6bee37863c8b3931d977b02726fbd5078eadbc364d7d8dbc8f8815ea2bef1c237ed78e31bed1fd8cfd23be7c726cf30bed18f17a53be33c2fcb424ee423f7392efa087fcfcdeb1d5d786e43118421f79db31f64b3de2d1c8ca6fc71dc3df5e11f311c6ffa63d7284f5fb01b11ec11fd8eb55abd15770464cfe273e25a6f120e93ab6f28be7c464eff37362b2dff9b3638cbf1e31d96fb5758cf59a17b0b167cc4f5a8e114f6d88bb90d74212f7503e7b6c18f25d1c12f7513ef21dc3de2be211e58f1dc3bf6bc7988fee89c790afbc770cfbee1073d4bfd78eedf5494c2ca02fdeb4cf1f61fdac699f1a59fbdf33f0b033b2f6b71e1077c7f6f9b654ff7030b2f25cb78947232baf9520e6638c3f767c54edc6bef3377063bfaba963ccdf5f88c99ffb9b8621dff91d710fcfbbe81393bcbd2d31f9177fef18e7054e894724bfe6fa31caeb9163c8ffc831fc779798439ebaef18fee39658a03c3f2196b89f6aead3e81f3ee50f5bd0c74e3bc67c6045dc1e597b0fe97ec32ecaafce88fbd0c7bee518f1669b7888fa3605b118637fcfce5754a7e90f21ecbb336891bdbe11b721ff3422ee923e2ac7181f036292ff2e26267f922c1ce37cf3a163ac970c88c99f646bc7c87f21169067d8b0447ede23f691cffb8ead7e929d63ecafef8935e4b9a5eb8dfce18f2e1c231ebd768ceba9bd463f884f268eb15e724bdc41f968e6d8f6af6a49dcc3f5d5b563ec0f660d435fbb31711fedcd6f88a93fce778ee1dfb60da3ff0643e221ea5b0862eabf7e42cc919f29c7982fb61c5bfd24642f4389fe1ea1bf761bfbf17d621a6f5627c4640fe28198fcddfede31e2cd3362d277794c2ca1cf558798fc17578eadbee4ab632bef15fa77d7e80ffee889b88dfc441377203fe61177912f98632bff7241dc47f960d730e4bd3e728cf70f1a267dedaf1a867c25c9a7e9affeb963e8e7ae61e86739271ea1fe153dff708cf2cb55c3e4bf97c47c8cfdca925890fe4e1de3fcee9858e27e15b57fd422fd93be469c63bd02e361cff863bc0f31271e429f69c363e8cb17c402fd63be21267fc9e68e6df9f91931e93b888835ae973bc7563f199eaf67f48b78f4a161c8a3f0883b281f1f117721bf6dd4309e7f1310f770bfed27b6d7574f8eb13e7d4d3c407d55bb61d4a7d78eb19ee21393fed7ab86a10fd521a6fe2a160de379a2a9639c1f58128f51ffe6de31d6ab1931f5f7a8b99f44f9f2c631d6bfcf89d518fb11747f630f982f52fb476de4f3b1632b8ff880b833c6fa7642dc1fe37ce1a3635b7e97120fc7d027fc69dff45f9c07591077208f7d9798fae7fcc531cecf5c11f720af521353ff8dce8987c89fdf3ac67876e2d8ea238e89491ffb3762ea6ffebd632bdf62e618f3bf9c98a3be4a10537fac7c629feed7728cf595e6f914ea4bce8835f455dc3bc67806ff69a225c87f991077905f0d88bb63acd7cd897bd06fbe261e20dfd78e11bfbc128fa0bf34241e8fad7c2b7ade9184bf504d7b14873f83bc07a6ff623c85fd0c8cff44fe9a98fa130b8847d43f0f1c633fef9498f491c7c464ef3c728cf9cf8b632befe09858409ed19c98fac7624bac903f178eb15ef6e0d8ca7b0e790c4c7fc1facbca31c62fbadee803fbad297197e44ff5197d60fd4438467f1911f7a97f15c443e4473bc7b0d725f108fa081b267d2d9e8839cab30eb10ff66f1b26fde58ead7c32c477c3a63f6d12629267f54c2cc99e778e218f0931d97fb521d6c8df9c3b86ff477b87469ef00f17c46de8237a718cf9e9037117e5d7078e71de6241dc877d8b37c7563ec59898fa83bc261ea17cbc756ccbc7ab8621efed9a780c792d3c628efbfb13c7d82f382616b87e31768cf56092a7e94f38afb9776cf3e733c7b0ef461e9a431fc4e316dac3a8be7107f9d9d231ce1f14c43d0e7b267d8f47dcca7383f174d4f4cfd531b10f7d2c3531f51f0ef98c8cfee08f66c4d41fc21e710ff29d9f10f7c91f5d120f20bfc58563acd74ae221f45d36f58f911fac8939e4b57a728cfdfda63e92bfbc2296b07f76eb18f6df27a6fe520c8935f2ab07c7185fa14f339a439e21e58fdbb8ff9c9ebfded0b6cf7be518eb85b78eb15e3225ee435f11271ea2fc1afe6cdc8cb765403c84bd46cfc464cf724f4cf11e4b8805d9cb1131c92368f27dc893cf1d63fe87f9a3f1cee045ee18e7bba83de6f9e14faf1c23be5f137770ff60e318f3f588b887eb8b9d63ace7a5c403dc2f7f748cf9fca163ac071e10937d8ba63ce7789f70e718e7b9487e632130df62c49a63be70dbb0c0fc1af1eab8fe00817dbe63e236ea4b113f72236f5bdf7c404cf21519b1823ccaad632b8f10f18419fd90efcf1d63fc3a728cfe971277208fe0de31ce6b34e5bb64ef8563d8e79ab88febc303c758af568e11dfcd8887d08f5e3ac67af605f108f28bee88c7a49f9e639cdf0a8805caaf160d431f1ec96fec43befeb061e4cfe97e461f98ff1c13b78595b77a768cf3e97d622eb0de80e717c6bf5bfdea7b621ff2ce4b620dfb0f29dfc817f69f1277210f1510933d0721f100f229ae89479047b5728cfd8f88788ce7cd6e8839aecf53c7382fb7219628bf7c6c18f2582a621fe583e67e0af6cc305e1a6f29b03f48ed37f242fc77ea18f12ed5c73bb0ff72ea18eb019cb88bfb6f48bebc87fa572bc7905f4c3c12785f85e4630cc0ca2f85bdc946fe29f2a5f13fb8df8ab80779a677c47de867b9748cf7ab9e88c790c72e27e678def5a963ac97c5c402fa29a563c40b3b621fd7eb8c58215fbf106be847cd1a46fdbba163f44ff863d9d86b7546dc4179ffd9b12daf06c45dc8b7ba728cefa96c887bd0df7ee018e34be118f37b922fef937e5b8e71bea6700cffd3b47708fd6db78e31bed1f319fd229e581053ffe329b144f9f2c431d64f23621fe5638f5809cc3f48fea285f23ef467665fe88feb8898437f6b4edcf8fb36b1843d94a78eb1debd235628af3cc738ff74e318fde78198f4bd837ff24dff827d1c39b6fa58ef1cc3be03e20ef4b7ce88bb289f078eb17f3925ee51ff7b758cefb3ac89499ff3827880fac3b9639c77ea128fa00fd9f098e4dfd4c705be0f714d2c70bf403846fcfe46eca3bc7c768cfdb4e6f915d90fe9876bdc7fcb1c63fda6e318e305c95f7425fc4d49dc97f0577de2a1c47e3cf46b667ff017912016d07f7ae518e75b33621ffdd93f20d6d0470cfb518d7e2b2a6ffa2fec23778cfdff057117f25a9f10f7a8ff0f1da3ffef88fb640f33e201e49305c443d4b7281d633cda138f21ffadef18fd6149cc71bd5c3946fcd52716282f1f1d63bde89258d278da738cf589576285ebf92786fe36c4a4efd5a46189780be3ad19ad703f79e618e7e5485ea28df23be118fe95117770bfa443dc43f9f2c031fae385639c973b26ee93fd54c403d45f70c7d8bf22fb112389f5d49858903d623eac1b7f12623ea14d7fc77c66e018f176403c20ff5939c679e113e211ec23fec478dfaded18f19722e6d047d09417c8e7b7c412f2de4bc7589f5d13fbb87fba778cf95a9758e37a3d730c7f88fe6aa269945fbe350c792e39711bf7f39bf2a45f3d24eea03cbb26eea2feea82b88ffcbce518ebddd231d6cf499e467f565fab57e221f4b5c91d637c2d89c712fe13fa36d62a719edbf68ffaf312e8bf3a27a678466c1c63bd69e518feb44d4cfd6bcd8825e9bbe518f25e13fb90d7e6c431f67b0b6205fdfa6f8e313f8fc0461f582f796d18f28e5c3ee439bf226ee3fae494b883fbb1e67ad24f7c47dc25796ac7983ff589a93feea8bd463ff08fc231cefff68807a84f3d38c6fcffc931be4771433c84be364d7d23dc3fed38c6fb77cdf371dc7fbe778cf3aca45fd39fb11ef0422c915fe68e319e2d881598d3f5b22d719e6a48dc97d80fb6f1906e37f3cbd596d887fe36036245fd2924d6b087c59b63ec571e808dbe70dee4be61e84754c41df25f77c45df2cffd86a19f7ce418dfc71a1293bfdccc1ce33ccaad63ccdf97c47db427dc348cf6f85de221ea53378eb1bedbd437827e524e3cc6fd58cb31de57ea100be8479c39c6f7ea368e713e784dec23bfba748c78f68158e1fe624eac51bf668e114f1f828dbe713e92f26547e2bc2ab5577625f693ca867d9c47f48907b00f3f271efa18dfa03f331b207f9613f720cf543a463c72484cfe6f1538c67ee101f100face9e1de3fcc50df188fcdf9a788ce7cf3831477dde8563c487e7c4d43fe2c231e2bdbd63ac3774897d5ccf2e8915c937758cf5873e31e963b7738cf9980736fe1adf3f281ce3fb2754dee807e72d48be463f38dfb520ee215f3e38467fec100f7cd82f3dafd117e20dee18e7c5ef88473ef6d76dbca0bb8d7f9c4f88299e5da4c4e4df36978e111f36d70fa1ffc58c9843de598758a07c31728cf5a38298ecddef38c6fb6007c41a1ce58e715e09f665bc05ee270e1c433ed386f1fce90d711bd7abc431e663197117d7cf9f887b641fd78eb1ded423267f5a3e360cf9ab17e201ea4f14f188fa176b18ed8b278ef13ecb31f118facd9af670e4a74b6281fce2cc31fc21e9434ad4ef93bea4f2a1cf31d86ff9382f79e518ef83f7893b3ed6df30def78cfef0fee59658a2bff84bc7f0771eb1c6f34ac8abd7d8ff5e11b751df86ae37fd01fe31748cf7c7f78eadfcb782b88bfbe95be21ee45f35d7937e424e3c407e913b867feb128f209ff89e780c79cb17c758af98107392f79b639c4f6813937eb2a63e89fab7678e71feac918f22791f126be887bf3946bc42f235fa42bcd8738cf58d6be236da1357c45de4e7dc31e65b47c43ddc3f69110b1ff283fdf51bfd0b8fd8477f5e613ce99bfe067fde22a6fe150d1c23de8e88bbb0876ae218fe70e018fb254df93ef49527c403944f470de3fee12b31f9bfe4d831d6a7668e313eed8939ca2f6e1c43df578e6d799f130be873bd708cefb10e8925ee97dc12fbd0e78aea6bfa9b3c778cf767491e467f984f937c4d7fc47ad68d63ec7f9c12f7507e593a467cffea18fbbd8fc47dd843f1403c803dacae89476076e318f1de2131477d8b35b152e80fa43f5f2bcc9fd01fcce801795437c4a49f4c1393ff5b468e313e3d120be42f0e1ce3bcf11bb1a4fe22897de4a78a58917ea463cc2fd11f8df5407e3e956ffa4f36728cf8ba4bdc817ca26bc758af6dca77a97ce618eb29afc47d5cbfc81c233e6bee3f207d3e110fe97eb163cc9f0f1c63fc0a88470afef094788cfa83a6fd02f9d1b1639c6f792196a86f5535ace0bf3c621ffaad0a628dfc3dec7f507f50d33eef86b803fb88d1ff864d7f5efbc402f2ae6e89499ff339b10ffd852d6245f98c98fc63de778cfda68563acffe0f94cb404fbc822e236e4bb691353ff4a32c758cf3b23ee42fef363e21ef9dfbd63c42f21f100e5fd33c7e88f2b62ea5f51d731f4f5d030f455d2f3fa63c83f11c4d41f75492c919fee1c63be7744eca3be55f3bc0ae5a303c7e8aff78e719e1cfe6b68f48b78f092b80bfd2753e2a182bc1f8985c2793ae86764f4077926c41acf9fc37e46463f56fefb1bc7e89f0be22ec93723ee415ede3d31f5aff0827888fc64d4309e7f774e4cf2f71e88c7906799360cf9a81531877c02e918eb775d621a3f59dc30eea75bc43e5def3946ff081c637f85116be82f7c748cf51fd8d748b515cec752fb4d7f837fdc107715f66342c7b0d71e710ff75b34d7f715bebf7c443c52f81e15c9438d15ce4b1f107394cf9af252e1fcd0a0618ddf6740f2560af650c15ec68d7f9d2f88a9bf2443e211e4194b624ef29c3bc67acd9658405e8122a6fe50dd112be4a7c231fc5b46ac51df863986bca83e63ff580fea3886be2ae20ee42d4e88bbc8cf1aee91bcce1c637e1912f7a1cf70473c407dd995639c3f0f1de37dad67e231f2e3d431c69b0d315738afd0e40bdc7ff94aec233ff11da3ffce1bd6985f92fe9486bee7b007def4b734251e439ee12db1803e828e639c7f3a259690ef6ae618ef5bf8c4d47ff697c41ae5a3b6637c5f513a46fc047be7cdf8b47f768cfd8809711bf6103c3bc6f9c9057117e593269ffa8faa88fb907f76ea18e7c114f110d7c7b78ef13da0a9638cef241fa33f8cc74d798ef2d9ca31f6dfdf8805f411270d6bc457244fd33ff1be5f40acd03fcbc231e2ad3db1d68887d17fb96e41ff9b27e236cac7a163c483478e61ff3be21e5835dcd7587f85bf16a63f63fe5a1093ff0cef8825f43fef12fbd0d7bc454cfdbb82ff3057437ff337e20ef4550e1ca37f5d12f7a0bff0d431d6b31f88fb547e4a3c803e76ca31f4171093beb7470d43de5b7a3ee35fd19f23c758efa81c231e68eec7717db4708cf7759af60a5c1f5c3bc6fcea8c58c29ea275c3d0e736718cf8bb9107f983f59e5869cc977d628debe3a5638c57d45e632f583fdc3a46fc7048dcc6f304778ef13e4287b883fa54e818f32f6aafeee2fe45535f1ff96ae918ef5f8d8987b87fba758cf97b933fd6787f18f62d1bff12c03f9a6818fa2e18f110f25e751dc31f36e549bf7187788ceb839963ec57b71ce33ce20db1c0f3ad0e8925ca877bc7781fe094d8873c933bc790e7de31f441cf67c663e8f7da31d6e7a1fffa03e3583f693b863f3f748cf7137ce236e9e7cd31d6d39f893b789ea8748cf3eb240fa34fc8fbd131c6d7d231de573c22eea13de98a7880f27ae118eb15778ee19f2f88871ae3ef867884f696178e719e7a42cc51be5a139b64ef87f1c537fa863e5f88693cde868ef13ed2393187fd14978eb1de281b86fcd3a63e9ffcfba061d24f53bf827cab91638c779e639c579b106bd8cf06fec7d486e75f6f88dba82f79748cef97a58ee10f347187faf7d031d6cb493e467ff87e89ef18e7df6e887ba82f683bc6f8bb710c7d90fc8cfe70beb3728cf19c118fa09ff489788cf6a8d831ce77e5c482f4d9e44be4af868e711e3323f6610fc5d631ce7bbc126bd4579d38c67a26c60bd5e87ff14c4cfa2b7c624de371d731e61bb067531acfb3ee1377507eae1ce3fccfda31fac72b7117f2dbc4c43df2dfc78ea10f4ddcc7f541cf31c6c363c7f09f9c7880fb9797c42394d763c7287fed18ebef5be231e4a9e9f94dffc37a29770cf92f8925954f88493fcb8c58a1fee4c931dee73e778cf9b424d66085ebcd6c00fa598f8835f93bf8775dff42062bcf9098e49bf68829fe89268ea1bf5be23ee4a50bc7d84fa1fb1b79a23f948e315f3e730cfff44a4ce39b6e3b86bd0f89c7b83eb9740c7fb8758cf3894dfb38e967e218fb5f8258a0fe843bc6faff29b144fde5d031d65362629ffaeb9b639c1fb82226fda9d231f4131193be66cb8ff491903eece123bd4f1ff6f091dea70f7bf848efd3873d7ca4f7e9c31e3ed2fbf4610f1fe97dfab0878ff43e7dd8c3477a9f3eece123bd4fbf650f1ef3b827ec4fd2f3cddfc2244579c2d3e67f559d6ffe0dcc1f69fe2ff0185d199abcc88bed3591f963fec7fcbfb9da4bcc1f6ed8d465feaeafad4bb3af6d795d33b509ff26688dfd3935b50ad46aef9f9a9fb9f99b7999977b85577af9179eb64961fd349fe5872605e6a9439bbebabddf47faf7f660f5a68c0c1323a1cafcdbc85a7cb20c2bbb5aaff3ba14646a7399b7f096decac88fdb1a542d43d803d512d0ffa726ad6bcbfbda96db7624f6a7d4d4636cc1dc4bc2b66cab22d3aad8fcbfb5519baf4c89c8db785b6fe7edbf5867dd1e7ac2cff298b55e69ebb7d6fd23a6dfb00765f4554bb591b168acc1e5e37f9a72ccfccb6dbf54de8177e81d79c7dec4fcc4a8f7864d79f4595bc789f51d69ed2fbeb6e5b69ec85a434aed39a5bbfbd696eb5e9e5bdbe464ddf5939c79e7de8537f52e3fabaff1348949d1bfbd6bfda4d197ece5c748bf610fc2e8921be94aefcabbf66e20af4f3eda784e8c0581776bbdb1b4ba096cfeccbbf3eebd07efd17b325733abf3d0f64e617b6a5d4b60fbdb33d5a2bfbeedf6cadabf4456872fc6cfbc9adadfbc96d7f63a5ed7eb91b52a3b6224d657f4bd8137f446dec1e7b591a7497f4bd7f67eeaa7b40769c7dbbadf8f8d8364755fb3ff6fb5606380d04b18678249e69b72a1d5b4e9954c31cd0216b288c52c61a9d110b3f99c7c85bd9e652cb79e1716f6a7fc2fe926b175302f608577c84a56b1395bb0255bb1b5b55a655b1b788a6dd896edd89e1d7c7ebf77d103fbf2f805cf616d4cfd84f6a0eb78affe971db22376cc26e4a3d1c31376e2bdb15376c6ced90593d63aa8ef1b691eb229bb6457ec9addb05b366377f67fa5fd63ed81ddb307f6c8b8bd8eff19f9dabba5b006dbabdf4c3b9fd8337b61afec8db5589b7558d7d6ff6c470fc67aaccf066cc846ccff427da14b751cfd993dd8c882ece1a7f40fa119ddd1af0fd9d874edfb77f61073c6b937e2824bee73c5b58de5226b0fb9c779c0431ef198273ce519cf79c14bdbf3ea31dd460abce273d6e10b1b9f5074f2b5c96a884620b6e64bbee26bbee15bbee37b7ec00ff911abed4f9b72075693313fe6137ec24fcdd8a2be505f133f4475ad5fc845f45bdf33f9d67afba7d26fc60faf753ccdcff8b9b1870b3ead476192cb9a5ff22b7ecd6ff82d9ff13b7667c7174402a7fc9e3ff047b6e54ffc99bff057fec65bbc6db51e581f61467cdee15ddee37d3e30fad2cdbcf66b12b5a68e0a241ff2111f9bdb33c185b09e2a1752f86c62f2d1e6b08e6d84125a04c662e517f49df292b745fd15aab07ed62f4984f92232f9b1f809edc18ea8757f09452a32918bc28d073d6f294a5189b958f04090ac6aef508fd3b3a55889b5d8886d1d81b042ecc45e1c884371248e6d39e9293e151371224ec59938af3d477d2f7151ebccce134231ad6317eb01223b6e7da9bf66762ca8733371c92a7125aec58db86d669c9f954f4c64732766750943af4ddce245e2ceb4e7de44a387e2413c8a27f1cc9ec44b338bb09e4fd74fc79fc42b8f4c8937d1126d1b2fbd5a0f9a8b8ee88a9ee88b81a7c4ad188a91189b21f45832f32491e462643a9690d2461eba96a9f465fd01452d03db3f427b3765738c3f96918c25e2dfd48edcf50c29e4461f6c235399c95c16ff697bf0d0cfccb82f4b59c9b9e933d23c1d67777221977225d77223b71c737266e3b6b59d5526ac2f7772cfcf6b59cd96f2401eca2379ccd25a5a884be4449ec8537926cfe5859c5acfb29697a22fa59d7724769e50d18a4168e7069faf0f2116d1b5eec58bbc92d752d9f9653dfee49f7b74c4bbf2c6d4ddcc50ed5a9abc95337967e6c71d792f1fe4a37c92cff245beca371a3f989d33a53290f51776eaaf76d45f1a18c8a1cdedc9911cfb9ecfeacfcfc9034ff9d2f7e50b8bebe3d9bed1a7b8f3433ff2633f11917d7a3327f6533ff373bf6043bf346d8dc88679fd9c7ee5cffd85bff457f6ff11a3733b9332d2e3b169c1a93f67a7dfc01e98edf5c63ff86b7fe36fe5c8b4eccadff97bffc03fe47b56aff531ffc83e23b76b4ea2b664ffd89ff82766c6677bb5f1c2b17fea9ff9e7fe85c99bd69a62d2bff4affc6bffc6bff567a6874e45ecdff9f7fe83ff68f4794033dac87a07c4aa9fad4fd8354e1317d6adf29ff8ab77c79fbd1ebcda17eda7b62b615aebdb5ecaedf3bd9a98e28c1ff8cffe8bffeabfb123bf255efcb6dff1bb7e8f64001fa4fcfafdf9a13f12f57ba266aaa2b88d254ccb94f0eb77217da55877b6545a052a54918a55c217c62349ff45a52af3cf55eea5e6fee66954e15f99f2a5aad45cac38530bfb34b57d2b7628576aa956aaee5d92ec81d939b5b17db5515bb5537b6ff20decc1aee398d61fa84375c4fae6e72ba9e44e1dab8989070e783d2feb59cd619d505bfd25ea449daa3371697d9db16319f8af2a51e7eac2cc276a6d3035554a5daa2b75ad6e78c78e116d75cb866aa6ee8c95d959a82959cf3ee6f59cd668fab3f1bc5921ad230975af1ed4a399c530bb8250dbd1e7f6204dfbd7c67a6a4b50626adb6b57a9d413bb923df5ac5ed4abbc556fe252b5e452b5c957534d22541dd5553d7f2a56aaaf066ae8a2d950d5ef0a8f8d8bec7a89186b663f5d27ebf3cd5a1b4b9fe84087c65e9feaf23af27afc40bee858273ad5193bacdbe5d672381fe95c17bad4157c24e646d6328d6761a99eeb85198dd36f600f217a083bd44bbd323ebe10e762a1d7fe83de7c5aaf746bc5b51ddba8dd1be9addee9bd9d7184b5d713521fe8437d24785da718e863ff861dfb8f7aa24ff4a93e3333c13b11eb73bed1177aeadd58395b49cf96fa525fe96b3efd621b131b8bc66aad6f7860ec4123ae859d7c660fb5df60eacdc835b66becccabcc08a8a45477fa96857ac6665eaaef4cd77f563d13d7a476f492368a11460af7fac18c79267ed28ffa493f5beb13b577e3957ed1af2c960376afdfeaf72aeb77a1eaf72d78bb3ee5af5f7dae8f75642512894b3d62911e075ec0d84dc0cdc8a3b11286d97d20f422309d08ebeb33da0d428cc6d240053a10ec1fda3ff9ddf1c2f4e62008c220127e100749900699d6b4ce0fbb4eac358434f20bc6833c2882d250642ddb3c695005f360c1bbc1d29ff9472251ad6025e37a6409d6c12608bcda272856045bff2ad8a9a9d1acb2fd3931d18a6217c1defb2c7eb27b4ba9bd8354a3e02038345e047b28b585069f3f0f5372a8b477859534371aa5fc2c380a8e834970625a52d908446275dd78937a54b77d511fab1b3f0c4e3da5f2e02c380f2eac3fb43116eb07cb60aa2af6145c0657c1757013dc06b3e02eb8f7c6ea3178081e65db9b044f36ceeaf1bd3e5261f01cbc04afc19b58042d1b81d5ebc126daf40e4d3bda41478d4c1b6de442eb78f6dfc00fba412fe807836f600f218d9f13bd0c86c1487655128c8d6f48cdb8ab6daf61b44f441ecdc65d3cf442a646e6e767f3043d783c396423751372390f85bf3541b4ef1f7b66980d8d71e989e921f5bd24bb0f387b0e83b05ea9a8472b1146fa348cc3447eaedf10b354af947998f29b30f35b616ea2f2032f0a8b2fcc47e61e0f2ec3d2f8800831bdf519f57370b661c76115cebd89dd67ab9f25a35892fc209bb06db80897fe93d886ab701d6e74ed29b4991599f1c43cf336dc85fbb0d4c7e14178a85be151c8c363f5104ec293f0343c0b4b33fef8b59db12c3c0f2fc2a93c0e2fc32b9d861bc1edda7dbd27f86c6470185e8737e1adb1878856fa2524cb143b0967e19db116e11dfec7ed21b21ad1e60918df84f7e143f8183e85cfa17922f207c2ee1f09ac175be9999f783b7c095fc598223e663567a4aecfc2b7b015b6c34ed80d7b615f9808896df4241cf80331ac7b06333ec1445717fa251cea33a357cd36e1281c479e577ebebf61bd522a2e2316994960b88f6420223f52669e3b3656f1f97eb6192bc456df44dabbc4fccd485f21def784f0f93c0a646962dd9eddd70e69459e6196a1daea9a4551182ea3288aa324ec9b5e9dd4f31566bd51944659f02836917140fa35caa342cda252ada22a9a478be035dc46b6cd3ae23a5a45ebe035da44db6817eda383e8303a727b43524debf1223a1663fb846b4f34b3e77aadc5afeb9cc8d537b00769c7336315bcf206d149742a7bd199b88aced59d6a471774c2012b4c18196dec65f2a6ac1d7dbe7fd88bae8265741d24d14d741bcde45bad93686bb478a70ec8d744667c3888eea387e831145e1e3d45cfd18b89dc22efb3f8c99e4448a3d7e82d6af93c6a4765d4d161d48d7a721ff5d917e36f358a06d150f2663471fb7351348ac6b117333be60534ea088a6252ce621e8b58c67eacd84d38e75b81f32009f6d64d4c94ca55ace5b99ac7411cc6517419c77112a77116e7ca37d7748cc7a9ec1e4b1a17711957c1969fc7f378112fe395774d6735541dadc5ebd8cc228c3d987e54cfc7bccaae97d452566a5d8f177265a2cec8fa65ec13fc89fde1afb68766ef49b2d3781befe2bd188b3c3e880ff5303e0a6233dfca29fe0d3eed601a5ac6c7f1a41e2f7e9dc42ddfc527ba151c44ddf8d4cc3f8ce5c767c607b3f8bc1e31663865732082f8229e065b3de0fdf832d8da9599cfe34365f72ed7fa2cbe8aaf4d507913dfc6b3f82ebe8f1fe247affcacbc994bc44f6c173ff3292255670fa61efe1cbf989860ebbd19bf1d34bbf3339cad31f9b2885fe337b5e799dcc948d8ebedba08f4919aa76e05d3f02c6e9b3f9db81bf7e2be0ee3413c8c4751c986f11574168feba028e18908976610dc24bef959f13a82aae325a1de824bb9d245d055236b6bafe46703ebabe6fa41fb41dbcc480ff8196217dbc6f597d6dfff667b0869a788cb49a293c0f4619584e2258992383e61afc12e498c64035ab56c4e4a097590a449f6b93d18ffff9ae449211f9232a992392bea7e17aa649164fe5d62d70f6985e92a5925eb64936ca33cd99979ae30f381cfe387d49eafe2582f0a45b24f0e9285384f567c21a27a05fd57e54572981c25c7be974cf4bbfd756a7fa48f830313cd9cd1fe1a471ee5d7250271999c24a7c959b44dce930b672d767f8e4ff569324d2e932b15eb32b94e6e4c4b6ef5abf790cc92bbe43e79a857544d3bc3f02179d43c9cc60b1daa2a68274fc973f292bcd2ea2c63ccae3f6c93b7662cb673636e7768c3c04f5a414fed83809dd0f9018155cc7fdc1e523a2115cab1bfe7b7666e5d4be7d4686ba91e9376d2895a4937be62138abc229c589365d24bfa9fdb8389d5d7c945b24c06c9301925882f84f7961a0388a7f5aa147615ad4fcd5296f2d43861d3f319b7e7b33e6b5f8fa293147a132ffe39afa312667c2cfb82fd48de4efd54a59a3febe8d3fe65b30aafa6699086acebe1440d4ebda4b3e69445ed9b5395a7511af3be1fbcb3955a67a91ca6499aa6599a27976921ba6220d2b48cb5e62a4aab746eecccf8505ea68b7499aea203f6aaf3e0446cf4537297aebd41ba3172ae63f024ddc4eb749beef415bf8c96a6c7758dad5de2b481893fa6ba0c7ae95e8df854f2fa4fb4f4ce8c457cf6bc7fbb3d289a7306b2480fd2c3f4480ea957c4de3a0c55cb1b887d7a1cc4ecde5ac21c32aaed3bfdc27851fb435dcfbe7d759df4646ce77546d6e9497aaa5ad2b7a320e2ecd88bfc59bc4acfd2f3f4a28e1dd897e68f8cd60ee123c2749a5ea65766767ac77ad0e4afca0bd64dafd39bf4d6eebee37cd6bbb37fe2259da577a2d674ddcec4f985a4d1bbf93737b3c6617a9f3e30ffdd692f1b4fa78fea217d32da7f8e236f6cfaf98129f992bea66fbae58f8c519f784cf5d256bc10a7693b19ab03d3c70fa37eda49b7519c7679e9adedfa03139bb417dffa2f69dfa4413a604faacff77258b7586c63990ed391b7353963f654e7675ef627ce1b7ead3d50ffb52b28e96dc6339149336669ec18ce96fc29f33395e92cc8426311a1f11c56cab53d64d117ec21c46aa0d15757dd795d2fcae2da8332c52f33ec95d7da9ddb5327077e2f4be29d4cedffd45ee3f3f308d2136e8c379e341499e9de5996e56680565f928f08b222abe77d36ee7d7f1ab7fe89df67556666c376ed41d1692fd5acbddafbd5b692d7a72cb285187cb2245a9d1d67cb7a0d3a5b656bdef6d2249477d94645d936bd919e1d7d0f8241b0ca76e163b6cf0e687438c80eb3a370efdfc949bd32cf5410f0343bce26719a9d64a7d999aab2137d2872ef4c4cbd6796aa6d769e5d6453f3ff97f6efabec5a8cd053ff497ba0f54956afe50597d94d761bb4664b5ab37fb1f3e13b59f27e709ecd642eea7e8c08d4cc8678579c7f561fb311426d63666a68bdf1ad9509c64d496b1df5aa6d65a2b7177699bc18af7160774dc417ec41e3ec5a3307f0c2ec2ebbcf1e3c3b27fa3cbe3273974cdc18a9affd23cc1e7e690fa6674eecfe78e84e050b27099c0fac6c0479c5a7a61c6bce83d21f1309658fd953741c56c9de9bd9ddf56ef6cc62339348ec6868468bec453d64afd99b8970eee9d4f995bacb5a71154722b096c85937d8c4955aa955786bfede069de838ea656d332ac87a3f2beb042add2933a244c7ba34f92aeba68f7fe6bce157da83b212afd72279d60b8eb3be5c60c785f456cf2972a5b9970dfc00eb49b51c459a0db3d117fc833d63cd993d0b2febfd66ab957ad6f86a679baf763e66f720b331dbcbe7dcb3a53956033eab0f6799b85d2de0753d39cb79d06787b6d59fef6f4adc6f462b6d9f228777166b773f1a1b98d12928ec2cda318437e7f8b13249b6a0ecb3e4f24d2afd2c552e708a944df4a0def7f6c6b9acc73071c1ee79aca722b57b34a19d1f85de8cad64c447ccb7fb9b420e652ea3dc0f7c35ca7dfd105cb03457e985ae473921031eabb532f215e3c0176335d2d35c9bfafeed09e0bfcd1e129a37304ff381b7cd83bce939763d9f63353b0a4d04508fa6465ef6447d1e4553ee4bef6b5b427bdbf664b408f4451eab27acc434a3f7ef5c1f1a292679cacf8daf7afebbe65f3f5bfacdf102c978b14c865efc9067788b827cb5987d3a538811d4f69824ccf3bc509f9d5ffebde4fc4ebde27198977965cf9ce0fd9e3f707aca537291cffdbd3cc0baeab796ecf7997e339e844fada3f759bec897c95e3527a434ed1aa1046665497261cfa304667c3d659baf6f8bf5c5f52c85e5ab7c1d5fe71bda0f137fc81ea27ccb6b6b58dbf77b3edbeffe487f24fdde79393b5a9ad1d00fc484ce1f45362e74b1776d172ec616760f4b627fe3eb9287d304f3daa2148fe7fcd4da5d68a3c6e00f8c17754b7bb685b597fa9be2ed9f2dfdcefe262ca23eb9b38e5e4d9410d2089f7e8ab85c54657566f4a9e4c844f05f1ddfb8f774cc3df28d5f99bb3571be6c568f7ff37a6ddfbac1a9fe1ff6bceb3f9d7ec73f346fe732bb5ba53d7af316eba8bf98ad89e64c22f5eaaf3f2fcddc5b3eda7a9c146fd5d2298adfad8fd6caf0d66de07de10d8b8ff4fbe977cec330775e2bb22b8775ffd3765df5935fa877179ab3ca12b3927cf7f53d94def4833d24f5db54b47e1d591dff81f985fd1b3bd9bc8e433ed2d7a7df3e3f496753998d17423a7d1ee0a4f227fff0694dc6fa8f97e65ce3d7250f2708ed2e9e3dcb96d0789536b39adfb93eb4d61ad2153fe8fbf8ff74faf81ec8477a9f3eece123bd4f1ff6f091dea70f7bf848efd3873d7ca4f7e9c31e3ed2fbf4610f1fe97dfab0878ff43e7dd8c3477a9f3eece123bd4f1ff6f091dea70f7bf848efd3873d7ca4f7e9c31e3ed2fbf4610f1fe97dfab0878ff43efd3cf6604f5945ee4dcce6eb58782bdd7d9ff48f9de5fe71d34f650fcc9d0166cdf929bcc78d77727ffd1b1d7ec6f4b3d903fd54a7b51cb28c4d985fbf39fdfefcdfcf9c7e227b60f6dd1e9cf10cbd37ce59212ec5a5b7e2f7ded5fb777b7f662ff113d983b0df30acbd444f0ea3a37c2f5ebcbed7cf0fbc767e2806f8d68a2bfb610f3f78a2d3e17514b960f7acafaef2a3fc389fe427b2cc4fe56dfd45ba776f937cd8c34f90f0857596f1b61ae667f97978925fe4d3fc32bf0a851c365fd1ff79ade167b2077af330afc70ad6cdaff94518e437f96d3ecbef78accc18f2fe37427debd67eabf413d903879ed9c4df8a9e7ecbeff387fc513ce74f599bef549b719a79e00b613fe9fb3c3f913de05db3dc9b856176973fe72f7c93bf269b7c1ebfb1d21bfb8f262ff09a2fc7fda4df13f989eca18e24233934b3cc544df2373ef76f4296b7f2226fe79df84aacf005b7f76f27ff7ce9e7b2873a9614973ccebb79cf1b0407793fbbf69f835de6e963d667f5d7a2c30f7bf8d66df8cf24bc8f5ccf2dc4793e100bd9f5398bf3613e8ab7f13c1ff3bdf4d984ddc122be756bbf55fa89ecc1ae562ba1daf1939f71919cf22ca9b49f5d07abc2cbda61879d4ace32fb55d09f7686f173d98397f36711cb56c4fc89bef11eb255c1b2d782f379de2e4421f9b158b1496d113f6bfa89ecc1fe564e762f5ed8283d97155feb56bc2cfca4f279a1c45bf292657c275ec4257cc4cf997e1c7bf8c59745c5bf49b57f785177852e02d90b9e951fb48b307c2ca2222e12355717612732330d6f51ff9661bbf7a5e81bba3fc97ac48f640fef7f7ebf13f1eee7da3ff87a92b68a346449153caab8c874a0fd228f4ffccbec515da4b7fe2c1466d4089b6f657dd8c3f79d3e7dc7e897a71a1a7b08b8bf090fb26b134dbe26f5af18df8ad3f0319e14aa288a52bfa911eb7b33fb7b52f10dad9f68c6f1e3d9c32f47884ffff3c91ef4a4b687b0823da46f695e54e23415c9717cc245318fcfe32b7d663c444ea726d8cf33dff8d1ece1df460e9fe207e31fd43c3c281666bc68a779f2943c15cba28afdc0cbaef551745eac8ab5f0f9540eed37ee3eece1bb4dbf7de6adb687e828b88ccf8b8d3accaee3857e2db6c993962aaa2d223c8bbae2aad8157b7521c6f24d16f57ae5a728e267483f8e3dfcfa04a419fd73333ef8ccafff3554af33e5a150073c89fce240df5a7b58a66f2a5291f112bc388c6fb3919e050bb60c62ef5008fb7b413fece1bb4cbfb60736619cdd87c2cc15eecd4ff5ef7ccdd944acd455de298ef8a638ceae825eb1853d6899be1593a8d41de33776e2ba38116376606719acf9ed293f43fa81ec41599f80c871edcdc4a59cb0ae4845ca4ea5b10363151bb6513da98a53aed4697156b0b8d449ed1bea114395c622ce8337ef9e5de76bbe2d2ebc7128c4e0d36f35a4fbb0e6abcd3f62fa71eca14ef68be6f52c221397de587ad93c3fcec7c5541feb81b71497ac906f62abcfe3a32ce06fc5a51e1757b577404a9ed23c780c9eb3ebe2da1f14373c36b38c4db356f9eeb7e1a4f8a6ff8f987e1c7ba0b9a5d1931c9a7e1d8bf364af776c19aed24171ab27e25cf822caaf822c1f14b342f12c3c5371f244d650d67fd75165b6e237818856a98e9fc2d09bc11ee837b5c053b8df00f3e3a51fc81ef02d7e630fcc1797fe2e1fb327bde222dec6c7e2da9b16a2b88bb6d1563f9af9e4bd7f533c885315237a207b302386e6e1a12e8b4791154ff1b99a9a7126aba3517657ff9e956ffd8cff7cfaf1ecc15b9ba85116cfc58bb74d8fd9b4780dfa791abd149be2ad6865776a12bf15857af01e8ab6e64d34893fb58708dad9557caf4ef3dba223ce4d4c796f7fefdeac4ef5db5cf84df13f6a7cf903d943d8ac2bb349b29459d1e5fda2c75a3ecfee358b87f1366f9b91a25f0c8ab21816a3c0537ef2993d98d8722c4ea390bd16e3b45f7ac2573db1125244ea4971f9c6a7c62afce664fe8f977e287be076d619b1ccce225eb275d1ab7f77bcee94ace472152ee36e29d852b0528683e039784cf34ff6d0c494092ffd52f1309b85ba78115b762a021ea7b7fc80efa4e71daadccc60b36ffdb4ff54fa81ec8135f62087a6174fd444cdfd2bbe6671303349853c3ed117eabad4652057c9adaaf4a258fe329eac533deb8cd3e4363ef1efcbb08cc4d8d8425274cab84c8ad3d293a91fd46bd9dffa79ff99f4e3d8c3bb1961ceeebd312be3377f121f96697856b4c3333d2fb342e9a57fa54ecb3c0acb428f5d34f92ed53165ec972cdcf893c4cc3acbd2fca9ca79342d1779dbcf7862bcc4323ab2ef7335bf35ea87997ffe38f6f0ee77f5448c974bf5e867e5aa5ccbd3f02c68ebd7e03a1121570fec5576f85bb951bee6ce3b44cd4fc953bddf59faf52a8478e44a9445873d155eb9d547e52e2fcb453a5613a98464dcee7faa4ff7fe11d20f6a0f137610f8715f2cb2409e076f45a5b99937ac748b67a92af7ba234e8baa587eee1dec1c635b9c0733735d9f0b3537b391bdbe08fada0b5979501e063b3f63253b149776355be237d3fe28e947b2076713517daa5e7afa5cb03cc8eee3b4a8d2dc58444f07e55176924dc569d04bde79875f2633c73023462c8b915e8a0557718b6fd8a5771fcb6c94768a5d799c9fc74ffe8c1566cc0870ef1fc5267e247b70e75f7296e9b35ce75d75a466e524bead2347d3eb972a56cb6416de18df30f977de01ab10fa35bbf479d02f86f9031b9727e6e7e7609654fc4d9e85cbe42552a227dfea31a37e63fcc7797fe787b207f2dcb57f1097d1b678e1fd78571cc7b74555c705aa34f3096ea2065eef72ffda3b7c9a73da98722c4ebd07ed654179caa6e22a0a83eba853b483e778c2a6d13cdc9667fc5cf27a2dc2ae607fd8c3ffb2d4d843fd85b0da3fd87dccbe9ad5f6604687a75afff5df9f5b824b6ece59af42243355f11b7619dfb156711c3e96e7e585b1ab3bb5e26b7fcd4ff479f226eb75cbfcc31efe7726fa926062fd83145d75913f95d3ec9e4571d9ac3bfd7abda1662dc937949fbc44fa565e16a10e79565e25b751379b86c7f5d9db6812a7e5b5ff963dd4e72cd5545cda5375a25efbf811d2f76b0f9f9d8db4a756ec79a69e7d4b735cdcfa77e19cbf65abf4e94b2b0dbf9dcc98b212a7e244b7c2c7ec2a5ea64ff528a3b94e7527acbc41d8cf077c677740f31fe7bcccf76e0fef984e31d5a75558c60ef82e4bcb1b3367ccc2b366dfea6b52adfb40177eb837e930e895b7b53dd467b1b355b967afe5acbcd313be371ea268be62f9fda7efd71e9ae4fc4348f610ce9626ee5f1677e57df6c05ea36eec1793afb7877af73bcd55ac17667652d973f96f766d621275ca87f231de4533ff5a9cab767d46e247390ff1e3d9433ddfe4cfdeb87c2a9ffd096ba5bba2ddec5b7d9d3de024beb9d6a44fe76eeb3333c135cffc9bfc21edb332ba0ac58f7332e2fbb587cfc60b670f7228b93a5093f225d80407ba13eb3f650f346a9828b344f48958d3cc4f2e93c7a8ad3dbdac7740a52a5fcdac33f8d6f2f87bd2f76e0fefced7874d4ebdfaa086fec87f296591672741afe9dd5f9fccfca3fc340fad7faa4f59ea058bcab72c0896591a3f954be38f3eece11ba75ff80613cf7dd2089bf0b61a15b7e5a26c25b776b5fa4f5ac3e76308f98c38f6bd0775a32fcab6baf30e25f77adf5a1e7f4ffadeedc14472b9fd2e79e65dd53fdb3f336f5976a2b7725576b357716afcfbbf5b81fa5dddfffaffea31c3cc3c44e997bdecba9471d71fc954c81fe584ccf7630fef7f1b01ed5bf5ea776e241797bccda7ec5e06c626ecf7464510c4c9203d662d3d0fa7f53b9a7f937fa0547b887a0754ae782ef2b22f226383d1bb13d8efde2effd4faef217dcff6507f3b50bec93cbee2316379fd4ef63df3ed3b58c3bce3efb35938280741bb1cda28e06fb507cd8b3011eaa19cd55faf143e2b9aef5fd3fe56f84b7bf85ed2f7680fce1aee559bc7e528d8966375173fa9a97cb3efe7f5d5883f08a606c92d8bec3987f2efb687348fb50e79a897919fecf99e4fbd45d3cefae49e271d7d5716f1fdda83f503d3f2291897cf95c7b7156365b4657d7de68d2bee67c57dfe5a9f8dfa336b93bf9f8a65d08b6f7dee3f47337d2e334410f69d417c43847d6af7f7e427be1f7ba853335ad46b4ede8cf5c5792192974a048bb855d46f6395f1953f8bb6950cf62cf12e7459b471a6fefd6ef6dfe321541c9e95fb745ff97a173f794bec74523b034fbf8f1d3eece19f49bfb487fa3bd47a572ef4320b2ac592b85be96c2eba5550886c9da7559854b1b6a3c53f600fc5a4689b39e743bc8ddf8a0bf1627f63c2dace6f727ac7ef239efc87d37b7b60f7f9557191f6b9905d76a93db52f8ab45545c60426c52a585649bdb3f9f7ad3dfc728e529f9088752ad86595aab9aaf7b556de8c3f87a29ee99859cf90be3ff5610fff6072b38ba8feb2477ec54ab63411fe5df9968dd8aeca7864fa6a27ee179b2a67c37a27cbad3dfcadf1a4f50fcba252553c0956bc5f9c8a6d18ca376f995f095fc4c9d25805be3f25decf8bfef7a7efc71edef9863a6acba3236fcc46655b5eb156f65a15e5be2ad561b9904b35cf54bc930f3a4c66e52dbef5f1f75a439d8aa55e04b35485f3649bb5f9811ec45755a5afaab99c89aea8bf15c079e97ee74ef8d79efe3f95be1f7b40c2db2ff8f28ff0d55d79570c83f340c5b78971dcc5ab0aa297e8451db2619215976eb4f89bbd03ec41c5e2d4bbd7b36a116ef524ec944f79d7c4b495c8f30edf8900df3ea63734be93ef877cbff66066fc87f179fd4e9ef674273c3333cb4e393163478b4dcddf93e0392addb9877fc01eec9a543b96eac69f18ab147927f3d25669663ad5b26633e718d727f26985ea3b394ff73dd9c3a755e07a354aacf83eef248b6a552cb293a80cdae1592ae479f95866a90a3c331bbca8d6ffc44841a92c96a51f3ed6116571244a33d379a936e2291b96327aa9b6c58dd8be3f91ffada5f7c7d2f76b0ff509eabc5b9fa8972ff16d78a3c77a214e55153e065ebc08cf829eddb7f8073c03527d32462dcb4df9c837d5325c252ffe7d29f54d9989fa0dd19bb41fc4f5897cfcdebe0f7bf8fbd3fb130ff5373fa4e75fc7476c9aaa6c1597092f264555fac19d99553cea85f1e6cb7f66a4f8640f412f9b9657d52e3e36730cafda5707fcad3ae499ec04a1ffe287629c2cad87f86edef6fd3eeda17e4353bee9e32ce5399d981dd7e71b4dcc5fbf6f73995cda37f9ff315bb0a9feba50bbb8cc46c56bf8501d1545755c4d742b4eebb7b8f86d7c9c8962ca64283eece19f49efbf3bcc78bd3a196eb960af511cfbc61b6cab137b9aed09a7a1d2d75f6aefefb607fb2e47ac83ea3438afcefc75755e5d54d358991873a0cbead2cc74fcbca386e292f9f55b21df5a7a7f2c7d3ff6d0cce33d5dff5655ffd11bcb015bcaabaad465f298e6ffa82ff837f69070e597039fa71dfe9ab7b2a78419cb5c8437aa2a27d555755ddc5695892927dfcffb19df973dd8bd435d47937c5a9f9855f3224d6f82e7d2ffcfdb439dd23ce805d76a9baaeaa6ba6571b60ab419b1c6e13e7b2d5eab19abca9188bdd9b796dd1f4fdf8f3d20e1b7a2b1cccc36e3e226eef28dcf54559f98fd16f650c72be14d70adc3ea2ea982eb645647b19a0777d5bd19451e2aaf9222adbf2ec4eebeb5e4fe58faeeec816617fa4c8c8b4eb564d3e4b6deb5fa36f650c72ab545c4be380da7e94a77ebf3f9e530d0d949d4cbd36c5ddc445b33331e7e2fef6f7d3ff6f06eff62cdb86a5741f518b7f82d6617ff797b68be4f68bf2130ae53fdd64e3daba9bf48c6a2ec5e0daa277d2e3d13417c37a76dbf277b707bc7eb7aaf3b9bb3a7a26043efa19e5dfc83eb907fc04b18abd8d6f35d3303b5bf4b237d0af7e59edf56cfd563f3bbe2bf8ff4fdd8c3a7355f33db2c82cb7a2fab7a09ce032feafcf9f7af7e9d6a9dfe95d3d8741e9fc77ed48deff287709bcdfd80dd7f2f6ff47d5ff6d0bc8f272ef520d97bdb6c564d924a2ddf7d47f22ff5f3628984af877c552af13b13605349fd558092b5f44531670faccbee3fe2c9bf9a3eade0d04c13df23565ec47c7dc6977e28aefde7e22cbe3573bce4eff00fc5b68e04d2a7f4c98c3f7963139ff4fcc7ed2ae1c1a3eea445b6944b3de1e77c5adbc3fbb331ff5bd723fef7dac3bbd350bffc6d79b9125ce75ed68ecec5261b05d7d5ebdfe11fec3cb1973c16ede451bfd6112a56bc610f5f73fe327932338c765295995ee6ed725c7f25dfee7b7fd8c35f4abffafe4b84df86250bc9f9717117bdb10bff260afff4fb78bf4ae5d0cc5adb665e70a2aae03ad676cee2fcc2d79dc7adcf4e6557f225def92f453fbeaabf2af4610f7f2dd56f38d97fe9fc0bcb94088558e933d657d3b2acdeeaaf3be8322aeb33717f35d9afc1b48359ba93a7d96be0056fe14dc23fe57f9d3d981967c5229feb23de2f5ea2ed873dfcf5f48b775a7236e153f9e68dfd1d8f452fec5491bfcf8ae020b94a66eff5f617ec615c7f4d30ef9759384855f8284ecb3fed776a7b88d3da1ed451716a7fef52f6610f7f2d35bf29b94ecce753118b6eb18ecff34ed1af5a69bf6a97bb228a17f5b997bfc31eeabdca4464d7f15df11a9cf34c55e1f19f7d13b8b10735abfd83b1e0cb0f7bf8abc97e29ceda03bd8bd55313390ff6f97de4278beaa9da571d791eccfe96b5eafaecdb45f0264f59ab52e569d50d2bb52dc23fbbce85f8219ef04ddcb5f1c3473cf99753630fdebadecd14ff7f7befd5dc38ae858bbe9fbf817796952ca9ce9365cbb692956ccbd21b0022308351a1eafef7bb0052dd6a77983d3d3d7bdba758abba258b09043eac8c0549af8862b7b24d63b1a771b0a43066c8250fd598fdb3fc0655aec7543bbc0d323767037b1eb7cb3ac77f9f437c6f5fe089b5abf1f04fa9d4202c870a92875cf5d59b7b88bdb883aed0157954d891c14434fe44e442d70062999b7a77f626be164795aba33f8f576265f644f80fb1f61539d101ec93a6b811fbd8e2436b80a2f3eaef8f4e1f1a0fd254517028656dd20a02df0e7d11e1408e9d9647f85584bc973f13b9d0785076dc651e3ce118aef1bd3db4ba38a8d6fbfd8778f85adbd60fe54058d698ce508694f64f7e96fd743e071e08d5f5a0d8537c54332ea3a97ce4428de49cb9bf5f29ec5b3c78d87bf1092e04487cf41a252a158b58aa6b977bff31e2bed8a4cac371cf7a46dd73fce272edf7c7a68f8b872f1e6abdbb49071f492895e804bd20977751cc5ce69ee3cbdf8cc5ef118ca0a3fc2399d199f7168ee27ea4fcbb60633d475263ee3fbf4fc91f38d6b50054e15ef1a3ea583ac7bace7ff88764f0808cef01134736fd07f7ce9e3b6015f27eb963c13f8b445e52199114cfea46a4511275543fb1a40a4482825c8dff06073aeff26b7664439338c316eb990cca1a0fff90ca3a2b251ea48c560916a9ce76881a3a9bfebb31fa47f685f63e900775c2db84f80f613f1af351d896aec4c17d34f81b364685079d1f25b1ae3ea7bd0f757ed49fa00b3cac198f0abd5b5eac84057cfd5fa817a76b10d3914cd85342550f1f133bb6688ca68a29fbe73b2b7d4f65d675c27c2246ea90703e14535d5baad61ffe399de585b5645cbdb2477b81de7ce228a3e1a96a3efe917515ba9683bb5033b6140e1b83aed2f66ff1813ef94dd1d2bb3aff4d3c4cc94322d0d6256a1d15c4d5d930357ff8a7f465b5a6a90483946a44dd78ea939fced75f23c31c2dab0f5f64bb54a8d2bb767b713c0c96f6296c9216768395182432711ca96b8af8bbc42dd7fa987d977eaebdaaaa36e553d8d1fbb95a2b324abc6a870cef2266ff61d7737e0e3ce8dd55651e7513df69fc6778d023f7ed59e5ca2dd5555d9d0175d63fcaec063fe4beb068333ea9155be19335c0473cc68eb8d7d9ba669d78a077e8bbac74ff333c685fb5bba06fea88590486b24dcbfdbe2f57237f5cfac87838472fd01ab5d82ab622e147bca9e3d0bfe6df7a0e97796f5f7d49ba468cce785163bd9b05c7e751d5fc5d57ac77afe5186de36bf49a04c4b6fa30af439526915e2b2cda70dd1446992b9ba75a9bfdd5b3755d29b1f1e7d1d1b113c5baa62a4858ca8b8f5f7bf033e041123c7247492c6fd0d18bff120f0a78c082f761d4fb95a6517a0542de67920bf2009665a35afd5d490bbdff6a92c447f61434f41e48c42507b0305e4361e308c1f836a2469007d3602a1f5dcedc9f3f5fefdd2907c8455774264e61dfeab03623a5b7fa7d45fe8f481f1b0f1a11666ddec43b45b7a11f856e2af8afe7277081becb5d9b0b66eb5d57cb3c78b019a7de0b72781334906b7912fcac95eaec576fa9a34f66fdcc1b65a8c31ae4105f85af81a7862c7633f9e8c54e2be8a9937c114f5565899ff107e035498ab6da939164d4721f599b0383f9160f1f15131f1a0fa8c403c94de50fa6f7560d267efe133c987d4b74552747053997bcc962bd2b735915c454ff7a422edec13d7abcc9858e93eb512d7d51f1c06ffa77e5ee0584a20ee98bbe779049b0567b8da2b0cb2dbf890bbc833bfb3f8d9a80aeaaa6e229e885db78294e1189ae580fc7b8a12318ef2b9e7f44faf878d0d9d4a4a5f75ed6f5a8c5321afd5c9f2bb3de90e3529fa95d92baa98e7895fbe2394d2ed58ecc50578ce8c84d9959c55356f5408ecf921c8749219b202b722bc3c7f845dc890edc87693458e3a08bf7f1114d9d56596de2c7cf07d913e81d19c3ad12c93e3990309ac7d83eda8772fff73adefdbb74f647956b35eda7e4984478279ed4f4c76351ad84e947d23fd2b7e484aed48b78164f9a0f80c478250f722ca224b2ae65124f931ba770f57ebd20ef1de53492419cbbade881b4d00d99dacb2440afe1b33d0f3bc053026b2c72996192dcdaf3a06772700e3fc743902777c9d05925f7c943f2988ca25db4b2face6db597ef9775871f913e381ecab5dc945aa21f37dc7b9d5dfff3b59a5ab7e75b16e31d7bf6851b863d1b07f73a42191d340fd07b6f4742a4f189366ca4ebcf99bd9b63f164a7f451b6ad09bd2636c9c9148ff830e1f6c25d790bc060948c9d377587ef3171bbc13a99f0f4c72bc2b4a6a2a6c9d4a5d84e66c913de075142d42a99531737ce3952264a57e3e16fd27b3c240bbdda429e7e8e076d374652308ed00e2d92a59af891b0b47fd10fc58b1747a1bd89d6ec561c23115ee9ec86e0085664a6583cc47bf204988b590345fcd19d79a76445e3644d4eb41974e36bc7f6af55c35edb1b350b0c1e7eec03010ed57254f29ca4c94bf2ea0f682798c7594245803aa61a658d87dfa4eff140733cff397f3096458a1c3ac25bb4881bce04f5dd55b0958f6aca5bcaf690b89137e409b4fe8d33718fcce34aecbc55708f77f62e7c8e123e44035d855a6d756d09c7a6b3245205bf956dc78e5f224254f2c696f44de3e17d8cebfc97ceac8946919d6c935d72653d278d60878975a77a529aca62e54ec21fd6e6fc3c787026b4a5f1f0d37c04ed77b0bd59005cda99b0c44b310104edc45270ff15b8844257f12969263468c48730a12d778ddca4e5057e3369bb5a631d1147d722676d77666fbd6b278fba51178dd45bdc8f690cd745167bd0fbc3ebaca91ff187cabb85a391b774946b23c77175bd52bd8a339ca1b5c103fbc8b56affdfc143292d9c167ba633fb8462774752900f777a7da7de9bdda5eec03d249d68ce8670b77e72ed9ffc792cd99cbca8942865113fe9a221b229462dd50b1ae14edd45b7ee2e6a45e3d04a7a204f5ed9b58dbfee0fff1e0d251eb456e987493f8a5dbbf4828b93e758fdaf78f8a8dce133e101e445eba7f242d7e0386869013a63cbbdc2073e0a7cdc097dfaecc57c1bc571cf23a86b4fad893b524dd4c363fb2db55294e2a49d12bf23b073c00dcdd169176fd00d65a817b692908ddd113e02bf38baaf81153792c85b00c2da605fbc8b9f81a542abb5bfaaf46b989c2b2246f1493590fa8207bf9617bf437fc3be507a3eea6ad2bc193c7902336b656ff92859c9359afac47b896239102dbfe91eac095b91160da22be5a534b559932d529672d2067d6f6dcd4cb59100450cbb33d6f31764e4ce80d3dfd84bf81e3a9354689b455b26efe35aefe587ceaaf596a0cff6ec85ceaafd222f6a3cfc16bdc7833806828e7e848772df75ef052ccd20bca2b38847736579302bf9185d21d7d4001c709bccf8d84dc2477c0a67ce41f552993aa94b8ef43af5ac4c9ac754f58886146b2f257b65217fa4184fb4872a688823bf0d9e908b1cedcdfa59de54153335fc81e5a92f330725a6cedc173c7cd8faa41f170f653e8c258d7fb21db508d2b5c3b42fa8d2e5d4d79ed7fa228bad35d7fade920c85cbef500fbdba77f4310d3c5b704729b04369acd743a001dda10ef1f92658452bb0316fe0ef48ef68f3e5c97a8f578c30480e0c1ac59078b8410e11896ed3902fbd3bc098afca2a453fcdba3051533b7e705758e7e04dadb272b1acb2be6afef0b7a9cc8fd2fbe881fdf7863b3a7e51ae99ba9c8966b5c3dcf54193f7dc2ecc45db96fe82327c9346c0df95cf5c5fce1d95ec646c17c10bf6d8843fa2884c512704596065ac8d3756bbda37f31c5f70f43e5866d7a350d71920b93b8ba983ec953dc3db2864b97cd4b1919ffbcecb3ca960cb97d19a1ffd056be8acda1a0fbf4f251ecef14d2fade29bef5664e99dcd409e4bfa16313ec6f7f14b347167c466bd88e07bbc8f422f56b69c0753ef4ed1e8e4305d8f41cf7a6b09d6e51a78c010adf4eedfefb3972ef7fa94c47de477d13c8de3d7d847dbb0a36bea7f5d49fcbde4d07890271c88fb98e83c297cc683acfd51bf4365bebdce8f2af31fecbdce7f50d77a142e7b5f67b944921dd094bcc6af641853caa4640dd6c55e9a445d6bac57793acd6012aced4df8cac6a40dbac1b0dc070ff842db8cd10ff31b2fea650f599b087c8c3aee4edcb16b77a851f6b525df67d081bdd1d791ce40b0276c510bf010d478f87d2af31fca7c391a0a37e1a89ff8bca9eb3d5ce2a1dc3b9927b18a9f935544e258472881033ca81e19466bbc087a11d2955ff03c6e45cba04146604be0ea1914e8cbf8bccf57f95a9b062384f9231e81bed10f16d6b57ae1f2020f3fa827a473b6831cefd0447674154a5d03a292171f782fad8f8b87b236f1399f56bd46099d818560ebfceaf7d6056893073253878863cf9dc1b86d00433bd26763ed83c0325e8b9d586a59ae72bc94cd4ab7732a4de19bbc84f7fbe17dd527c05eccc8888f84e31ebd3b5d1fe25799393a8ecee2e8ced48078a0acaa1153e3e1b7a9d4bbcaf538fcc5ef47117b76a98e4fbdc783a3e40bb7ec59b8d6da22c951005a2841033e8c1291f2a5ce7708ee1da93d52f890a6e10c34c8f09b2a65ef2ad05be52edcb8dc7b5913b9466b86fd459ab12799780bd7d755b34b7df247766794e93c4a2cd33c59556bfe538371cdf56a7bf33708387951aecfb232c7b703b35e4fba3673cf7d5eee7851ae878a42bcc7f7ba5a93dee910d9f68b958596fd8419cf70116c53f8e737d1ad6a089708e7166c07ed0b60e739fb9e3f949640357ef03fa514d3102907c936da46cf55568cfa291e8620a35c3ee763d5081f898d22f336e5fdfc5a7ff8bb548d8c672a89856444427b2d4819c1d0b3f26b3e3d202248f77897aa641134425d2f1ad32e7088a93510ae7f0dfadf0398261d6fc19e010fabb08f6327bbacd8f223fdcef0068d1852ad2a0ebc8cb4a2b7e8c4336e7988c9cb753aa547a4f2583be56e8ce2090778e15ed94138ada29b5f76d2aaf1f077e9cb4c8591b04ea08f8d42134d02dd30fed633e8bdfa5d2e747de0e0d9bfa657e8c1eca59de20d8c603b6c7ad7ae464413bd796db5d47820b63ee32ff020cfedd0d204f01591b7a467076aeede7b0b75ab7375bfe70b673ce80a316eaab0c885a3b549fffe4bb4bbc6c36fd1c558a564eacea2b9e4a1af022fd61e884b7d5ee745690dc209633f5cab3ebfd6f59ad00a018f262ebf0b5b114f0fd1912ded2226e931bad2bbaf5feea6fc433cf8df56d4a73b6a8134b223419b2c4f4fde4ff2f6ca9c6db0796c9683cd738ab83b6237ba45678f57bd3eeb77a8ac3f598d4644444cf55ebcb459aee87dafbbf97930496f421167310f2d5d511ead40031c8216d7c7c7e8cddd61161392a683b82f9b656ce91b7fe4cff1e0e8780699b21b7a8d5edd2bb76b63bd03cb4f5781a873668ecfe2969adb41b422ae37387bc33ff60a8c8f8d876aac0ab4963248508cc9b9226d1953fe6a63e8f5fa603f6ca3c8dd21457c42acd48c6440f270c67a4926faf2805ee37e7aab5758584ba3ddfd45febb392ab47792b8f8889fd59dbcc1857367f66ffba9ad097818329b5f718b0da2dbe8a1f47f5dac40acf1f01b0478f0be7807b1d95dd1b257dad27b9f8fa26587ded98c37fd799c0745d8a2969781d6119ac854a4a393e91d3e2a8b5ec35c6db98f6091dae619bfe20fa2fc34f9101d6a85cd741845780bb6eb42347e5ef3d2d83b6de4a827ba71effceb68e2ccf4aeac97feef1a0f7f9f2a6f946f747b13d30a9b92f32c19f0e6b73520ca3d48ca6c18d189d6641815565f926acc4d860b7fb4321c23446c2b0334e04b69f1133c942b2e436b891bd88d697a1f9398a917ded415497e5c8fe4bcfb4564a70fe28667e96310e8fa30c08d2a7f788d87dfa5caded3fe0161ead3da48a5a374ecae1ce95efbddf751ce6828075ce1223a4a1ebd9116a1e5be76c647bc437b98e511a06a924ed01074bbe2aff060ae05cd416dd1009e3c25287ac28578d671cd1fd4183be34179583482593aa3799ca64fa5ec2a575e983bd678f80774114f0a4c468aa552769dce592ce7679bb3cc5a8cef5557afb3f7193bb95764a87a4418abb3e2fa96b00aa0d450f1437e408ddfc9ffeaa1d639106a6b0d8224bc5677e9823d8760edf2ad5ecf71c911befaa3cc7a9c583e3aad74e93ad16dba227d7453ea2a9f833e3e1e4a9fb55ec5a9b39eed3d8d75c4920ba3d1a9af75623487706de446bd2072fa9a4368bfd417ad9e7f7fdf77cf42a5be72c68a9632c06306d12a5d47b7c9b53df759faec726e5608ff280fa6dc6d4f67edf145e04995bea8579ae20970870feb9f7e4f9f030fc66bbd0e67a00daa9804425b7c555ecc190fa51ed760b1dad196f7a8d6d1151e9575a3b5ed7879c79fc806ff1227c01bd684b249d28b16f6297d0d766a283662a5b3bb7fbeb69b6365eb163857368f2def4459b59ffb87f54fbfa78f8c876f638ea00134a81fcdf195d85b63e593079d497951e745af8deac73d76c0855dd86f5193df818cd9545e627979cf1ff2876a0e97562ac53a8302a47f18ddd2935bb8c3a4956e785f752f76517a6757e8d58260579c5097c66296bee94a1267cba2c6c33fa5ef62d03b49ac3e7fb1031ca65bfae6c555b562c5be5487f243d021fca097eeeca96a888373d0963f56a03d88efeffbddf33c13fb367b6d10975a317576e429eaaa82bef944eb91d1e147f92f3aaa66f6cc6a4753f14c9b714e50e047054d751ed66742c3c7c6c337d14662ac4e4a59d86449b20cafe8835846836fed4eb3de7fc59bb1640fec891f55cfeaeb19aad393fe6a4c4acf97d621591b3d8496eaa3d7388b7cb4b5b17c017de572cda67a173fd13918a047b2437a15df890cbdf2a13bd3164e65d7d6f2e21fd3a537cf7c377ec27016acd24876d286b8910bcf7e17db52aaeb2a79725ab18a04d89d84f5ccba8ae21ccffe8be7cdf00637d040a88878d738242f6c4e475eecda958df9557ffd060d6a21daf2c455f0a4aedc3bd5507d1ab006de1859c14c76c527d1283f301e8c0e788107b4cc18d16baff9306d264426de9d7c495bd54e7817525c34b4dd293aee9dfb90b6dd995e7755faa6bebde3bbe785c8960475d2bb681c586927be8e035ca8138b4b2df2d2db71c683d65eca1a24e93572d36e20c267ff2a7a8b63294d06bfd0b90ecbecabfef2d1e9e3e2e17b02d9de06332e23604deabd30fc537a23366e065a6451ee94fca55a9c1d47e82872718cf2b4671f09c5ba5ecf57ff825e43e957dff51a8f151c5d92dc5e522bec13a5eed2be5b60e9b490e328defa5a8deecc13ce1aac5e09245ec4d27a8e874924d248452d7c442d9d1d77cec8336dafe5c51f26adef698e4e08e37419a3ccb217f63c5873e9da6a7cd6fbcf355ac4138ce5151398b15674e5cee8ae8c6856fcc1bfe03b0e05398f27a82312f7359a6748a54c6458cdb82d1fe55c67bd9cd7ff7cab419a95dcb11ce895404e180af7866619612fe84167ec9535063f7abec37bfa7478284c2c63142474953ed2d89edbb8ac0ef6d587aced0c3957b7410f6d698c3bfc285cecb20648035309d2dcc73b8f94f634a82dcce87e46139a34333b637e533d71c9857fa8f654f8aefa6de97b62997c141b9fb139de673c13614b750c1a866585e28f9ffff29e3e111eaa55f266ff038a4f99541ebe8f4f789b39fe513cf1edb9ee3d8cd54157697153b543db48384bff810fa30dea7cc98a62157f28b48e9ab9ee4cf5c296bb939da84bf3e02a49830958b3fd725785af354d4b249c3903b35d9fe5f4cd9ebb8ebd7277e48adf9137e034dac2fd060d351efe3c9d2d46d0d16608e3063e456312ba2d3e4e72d0159edd45d4387309d0263cbd9fa617879df02aba51a93c847dad597edda906f00577f224ddb159f888c7d621f3ac6bf66c63618927617655f8ea6df88a05bd96dc9bca3bb027240ed0144d6466bf45b93b220729351abe64f27f93b5ffbfeebfff8c3e111ecefc41e727cf4c46c47534091af649a481870b3c57cfe441579e3d572065aed279f63dbf29a4c77d4eaf4a0f519917013c22d4d932c457bd84b2051f07c29f07dbe05eaf07f7f0b7f5af4d8ec5abae81cc7134200f6eeab80a03f769ab39cd445fbd629738462239e738fd67a4cf84878a039739f0055a7b993b034458d1de7913399bab9dd390a7b2266da9573297fbc114cfdd55fceca5e8c0d6b68019bcd66bb711b65f74a54972089b6a95f9492463a7a5f76853dfefb7a2be78a4fb8e428e5cd898ccd0849ec257bf13cddd5734c00de7d69a7dcdcafc9cf499f050497d6d353aba4e29c5baceb438d841fa184581678d839eb63fb5d4d035698d1ed1f75e827b35a30d34b626d8630511e10cae03b297c48e36ca723bf69bd8bb2bbc537bd78e46dcf3b7df72064d590032088356e2233773d40dde63e2a5fcc886ac07779c626cedcab536c60385befad23e133a3e0f1e2ec948e7b6593fd7c79eb3735bf192bc445befcea5417eb611cbeab3ba42a95ce0227a22c8ba8bdec2c7681c155191a6d1846c531e3555c3f68239baf282e0fe5ccff6fbe86574d03aa4abb3f21858b20f51843b76005a43df7d049e139c5bf6f93070499f090f5f7313ca35f83a674af5b0e53b38a431035d90be2542dd3a4a738868566a11808d65f2ec337b8efa71c3b1938ebb4b6377870fd6244ad4cae9b3a72c545789af4ec1bdd649a3a1d624df93f13c3540d3b4d41075458e89e441835ea1017fa4d1b7d9d3351efe7dfa26b645b41f023728537dd57092f085b6407f08e8881d90e3daf28e37d49437781fb8c3c8698aa54bd50bdee23deadb437b2a52fd4fff6f0fa32ecfb2087523c7915eec5e2b5bb4799fb9def45b8a748efd8b58a60f80ad2c5538095f892ab32c905dedcdf0a9b1a0e973e2a1f44ba18e5e6d1d9de8ccbdb7c67c11ac33c5722e8359908b9da7bd8b9a4eae1fdcf3c467fe1c38c863c4dcfb400482b6340912ec80735cd1b61ad287781ddc23473c5557be23f1e42eb864391d054fbc4b5ed4dcdd25997dd4fea7cfcf194afabc78b09674c77ad17d74425e16a7be13aac0bb53336f01e3d5039b22c601d01cb4821e688ab3281591df8cb0bb425bb4f51ed093fe445bf8bb0b16e9c88fd44b748777e6eae07bf280e8c8d33b21056486b7a18f871a0ff864f883f3ff021a3e2b1e4a79a1b321bc53bccb92f8d9bab6374994aa54cffb9ce682b885b8d79ffaaf2c8d3d75150af6908c452e72eb5affef1e4b1279320ebc98a14912d1967bafaff89eca3bb9f7f1915dbbc72c13a9baf3b9b2888d275f2a957f72347c263cfc509f14c12a08f0c14b9da54a53425267445286ec3543e5f72c2769f9bf3dca0ac5551abfc619d0abf97c726f15d79fe2a8d2ac604ffa2a7dddf794e50ce9bbb2a7e4283bea8e2578a9faac27a5ce73286de16fdbfa19e933e1e12b9519b6d632dbeb9df0b243d4c98ed80a80621ef7e37e38127dfd3db0b25338d2fb710756b4d0e53d9250f4a385fe9edd94df44df7e127dfd3d5dc7dcbfd1d7ff88cafb6073d7248c5ad9003d933e7933d12bf16dbecde7e5149f130f25e99c6bfe485c34c02e69c1d8fcab44ad6f89cdc4f462add727f54fbfa7cf8b079891ba6ae810ad416ee4800bfa5fa6299ee8784595d1ff816bd6ff1dfac478282bef143a660db808a8f877c99a7d4b7acd5fb9eecab444fcd3f7f918f489f1f025bfa9a4ff592baa1a53ffebfef833f4d9f1709971f2dfa6324fd6a001d5f2e27f4d9768d031c5af9501ff3b649e5bd59eabf9c3c723ebbd01f06f132e33b63e763da8bf4b9f170fd53c25157760bfcbf5ffa1bcf846667d7efabc78a8e9dfa01a0f355d528d879a2ea9c6434d9754e3a1a64baaf150d325d578a8e9926a3cd47449351e6abaa41a0f355d528d879a2ea9c6434d9754e3a1a64baaf150d325d578a8e9926a3cd47449351e6abaa41a0f355d528d879a2ea9c6434d9754e3a1a64baaf150d325d578a8e9926a3cd47449351e6abaa41a0f355d528d879a2ea9c6434d9754e3a1a64baaf150d325d578a8e9926a3cd47449351e6abaa41a0f355d528d879a2ea9c6434d9754e3a1a64baaf150d325d578a8e9926a3cd47449351e6abaa41a0f355d528d879a2ea9c6434d9754e3a1a64baaf150d325d578a8e9926a3cd47449351e6abaa41a0f355d528d879a2ea9c6434d9754e3a1a64baaf150d325d578a8e9926a3cd47449351e6abaa41a0f355d528d879a2ea9c6434d9754e3a1a64baaf150d325d578a8e9926a3cd474493fc78325e11fb13c0b5914be7956603e1df8cdb7843d815fa8b5b57c7d2690f7df6e39b40271c74264624fbcb1692b39ff6f8e3374cf756b856923f9c7cfc3f0ee18ded903da5ae82fcf67d0739a24b4a1f8fe7cf85ddfad3c03fad8b4d47c9ab7a0df9d0fc7586ace35f4eff4ea2ff080a17da2ec49f81e5b948ca19d88cef548c037fdbe655f338b5bf8df69df2ffadb83bea1d00209eda1553b2b34e84fd4ce6e4debb069e93fc703601e7a8158d2d3fdf097efabdb004fd6ff4bcbd5b3ebdd718d03417bf00e6ff08dc35b9457a0f2e88fcf87f3c4ff060fa6c791990f7a16dee91619ae607801b4ca336f212cb79c0bff4efb7ed9dfbc9a59ba87d8790cce9f7c85eecbdfadcdf7b3ed379ee7433f08d3176378aef397e773cbc9eecc751ab7dfe3e1ccc734067c208d9dc0e0ce07be267e7047b73cf3f2ea3f4d3fc7036a1b649f671e32dc8058c9791e9af6333303371a11ff4efb7ed1dfd2b4a2e44fa4ecefafd2c2fcaae5d8067ebbd173ef0f3c51f3c544e3507fffcbb385e929695af883d9625aed55f2b74403323c489abfbec3c397ded647dd7fab577f212f84e14fc860d28cbf4145292768a95f00669c72eefd0ff843a9dfb4a1357e8907d3ca2f1c02e45a29e930f0e4bf9ccdffc1f33c23f1cfb361f397e7b32fda01c13f9057e7796ef9faa86e219d439b9db38cf9c1fdcef8d16df897f4b55fe0819632d27089526b80b1cf86c007dbc8d61a9225000fa063649a2f7fd7fe7f9bcc5cd1989d19d9452e79a8ee5f6b576a71b46be4da3fc62b5a01c6bc4a5fc17f2d81b47e08cf4ef51c92d1f7fcd3a0c070ff9207c378877076a9afca1fe0877ce110dfbceb9fa55fe0019e08fa824fae2d943d04144528b25f18c18fe4e0de92bec500235b4bd2149db2c7ff017f00be8956d908c5800872eea38a3b782820281bc3f109cfb3e99fc0ab25b35964911160cbcc90bf6e1feddafbec09e68eb4ec1fd80b1586e133d4df5040b36c8e02f3dbdb0feee719943be62af7df92cfbfd427351e25dbd1285b644b7927ef2229eeb355b6968fd9b315187b6ee68edd05bac3eadf69df2ffa1bc6443c642fd92b9f6a9df2ab85a1fbcdb9958ff6c893ec36dba09e9edbfff87961f6966da3054828fd9cbfd627255adbf36ce7f641af25e8fe87bd0b3c1705d915562035b03db7e764a579596975be3b1f3803b1b30620424b98877fa7577f8907667406df0a499fb582d780c72f7c48bb81e5a8f8c59a32c27616f08dac49811f92055af3131a6a196bb82ac3af9c672d49a880f7731046d89364a1bd06682f09c2591b9e80b1ca3a9eb496d013308bd110adb36b9831c25af213e7dec8e8853bb4262b49b22e9f66d7703fcda5c65a86b21bd5b342749f3d642b6f400520d4876b71d693936849bb4ee6dd677d3d1a34c21b69e434b2d1daca916ea74436dee08d3740437b42eed0caed03271cea3eb766f0bc55105a9e8c724b3c58d3345276388256834e02b3b5b0f2ec1ed9ce2d052d817625e15cb7d86833f0379fe6c81db82b6b69e11c7b03bc4601f05b1e526b995da300de16380d59e5449e5803de7199539fe6ba3daad2879601252bc0b2633892b49478ca19596a3b87dcf2a9270defc1688d867c8a56cb2ceb0521bccb9a523886b1b60068ceed172bd73ce8d243f3b3f9f16b79a1f5443db7ac30a0b97007b9a45d728d2d9ee60ebf0a0bb4cedddccbfd3ca0dd3cc4d26d268446e5b5702ccad25ce5719ed008ade3669eda38cfb042833c8fa67991b60169eb949313deb9dd7ceff6c5437ec88ff929bfb1f6fc361f60193460b4b1c7e9333cfd36bfcb87fc2abfa75d8d567b923fe48ff908186d97f7e8281fe7134ab54eb6ccf8299fba2e5e3b713ec8d6c89644a4f92c7f420f80b722ec082b2c00bd7b8282a77cce6df20c2859610f1df385f708fdcbe3061fe4cb28b21e2d9e4d92483eca225fe56bc081c6d10aee3cca9fc351fe92df20ecc4f2317f15739be760d1a06166e56f3613ad7c9beff22b92e25dde500246ce7696b9f01ef2a695923bab88af22db7bcd5b7a16e46deb39eff001dd83eec3dcd7fc5aec685bf52d47cb6dbca19bbcebf2bc8782bc6f4f053444721404b440054e1aec8a907c91bd70bb204e225a5e534c2d8778054c9fc2463dabf8aa715fda61ff311eb0d166352e41af4458ddc83d863915eeb1150db0433672e0234ac36b65c3a992df16ace085007e6af421b47607859479e190076b8870e1165e3a2e7cb42e02dbf11f924111128ff3222a94ffa0a037d2095915b15f14098f3927cf9957a4f9d2014ecd9acaf6ed0033294e45e634bc81b11f10b28b9cd930ae6b963b5745c1ef2c01b382228627cc7626c4f36fbc65cc31ce8ab8c73bd9337e8d79b177efe87d71f03bc423a9bcf38eb2e0cdac8786c5d191e8551c909d84c5a9b8c98a6210107e2a6e23197167c5b2ec595b55c0b917c59d9c1443b7c364dc47c037f8968fc946acdc915588a9d3885bfcc665b900f9fae6daf1d25ea951fa64bfd8a37c55dc3b312efd4efde241ce59cb0af13a174e503c060fbe28467c5a8c3d968eac316d03e784b98e51318906a11f5ad6cc191553fb54cc8a273c821e9c7b2ff4898c50542cd83379f2f362191fbc97e21638d1c8b3e36b7f642dbff7e0fe4d3cd0cabad7de14443cb90f7b9eb19d024bd9f10bc80ebf58a121b69c6638a20b6ba54e62e84c342724637b8231edf84d2b92ddc22bd678a26e72416d0b7ad729e20d6e14cfd9b67891a478c5432f0391d8b596ce6d84e18da6c5a678a3cfc5961de43c9d84d45e173bd429aebc97cc954a0ef004dab58591d9178da209fdd04a1ed473a69c75d1d69e543a97c495c0a87aa25f74e2be37cc87d6183750e08c8beb68e8aaa22befe25749a0677be8a6e81787bd0592b081e77b142dadc738f3b07f50b668206b8fe92330924efce217715f6b2aa011ccf6d4510edfdb5a86502f0999bd67f18bd3147dd0239f94cd8fd97e4ff63c407be17779cab77b3033d209bccb0137cc6cc5f6040d19da3baccd1dbcf141a4b110755117f0bb929360b87783317990daf3a6add72b47edbdbd0fb366ec6179171ce5601f90cc6bee436f6b39fc2407527959d4d84774e7a86441453820afc500db7268f8da176fdd6ff007aff43299380570abbdda73d02c6fad59123a4d67a03cee3b7346e23ef45a9f46d1b55acb8673e7dc9231cc51c4a7fb3898ee9338f709c5f835a7ee0a458074bc4ff7d93ec7725f0057e1ce35b6f7fbe09ebf5acbbd1f5ec93df0cefbbcc7fdfd617f947318cb0724a0b74ffb1b66d3be03331fe42135f64d3b5aba929f6004acfdc0011e059a8cb1deb2155c01f323e64e335a10cf755d9b77f8086136746df76e7f977440f253923acd6c9f25c53eeb59edfd501ef6f71ec153d973edcc970794811631152997fc61ff20dad969ff68fc30c0e8c46a3fc24e3488166828fafe663f0e4e8e8a16f983358864e8ef27c5740f521e7be989beee676e82d754b02797830cda1abdc8b3667196307f4441fbf49aee8a3fc6639fe2753808057d0b5ef64f0af005f609581714bb997cdacfd1de5e898decec17240461b024f17e89d6f81145fb5596d07edadaaf259313f82ef6cf6cba7fd9bf4696955e7288bf8f872fd2a6b48b96f99e3e6ad998ddef37fbb7c0ca4ed966bf45fbfd6e7f15dde38dcac564dfd837d15e6b897015c8c97d0be65b7bdfd1fae0fe3a8ff65d8b926bbfa5aef211bbc6a0fd91eb7d6fdfc7f260c563ad171dd001f32958e7e2400ef4601f9824e4f6c0dda64de327b1a4fd833848498cef01858783839c838b5fc9e3c1639ebdd55a951580603df176fe985dcb4dbe38f8568163d73904ca67a071d17b2cc51c4dc5186137709b8750a5870866e1dc79134f077588914d17bc60de2139a47c0212104647b043964cf7c121d7f202faa12f5238bb9027b9a18bf42dc80ffbb81fe4fbc00a431add7a0b7775381c8e0c58ab389a7b9d588182f8f570634db515417b8701468e1f760eb79ef4e67c196ed5366ec620bbb873b8b3378ab10358f35d3d232dd0d1480a4f191eee89ed1cf9e0f020161c64a12a5c0b3464c04b84e20cd4f7e5c151db202788f3f0eef0a8a27d8150c91ffecacefa057ff02b4454366fd63f8caa58c10ee6f90c2bb01140f7052d6c62cde0edc40146d4190316807759a027ef797895eded97c344eb13e101346da43577da051b0b3477b8bf0d76499fb4f99d1707cf30b725689e3a8e862dcaa7640942330264312b756e2d277fc06be0d5c0554a6f8ff694665de756c4968730cce39e89406adb867027eb655de020bb6c45a9b15c026d9b809e8d299ced807ece1db074023cd1dc1f2421b26fc92dc59c837de173075ab93e4c8ddc85e761b01082103891c886a03de8370ad030a06041adccdb77c12e59596d4055a8bde4cef8300359bac13a9a0682c05ac29b2cc9daf2911ddce84890897048102181b670ac2dc88e3dbc7b4cb44dc32d7a786204eeb6b4e62001b760898ce13ed4b90574c8430ef239776e0f73cdabc006c1c64a25560b9e440e0b786366ac0f90ee60f7ece12ee25b69f11bf2421a3b879a9851e943c55594003e0dbff3bfc4fca8f94ddb375b63297907e060e1166f813fef403b2eed2769a8e41ea645305eb3601180b616afd88b194d1d95d8ea780e9c9354d162f33fcca69541670cc702dd3b70b60d1ab4fea6650731914ca7f25b6ae44933933ded3b3256a07fe17fd7def67b7315aa3cc1c2f4a8968edcb495014e7ccb2e3d1da8ad7d89587f6a74612333b8b9da336f6fda6e4f0e6b6facf5a7c3b391b77ee53ff2ab6becaacf988e0c0377bc33d732edcb29910c9f9ef1a5488b8335ef579123c7b4acec7556459585b9d2f4a9f670680c55d19c327aee194fbee9bf4af25fd816bf232ffe1e95c88191a4a68ddace87b9a6637665a456cf07da33d8219577f1def43a967e4c2936f385550894065d76153111e68db87d6b7c38c67a319fd88c85d6771d7dc661591d9355ee81f1539b6b89f18ad825daa09f6589890a37be19ab077336337d4e4d6f1233f6655c9f94311a33ca041b1d425b81704d51a1e38c3e52e6282c3398fb129e5522507bfc3df32e1a43d88c9f3e22cf11816a4e99734c9e03d79a107eacda4f4d5601aa720da4e92b597dffa1ffeaf7e80fe281ebf7d7fdc84baeed1b4983a8841ea3a6af1e6044f538f98717e0d3caa018c12ced028fa57a66c0ecd358e755f48878633a87df0c2fd2c74086f6ccb3b6067f1446d8f87f50bb8a0f42af1c5ee99ca586c380d4d012a91c4bed3bd36d82df1e8c4c91a66f752b35263077cca8eabfb9f94dbf4b01baa189f29a6b0beb1efe692ec3c46b356ba91e37969a77d0c802790452ecdedae9a8780e7c832c0eafda776646d0379c441a0fb646a36e09018b4c98fbd806a5257f323c4d7bd7400ae112b7cb4cf31e5ce2907ec1aba3a5c99fca3ff993fcc1e041639fb19de160800cd974966108d614d29204b4b0d2db3b931d36b642c3dd44c913e06a613216bc2af217134f7b3cf909fa18f4f0c3f8b0d11135bcb6607e538a22aafbb59dadc8b54191f642c1588206b3248dc39b3503393f663bc38b841965ac51577225f85b73001d2d2867b7a8629755b682f6bad0ee617bd81a4fa29991600e4ef9c9935480fe204a8fb3f65c5b5ef670d8c199fb32ae0e5af1d5a101327c76681e5a56db604993679e12821e20b56fb344149cdd26b69103411977d39eb632a255493a5ccaa24aa7f34a09aaf98df9ed019ec0ff543ce30fe201e61c4babf67a2653cdc79343c706c30f0d35b2ad0d8ce1b5f658932579c80ad0db98b5317d5a6655181bec706db9d0836d845c47a66e76e8f26730d1632ef0dcba426bb18c9f002723d0b47bc83ef8d9266a6a5b4a4b603a071dab7fb454c4d57e8f6c782a459afbfb557c9699b944e0a9894185aff9963736d840206f086206c9941b797744a0486e8c2605765dd2966047aaa723c84118315c4921907ca0a776d116b4368d2517ad8fe4087a9c731b3df30001de8e95442b3373ace2688b251f695e42d6313db22307ed15f81f191becdd00def4273ebc542895959ea2bfb74d2f23830a83034004fd53f1ef3f88073d03b56f7fa7e30454bfc1ec28c02abfb3f2ca9f323d4adaa17de07993b4c5903f262be813841f31c26b6d4d800c396758b49241d8755b313f3ab96bb59d396fc4dba39bede50009fc1af7997d043b41c752b293e1ff5a431f1e7d4ffb9356c780f53412906dbfe0b5f6ab8234029bc7b9456b2acaf8a4b62dc403707a9dc9d4437be03cfe21c7afceadfd02a8d51ed6157b3656118c0d9fbaabcc51ee315491980247d22ec37b720bdc688cd761ef18695b4a7bd28f4aee8f7176cd1dfb0a9fe09d64768b5fa14fb4971db46facd2b5f69a1a1ee358e93139a6463e15f8956beb125b376e5f92801ae926c10ed7f610371209e73824560eed4b00371ebc1d0890e31fcb3ff98378d05c99528f77f67d4ce30659d92f62128c9c42f48eb985b5e75eb4997b2cdc3e89dcfd714f4779e778802b7774753c8a793c3b9e405ade5b31edaa386ac084888e37640a12c011fd28e60a07c7c1f1364bf0e678e76fb0954d93d051d0b3a999391ca1e390219015396bc3c8df5bcbe3fd81f2ab02aec81e0892717895df1e1f608c045d7afb201737c747720d739926cbe3285bd9cbe3f8901c27c72958d26b02e78365af257d0ca3d23dcec46d7c881a6ce5f631584fc7a7707b9cc3f7d7e3e2b8f41ee4e2e802ae36c5f8b8d2d13bbedc5f8b072b3cc29ddc66de433a6bc4c1ca99177b676e624c124fc53279a3022b7b1bf6c4f2f84c3dc73fbec8478e8eaf68055c667adc1cdff20e1e693fd071eb93e38e5e63e5beaa2b3177c2e395d66a3e1a1e340fc3ca47c593b8c3a16b8b3e8ac2b762116f8e8d320b53758ecd63cbdec268e4c7f6b193379da638c22c8d8fd7c7aee4f9d3b107d21a742414b02766f347e7d65d70ffd83f8cb293b26360042774c2c120bb8efbc51efeb58a3b47614beb0e20097631929313f127271ac97467e579a0bd8c87be58d983ace34cfc1cdf07d8690037c0e8c91d9e6cda3cb170e0dcc2346edb234ab3871377ded4305e010e96daa70afca13096c0326f9f44318f7b329604aff77cbfa4fdf04a9fe1dceec393e43727279258c0dddcbddafbd6321e93186f08e12abc226151e5b2a055dcf7378087b691581193ce0878d7246fc4e3a338799a2fb94336b5c6fe9c4fad5ccefd26dd7a4aa5d0c12a1f84c9c9cfafa03d1db93d05d6184bb23a851f0d0f1aebb41b67de0b6b9ca2e290bc114f798e3a29cd9f752695739bb7e3319e584412391099741ce54c2c90a4c138defa8568273390c48ef622850db13ac5787d4afcdc19e1b5f63b9fd25376ca61362df0c606bc3803b466ade2e08ed0aab469dd57261972b2536123feea6de38cf74f7b6547030212497bbd5968af99b45a2872e5e9e02d05270fde10c6c43e1db30e56a7532c8bad607ccb4f3a8607b3526760ea98c5ba884f37457e1a58ad32da80bab91d5e853d9d2514613ec70d7e3cddeeb7013dddb9c01dd15a7bdff929bf719472ada5e64a46df28a205b32ded272b74d4c1515a02ee0368c3f0748f56a6350fa7dbd3e36924c9e12d6d856fe886d924a51ec6a771dae28bf01e458ef2f0b10d674db2d59fc818fec378008d06242307ce00fc21926c98758f1ef7e3beb6b08c06b42471c1347fc05339c9994dbd1767029c72e213bc40afa98b8fda9ad79a38bb394d0327e9d801206a86d75a2eb81d7eaddaa7a72c4101c5a739ea9e16fb25de515c8e18f095b5f7c02549c5e0b4745721c9c3e310137960c069d0305a729fd02ce7bece7e90fdd32a59d941083a8c73ab7b1bd968e8dec2f3d678e1c26d603c7bb4037c427bd0909eb5f1d8db9af8bf44c3a09ba4a7e7d3cb5eeb3d1bfeaaf6c9e8343ebd52accfdc738cddbef9dc5883d3863de331f2cb0c3e8ce23edf9ede4edb48a31f034fdba1a1987a33f69c46a18dd6beb051da3925de497b81c50a90d0e77ece80ed4994a50309f886e74ce4365911a5fa6586d507c383f6a85234d4790378c79ed010ade426c89db86c2d1cbfb607f15a7440038af2857b4bfb6279baca1fc8f5a9c1bb8724589f9e33eda783b94eaed936143e210f45acde108eee4fcda889d659523c9d5ab48b5562a3ad784293531b46c82fed6fb41253bbc0f3644a9f3181f1c5f6ea6889dda943fa681f3fa57bfea8f8a9099a63e0bec6330fb143ded3b92c41eede86d462fe024b9fc52db1b35a74c197dac36ade0ef447be84bf5fab1cfe30e5fbb6cf0a3843ebabf6cebd8753765e0af87e0db7e136bb265eb83dc02c40c3e42063b18cd66051698f58981d23e9bdc881ba95c4930e8d5fb50f3f8d258aa6c533c2fe42bf7bfa40c1da054ed68457a1f9227e650420957271ba263e5a61e1ed4f5d60394f20653f1c1e8c2fc18591bcb51e81667aed94350349bd32b62835de9b19cc3a6df3a3c306f47a8137a79ee1f421dee87965b58de7adcc400fb5566d3dc2d8cd40fba3fc049f1c64cf23d5be1bc71b59cb6cc5f50a1093bb567912db6808d288e08d898f389462ac73b1cab849d6b16fad19de94b103fc8a3787a9f6f2a355a6a3882643914f81d3636d6b680cb0d29b68ec3d4682b05a7da26dc730eb588f30c2cb65c64187c8fa688d37f0b7a7a32926a25030c28ce702f421827464061b8f172bdb4831bc1387a3e60d2d026ddd642b1ac12f2b34d49e173434ed3477057d56fbaddada7ad31885b616547803381afcb96cca3fc81f4a4bd92be7b7f1c2959663b95ec1e462ea2844151df0cac84275b4f4331baf6135b6654ebf5fad563adf497ba9cb9537a57fa77c2635ab2248e5ada1a5bf7af9757500ab7cf8674ff739b2432b8b1e559ea872ecf54896791fb88ada88ea6d64e9ebac5a54c62d4ab4d0ea89cc2a57e1913283d7f403374785b9de645eea27e87b68efbdfe048cfa95f7995577d856eb08fccaf7ae331359e5b9965fa234c878e01c4bfc27f9bdff753c94bef732b685ab3954be43e9a32fbdc3b4f413979a76d567bee96fdf7805a9b947b9f28a5cdc551f753506aab1f0ab0886f1899b3b94b9eba5af9c182e63627aa697bdca7f2ecd9dceb9d8f8bcfaace2304e19ef3091d3739481991693cafb745e05563ec9e8b02cadc6de8cb1f14096d83923925bb1b1c5cb989e6feec3ab1e2bf3094accf36ade08e3874725faaaf7708c3f8d635445a99c924b01a729574dc93fb5dee14fea0f55dc656b56f1698c238b6b6fa489c4d0121db89cb3b88c08590ee01e9bbe76ccc8e0b2afca1eafe25060fb9b3ee6663ee30a3565343ed0337459ae55311ae5976859197160e63ac73cf31ca3e555cc099ffa5fda6cd65354ebe10283b67295458996725d0d3133b17c1aae305afeeac3bb7a2592cd51ffcb3cd6d75333a6e5318c58b5e2c6af3040abd819af625bb6e985b641825856ab60acf36a385efd45aa99212b64fd21ef03e0e1fffbbfffe7ff07835e35f2</data>
+ </image>
+</images>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallobjectinfo.ui b/kmyfirewall/kmfwidgets/kmyfirewallobjectinfo.ui
new file mode 100644
index 0000000..a39c64a
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallobjectinfo.ui
@@ -0,0 +1,166 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallObjectInfo</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallObjectInfo</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>496</width>
+ <height>383</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Documentation</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_header</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="text">
+ <string>Rule Documentation</string>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ </widget>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>te_desc</cstring>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ <property name="wrapColumnOrWidth">
+ <number>50</number>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_cancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_apply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>b_apply</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallObjectInfo</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallObjectInfo</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_cancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallObjectInfo</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>reject()</slot>
+ <slot>accept()</slot>
+ <slot>slotHelp()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallportwidget.ui b/kmyfirewall/kmfwidgets/kmyfirewallportwidget.ui
new file mode 100644
index 0000000..cb76884
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallportwidget.ui
@@ -0,0 +1,177 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallPortWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallPortWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>444</width>
+ <height>72</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>PortWidget</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Port:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>sb_port1</cstring>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>l_to</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>to:</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="2">
+ <property name="name">
+ <cstring>c_port_name</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Service name:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>cb_port_name</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>sb_port2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>c_portrange</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Use port range</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="4">
+ <property name="name">
+ <cstring>c_inv</cstring>
+ </property>
+ <property name="text">
+ <string>Invert</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>c_portrange</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_port_name</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_port_name</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_portrange</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_portrange</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>l_to</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_portrange</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_port2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_port_name</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_port1</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_port_name</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_port_name</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallprotocollistview.ui b/kmyfirewall/kmfwidgets/kmyfirewallprotocollistview.ui
new file mode 100644
index 0000000..c83583d
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallprotocollistview.ui
@@ -0,0 +1,70 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallProtocolListView</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallProtocolListView</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form3</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="KListView" row="0" column="0">
+ <column>
+ <property name="text">
+ <string>Accept Protocol</string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>false</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_lv_protocols</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>3</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallprotocolpropertieswidget.ui b/kmyfirewall/kmfwidgets/kmyfirewallprotocolpropertieswidget.ui
new file mode 100644
index 0000000..55dc297
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallprotocolpropertieswidget.ui
@@ -0,0 +1,173 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallProtocolPropertiesWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallProtocolPropertiesWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>557</width>
+ <height>95</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form2</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="1">
+ <property name="name">
+ <cstring>m_gb_protocol_option</cstring>
+ </property>
+ <property name="title">
+ <string>Protocol Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>m_cb_log</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Log packets maching this protocol</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_cb_limit</cstring>
+ </property>
+ <property name="text">
+ <string>Limit matches</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>m_sb_limit_rate</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbl_slash</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>/</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>second</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>minute</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>hour</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_cb_limit_interval</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="editable">
+ <bool>false</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>m_gb_protocol_description</cstring>
+ </property>
+ <property name="title">
+ <string>Protocol Documentation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_l_protocol_desc</cstring>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_cb_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_sb_limit_rate</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_cb_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_lbl_slash</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_cb_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_cb_limit_interval</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallselectactivetarget.ui b/kmyfirewall/kmfwidgets/kmyfirewallselectactivetarget.ui
new file mode 100644
index 0000000..622bf93
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallselectactivetarget.ui
@@ -0,0 +1,181 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallSelectActiveTarget</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KMyFirewallSelectActiveTarget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>560</width>
+ <height>282</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Select Target</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="4" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>339</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Current Selected Target:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>m_lbl_message</cstring>
+ </property>
+ <property name="text">
+ <string>NO Message loaded!</string>
+ </property>
+ <property name="textFormat">
+ <enum>RichText</enum>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="4" column="4">
+ <property name="name">
+ <cstring>m_cmd_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Ok</string>
+ </property>
+ <property name="accel">
+ <string>Alt+O</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="4" column="0">
+ <property name="name">
+ <cstring>m_cmd_cancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string>Alt+C</string>
+ </property>
+ </widget>
+ <spacer row="2" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>178</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="2">
+ <property name="name">
+ <cstring>m_lbl_currentTarget</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>NO Target Selected</string>
+ </property>
+ </widget>
+ <widget class="KListView" row="3" column="0" rowspan="1" colspan="5">
+ <column>
+ <property name="text">
+ <string>Network/Target</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Address/Mask</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>System</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Backend</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_lv_zones</cstring>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallselectinterface.ui b/kmyfirewall/kmfwidgets/kmyfirewallselectinterface.ui
new file mode 100644
index 0000000..ac46984
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallselectinterface.ui
@@ -0,0 +1,392 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallSelectInterface</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KMyFirewallSelectInterface</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>545</width>
+ <height>443</height>
+ </rect>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="caption">
+ <string>Select Interface</string>
+ </property>
+ <property name="icon">
+ <pixmap>image0</pixmap>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QFrame" row="0" column="0">
+ <property name="name">
+ <cstring>frame5</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>m_pic_screenshot</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>400</width>
+ <height>300</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>300</height>
+ </size>
+ </property>
+ <property name="pixmap">
+ <pixmap>image1</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>m_cob_interface</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbl_descripton</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_cmd_help</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>101</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbl_header</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>11</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Welcome to KMyFirewall&lt;/b&gt;
+
+&lt;p&gt;KMyFirewall provides two different inerfaces for setting up your firewall. Please select the Interface you like to use.&lt;/p&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_close</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>x</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_opt_showOnStartup</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Never show this dialog again</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>m_cmd_ok</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Start KMyFirewall</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<images>
+ <image name="image0">
+ <data format="PNG" length="685">89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff610000027449444154388d6d93bf4b5b5114c73fef47f2a2491c02050d0551323445ec5014151497d2c176f0f7e41fd0a1438538bb75b385824eede4a654688b8a8b62a0b4521d148594686930d568f0477c7d2f2fcdbbb7439e62ad072e9c7beef77c0fe77bee51b8c504c40ea1cb80a8099603db0256ef817d13ab5cbf5cf8fd71b7b7f795d6d6f628108fab6a2482741c9cfd7dce37368ef717175fe6b6b6de3c85f27f045978ec1f1b9bad191808a9800a28aa8a140209b8807372c2b7d1d14fdb3b3b83cfa18887a300f11ccceacdcda17226839bc92032190887110707b85e0cd3241a8b3d09c3e465610d6004a64db8af99269aeb22b359945008bdbd1d717646697d1d676f0f3b9de664610169590fa2b0f2197e6a0262dfe115a088dd5d443a8d383cc4e8e8c0dfda8a1a8950cee7399d9ae26c799962a18004c584aa2578af66a1cbf15a118093cba1363541305811291ca6babf1f6118b8c522977dd74027e0532d88ea97627824d53d3d0407072b01d745f1f9a84f26919eea1ae0875ac0a72a60f9019ff750ddd242cdf0f0d568f3e3e3159e7c1ecdc3f92b056d40d155d8aef2923540334d144da3984c224e4fb16666b8686c24383444b8b5156b6d0d1db0210508bd08ab061c1b704701820d0d0014120910022595c29a9c243c3282717e0e547ed126cc032500bec08b5f208f40e60301595a5a92662221f3208f41dad3d3d29e9890471ee603641ba0feaacf39d0bfc2c70b90bf415a9a269dee6e6981b40c43da7575151fe426147ba10fd0ff598ad71098877747e0ba20c5b5e3822c815c866c5f25d9b8759900c6a0eb213cbb0b9d5550fb07ec1ca456607e0edefe802cb72dd30d53bc89f93c5f7882956f02ff02854c0fcf287a72340000000049454e44ae426082</data>
+ </image>
+ <image name="image1">
+ <data format="XPM.GZ" length="55092">789cccbd47b7eb38b2ef397f9fa2d6e5ecae5e7cf266d0035266cb6da7ed77af1ed07b2f1aa9bf7c83883f704c56d5cd7c75bb5f95d6c9ca5f8a22114044202200f0fccffffcdbe7d3fddffef37ffe8fea625c02eb6f966f947ffb4fbb4e92ebfff57fff9fffcffff88fe160f0b7fecf68389bfe6df41fffc7fff80febf96fd6df9401ff5fcff64232ffde36244f7a762ac953fefd56f29cf35cf2a267f3072ff9f733c906e7836493f35eb2c59fd74ab6797b1f243bfcfb46b2cb7fef0a1e72799c5af2907f7f94cce5732cc963fefd483297cf3a8387d43f992999ffde0c25f3dfb79a64de5f662099dfcfe924cf386f24f3fe4a44ff0fd17e5b327f9e772799dfcfb8078fa87d662499cbebbb9249de6fc9bcbd9d2f99dab795ccc7b31a48e6e3b71a4ae6e315ed25f3f1b04f82a93f0dc1636a9ff32999daf32599f757a54ae6fde17e48e6fae23892b97e78a2bd63ea1f438cef849e97e892f9f7652b99b76f3d91cce53763f0947e6f08fd9c1137b664de5e43c83fc7f53bf0022cf475499c8be719c4f113d824de5cc01671fd0eb6895dbaff50d8ab174ae6f2ad3ac9a47f63c924df4832d73f732a99f777f324998fb73993ccfb5f7f96ccc7df3a49e6e3514592b9bd3aa664ae1fd6bd646eaf9a2b98f4ddf52573fdb58e60d89f6d49e6df9b13c97c3c1d45326fbf634826ffb2934cfee40086fdf88164de7ff65232d9eb9b646e1fa607867e9bbe641a8f816092cf14f2423f4d070c7d8b9f25f3e7bbaf60e89fb791ccfb3b15df43ffe22f30f42f13f240ffea1b18fab716bf877ee967b043dc92bf1f0ea16fdd9af3a8f740bc3dbe64f2f70bc9bcbfcd2fc9bcbfbd4432f90b4730f5cff55e3297bfc9c0187f732899f4772099c6e35b321f7f6b0fc6f8daa6649aff7692f9f3724d32d7f7cb4932ef6ffb4e32e9b302c6f86723c9dcdefc50326f9ff32e99f7975382a10fd75c32d7e795906742fdd3bd49e6df67a2bdd09ff20886beb89164fefcd54932ef9ffa2c98fca72bda0b7d6a9f25f3feb0c4f842bf9a07b0d02fd13fd0afe2090cffd6c660e85b24ae87be05a40f63e1df8277c9bc7debab643e5e575732efef6e2799cb1bfcf89ecbdbed2573fd5cfd781e1fcf952d98fa3b91cf277f74cd24f3fe0f3ec08807ba8d64ae9fc54232e98f27993faff9f13df787ae680ff4d57995cce57103c95c7fac3bc97c7c7c5f308d67b8028bf9f72299cbd3dc49e6f2981f92797fd69664de5f7e2499dbb33b92ccdb6f2dc1d067772099fca72e99b7ff6a49a6f946f437f4b9bd48267934b0d0ef77c9bc7dad68df9cee9fee25f3fe69447fcc31df88f1843eaf6e92f9f3da89649a0fee25f3f1cb85be41ff0331bed07f5f8ca7f0a7d43f13a1df9d2a99f777f32899dfffea80111faeae92b93cee41f090f7effa0c463ce77f48a6f9ee51321fafeb4930f547bb01433fecb164fe7cff5b321f2f2f92ccfb3f93d793bd745b30f421ae2593bfd94be6fd1b2692b93cde4e32b79fda164ced8ddec1d017e74332f9dbb564de5e772899e299140c7dcaa692b93db8df92797fe61d18fe3117e303fd59b792e979b164de3f8918ff05f5cf46f40ff4c715e301fdb9bd80e13f57f792797fad4a30fce906bf17f3f51ae331c4fc19a13d43f89780e693a9f0a7ed028cebfd4e321fafe6198c7cc00b2473f9bc77c95cdf4a4ff0908fc75a5c8f78bfb52553fcf02999ebbfdf08a6f10e5ec1c2bfdc49a6f97c2b99e6ff27c9642f3fbee7fab416f2407fc299643efe912f99ec692099cbd3b492b9bc9ab8ff94c63711fd0bfdb2a792c93e2ac9140f689229df5125f3feed5660e85ffd2a99fce34432efdfee00867e5e14c9941f8ec0d0bfcc904cf9572a99b7a76e25f3fe73c760a1afaa646ebf99e85fe86f2ec61bfaea0b79e11f0ba12f2eda8bfb4b7d267b98897c64dd81a1cfeb503297afbd934cf1d45e30fc93f81ef363b896ccefbf3a4a26793dc1149fae7d30f247ff2a99ea1d3fbee7fed68b05a31eb1924cf9c2083ca5f6076bc9542fd948e6fa900e2473fdbbbc09463d630246be1a6692f9f84481643edef95532b73f5df01cfd7993ccdb7be92453beb5924cf3c14432efbf5cfc7e01fffa2999e6bfb1646e5f9b022ce2cba364de3e37114cfec132c0d047f74d32f9e37b30f26b2f05431f5763c9bc7f42c1d04797e6cf99d0c71be41fc21fa52a18fe24207d9f0bfd5a1d04d3f8570fe009d573dca3642e7fbb054f697ca237c1246f3a944cf53a5b32c5a72f60f81bd796ccaf4f2bc994af2d2593be6f2453bea682e7345eed4e32d5ff14c9bcbf2f57c95cff7dd15ef8a35097ccdb93cd25537e2bfa6b3124fffd055ec2bfcc24537c548045fe518331decda7647ebd2eda6ba37fc478c01f6d44ffb8d43e1ded17e3af3960cc97f5022cf481e257a6dd149fd96bf08cc6ffe64aa6f92604c35eec4032b7efab2799e2375b30e94b2aae5f50ff58aa642e6fe148a67ce1065e927fb80d2553bd2494cc9fdf3e49a6fc45c863c07e1dc97cfcd3a3606a5f7d05633e887682497faf4bb08df8e2030cfb2bc9de17a2ff4bf49f886762f4cf10f666bd80618f3e8dff92f5177f5e914be6ed2f36e005c91b5f24533cf22598ecafeec04be467ae64f28757b041bfaf5f040f29fe68c0268d9726da63917e14a2bdd0c7f424998f5f44fdb314fd91bf83a18f8105467fdc4660e86783e789fee94a30e215e3118c78a3a0f9dc60fd45fa34072f491fc329d8a0f685a964aae7dfc0265d5f2f05537f568f60d86bb091ccfbe36248e6fad988dfbba85f8e24533e48f66f88fe892b30fa67634ba6f97508467f6d1cb0a827435ed11f35fa6388f9c9a7f8c814f157fd065e92fe5f6e6083e42f5cb0897ac417d8227dca3fc036f55fb305431fba77c1747f3b02bba4df3ad9ab29e42f669229df46fb647fe460d8d3aa0243fecd2758d4bbefc0a21eb403a33f2a8a772c263f6fff35055ba827d1f85aa2bf2f1a58f4f70a8cfb252a18febdf1c0f02701f58f2dda7f5d48a6fe9b8071fff21d2cfc83603caf51c1b87fb106433f4b1a1f87fd17eebf1b17ec903efbd43e46b0f71a0c79cb2d58c4e72d18cf2f1bb078be0dc6f3339abf5cd11f8906c6f5de1a8cf846e3f6c1cbe724df068cf6548964ae3f1b130c7f9096608c7f7603a3bde90e8ce7bb2f60b4d77e00c39f075c9f98f639e47fa34832d7e7f84c2c9eb7ba80216ffb08c6f3cc042cd64f1a30e42f9760d88fe382d19e1ced19c11e42aebf0cf17cd306435ecb04a33d610e16f20b16f1470a16ed3981457cf9443c82bdae2660e19f79bc341c8be7d70e18cfd71ec022df8ac178feaa05e379d72bf108e3df70ff369cc8fe1d8345bc9c81d1fe60452cfaeb7a03c3be74ba7e2adbd382f1fbcb3b18e3910dc1689f4df24e657fd4603cafb2c168bffb0cc6f32b1ebf0c67e2fe01e9d34cdcef1283e12faa6f30ee67f860e1ffe660a1efdc7f0ee7e2fed58c58b6e70cc6ef8d002cd6173db0a83f2dc0d0b78edbf77021e5bd078bf6aec1f87d41fabd14f2155bb0f8fd108cdfeb2330da93de83f1fc8ac6d310f2ac1a309ed772ff3734c5fdb48d64ee0fb72e58d4e75ec0f87d7202a33f0d713df4a5237bb7e4782a60b11ee681d15eed112cee1782a1cf158f4f86b6b8bf6581c5fa2af5a733823f762d30eed7d2efdd11f2efcd1d18d76bdc5e468311f2a3c007e379f5082cea75f760e8fbfa8d782cf49dfba3d150fcbebc030b7bdc83a17f099faf472371ffe64c2ceed73460e883cefb6b3416f7ab4fc463e10f2c30e46b8927e279b94b2cee6f6cc1d087ec092cec4930c6f342f24f85fc46442caef75660e8cf85fb93d18cfd9ec783f1162ceaa37cfe19cdc5fd3ceabfb990d79d80d13eeb152cd64fe9fa85f8de7c05a33df9188cf66cbec0d0c7f50d0c7df3b8ff1f2d85bcce002ce227078ceb1d0f2cfca54e3c41fb6f74bd21ef5780f17c5d058bf53beeaf46e618ebd77a2299c77f5bba9f25c6b7f4c1c2bfbd80d19eeb07f104fda1933cb678de2603e37eba01c6ef6f57b0a8ff71ff3d72c6a8b7e8d47faee88fb507c6effd188cdf3bdc1ec67d38c739e2e3c5a63393e21723269e60fde4f22c99d677b93e307577285eb7b8fd8f27ecfe9cf50e0c7d8a79ff8ca7ec7bfefb6b412cc627db81c57e823730ead9eb1158d43fb8bce399b8fe7a0716eb5d7330c663c3fb733c67eda1fa484d2cc6c39a83a11fed193ca57a651282b13e16f3f96ebc9860bdc8d880c5fe810c2cf21bae8fe3e544d4cb23c93c5ed30a30ea071b170cff92d0f81813d443d71730eaed9a07c6f53eb7b7b1c9bee7fa117c49a6f5024b30c5b3760cb6b19ec9e3adb13331e8face93ccfbaf3883f13c23013ba8a72e05d3fd0d1b8c7c734df23b53d8df86facf9da03e7e1b80f1fc82f7e76430813e6d63e229fa3be5e333194e4cd40b52b04ded31b8fe4e4653110ff2fa0a73a736f28d9a788afd67fa180cfd6a1db0588fe3fe7f32610accfb77c3f59721f2c77c493cc5fe0aaf00e37eb731788afa4e059ed1f8361f60d48f6dde1f93d914ebc7460a46bd2fe4fd37994fc7940f6cbec1e89f98cf5f93a578def5013c433d86da6f4c51bf09b9bd4dcce982f2b39cebcbc49a22fff6b83e4dec29ea15d95932adb704c433acffebf43c776ad1fd039d7886f5d315bf3f5356f09acf77d3d1d4a5fa65734f3cc3fe035d134cf7372c30ec355b824dc413dc3fb0e9906574dcdf79c4e2f74501c6fa5b74104cdfb73c3e9d4ea6d6887f7fdb10b3e791bef1f9940ddf1ceb078fe005f5b7c5e7e3e96c86f58f8d0246fd3a76c1f311f9b377b043e31bf07c693a9fa1de19df816dec07f804bb584fa3fe5accc47a86069e517b82002cd6f775b043f39bc6e3dde9923d8eeb7332035bd47f3705ec60ff824d3cc7fecf84ebefd498c19e2faf609bfa2be6f9f0d49c2d51cff5c016e5fb2b176c8f78fb8b15d8a5fa99c9e7d7a93543fdab1b831dfafde6287844f5d10e8cf1af49bfac39c63bff024f499e98ee6fb3fb937f7d023bd4fed407bb435aafb124d37e2d5d30b53f03cf87d43eeb0d8cf5dd7803c67cb7e1f63d75587f707df1e9fece7c30a2fd5d7b30f6b3469f9269fdc792cce5594dc1587fba52ffb84c1edebecd5e326f7f41faebceb19f2cda8271bfa6133ca2e727e0118d4fb2164cfa9c2892f978af4c30eca1f1c19321d7bf2bff7e3660e34ff5e53bb043cfaf5dc174bf6c0076a97fdb929805acfcfb6d0446bdbee4ed9f0d857eddd660f89b6e2298da5f05c4ac3f687e6bc0c311ad87e07a263f9f0fda77f094da537f8067245fc5f569369a1963d29f2b31eb5fdabfe20ba6e7a777e0d188ff3eb9815906c29fa78227d04f053ca3f6b65c3f6663260fd553a93d2cfca4fec91bc95cfeea041e517f5fb8fece2662fcdd023c86ff33c1d31167cd06cf21cf5c308d679d8017d41f0df72fb3e9cc1ef3ebab14ec8c69bfc05432ed47d38885fe5d4cc9b4fe37028fc8fecb37c9649f25784cf6ebbf82e7f47dbc042fe87e05f5cf4ce8936b82e7f4fb36113ca6f17a002fe8f986b8de80fe8bef4dd28fc292cce52fa68269fc4d1effb0db2f49decd0c0c7fdc92fe2ce6131a3f6d2d98fcb7bf02cf49bf370330d68fea5a30fdde38831dfabea3fe59b2fea178b0009bd41e4f03db23aeff37713decb5f00593fc2df5a7c1ee47eb6f2330eadd17156c8ea87ff7609bfc45590b267f78d5c02e714bfa6ab2f1207ff80136c87ef22918f34dfe06c67cd186c48b018dafcee3cd99c5ee47faa48217647f99609bf4c7a0f1b2160392afa3f6da6cfc68bcd69279ff949f6093daef4ec1f067f5817831a4e76de8f70ebb9ece177c806d6abfb3235ec0dfba2bc9b4df9bc6d7ed1376ae5f5c3fe703263f6f4f520a1e53fc99102f66d4be8cf7cf7cc8e4e3d7673e784c7cdd82a7d4de5a03c3fe751e9f3265c2fca09be009d94fc2e397394b87c99f186bf08cfa4fe3fd3b9fb0e7717dacc792e97c0b8f5f58f8bb20d6793d613e5f2cc7b49fc5005bd49e35b56fb1c4fcecf1fe9e2fd9f7743dfdde582ca83f8267b049ed59f3f9686eb2eb69fd782699d62fa83de67244f67de1fa3eb79643b237ef2698f4ab9e8347d4feb0008fc99e1c6a8fbd70d05f4762261e6f9f46e3e730a6f3160618fdbbe6f9c6dc5d0ea8bd0df5bf6b88f89aebdfa25f00a5f8ff4e32edd749c0636aff66019ee17939780e7de2f92a73f643e8bb031e537b7c133c237bf5dec073ba7f44f71f1a225ea3e78f447f79dfe011ddcfe3f22dc68c29feff06e379ba0e9ed2ef0b1effb1747d44f3b1fd0d5ed2f78d0236c65cdf367c7e5fb0009858bf07cfd15f7bf082f4a3492473f96f19d8257b6df8f82e66cb05f55fbe223630ff6f797cbc98b3f67079527afe82319d17e1f6b7581a03fafdc693ccc7d7a0fb194b97da7bbb111b63f2af1bae9f0bd31810eb7cbd61612d1dd2bf94da671943c8cfe7af856d8c69be6e0563be594f2573fdd7b8bd2c1c763ded0f53c01392c7bb4ae6fdd3717d5db8c684fa4bbb134cdfa767f094e28180fba3e5c080fff15fc0b309f5ef9764d24ff13dfc43cae7a3e5d0807d6cf8782d47acbdfcfeed0b783ea1fad50ebca0ef6f3ed82079a32f30f2c5644f6c627f5acce7df655fd0e1e3930460a662dc3f1cc14beaaf40133ca178a8069bf47cdf90ccc74ff3c10e8de78dfa676c8afd09b564daff5982b1ff36a6f64c58ffd2fed40b7836a1fac504bc9c50fd6101c6fc97abc426e2b3700fc67911f3018cf33ac99d643e1edd198cf3176e07463da4fa0063bf8826be47bd53e7fe773965e345fded806db217eb1d8c78f29612b3f6923ea9603cbffb0663bf4949d7b38083c663b3022f68fceb7bb043f6118682a9ff8c02ec92bfcbe9fe7dba49f5c30d18fb636c9e2f2ce7ecf7144f2a6097e4bbe5c4ecf7140fcdc0b0b734018bfde03a784af3c53504cfb15f47dc0ffb0bbb8160ecbffc002fa95e58edc1d8bf1a4dc1163d2f36c1a8575495609c5f1a4aa6f3a134febd83e2ed2f376093faafa3e72fcc01f1f50b3c217ddd5660ac37ad63f00cfe5407cf69beef5230ea35c6026c60bfe55532e55b39d8a4eb6f73b0d8df20ee6f637fe04a32cdff03b043fd757b904cf9d9168c7ae7ed2299ce7b3692697fc898d8c2f99ddb128cf3b317f49f85fa6348f75f1a06d9afb604c37ff817b04dfa1c0ec10ee9bb4ef22ecd015d7fdd8047345eb5079e907e598e60d2d7b40363ffe3762598e2d5750e16e703d692297ffc128cf35768af897afb36108cfaee5c32d56b0f9269fe2e24f3f61731d880ff5125d37ed80558ac974c25d37ec09d64de7fe64132f73fea27d8a2f15732c9b4bea008a6f655a23fb1dfb28c24d3fe470d8c7ae1ed5132e95b2099cf8fa6e82fd4e3c32fc9b4bee3125b38ef7723ff641816d99b7d03dbe48fc22bd8a1f9f95a825d9adf4af28706eb1ede5eaf060fe97aaf133ca1fc5605237e6d8ee009e5bbd5198cf58b4efc1efb6fb71730f67bae66e025c5df8a09c6fecae020998fafd248a6f3ba909fd93b6f4f71025bb0af52329ddf9849e6cf533fc036e993924ba6f96726993f2fcec00ef57ff12e99e2c34a32ed7f0cc1f017d5bb649aef7cc9bc3f22f13c97fa4fc3f859388f5a6d25f3f69443c1d86f3b06e37c4be54ae6edd354c9bc7dd791643aefdc4aa67acf2b18e7f134f13dced325a4ef26d3379affc95f9826e2cb952a99c6f7153ca57835fd0463ff691108267fb579028b78c2001b34dee14532bf7f62814df88b4832d52f2ab085f59d0118eba3752899ecff2699eae307c9b43fb405431f9454329d2fbb97ccdb938cc02ee95b2adaebd2f8b590dfc279e448974ce3f12998e67b4d30ce074713c934ff403e0be72d2dba9fc5e607defeca014fc85f5413f094e2313b954cfea0114cfe467901233fd41792a99e6a49a6f527c198afd71bc9549fb9822dea8fba944cf9502799dad782b17e6d7592c9be6782495fea42321fdff8c7f77cbcb477b043fa1deb9229ff4904e37cc697641a7f0decd27828aa647abfc45032ade7b982495f13b25fcbc2fb0c944032d9cb93606abf5949a6f314cf60bc4fc00a24f3f6b79960d29f5a914cf11dfa53d87bf82999d6df303e16ceb755a4cf369b3fc8ff7660ec3f57de04933ff0f760ac5f665bc114df2b67c1a44f57156c507f5f1cc9b49ff3198cfdc69bab60aac7ac4f601be7fd22c1781fc95132ddaf95ccdbabd492b93e794f60e883229e87fd9ef959326fbf3a964cf9e00318fe5d9d4be6fda192fed916ce83a92f92a93dbe64ca8fd11f229e4c6f92f9f3938164ca1f4f82b1fe994ae6df871f60acf79a6bc9bc7f62f49785f3b1b75230d95775914cf30bfacfc279b22df90f47c413a621995f9f7be011f99b6d2b98e2136d021e4f683d63059e4cb83e7ae2fa19dd4f3b83e734df943118f581f22099cba33c8397549f592dc026d69b8f9279fb6f9f60e453d6156c537f5a63c9644f8160aa47695330fc8dee0aa6e7c5b964f28791648a6fe692297e580aa6fa6628da8bf8c3bc974cf9642118fa38954cf58f89649acf1692e93c27e9936361ffbdd149e6df2b9e609c1f7d96ccf549ad24d37974e887d0676721998f8fba924cf1fa9364b247713df687754f92e9fc672399ea45a23d581f35af92f9f7b9f81eef13885ac1181f4b32d5dfa10f16f6a3044bc974dee9158cfd3f892399fcbb2d993fff26fa6786fd3ba23f711ef146d7bbcc7e283f7b944ce7995ec0639aafab25784af671db0a9e52feb200cfc9fe320f2cec650f5e52beae7d49a6f319e2fe4bd457766083f453bf80b11fa878154cf6b2adc1585f37c4fde0af235530f251717fc45b9e90d7c17ca848a67add5530ad1f74a160aa8f76e279c8e7c34630f97f3b174cf2379a645abf247fe35a781f90ff2818f3c1443297571d49a67cfd4930cd87da1b58e8ff5630ece74b32cd1fa564aaef7982697dc87900633f73694ae6faa0be4aa6fd789a648aa724637fd25a32ed3f79924ceb3d3330f6f325ad64de1fd98364927f2598facbd42553fd3594ccafcf311e16cecbdf22c95c5e652a99de7f267e8ff3c9e1bb641a6f4732bf3efb008bfd812f92297eb32473794b31bec87fa30a2ccea3ee0493ff30f79269bfe23718f53e6b2099ea0377609c7f34be2453fc7b914cf91c1f2f63c0e6478a0fb6e019d58be207c1538aff8fe039e503712b99e6eb5c3297a750c04b1afff22618fb1922c1347fc73bc9b47f4630f2f9eda360b2efab2e98fcd1ea158cfd83452598f47f6b48e6cf8feec1a8b7a40bc1f05f3bc9bcffb61918f596f85d32d5e3447fbaa48ff94030f6ffdc24737bf267c416f6a7ac3f2453fe580bc67e99122cceeb9c24533d6b2299f4ad108cfce30773fd500cc9341f7792a9fe6b0ba6f5da6b2399ce372ec1d85f1d9d25f3efd59b60f89f3bc9bc3fd4a364f22f6f60ec97543792797fa8a960d8c74d32f9932918f61ed49269ff832d99e44d24f3f61a23c1d43f96fc1ef1fe1c8cf763448e645a3f16cfc3fe3d632899e2955832cdafd01f0be7d5ad4a32ad9f3792b9fcc64030ced3d792b93e9723c9b41feb02c6fe67732b99f68b7c4aa6faa3180f9c17f6499ffa032dc46bf098ec5d8f24d3fe08133ca1f530ed049e527eb7f50593ffb83c48a6fd570a7846f7d36b30e6fff25b32d5ab73c1145f28ef82299ed1e660d473b64f92a9def92698fcdd5a3cdf46fd24914cfbcd74c9b43e21e445fda611f7437cb1fe124cf65edcc02edd3f7225d3fb001e05d3fc5ebd108b7879bb93ccfbc72f05937e66a9605abf538e92493f56e021d99f6249a6fa5b2b98fc9f72914cedc3785a789f52f12698e42943c964ef17c9e40fe792697e1849e6f2648e60ac470660bc9f243b4aa6fd3fa1647ebda20826f9d24c32ef0ff55e32d5d7447f60fe2f9f25933f5a4aa6f8e62c18f9502299f40ffa61e1fd4b4a2899f6279492495ed19e29e297028cf795048d64dedef05530e29137c9e47fe4efb19f740cc6fed152134ced0f55c9fcfb488c17dedf74b9934cf64dfa3c326754ffab0cc1643f510ac67a78ba04633e77466083ecb309c026cdffa921998f476582b19fa7ba0aa6f93e5e0ba6fca6188051bf4b447bb1bf4aff00237ff60f92e9fd41f792e9bc7d2599e6f717c1d8cf247e8f7a5d160ba6fecf23c1b4bf21a0f86264e13c72f82499f2fd57c1f06727c954bfcec098df755b30d9ef7a2e98ecdf78974cf54cb447d47b3d5330e2cb0fc9b4df47dc0ffbd12ea9647a9fec1e2cde07f92e99f60b1c05239e3e4ba6f9df974cf9d74932ed9ffff17b2e5f70014f90ef288261df8664b25f5332bd6f0ae36be1fc4ef92499f22d4b3297ff593c0fefb7525dc9e4df3c30de5fa53a9229feb12553bc2ec66f46f2565f92c97f37609ca7b4df25d37e825a32adff89fba39eaafb92293fea24f3ebb7627cb13ebbfd944cfbadbf2453fe37154cf287a664d257d15e715e80fa6fcce673f2af117846f94076075e503d2188c1d88f9a9b82c91f2457c954cf38832df2279ba9647adfe70a8cfaecf62098e2ef6e2699ce27ed04533cb2d5c0d8efaa3c09a6fa46f12199ec5d3c0feba51dcd9f63517f5dbd0886bd3f4be6d76f7f30d59b62c164afde5432d5271f2453bdf0118c7abd77124ced4f1ac914afae2553bd5edc0ff3b9f32498ec6d1308a6f66c55c9341fdd83313f9ba23da8ef46a564dabf664aa6fd21f27b8a37e291643abfe249a6f9ce174cfb13a2028cf78b25b9647a1fd4a364f20fdf92c97f0c25d37a512599d607a03f22bf375ac994ffa49229ff78944cf94a2618fe48fe1ef59e4632bd3f270163becf2ac994bf8beb71fe4b0d2453bd27964cf552d13fa807da2f9269ff612499e627d13ed40f424330b55f13d763bfc6ed4332c50f37c1f0f78a64daff3d964cfb43c578637daf7a138cfd39429f719e6745fa30314df21f590ec6fedd32134cfbb10c5d30f98bcb8b64da2f3c01dbd87fbc174cf5c92001e37c4d25eee760fff1b7605a0fc8b792e9fc81b8bf43f149740263ff68fe2a989eb722fb9c8878201849a6f75f9e25d3f37cc974fee15532bdaf752898ecdd0904d37a475080512faf7e30e9432e18e7f56e82914f5482c91e0bf13ce4ff7e2698c627fb924cebcfe2f7d8ff1b3e80719eaa934cfaee3992491e717ff80f6f2699f22ff13dcecfa753c9e4bf0e92293f394aa6fd139660b2cfc8904cf9df4230e68b4a32add78bf1c0feda740ec6fbebcab3648a8f2792c95fd492299e1848a67ccd164cf25b2d58f887ab64f2379d64de3fea4132bd6f4efc7e8e7827944cfb7f1e2553bd4f134cfa6c799269ffb6781eea8df14432b57f2718ebe591645a2f8b05231f15bfc77e0f652699e229f13cbc7faa9a4ba6f361427fb03f5013fa8cf5e2c495ccbfd73dc924af180fec0fd33e24737922f17c9c6f6cc91ea626f69b5e13f082fccfe64d32d547bfc0385f565ec0886fba1cecd07a663394ccfb237b05633d627b144cf6779949a6f75fd682c93f06349f4dc5fa433d154cfaace982697d721b4aa6f3c11918f585742299fce5bd64aa67958229be5ac560ac27ac12c178bfd79b64da0ff1e37b7adf95fc3dcef70592a95ebb174cfe3a10cf47fda01c08c67e1b5f32bdcfb0134cfde12a92493ed17f585fc81f25d378dc49a6f8e253308d57249e3f417c7a904cfbcd7e30c5d382b11e982592797f24df82b1de954ba67aa6907f4af69baec138af6c8d24533d692f99ea733bc1e4ff3c0b2cde37be944cfe712499f2b1b964b2675732c52bd0670bfb45d54832e58fba64da0fb301e3fd8d4a2499d67f857ee0fc72f82d99be5f81713e3e194aa6fd49e27e588fb89ec1884fae13c9d4ffa27fb0bff0229e67537fae481f66e612fb2d776083ec3debc026eaa53618f18a3b0323fe580f04d3f5c98b64da7f63825df217852e99ce77907c33113f6c4dc134df6f1f24d37c9982b17ee04f05537b9a77c9148f88dfa3deb07a92ccfb7f73168cf365778229be48bf25537d19f28bf501e55e309d4fc94f92c97fcec158cf2b12c1e41fbb4fc9b43e3d104cf3f7f6158cf87ebb170cffe448267942c1e47fba05187f1f455049a6f5614330f4ff0d8cf3b88ab83fde3770d94ba6fafc12bca0f6a557c1c80f6dc9644fb964aa7f1492a99eb1934cf3f718bc44fd632199f2ab67c914bfd782518f16e389f78346a23dd8bfa58c25d379ba4030c95b5f2453fc5c824deacfec2299f6eb6c25d37ae74630e2b94632ad170bf9b13fb87b964cf514713df61bd4aa643a9f0f7bb31cecbf10fa28f6e3f89269bd83e2adb9399f52bd33032fa6fcfef9086cd07e8d95f81eeb1b97a964b2bf0dd8a2f958ff02dbb41fbbbb825d9a3f2eb5608a3fe28560caafb6141fcd45fdb11a83b11e180f05d37e5c5f114cfe669d8051ef6f3dc1a40fab108cf3d9e55a30ce3b1a60d4d78bab649a5fe5f7645f978364dededbb360f247452899ea616730d6e7d6779269fdfb4330f9bbd4148cf8e7058cf5b8e44932bdffe25e30f6835c24d3f9d1b964b27f713decdd16ed9b937fd2f792a99ed2082679a247b0380f33964cf3ab18af05c52f57d1df381f5baf2453bcff0046fcacfe60daaf6a4aa6f9ed4b30ce7fce25d3fedd1918f65f8af1c37e6d4f954cf9cf5a32c927fa17fbede254326faf22aec77c1bd582a9fd971d58ecef3524d3fe5ea1bfd84f97d1f82ec47a83be124cf5c8ca07dba4efbab8de9df2dffba44f0b51afeb5cc1747d32154cf61eecc043ccf74f9269ffd3098cf7495c1e25d3f9c14a30ad9f281f92693de2001ee3bcf34430e94f71114cfe259883f17ef6b52599de2f36144cfaa23c4aa6fafd188cfa79d60a267de832c1345f1786649a3f7e30cd97a2bdc86ff55232c54fb9648a6fc4f367e44fbaa1649a5f669269ffb7f87e4ef6915f2453beaf4ba6f9443c1feb655a2c99e47b944cfb532493ff6bef25d3f86ec1e2bc532318ef1712fa82f3cdc55e32b5ff1b0c7b5acd25d3df9fa04ba67ac25e32bd0f44b4cfc0f95ad13f787f759c08c6fb8f34c9141f6e2453fee80b46fe22fac7c2fbafef24933f17fa8efdf9590dc6fb8d4a8a079626ceb3d513b04bfa5a527cb664f645eb65067848f359fd8369bfec063cc27ae45532d5e31f25f3f15c3d83315f5d12c9544f740553fe1e6592a93f3dc158bfb88127145ffb9560b2873a96cce5d75f25537ce90ba6fa62f283a95e2ae49bd2f82b0f82c93ef385645a6f17ed453d39984aa6fac04c32fdfd5607c1a42ff14a30cdb7b74232e5a76f60e483fe5132cdafb960c4fb5f60c4aba52218ebaf7b30d69fb6e27b9c1f0ceec1d82f962b92c95f1d24537da7148cf93d05239f534f92e9bc8bb81fcefb1547c9544fabc1383fe68af1c67e92f807d3fe43213ff6af7662fcb19fdaa37cc410f5ebfc5e30cd1f6b07ecd2f85a347e06332faa8f1cc0d0efdb17784cf6e91a82499ff44ff004eb318f92693fdebd649adf5f05937efa67c1347fe91618e7bb6e7782112faa60ac8736a1601a8fac00a31ee98c05e37d155bc1347ff8aa647a1fc009bca0f1f21682c99f9ae2fe0b6acf360763fd62bb168cfcb0148cf7790879f1be9ad4954cf53cd17fd8bfe49f24533db1164cfdbd7d07e33cd346fc1efb17b789643a4f300423bf303760bcdfec42f669b27885ee47f38169e1bc977e124cf18d3706e3fd11fa163c22fdda9482a7b43e7805c3ff058660ba9f2b9e87f364d14632d5fb4792e9ef37fe02e33cd926028bf364efe039c9b712f747fdd9ad24d3f58231fee58b601affdb9b648a6f7230dedfe12d25d3fa760a467d3817f218145fd99f9269bda1924cefdf93df23fe7e009b349f98623c2c1a5ffb2298ee97d8609c3f32e6609c3f8b2cc9646f0bc914cf3f4aa6786607c6fe958ee20f8bcdafb43f81e20b165e93fe5c3e25d37e30f13dea3ddd093cc27ede2d18f5983804e3fd1d9a25989ed7168269ff61fa089e223f9e8167d47f862699d6f39e25d3fe68152ce2b70318e7c9ec67c9f4fe12138cf70f252918f1932b9e67507caf08f9f1be9938069b648fc15e308dbf32108cf7df88e7637f627c150cff7a0163ff42f000c6f99c88ec9b4d37a867d1fc62b3f1a3fd3c743f5b8c5ff102463cb2da82117fb4df9269bde12498ec510f25d3fef01c8cfcb8b425d37eaa5232bd5f2506235ed85a9269bda4154ce31d89f6cef17ea8037841f76b447b17d84fb6012fa9fd6b211fea49978b608a4f0c156c423f3bc9b49f3602c31e6f7bc1d0bf4a32c50fe44f6c1bfb3be22918e7e93a6287d907adb70ec063eacfd51b784afdb3d1c0c85f8a5232cd97afe0398ddf652d99fcf75130e5879d09c67c961482c97eae7bb049f74b3ac9349e86649a4f2692b93cb978be8df749b88229be509660eca7f39f24d3f922713dd6afaedf8269bcd690c7c6f9d755001e52bc5b533ceb5a63d29fab2199ce63edc1139a9f82083c25f9f5068cf745dd2cf082c6238d25d3fb1d378229bf503ec178dfce6a0946fce9bd0aa6fe5ccf04e37d0af27aca77ac1bd8a2e747df9229fe2dc136f98ffc4530e9f34a934cf9f10fa6e78be739387f48fde9daa8f7273c3e310716f67b260f9269ffde1318efefb91e24537dcd06e3fd79f6156ca0deb1904cf6a080d1fe6a2199e67b5f303d4fbb801dd8fb0a8cf8f9a611db78ff5dac8211df745f60d413133e7e2c389be17ccc183c27ff97459279ffac4b30de27947e0826f94c4532bd7f5d032fa9fd6d2a784af58e21d8a0f9e1aa48a6f53f5b30d58ffd6730de5f94ad89ed01d9ef86eb2b0b2eb0feac6fc04b92af7525d3fbcd8f6093fccde64532d9cb4d30c57fe1128cfd33eb77c1a41feb028cf7355a1f82e9f9ee1cec62ffea9b60f227892918e785f0bd8dfdafe9b3601a4f270463fda81980f17ea59adbbf3966fd41ef472dc14bf2075b1b6c60fdec4132d50f0bc9944f1cc126c693dad7bf5e9ff2075c6f63bd6b45fd33b1e6549fb8adc0580fdc7682c97fdd5ab035a5f74309c67961e50bec523c1de2f736eaf7f11c3ca4feaba8bfa6d664467fffdc080c7f53b492a97e6f08a6f686776013fab4964cf69982717ed224ff30b5b15fe81608c6fbd3ce60c48b2d8dd78cdd8ff2eb5430c5839b5730f2dff60086be74a4af33d6ff148fdd8391ff6a74bf390b30693de808b6917f64c436ce8fdf1230f6bfb7345e0b6b3a27fbe9c0f319bdaf8bfcc782a5f7e43f0f60cc4705f99f256b3fedf71c826d92ef3625b627349f68dcdf9b2c9f9b927f237d3458ffd1fc5b8327f007241f530f1aaf6b00467cad51ffb2f8674efd41fed5b6711ed0e4fac192cf39b57733022fe97ecf977feda32abf7d8c9f3e26ffa7827fa74fcf0afb9da5daaac3fe58ff6a0be8f3df21cb2f72b9ecf3bb5c0afe9b90afff77f7df5116d62247f5d81ffad87ddba87590cbfd87bfb3f1f9779605f20899fa6be8cfffb79fff167b71e9f393743ffadc1663f4e33aa96fbdedf8eccf3f18b9ffff65e16dfbc90e6009240d1fa9bf2b3bc9439ee0df4d1661eb3f64f9313a3f24f3e4e717cbfa7791e5379fecfefa91d758f05a8e94457a8a7f2b590235542335561335553335570b364ea55aa917b5669f86e951ab76ec7365b2de544dd5d99f15ff9dc67eb1fe379365a3aed827652391a85bf6b963d2ecd43dfbec982c07464726dd91fdfb4e3da9f74cce7bf5817d0c76e53ff4daff5b6479e43dfdc446e699fddb597d515fb94ebda9efea87faa906ec9a9449f8c524f85607ea501da96375a24ed5993a67d2fc1bc9c25a7a5637ec9f91ba607f02d8fd92c9f2cafe6929aafaa4284cc7be15431d2ba662b18fad380af31a8aa7f8ff3d92fcf7cc954aa0844aa4c44aa2a44aa6e44ccf5ca63d2dfbf4b6622a059b45064aa954ca45a9954669954eb92a3745537465a5acffe8b5ff37cab251b6ca9db253cf8aa2ec95036bf1513929f7ca83f2a83c29cfca5979515e9537e55df9503e952ff6dfbf9581325446ca589928d37f23596c65a6cc9505d3b393b26413cd83f261288661b044c0b00dc7700dcff08dc0088dc8888dc4488dccc88dc2288dcab8a87746fddf23c99f9345b58ca6ff23a390df6677a3353ae36adc0ccdd08d95b13636c6d6b83376c69efd391847e364dcb3cf897d8e8c1fd8e7d178329e8db3f162bc1a6fc6bbf1c1b4b0cf02685e757f9b797f9aadfe999ff8af6561527c1a5feccfb7313086c6c818315fd4186363624c8d194b9916c6b2370ad3304dd3326de3683aa68b8fc73ebe19b04f684666c465eaa53a9a31936a6726666a66666e16666956e6c5accdc66ccdcebc9a375333757365aecdcd2f33b1f2eb1cfcd764311a736bde3169becd9db9e7b21ccc8379344fe6bdf9603e9a4fe6b379365fcc57f3cd7c373fcc4ff38b7dbecd8139c467648ed967c23e63736aceccb9b960992a3334e3de322cd3b22cdb722cd7f22cdf0aacd08aacd84aacd4caacdc2aac12b9dc2f91c5ffaa2c56655dac4b3f2e566d0cad5a3d5b8dd55a9d75b56e9666e9d6ca5a5b1bd6d3f7ccd96ead3bd6522689b5b3f61677bfd6019f2393666a9dac7beb817d1ead27ebd93ab351da592fd6abf566bd5b1fd6274b98bf5884b0601e3d61b3e9c0faeea3cf1fd1d1bfa2634cb31a8bfe82f001fff74a89aca135b2c6d6c49a5a336b6e2d7acdb196cc74fa4a9ed18f85b5b34d48f2439643bf4c614e6ddb766cd77ab03ddbb7033bb42326cfc178b4633bb1533bb37336abda766197ea935dd997de92fecce74fc932307756cdc6646055aa67d77663b776675fed9badd9ba71303fec95bdb6376c249ef9676fed9924625414662bcc5e602bf766681bf6d6beb377f6de3eb0cfde3eda27fb9e8debde7eb01fed27fbd93eb319d7b35fec57656fbfb1d1b07efffcafc9f27cb16a66274cb78cc6f8b4df992c1ff6a7fd657fdb037bc8faf3c47a7864bbe6dc1edb137b6a2db924bb7e64fab161ff9cb1f6ce85fd9b91bdb0972c485698ddcc1dc3311d662c8eed384cd2bde33a9ee33b8113b218f5dd89545df17fcdecfe155954d7183ab113333bb1edda499cd4c9ec2f27778a5e0ea7640ff0ed3d6b55653d3b17361acf4cc706cc6216dc6ed8ff3b356b6be3b44ca6b9d3998173756e8e66f7938feeac9cb5b3b1b7ecf78eb365d21c8d9d73e7ec9cbd73708ecec9b9771e7ec9107ecb7a7eb6a03f234b2f09f3c683fe7ecea3f3e43c3b67e7c58cadb33db1ced6b33d6656cc3ece2b6b5dc5dab5c0a7f765ec63cfe9e374f8bc39efbd24f6d20e9d0f66fd47e7d3f9ea7fe954ce379366dffff5f6cec8e9ff5acca933b3eb9fe4f8576599ab9db3b05f9c25fba1e21a6ce2b08c23f34accd3bab6ebb8aebd702a73e17ab66b1f5d9ff9a8931b981fccdacfaca5f76ec86c2ae673e6d18ddcd84d98bde0e3746e6a7acc73b02b594fbcd93336be67377373b7704bb7722f6e6d176e63356e6b358ae67656f3afe8987a70afaaeddeecd6d55cdd5db96b3626cfeec6dd9a43f7ceddb97b3622dbde86dd837bb4576e6031ed331df7e4debb0feea3fbe43e1b817b765fdc472195fbeabeb9efec5707f7c3f9703fdd2ff7db1db84377c474f1c0fe7dec4edca93b73e7eec25daabd2f6091b8a7aa81f70fbdda9f91c533d8f46d79b6e778ae937b9e71b2179eef055ec8e4601fdbf0222ff612e6030eb6d1eb8c977a99977b85577a9577f16aaff15aaff3aedecdd33cdd5b796b36e7c7c6c9db785befce7a70471ebb0b1b5d9dfd3ff36fde8e59cec1db7b07efe89dbc7bb5f01e58467af31ebcc71f5af5bb1ff853b23c79cfded97bf15ebd37a730637362dbde3bd32f2e099368cbe6f229b39ae7de76bd0fefd3fbf2bebd8137f446ded89b78536fe6cdbd85b76441d7a3aff8866ffa966ffb8e71f45ddfb31e7c9ff9e8ad6df8811ff663e547ee8069e4831ffb899ffa198bd6be51bffd523c9189fe75599e2f7eee177ee957fec5af0d6603e6d46f7a49fc967d3aff6acead27ffd6cf77bee6ebfeca5ffb1b7febdff93b7fef1ffca37f62f966a2bef8f78aea3ff88ffe93ffec9ffd17ffd57ff3df8da3bdf03ffc4fff8bf9f485bd30c74ee57ffb037fe88f8cbd3ff627fed49ff9737fa1382c27fd6679f70f597ea97dfc99d8d25f066aa004060b112da65f6aff97c0f7fae5b7811d38fe3570cd0fe31478811f04411844411c24411a64411e14411954c14509839a7d1afb3d68838ee59af3e06a3f07b7400bf460c5fc48ef0d9560ddeb99ad30d906f6c27a0e36ecaedbe02ed8057ba50e0e4a191c8353708f0af54f35ab3f2d8b1d3c048fc153f01c9ccdd829ad73f012bcf6da15bc05ef81137c049fccf38c83afe03b1804c360148c8309fb330d66c19c49b47016c1325443253442d3188416fbc39c71e8865ee88741188651c86cc73a8709f3cb4698f29881c50f61d6fbfc300f8bb00cabf012d661e32fd421d3b41fb2387f94e5e77af6cf63d25f1db661175ec39b19875aa8b3bbafac636f27e13a5c33795e8c7b2f0d37e136bc0b77e13e3c84c7f014de870fe163f8143e8767f52d7c095fc337ab08dfc38ff033fc62d2982c22f6d97ff90e07e1301c8563e3184ed82cb40dd6e1943d63e6ee99fd7c9b53f6dfe7e1225c466aa428456444e68fcacdaf5a46b288ff862c28f1d4c8525fd5d7c88e1c7f19b9e673e41987c8376751c02375a61351c8e2f7cf88e524511c25511a65c62dca8347ab65f369cafe3c4645f01895aa1255d125aaa3266a5910d345d7e8166966678ccc75d4467ab48ad6d126da4677c629da452c82f0039ef778d68ecdb40bf6bc7d74888ed129ba77d2e8217aecefcdabed866af4d1eeaff6f2932c068fb043b77516ca2e7a8a9ea373f4629ea357f6a437e6750d16a79ca37773c2e6e8aad7eae823fa8cbea2ef68a0ce153f1a2aea8f2a2c7f9e1b8da27134096d2b8ca6d1cc8aa379b48896b11a2b56111b319bac629b85166eccbc3d9f73962c7f93b29843e33ef6e3200ea3fb388ae3f081f554cadbcafc5a1f25fe2c0b7ff68f7131d4f8f9e22cd4f73889d3388bf3b888cbb86277bcb0f87111d7d6dedd5b4f7c2639b959dcc46ddcc557ff515dfdb4f662cb3bbaca5875e25bacc5ba3f8b57f13adec4dbf82edec57ba5890fea323ec6a7f83e7e881fe327e3143fb3d866c9bc7380b86e689de373fc120ce2d76011bfc5effd88736b3055a38fdeff992c0ad34726cb6b9cb8adba8a3f4c23fe649db7641ec6b09ee3da665ed3fc0c33f6dcaff83b1ec4c378a456eaca7e51ee94713c862c3c1eecff9dfdb7493c55f57816cfe345bc4c54e3c17e4894c448ccc44aecc449dcc44bfc24484263efde9b3e8bd8d887e7a42c3b65f3d6d17c4da2244e92244db2a84872b1baf07765b1c886f8155b36bbb2fe65914fa2b8499194e69b71f26fd69e8dc9d9b998dff6c13ad953e39054c925a99326d6d5f7beea9db4ccca52f40d55c1d97d95bb385332bb4abae49adc12cd38252ceb4956c93ad924dbe42eba26bb641f1c9243724cd82c657a8ec272014364d94c9b4b2f4dee9387e4d158264f09b34ab146d2e722ff4c96e499f5e198e50e2bf6efe7e4257935dfad3e3f3f276f56ff8afa7df26ece8dfb709c7c249fc957f29d0c143d192a8b64c4abe3bdc7b4fbac8dc9c264b2df93713231de9269324be6c63159d8c76469c6a99a2aa9919aa995daa9e3dfa76eeaa5bef1603a2cbfe1b2f45910cb54b769601cd3308dd2384dd294cbc2d76dfa7cc4180aaff6932c96b0fe3453466e6b97cc8e9d344f8bb4343fd22a4c98f75a5afdfe8687f4621becee75daa46ddaa5d7d451f4a04b6fa996ea91c9fd3f978549c3644957e93adda4dbf42eddb15fedd3837d4c8fe9c9d8a7f7e943fa18fae953642b7a344c9fd373fa92bed2c8902c2ca7db4681719fbea5efe947fa997ef5feb197a56f7f9f5bfd2acb8f91e17a78607dbb5412ff2139a7dfce9069eb673ae86da5f7c54ee5fa696f8f553a4ac7e9249da6b3a4b50b65c3f42c5177fe23ef31361a7d0edad724d379ba4897999a29c63163f971b4efb3e3ccecb3e2649559999d39ea57ea0475e6665ee66781e9fa81a3a06ab0eb675096e1c5599845599c25ce23b3172e8b6af5b9d52fb2889a9add3f99d14efd4a064ccf952c553eb2cc74cc2fe61b077dcecbf477613d982316e37efaeb2ccf8aaccc2a61e7e45b98b34db24b56678d5dc763f53b6bb32ebb662c62f343d6df6ff6c2fd66de9c652c99661ce3a74ccf56d93adb306bd3b36d76e74efa5999c53363a603cf76bfcd8445369691edb23d93e5901db313d31d85db7491ddff268bf28b2ca67a973d3032b24743c99eb82ccc37f67d642ebcc4661146f69c9db397ec357bcbde852c1855577d4bdaec23fb8c9e93419a655fd97736c8d8e866a36cec8eb24936355da7cc66d9bcf7ebacbf17d93257734509552b377233b7723b77d8377d3d6dc29edad74398b7cedddccbfdec900779a828ff4496be024a7dabf8bd36f63edacc23c330ee982cbd97efed70c024619219f7799c27fe364ff32c3c30597eac4172bf95e779919779a556f925aff3266f8d63dee5d75eb7dc613f1ef9cdfdeeb3e25cb316f153aee7ab7cad9eed32dfe4dbfcced67396c1b09879c8729a4bafd9feb7719f29f93e3fe4c73cc88e4c9b1392c52afe812cbd0f559209d332db2ed5263f1926f32baed05ca6678eed5877ecbfbce6f7fe5dfe104cf347a3fd690d92d97afe943f671725cecff94bfe9abfe5ef7dd4937ff49909af719cddaf6cca73628dcd8871fe997fe5dff9404d9cc833f3613ecac7f1579ff1997dbc4c51b4cfee30c9a7f92cc9988e1d59a699f47e377c0bdffe200bb75792259fab7b854d65ea77be302c63cfd2fb1dd5bc481673943bf9b2500b8545f5b3e8814547b6dcabc0575793b1fa919f0ba33059b7d9ac557d2cbfe8f312ebaeb7e4c2e96b1785cb62ad53e1157e111461112923d52ee22229d22233f67d5ec365611ac6aecdd98cb92f8aa22caa3c2459faf6b398f5f597f9e5375958c6b34f6fcc62be8b0b7be4ce74a97227646177ae8ba6688b2e288a6b714bf25f7684303d53fc645268855eac8ab5710835e7b597a5d8b06cabaf6a7ef4d5be60cd243916dbe2aed815fbe2a0d8c5317b284ec57df1503c16cc3efa1a279764614e0b268f7128cec54bf15abcfd248b1aaa7f57164fcab22bde59fe742a3ed894b5efa33c5420875c9645f1597c15dfc5a01806398ba2c90bffd8555114a3625c4c8a692f4931ebd72c989ea8c5bc8f467b5b6677e03163b12cd5ecbb544287c540d7d250c2d22cadd22e9dd2354ebc22c2ae36c7f6a1f498cdc6a55f06e1ae64290dd731f7efc822d654c40cf3adb665c472b053191b2ecbef852cfb5e16f3cb3a9749999659996749745f163f564a7824669465599597b22e9b5e92b2cd34661b565f3b6371dc985bb4e10ffaaca7ecca6b79b3be4acd0a4a9d8d67c4a45995eb72536e992cbabdeda326368e5bebbecf64cabb7257ee7b591425cd7a6d28b552fb45961fd13ef773ea8dcd103b75c56439183e1bebc81c5b7d3d2cb0674e63cfcb63792aefcb87f2b17c6271ce86e527a398c594ca9d5d97cfe5b97c295fcbb7f29d79d12eef32adafee9bb3bebec13f337b5f7eb079bc2c3fcbaff2bb1c985d392c47e5b89c94d3c42d67e5bc5c944be3c45c7d156a7c4c0f665f1939564a655466d06746a7e0d4ef2ab2aadf62fedefb3059d8b7663f36c8d834bbaa2c26cbbd19b2deec97483a264b6b06c6a1b22bc79bc5e3a00996e5c4dc562e538ba86236cfa29545e5574115329fca66bb3ea736471513d73a313946fd9a4515dbdb2aa9d22aabf2aaa84a2bacaaea52d55553b5556745c1b1ba062b362e5ba7a355b57ebda3aff254b74aabf42467b21c83a36ad9f51f641151a5cf6571d488e9e246bd315559556b264bc4662c268b193269f64c96a37bf65a6fae2e2387e9eb5bb5a9b6d55db5abf6cab53a54c7ea54f575e17be6c717d681c5d5233e26a3fe2ebd3d570f4c96c7eaa97af646d5b97ab1aaead5dc556fd57bf5517d565ff128afabef5e966ac07ac2e5f5cf678bddb11a56a36a9ce4ce23c6c5339adf627e4bca6270efba60d1ee539ac5a36a524db98e912c51af654c965335f33a8f656bca3c34ccae9a87af9eaac6ac3f17d5f2a26637f7f5a25cb81fb615f38349d17f26b406c3ee7570377d7e75312fd6c5be38e1cbc5bd78179f8d897f092e6134b8449798c9d2b91fccbadefb159cde673059946a7449823e47f6d9c7fea32ca859283c96225912f549bdbfa4ec9e593fc6fdfa9c6df523d4af3d18a774e75d2fb9925e8ad0c8eefbbcfd525eaacbe5525f9a4b6b9c2edde56a6fcdd1e5165f98bd93244764f10773e445d68e5da55df4cbeab2b6c2cbe6b2bddc5d7655a7b697fde57039ba2fbd2c173633b1d8cde27fd5d684fde2fef27079e4b2a0adfd5add3f95256071f24d29c2faf27479eeb585d61bfb95a07ecd81e9d8a377f35545b3df7975c88ca6feec72bebc5c5ecdc4383afae58daf136d8235f75dbd7e8db92c7c3d96f5f196c5dd5333bebc5f3e2e9f97afcb777cbcf06a13d388e16578195dc66c869ddb6c66cd466c967db5ee7adbbf4c2ed3cb8ccba2f0bcc2fe5d16392f4096545373b5cdcf97f9657159f6eb90bdcdb2d8b85fd50accc08d8c83a7298f8a1fb4c620fca8d55a49b6b5519bc98ac9f9565bb56def1cc38bfaf99ecd8d336ef74cc7b8341e9b3146e6dcdef82cdeac9ddaadbddaaf83484b46e9ad0eeba88eeb84e5ca9fcce3796c6e9db008f4c9dd32590e755a67756e325990875bfd0aeaeff9cbcfb2287eaa2b6e5dd4a5f25557c68149c0bc0fb3dfa8978569716cc69eee2b6aa9cc422bfc8caa9a4590ec7f0d6b5beb7eb84347cdaf2c63af9cd73063f67faa22f6ebdeaff7d27875c746f9cbfc626d5cd6d7fa566bb55eafea35d36ca77c8af27a536fcdd8b9b23cdceb6318d6239bdec2eabb7a57efcb3d932515759e3fe695d8112074cc55efd44370523ae5b13e184cb3597e7f6fdbbc12cfda581f599b4ff57dfde0b6a1556d13b77eac9fea67e3549feb17a65b8bfab59f159cd728b02d1691ceeb37bfb1b7fe376fd994b220ca89acbdfb5abfd71ff56738a8bfeaef7a500fcba01e992ed3c27db17077aec3f29881cb324b63578feb493de5b2507ef20f7264f6a797a59ffb13f6ff0d9bfda7f5ac9ed70b9657b2fc8bc52e5b7b592f9d779bcdc98dda288de13f5a35f3ca1f8dd958c64363db47f6d9374e3f438693be6ed3fbb2c665ff34a2d0def09a9af1cb1ae0d074eb5be3357e1334a1f3d4444ddc244dcafae291e54977eeaec9ac2dfb158b429bbc299ab2a9b8bdd09ca8f42b763fcb42732397c5e4b364aa8cd2cc99c77a7369eaa6316377c3eefb7039352d0b8359d6e186c6aee99a6b738badd0b48a466b74fbc18c9b557aecc7c57c6fd64cdfc76c2c3efa5cbdd9345bebdcdcb9dbbe8283d53fac9c9b5ebfb3a4d935fbe6604d9a63736aee9b0726c363f3d43c3799bbeb6be64c2fe3e6dcbc34afcd9b948559c51f65a1d95ecaa2f1959bb5faa138cd7bf3c1a22ac7ff609e89d973bfa6686f9b4fe3e0dbcd57f31dbae167ad3483669828d60b7bde283359ae356bc66c961b46611f41369366dacc9ab971b296eeb6e1e3815566167d9b9ed3354b63efad5bb5555aa3355bcbe8ebd581396efb15c45d9f2b87ba71689dd66dbdd6ef63181e7719aadfaf09ff365752a5cfa4bdc2fdfa937a8bc76de03dc65d1b1afd4afdb658703fbbed6dba8d8c531bb7499b865ef5de666d9e9fdaa22ddbcad8370fed85595585fce4beaddba66ddbaebd5e5876dfded8bcf3ddd70ee4eabfefed5aaddf1de36baddeaeda755bb35f6dda6df0dede056f5ec89eb7734a63d7eedb437b6c4f52163f38fd41161bd97abff39945bc2c951e313ddbe5b9a2b7f7ed43fbc8b4f7686ffa9d05b5d53ef55adf326fdf9edb97f6d518861f4e5c44ed5bb269df59ccb3cf3b7bc9645ef5f949fbd17eb65fed773b6887eda865b3068b697aed123b19f67e906bf6b69db0acf8d44edb593b6751cb397875ed76d12e3bb59fdbeace38754a67746667c571922779af472c8e39fe4116e75759d84c99a94967770e93e6dab99d67192cd770d89cb063be56ef7c7b5b9f7d3753baa00bbba8da767197746997b1b0b8e8ca7e6dc8db75157bfea5abbbc6df756dd775d7eed6699ddeadfaac8e723b5ec95b326b687b8fe2fb4e65dce75db7ee36eeaedb76776c02d875fbe6397aef0eddb13b75f7dd43f7f8ab2cbfc563b40fdae2fbb87b59fabdb76ef7d43de7cfddb97be95e6bc738b9ae7de8ff1a4166c38eb3eddeba77964f9cba8feeb3fbeabe9d85fad80dba6137eac6d19d195b0b33f6b56ed24dbb5937ef16ddf2aa5e95ab71358d9dfbca7763f9bd1ce6d00ffa99fd6ad97bc7bada4cbe73b7bb322bb18ee1cadd5d5deffdea3109dfaffe35b886d7280fa302b66ffe1d1d13eb0b72bf196a7fdcef5de36b52b2d65d53ebe19ab119ef6c9dddcf7eb5f79ab3ff5a5ccb6bc5e29897ebe55a5bfeb5b9b6d7ee7acd27d7db55bb321d5533b30bdf8da69c5c57d7f57573dde6937efe655aa8f4750ce623a2be06c6f7638dd87c74ecfd38d515ade7de5aaa8171bcde5d77d7bdda3847b5edab2c5993353c07367f9c07f8afd7f89ca7ebe17a8cd953afa7eb3d3dddbf998b6641d1eef5e1fa787dba3e5fcfd797eb6bad3069deaeefd78febe7f5ebfa5d75d74139bc0eafa3eb987d26d7e975769d7b6bd60b8bcccccceb92dba2f5f327f2dd7d73c7fc1c27ebcc52c3a79b7263f955348c4c36f3b9aa6dbf33591cbebef31764b99937eb66df1cd6379ecb66877edf8bad140b2fb9b139d0b8f7b51b0b346f8152ddc25b748bd5db2db9a5b7ec96df8a68d025e15755df4a7377ab6e97f0e3c626c65b5bac6e9db1ef772df0fd16d6af1f5eafb0d86cc4246aee7236b3dcaeb7db4d4bc6d133cb2d44fefb87ddf3ffb52ce6e34dbfad6eeb86c5860d1b0d663515f3f8ecff6d8fc5eecc9fe593dbe6b6bdddd5a5fa62d7cae2b65386b7fdeda0d4ea58dd869f55773bde4eb7fbcbddede1f6787bba3ddfce51623f180fb71733643e7af24759983454afa4fbbfdede54f7f67efb48068a226ac97f7d7d3f2a6e9fb7afdbf76dc02b565f2cb35c58776c86d89a73162f6d6e43e3741bddc6b7c96d9abab759eadce6f1241ef77bf56f8bc80a5fa2eab6d4d4a8d394a85202f5ac199aa9599aadb1b16e5acdedade4e78fbbef3396c82759cc58f3345f0bb4508bf242d1d20ce3f287d3597fc25e1eb5584bb454cbfad981dd7b617e7a119385f624cdedad96f733a75668a5566917ad564325615ed0b65fe289b25322add15aadd3aedacdf84c1dd573979aa6e9da4a5b6b1b7ba16da99af0ebc8b03f2a8bb1ad7667dada9db653bba0b9bddbef2c7f37642dcfa1f8f22fc8926a7beda01db59376af3db008efce9cfa1f2c3bda71eb6451633568f92e43ed517bd29eb5b3f6a2bd46b935d2de8c85f61e4fb40f36269f2c216e94246ccb2767e999da97f6ad0d3436a6edeeefd98bf5dcee2c35f2b59136d6260a8bd955d72eed525db37111f562ef2fcbf2a84db59936d716da52578d7da8318f79673d9993b86e6fecb363518056b6bac26c79a71bbad92a9dab5bc64db77527327457c97596ee844e7fe622ce597e32d4033dd4233dd6133dedc7e0d74f98f5b2447e2f95bbd7333dcfebb2d20bf6fbfe0c84266b797c86ff2b3a16157aa957fa45aff5466ff5aedf11c3f2de39af8f322fa45ffb798faffbfaa6ebbe66817ed3355dd757fa5adfe85bfdcef850bff59dbe77c6d5413fe847fda4dfeb0ffaa3fe14bd07aece722db28dde4ef86e0bf3e78fe9e8e764adbfe8af4aa36ead86cdca34abf4f6eff075c43fbd8724c9f537fdbdb8ea1ffaa7fea57febcc07588affed6ed3ca56a3f7beea637afd3a561f4733895c33d687fa888dd0589fe8537da6cff585be5ca92b6565accc95e5eddd3c7ded778d38d5ca5e39b6e1eec90f0b0ff68b2cae7170dc95bbf2567e3c535f56415f310a4e2cdeea57df6a5a7bfb73b2048fab701505b355bc4a56e92a5be5ed78555807166b6efa5ccb3afe248bc9b28265dee5ceed8565b4b755b9aa5697555dcd568d3e5ab5b1c7f7c23129dcddaaeb76abab395e752c5bbbe3f66e626ef955166f7533e3b261f9d270a5b1f178e335567efeafaf2afd9571311f57fa6ab55a6bb362b8daacb6abbbcbc76ad75767d2a05f79b0b67d0ecf64796372ec983c0adfc570cff7819ef85efea3d8cf6bdcbbdf76e87ff8cd6abf3aac8ead1d7cb84edffa7e9e679aa6b63b6627bfcae2af4eab7b9643ad570fcdfbea919fce727f3a052c4f69fca971795a3dafceab176db67ad5ebd5dbea7df5b1fa8cbff26ef595f615a31fbbddf98749f7c177bc0f9d57f6795b7daf06d17e35147b2cfbbdbccd9339ee7739b58bd5a8d72e173b9358e3acdf65b1ceab717d67ec5693d574355bcd51c3b7708ec1fdf3314c92af16abe55a5d2b6b439badcdb5b5b6d7ceda5d7bc69e45cffb1f7bdefb489eaffb32097a7b62b3105fc7e3fba9f9beea7e36627e6318266b7f1dacc3c0091cbecb91452c6431bd17f85d967e7473dbd8d7efeb681dab77e20c2d9745f9b16be9cff8b1f03198af933c5d5bc1789daeb375be2ed6e5ba5a5fd6b5b5b437741601fbf7fbd5b30fbe57a25f6bb15a16fc34ceba757416dfb3e83e9ce9d77ecd807df6ebceefd6cc62bc50c8d2eeb411f366bfd90bd7d26374b7beadb53573e4b2fee5fed5793f628aba5eaf37ebedfa6ebd5befd787f5717d5adfaf1fd68feba790c5fdd69eef5ac1b8b04fbf9ef76a7e704b3e584bbedb9f5950bffba8f7e2eb7e97fcb1df83b63eaf5f02d736cc28effa73246c8e1feb193f73d2e7373edfafe4b23c69bb7e5dbf35cafa7dfdc1e617c8f2f7f78ffdf38ff3283f69566595d196e7f5e7fa6bfdbd1eac87eb11d335bea38c568b980e4db0afbf8fa6c6acc7cffc04c6b2dfadd7cbe90f7a7bea77569a43967505d5e0a69a713e6171d79d36d1f3f5b8f776eb49bfa3b61f93cb389f38de7aba9eade7eabdd8d32b674be7afc8f2d3d9621ecf798f6a11dcaf179774bdcc5f36ea46d9181bb37faead164ebf368979c230a77db5439cb4602336661ab91436d3dc39174ba1fd0a2caa7f6511e4ae0f0b36569fdfacc6cce59f8ce3c6c9271b77e36dfc4d607da94f56f35b9bfed2b8fc7eb6381a2a9ee2da55972acd26dc449b78936cd24db6c9f9aa0bcb6eac27ffdbf68bbc782effdf76ae6549552488eee733a6f615fdba7dbb6356a899203e5a6db51f3b4444f0c14b1489987f9faa8202a4bd37b457331113b9d010943a661645669d93b6d9e37b5a6207f5ce54d90a7b630ee6244ed8f3c2d4532060d9afca32ad349d280e4d481246103617866ae8b10a11c3b2b36c86248e1fe983506f36cb7bd7f59cde1344592e9dd23decc91c0e90c0115250a0014d680104cf80a691efb672cf7c667bc1191af13a6a6c8d2ed758790ea8a041fba8a546ca6681e23a2c67047dffd9b4a1130fb9e20cbad0833e2ce34747a706bc2c0e85fef98baee722bfd4f4404187dc51957668dcd0c2d0b660004318c12b8c61025378f3347fb13bb0acbe5df0f8ab3a31cdd0e01d3ee0136ee036e9c2ddb1ed7437f7e95459c13d7169c0bcfd003fe0117eb2bb700a4ff08c94def1b9eef5e9337dca1557dfc052a8ea8aefae6ed98c216b9d45ef4ffa485524aebeeaa181333471eeaa5edbb7f71bff47100423b4421517519a70a1686ff7106f632dbe471b97ebe0a027b3a4874ec8a276354cdffc603e255ca59dee228325a4b8c2354b719e8d29bbca113774bcb961e319c8f15c1f6327bd3884873ca043ee1bdcda7dce35430f7d0c30740718e10e636fed2f7ddd7f0cc2861b3aa1161991827b3cecfa8d66ec6112bce2115354f693204dfadb96d559cd6ccab25f967cd21655d61b3627a2d61336b0892d72a03dc20e53978ef868d8fa229f5faee75a7fe935c07eb745b764495b08ec7d0311d5f514356ca3bffd70224ff774bfb3f1822818bb5ad8461d3bd8c5de6e837df6fe0507fb088787258ef015c7d68bd0fa1a7cc79ef3f0a8623d21573237714a0f6bb636061dba66de58d0211dac1b76bfe293ef6039b59ad281736c393795d713791dceebf80ee712f96e3009ddd07544a5d179e13613e6e4967d435ca3ec245389a0cad56bfd58aad7bf7aee9fc122ff178e852391e3f3ba9c7d9399eff23a234758aeb7d96b869def6fe7fb0f468e60216ac18678a2378b9890bd31a42ee18c42f1d27b720dcf09969c1fb0909d7904e76ec356026184f0baafc89d66956e3da5fecbf6f6f369d67545d6b5c5d924df135a7ec542cb5e26e49a7cbfc201afa191da8093df3604f79408ae9ab0ad576031ca9ca3caca1635c83935653d22cfb448ce3bcf6adc752c32e62a9eb9443352aa19aaaae7e288acea1ab4729f2cb50e052bf5d4871cf952b02732ae47d9db635ea9689b453c57bc2062244752ad5f5e84c592fcc3e1ee4c949995795bc152fdbea830d827ffc84c20e9088f91d2fb395e4b665b520152c3422492ebf27dce3a1163b10a2cc60916c11710bad85b6ed69a7320cdc09db863ceee0a1533e20c1ccef6c814cd995eb334f9fc9ecf4b7ebda988b5c23b67b1108e04dff03d63da7fc32f8b9a5f4caeec2fc7c9c7e6f5bc5e154b795ce2e596e3679fca7dd222b624e3bc58134fe3a1e0bbcd199677fcb81c4b3d6a7ea7d6aeb0fb7e71ceb9a3f5738b7cbeda2ba7de3ba79caf57e52fff15fb1fcbbfd3fefcfbaf3ffe0193cc32fd</data>
+ </image>
+</images>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewallsystemsettingslinux.ui b/kmyfirewall/kmfwidgets/kmyfirewallsystemsettingslinux.ui
new file mode 100644
index 0000000..4c45d9a
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewallsystemsettingslinux.ui
@@ -0,0 +1,202 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallSystemSettingsLinux</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallSystemSettingsLinux</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>560</width>
+ <height>262</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>KMyFirewallSystemSettingsLinux</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="KComboBox" row="1" column="0" rowspan="1" colspan="2">
+ <item>
+ <property name="text">
+ <string>LSB Distribution</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Gentoo</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Slackware</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_cob_distribution</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>As Gentoo and Slackware are using non-standard SysV init system it is required to select your distibution in order to make the firewall install properly into your boot setup.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Path to the defaul &lt;b&gt; runlevel&lt;/b&gt; directoy:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>m_lab_init_path</cstring>
+ </property>
+ <property name="text">
+ <string>Path to the &lt;b&gt;init&lt;/b&gt; directory:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>l_path_ipt_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Path to the &lt;b&gt;modprobe&lt;/b&gt; program:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>l_path_ipt_2_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Path to the &lt;b&gt;iptables&lt;/b&gt; binary:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="3" column="1">
+ <property name="name">
+ <cstring>m_url_mod_path</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="2" column="1">
+ <property name="name">
+ <cstring>m_url_ipt_path</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="4" column="1">
+ <property name="name">
+ <cstring>m_url_init_path</cstring>
+ </property>
+ <property name="mode">
+ <number>25</number>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="5" column="1">
+ <property name="name">
+ <cstring>m_url_runlevel_path</cstring>
+ </property>
+ </widget>
+ <spacer row="6" column="0">
+ <property name="name">
+ <cstring>spacer16</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>51</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="6" column="1">
+ <property name="name">
+ <cstring>spacer17</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>41</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewalltemplatechooser.ui b/kmyfirewall/kmfwidgets/kmyfirewalltemplatechooser.ui
new file mode 100644
index 0000000..778a705
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewalltemplatechooser.ui
@@ -0,0 +1,474 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallTemplateChooser</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KMyFirewallTemplateChooser</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>580</width>
+ <height>401</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>580</width>
+ <height>400</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>500</width>
+ <height>600</height>
+ </size>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="caption">
+ <string>Select a Ruleset Template</string>
+ </property>
+ <property name="icon">
+ <pixmap>image0</pixmap>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QFrame" row="0" column="0">
+ <property name="name">
+ <cstring>frame5</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <string>F1</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_accept</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Load Template</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_cancel</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;h3&gt;Description:&lt;/h3&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>lbl_description</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Template docu</string>
+ </property>
+ <property name="textFormat">
+ <enum>AutoText</enum>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ <property name="indent">
+ <number>1</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image1</pixmap>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>&lt;h3&gt;Template Chooser&lt;/h3&gt;
+&lt;p&gt;Select a ruleset template you like to use as the starting point for your firewall setup.&lt;/p&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_close</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>x</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout14</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;h3&gt;Available&amp;nbsp;Templates&lt;/h3&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QListBox">
+ <property name="name">
+ <cstring>lb_templates</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>2</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>204</red>
+ <green>0</green>
+ <blue>49</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<images>
+ <image name="image0">
+ <data format="PNG" length="685">89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff610000027449444154388d6d93bf4b5b5114c73fef47f2a2491c02050d0551323445ec5014151497d2c176f0f7e41fd0a1438538bb75b385824eede4a654688b8a8b62a0b4521d148594686930d568f0477c7d2f2fcdbbb7439e62ad072e9c7beef77c0fe77bee51b8c504c40ea1cb80a8099603db0256ef817d13ab5cbf5cf8fd71b7b7f795d6d6f628108fab6a2482741c9cfd7dce37368ef717175fe6b6b6de3c85f27f045978ec1f1b9bad191808a9800a28aa8a140209b8807372c2b7d1d14fdb3b3b83cfa18887a300f11ccceacdcda17226839bc92032190887110707b85e0cd3241a8b3d09c3e465610d6004a64db8af99269aeb22b359945008bdbd1d717646697d1d676f0f3b9de664610169590fa2b0f2197e6a0262dfe115a088dd5d443a8d383cc4e8e8c0dfda8a1a8950cee7399d9ae26c799962a18004c584aa2578af66a1cbf15a118093cba1363541305811291ca6babf1f6118b8c522977dd74027e0532d88ea97627824d53d3d0407072b01d745f1f9a84f26919eea1ae0875ac0a72a60f9019ff750ddd242cdf0f0d568f3e3e3159e7c1ecdc3f92b056d40d155d8aef2923540334d144da3984c224e4fb16666b8686c24383444b8b5156b6d0d1db0210508bd08ab061c1b704701820d0d0014120910022595c29a9c243c3282717e0e547ed126cc032500bec08b5f208f40e60301595a5a92662221f3208f41dad3d3d29e9890471ee603641ba0feaacf39d0bfc2c70b90bf415a9a269dee6e6981b40c43da7575151fe426147ba10fd0ff598ad71098877747e0ba20c5b5e3822c815c866c5f25d9b8759900c6a0eb213cbb0b9d5550fb07ec1ca456607e0edefe802cb72dd30d53bc89f93c5f7882956f02ff02854c0fcf287a72340000000049454e44ae426082</data>
+ </image>
+ <image name="image1">
+ <data format="XPM.GZ" length="20489">789cb5db5753643bb627f0f7fe1415adb78e09ddf4266ecc0390786f920426e641de6c208134904ccc77bf4aadff1670ea949be91b44f539bfd24eada59df29cfe8f7f7dbb393bfef6affff8c76c2ee6417d535ebc7cfb975e3c3cacfed7fffe9fffe71fffec36bef5dbdf068df6b7d63fffc73ffec9f437f58d29d968b4ecda5cd66e37b25571736d7d0637f1bca88de797c5f979df805b64fe08b7db14ff3d5b95f8ac36d5773e2fa6cf1bb88e372aa6f26931d5af60c4671bc5b93c6818f9f0d7e2f6da6a0177c866bfb8b3b698c15db279807b644ef5ebf23e8f8ae9fd9cc1688faa8aa93d9d62ca6f0c237f7e589cf3e316467be47d31950718ed91c3626acf098cf60853dccdf93dc2681f9b16e772760af7c9dc15f7b23d3cc0f347c5b93ccee121d94f8afb397efd3e05395e649b3a7fd581917f382bcef1fc068cfced4b712e8f23b8ce7f519cf311cf30f215f362caaf0d235f715c3cc8f5d51664656049162fc5c3fc7c5d9f82af8a45f616acc946c3a62df3f7db806d5be5e7a97f9a6683cac339dc6ceb6c1abfb66e8f3d87d11edb2fcef9fa4718edf1bde29cafba87d11e2be0ba3d4fc5397fb905a33d6a599cf3e5d730dac7bb30dac7e87ddad4be6c7d5a9cdba711af6eaf7a28366b3b07b7da793e0ab7709bcafd41712e67b9be343c11cf3c16e7fa7984eb78d3e25c9f3d825b54ceee8a7379181753bc4d18f9a8589ccbfd4bed4e9e4fe20ceee0f3abda546e167097ac5ac579fe317b708f2c1f8a69fedc85fb28af8a73b9bf84079d3cdf04fa7cb3cecf5dc3c8c7eec1881f0c8c78761346fdecac98e6b70318f1eca098e6877778d8a1f9a08205958b5e712ed7135892c551711effecb898c6ff06aca83cd6edd39d3c3e0ce5d7aaf3f1a730e2b12e8c786aaf38d767cf60d4afdbc5393e3b29cef1e40046fc70011be4b3846d278f47795e9cc71f6b905b0d94378ba9bc0737c9feae388f4f5b97b7c9f1ae98e6a37bb8439fe76fd9edbabd6e00237f358791afa0f7d52ef93cc2c84768b845f1c541718eefebf23a9f0aee20dfdbe25cee3e4cf3e50bdca572cd8af3f8e4c8b7d5238756711e8ff101ee9315b5a793eaa7f9a80da33ecd8b697eeac1a8dff0e25cae4770bf4bfb8f5631ede76a0fa8dcf3e25c5e4de1219533599ccbe356711e8faafebc20fbd7e23c1e75fd79496687c5b45fda861595c71bd874f37830545fb7ce57d5aee35d17e7cfbb3718f1ec1446fdeaa898e6875d5893c5a298f607e7c5d43f8730f2f30eb6545ea1be76a39bc767407eed7697c60bf5ff5e2aa7f9c516d37ee9b2387f9e3fc34db2fe30adbf0f708bca952aa6f16e8a69fc1cc21dca47ade06e37f77fd328a6f1b209f7bbb9fffb263cec52ffccebbbeed7ed8b0bb843f1e466712eaf4630e205569ce3c506dcc3f35bc534bfc4e2fcbcadcbfb64658b69bc1ec103e43b85913f3f814597c6e304d63d1a0fd43f0775bed54e718e27228c78b1f680cc3ac5395edc8305593c15d3f8aeeb57143f1c17d378bb80919fbc2bcee5a2011bb299c2b647eb7120771abddcdf2bc4ef34c996c6ebb0ae8f6fc2863eafde608be7693d19a6fa68bcdfc3cd5eeedfb60bb7c8e6b098f6fbb5db647d524cfd7f02777bb49eddc13db2a1fe2e527c8ab701a3fed88651bfad8a69bc1c16e7fa22833b54eece8a73b9ebc05d948f8b29bf3a3ef25337c5b41f9e15e7feadcfe13e95876e31ad6f6ff080ac9ee0618fd6a70758f472ff7434bfcbfaf3cec2f8bc8cc5b4de1d15d37efa161e52b95d15d3783b8511cfef14d37ada2ba6f1577f5e52b9b92fa6f20fd3fab7092bb80f1b7a9e356bf7693f897cba0d329fc1fd3e9d57a9fdaaae8f3d17e7f1263ab021ab666daa8fd1fca252fd79bcd95db84916cd625a8fdee11659edc3ed3edd27bcc15dcacfd3f7adebcfdb05dcc2f317709b9e3773b843d63770b79ffb7f65e05e3ff7f7302aa6f1b40ff7c9f2111ed0f362bf98d6afba7cd8cffd336ec2a69fbfcf403675fba286bb549fd985fb64fd504cf14730e2991e3cecd3faf6564ce7c7152cc8f602966456d7affa347edac5747e7c8135954b7cbed7e8d37989c6a34df9507c034b3c7f066b6abfda84f13ef47571eeafb20f5bb23f29a6fe48eba74df1e9bcc98ae97eac0937c962036e91e3126e937df120f7df90fba369d4f1dd63318daf8362aabf4f4ef1f3f316cfa7f8f9796961d4cffac5b4bfecc0dd01f5ff5931edc7eacf0fc8a15f4cf3377dbe59c7735b30ea3747708feab737c5b4ffdb8707833c3edc0c1e9259ab38c70b6fb01850ffdc2aa6fb1c054b2af7cfb0a27275594ce7afba7e4d0ef47cabfebc9bc0f8bc7e2ca6fe760beb41eecf7e0b36e4f05a4ce79d53d892e35971eeef6a40eeb706f9fb1415dc1ed0fe4e1553ffc8f38b69d79fb786dc6f90e30bdc2457cfc534bf5fc22db27b8551bfeac19d01edc72ab83ba0fdcfacf690e6f72edca3cf1b06f7e9f9b85b9b9e8f437830ccfda3cae713d3a9f30b0a467c7f0323be3a867b549fba86513f3b28a6f9ff0e1e90d54131c567f090ec7ab0c0e71d2c87b47f52c534dfdfc26a48e7917dd890459edfd2745ad7bf010baa8f5fc0a84fd6e58a2c5ac574ffb9036bd41f6033a4fe7b0e5bb25816d378c0e7070db2cbfb51d3abebf3fbb0a1f248fdab979ea7fddc31dc24c70fd3fda2845b43eaffef709bac0fe0ee90e6fb0d7830ccdf7ff5569cbfffaafefc7098bf7f97f723a69feaa7f5e51046fd610fee517dfaa598faa785517f382ca6fe7a090fa95cbf17e7f26a031682e6bb3e2c05f5efaa98f6ffb7b022bb2b580bfa7d4080ada0fd7e5e3fcda0cec79fc382eab7c7c574de7f84115f0f8be97c72052b2a37cd622ae7c5345f0718f9552fb011b9bf8a296cc94e1553fe349f0c860d780937e14531ed874431cdeff47e87757bc4268c7c7dab98f2abcb91af1dc1c8b79ac1c8376c17d378a3fc8625df398c7cbd2dcef9a95bb82568ff3585db647b5b4ceb451fee50b9b929cee59af211f5f3fc14c6f3ec15ee0adadf0d8ae9bc710ef7a89cbfc37d2ad7c7c5b45e287820e83ccf6129e8fcdb82b5a0f1503f6f24ed5768be90757d6e050fc8c117d37af3040fa9dc1f15d3fa53c112f9bc16d37895c5b4bf31c5b41fba8235e5e7eaf8c8d7e962ea3f785e34c8eea998f63ff77053d2f8443ea225a97f507f50297fba4fd880919f6dc30a66c5395f7b02e3fdba266c910fca533e749fff04231f7603b7c87abf98faf75631eda7105fb491ff23dc9574de9ec33d72a4fd8faee3f94571aedf4f61d4cf6f60d46f4e8be9fefc1eee906d03467cf75c9cfbbb8f30f231153c90b97f9b2b5848ba9fde832539d0f3a6aecf31386df072b985fb541ec7c5b9dc3ec103b21f1553fc3b7848e566554ce3af5f4ce3b301d7f9d69692cef30e56e42ac25ae6f1c25e8a693ddb848dccfdafaadb6b25edc769fcdb3a9e7b81ebfa038cfa7ca798ce43a7b0413c574cf7016d18f1ec7e319dcfe87d59d920fb19dc54b4fe9cc32db218c35d45f763f9fbb48df479ba7ff3c5747f7e0be3f366564ce79b43b84de5eaaa98d6e329dca17871a798cef36318f9c8ed62ba5ffb28a7df670fe01e95c7d3623adfd4ede953b9bd2ca6fb8171318d970b7840e586f26bd6f1e3338cfa4313467d5114e7fa5c8407f4792f8ae9f7595bf050d1f9e9021664e98a693cd5e592cac5a098d6bf87623a6f5dc28a6caee134e5e5f879bf625bf5f3b6369e7777b0268bcb62eadf5318f5c983623a6f1d16d3ef9b56b0a572be5b4ceb137ddfa97791d9a0388f07e9e1265948b8450e1fa6f1f40e7714cdf71cee6adacfd1fb6dd7edad3e9cf3b36fb0a6f6854b18f9eb2eb9cecf2d61e4e72e8b69bdda2ea6f5fe0a46be4e14d3feb7fe7c9bec3d8cf6c84318ed916db8a7697f3a85fb9ac65b80879af667797db69d3a5eb881db547fb470972cce6a533cb60ff7c8fea998ce7b7db88f7c6a0f281f7b5d4cfbdb7b18f9994d58681a6f02969aee27eaf84ad37dde02d6e4f8061b7255d76f35edf7f27c68bb753e66ab98ce9b11463ee216463ee2159664bf574ce3fb045664dd84919f0b30f233dd62daaf9ec1c8d753ffeed5ed8def30ead3f47da66f43d3f866701316c5b43e6ec32db269c16d4dfbd583621a7f377087caf5aa98caebfabb9aeef3e6f040e7fe63683cf7ebcf8bad621abfb198fefb140ba33e7e06f750ee8b693dbc83fb643d83ebf80e1e92dd516d43ebe1232cc8ac2aa6fbed3a9e845bb031741ea3f96c90f2a5fdf7a498f6cf6f30f2611c467c3d80112f9cc088a71cac0cdd1fdec19a5c3dc0c847ee17d37a56d767c97e504cfd93d6bb816990ad869b86fadb4131ddcf1dc12d2a97d43f87291f9a5f3c5ce7a38b69fcbcc188afe8fb1dd6f1f56b31c547fd753e7a09b7281f5b3fdf26f3db625abfaee18ec9e3c12de02e3938b867687da3f7917a03e5eb4c31dd07ddc175fcf7625a4fc730f2619362babf3929a6fb140e233f1560e4a7ef8a69bc8e60e42b4f8ae97ef3b998c62783fbf8fc73319d1f87f0802c57c5f4f923784836efc5745e8cc5341eebfa053d1f9bc5b43ef760490ea7c5345e3bb0a2fae25331ed6fe9fdcad43efafdfd4531ed27028cf6987631e5bf01237f3e28a6f5761746befaa298dab7534ceb63fdbca472e68b69bccf6a5b5a2f8f61b4c7c9da541e57b0a6726d6a53b979818da5f3eba898cea70dd8d2f3f2a998ceb3b45ea56cc866bb98d6bb21dc247b7a7faa6eaf5fc168afbe82d11eb65d1bed71c5741e58c09a2cce61b447ee14d3797c025b2ab71fa6fd04e2d7ed51a3623a3fbcc0688f5e14d37d54fdf916da2f8ae9bcd02ba6fbe60edca672362ca6f344843b96e6c73a7e97ac03dcb3b4ded7f1fa96f6df37f0c0d2efef683f987a03e5e7e8fdeaba3d952ca6f68c61e46fb78b697e6fc2c8970f8b29df6b18f957aa987eff7303a33d6c594cf7dda730da2767c5741e0930da2b79319d278e61b45f8c8ae97c710f0ff17c9d5f3a10e7720fa70d7b2eefc28aacdf8a69fea1efd3d4efc71dc2687f98c3685f3828a6efeb18467bf5bc98da3b84ebf6edc1689ffe30cdcf1e46fbf46e31ddef3f14d37eac0f0b2a97cfc5b41ef862baffb88625958b4931bdaf3a7fbc2fd929a6ffdea02ed7f04e31cd7f0bd890e56e31cd0f63d8923dbd1f5bb72f7661b427f68a29ff00d7f94e60e4277660e4275831e577051b94f362baffd82ea67c7761e47b3effd50f675ca43f92b3f4ef8a6b2ed33fe5af3ff7f1f3db71520c6eb8e58e7b1e92fe28ca1fc4d1e94fe09157fc9e3ff0476ad1ba7dffce38b9ce297fe2cffc85cff89c2ff8f2cfdedc1fbcb757fec657fc9d6ff04dbec547e9e7dfde9efcfd3bbecd77f82edfe3fbfc801fe6361efd37c439e627fc949ff1737ec12ff9151fffb7bcb711bfe6137ec36ff91d6ff0266ff136effcbbe2acfb2f7e46bccb7bbccf077cc838634c30c98f99627afdee7efd3dfd2cce4794f4ef236698658e7916586415bb670fec914df992ad7bfcff479c4f6dc9ed614fec99bdb0199bb3055bf233f6caded88a8fd9fbeff4bb1fc5412ba63cb0f59f8df4b3c9b6d8886db31db69b62edb17d76c00ed9519a257ea377ff308e4a913abccd8e79c54e78979db23376ce2ed825bb62e314e99a4dd80dbb65774cd17b5bffef8f23fe7d9cfcb9a354778335598bb5598775598ff5d9800dd384bacb760513eb6b7625d261793d6629b73f6d0fc5e1c7698171c23327029f88282a71cf961427457a108f622a9ef8b578162fe9d91945fbb338e94789b95888a578156f6225dec586d8145b6224b6116747ec8a3db1cf7ae2401cf24b71248e7f1ce987df4f9ad1c449aae1549c897371212ec595188b6b31a128290e1737e256dc8986688a96688b8ee8aee7d7bfff8e7ed21ec65f454ff4c5400c53e763524899c6e8a28ec376a5927a7dd811413ae96590515669edd07f17e9877152af96f7f2413ecaa97c6273f92c5fe44cce3fa2ac5b24177c572ee5ab7c932bf92e37e4a6dc621b7f379e7ef2de14db90951cc96db9c3167297edd43de0538bf6e4be3c9087f2481ecb13792acfe479ea0f7fd3bfff1aa78cffbc4a8b9ebc9097f2eafb08681193637e27aee5b59ca4d6dec85b79271b6ce3f7de5b8ec2f27b6bca966ccb971fc6d9969d9cd624fd5b57f6d23beecb811c7e3f92be6f0fbdb5fcbf8b34296ca83431ff280e46ec36bead995aff4a4c29fd7dfffe1a278fcf119fa6b9248df1f5c1514c9553fec7513e5a96fe4c54482b544f4555fd2a0e0fea5e3dc82df5c85fd5543db17bf52c3bbf8e432d522ff240cdd45c2d300fb37acda538182f926da8a57a556f6aa5def9b1da509b6a4b8d04fbcd38db92ab6db5a376f9625d775a3158fd4d7c6e0f976aa1f6d4be785707ea30453952c7ea449dd633cd6f449aa83375ae2ed27e689abf0159ef5ceb381439cd345a5daa2b3556d76aa26ed4adba93cfbf1b258da70e1fa8866aaa966af376fa13d23c94dfdf477bd6bb24b5fe1d444ff5c5a36a8853355057a2f4a7dffad9512335e44dcd35d3eb5fbf467142adf81a874d99d44a6b6dd291c1a51fafc3cffaf4dff4baa58ebad2f7fa41b4f4a39eea273efe1c87e60031d7cffa45cff45c2ff452bfaa917efb83d6a43862a457fa9d09bd210ff4a6ded2a334878f3e7d3feb384b65f889ded63bcacb8eded57bb2f32751d63fe9935aefeb037da88f52bec7fa449faef7791fef4d9fadf768fa9c31c9d81c6fe18f62504fd0173af524792384bed2637dad27f2fe739cd49eb16ae91b7d2b17794ff3fff6b390337d27de7423f5f153dd6407ba95764ca32fe327e8b6eee8aeeefdc977ffddcf8ede4d33629a59f5fa371043b9c98f3f7f3f69fc4e0d374c378df8759cf48db3cf6beb77a579bee3b7461a6534b5a7de79a9b631e948eb8cff8d3813138cff793f9113134d65ee559a97739cd4d3f8ab79308f666a9ef432eda07f1585f1a1be33cf6997f593b94f30f3626666ce566c23c71989b95998a579356f6665de7f3d6fa6d66c984db36546695ffa93776bb6cd8ed9357b7c9cef5df6cd8139947d73648ef9ae1afdbab749654ef4a6393567f2fac7ef58f0d49e7373b1deede7fb85e7b43dba3457666caea5947bbf6ccdb63c361373636ed9c8fc6c75dae1037397be9f074eff3fbeb66998a66999b6e9881b36ff751c3d375db1343dd3370333fc515f9013cb2dd3f7a9bf4df37de2fa3f445156a77edff99d119a7aed8d6ce7fb266b9d18fee8cdc967eb6db0319d6ca95f5fdbcadefff40dfce5bdeb857db08f762a3af6c93effe00d8cd7ad56693eb02f14272d02333b376d39f959dde9edd4e37287cde4a95dc8a65d9a27fb9ac63e4f7fb7f8ee13c2be49abdb6a41f3013376652a7df1d7f6a49d5287cdf3c8e6eb712968a7301613fb9eb6d51b76d36ed9515a71b90936ed0dfef2cee7768739bb6bf7e43da7ff3f46144dbbafaffe326e76f45c3ef161da03a62872a15f538bf7d6ed4ab51ed843fd6c8fe4a63dd633f322f7451a4bfaebb733e777f6c49eda337b4ee35456f6c25eda2fbbdb54dbd08eb54e278219db497bda37e9ec35f3eb9e6227e2d2deb01eef8a277b6befd21679661bba699b1f35ac67d1f5bdbcedac6f9be97ed50ef4b51dcaf197383b72e1b84b47392765c74ea477ca69edd35cbfeb8cb8725645e76474de05732e3778da87dbc9478f4863ecd98e5d7495bb770f664171dca39bcaf1e76f523c48e99e44cb3deb659a2f8fdc8b9bb9b939770b3e704bf7eadef8b1d9635b6ee5dedd86db745b72db8d3ef73cd971db6ec7edba3db7afe6887360ae85f8dc6a7728eef98ee989a93b72c72ab81377eacedcb9bb7097eeca8dddb5385153bee9266edf2ec522bd91d49e4f6f24bd1d397737eac56caa9ebb2dedb913a26e4fea0fd7e63dbd8dbebe778df51ca6ef5cd3b55cdb755cd7f55cdf0dd8299fa6f9aaed869ecb8a353cf322edc1265fe78634c3052fbdf2741f7ce6cd7a7f5bdedbb5362e78cb27dee947efc5d0071fed4a3ef8cadffb07d615cf2c9d3cd2c96de11fc59c9dfa8aeffba919a4efb1f3358eb8f14ffed92cf3bdf18b5df89936d4ffd36efcd4cffdc22ffdab6cfab7f55ed1af84f7efaac54ed319e2de6fac77b47947b1beed5bb20df3e837fd961fa559f8f8cbd858d8a6df4e637592e78347bf632abf8b5d0e97d77ecfefeba98afec01ffa2329fdb17df027fe348db8913f4b273df5716bb95e25c5093bb34b7fae57267c6d8f1af90bf6e02ff3f8d93287feca8f05da2367a6ab95bf566d3f716ffe465fea3beffdadbf4b27359c373e9dfcd2dff8865afaa66f8947fd7537b6e3dbbee3bb6c95df5b8f9ff8be1fe4bb8131dbf54356051e9878497daac57bec35a4a37b507c9e6644dce4d4e725ba150b3a18b6156c70e2cb1cb93e3f041f02bfceebdcdc3bf11ea218d53d5fb25085fbf0904ec2cf698bfd18a6e1293c871736fdbb5b5e55a5b3d26e98f9a7b423fb347789ed300f0badec34e47eb0bef708afe9bc7b5d9f34d3eeba1bdebc4efbfa0d75ef6ec32abc870dd635fbdfc749df8ed193b019b6acfe7a86d16fe6ddeef3953f55793ee0af76338cd848a027a43136d2b3b01d76f8f5fae64dccc3aed07aa2eef9f4e38631c7483b74b5602b330d7b61df6e7f99b9783850dbe1301cc92d5a7f98925be1382d7d279871c76c1e4ee5366f9ad49372dfb5e12cfddbf8d339162742791fce03f337f6810f3e8f52b19d06e79dde9467e142cc68fde18a4dddad9b844bf9c476f27a93e67eb115aed48579ac6f1d3eff4ea13edfca611887ebd41367fc36f5b44fad919d300969a7924ebacbf5e91bfbc471b80d77a1a1d7bb0a4ecf311f9a6e3fb4524f6870f3354ebe6f1cd917bbc94fcc6568a7d5837f99db76424731b90c5df9b01e0b258ee08bd00bfd300843ba2d48f3fa9e7291bbcd5457f8febe269d2ddaec2432731b4594eb35eae31c23277c68efa28a3adf941d7d3e6ff3b13e154fd1441b5df4f9dd31bd88412c63e4711da9de85af671bb5e05beed67763e5966614ef3fcdf469edd50b7ea6f7653f3eac6fb869c495fb8374d6b683d08d8f711a9fe433edf7e5517c8e2fcac659ee0f79ecf3699cb3b3b888cbf81adfe22af5e58f752b9d49988fef71236ec62dfe94665af5f9bc4df72d71a4db7e47bfc76d792267eb7387f17a1977e26edc0b63feba6e0b53e97d3d8655dcf733c6d3eea33e31a45532ed4f9af1201e9abedad7693609fa63b47dba0f49db16be708378148fede5faee30ed40983c8e27f1349ec573be254ee20577b272e37819afd279217c8c7e39497be1b6e9c6b1ea99c378bdde7b7cee375fef43d6bfad70437ded6d3ad5dda59d763a419aa1d471a21fe24dbc8d777c1e1bd2fac82a79fd69955ec8e7d814b7b1c55acada3dbc65f611e9e33e24bffb43b68a6dd7f0511e46193bb11b7b7a37ae623f0ee230bec4978a57ac12512857c9b49f9bd08f7cae543ca9741cc833d76647eb79e2eb38f8720e963c885e652a5b39b3a9576977dc3227954fb37d530cfcac0a55642f5595761c97d5bd78ac1ecc09fd48ad9c3df0be7a0ccf555acff36dfe9779f02f71c66c553d55cff1b27aa966d5bc5ac865b5ac5eab17bd91feee6dfdabdc6a55bd571bd5663593cbfa273d33b723fd2eda69ad69ac578fbfceb67fbd4f6447fed25f8bc3c06cacb6423a42565beb7f56a36a641ad5f6fa6ff2dfeeaccbcbcf68fda356d5aee8e61bdfefef61ffef7ffee3bf00ce86dc04</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>b_accept</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallTemplateChooser</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>b_cancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallTemplateChooser</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>b_close</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallTemplateChooser</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/kmfwidgets/kmyfirewalltransactionlog.ui b/kmyfirewall/kmfwidgets/kmyfirewalltransactionlog.ui
new file mode 100644
index 0000000..7f50160
--- /dev/null
+++ b/kmyfirewall/kmfwidgets/kmyfirewalltransactionlog.ui
@@ -0,0 +1,344 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KMyFirewallTransactionLog</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallTransactionLog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>520</width>
+ <height>467</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Transaction Log</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>tabWidget2</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Undo/Redo Stacks</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QSplitter" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>splitter4</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="opaqueResize">
+ <bool>false</bool>
+ </property>
+ <property name="childrenCollapsible">
+ <bool>false</bool>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbl_lvUndoTransactions</cstring>
+ </property>
+ <property name="text">
+ <string>Undo stack</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>ID</string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_lvUndoTransactions</cstring>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ <property name="shadeSortColumn">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbl_lvRedoTransactions</cstring>
+ </property>
+ <property name="text">
+ <string>Redo stack</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>ID</string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_lvRedoTransactions</cstring>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>m_cmd_clearStacks</cstring>
+ </property>
+ <property name="text">
+ <string>Clear stacks</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>225</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Application Log</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lbl__transactionLog</cstring>
+ </property>
+ <property name="text">
+ <string>Transaction Log</string>
+ </property>
+ </widget>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>m_txt_transactionLog</cstring>
+ </property>
+ <property name="textFormat">
+ <enum>LogText</enum>
+ </property>
+ <property name="undoRedoEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>m_cmd_clearLog</cstring>
+ </property>
+ <property name="text">
+ <string>Clear log</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>201</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Statistics</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QTextBrowser" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_txt_stats</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <family>Nimbus Mono L</family>
+ </font>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Object statistics:</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>m_cmd_update</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Update</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<includes>
+ <include location="local" impldecl="in implementation">kmyfirewalltransactionlog.ui.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/kmyfirewall.cpp b/kmyfirewall/kmyfirewall.cpp
new file mode 100644
index 0000000..3af7c7c
--- /dev/null
+++ b/kmyfirewall/kmyfirewall.cpp
@@ -0,0 +1,1113 @@
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************
+
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+
+*/
+#include "kmyfirewall.h"
+
+// QT includes
+#include <qmessagebox.h>
+#include <qtextstream.h>
+#include <qpixmap.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qwidgetstack.h>
+#include <qvaluelist.h>
+#include <qlayout.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kaction.h>
+#include <kaccel.h>
+#include <kstdaction.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <kmenubar.h>
+#include <kprocess.h>
+#include <kdebug.h>
+#include <dcopclient.h>
+#include <kstatusbar.h>
+#include <kpopupmenu.h>
+#include <kglobal.h>
+#include <kmessagebox.h>
+#include <kstdguiitem.h>
+#include <kcmdlineargs.h>
+#include <kio/netaccess.h>
+#include <kfileitem.h>
+#include <klibloader.h>
+#include <ktextedit.h>
+#include <kparts/partmanager.h>
+#include <kpushbutton.h>
+#include <kedittoolbar.h>
+
+// C includes
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+
+// project includes
+#include "kmfapp.h"
+#include "core/kmfconfig.h"
+#include "core/kmferror.h"
+#include "core/kmferrorhandler.h"
+#include "core/kmfdoc.h"
+#include "core/kmfnetwork.h"
+#include "core/kmftarget.h"
+#include "core/kmftargetconfig.h"
+#include "core/kmfiptdoc.h"
+#include "core/kmfgenericdoc.h"
+#include "core/kmfpluginfactory.h"
+#include "core/kmfappstate.h"
+#include "core/kmfprotocollibrary.h"
+#include "core/xmlnames.h"
+
+#include "kmfwidgets/kmfprocout.h"
+#include "kmfwidgets/kmfnewdocdlg.h"
+#include "kmfwidgets/kmfobjectinfo.h"
+#include "kmfwidgets/kmftemplatechooser.h"
+#include "kmfwidgets/kmfdocumentinfo.h"
+#include "kmfwidgets/kmfselectinterface.h"
+#include "kmfwidgets/kmfselectactivetarget.h"
+#include "kmfwidgets/kmftransactionlog.h"
+#include "kmfconfigdialog.h"
+namespace KMF {
+KMyFirewall::KMyFirewall( QWidget* parent, const char *name ) : KMFMainWindow( parent, name ) {
+// // kdWarning() << "MyFirewall Starting up..." << endl;
+ // Initialize the document
+ parseCommandLineArgs();
+
+ set_splash_status( i18n( "Load Protocol Definitions..." ) );
+ KMFProtocolLibrary::instance();
+
+ m_network = 0;
+ set_splash_status( i18n( "Initialise Document..." ) );
+ m_network = new KMFNetwork( 0, "KMFNetwork", this );
+
+ set_splash_status( i18n( "Initialise Undo/Redo engine..." ) );
+ KMFUndoEngine::instance()->setKMFInterface( this );
+ KMFTransactionLog::instance();
+
+/* childproc = new KProcess();
+
+ connect( childproc, SIGNAL( processExited( KProcess* ) ), this, SLOT( slotProcessExited( KProcess* ) ) ) ;
+
+ connect( childproc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), this, SLOT( slotReceivedOutput( KProcess*, char*, int ) ) );
+
+ connect( childproc, SIGNAL( receivedStderr( KProcess*, char*, int ) ), this, SLOT( slotReceivedError( KProcess*, char*, int ) ) );*/
+
+
+
+ //########################
+ set_splash_status( i18n( "Loading Plugins..." ) );
+ // Initialize the settings dialog
+ m_configDlg = new KMFConfigDialog( this, "config" );
+ m_configDlg->setNetwork( network() );
+ connect ( m_configDlg, SIGNAL( sigConfigChanged() ),
+ this, SLOT( slotConfigChanged() ) );
+
+ // Initialize error object
+ m_err = new KMFError();
+ m_err_handler = new KMFErrorHandler( "KMyFirewall" );
+
+
+
+ set_splash_status( i18n( "Init statusbar..." ) );
+ initStatusBar();
+ set_splash_status( i18n( "Init actions..." ) );
+ initActions();
+ set_splash_status( i18n( "Init GUI..." ) );
+ initView();
+ set_splash_status( i18n( "Read configuration..." ) );
+ if ( checkRoot() ) {
+ if ( ! KMFConfig::configurationConverted() ) {
+ closeSplash();
+ const QString & msg = i18n( "<qt><><h4>Compatibility Warning!</h4><p>"
+ "Since KMyFirewall 1.1.0 the configuration handling has changed to allow multi target rulesets. Because of this change all installation target dependent settings (paths, interfaces etc.) are stored within the ruleset document itself.</p>"
+ "<p>The file extention for the new configuration format is <b>*.kmfnet (KMyFirewall Network Configuration)</b>. To import your old configuration select <b>File -&gt; New -&gt; New Empty Configuration</b> and use the <b>File -&gt; Import... -&gt; Import Target Config</b> menu entry and select a <b>*.kmfrs (IPTables interface)</b> or <b>*.kmfgrs (Generic interface)</b> file. If you allready defined several targets (e.g. different firewalled computers) in your configuration the application will show you a dialog to select the target that should use the configuration.</p>"
+ "<p>All configuration setting you have allready made for your local computer using an older version of KMyFirewall will be imported and applied to the localhost target.</p>"
+ "</qt>" );
+ KMessageBox::information( this, msg, i18n( "Warning" ), "configuration_not_converted_to_1.1.0_warning" );
+
+ m_configDlg->convertConfig();
+ }
+
+
+ if ( KMFConfig::firstRun() ) {
+ closeSplash();
+ slotConfigureKMF();
+ slotFileNew();
+ } else {
+ set_splash_status( i18n( "Restoring session..." ) );
+ m_fileToOpen = KMFConfig::currentConfiguration();
+ slotRestoreSession();
+ }
+ setActiveWindow(); // Make sure this window gets keyboard focus
+ raise(); // Make sure the window is now on top of other windows
+ statusBar() ->changeItem( "Ready", 0 );
+ checkStatus();
+ } else {
+ close(); // User indicated an abort is needed, so close the main window
+ }
+
+ KMFAppState::setUpAndRunning( true );
+ slotConfigChanged();
+ KMFUndoEngine::instance()->clearStacks();
+ updateCaption();
+ statusBar() ->changeItem( "Ready", 0 );
+}
+
+KMyFirewall::~KMyFirewall() {}
+
+//############ Parse CommandLine #####################
+void KMyFirewall::parseCommandLineArgs() {
+ kdDebug() << "############ Parse CommandLine ###############" << endl;
+ KCmdLineArgs * args = KCmdLineArgs::parsedArgs();
+
+
+
+ QString curr = "";
+ kdDebug() << "Args count: " << args->count() << endl;
+ // kdDebug() << "Open File: " << args->arg( 0 ) << " passed from commandLine " << endl;
+ if ( args->count() == 1 ) {
+ curr = args->arg( 0 );
+ kdDebug() << "Open File: " << curr << " passed from commandLine " << endl;
+ KURL url( curr );
+ if ( prepareForFileOpen( url ) ) {
+ m_fileToOpen = curr;
+ } else {
+ closeSplash();
+ const QString & msg = i18n( "<qt><p>Open File %1 failed</p>"
+ "</qt>" ).arg( curr ) ;
+ KMessageBox::error( this, msg, i18n( "Error" ) );
+ // Show interface select if open file failed when requested
+ if ( KMFConfig::showSelInterface() ) {
+ closeSplash();
+ slotSelectInterface();
+ }
+ }
+ } else if ( args->isSet("i") ) {
+ QString interface = args->getOption("i");
+ kdDebug() << "Found interface option: " << interface << endl;
+ if ( interface == XML::IPTablesGUIInterface_Value ) {
+ KMFConfig::setUseGenericInterface( false );
+ KMFConfig::writeConfig();
+ kdDebug() << "Start using iptables interface" << endl;
+ } else if ( interface == XML::GenericGUIInterface_Value ) {
+ KMFConfig::setUseGenericInterface( true );
+ KMFConfig::writeConfig();
+ kdDebug() << "Start using generic interface" << endl;
+ } else {
+// kdWarning() << "Unrecognized argument: " << interface << " for option i" << endl;
+ }
+ } else if ( ! args->isSet("i") && KMFConfig::showSelInterface() ) {
+ closeSplash();
+ slotSelectInterface();
+ }
+ kdDebug() << "############ Parse CommandLine Finished ###############" << endl;
+}
+
+
+//############ Start Init Methods ####################
+void KMyFirewall::initView() {
+ kdDebug() << "KMyFirewall::initView()" << endl;
+ m_widgetStack = new QWidgetStack( this, "stack" );
+ setCentralWidget( m_widgetStack );
+ // Load the main editor widget
+ KParts::ReadWritePart* mainView = KMFPluginFactory::KMFMainView( this, m_err );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ kapp->quit();
+ }
+ if ( ! mainView ) {
+ KMessageBox::error( this, i18n( "KMFPluginFactory::KMFMainView( this, m_err ): returned a NULL pointer" ) );
+ kapp->quit();
+ }
+ m_editorWidget = mainView->widget();
+ m_widgetStack->addWidget( m_editorWidget );
+ m_widgetStack->raiseWidget( m_editorWidget );
+ createGUI( mainView );
+ m_outputWidget = new QWidget( this, "output" );
+ m_widgetStack->addWidget( m_outputWidget );
+ emit sigEnableActions( false );
+}
+
+void KMyFirewall::updateView() {
+ updateCaption();
+
+ KParts::ReadWritePart* mainView = KMFPluginFactory::KMFMainView( this, m_err );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ kapp->quit();
+ }
+ if ( ! mainView ) {
+ KMessageBox::error( this, i18n( "KMFPluginFactory::KMFMainView( this, m_err ): returned a NULL pointer" ) );
+ kapp->quit();
+ }
+ m_editorWidget = mainView->widget();
+ QWidget* wid = m_widgetStack->widget( m_widgetStack->id( m_editorWidget ) );
+ wid = m_editorWidget;
+
+ createGUI( mainView );
+ m_widgetStack->raiseWidget( m_editorWidget );
+ emit sigEnableActions( false );
+}
+
+void KMyFirewall::showEditor() {
+ m_widgetStack->raiseWidget( m_editorWidget );
+}
+
+void KMyFirewall::slotShowEditor() {
+ showEditor();
+ emit sigEnableActions( true );
+}
+
+void KMyFirewall::showOutput() {
+ m_widgetStack->raiseWidget( m_outputWidget );
+ emit sigEnableActions( false );
+}
+
+void KMyFirewall::slotShowTransactionLog() {
+ kdDebug() << "KMyFirewall::slotShowTransactionLog();" << endl;
+ KMFTransactionLog::instance()->show();
+ KMFTransactionLog::instance()->raise();
+}
+
+void KMyFirewall::setOutputWidget( QWidget* wid ) {
+ m_widgetStack->removeWidget( m_outputWidget );
+ QWidget* widget = new QWidget( this , "output" );
+ QGridLayout *layout = new QGridLayout( widget, 1, 1 );
+ wid->reparent( widget, ( unsigned int ) 0 , *( new QPoint( 0, 0 ) ) );
+ layout->addWidget( wid, 0, 0 );
+ kdDebug() << "Adding outputwidget: " << wid->className() << endl;
+ if ( strcmp(wid->className(), "KMFObjectInfo") ) {
+ KPushButton * close = new KPushButton( i18n( "Return to Editor View" ), widget );
+ connect( close, SIGNAL( clicked() ),
+ this, SLOT( slotShowEditor() ) );
+ layout->addWidget( close, 1, 0 );
+ }
+ m_outputWidget = widget;
+ m_widgetStack->addWidget( widget );
+}
+
+void KMyFirewall::initActions() {
+ kdDebug() << "Init Actions..." << endl;
+ // Custom Actions
+
+ actionEditDocInfo = new KAction( i18n( "&Edit Document Information" ), "edit", 0 , this, SLOT( slotEditDocInfo() ), actionCollection(), "edit_doc_info" );
+
+ // KStdAction
+ actionNew = KStdAction::openNew( this, SLOT( slotFileNew() ),
+ actionCollection(), "new" );
+
+ actionClose = KStdAction::close( this, SLOT( slotFileClose() ),
+ actionCollection(), "close" );
+
+ actionOpen = KStdAction::open( this, SLOT( slotFileOpen() ),
+ actionCollection(), "open" );
+
+ actionSave = KStdAction::save( this, SLOT( slotFileSave() ),
+ actionCollection(), "save" );
+
+ actionSaveAs = KStdAction::saveAs( this, SLOT( slotFileSaveAs() ),
+ actionCollection(), "save_as" );
+ actionSaveAs->setEnabled( false );
+
+ actionQuit = KStdAction::quit( this, SLOT( slotQuitApp() ),
+ actionCollection(), "quit" );
+
+ actionUndo = KStdAction::undo( this, SLOT( slotUndo() ),
+ actionCollection(), "undo" );
+
+ actionRedo = KStdAction::redo( this, SLOT( slotRedo() ),
+ actionCollection(), "redo" );
+
+ actionExportTargetConfig = new KAction( i18n( "&Export Target Configuration..." ), "wizard", 0 , this, SLOT( slotExportTargetConfig() ),
+ actionCollection(), "export_tagret_config" );
+
+ actionImportTargetConfig = new KAction( i18n( "&Import Target Configuration..." ), "wizard", 0 , this, SLOT( slotImportTargetConfig() ),
+ actionCollection(), "import_tagret_config" );
+
+ actionShowTransactionLog = new KAction( i18n( "&Show Transaction Log..." ), "wizard", 0 , this, SLOT( slotShowTransactionLog() ),
+ actionCollection(), "show_transaction_log" );
+
+ actionLoadTemplate = new KAction( i18n( "&Load Template..." ), "wizard", 0 , this, SLOT( slotLoadTemplate() ),
+ actionCollection(), "load_template" );
+
+// KStdAction::showToolbar( this, SLOT( toggleToolBar() ) , actionCollection() );
+ KStdAction::showStatusbar( this, SLOT( toggleStatusBar() ), actionCollection() );
+ KStdAction::preferences( this, SLOT( slotConfigureKMF() ), actionCollection() );
+ KStdAction::configureToolbars( this, SLOT( slotConfigureToolbars() ), actionCollection() );
+}
+
+
+//############ End Init Methods ####################
+
+void KMyFirewall::slotExportTargetConfig() {
+ kdDebug() << "KMyFirewall::slotExportTargetConfig()" << endl;
+ KMFTarget* tg = KMFSelectActiveTarget::selectTarget( network(), i18n("<qt><p>Please select the Targetfrom which the configuration should be exported.</p></qt>") );
+ if ( ! tg ) {
+ return;
+ }
+ QString s = tg->doc()->getXMLRuleset();
+ kdDebug() << "Got XML: " << s << endl;
+ tg->doc()->exportXMLRuleset( true, false );
+}
+
+void KMyFirewall::slotConfigureToolbars() {
+ saveMainWindowSettings( KGlobal::config(), "KMyFirewall" );
+ KEditToolbar dlg( factory() );
+ connect( &dlg, SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() ) );
+ dlg.exec();
+}
+
+void KMyFirewall::slotNewToolbarConfig() {
+ applyMainWindowSettings( KGlobal::config(), "KMyFirewall" );
+}
+
+//check for the uid etc...
+bool KMyFirewall::checkRoot() {
+ // Is application started as root?
+ if ( getuid() != 0 ) {
+ closeSplash();
+ const QString & msg = i18n( "<qt><p><b>KMyFirewall was not started as user <i>root</i>.</b><br>"
+ "You will be prompted for the root password when you try to do something that requires root access.</p>"
+ "<p><b>Do you still want to continue?</b></p></qt>" );
+ int choise = KMessageBox::warningYesNo( NULL, msg, i18n( "Warning" ), KStdGuiItem::yes(), KStdGuiItem::no(), "not_root_warning" );
+ switch ( choise ) {
+ case 4:
+ kdDebug() << "Clicked NO" << endl;
+ return false; // Abort and prevent application continuing from here
+ case 3:
+ kdDebug() << "Clicked Yes" << endl;
+ break;
+ default:
+ return false; // Any action but pressing 'yes' will abort application
+ }
+ }
+
+ const QString& msg = i18n( "<qt><b>Compatibility Warning</b>.<p> "
+"As the file format used to save the rulesets has changed, "
+"rulesets created with KMyFirewall &lt; 1.0beta1 <b>WILL NOT</b> work, don't even try it!"
+ "</p></qt>" );
+ KConfig* _config = kapp->config();
+ _config->setGroup( "Notification Messages" );
+ QString warn = "";
+ warn = _config->readEntry( "compatibility_warning" );
+ if ( warn != "false" )
+ closeSplash();
+ KMessageBox::information( NULL, msg, i18n( "Warning - File format change" ), "compatibility_warning", 0 );
+ return true;
+}
+
+bool KMyFirewall::saveQuit() {
+ if ( ! KMFUndoEngine::instance()->isSaved() && !network()->currentDoc()->isEmpty() ) {
+ const QString & msg = i18n( "<p>Do you want to save the changes before you quit?" );
+ const QString& title = i18n( "Quit" );
+ int doit = KMessageBox::questionYesNoCancel ( this , msg, title );
+ kdDebug() << "Message Box returned: " << doit << endl;
+ if ( doit == 3 ) { // OK clicked
+ slotFileSave();
+ return true;
+ }
+ if ( doit == 2 ) { // Cancel clicked
+ return false;
+ }
+ if ( doit == 4 ) { // No clicked
+ return true;
+ }
+ return false;
+ }
+ return true;
+}
+
+void KMyFirewall::slotQuitApp() {
+ bool quit = saveQuit();
+ if ( quit ) {
+ KMFConfig::self() ->writeConfig();
+ kapp->quit();
+ }
+}
+
+KMFNetwork* KMyFirewall::network() {
+ return m_network;
+}
+
+void KMyFirewall::closeEvent( QCloseEvent* ) {
+ slotQuitApp();
+}
+
+void KMyFirewall::toggleToolBar() {
+ if ( toolBar() ->isVisible() )
+ toolBar() ->hide();
+ else
+ toolBar() ->show();
+}
+void KMyFirewall::toggleStatusBar() {
+ if ( statusBar() ->isVisible() )
+ statusBar() ->hide();
+ else
+ statusBar() ->show();
+}
+
+void KMyFirewall::initStatusBar() {
+ kdDebug() << "KMyFirewall::initStatusBar()" << endl;
+ statusBar() ->insertItem( i18n( "Starting Up" ), 0, true );
+ statusBar() ->insertItem( "", 1, true );
+}
+
+void KMyFirewall::slotConfigChanged() {
+ kdDebug() << "KMyFirewall::slotConfigChanged()" << endl;
+ KMFUndoEngine::instance()->setMaxUndo( KMFConfig::maxUndo() );
+
+
+ updateCaption();
+ // FIXME: enable dynamicly interface changeing
+ //updateView();
+ emit sigUpdateView();
+}
+
+void KMyFirewall::updateCaption(){
+ if ( ! network() || ! network()->currentTarget() ) {
+ return;
+ }
+ QString s = network()->url().fileName() + i18n(" Configuring Target %1").arg( network()->currentTarget()->toFriendlyString() );
+ if ( ! KMFUndoEngine::instance()->isSaved() ) {
+ s += i18n( "[modified]" );
+ }
+ setCaption( s );
+}
+
+
+void KMyFirewall::slotEnableSave() {
+ actionSave->setEnabled( true );
+}
+
+void KMyFirewall::slotEditDocInfo() {
+ KMFDocumentInfo * dlg = new KMFDocumentInfo( this, "KMFObjectInfo", true );
+ dlg->loadDoc( network()->currentDoc() );
+ connect( dlg,SIGNAL( sigSaveAsTemplate() ) , this, SLOT( slotFileSaveAsTemplate() ) );
+ dlg->exec();
+}
+
+void KMyFirewall::slotSelectInterface() {
+ KMFSelectInterface * m_sel = new KMFSelectInterface( 0, "KMFSelectInterface", true, QWidget::WDestructiveClose | QWidget::WStyle_Customize | QWidget::WStyle_NoBorder );
+ closeSplash();
+ if ( m_sel->exec() == QDialog::Rejected ) {
+ kdDebug() << "Wante to exit now..." << endl;
+ kapp->quit();
+ ; // FIXME: Doe not work - kapp->quit();
+ }
+ showSplash();
+}
+
+void KMyFirewall::slotUndo() {
+ kdDebug() << "KMyFirewall::slotUndo()" << endl;
+ QValueList< NetfilterObject* >& aff = KMFUndoEngine::instance()->undo();
+
+ QValueList< NetfilterObject* >::iterator it;
+ for ( it = aff.begin(); it != aff.end(); ++it ) {
+ emit sigUpdateView( *it );
+ }
+}
+
+void KMyFirewall::slotRedo() {
+ kdDebug() << "KMyFirewall::slotRedo()" << endl;
+ QValueList< NetfilterObject* >& aff = KMFUndoEngine::instance()->redo();
+
+ QValueList< NetfilterObject* >::iterator it;
+ for ( it = aff.begin(); it != aff.end(); ++it ) {
+ emit sigUpdateView( *it );
+ }
+}
+
+
+
+void KMyFirewall::slotFileOpen() {
+ kdDebug() << "KMyFirewall::slotFileOpen()" << endl;
+ KURL url;
+ url = KFileDialog::getOpenURL( ":", QString( "%1" ).arg( network()->getFileDialogFilter() ) );
+
+ QString xmlfile = url.path();
+ if ( url.path().isEmpty() ) {
+ return ;
+ }
+ slotLoadFile( xmlfile );
+
+/* statusBar() ->message( i18n( "Open file: " ) + url.path() , 5000 );
+ m_err = parseDocument( url );
+ m_err_handler->showError( m_err );
+ updateCaption();
+ emit sigUpdateView();*/
+}
+
+void KMyFirewall::slotLoadFile( const QString& file ) {
+ kdDebug() << "void KMyFirewall::slotLoadFile( const QString& " << file << " )" << endl;
+
+ KURL url( file );
+
+ statusBar() ->message( i18n( "Open file: " ) + url.path() , 5000 );
+ m_err = parseDocument( url );
+ m_err_handler->showError( m_err );
+ updateCaption();
+ emit sigUpdateView();
+}
+
+void KMyFirewall::slotImportTargetConfig() {
+ kdDebug() << "KMyFirewall::slotImportTragetConfig()" << endl;
+ KURL url;
+ url = KFileDialog::getOpenURL( ":", QString( "%1" ).arg( network()->currentDoc()->getFileDialogFilter() ) );
+
+ QString xmlfile = url.path();
+ if ( url.path().isEmpty() ) {
+ return ;
+ }
+
+ statusBar() ->message( i18n( "Imported file: " ) + url.path() , 5000 );
+ m_err = parseDocument( url );
+ m_err_handler->showError( m_err );
+ updateCaption();
+ emit sigUpdateView();
+}
+
+void KMyFirewall::slotLoadTemplate() {
+ KMFTemplateChooser * dlg = new KMFTemplateChooser( 0 , "KMyFirewall - Load Template", true, QWidget::WDestructiveClose | QWidget::WStyle_Customize | QWidget::WStyle_NoBorder );
+
+ // dlg->parseTemplates();
+ connect( dlg, SIGNAL( sigLoadTemplate( const QString& ) ),
+ this, SLOT( slotLoadFile( const QString& ) ) );
+/* connect( dlg, SIGNAL( sigLoadEmptyDocument() ),
+ this, SLOT( slotLoadFile( const QString& ) ) );*/
+ dlg->exec();
+}
+
+void KMyFirewall::slotFileClose() {
+ kdDebug() << "KMyFirewall::slotFileClose()" << endl;
+ bool choose_save = false;
+ if ( KMFAppState::upAndRunning() && ! KMFUndoEngine::instance()->isSaved() /*&& ! network()->isEmpty()*/ /*&& KMFAppState::hasOpenDoc()*/ ) {
+
+ switch ( QMessageBox::warning( this, i18n( "Save Changed Data?" ),
+ i18n( "This firewall configuration has been changed since it was last saved.\n\n"
+ "What do you want to do with these changes?\n" ),
+ i18n( "&Cancel" ), i18n( "&Discard" ), i18n( "&Save" ),
+ 2, 3 ) ) {
+
+ case 0:
+ kdDebug() << "Clicked Cancel" << endl;
+ return ;
+ case 1:
+ kdDebug() << "Clicked Discard" << endl;
+ break;
+ case 2:
+ kdDebug() << "Clicked Save" << endl;
+ choose_save = true;
+ slotFileSave();
+ break;
+ }
+ }
+ if ( ! choose_save ) {
+ network()->clear();
+ KMFConfig::setCurrentConfiguration( "" );
+ actionSave->setEnabled( false );
+ updateCaption();
+ toggleActions( false );
+ emit sigUpdateView();
+ }
+ emit sigUpdateView();
+}
+
+
+
+
+bool KMyFirewall::prepareForFileOpen( const KURL& url ) {
+ kdDebug() << "void KMyFirewall::prepareForFileOpen( const KURL&" << url.fileName() << " )" << endl;
+ QString xmlfile;
+ if ( KMFAppState::upAndRunning() ) {
+ kdDebug() << "ERROR: calling KMyFirewall::prepareForFileOpen(--) after application startup" << endl;
+ return false;
+ }
+
+ if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "Could not download file." << endl;
+ return false;
+ }
+
+ if ( !xmlfile.isEmpty() ) {
+ QFile kmfrsFile( xmlfile );
+
+ if ( !kmfrsFile.open( IO_ReadOnly ) ) {
+ return false;
+ }
+
+ QDomDocument doc;
+ if ( !doc.setContent( &kmfrsFile ) ) {
+ kmfrsFile.close();
+ return false;
+ }
+ kmfrsFile.close();
+ QDomElement root = doc.documentElement();
+
+ QString version = "";
+ QString minVersion = "";
+ QString maxVersion = "";
+ QString interface = "";
+
+ if ( root.hasAttribute( XML::Version_Attribute ) ) {
+ version = root.attribute( XML::Version_Attribute );
+ }
+
+ if ( root.hasAttribute( XML::MinVersion_Attribute ) ) {
+ minVersion = root.attribute( XML::MinVersion_Attribute );
+ }
+
+ if ( root.hasAttribute( XML::MaxVersion_Attribute ) ) {
+ maxVersion = root.attribute( XML::MaxVersion_Attribute );
+ }
+
+ if ( root.nodeName() == XML::GenericDoc_DocumentElement ) {
+ kdDebug() << "Got kmfgrs doc" << endl;
+ kdDebug() << "Startup Using Generic Interfafce" << endl;
+ KMFConfig::setUseGenericInterface( true );
+ KMFConfig::writeConfig();
+ return true;
+ } else if ( root.nodeName() == XML::IPTDoc_DocumentElement ) {
+ kdDebug() << "Got kmfrs doc" << endl;
+ kdDebug() << "Startup Using IPTables Interfafce" << endl;
+ KMFConfig::setUseGenericInterface( false );
+ KMFConfig::writeConfig();
+ return true;
+ } else if ( root.nodeName() == XML::KMFNetwork_DocumentElement ) {
+ kdDebug() << "Got kmfnet doc" << endl;
+ if ( root.hasAttribute( XML::Interface_Attribute ) ) {
+ interface = root.attribute( XML::Interface_Attribute );
+ if ( interface == XML::IPTablesGUIInterface_Value ) {
+ KMFConfig::setUseGenericInterface( false );
+ KMFConfig::writeConfig();
+ kdDebug() << "Startup Using IPTables Interfafce" << endl;
+ } else {
+ KMFConfig::setUseGenericInterface( true );
+ KMFConfig::writeConfig();
+ kdDebug() << "Startup Using Generic Interfafce" << endl;
+ }
+ return true;
+ } else {
+ kdDebug() << "No interface attribute found!" << endl;
+ }
+ }
+ return false;
+ }
+ return false;
+}
+
+KMFDoc* KMyFirewall::getDocumentLoaderForUrl( const KURL& url, KMFError* err ) {
+ kdDebug() << "void KMyFirewall::getDocumentLoaderForUrl( const KURL&" << url.fileName() << " )" << endl;
+ err->setErrType( KMFError::OK );
+ QString xmlfile;
+ if ( ! KIO::NetAccess::download( url, xmlfile, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "Could not download file." << endl;
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>Could not download file %1</qt>" ).arg( url.url() ) );
+ return 0;
+ }
+
+ if ( !xmlfile.isEmpty() ) {
+ QFile kmfrsFile( xmlfile );
+
+ if ( !kmfrsFile.open( IO_ReadOnly ) ) {
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>Could not read file %1.</qt>" ).arg( url.url() ) );
+ return 0;
+ }
+
+ QDomDocument doc;
+ if ( !doc.setContent( &kmfrsFile ) ) {
+ kmfrsFile.close();
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>File %1 in not a vaild XML file.</qt>" ).arg( url.url() ) );
+ return 0;
+ }
+ kmfrsFile.close();
+
+
+ kdDebug() << "Find Opener For file: " << xmlfile << endl;
+ QDomElement root = doc.documentElement();
+
+ QString version = "";
+ QString minVersion = "";
+ QString maxVersion = "";
+
+ if ( root.hasAttribute( XML::Version_Attribute ) ) {
+ version = root.attribute( XML::Version_Attribute );
+ }
+
+ if ( root.hasAttribute( XML::MinVersion_Attribute ) ) {
+ minVersion = root.attribute( XML::MinVersion_Attribute );
+ }
+
+ if ( root.hasAttribute( XML::MaxVersion_Attribute ) ) {
+ maxVersion = root.attribute( XML::MaxVersion_Attribute );
+ }
+
+ QPtrList<KMFTarget> *list = new QPtrList<KMFTarget>;
+ network()->netzone()->getAllTargets( network()->netzone(), list );
+
+ const QString& selTargetDialogMessage = i18n("<qt><p>Please select the Target host that should load the selected configuration.</p></qt>");
+ if ( root.nodeName() == XML::IPTDoc_DocumentElement ) {
+ if ( ! KMFConfig::useGenericInterface() ) {
+ KMFTarget* tg = KMFSelectActiveTarget::selectTarget( network(), selTargetDialogMessage );
+ if ( ! tg ) {
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>No target found to load document.</qt>" ) );
+ return 0;
+ }
+ network()->setCurrentTarget( tg );
+ updateCaption();
+ kdDebug() << "Returned IPT Doc for target: " << network()->currentTarget()->guiName() << endl;
+ KIO::NetAccess::removeTempFile( xmlfile );
+ return network()->currentDocAsIPTDoc();
+ }
+ } else if ( root.nodeName() == XML::GenericDoc_DocumentElement ) {
+ if ( KMFConfig::useGenericInterface() ) {
+ KMFTarget* tg = KMFSelectActiveTarget::selectTarget( network(), selTargetDialogMessage );
+ if ( ! tg ) {
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>No target found to load document.</qt>" ) );
+ return 0;
+ }
+ network()->setCurrentTarget( tg );
+ updateCaption();
+ kdDebug() << "Returned GEneric Doc for target: " << network()->currentTarget()->guiName() << endl;
+ KIO::NetAccess::removeTempFile( xmlfile );
+ return network()->currentDocAsGenericDoc();
+ }
+ } else if ( root.nodeName() == XML::KMFNetwork_DocumentElement ) {
+ QString interface = root.attribute( XML::Interface_Attribute );
+ if ( interface == XML::GenericGUIInterface_Value && ! KMFConfig::useGenericInterface() ) {
+ kdDebug() << "Invalid Document type: " << interface << " found " << endl;
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>You are running KMyFirewall with the <b>IPTables Interface</b> but the document was created using the <b>Generic Interface</b>.</qt>" ) );
+ return 0;
+ }
+ if ( interface == XML::IPTablesGUIInterface_Value && KMFConfig::useGenericInterface() ) {
+ kdDebug() << "Invalid Document type: " << interface << " found " << endl;
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>You are running KMyFirewall with the <b>Generic Interface</b> but the document was created using the <b>IPTables Interface</b>.</qt>" ) );
+ return 0;
+ }
+
+
+ kdDebug() << "Returned KMFNetwork " << network()->currentTarget()->guiName() << endl;
+ KIO::NetAccess::removeTempFile( xmlfile );
+ return network();
+ }
+ KIO::NetAccess::removeTempFile( xmlfile );
+ kdDebug() << "ERROR: No Loader Found!" << endl;
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>The document is not a valid KMyFirewall document.</qt>" ) );
+ return 0;
+ }
+ KIO::NetAccess::removeTempFile( xmlfile );
+ err->setErrType( KMFError::NORMAL );
+ err->setErrMsg( i18n( "<qt>Could not download file %1.</qt>" ).arg( url.url() ) );
+ return 0;
+}
+
+KMFError* KMyFirewall::parseDocument( const KURL& url ) {
+ kdDebug() << "void KMyFirewall::parseDocument(QString& file)" << endl;
+ KIO::UDSEntry f_props;
+
+ if ( ! KIO::NetAccess::stat( url , f_props, KApplication::kApplication()->mainWidget() ) ) {
+ closeSplash();
+ const QString msg = i18n( "<qt><p>The file <b>%1</b> could not be loaded.</p>"
+ "<p>If you are working with files stored on remote computers "
+ "make sure that the network is up and the fileserver running.</qt>" ).arg( url.url() );
+ m_err->setErrType( KMFError::NORMAL );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+ KFileItem *props = new KFileItem( f_props, url );
+ kdDebug() << "Found file permissions: " << props->permissionsString() << endl;
+ if ( !props->isReadable() ) {
+ const QString msg = i18n( "<qt><p>You don't have the permissions to read file: <b>%1</b></p></qt>" ).arg( url.url() );
+ m_err->setErrType( KMFError::NORMAL );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+
+ KMFDoc* loader = getDocumentLoaderForUrl( url, m_err );
+ if ( m_err->errType() != KMFError::OK && m_err->errType() != KMFError::HINT ) {
+ return m_err;
+ }
+
+ if ( ! loader ) {
+ const QString msg = i18n( "<qt><p>No loader found for file: <b>%1</b></p></qt>" ).arg( url.url() );
+ m_err->setErrType( KMFError::NORMAL );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+ if ( loader == m_network ) {
+ slotFileClose();
+ }
+
+ QStringList *errors = new QStringList();
+ loader->parseDocument( url, *errors );
+
+ if ( loader == m_network ) {
+ KMFConfig::setCurrentConfiguration( url.url() );
+ }
+
+ KMFError *err = KMFError::parseErrors( *errors );
+ if ( err->errType() != KMFError::OK && err->errType() != KMFError::HINT ) {
+ return err;
+ }
+
+
+ slotEnableRedo( false );
+ if ( network()->currentDoc() == 0 ) {
+ kdDebug() << "void KMyFirewall::parseDocument(QString& file)\nkmfdoc == 0" << endl;
+ KMFConfig::setCurrentConfiguration( "" );
+ network()->currentDoc()->clear();
+ m_err->setErrType( KMFError::NORMAL );
+ const QString msg = i18n( "<qt>Unable to load file %1.</qt>" ).arg( url.url() );
+ m_err->setErrMsg( msg );
+ return m_err;
+ }
+
+ const QString filename = url.fileName();
+
+
+ toggleActions( true );
+ actionSave->setEnabled( true );
+ checkStatus();
+ updateCaption();
+ m_err->setErrType( KMFError::OK );
+ const QString msg = "";
+ m_err->setErrMsg( msg );
+ return m_err;
+}
+
+
+void KMyFirewall::slotRestoreSession() {
+ kdDebug() << "############## RestoreSession #############" << endl;
+
+ bool worked = true;
+ if ( ! KMFConfig::currentConfiguration().isNull() && ! KMFConfig::currentConfiguration().isEmpty() ) {
+ KURL url( KMFConfig::currentConfiguration() );
+ m_err = parseDocument( url );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ updateCaption();
+ slotEnableUndo( false );
+ slotEnableUndo( false );
+ worked = false;
+ }
+
+ checkStatus();
+ if ( ! worked ) {
+ KMFConfig::setCurrentConfiguration( "" );
+ }
+ }
+ kdDebug() << "############## Restore Session FINISHED #############" << endl;
+}
+
+
+void KMyFirewall::slotFileNew() {
+ kdDebug() << "KMyFirewall::slotFileNew()" << endl;
+ slotFileClose();
+ KMFNewDocDlg *dlg = new KMFNewDocDlg( 0, "KMyFirewall - New Document", QWidget::WDestructiveClose | QWidget::WStyle_Customize | QWidget::WStyle_NoBorder );
+ dlg->show() ;
+ dlg->raise();
+ connect( dlg, SIGNAL( sigNewDocLoadTemplate() ), this, SLOT( slotLoadTemplate() ) );
+ connect( dlg, SIGNAL( sigNewDocLoadEmpty() ), this, SLOT( slotLoadEmptyRuleset() ) );
+ connect( dlg, SIGNAL( sigNewDocLoadSaved() ), this, SLOT( slotFileOpen() ) );
+}
+
+void KMyFirewall::slotLoadEmptyRuleset() {
+ kdDebug() << "slotLoadEmptyRuleset()" << endl;
+ network()->clear();
+ // slotLoadDocument( network() );
+ toggleActions( true );
+ actionSave->setEnabled( true );
+ checkStatus();
+ toggleActions( true );
+// m_configDlg->slotAutoConf();
+
+ updateCaption();
+ emit sigUpdateView();
+}
+
+
+//############# Save Stuff #################//
+
+void KMyFirewall::slotFileSaveAs() {
+ kdDebug() << "KMyFirewallMainView::slotFileSaveAs()" << endl;
+ KURL url;
+ saveDocument( true, false );
+}
+
+void KMyFirewall::slotFileSaveAsTemplate() {
+ kdDebug() << "KMyFirewallMainView::slotFileSaveAsTemplate()" << endl;
+ // KURL url;
+ saveDocument( true, true );
+}
+
+
+
+void KMyFirewall::slotFileSave() {
+ // FIXME: reenable after generic doc works
+ /* if ( kmfdoc->isSaved() ) {
+ statusBar() ->message( i18n( "No changes to save." ) , 5000 );
+ // actionSave->setEnabled( false );
+ return ;
+ }*/
+ m_err = saveDocument( false, false );
+ kdDebug() << "m_err" + m_err->errNum() << endl;
+ if ( m_err_handler->showError( m_err ) ) {
+ kdDebug() << "Wrote file: " << network()->url().path() << endl;
+// network()->saved();
+ statusBar() ->message( i18n( "Wrote file: " ) + network()->url().fileName(), 5000 );
+ updateCaption();
+ }
+}
+
+KMFError* KMyFirewall::saveDocument( bool promptURL, bool asTemplate ) {
+ kdDebug() << "void KMyFirewall::saveDocument( promptURL " << promptURL << " , bool asTemplate " << asTemplate << " )" << endl;
+
+
+ m_err = network()->exportXMLRuleset( promptURL, asTemplate );
+ if ( m_err->errType() != KMFError::OK ) {
+ return m_err;
+ }
+
+ // network()->url().set;
+ KMFConfig::setCurrentConfiguration( network()->url().url() );
+
+ kdDebug() << "Wrote URL: " << network()->url() << endl;
+ updateCaption();
+ m_err -> setErrType( KMFError::OK );
+ m_err -> setErrMsg( "" );
+ return m_err;
+}
+
+
+//#############################################//
+
+void KMyFirewall::slotConfigureKMF() {
+ closeSplash();
+ m_configDlg->slotReadConfig();
+ m_configDlg->exec();
+}
+
+//################ Check Status #############//
+// FIXME: Implement iptables active check
+
+void KMyFirewall::checkStatus() {
+ kdDebug() << "checkStatus()" << endl;
+ bool isInstalled = false;
+
+ if ( network()->currentTarget()->isLocalExecuteTarget() ) {
+ FILE *sbin1;
+ sbin1 = fopen( "/etc/kmyfirewall", "r" );
+ if ( sbin1 != NULL ) {
+ kdDebug() << "Firewall is installed" << endl;
+ isInstalled = true;
+ fclose( sbin1 );
+ }
+ } else {
+ if ( KIO::NetAccess::exists( network()->currentTarget()->getFishUrl() + "/etc/kmyfirewall", true, KApplication::kApplication()->mainWidget() ) ) {
+ kdDebug() << "Firewall is installed" << endl;
+ isInstalled = true;
+ }
+ }
+
+
+
+ if ( isInstalled ) {
+ statusBar() ->changeItem( i18n( "Firewall is installed on %1" ).arg( network()->currentTarget() ->toFriendlyString() ), 1 );
+ } else {
+ statusBar() ->changeItem( i18n( "Firewall is not installed on %1" ).arg( network()->currentTarget() ->toFriendlyString() ), 1 );
+ }
+
+
+
+}
+
+
+//############# UNDO ###################//
+void KMyFirewall::enableUndo( bool onoff ) {
+ kdDebug() << "void KMyFirewall::enableUndo( bool " << onoff << " )" << endl;
+ if ( ! KMFUndoEngine::instance()->maxUndo() ) {
+ actionUndo->setEnabled( false );
+ return ;
+ }
+ actionUndo->setEnabled( onoff );
+}
+
+void KMyFirewall::enableRedo( bool onoff ) {
+ kdDebug() << "void KMyFirewall::enableRedo( bool " << onoff << " )" << endl;
+ if ( ! KMFUndoEngine::instance()->maxUndo() ) {
+ actionRedo->setEnabled( false );
+ return ;
+ }
+ actionRedo->setEnabled( onoff );
+}
+
+void KMyFirewall::slotEnableUndo( bool onoff ) {
+ kdDebug() << "void KMyFirewall::slotEnableUndo( bool " << onoff << " )" << endl;
+ enableUndo( onoff );
+}
+
+void KMyFirewall::slotEnableRedo( bool onoff ) {
+ kdDebug() << "void KMyFirewall::slotEnableUndo( bool " << onoff << " )" << endl;
+ enableRedo( onoff );
+}
+//########### ACTION TOGGLES ################//
+/** toggle the available actions */
+void KMyFirewall::toggleActions( bool ) {
+// if ( on ) {
+ // actionClose->setEnabled( true );
+ actionSave->setEnabled( true );
+ actionSaveAs->setEnabled( true );
+ actionEditDocInfo->setEnabled( true );
+
+ // diable new and open file
+ actionNew->setEnabled( true );
+ actionOpen->setEnabled( true );
+ actionUndo->setEnabled( false );
+ actionRedo->setEnabled( false );
+ // emit /*sigHasDoc*/( true );
+ emit sigEnableActions( true );
+// } else {
+// actionClose->setEnabled( false );
+// actionSave->setEnabled( false );
+// actionSaveAs->setEnabled( false );
+// actionEditDocInfo->setEnabled( false );
+// actionUndo->setEnabled( false );
+// actionRedo->setEnabled( false );
+//
+// // enable new and open file
+// actionNew->setEnabled( true );
+// actionOpen->setEnabled( true );
+// // emit sigHasDoc( false );
+// emit sigEnableActions( false );
+// }
+}
+
+// // bool KMyFirewall::hasOpenDoc() {
+// // return KMFAppState::hasOpenDoc();
+// // }
+
+bool KMyFirewall::isTemplate() {
+ if ( ( network()->currentDoc()->url().fileName().endsWith( "tkmfrs" ) || network()->currentDoc()->url().fileName().endsWith( "tkmfgrs" ) ) ) {
+ return true;
+ }
+ return false;
+}
+
+}
+
+#include "kmyfirewall.moc"
diff --git a/kmyfirewall/kmyfirewall.desktop b/kmyfirewall/kmyfirewall.desktop
new file mode 100644
index 0000000..b5a84e2
--- /dev/null
+++ b/kmyfirewall/kmyfirewall.desktop
@@ -0,0 +1,38 @@
+# KDE Config File
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+MimeType=application/x-kmyfirewall;application/x-kmyfirewall-kmfrs;application/x-kmyfirewall-kmfgrs;application/x-kmyfirewall-kmfnet;
+Icon=kmyfirewall
+Patterns=*.kmfrs;*.kmfgrs;*.kmfnet;
+Exec=kmyfirewall %u
+Terminal=false
+Categories=Qt;KDE;System;
+Name=KMyFirewall
+Name[sv]=Min brandvägg
+Name[xx]=xxKMyFirewallxx
+GenericName=Firewall Configuration Tool
+GenericName[bg]=Настройване на защитна стена
+GenericName[es]=Herramienta de configuración de cortafuegos
+GenericName[et]=Tulemüüri seadistamistööriist
+GenericName[it]=Strumento di configurazione di KMyFirewall
+GenericName[nl]=Firewall-configuratieprogramma
+GenericName[pt]=Ferramenta de Configuração da Firewall
+GenericName[pt_BR]=Ferramenta de Configuração da Firewall
+GenericName[sr]=Алат за подешавање заштитног зида
+GenericName[sr@Latn]=Алат за подешавање заштитног зида
+GenericName[sv]=Verktyg för brandväggsinställning
+GenericName[xx]=xxFirewall Configuration Toolxx
+Comment=Firewall Configuration Tool
+Comment[bg]=Настройване на KMyFirewall
+Comment[es]=Herramienta de configuración de cortafuegos
+Comment[et]=Tulemüüri seadistamistööriist
+Comment[it]=Strumento di configurazione di KMyFirewall
+Comment[ms]=Alatan Tetapan Firewall
+Comment[nl]=Firewall-configuratieprogramma
+Comment[pt]=Ferramenta de Configuração da Firewall
+Comment[pt_BR]=Ferramenta de Configuração da Firewall
+Comment[sr]=Алат за подешавање заштитног зида
+Comment[sr@Latn]=Алат за подешавање заштитног зида
+Comment[sv]=Verktyg för inställning av brandvägg
+Comment[xx]=xxFirewall Configuration Toolxx
diff --git a/kmyfirewall/kmyfirewall.h b/kmyfirewall/kmyfirewall.h
new file mode 100644
index 0000000..919d461
--- /dev/null
+++ b/kmyfirewall/kmyfirewall.h
@@ -0,0 +1,178 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+
+#ifndef KMYFIREWALL_H
+#define KMYFIREWALL_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// QT includes
+#include <qwidget.h>
+#include <qguardedptr.h>
+
+// KDE includes
+#include <kapplication.h>
+#include <kmainwindow.h>
+#include <kprocess.h>
+#include <kconfig.h>
+#include <kurl.h>
+#include <kparts/mainwindow.h>
+#include <kparts/dockmainwindow.h>
+#include <ktempfile.h>
+
+// Project includes
+#include "kmfwidgets/kmfmainwindow.h"
+#include "core/kmyfirewallinterface.h"
+
+class KAction;
+class KActionMenu;
+class KDockWidget;
+class KTempFile;
+class QCloseEvent;
+class QStringList;
+class QWidgetStack;
+
+
+namespace KMF {
+class KMFNetwork;
+class KMFDoc;
+class KMFIPTDoc;
+class KMFGenericDoc;
+class KMFView;
+class KMFError;
+class KMFErrorHandler;
+class KMFIPTDocOptions;
+class KMFConfigDialog;
+class KMFRuleEdit;
+class KMFCompilerPlugin;
+class KMFProcOut;
+class KMFSelectInterface;
+// class KMFSelectInterface;
+
+class KMFTarget;
+
+/** KMyFirewall is the base class of the project */
+class KMyFirewall : public KMFMainWindow {
+ Q_OBJECT
+
+public:
+ KMyFirewall( QWidget* parent = 0, const char *name = 0 );
+ ~KMyFirewall();
+ // KMFDoc* doc();
+ KMFNetwork* network();
+ virtual void showEditor();
+ virtual void showOutput();
+ virtual void setOutputWidget( QWidget* );
+ virtual void checkStatus();
+ virtual void updateCaption();
+
+public slots: // Public slots
+ void slotUndo();
+ void slotRedo();
+ void slotFileSaveAs();
+ void slotFileSaveAsTemplate();
+ void slotFileOpen();
+ void slotFileNew();
+ void slotFileClose();
+ void slotConfigureToolbars();
+ void slotNewToolbarConfig();
+ void slotEditDocInfo();
+ void slotEnableSave();
+ void slotRestoreSession();
+ void slotConfigureKMF();
+ void slotLoadEmptyRuleset();
+ void slotLoadTemplate();
+ void slotLoadFile( const QString& );
+ void toggleActions( bool );
+ void slotEnableUndo( bool );
+ void slotEnableRedo( bool );
+ void slotQuitApp();
+ void slotConfigChanged();
+ void slotSelectInterface();
+ void slotExportTargetConfig();
+ void slotImportTargetConfig();
+ void slotShowTransactionLog();
+
+protected:
+ bool checkRoot();
+ void updateView();
+ void enableUndo( bool );
+ void enableRedo( bool );
+
+protected slots:
+ void initStatusBar();
+ void initView();
+ void initActions();
+ void slotFileSave();
+ void toggleToolBar();
+ void toggleStatusBar();
+ void slotShowEditor();
+// void slotProcessExited( KProcess* );
+// void slotReceivedOutput( KProcess*, char*, int );
+// void slotReceivedError( KProcess*, char*, int );
+
+private: // member functions
+ bool isTemplate();
+ KMFError* parseDocument( const KURL& );
+ KMFError* saveDocument( bool promptURL, bool asTemplate );
+ KMFDoc* getDocumentLoaderForUrl( const KURL&, KMFError* );
+ bool prepareForFileOpen( const KURL& url );
+ void parseCommandLineArgs();
+ //++++++++++++++
+
+private: // data
+ QWidget* m_editorWidget;
+// KProcess* childproc;
+// KProcess &operator<<( const QString& arg );
+/* QString m_processName;
+ KTempFile *m_iptables_saveOutput;*/
+ KMFError *m_err;
+ KMFErrorHandler *m_err_handler;
+
+ KMFNetwork *m_network;
+ KMFConfigDialog *m_configDlg;
+ KMFSelectInterface *m_selInterface;
+
+ KAction* actionQuit;
+ KAction* actionNew;
+ KAction* actionClose;
+ KAction* actionOpen;
+ KAction* actionSave;
+ KAction* actionSaveAs;
+ KAction* actionEditDocInfo;
+ KAction* actionLoadTemplate;
+ KAction* actionUndo;
+ KAction* actionRedo;
+ KAction* actionExportTargetConfig;
+ KAction* actionImportTargetConfig;
+ KAction* actionShowTransactionLog;
+
+ bool saveQuit();
+ void closeEvent ( QCloseEvent * );
+ QWidgetStack* m_widgetStack;
+ QWidget *m_outputWidget;
+
+
+ QString m_fileToOpen;
+
+signals:
+ void documentChanged( KMFIPTDoc * );
+// void processExited( KProcess * );
+ void sigSplashShow( bool );
+ void sigSplashShowMsg( const QString& );
+};
+}
+#endif
diff --git a/kmyfirewall/kmyfirewallrc b/kmyfirewall/kmyfirewallrc
new file mode 100644
index 0000000..eca4cd1
--- /dev/null
+++ b/kmyfirewall/kmyfirewallrc
@@ -0,0 +1,7 @@
+[GENERAL]
+FirstRun=true
+
+
+
+
+
diff --git a/kmyfirewall/kmyfirewallui.rc b/kmyfirewall/kmyfirewallui.rc
new file mode 100644
index 0000000..8b499db
--- /dev/null
+++ b/kmyfirewall/kmyfirewallui.rc
@@ -0,0 +1,56 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kmyfirewall" version="9">
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Action name="new"/>
+ <Action name="open"/>
+ <Separator lineSeparator="true"/>
+ <Action name="save"/>
+ <Action name="save_as"/>
+ <Action name="export_script"/>
+ <Merge/>
+ <Menu name="import_script_menu"><text>&amp;Import..</text><icon name="fileexport">fileimport</icon>
+ <Action name="import_tagret_config"/>
+ </Menu>
+ <Menu name="export_script_menu"><text>&amp;Export..</text><icon name="fileexport">fileexport</icon>
+ <Action name="export_tagret_config"/>
+ </Menu>
+ <Separator lineSeparator="true"/>
+ <Action name="undo"/>
+ <Action name="redo"/>
+ <Action name="edit_doc_info"/>
+ <Separator lineSeparator="true"/>
+ <Action name="close"/>
+ <Action name="quit"/>
+ </Menu>
+ <Merge/>
+ <Menu name="run"><text>&amp;Run</text>
+ <Merge/>
+ </Menu>
+
+ <Menu name="settings"><text>&amp;Settings</text>
+ <Action name="show_transaction_log" />
+ </Menu>
+</MenuBar>
+<ToolBar fullWidth="true" name="mainToolBar"><Text>Main</Text>
+ <Action name="new"/>
+ <Action name="open"/>
+ <Separator lineSeparator="true"/>
+ <Action name="close"/>
+ <Action name="save"/>
+ <Action name="save_as"/>
+ <Action name="export_script"/>
+ <Merge name="kmfcompilerplugin"/>
+ <Separator lineSeparator="true"/>
+ <Action name="undo"/>
+ <Action name="redo"/>
+ <Separator lineSeparator="true"/>
+ <Action name="edit_doc_options"/>
+ <Merge/>
+ <Merge name="kmfinstallerplugin"/>
+ <Action name="quit"/>
+</ToolBar>
+</kpartgui>
+
+
+
diff --git a/kmyfirewall/main.cpp b/kmyfirewall/main.cpp
new file mode 100644
index 0000000..4dfd845
--- /dev/null
+++ b/kmyfirewall/main.cpp
@@ -0,0 +1,78 @@
+/***************************************************************************
+ begin : Sun Jan 27 21:17:58 CET 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "kmyfirewall.h"
+
+// QT includes
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qlistview.h>
+
+// KDE includes
+
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+#include <kconfig.h>
+#include <kdebug.h>
+
+// project inclues
+#include "core/kmfapp.h"
+#include "version.h"
+#include "core/kmfconfig.h"
+
+static const char description[] = I18N_NOOP( "KMyFirewall - IPTables configuration tool" );
+
+
+static KCmdLineOptions options[] =
+ {
+ { "+[URL]", I18N_NOOP( "Files/URLs to Open." ), 0 },
+ { "i <interfacename>", I18N_NOOP("Select the interface to use at startup. Use 'iptables' for the iptables/netfilter interface or 'generic' for the generic GUI. By default the interface selection dialog is shown if the user did not specify to allways use one of the interfaces by default."), 0 },
+ KCmdLineLastOption
+ };
+
+int main( int argc, char *argv[] ) {
+ KAboutData aboutData( "kmyfirewall", I18N_NOOP( "KMyFirewall" ),
+ KMYFIREWALL_VERSION, description, KAboutData::License_GPL,
+ COPYRIGHT_STRING, 0, 0, "chubinger@irrsinnig.org" );
+ aboutData.addAuthor( "Christian Hubinger", 0, "chubinger@irrsinnig.org" );
+ aboutData.addCredit( "Benjamin Meyer", I18N_NOOP("A handful of fixes and code cleanup."),"ben+kmyfirewall@meyerhome.net");
+ aboutData.addCredit( "Casper Planken", I18N_NOOP("Gave me some really good hints about how to do certain things"), "cplanken@chello.nl" );
+ aboutData.addCredit( "Malcolm Hunter", I18N_NOOP("Spell Checking and making messages real English"), "malcolm.hunter@gmx.co.uk" );
+ aboutData.addCredit( "Carsten Niehaus", I18N_NOOP("Part of the sanity checks, bugfixes"), "cniehaus@gmx.de" );
+ aboutData.addCredit( "Christian Deschka", I18N_NOOP("Artwork"), "echos@lycos.at" );
+ aboutData.addCredit( "Anton Frennevi", I18N_NOOP("Artwork"), "twopointone@hotmail.com" );
+ aboutData.setHomepage( "http://kmyfirewall.sourceforge.net" );
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
+
+ KMF::KMFApp a;
+
+ // Splash screen
+ KMF::KMFConfig::self()->readConfig();
+ if ( KMF::KMFConfig::showSplash() ) {
+ KMF::showSplash();
+ }
+
+ KMF::KMyFirewall * kmyfirewall = new KMF::KMyFirewall;
+ a.setMainWidget( kmyfirewall );
+ kmyfirewall->show();
+
+ KMF::closeSplash();
+
+
+
+ return a.exec();
+
+}
diff --git a/kmyfirewall/ruleoptionplugins/Makefile.am b/kmyfirewall/ruleoptionplugins/Makefile.am
new file mode 100644
index 0000000..7b29483
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/Makefile.am
@@ -0,0 +1,5 @@
+# INCLUDES = -I../kmfwidgets $(all_includes)
+METASOURCES = AUTO
+partdesktopdir = $(kde_servicetypesdir)
+partdesktop_DATA = kmfruleoptionedit.desktop kmfruletargetoptionedit.desktop
+SUBDIRS = interface_option ip_option limit_option mac_option protocol_option state_option tos_option nat_target_option custom_option tos_target_option log_target_option mark_target_option
diff --git a/kmyfirewall/ruleoptionplugins/README b/kmyfirewall/ruleoptionplugins/README
new file mode 100644
index 0000000..7f2e5f7
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/README
@@ -0,0 +1,75 @@
+Writing Rule Option Plugins for KMyFirewall
+-----------------------------------
+
+
+Abstract
+--------
+
+As the netfilter/iptables suite grwos quite fast (every few releases there are
+more ruleoptions added) all rule option handling (logig & GUI) is located in
+small plugins that get loaded at startup and made available thorough the gui.
+
+This way it's possible for others to easily extend KMyFirewall and help to keep
+the Application up to date with iptables. I hope that this will help to make
+KMF an even better tool then it allready is.
+
+
+Creating KMF Rule Option Plugins
+--------------------------------
+
+
+A Plugin consists of the following different parts.
+
+*) The Widget for editing the Option
+
+*) A class derived from KMFPlugin that defines the ServiceType
+KMFyFirewall/RuleOptionEdit or KMFyFirewall/RuleTargetOptionEdit
+
+*) A XML file describing the option so that the correct iptables commands can
+be genereated
+
+
+Writing the Edit widget
+-----------------------
+
+This class is simply a Widget that has the following methods/slots/signals defined
+
+public:
+ void loadRule( IPTRule * );
+
+public slots:
+ void accept();
+ void reject();
+ void slotHelp();
+
+signals:
+ void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigAddTargetOpt( QString *, QPtrList<QString> * );
+
+ void sigDocumentChanged();
+ void sigHideMe();
+
+It's up to you if design the widget with QT's designer or if you write. It's just importent that you
+implement the needed methods properly in order to make the Editor work as expected.
+
+The signals emited by the widget will be conneted to the KMFRuleEdit window.
+Have a look at the allready available plugins to find out thow to implement those methods in detail.
+
+FIXME: More explainaitions here
+
+
+
+
+Writing the KMFPlugin class
+---------------------------
+
+This class is compiled to an loadable modules using KDE's KParts technology. There fore it is important
+to make shure that the corresponding *.desktop file is written properly. Otherwise the plugin won't be found by the application as the name of the loaddable library is taken from the desktop file.
+
+The Plugin class should be named KMFRuleOptionEditOptionName or KMFRuleTargetOptionEditOptionName
+
+
+
+
+
+
diff --git a/kmyfirewall/ruleoptionplugins/custom_option/Makefile.am b/kmyfirewall/ruleoptionplugins/custom_option/Makefile.am
new file mode 100644
index 0000000..a03180e
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/custom_option/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruleoptionedit_custom.la
+
+libkmfruleoptionedit_custom_la_LDFLAGS = -module -no-undefined $(all_libraries) \
+ $(KDE_PLUGIN)
+libkmfruleoptionedit_custom_la_LIBADD = \
+ $(LIB_KPARTS) ../../core/libkmfcore.la
+noinst_HEADERS = kmfruleoptioneditcustom.h kmfruleeditcustomopt.h
+
+libkmfruleoptionedit_custom_la_SOURCES = kmfruleoptioneditcustom.cpp kmfruleeditcustomopt.cpp kmyfirewallruleeditorcustomrule.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruleoptionedit_custom.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_custom_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_custom_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_custom_option.xml
+
diff --git a/kmyfirewall/ruleoptionplugins/custom_option/kmfruleeditcustomopt.cpp b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleeditcustomopt.cpp
new file mode 100644
index 0000000..3edabc9
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleeditcustomopt.cpp
@@ -0,0 +1,148 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfruleeditcustomopt.h"
+
+// KDE includes
+#include <kdebug.h>
+#include <kapplication.h>
+#include <klocale.h>
+
+// QT includes
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#include <qlabel.h>
+#include <qstring.h>
+#include <qcheckbox.h>
+
+// Project includes
+#include "../../core/xmlnames.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+
+namespace KMF {
+KMFRuleEditCustomOpt::KMFRuleEditCustomOpt( QWidget *parent, const char *name ) : KMyFirewallRuleEditorCustomRule( parent, name ) {
+ c_options->setChecked( false );
+ c_target_options->setChecked( false );
+ t_target->clear();
+ t_target_options->clear();
+ t_options->clear();
+}
+
+KMFRuleEditCustomOpt::~KMFRuleEditCustomOpt() {
+}
+
+void KMFRuleEditCustomOpt::loadRule( IPTRule * rule ) {
+ kdDebug() << "void KMFRuleEditIP::loadRule( IPTRule * rule )" << endl;
+ if ( rule == 0 )
+ return ;
+
+ m_rule = rule;
+ t_target->clear();
+ t_target->setText( m_rule->target() );
+ t_target_options->clear();
+ t_options->clear();
+ IPTRuleOption *opt;
+ QStringList vals;
+ QString val = "";
+
+ opt = m_rule->getOptionForName("custom_opt");
+ vals = opt->getValues();
+ val = *vals.at(0);
+ if ( val != XML::Undefined_Value && !val.isEmpty() && val != XML::BoolOff_Value ) {
+ c_options->setChecked( true );
+ t_options->setText( val );
+ }
+ vals.clear();
+ val = "";
+
+ opt = m_rule->getOptionForName("target_custom_opt");
+ vals = opt->getValues();
+ val = *vals.at(0);
+ if ( val != XML::Undefined_Value && !val.isEmpty() && val != XML::BoolOff_Value ) {
+ c_target_options->setChecked( true );
+ t_target_options->setText( val );
+ }
+ return ;
+}
+
+void KMFRuleEditCustomOpt::accept() {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Custom Rule: %1 Option").arg( m_rule->name() )
+ );
+ QString target = "";
+ target = t_target->text();
+ QString option = "";
+ if ( c_options->isChecked() )
+ option = t_options->text();
+ QString target_option = "";
+ if ( c_target_options->isChecked() )
+ target_option = t_target_options->text();
+ QString* op = new QString( "custom_opt" );
+ QString *tg_opt = new QString( "target_custom_opt" );
+ QPtrList<QString>* values = new QPtrList<QString>;
+
+ kdDebug() << "target: " << target << endl;
+ kdDebug() << "option: " << option << endl;
+ kdDebug() << "target_option: " << target_option << endl;
+ if ( !c_options->isChecked() && ! c_target_options->isChecked() ) {
+ m_rule->setCustomRule( false );
+ m_rule->addRuleOption( *op, *values );
+ m_rule->addRuleOption( *tg_opt, *values );
+ KMFUndoEngine::instance()->abortTransaction();
+ emit sigHideMe();
+ return ;
+ }
+
+ m_rule->setCustomRule( true );
+ if ( !target.isEmpty() )
+ m_rule->setTarget( *( new QString( target ) ) );
+
+ if ( !option.isEmpty() ) {
+ values->append( new QString( option ) );
+ } else {
+ values->append( new QString( XML::BoolOff_Value ) );
+ }
+ m_rule->addRuleOption( *op, *values );
+ values->clear();
+
+ if ( !target_option.isEmpty() ) {
+ values->append( new QString( target_option ) );
+ } else {
+ values->append( new QString( XML::BoolOff_Value ) );
+ }
+
+ m_rule->addTargetOption( *tg_opt, *values );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+}
+
+void KMFRuleEditCustomOpt::slotHelp() {
+ kdDebug() << "void KMFRuleEditIP::slotHelp()" << endl;
+ kapp->invokeHelp( "custom_rules" );
+}
+
+void KMFRuleEditCustomOpt::reject() {
+ kdDebug() << "void KMFRuleEditCustomOpt::reject()" << endl;
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleeditcustomopt.moc"
diff --git a/kmyfirewall/ruleoptionplugins/custom_option/kmfruleeditcustomopt.h b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleeditcustomopt.h
new file mode 100644
index 0000000..1ed3b86
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleeditcustomopt.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITCUSTOMOPT_H
+#define KMFRULEEDITCUSTOMOPT_H
+#include "kmyfirewallruleeditorcustomrule.h"
+
+#include <qwidget.h>
+#include <qptrlist.h>
+/**
+ *@author Christian Hubinger
+ */
+
+
+class QString;
+
+namespace KMF {
+class IPTRule;
+
+class KMFRuleEditCustomOpt : public KMyFirewallRuleEditorCustomRule {
+ Q_OBJECT
+public:
+ KMFRuleEditCustomOpt(QWidget *parent=0, const char *name=0);
+ ~KMFRuleEditCustomOpt();
+
+ void loadRule( IPTRule * );
+public slots:
+ void accept();
+ void reject();
+ void slotHelp();
+
+private:
+ IPTRule* m_rule;
+
+signals:
+/* void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );*/
+ void sigHideMe();
+
+
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoption_custom_option.xml b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoption_custom_option.xml
new file mode 100644
index 0000000..980e72f
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoption_custom_option.xml
@@ -0,0 +1,9 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="custom_opt" guiName="Custom Option" >
+ <option guiName="Option:" command="" />
+</ruleoptiondefinition>
+<ruleoptiondefinition name="target_custom_opt" guiName="Custom Option">
+ <option guiName="Custom Target Option:" command="" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset> \ No newline at end of file
diff --git a/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptionedit_custom.desktop b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptionedit_custom.desktop
new file mode 100644
index 0000000..d8f3d41
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptionedit_custom.desktop
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall Custom option edit
+Name[bg]=Редактиране на потребителските настройки на KMyFirewall
+Name[ca]=Edita les opcions a mida de KMyFirewall
+Name[cs]=Vlastní nastavení KMyFirewall
+Name[da]=KMyFirewall selvvalgt redigeringsvalg
+Name[de]=KMyFirewall - benutzerdefinierte Optionen
+Name[el]=Επεξεργασία προσαρμοσμένων επιλογών για το KMyFirewall
+Name[es]=Editor de opciones personalizadas de KMyFirewall
+Name[et]=KMyFirewalli kohandatud võtmete redigeerimine
+Name[fr]=Édition des options personnalisées de KMyFirewall
+Name[gl]=Edizón de opzón personalizada de KMyFirewall
+Name[hi]=के-माइ-फायरवाल मनपसंद विकल्प
+Name[it]=Modifica delle opzioni personalizzate di KMyFirewall
+Name[ja]=KMyFirewall カスタムオプション編集
+Name[ka]=KMyFirewall მორგებულ პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - gebruikergedefinieerde opties bewerken
+Name[pa]=KMyFirewall ਪਸੰਦੀਦਾ ਚੋਣ ਸੋਧ
+Name[pl]=Edycja własnych opcji w KMyFirewall
+Name[pt]='Plugin' de edição de opções personalizadas do KMyFirewall
+Name[pt_BR]=Editar Opção Personalizar KMyFirewall
+Name[sr]=KMyFirewall-ово уређивање посебних опција
+Name[sr@Latn]=KMyFirewall-ovo uređivanje posebnih opcija
+Name[sv]=Redigera egna alternativ i Min brandvägg
+Name[ta]=KMyFirewall தனிப்பயன் தேர்வை தொகு
+Name[tr]=KMyFirewall Özel seçenek düzenleyicisi
+Name[xx]=xxKMyFirewall Custom option editxx
+Comment=Plugin for editing iptables rule Custom options
+Comment[bg]=Приставка за редактиране на потребителските настройки на правилата на iptables
+Comment[ca]=Connector per editar les opcions a mida de les regles de iptables
+Comment[cs]=Modul pro editaci iptables pravidel
+Comment[da]=Plugin til at redigere selvvalgte regelvalg for iptables
+Comment[de]=Modul zum Bearbeiten eigener iptables-Regeloptionen
+Comment[el]=Πρόσθετο επεξεργασίας των προσαρμοσμένων επιλογών iptables
+Comment[es]=Complemento para editar las opciones personalizadas de reglas de iptables
+Comment[et]=Plugin IPTablesi kohandatud võtmete redigeerimiseks
+Comment[fr]=Module pour l'édition des options personnalisées des règles iptables
+Comment[gl]=Extensión para editar opzóns personalizadas de regras de iptables
+Comment[hi]=आईपी-टेबल्स नियम मनपसंद विकल्पों का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni personalizzate delle regole iptables
+Comment[ka]=iptables მორგებულ პარამეტრთა რედაქტორის მოდული
+Comment[nl]=Plugin voor het bewerken van uw eigen iptables-regels
+Comment[pl]=Wtyczka do edytowania własnych opcji w regułach iptables
+Comment[pt]='Plugin' para editar opções Personalizadas de regras iptables
+Comment[pt_BR]=Plug-in para a edição das opções de regras do iptables sob o item Personalizar
+Comment[sr]=Прикључак за уређивање iptables правила „посебне опције“
+Comment[sr@Latn]=Priključak za uređivanje iptables pravila „posebne opcije“
+Comment[sv]=Insticksprogram för att redigera egna regelalternativ för IP-tabeller
+Comment[ta]=Plugin for installing an ip அட்டவணை தொகுப்பிற்கான சொருகுபொருள் விதியின் தனிப்பயன் தேர்வு
+Comment[tr]=iptables kuralı Özel seçeneklerini düzenlemek için eklenti
+Comment[xx]=xxPlugin for editing iptables rule Custom optionsxx
+X-KDE-Library=libkmfruleoptionedit_custom
+ServiceTypes=KMyFirewall/RuleOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptioneditcustom.cpp b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptioneditcustom.cpp
new file mode 100644
index 0000000..fb7b357
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptioneditcustom.cpp
@@ -0,0 +1,130 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruleoptioneditcustom.h"
+
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kparts/genericfactory.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditcustomopt.h"
+
+namespace KMF {
+KMFRuleOptionEditCustom::KMFRuleOptionEditCustom(QObject *parent, const char *name,const QStringList& )
+ : KMFRuleOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleOptionEditCustom::KMFRuleOptionEditCustom(QObject *parent, const char *name)" << endl;
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditCustomOpt( 0 , "Edit" );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+KMFRuleOptionEditCustom::~KMFRuleOptionEditCustom() {}
+
+void KMFRuleOptionEditCustom::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleOptionEditCustom::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+const QString& KMFRuleOptionEditCustom::optionEditName() const {
+ return *( new QString( i18n("Custom Option") ) );
+}
+const QString& KMFRuleOptionEditCustom::description() const {
+ return *( new QString( i18n("This plugin manages the Custom options.") ) );
+}
+
+void KMFRuleOptionEditCustom::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleOptionEditCustom::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleOptionEditCustom::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleOptionEditCustom::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// // KInstance* KMFRuleOptionEditCustomFactory::s_instance = 0L;
+// // KAboutData* KMFRuleOptionEditCustomFactory::s_about = 0L;
+
+KMFRuleOptionEditCustomFactory::KMFRuleOptionEditCustomFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// // s_instance = new KInstance( "KMFRuleOptionEditCustomFactory" );
+}
+
+QObject* KMFRuleOptionEditCustomFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleOptionEditCustom( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// // KInstance* KMFRuleOptionEditCustomFactory::instance() {
+// // if ( !s_instance ) {
+// // s_instance = new KInstance( "KMFRuleOptionEditCustomFactory" );
+// // }
+// // return s_instance;
+// // }
+
+extern "C" {
+ void* init_libkmfruleoptionedit_custom() {
+ return new KMFRuleOptionEditCustomFactory;
+ }
+}
+
+
+}
+
+#include "kmfruleoptioneditcustom.moc"
diff --git a/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptioneditcustom.h b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptioneditcustom.h
new file mode 100644
index 0000000..c86fb43
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/custom_option/kmfruleoptioneditcustom.h
@@ -0,0 +1,93 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULEOPTIONEDITCUSTOM_H
+#define KMFRULEOPTIONEDITCUSTOM_H
+
+#include "../../core/kmfruleoptioneditinterface.h"
+
+// QT includes
+#include <qobject.h>
+#include <qptrlist.h>
+#include <qstring.h>
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+class KInstance;
+
+namespace KMF {
+class IPTRule;
+class KMFRuleEditCustomOpt;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleOptionEditCustom : public KMFRuleOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditCustom(QObject *parent = 0, const char *name = 0, const QStringList& = QString::null);
+
+ ~KMFRuleOptionEditCustom();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+ static KAboutData *createAboutData();
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditCustomOpt *m_edit;
+ IPTRule *m_rule;
+};
+
+
+
+class KMFRuleOptionEditCustomFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditCustomFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleOptionEditCustomFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/custom_option/kmyfirewallruleeditorcustomrule.ui b/kmyfirewall/ruleoptionplugins/custom_option/kmyfirewallruleeditorcustomrule.ui
new file mode 100644
index 0000000..dc447e5
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/custom_option/kmyfirewallruleeditorcustomrule.ui
@@ -0,0 +1,372 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>KMyFirewallRuleEditorCustomRule</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorCustomRule</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>491</width>
+ <height>473</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel8</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="text">
+ <string>Custom Options</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignCenter</set>
+ </property>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup3</cstring>
+ </property>
+ <property name="title">
+ <string>Rule Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_options</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Use custom options</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel14</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;Define the options for you rule here. You may use any option that your current iptbales installation supports.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>t_options</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Target</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="0" column="0">
+ <property name="name">
+ <cstring>t_target</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Target Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>t_target_options</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel13</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Target options:</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>c_target_options</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Enable target options</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel7</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Here you may define the target option for the rule. Please keep in mind that not all targets have options to set. </string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout61</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_cancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>80</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer17</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>141</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_apply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>b_cancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorCustomRule</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorCustomRule</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_apply</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorCustomRule</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>c_options</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_options</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_options</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel14</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_target_options</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel7</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_target_options</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel13</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_target_options</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_target_options</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>reject()</slot>
+ <slot>accept()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>qwidget.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/interface_option/Makefile.am b/kmyfirewall/ruleoptionplugins/interface_option/Makefile.am
new file mode 100644
index 0000000..5a7900c
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/interface_option/Makefile.am
@@ -0,0 +1,26 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruleoptionedit_interface.la
+
+libkmfruleoptionedit_interface_la_LDFLAGS = -module -no-undefined \
+ $(all_libraries) $(KDE_PLUGIN)
+libkmfruleoptionedit_interface_la_LIBADD = \
+ $(LIB_KPARTS) ../../core/libkmfcore.la
+
+noinst_HEADERS = kmfruleeditorinterface.h kmfruleoptioneditinterface.h
+
+libkmfruleoptionedit_interface_la_SOURCES = kmyfirewallruleeditorinterface.ui kmfruleeditorinterface.cpp kmfruleoptioneditinterface.cpp
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruleoptionedit_interface.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_interface_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_interface_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_interface_option.xml
+
+
+
+
diff --git a/kmyfirewall/ruleoptionplugins/interface_option/kmfruleeditorinterface.cpp b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleeditorinterface.cpp
new file mode 100644
index 0000000..9b8ee73
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleeditorinterface.cpp
@@ -0,0 +1,155 @@
+/***************************************************************************
+ begin : Tue Mar 5 2002
+ copyright : (C) 2002 by Christian Hubinger
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//MY includes
+#include "kmfruleeditorinterface.h"
+
+// QT includes
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qcheckbox.h>
+#include <qmessagebox.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+
+// KDE includes
+#include <kcombobox.h>
+#include <kurl.h>
+#include <kstandarddirs.h>
+#include <kconfig.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+// project include
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfconfig.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+#include "../../core/xmlnames.h"
+namespace KMF {
+KMFRuleEditorInterface::KMFRuleEditorInterface( QWidget *parent, const char *name, WFlags fl /*,IPTRule* cr */ ) : KMyFirewallRuleEditorInterface( parent, name, fl ) {
+}
+KMFRuleEditorInterface::~KMFRuleEditorInterface() {}
+
+void KMFRuleEditorInterface::loadRule( IPTRule * rule ) {
+ kdDebug() << "void KMFRuleEditorInterface::loadRule( IPTRule * rule )" << endl;
+ slotReadConfig();
+ c_in_int->setChecked( false );
+ c_inv_in_int->setChecked( false );
+ cb_in_int->setCurrentItem( 0 );
+ c_out_int->setChecked( false );
+ c_inv_out_int->setChecked( false );
+ cb_out_int->setCurrentItem( 0 );
+ m_rule = rule;
+
+ IPTRuleOption* opt = 0;
+ opt = m_rule->getOptionForName("interface_opt");
+ if ( opt ) {
+ QStringList vals = opt->getValues();
+ QString in = *vals.at(0);
+ QString out = *vals.at(1);
+ if ( ! in.isEmpty() && in != XML::Undefined_Value && in != XML::BoolOff_Value ) {
+ c_in_int->setChecked( true );
+ if ( in.startsWith( "! " ) ) {
+ c_inv_in_int->setChecked( true );
+ cb_in_int->setEditText( in.right( in.length() - 2 ) );
+ } else {
+ cb_in_int->setEditText( in );
+ }
+ } else {
+ c_in_int->setChecked( false );
+ }
+ if ( ! out.isEmpty() && out != XML::Undefined_Value && out != XML::BoolOff_Value ) {
+ c_out_int->setChecked( true );
+ if ( out.startsWith( "! " ) ) {
+ c_inv_out_int->setChecked( true );
+ cb_out_int->setEditText( out.right( out.length() - 2 ) );
+ } else {
+ cb_out_int->setEditText( out );
+ }
+ } else {
+ c_out_int->setChecked( false );
+ }
+
+ }
+ gb_in_int->setEnabled( true );
+ gb_out_int->setEnabled( true );
+}
+
+/** No descriptions */
+void KMFRuleEditorInterface::slotOk() {
+ // KMyFirewallRuleEditor* ed = (KMyFirewallRuleEditor*)parentWidget();
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 Interface Option").arg( m_rule->name() )
+ );
+
+ QString out = cb_out_int->currentText();
+ QString in = cb_in_int->currentText();
+ QString* option_name = new QString( "interface_opt" );
+ QPtrList<QString>* args = new QPtrList<QString>;
+
+ if ( c_in_int->isChecked() && !in.isEmpty() ) {
+ bool inv = c_inv_in_int->isChecked();
+ if ( inv ) {
+ in.prepend( "! " );
+ }
+ QString* opt = new QString( in );
+ args->append( opt );
+ }
+ if ( c_out_int->isChecked() && !out.isEmpty() ) {
+ bool inv = c_inv_out_int->isChecked();
+ if ( inv ) {
+ out.prepend( "! " );
+ }
+ QString* opt = new QString( out );
+ args->append( opt );
+ }
+
+ while ( args->count() < 2 ) {
+ args->append( new QString( XML::BoolOff_Value ) );
+ }
+
+ m_rule->addRuleOption( *option_name, *args );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+}
+
+/** No descriptions */
+void KMFRuleEditorInterface::slotCheckConfig() {}
+/** No descriptions */
+void KMFRuleEditorInterface::slotReadConfig() {
+ cb_in_int->clear();
+ cb_out_int->clear();
+ // FIXME: Use From Target
+ cb_in_int->insertStringList( KMFConfig::interfaces() );
+ cb_out_int->insertStringList( KMFConfig::interfaces() );
+}
+
+void KMFRuleEditorInterface::slotHelp() {
+ kdDebug() << "void KMFRuleEditorInterface::slotHelp()" << endl;
+ kapp->invokeHelp( "interfaces" );
+}
+void KMFRuleEditorInterface::reject() {
+ kdDebug() << "void KMFRuleEditorInterface::reject()" << endl;
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleeditorinterface.moc"
diff --git a/kmyfirewall/ruleoptionplugins/interface_option/kmfruleeditorinterface.h b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleeditorinterface.h
new file mode 100644
index 0000000..f641637
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleeditorinterface.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ begin : Tue Mar 5 2002
+ copyright : (C) 2002 by Christian Hubinger
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITORINTERFACE_H
+#define KMFRULEEDITORINTERFACE_H
+#include "kmyfirewallruleeditorinterface.h"
+
+#include <qwidget.h>
+#include <qptrlist.h>
+#include <qstring.h>
+
+
+/**Dialog for setting up interface
+dependent rule options.
+ *@author Christian Hubinger
+ */
+
+namespace KMF {
+class IPTRule;
+
+class KMFRuleEditorInterface : public KMyFirewallRuleEditorInterface {
+ Q_OBJECT
+public:
+ KMFRuleEditorInterface( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFRuleEditorInterface();
+
+ void loadRule( IPTRule* );
+
+public slots: // Public slots
+ void slotCheckConfig();
+ void slotOk();
+ void slotReadConfig();
+ void slotHelp();
+ void reject();
+
+private:
+ IPTRule* m_rule;
+
+signals:
+/* void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );*/
+ void sigHideMe();
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoption_interface_option.xml b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoption_interface_option.xml
new file mode 100644
index 0000000..ac87303
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoption_interface_option.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="interface_opt" guiName="Network Interface" >
+ <option guiName="Incoming Interface:" command="--in-interface" />
+ <option guiName="Outgoing Interface:" command="--out-interface" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset> \ No newline at end of file
diff --git a/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptionedit_interface.desktop b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptionedit_interface.desktop
new file mode 100644
index 0000000..6fe7f89
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptionedit_interface.desktop
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall Interface option edit
+Name[bg]=Редактиране на настройките на интерфейса на KMyFirewall
+Name[ca]=Edita les opcions de la interfície de KMyFirewall
+Name[da]=KMyFirewall redigering af grænsefladevalg
+Name[de]=KMyFirewall Optionen-Editor
+Name[el]=Πρόσθετο επεξεργασίας επιλογών διασύνδεσης για το KMyFirewall
+Name[es]=Editor de la opción Interface de KMyFirewall
+Name[et]=KMyFirewalli liidesevõtmete redigeerimine
+Name[fr]=Édition des options d'interface de KMyFirewall
+Name[gl]=Edizón de opzón de interface de rede de KMyFirewall
+Name[hi]=के-माइ-फायरवाल इंटरफेस विकल्प संपादन
+Name[it]=Modifica delle opzioni di interfaccia di KMyFirewall
+Name[ja]=KMyFirewall インターフェースオプション編集
+Name[ka]=KMyFirewall ინტერფეისის პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - interfaceopties bewerken
+Name[pa]=KMyFirewall ਇੰਟਰਫੇਸ ਚੋਣ ਸੋਧ
+Name[pl]=Interfejs KMyFirewall do edycji opcji
+Name[pt]=Edição da opção Interface do KMFirewall
+Name[pt_BR]=Editar Opção Interface do KMyFirewall
+Name[ru]=KMyFirewall - Интерфейс
+Name[sr]=KMyFirewall-ово уређивање опција интерфејса
+Name[sr@Latn]=KMyFirewall-ovo uređivanje opcija interfejsa
+Name[sv]=Redigera gränssnittsalternativ i Min brandvägg
+Name[ta]=KMyFirewall இடைமுக தேர்வினை தொகு
+Name[tr]=KMyFirewall Arayüz seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall Interface option editxx
+Comment=Plugin for edition Interface based iptables rule options
+Comment[bg]=Приставка за редактиране на базираните на интерфейса настройки на правилата на iptables
+Comment[ca]=Connector per editar les opcions de les regles de iptables basades en la interfície
+Comment[da]=Plugin til redigering af grænsefladebaserede regelvalg for iptables
+Comment[de]=Modul für benutzerdefinierte Iptables-Regel-Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων iptables με βάση τις διασυνδέσεις
+Comment[es]=Un complemento para las opciones de Interface de reglas de iptables
+Comment[et]=Plugin IPTablesi reegli liidesevõtmete redigeerimiseks
+Comment[fr]=Module pour l'édition des options des règles iptables basées sur les interfaces
+Comment[gl]=Extensión para edita opzóns de iptables baseadas na Interface
+Comment[hi]=इंटरफेस आधारित आईपी-टेबल्स नियम का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni di interfaccia delle regole iptables
+Comment[ka]=iptables დაფუძნებული წესების პარამეტრთა რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van interface-gebaseerde iptables-regels
+Comment[pl]=Wtyczka do edycji opcji reguł iptables w interfejsie
+Comment[pt]='Plugin' para editar opções de Interface de regras iptables
+Comment[pt_BR]=Plug-in para a interface de edição das opções de regras baseadas no iptables
+Comment[ru]=Модуль для правки правила iptables на основе интерфейсов
+Comment[sr]=Прикључак за уређивање опција iptables правила на основу интерфејса
+Comment[sr@Latn]=Priključak za uređivanje opcija iptables pravila na osnovu interfejsa
+Comment[sv]=Insticksprogram för att redigera gränssnittsbaserade regelalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி தேர்வினை சார்ந்த இடைமுக தொகுப்பின் சொருகுபொருள்
+Comment[tr]=Arayüz tabanlı iptables kuralı seçeneklerini düzenlemek için eklenti
+Comment[xx]=xxPlugin for edition Interface based iptables rule optionsxx
+X-KDE-Library=libkmfruleoptionedit_interface
+ServiceTypes=KMyFirewall/RuleOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptioneditinterface.cpp b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptioneditinterface.cpp
new file mode 100644
index 0000000..df0e3ec
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptioneditinterface.cpp
@@ -0,0 +1,120 @@
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruleoptioneditinterface.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditorinterface.h"
+
+namespace KMF {
+KMFRuleOptionEditorInterface::KMFRuleOptionEditorInterface(QObject *parent, const char *name)
+ : KMFRuleOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleOptionEditorInterface::KMFRuleOptionEditorInterface(QObject *parent, const char *name)" << endl;
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditorInterface( 0 , "Edit", 0 );
+ m_edit->hide();
+
+/* connect( m_edit,SIGNAL(sigAddRuleOpt(QString*, QPtrList< QString >* ) ),
+ this,SLOT( slotAddRuleOption(QString*, QPtrList< QString >* ) ) );
+ connect( m_edit,SIGNAL(sigAddTargetOpt(QString*, QPtrList< QString >* ) ),
+ this,SLOT( slotAddTargetOption(QString*, QPtrList< QString >* ) ) );*/
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+KMFRuleOptionEditorInterface::~KMFRuleOptionEditorInterface() {}
+
+void KMFRuleOptionEditorInterface::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleOptionEditCustom::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+const QString& KMFRuleOptionEditorInterface::optionEditName() const {
+ return *( new QString( i18n("Interface Option") ) );
+}
+const QString& KMFRuleOptionEditorInterface::description() const {
+ return *( new QString( i18n("This plugin manages the Interface based options of iptables.") ) );
+}
+
+void KMFRuleOptionEditorInterface::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleOptionEditorInterface::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleOptionEditorInterface::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleOptionEditorInterface::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleOptionEditorInterfaceFactory::s_instance = 0L;
+// KAboutData* KMFRuleOptionEditorInterfaceFactory::s_about = 0L;
+
+KMFRuleOptionEditorInterfaceFactory::KMFRuleOptionEditorInterfaceFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleOptionEditorInterfaceFactory" );
+}
+
+QObject* KMFRuleOptionEditorInterfaceFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleOptionEditorInterface( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleOptionEditorInterfaceFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleOptionEditorInterfaceFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruleoptionedit_interface() {
+ return new KMFRuleOptionEditorInterfaceFactory;
+ }
+}
+
+}
+
+
+#include "kmfruleoptioneditinterface.moc"
diff --git a/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptioneditinterface.h b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptioneditinterface.h
new file mode 100644
index 0000000..cb5bb64
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/interface_option/kmfruleoptioneditinterface.h
@@ -0,0 +1,77 @@
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULEOPTIONEDITINTERFACE_H
+#define KMFRULEOPTIONEDITINTERFACE_H
+
+#include "../../core/kmfruleoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+class KInstance;
+
+namespace KMF {
+class IPTRule;
+class KMFRuleEditorInterface;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleOptionEditorInterface : public KMFRuleOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditorInterface(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleOptionEditorInterface();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditorInterface *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleOptionEditorInterfaceFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditorInterfaceFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleOptionEditorInterfaceFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/interface_option/kmyfirewallruleeditorinterface.ui b/kmyfirewall/ruleoptionplugins/interface_option/kmyfirewallruleeditorinterface.ui
new file mode 100644
index 0000000..e99685f
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/interface_option/kmyfirewallruleeditorinterface.ui
@@ -0,0 +1,439 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorInterface</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorInterface</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>576</width>
+ <height>438</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Interface Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <family>Arial</family>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="text">
+ <string>Interface Options</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignCenter</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;ATTENTION: &lt;/b&gt;Not All options are not always allowed! The program will attempt to check your settings, but as usual options may be accepted even if the configuration is not valid. If you get error messages at firewall startup, make sure that your configuration is valid. Have a look at the help or the "iptables" man page for more details.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget5</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Incoming Interface</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>gb_in_int</cstring>
+ </property>
+ <property name="title">
+ <string>Incoming Interface</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>The incoming interface is only valid in the INPUT and FORWARD chains, and chains that are fed only by them.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="3">
+ <property name="name">
+ <cstring>c_inv_in_int</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Invert</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="2">
+ <property name="name">
+ <cstring>cb_in_int</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_in_int</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Check for incoming interface</string>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Outgoing Interface</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>gb_out_int</cstring>
+ </property>
+ <property name="title">
+ <string>Outgoing Interface</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Checking for the outgoing interface is only possible in the OUTPUT and FORWARD chains, and chains that are fed only by them.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="3">
+ <property name="name">
+ <cstring>c_inv_out_int</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Invert</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="2">
+ <property name="name">
+ <cstring>cb_out_int</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_out_int</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Check for outgoing interface</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>80</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>130</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>c_in_int</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_inv_in_int</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_out_int</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_inv_out_int</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorInterface</receiver>
+ <slot>slotOk()</slot>
+ </connection>
+ <connection>
+ <sender>c_in_int</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_in_int</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_out_int</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_out_int</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorInterface</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>kPushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorInterface</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>slotOk()</slot>
+ <slot>slotReadConfig()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/ip_option/Makefile.am b/kmyfirewall/ruleoptionplugins/ip_option/Makefile.am
new file mode 100644
index 0000000..4a84c9d
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/ip_option/Makefile.am
@@ -0,0 +1,24 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruleoptionedit_ip.la
+
+libkmfruleoptionedit_ip_la_LDFLAGS = -module -no-undefined $(all_libraries) \
+ $(KDE_PLUGIN)
+libkmfruleoptionedit_ip_la_LIBADD = \
+ ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruleoptioneditip.h kmfruleeditip.h
+
+libkmfruleoptionedit_ip_la_SOURCES = kmfruleoptioneditip.cpp kmfruleeditip.cpp kmyfirewallruleeditorip.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruleoptionedit_ip.desktop
+
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_ip_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_ip_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_ip_option.xml
+
+
diff --git a/kmyfirewall/ruleoptionplugins/ip_option/kmfruleeditip.cpp b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleeditip.cpp
new file mode 100644
index 0000000..ae19d92
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleeditip.cpp
@@ -0,0 +1,196 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+#include "kmfruleeditip.h"
+// qt includes
+#include <qcheckbox.h>
+#include <qframe.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <kapplication.h>
+#include <klocale.h>
+
+// project includes
+#include "../../core/xmlnames.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmfcheckinput.h"
+#include "../../core/kmferrorhandler.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+
+namespace KMF {
+/*
+ * Constructs a KMFRuleEditIP which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+KMFRuleEditIP::KMFRuleEditIP( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallRuleEditorIP ( parent, name, fl ) {
+ m_CheckInput = new KMFCheckInput();
+ m_ErrorHandler = new KMFErrorHandler( "KMFRuleEditIP" );
+ m_err = new KMFError();
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+KMFRuleEditIP::~KMFRuleEditIP() {
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * Main event handler. Reimplemented to handle application
+ * font changes
+ */
+bool KMFRuleEditIP::event( QEvent* ev ) {
+ bool ret = QWidget::event( ev );
+ if ( ev->type() == QEvent::ApplicationFontChange ) {}
+ return ret;
+}
+
+void KMFRuleEditIP::loadRule( IPTRule * rule ) {
+ kdDebug() << "void KMFRuleEditIP::loadRule( IPTRule * rule )" << endl;
+ c_src_ip->setChecked( false );
+ c_dest_ip->setChecked( false );
+ c_inv_src_ip->setChecked( false );
+ c_inv_dest_ip->setChecked( false );
+ t_src_ip->setText( "" );
+ t_dest_ip->clear();
+ m_rule = rule;
+
+ IPTRuleOption* opt = 0;
+ opt = m_rule->getOptionForName("ip_opt");
+ if ( opt ) {
+ QStringList args = opt->getValues();
+ QString src, dest;
+ src = *args.at(0);
+ dest = *args.at(1);
+
+ if ( !src.isEmpty() && src != XML::Undefined_Value && src != XML::BoolOff_Value) {
+ c_src_ip->setChecked( true );
+ if ( src.startsWith( "! " ) ) {
+ c_inv_src_ip->setChecked( true );
+ t_src_ip->setText( src.right( src.length() - 2 ) );
+ } else {
+ t_src_ip->setText( src );
+ }
+ }
+ if ( !dest.isEmpty() && dest != XML::Undefined_Value && dest != XML::BoolOff_Value ) {
+ c_dest_ip->setChecked( true );
+ if ( dest.startsWith( "! " ) ) {
+ c_inv_dest_ip->setChecked( true );
+ t_dest_ip->setText( dest.right( dest.length() - 2 ) );
+ } else {
+ t_dest_ip->setText( dest );
+ }
+ }
+
+ }
+ return ;
+}
+
+
+void KMFRuleEditIP::accept() {
+ kdDebug() << "KMFRuleEditIP::slotOk()" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 IP Option").arg( m_rule->name() )
+ );
+ QString* src_ip = new QString( t_src_ip->text() );
+ QString* dest_ip = new QString( t_dest_ip->text() );
+
+ bool en_c_src_ip = c_src_ip->isChecked();
+ bool en_c_dest_ip = c_dest_ip->isChecked();
+ bool is_inv_src_ip = c_inv_src_ip->isChecked();
+ bool is_inv_dest_ip = c_inv_dest_ip->isChecked();
+
+ QString* option_name = new QString( "ip_opt" );
+ QPtrList<QString>* args = new QPtrList<QString>;
+ QPtrList<QString>* empty_args = new QPtrList<QString>;
+ empty_args->append( new QString(XML::BoolOff_Value) );
+ empty_args->append( new QString(XML::BoolOff_Value) );
+ m_rule->addRuleOption( *option_name, *empty_args );
+ // emit sigAddRuleOpt( option_name, empty_args );
+
+ if ( en_c_src_ip && !src_ip->isEmpty() ) {
+ QString cmd = *src_ip;
+ // Sanity checks +++++++++++++++++
+ m_CheckInput->checkInput( cmd, "IP/NETWORK/FQHN", m_err );
+ if ( !m_ErrorHandler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ // ++++++++++++++++++++++++++++++++
+
+ if ( is_inv_src_ip ) {
+ src_ip->prepend( "! " );
+ }
+ args->append( src_ip );
+ } else {
+ args->append( new QString(XML::BoolOff_Value) );
+ }
+
+ if ( en_c_dest_ip && !dest_ip->isEmpty() ) {
+ kdDebug() << "Add new dest_ip option" << endl;
+ QString cmd = *dest_ip;
+ // Sanity checks +++++++++++++++++
+ m_CheckInput->checkInput( cmd, "IP/NETWORK/FQHN", m_err );
+ if ( !m_ErrorHandler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ // ++++++++++++++++++++++++++++++++
+ if ( is_inv_dest_ip ) {
+ dest_ip->prepend( "! " );
+ }
+ args->append( dest_ip );
+ } else {
+ args->append( new QString(XML::BoolOff_Value) );
+ }
+
+ m_rule->addRuleOption( *option_name, *args );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+}
+
+void KMFRuleEditIP::reject() {
+ kdDebug() << "void KMFRuleEditIP::reject()" << endl;
+ emit sigHideMe();
+}
+
+void KMFRuleEditIP::slotHelp() {
+ kdDebug() << "void KMFRuleEditIP::slotHelp()" << endl;
+ kapp->invokeHelp( "src_dest_ip" );
+}
+
+
+}
+
+
+#include "kmfruleeditip.moc"
diff --git a/kmyfirewall/ruleoptionplugins/ip_option/kmfruleeditip.h b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleeditip.h
new file mode 100644
index 0000000..a2131d5
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleeditip.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+#ifndef KMFRULEEDITIP_H
+#define KMFRULEEDITIP_H
+
+#include "kmyfirewallruleeditorip.h"
+
+// QT includes
+#include <qvariant.h>
+#include <qdialog.h>
+#include <qptrlist.h>
+
+namespace KMF {
+class IPTRule;
+class KMFErrorHandler;
+class KMFCheckInput;
+class KMFError;
+class KMFRuleEditIP : public KMyFirewallRuleEditorIP /*, virtual public KMFRuleOptionEditInterface */{
+ Q_OBJECT
+
+public:
+ KMFRuleEditIP( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFRuleEditIP();
+
+// QPtrList<QString>* options;
+
+ void loadRule( IPTRule * );
+public slots:
+ void accept();
+ void reject();
+ void slotHelp();
+
+protected:
+ QVBoxLayout* KMyFirewallRuleEditorIPLayout;
+ QGridLayout* Layout85;
+ QGridLayout* GroupBox16Layout;
+ QHBoxLayout* Layout50;
+ bool event( QEvent* );
+
+private:
+ KMFCheckInput *m_CheckInput;
+ KMFErrorHandler *m_ErrorHandler;
+ IPTRule* m_rule;
+ KMFError *m_err;
+
+signals:
+/* void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigDelRuleOpt( QString * );*/
+ void sigDocumentChanged();
+ void sigHideMe();
+// void sigAddUndo();
+};
+}
+
+
+
+
+
+
+#endif // KMFRULEEDITIP_H
diff --git a/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoption_ip_option.xml b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoption_ip_option.xml
new file mode 100644
index 0000000..dffbd6b
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoption_ip_option.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="ip_opt" guiName="IP Address">
+ <option guiName="Src. IP:" command="--source" />
+ <option guiName="Dst. IP:" command="--destination" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptionedit_ip.desktop b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptionedit_ip.desktop
new file mode 100644
index 0000000..c801e81
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptionedit_ip.desktop
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall IP option edit
+Name[bg]=Редактиране на IP-настройките на KMyFirewall
+Name[ca]=Edita les opcions IP de KMyFirewall
+Name[da]=KMyFirewall IP redigeringsvalg
+Name[de]=KMyFirewall IP-Optionen-Editor
+Name[el]=Πρόσθετο επεξεργασίας επιλογών IP για το KMyFirewall
+Name[es]=Editor de la opción IP de KMyFirewall
+Name[et]=KMyFirewalli IP võtmete redigeerimine
+Name[fr]=Édition des options IP de KMyFirewall
+Name[gl]=Edizón de opzóns de IP de KMyFirewall
+Name[hi]=के-माइ-फायरवाल आईपी विकल्प संपादन
+Name[it]=Modifica opzioni IP di KMyFirewall
+Name[ja]=KMyFirewall IP オプション編集
+Name[ka]=KMyFirewall IP პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - IP-optie bewerken
+Name[pa]=KMyFirewall IP ਚੋਣ ਸੋਧ
+Name[pl]=Edycja opcji IP KMyFirewall
+Name[pt]=Edição da opção IP do KMFirewall
+Name[pt_BR]=Editar Opções de IP do KMyFirewall
+Name[ru]=KMyFirewall - IP
+Name[sr]=KMFirewall-ово уређивање IP опција
+Name[sr@Latn]=KMFirewall-ovo uređivanje IP opcija
+Name[sv]=Redigera IP-alternativ i Min brandvägg
+Name[ta]=KMyFirewall IP தேர்வினை தொகு
+Name[tr]=KMyFirewall IP seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall IP option editxx
+Comment=Plugin for edition IP based iptables rule options
+Comment[bg]=Приставка за редактиране на IP-базираните настройки на правилата на iptables
+Comment[ca]=Connector per editar les opcions de les regles de iptables basades en IP
+Comment[da]=Plugin til redigering af IP baserede regelvalg for iptables
+Comment[de]=Modul für benutzerdefinierte IP-Regel-Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων iptables με βάση το IP
+Comment[es]=Un complemento para la edición de opciones de reglas de iptables basadas en IP
+Comment[et]=Plugin IPTablesi reegli IP võtmete redigeerimiseks
+Comment[fr]=Module pour l'édition des options des règles iptables basées sur les adresses IP
+Comment[gl]=Extensión para a edizón de regras de iptables baseadas na IP
+Comment[hi]=आईपी आधारित आईपी-टेबल्स नियम का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni IP basate su iptables
+Comment[ka]=IP-ზე დაფუძნებული iptables წესების პარამეტრების რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van IP-gebaseerde iptables-regels
+Comment[pl]=Wtyczka do edycji opcji reguł iptables opartych na IP
+Comment[pt]='Plugin' para editar opções de IP de regras iptables
+Comment[pt_BR]=Plug-in para a edição das opções de regras de IP baseadas no iptables
+Comment[ru]=Модуль для правки правила iptables на основе IP
+Comment[sr]=Прикључак за опција iptables правила на основу IP-а
+Comment[sr@Latn]=Priključak za opcija iptables pravila na osnovu IP-a
+Comment[sv]=Insticksprogram för att redigera IP-baserade regelalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி தேர்வினை சார்ந்த IP தொகுப்பின் சொருகுபொருள்
+Comment[tr]=IP tabanlı iptables kuralı seçeneklerini düzenlemek için eklenti
+Comment[xx]=xxPlugin for edition IP based iptables rule optionsxx
+X-KDE-Library=libkmfruleoptionedit_ip
+ServiceTypes=KMyFirewall/RuleOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptioneditip.cpp b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptioneditip.cpp
new file mode 100644
index 0000000..3c32fc4
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptioneditip.cpp
@@ -0,0 +1,128 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruleoptioneditip.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditip.h"
+
+namespace KMF {
+KMFRuleOptionEditIP::KMFRuleOptionEditIP(QObject *parent, const char *name)
+ : KMFRuleOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleOptionEditIP::KMFRuleOptionEditIP(QObject *parent, const char *name)" << endl;
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditIP( 0 , "Edit", 0 );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+KMFRuleOptionEditIP::~KMFRuleOptionEditIP() {}
+
+void KMFRuleOptionEditIP::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleOptionEditCustom::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+const QString& KMFRuleOptionEditIP::optionEditName() const {
+ return *( new QString( i18n("IP Option") ) );
+}
+const QString& KMFRuleOptionEditIP::description() const {
+ return *( new QString( i18n("This plugin manages the IP based options of iptables.") ) );
+}
+
+void KMFRuleOptionEditIP::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleOptionEditIP::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleOptionEditIP::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleOptionEditIP::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleOptionEditIPFactory::s_instance = 0L;
+// KAboutData* KMFRuleOptionEditIPFactory::s_about = 0L;
+
+KMFRuleOptionEditIPFactory::KMFRuleOptionEditIPFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleOptionEditIPFactory" );
+}
+
+QObject* KMFRuleOptionEditIPFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleOptionEditIP( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleOptionEditIPFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleOptionEditIPFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruleoptionedit_ip() {
+ return new KMFRuleOptionEditIPFactory;
+ }
+}
+
+}
+
+
+#include "kmfruleoptioneditip.moc"
diff --git a/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptioneditip.h b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptioneditip.h
new file mode 100644
index 0000000..67cd6f1
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/ip_option/kmfruleoptioneditip.h
@@ -0,0 +1,87 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULEOPTIONEDITIP_H
+#define KMFRULEOPTIONEDITIP_H
+
+#include "../../core/kmfruleoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+class KInstance;
+namespace KMF {
+class IPTRule;
+class KMFRuleEditIP;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleOptionEditIP : public KMFRuleOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditIP(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleOptionEditIP();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditIP *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleOptionEditIPFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditIPFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleOptionEditIPFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+
+}
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/ip_option/kmyfirewallruleeditorip.ui b/kmyfirewall/ruleoptionplugins/ip_option/kmyfirewallruleeditorip.ui
new file mode 100644
index 0000000..1b82fea
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/ip_option/kmyfirewallruleeditorip.ui
@@ -0,0 +1,303 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorIP</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorIP</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>427</width>
+ <height>230</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>IP Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <family>Arial</family>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="text">
+ <string>IP Options</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignCenter</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout10</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>NOTE: By checking the "Invert" checkbox the rule will only match if the specified address is not one of the values you defined.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="2">
+ <property name="name">
+ <cstring>c_inv_dest_ip</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Invert</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>t_src_ip</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>t_dest_ip</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="2">
+ <property name="name">
+ <cstring>c_inv_src_ip</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Invert</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_src_ip</cstring>
+ </property>
+ <property name="text">
+ <string>Source IP/network:</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_dest_ip</cstring>
+ </property>
+ <property name="text">
+ <string>Destination IP/network:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>60</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer5_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>100</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>c_src_ip</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_src_ip</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_src_ip</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_inv_src_ip</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_dest_ip</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_dest_ip</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_dest_ip</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_inv_dest_ip</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorIP</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorIP</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>kPushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorIP</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/kmfruleoptionedit.desktop b/kmyfirewall/ruleoptionplugins/kmfruleoptionedit.desktop
new file mode 100644
index 0000000..394d850
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/kmfruleoptionedit.desktop
@@ -0,0 +1,28 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=ServiceType
+X-KDE-ServiceType=KMyFirewall/RuleOptionEdit
+Name=KMyFirewall RuleOption Edit Service Type
+Name[bg]=Редактиране на настройките на правилата за типа на услуга на KMyFirewall
+Name[ca]=Editor de les opcions de la regla Tipus de servei de KMyFirewall
+Name[da]=KMyFirewall regelvalg redigeringstjenestetype
+Name[de]=KMyFirewall Regeloptionen Diensttyp-Editor
+Name[el]=Επεξεργασία επιλογών κανόνων τύπου υπηρεσίας για το KMyFirewall
+Name[es]=Tipo de servicio de edición de RuleOption de KMyFirewall
+Name[et]=KMyFirewalli reeglivõtme redigeerimise teenuse tüüp
+Name[fr]=Type de service d'édition des options de règles pour KMyFirewall
+Name[gl]=Edizón da opzón de tipo de servizos das regras de KMyFirewall
+Name[hi]=के-माई-फ़ायरवाल रूल-विकल्प संपादन सेवा क़िस्म
+Name[it]=Tipo di servizio di modifica delle opzioni delle regole di KMyFirewall
+Name[ka]=KMyFirewall RuleOption რედაქტირების სერვისის ტიპი
+Name[nl]=KMyFirewall-servicetype "Regeloptie bewerken"
+Name[pa]=KMyFirewall RuleOption ਸੋਧ ਸੇਵਾ ਕਿਸਮ
+Name[pt]=Tipo de Serviço de Edição de Opções de Regra do KMyFirewall
+Name[pt_BR]=Edição do Tipo de Serviço RuleOption do KMyFirewall
+Name[sr]=KMyFirewall-ов тип сервиса за уређивање опција правила
+Name[sr@Latn]=KMyFirewall-ov tip servisa za uređivanje opcija pravila
+Name[sv]=Redigera tjänsttyp för regelalternativ i Min brandvägg
+Name[ta]=KMyதீச்சுவர் விதிதேர்வின் சேவை வகையை தொகு
+Name[tr]=KMyFirewall Kural Seçenekleri Düzenleme Servis Tipi
+Name[xx]=xxKMyFirewall RuleOption Edit Service Typexx
+
diff --git a/kmyfirewall/ruleoptionplugins/kmfruletargetoptionedit.desktop b/kmyfirewall/ruleoptionplugins/kmfruletargetoptionedit.desktop
new file mode 100644
index 0000000..a5e1331
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/kmfruletargetoptionedit.desktop
@@ -0,0 +1,28 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=ServiceType
+X-KDE-ServiceType=KMyFirewall/RuleTargetOptionEdit
+Name=KMyFirewall RuleTargetOption Edit Service Type
+Name[bg]=Редактиране на настройките на правилата за типа на услуга на KMyFirewall
+Name[ca]=Editor de les opcions de la regla de destí Tipus de servei de KMyFirewall
+Name[da]=KMyFirewall regelmålvalg redigeringstjenestetype
+Name[de]=KMyFirewall Regelzieloptionen Diensttyp-Editor
+Name[el]=Επεξεργασία κανόνων προορισμού τύπου υπηρεσίας για το KMyFirewall
+Name[es]=Tipo de servicio de edición de RuleTargetOption de KMyFirewall
+Name[et]=KMyFirewalli reegli sihtmärgi võtme redigeerimise teenuse tüüp
+Name[fr]=Type de service d'édition des options de cibles des règles pour KMyFirewall
+Name[gl]=Edizón do tipo de servizo da opzón obxectivo das regras KMyFirewall
+Name[hi]=के-माई-फ़ायरवाल रूल-टार्गेट-विकल्प संपादन सेवा क़िस्म
+Name[it]=Tipo di servizio di modifica delle opzioni degli obiettivi delle regole di KMyFirewall
+Name[ka]=KMyFirewall RuleTargetOption რედაქტირების სერვისის ტიპი
+Name[nl]=KMyFirewall-servicetype "Regeldoeloptie bewerken"
+Name[pa]=KMyFirewall RuleTargetOption ਸੋਧ ਸੇਵਾ ਕਿਸਮ
+Name[pt]=Tipo de Serviço de Edição de Opções de Regra Alvo do KMyFirewall
+Name[pt_BR]=Edição do Tipo de Serviço RuleTargetOption do KMyFirewall
+Name[sr]=KMyFirewall-ов тип сервиса за уређивање опција циљева правила
+Name[sr@Latn]=KMyFirewall-ov tip servisa za uređivanje opcija ciljeva pravila
+Name[sv]=Redigera tjänsttyp för regelmålalternativ i Min brandvägg
+Name[ta]=KMyதீச்சுவர் விதிமூல தேர்வின் சேவை வகையை தொகு
+Name[tr]=KMyFirewall Kural Hedef Seçenekleri Düzenleme Servis Tipi
+Name[xx]=xxKMyFirewall RuleTargetOption Edit Service Typexx
+
diff --git a/kmyfirewall/ruleoptionplugins/limit_option/Makefile.am b/kmyfirewall/ruleoptionplugins/limit_option/Makefile.am
new file mode 100644
index 0000000..43a5e59
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/limit_option/Makefile.am
@@ -0,0 +1,23 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruleoptionedit_limit.la
+
+libkmfruleoptionedit_limit_la_LDFLAGS = -module -no-undefined $(all_libraries) \
+ $(KDE_PLUGIN)
+libkmfruleoptionedit_limit_la_LIBADD = \
+ ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruleoptioneditlimit.h kmfruleeditorlimit.h
+
+libkmfruleoptionedit_limit_la_SOURCES = kmfruleoptioneditlimit.cpp kmfruleeditorlimit.cpp kmyfirewallruleeditorlimit.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruleoptionedit_limit.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_limit_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_limit_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_limit_option.xml
+
+
diff --git a/kmyfirewall/ruleoptionplugins/limit_option/kmfruleeditorlimit.cpp b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleeditorlimit.cpp
new file mode 100644
index 0000000..217e191
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleeditorlimit.cpp
@@ -0,0 +1,144 @@
+/***************************************************************************
+ begin : Wed Mar 13 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfruleeditorlimit.h"
+
+// qt includes
+#include <qstring.h>
+#include <qptrlist.h>
+#include <qspinbox.h>
+#include <qcombobox.h>
+#include <qcheckbox.h>
+
+// kde includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+
+// Project includes
+#include "../../core/iptruleoption.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+#include "../../core/xmlnames.h"
+namespace KMF {
+KMFRuleEditorLimit::KMFRuleEditorLimit( QWidget *parent, const char *name, WFlags fl /*,IPTRule* cr*/ ) : KMyFirewallRuleEditorLimit( parent, name, fl ) {}
+KMFRuleEditorLimit::~KMFRuleEditorLimit() {}
+void KMFRuleEditorLimit::loadRule( IPTRule * rule ) {
+ kdDebug() << "void KMFRuleEditorLimit::loadRule( IPTRule * rule )" << endl;
+ m_rule = rule;
+ c_use_limit->setChecked( false );
+ c_limit->setChecked( false );
+ sb_limit->setValue( 5 );
+ cb_interval->setCurrentItem( 0 );
+ c_burst->setChecked( false );
+ readRuleConfig();
+}
+
+void KMFRuleEditorLimit::readRuleConfig() {
+
+ IPTRuleOption *opt = 0;
+ opt = m_rule->getOptionForName("limit_opt");
+ if (opt) {
+ QStringList vals = opt->getValues();
+ QString limit = "";
+ QString burst = "";
+ limit = *vals.at(1);
+ burst = *vals.at(2);
+ if ( limit != XML::Undefined_Value ) {
+ c_use_limit->setChecked( true );
+ c_limit->setChecked( true );
+ int i = limit.find( "/" );
+ QString str_rate = limit.left( i );
+ kdDebug() << "Found Rate: " << str_rate << endl;
+ int rate = str_rate.toInt();
+ sb_limit->setValue( rate );
+ QString interval = limit.right( limit.length() - i - 1 );
+ kdDebug() << "Found Limit: " << str_rate << "/" << interval << endl;
+ //cb_interval->setEnabled(true);
+ if ( interval == "second" )
+ cb_interval->setCurrentItem( 0 );
+ if ( interval == "minute" )
+ cb_interval->setCurrentItem( 1 );
+ if ( interval == "hour" )
+ cb_interval->setCurrentItem( 2 );
+ }
+ if ( burst != XML::Undefined_Value ) {
+ c_burst->setChecked( true );
+ kdDebug() << "Found Burst: " << burst << endl;
+ int rate = burst.toInt();
+ sb_burst->setValue( rate );
+ }
+ }
+}
+
+void KMFRuleEditorLimit::slotOk() {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 Limit Option").arg( m_rule->name() )
+ );
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "limit_opt" );
+ if ( c_use_limit->isChecked() ) {
+ QString* opt = new QString( "" );
+ if ( !c_limit->isChecked() && !c_burst->isChecked() ) {
+ KMessageBox::sorry( this, i18n( "You cannot enable a limit without at least the rate." ), i18n( "Limit Matches" ) );
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ if ( c_limit->isChecked() ) {
+ QString str_rate = sb_limit->text();
+ QString interval = cb_interval->currentText();
+ opt->append( str_rate );
+ opt->append( "/" );
+ opt->append( interval );
+ options->append( new QString( XML::BoolOn_Value ) );
+ options->append( opt );
+ if ( c_burst->isChecked() ) {
+ str_rate = sb_burst->text();
+ QString* burst_rate = new QString( str_rate );
+ options->append( burst_rate );
+ } else {
+ options->append( new QString( XML::BoolOff_Value ) );
+ options->append( new QString( XML::BoolOff_Value ) );
+ }
+ } else {
+ options->append( new QString( XML::BoolOff_Value ) );
+ options->append( new QString( XML::BoolOff_Value ) );
+ }
+ }
+ m_rule->addRuleOption( *name, *options );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+}
+
+void KMFRuleEditorLimit::slotHelp() {
+ kdDebug() << "void KMFRuleEditorLimit::slotHelp()" << endl;
+ kapp->invokeHelp( "limit" );
+}
+
+void KMFRuleEditorLimit::reject() {
+ kdDebug() << "void KMFRuleEditorLimit::reject()" << endl;
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleeditorlimit.moc"
diff --git a/kmyfirewall/ruleoptionplugins/limit_option/kmfruleeditorlimit.h b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleeditorlimit.h
new file mode 100644
index 0000000..27977bb
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleeditorlimit.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ begin : Wed Mar 13 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITORLIMIT_H
+#define KMFRULEEDITORLIMIT_H
+#include "kmyfirewallruleeditorlimit.h"
+
+#include <qwidget.h>
+
+/**
+ *@author Christian Hubinger
+ */
+ namespace KMF {
+class IPTRule;
+
+class KMFRuleEditorLimit : public KMyFirewallRuleEditorLimit {
+ Q_OBJECT
+public:
+ KMFRuleEditorLimit( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFRuleEditorLimit();
+
+ void loadRule( IPTRule* );
+
+public slots: // Public slots
+ void slotOk();
+ void readRuleConfig();
+ void slotHelp();
+ void reject();
+
+private:
+ IPTRule* m_rule;
+
+signals:
+/* void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );*/
+ void sigHideMe();
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoption_limit_option.xml b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoption_limit_option.xml
new file mode 100644
index 0000000..c7720da
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoption_limit_option.xml
@@ -0,0 +1,8 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="limit_opt" guiName="Limit Matches">
+ <option guiName="" command="--match limit" />
+ <option guiName="Limit Matches To:" command="--limit" />
+ <option guiName="Set Burst:" command="--limit-burst " />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptionedit_limit.desktop b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptionedit_limit.desktop
new file mode 100644
index 0000000..bc83bbe
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptionedit_limit.desktop
@@ -0,0 +1,55 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall Limit option edit
+Name[bg]=Редактиране на настройките за ограничения на KMyFirewall
+Name[ca]=Editor de les opcions Limit de KMyFirewall
+Name[da]=KMyFirewall redigering af grænsevalg
+Name[de]=KMyFirewall Limit-Option-Editor
+Name[el]=Επεξεργασία επιλογής ορίου για το KMyFirewall
+Name[es]=Editor de opciones Limit de KMyFirewall
+Name[et]=KMyFirewalli limiidivõtmete redigeerimine
+Name[fr]=Édition des options de limites de KMyFirewall
+Name[gl]=Edizón de opzóns de Límite de KMyFirewall
+Name[hi]=के-माइ-फायरवाल सीमा विकल्प संपादन
+Name[it]=Modifica delle opzioni limite di KMyFirewall
+Name[ka]=KMyFirewall შეზღუდვების პარამეტრების რედაქტორი
+Name[nl]=KMyFirewall - Limietoptie bewerken
+Name[pa]=KMyFirewall Limit ਚੋਣ ਸੋਧ
+Name[pt]=Edição da opção Limite do KMFirewall
+Name[pt_BR]=Edição da Opção do Tipo de Serviço Limit do KMyFirewall
+Name[ru]=KMyFirewall - Лимит
+Name[sr]=KMyFirewall-ово уређивање опција ограничења
+Name[sr@Latn]=KMyFirewall-ovo uređivanje opcija ograničenja
+Name[sv]=Redigera gränssalternativ i Min brandvägg
+Name[ta]=KMyFirewall அளவு தேர்வினை தொகு
+Name[tr]=KMyFirewall Sınır seçeneği düzenleyici
+Name[xx]=xxKMyFirewall Limit option editxx
+Comment=Plugin for editing iptables rule Limit options
+Comment[bg]=Приставка за редактиране на настройките на правилата на iptables за ограничения
+Comment[ca]=Connector per editar les opcions Limit de les regles de iptables
+Comment[da]=Plugin til at redigere regelgrænsetilvalg for iptables
+Comment[de]=Modul für benutzerdefinierte Regel-Limit-Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων ορίου iptables
+Comment[es]=Un complemento para editar las opciones de las reglas Limit en iptables
+Comment[et]=Plugin IPTablesi reegli limiidivõtmete redigeerimiseks
+Comment[fr]=Module de modification des options de limites des règles d'IPTables
+Comment[gl]=Extensión para a edizón da opzón de Límite nas regras de iptables
+Comment[hi]=आईपी-टेबल्स नियम सीमा विकल्पों का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni delle regole iptables di limite
+Comment[ka]=iptables წესთა შეზღუდვების რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van iptables regellimiet-opties
+Comment[pa]=Plugin for editing iptables rule Limit ਚੋਣ
+Comment[pt]='Plugin' para editar opções de Limite de regras iptables
+Comment[pt_BR]=Plug-in para a edição de regras do iptables para opções Limit
+Comment[ru]=Модуль для правки правила iptables "Limit"
+Comment[sr]=Прикључак за уређивање iptables правила „опције ограничења“
+Comment[sr@Latn]=Priključak za uređivanje iptables pravila „opcije ograničenja“
+Comment[sv]=Insticksprogram för att redigera regelgränsalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி அளவு தேர்வு தொகுப்பின் சொருகுபொருள்
+Comment[tr]=iptables kuralı sınır seçeneğini düzenlemek için eklenti
+Comment[xx]=xxPlugin for editing iptables rule Limit optionsxx
+X-KDE-Library=libkmfruleoptionedit_limit
+ServiceTypes=KMyFirewall/RuleOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptioneditlimit.cpp b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptioneditlimit.cpp
new file mode 100644
index 0000000..5424591
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptioneditlimit.cpp
@@ -0,0 +1,130 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruleoptioneditlimit.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditorlimit.h"
+
+namespace KMF {
+KMFRuleOptionEditLimit::KMFRuleOptionEditLimit(QObject *parent, const char *name)
+ : KMFRuleOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleOptionEditLimit::KMFRuleOptionEditLimit(QObject *parent, const char *name)" << endl;
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditorLimit( 0 , "Edit", 0 );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+KMFRuleOptionEditLimit::~KMFRuleOptionEditLimit() {}
+
+
+void KMFRuleOptionEditLimit::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleOptionEditCustom::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+const QString& KMFRuleOptionEditLimit::optionEditName() const {
+ return *( new QString( i18n("Limit Option") ) );
+}
+
+const QString& KMFRuleOptionEditLimit::description() const {
+ return *( new QString( i18n("This plugin manages the Limit options of iptables.") ) );
+}
+
+void KMFRuleOptionEditLimit::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleOptionEditLimit::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleOptionEditLimit::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleOptionEditLimit::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleOptionEditLimitFactory::s_instance = 0L;
+// KAboutData* KMFRuleOptionEditLimitFactory::s_about = 0L;
+
+KMFRuleOptionEditLimitFactory::KMFRuleOptionEditLimitFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleOptionEditLimitFactory" );
+}
+
+QObject* KMFRuleOptionEditLimitFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleOptionEditLimit( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleOptionEditLimitFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleOptionEditLimitFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruleoptionedit_limit() {
+ return new KMFRuleOptionEditLimitFactory;
+ }
+}
+
+
+}
+
+#include "kmfruleoptioneditlimit.moc"
diff --git a/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptioneditlimit.h b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptioneditlimit.h
new file mode 100644
index 0000000..037df8a
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/limit_option/kmfruleoptioneditlimit.h
@@ -0,0 +1,87 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULEOPTIONEDITLIMIT_H
+#define KMFRULEOPTIONEDITLIMIT_H
+
+#include "../../core/kmfruleoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+class KInstance;
+namespace KMF {
+class IPTRule;
+class KMFRuleEditorLimit;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleOptionEditLimit : public KMFRuleOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditLimit(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleOptionEditLimit();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditorLimit *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleOptionEditLimitFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditLimitFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleOptionEditLimitFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/limit_option/kmyfirewallruleeditorlimit.ui b/kmyfirewall/ruleoptionplugins/limit_option/kmyfirewallruleeditorlimit.ui
new file mode 100644
index 0000000..71a971b
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/limit_option/kmyfirewallruleeditorlimit.ui
@@ -0,0 +1,443 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>KMyFirewallRuleEditorLimit</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorLimit</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>387</width>
+ <height>238</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Limit Matches</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <family>Arial</family>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="text">
+ <string>Limit Options</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignCenter</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>gb_conntrack</cstring>
+ </property>
+ <property name="title">
+ <string>Configure Limit </string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout17</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_use_limit</cstring>
+ </property>
+ <property name="text">
+ <string>Limit packet matching</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout26</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_limit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Set limit rate:</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer60</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>sb_limit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel7</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>/</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>second</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>minute</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>hour</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>cb_interval</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="editable">
+ <bool>false</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout27</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_burst</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Set burst limit:</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer61</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>sb_burst</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>5</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer15</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>60</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>60</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorLimit</receiver>
+ <slot>slotOk()</slot>
+ </connection>
+ <connection>
+ <sender>c_use_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_limit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_burst</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_limit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_limit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_interval</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_burst</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_burst</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorLimit</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>kPushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorLimit</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>slotOk()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>qwidget.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/log_target_option/Makefile.am b/kmyfirewall/ruleoptionplugins/log_target_option/Makefile.am
new file mode 100644
index 0000000..c407197
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/log_target_option/Makefile.am
@@ -0,0 +1,21 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruletargetoptionedit_log.la
+
+libkmfruletargetoptionedit_log_la_LDFLAGS = -module -no-undefined \
+ $(all_libraries) $(KDE_PLUGIN)
+libkmfruletargetoptionedit_log_la_LIBADD = \
+ ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruletargetoptioneditlog.h kmfruleedittargetlog.h
+
+libkmfruletargetoptionedit_log_la_SOURCES = kmfruletargetoptioneditlog.cpp kmfruleedittargetlog.cpp kmyfirewallruleeditortargetlog.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruletargetoptionedit_log.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_target_log_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_target_log_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_target_log_option.xml
diff --git a/kmyfirewall/ruleoptionplugins/log_target_option/kmfruleedittargetlog.cpp b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruleedittargetlog.cpp
new file mode 100644
index 0000000..3463562
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruleedittargetlog.cpp
@@ -0,0 +1,164 @@
+/***************************************************************************
+ begin : Wed May 22 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfruleedittargetlog.h"
+
+// QT includes
+#include <qstring.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qlineedit.h>
+
+// kde includes
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+// MY includes
+#include "../../core/xmlnames.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+namespace KMF {
+KMFRuleEditTargetLog::KMFRuleEditTargetLog( QWidget *parent, const char *name, WFlags fl ) : KMyFirewallRuleEditorTargetLog( parent, name, fl ) {}
+KMFRuleEditTargetLog::~KMFRuleEditTargetLog() {}
+
+void KMFRuleEditTargetLog::loadRule( IPTRule* rule ) {
+ kdDebug() << "void KMFRuleEditTargetLog::loadRule( IPTRule* rule )" << endl;
+ c_log_tcp_seq->setChecked( false );
+ c_log_tcp_options-> setChecked( false );
+ c_log_ip_options->setChecked( false );
+ c_log_prefix-> setChecked( false );
+ c_log_level ->setChecked( false );
+ cb_log_level->setCurrentItem( 0 );
+ t_log_prefix->clear();
+ m_rule = rule;
+ IPTRuleOption *opt = 0;
+ opt = m_rule->getOptionForName("target_log_opt");
+ if (opt) {
+ QStringList vals = opt->getValues();
+ QString prefix = "";
+ QString level = "";
+ QString tcp_seq = "";
+ QString tcp_opt = "";
+ QString ip_opt = "";
+ prefix = *vals.at(0);
+ level = *vals.at(1);
+ tcp_seq = *vals.at(2);
+ tcp_opt = *vals.at(3);
+ ip_opt =* vals.at(4);
+ if ( !prefix.isEmpty() && prefix != XML::Undefined_Value && prefix != XML::BoolOff_Value ) {
+ c_log_prefix->setChecked( true );
+ prefix = prefix.right( prefix.length() -1);
+ prefix = prefix.left( prefix.length() -1 );
+ t_log_prefix->setText( prefix );
+ } else {
+ c_log_prefix->setChecked( false );
+ t_log_prefix->setText( "" );
+ }
+ if ( !level.isEmpty() && level != XML::Undefined_Value && prefix != XML::BoolOff_Value) {
+ c_log_level->setChecked( true );
+ cb_log_level ->setCurrentText( level );
+ } else {
+ c_log_level->setChecked( false );
+ cb_log_level ->setCurrentText( "" );
+ }
+
+ if ( tcp_seq == XML::BoolOn_Value )
+ c_log_tcp_seq->setChecked( true );
+ else
+ c_log_tcp_seq->setChecked( false );
+
+ if ( tcp_opt == XML::BoolOn_Value )
+ c_log_tcp_options->setChecked( true );
+ else
+ c_log_tcp_options->setChecked( false );
+
+ if ( ip_opt == XML::BoolOn_Value )
+ c_log_ip_options->setChecked( true );
+ else
+ c_log_ip_options->setChecked( false );
+ }
+}
+
+void KMFRuleEditTargetLog::accept() {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 Target Log Option").arg( m_rule->name() )
+ );
+ QPtrList<QString>* args = new QPtrList<QString>;
+ QString* name = new QString( "target_log_opt" );
+
+ if ( c_log_prefix->isChecked() ) {
+ QString val = t_log_prefix->text();
+ val.prepend("\"");
+ val.append("\"");
+ args->append( ( new QString( val ) ) );
+ } else {
+ args->append( ( new QString("") ) );
+ }
+
+ if ( c_log_level->isChecked() ) {
+ QString val = cb_log_level->currentText();
+ args->append( ( new QString( val ) ) );
+ } else {
+ args->append( ( new QString("") ) );
+ }
+
+ if ( c_log_tcp_seq->isChecked() ) {
+ QString val = XML::BoolOn_Value;
+ args->append( ( new QString( val ) ) );
+ } else {
+ args->append( ( new QString("") ) );
+ }
+
+ if ( c_log_tcp_options->isChecked() ) {
+ QString val = XML::BoolOn_Value;
+ args->append( ( new QString( val ) ) );
+ } else {
+ args->append( ( new QString("") ) );
+ }
+
+ if ( c_log_ip_options->isChecked() ) {
+ QString val = XML::BoolOn_Value;
+ args->append( ( new QString( val ) ) );
+ } else {
+ args->append( ( new QString("") ) );
+ }
+
+ // emit sigAddTargetOpt(name,args);
+ m_rule->addTargetOption( *name, *args );
+ emit sigDocumentChanged();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+}
+
+void KMFRuleEditTargetLog::slotHelp() {
+ kdDebug() << "void KMFRuleEditTargetLog::slotHelp()" << endl;
+ kapp->invokeHelp( "targets" );
+}
+void KMFRuleEditTargetLog::reject() {
+ kdDebug() << "void KMFRuleEditTargetLog::slotreject()" << endl;
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleedittargetlog.moc"
diff --git a/kmyfirewall/ruleoptionplugins/log_target_option/kmfruleedittargetlog.h b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruleedittargetlog.h
new file mode 100644
index 0000000..1d421c4
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruleedittargetlog.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ begin : Wed May 22 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITTARGETLOG_H
+#define KMFRULEEDITTARGETLOG_H
+#include "kmyfirewallruleeditortargetlog.h"
+
+#include <qwidget.h>
+#include <qptrlist.h>
+namespace KMF {
+class IPTRule;
+/**
+ *@author Christian Hubinger
+ */
+
+class KMFRuleEditTargetLog : public KMyFirewallRuleEditorTargetLog {
+ Q_OBJECT
+public:
+ KMFRuleEditTargetLog( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFRuleEditTargetLog();
+
+ QPtrList<QString>* options;
+
+ void loadRule( IPTRule * );
+public slots:
+ void accept();
+ void slotHelp();
+ void reject();
+
+private:
+ IPTRule* m_rule;
+
+signals:
+/* void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );*/
+ void sigDocumentChanged();
+ void sigHideMe();
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/log_target_option/kmfruleoption_target_log_option.xml b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruleoption_target_log_option.xml
new file mode 100644
index 0000000..6178bfb
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruleoption_target_log_option.xml
@@ -0,0 +1,10 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="target_log_opt" guiName="Log Options">
+ <option guiName="Log Prefix:" command="--log-prefix" />
+ <option guiName="Log Level:" command="--log-level" />
+ <option guiName="Logging TCP Sequence Numbers" command="--log-tcp-sequence" />
+ <option guiName="Logging TCP Options" command="--log-tcp-options" />
+ <option guiName="Logging IP Options" command="--log-ip-options" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptionedit_log.desktop b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptionedit_log.desktop
new file mode 100644
index 0000000..c59aa40
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptionedit_log.desktop
@@ -0,0 +1,55 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall LOG target option edit
+Name[bg]=Редактиране на настройките за регистрирането във файла-дневник
+Name[ca]=Editor de les opcions del destí LOG de KMyFirewall
+Name[da]=KMyFirewall redigering af LOG måltilvalg
+Name[de]=KMyFirewall Log-Zieloptionen-Editor
+Name[el]=Επεξεργασία επιλογών προορισμού LOG για το KMyFirewall
+Name[es]=Editor de KMyFirewall de opciones tipo LOG target
+Name[et]=KMyFirewalli logi sihtmärgi võtmete redigeerimine
+Name[fr]=Édition des options de cible LOG de KMyFirewall
+Name[gl]=Edizón de opzóns de obxectivos LOG de KMyFirewall
+Name[hi]=के-माइ-फायरवाल एलओजी लक्ष्य विकल्प संपादन
+Name[it]=Modifica delle opzioni di obiettivo LOG di KMyFirewall
+Name[ka]=KMyFirewall LOG target პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - LOG-doel-optie bewerken
+Name[pa]=KMyFirewall LOG target ਚੋਣ ਸੋਧ
+Name[pt]=Edição da opção de alvo LOG do KMFirewall
+Name[pt_BR]=Edição da opção de Alvo LOG do KMyFirewall
+Name[ru]=KMyFirewall - LOG target
+Name[sr]=KMyFirewall-ово уређивање опција LOG циља
+Name[sr@Latn]=KMyFirewall-ovo uređivanje opcija LOG cilja
+Name[sv]=Redigera LOG-målalternativ i Min brandvägg
+Name[ta]=KMyFirewall LOG மூல தேர்வினை தொகு
+Name[tr]=KMyFirewall LOG hedefi seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall LOG target option editxx
+Comment=Plugin for edition LOG target iptables rule options
+Comment[bg]=Редактиране на настройките на правилата на iptables за регистрирането във файла-дневник
+Comment[ca]=Connector per editar les opcions de les regles de iptables del destí LOG
+Comment[da]=Plugin til at redigere LOG målregeltilvalg for iptables
+Comment[de]=Modul für benutzerdefinierte Log-Zieloptionen
+Comment[el]=Πρόσθετο επεξεργασίας επιλογών προορισμού LOG iptables
+Comment[es]=Un complemento para editar las opciones de las reglas de iptables de tipo LOG target
+Comment[et]=Plugin IPTablesi reegli logi sihtmärgi võtmete redigeerimiseks
+Comment[fr]=Module d'édition des options de règles IPTables des cibles LOG
+Comment[gl]=Extensión para a edizón de regras de iptables con obxectivos LOG
+Comment[hi]=एलओजी लक्ष्य आईपी-टेबल्स नियम का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni delle regole iptables con obiettivo LOG
+Comment[ka]=LOG target iptables წესთა რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van LOG-doel iptables-regelopties
+Comment[pa]=Plugin for edition LOG target iptables ਨਿਯਮ ਚੋਣ
+Comment[pt]='Plugin' para editar opções do alvo LOG de regras iptables
+Comment[pt_BR]=Plug-in para a edição de regras de alvos LOG do iptables
+Comment[ru]=Модуль для правки правила iptables "LOG target"
+Comment[sr]=Прикључак за уређивање опција iptables правила LOG циља
+Comment[sr@Latn]=Priključak za uređivanje opcija iptables pravila LOG cilja
+Comment[sv]=Insticksprogram för att redigera LOG-mål regelalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி தேர்வினை LOG மூல தொகுப்பின் சொருகுபொருள்
+Comment[tr]=LOG hedef iptables kural seçenekleri yayını için eklenti
+Comment[xx]=xxPlugin for edition LOG target iptables rule optionsxx
+X-KDE-Library=libkmfruletargetoptionedit_log
+ServiceTypes=KMyFirewall/RuleTargetOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptioneditlog.cpp b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptioneditlog.cpp
new file mode 100644
index 0000000..0ccea50
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptioneditlog.cpp
@@ -0,0 +1,126 @@
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruletargetoptioneditlog.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../ipteditor/kmfruleedit.h"
+#include "kmfruleedittargetlog.h"
+
+namespace KMF {
+KMFRuleTargetOptionEditLog::KMFRuleTargetOptionEditLog(QObject *parent, const char *name)
+ : KMFRuleTargetOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleTargetOptionEditLog::KMFRuleTargetOptionEditLog(QObject *parent, const char *name)" << endl;
+
+ m_managedTargets << "LOG";
+
+
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditTargetLog( 0 , "Edit", 0 );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+KMFRuleTargetOptionEditLog::~KMFRuleTargetOptionEditLog() {}
+
+void KMFRuleTargetOptionEditLog::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleTargetOptionEditLog::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+
+const QString& KMFRuleTargetOptionEditLog::optionEditName() const {
+ return *( new QString( i18n("NAT Option") ) );
+}
+const QString& KMFRuleTargetOptionEditLog::description() const {
+ return *( new QString( i18n("This plugin manages the NAT options of iptables.") ) );
+}
+
+void KMFRuleTargetOptionEditLog::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleTargetOptionEditLog::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleTargetOptionEditLog::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleTargetOptionEditLog::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+bool KMFRuleTargetOptionEditLog::setTarget( const QString& target ){
+ if ( ! manageTarget( target ) ) {
+ return false;
+ }
+ return true;
+}
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleTargetOptionEditLogFactory::s_instance = 0L;
+// KAboutData* KMFRuleTargetOptionEditLogFactory::s_about = 0L;
+
+KMFRuleTargetOptionEditLogFactory::KMFRuleTargetOptionEditLogFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleTargetOptionEditLogFactory" );
+}
+
+QObject* KMFRuleTargetOptionEditLogFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleTargetOptionEditLog( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleTargetOptionEditLogFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleTargetOptionEditLogFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruletargetoptionedit_log() {
+ return new KMFRuleTargetOptionEditLogFactory;
+ }
+}
+
+
+}
+
+#include "kmfruletargetoptioneditlog.moc"
diff --git a/kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptioneditlog.h b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptioneditlog.h
new file mode 100644
index 0000000..f005c78
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/log_target_option/kmfruletargetoptioneditlog.h
@@ -0,0 +1,76 @@
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULETARGETOPTIONEDITLOG_H
+#define KMFRULETARGETOPTIONEDITLOG_H
+
+#include "../../core/kmfruletargetoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+class KInstance;
+namespace KMF {
+class IPTRule;
+class KMFRuleEditTargetLog;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleTargetOptionEditLog : public KMFRuleTargetOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleTargetOptionEditLog(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleTargetOptionEditLog();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+ bool setTarget( const QString& );
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditTargetLog *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleTargetOptionEditLogFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleTargetOptionEditLogFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleTargetOptionEditLogFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+
+}
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/log_target_option/kmyfirewallruleeditortargetlog.ui b/kmyfirewall/ruleoptionplugins/log_target_option/kmyfirewallruleeditortargetlog.ui
new file mode 100644
index 0000000..458c743
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/log_target_option/kmyfirewallruleeditortargetlog.ui
@@ -0,0 +1,267 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorTargetLog</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorTargetLog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>263</width>
+ <height>221</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Logging Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>gb_conntrack</cstring>
+ </property>
+ <property name="title">
+ <string>Configure Logging</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_log_prefix</cstring>
+ </property>
+ <property name="text">
+ <string>Set log prefix:</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>t_log_prefix</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>KMyFirewall</string>
+ </property>
+ <property name="maxLength">
+ <number>29</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout26</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_log_level</cstring>
+ </property>
+ <property name="text">
+ <string>Set log level:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>info</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>warning</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>notice</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>debug</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>err</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>crit</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>alert</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>emerg</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>cb_log_level</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="editable">
+ <bool>false</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_log_tcp_seq</cstring>
+ </property>
+ <property name="text">
+ <string>Log TCP Sequence Numbers</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_log_tcp_options</cstring>
+ </property>
+ <property name="text">
+ <string>Log TCP Options</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_log_ip_options</cstring>
+ </property>
+ <property name="text">
+ <string>Log IP Options</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout22</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Discard</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>c_log_level</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_log_level</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_log_prefix</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_log_prefix</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTargetLog</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTargetLog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTargetLog</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>slotOk()</slot>
+ <slot>reject()</slot>
+ <slot>accept()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/mac_option/Makefile.am b/kmyfirewall/ruleoptionplugins/mac_option/Makefile.am
new file mode 100644
index 0000000..4faae53
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mac_option/Makefile.am
@@ -0,0 +1,21 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruleoptionedit_mac.la
+
+libkmfruleoptionedit_mac_la_LDFLAGS = -module -no-undefined $(all_libraries) \
+ $(KDE_PLUGIN)
+libkmfruleoptionedit_mac_la_LIBADD = \
+ ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruleoptioneditmac.h kmfruleeditmac.h
+
+libkmfruleoptionedit_mac_la_SOURCES = kmfruleoptioneditmac.cpp kmfruleeditmac.cpp kmyfirewallruleeditormac.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruleoptionedit_mac.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_mac_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_mac_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_mac_option.xml
diff --git a/kmyfirewall/ruleoptionplugins/mac_option/kmfruleeditmac.cpp b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleeditmac.cpp
new file mode 100644
index 0000000..f741055
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleeditmac.cpp
@@ -0,0 +1,222 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+#include "kmfruleeditmac.h"
+
+#include <qcheckbox.h>
+#include <qframe.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kapplication.h>
+
+// project includes
+#include "../../core/xmlnames.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfcheckinput.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmferrorhandler.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+
+namespace KMF {
+/*
+ * Constructs a KMFRuleEditMac which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+KMFRuleEditMac::KMFRuleEditMac( QWidget* parent, const char* name, WFlags fl )
+ : KMyFirewallRuleEditorMac( parent, name, fl ) {
+ m_err_handler = new KMFErrorHandler( "KMFRuleEditMac" );
+ m_check_input = new KMFCheckInput();
+ m_err = new KMFError();
+
+
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+KMFRuleEditMac::~KMFRuleEditMac() {
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * Main event handler. Reimplemented to handle application
+ * font changes
+ */
+bool KMFRuleEditMac::event( QEvent* ev ) {
+ bool ret = QWidget::event( ev );
+ if ( ev->type() == QEvent::ApplicationFontChange ) {}
+ return ret;
+}
+
+void KMFRuleEditMac::loadRule( IPTRule * rule ) {
+ kdDebug() << "void KMFRuleEditMac::loadRule( IPTRule * rule )" << endl,
+ c_src_mac->setChecked( false );
+ c_inv_src_mac->setChecked( false );
+ t_src_mac1 ->clear();
+ t_src_mac2 ->clear();
+ t_src_mac3 ->clear();
+ t_src_mac4 ->clear();
+ t_src_mac5 ->clear();
+ t_src_mac6 ->clear();
+ m_rule = rule;
+ QString line = "";
+
+ IPTRuleOption* opt = 0;
+ opt = m_rule->getOptionForName("mac_opt");
+ if ( opt ) {
+ QStringList args = opt->getValues();
+ QString src, dest;
+ line = *args.at(1);
+ if ( line.isEmpty() || line == XML::Undefined_Value )
+ return;
+ if ( line.startsWith( "! " ) ) {
+ kdDebug() << "Found Invert Flag" << endl;
+ line = line.right( line.length() - 2 );
+ c_inv_src_mac->setChecked( true );
+ }
+
+ line = line.simplifyWhiteSpace();
+
+ kdDebug() << "Found Mac Address: " << line << endl;
+ if ( line == XML::BoolOff_Value ) {
+ t_src_mac1 -> setText( "" );
+ t_src_mac2 -> setText( "" );
+ t_src_mac3 -> setText( "" );
+ t_src_mac4 -> setText( "" );
+ t_src_mac5 -> setText( "" );
+ t_src_mac6 -> setText( "" );
+ c_src_mac->setChecked( false );
+ return;
+ }
+
+ int num = 1;
+ QString part = "";
+ c_src_mac->setChecked( true );
+ while ( !line.isEmpty() ) {
+ int pos = -1;
+ pos = line.find( ":" );
+ if ( pos < 0 ) {
+ part = line;
+ kdDebug() << "Found last digit: " << part << endl;
+ line = "";
+ } else {
+ kdDebug() << "found delim: " << pos << endl;
+ part = line.left( pos );
+ kdDebug() << "Token Nr." << num << ": " << part << endl;
+ line = line.right( line.length() - ( pos + 1 ) );
+ kdDebug() << "Rest: " << line << endl;
+ }
+ switch ( num ) {
+ case 1:
+ t_src_mac1 -> setText( part );
+ break;
+ case 2:
+ t_src_mac2 -> setText( part );
+ break;
+ case 3:
+ t_src_mac3 -> setText( part );
+ break;
+ case 4:
+ t_src_mac4 -> setText( part );
+ break;
+ case 5:
+ t_src_mac5 -> setText( part );
+ break;
+ case 6:
+ t_src_mac6 -> setText( part );
+ break;
+ }
+ num++;
+ }
+ }
+}
+
+
+void KMFRuleEditMac::accept() {
+ kdDebug() << "KMFRuleEditMac::accept()" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 MAC Option").arg( m_rule->name() )
+ );
+ QString tok1 = t_src_mac1->text().upper();
+ QString tok2 = t_src_mac2->text().upper();
+ QString tok3 = t_src_mac3->text().upper();
+ QString tok4 = t_src_mac4->text().upper();
+ QString tok5 = t_src_mac5->text().upper();
+ QString tok6 = t_src_mac6->text().upper();
+
+ if ( c_src_mac->isChecked() && ( tok1.isEmpty() || tok2.isEmpty() || tok3.isEmpty() || tok4.isEmpty() || tok5.isEmpty() || tok6.isEmpty() ) ) {
+ const QString & msg = i18n( "One ore more of the fields are empty. Please fill out all fields to define a valid MAC address." );
+ KMessageBox::error( this, msg );
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+
+ QString mac = "";
+
+ if ( c_src_mac->isChecked() ) {
+ mac = tok1 + ":" + tok2 + ":" + tok3 + ":" + tok4 + ":" + tok5 + ":" + tok6;
+ m_check_input->checkInput( mac, "MAC", m_err );
+ if ( ! m_err_handler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->endTransaction();
+ return ;
+ }
+ }
+
+ QPtrList<QString>* values = new QPtrList<QString>;
+ QString* op = new QString( "mac_opt" );
+ if ( c_src_mac->isChecked() && !mac.isEmpty() ) {
+ kdDebug() << "Add new mac option" << endl;
+ QString* src_mac = new QString( mac );
+ if ( c_inv_src_mac->isChecked() ) {
+ src_mac->prepend( "! " );
+ }
+ values->append( new QString( XML::BoolOn_Value ) );
+ values->append( src_mac );
+ } else {
+ values->append( new QString( XML::BoolOff_Value ) );
+ }
+
+ m_rule->addRuleOption( *op, *values );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+}
+
+void KMFRuleEditMac::slotHelp() {
+ kdDebug() << "void KMFRuleEditMac::slotHelp()" << endl;
+ kapp->invokeHelp( "src_mac" );
+}
+void KMFRuleEditMac::reject() {
+ kdDebug() << "void KMFRuleEditMac::reject()" << endl;
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleeditmac.moc"
diff --git a/kmyfirewall/ruleoptionplugins/mac_option/kmfruleeditmac.h b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleeditmac.h
new file mode 100644
index 0000000..44182c9
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleeditmac.h
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/*
+Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001-2004
+*/
+
+
+#ifndef KMFRULEEDITMAC_H
+#define KMFRULEEDITMAC_H
+
+#include "kmyfirewallruleeditormac.h"
+
+#include <qvariant.h>
+#include <qdialog.h>
+#include <qptrlist.h>
+
+namespace KMF {
+class IPTRule;
+class KMFErrorHandler;
+class KMFCheckInput;
+class KMFError;
+
+class KMFRuleEditMac : public KMyFirewallRuleEditorMac {
+ Q_OBJECT
+
+public:
+ KMFRuleEditMac( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KMFRuleEditMac();
+
+ void loadRule( IPTRule* );
+
+public slots:
+ void accept();
+ void slotHelp();
+ void reject();
+
+protected:
+ bool event( QEvent* );
+
+private:
+ KMFCheckInput *m_check_input;
+ KMFErrorHandler *m_err_handler;
+ KMFError *m_err;
+ IPTRule* m_rule;
+
+signals:
+/* void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );*/
+ void sigHideMe();
+};
+}
+#endif // KMFRULEEDITMAC_H
diff --git a/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoption_mac_option.xml b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoption_mac_option.xml
new file mode 100644
index 0000000..0f80a1d
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoption_mac_option.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="mac_opt" guiName="MAC Address">
+ <option guiName="" command="--match mac" />
+ <option guiName="MAC:" command="--mac-source" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptionedit_mac.desktop b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptionedit_mac.desktop
new file mode 100644
index 0000000..70c2275
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptionedit_mac.desktop
@@ -0,0 +1,55 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall MAC option edit
+Name[bg]=Редактиране на настройките по MAC адрес на KMyFirewall
+Name[ca]=Editor de les opcions MAC de KMyFirewall
+Name[da]=KMyFirewall MAC redigeringstilvalg
+Name[de]=KMyFirewall MAC-Optionen-Editor
+Name[el]=Επεξεργασία επιλογής MAC για το KMyFirewall
+Name[es]=Editor de KMyFirewall para las opciones MAC
+Name[et]=KMyFirewalli MAC-i võtmete redigeerimine
+Name[fr]=Édition des options MAC de KMyFirewall
+Name[gl]=Edizón de opzóns MAC de KMyFirewall
+Name[hi]=के-माइ-फायरवाल एमएसी विकल्प संपादन
+Name[it]=Modifica delle opzioni MAC di KMyFirewall
+Name[ja]=KMyFirewall MAC オプション編集
+Name[ka]=KMyFirewall MAC პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - MAC-optie bewerken
+Name[pa]=KMyFirewall MAC ਚੋਣ ਸੋਧ
+Name[pt]=Edição da opção MAC do KMFirewall
+Name[pt_BR]=Edição da Opção MAC do KMyFirewall
+Name[ru]=KMyFirewall - MAC
+Name[sr]=KMyFirewall-ово уређивање MAC опција
+Name[sr@Latn]=KMyFirewall-ovo uređivanje MAC opcija
+Name[sv]=Redigera MAC-alternativ i Min brandvägg
+Name[ta]=KMyFirewall MAC தேர்வினை தொகு
+Name[tr]=KMyFirewall MAC seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall MAC option editxx
+Comment=Plugin for edition MAC address based iptables rule options
+Comment[bg]=Приставка за редактиране на MAC-базираните правила на iptables
+Comment[ca]=Connector per editar les opcions de les regles de iptables basades en l'adreça MAC
+Comment[da]=Plugin ril at redigere MAC adressebaserede regeltilvalg for iptables
+Comment[de]=Modul für benutzerdefinierte MAC-Adressenbasierte IP-Regel Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων iptables με βάση τη διεύθυνση MAC
+Comment[es]=Un complemento para editar las opciones de las reglas de iptables basadas en direcciones MAC
+Comment[et]=Plugin IPTablesi reegli MAC aadressi võtmete redigeerimiseks
+Comment[fr]=Module pour l'édition des options des règles IPTables basées sur les adresses MAC
+Comment[gl]=Extensión para a edizón de regras de iptables baseados en enderezos MAC
+Comment[hi]=एमएसी पता आधारित आईपी-टेबल्स नियम का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni delle regole iptables basate sugli indirizzi MAC
+Comment[ka]=MAC მისამართებზე დაფუძნებული iptables წესთა რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van Mac-adres gebaseerde iptables-regelopties
+Comment[pt]='Plugin' para editar opções de MAC de regras iptables
+Comment[pt_BR]=Plug-in para a edição do endereço MAC baseado em opções de regras do iptables
+Comment[ru]=Модуль для правки правила iptables на основе MAC-адресов
+Comment[sr]=Прикључак за уређивање опција iptables правила на основу MAC адресе
+Comment[sr@Latn]=Priključak za uređivanje opcija iptables pravila na osnovu MAC adrese
+Comment[sv]=Insticksprogram för att redigera MAC-adressbaserade regelalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி தேர்வினை சார்ந்த MAC முகவரி தொகுப்பின் சொருகுபொருள்
+Comment[tr]=MAC adresi tabanlı iptables kural seçeneklerini düzenlemek için eklenti
+Comment[xx]=xxPlugin for edition MAC address based iptables rule optionsxx
+X-KDE-Library=libkmfruleoptionedit_mac
+ServiceTypes=KMyFirewall/RuleOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptioneditmac.cpp b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptioneditmac.cpp
new file mode 100644
index 0000000..14e48b8
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptioneditmac.cpp
@@ -0,0 +1,111 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "kmfruleoptioneditmac.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditmac.h"
+
+namespace KMF {
+KMFRuleOptionEditMAC::KMFRuleOptionEditMAC(QObject *parent, const char *name)
+ : KMFRuleOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleOptionEditMAC::KMFRuleOptionEditMAC(QObject *parent, const char *name)" << endl;
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditMac( 0 , "Edit", 0 );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+
+KMFRuleOptionEditMAC::~KMFRuleOptionEditMAC() {}
+
+void KMFRuleOptionEditMAC::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleOptionEditMAC::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+const QString& KMFRuleOptionEditMAC::optionEditName() const {
+ return *( new QString( i18n("MAC Option") ) );
+}
+const QString& KMFRuleOptionEditMAC::description() const {
+ return *( new QString( i18n("This plugin manages the MAC address based options of iptables.") ) );
+}
+
+void KMFRuleOptionEditMAC::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleOptionEditMAC::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleOptionEditMAC::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleOptionEditMAC::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleOptionEditMACFactory::s_instance = 0L;
+// KAboutData* KMFRuleOptionEditMACFactory::s_about = 0L;
+
+KMFRuleOptionEditMACFactory::KMFRuleOptionEditMACFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleOptionEditMACFactory" );
+}
+
+QObject* KMFRuleOptionEditMACFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleOptionEditMAC( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+extern "C" {
+ void* init_libkmfruleoptionedit_mac() {
+ return new KMFRuleOptionEditMACFactory;
+ }
+}
+
+
+}
+
+#include "kmfruleoptioneditmac.moc"
diff --git a/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptioneditmac.h b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptioneditmac.h
new file mode 100644
index 0000000..9534c29
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mac_option/kmfruleoptioneditmac.h
@@ -0,0 +1,91 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULEOPTIONEDITMAC_H
+#define KMFRULEOPTIONEDITMAC_H
+
+#include "../../core/kmfruleoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+#include <qstring.h>
+#include <qptrlist.h>
+class KInstance;
+
+namespace KMF {
+class IPTRule;
+class KMFRuleEditMac;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleOptionEditMAC : public KMFRuleOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditMAC(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleOptionEditMAC();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditMac *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleOptionEditMACFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditMACFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleOptionEditMACFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+
+}
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/mac_option/kmyfirewallruleeditormac.ui b/kmyfirewall/ruleoptionplugins/mac_option/kmyfirewallruleeditormac.ui
new file mode 100644
index 0000000..c8cce9e
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mac_option/kmyfirewallruleeditormac.ui
@@ -0,0 +1,502 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorMac</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorMac</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>568</width>
+ <height>192</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MAC Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <family>Arial</family>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="text">
+ <string>MAC Options</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignCenter</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_src_mac</cstring>
+ </property>
+ <property name="text">
+ <string>Source MAC:</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>t_src_mac1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>40</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>40</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="maxLength">
+ <number>2</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_2_6</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>5</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;:&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>t_src_mac2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>40</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>40</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="maxLength">
+ <number>2</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_2_5</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>5</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;:&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>t_src_mac3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>40</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>40</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="maxLength">
+ <number>2</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_2_4</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>5</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;:&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>t_src_mac4</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>40</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>40</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="maxLength">
+ <number>2</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_2_3</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>5</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;:&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>t_src_mac5</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>40</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>40</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="maxLength">
+ <number>2</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_2_2</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>5</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;:&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>t_src_mac6</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>40</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>40</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="maxLength">
+ <number>2</number>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_inv_src_mac</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Invert</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>NOTE: By checking the "Invert" checkbox the rule will only match if the address found in the packet header is not one you defined.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer5_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>80</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>80</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>c_src_mac</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_src_mac1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_src_mac</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_inv_src_mac</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorMac</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>c_src_mac</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_src_mac2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_src_mac</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_src_mac3</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_src_mac</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_src_mac4</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_src_mac</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_src_mac5</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_src_mac</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_src_mac6</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorMac</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>kPushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorMac</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/mark_target_option/Makefile.am b/kmyfirewall/ruleoptionplugins/mark_target_option/Makefile.am
new file mode 100644
index 0000000..f6878e2
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mark_target_option/Makefile.am
@@ -0,0 +1,21 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruletargetoptionedit_mark.la
+
+libkmfruletargetoptionedit_mark_la_LDFLAGS = -module -no-undefined \
+ $(all_libraries) $(KDE_PLUGIN)
+libkmfruletargetoptionedit_mark_la_LIBADD = \
+ ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruletargetoptioneditmark.h kmfruleedittargetmark.h
+
+libkmfruletargetoptionedit_mark_la_SOURCES = kmfruletargetoptioneditmark.cpp kmfruleedittargetmark.cpp kmyfirewallruleeditortargetmark.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruletargetoptionedit_mark.desktop
+
+install-data-local:
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_target_mark_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_target_mark_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_target_mark_option.xml
+
diff --git a/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleedittargetmark.cpp b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleedittargetmark.cpp
new file mode 100644
index 0000000..213209f
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleedittargetmark.cpp
@@ -0,0 +1,96 @@
+/***************************************************************************
+ begin : Thu Aug 29 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org.orphi.iki
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfruleedittargetmark.h"
+
+// QT includes
+#include <qstring.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+// KDE includes
+#include <kdebug.h>
+#include <kapplication.h>
+#include <klocale.h>
+
+// MY includes
+#include "../../core/xmlnames.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+
+namespace KMF {
+KMFRuleEditTargetMark::KMFRuleEditTargetMark( QWidget *parent, const char *name, WFlags fl ) : KMyFirewallRuleEditorTargetMark( parent, name, fl ) {}
+KMFRuleEditTargetMark::~KMFRuleEditTargetMark() {}
+
+void KMFRuleEditTargetMark::loadRule( IPTRule* rule ) {
+ kdDebug() << "void KMFRuleEditTargetMark::loadRule(IPTRule* rule)" << endl;
+ if ( rule == 0 ) {
+ kdDebug() << "void KMFRuleEditTargetMark::loadRule(IPTRule* rule)\nrule == 0\nThis is a bug ;-)" << endl;
+ return ;
+ }
+ m_rule = rule;
+ IPTRuleOption *opt = m_rule->getOptionForName( "target_mark_opt" );
+ QStringList vals = opt->getValues();
+ QString val = "";
+ val = *vals.at(0);
+ if ( val != XML::Undefined_Value && !val.isEmpty() && val != XML::BoolOff_Value ) {
+ c_use_mark->setChecked( true );
+ int num = val.toInt();
+ sb_mark->setValue( num );
+ } else {
+ c_use_mark->setChecked( false );
+ }
+}
+void KMFRuleEditTargetMark::accept() {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 Mark Target Option").arg( m_rule->name() )
+ );
+ kdDebug() << "void KMFRuleEditTargetMark::accept()" << endl;
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "target_mark_opt" );
+ if ( c_use_mark->isChecked() ) {
+ int mark = sb_mark->value();
+ kdDebug() << "Will set mark" << mark << endl;
+ QString* opt = new QString( "" );
+ QString val = val.setNum( mark );
+ opt->append( val );
+ options->append( opt );
+ }
+
+
+ m_rule->addTargetOption( *name, *options );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigDocumentChanged();
+}
+
+void KMFRuleEditTargetMark::slotHelp() {
+ kdDebug() << "void KMFRuleEditTargetMark::slotHelp()" << endl;
+ kapp->invokeHelp( "targets" );
+}
+void KMFRuleEditTargetMark::reject() {
+ kdDebug() << "void KMFRuleEditTargetMark::reject()" << endl;
+ loadRule(m_rule);
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleedittargetmark.moc"
diff --git a/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleedittargetmark.h b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleedittargetmark.h
new file mode 100644
index 0000000..eddefec
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleedittargetmark.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ begin : Thu Aug 29 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org.orphi.iki
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITTARGETMARK_H
+#define KMFRULEEDITTARGETMARK_H
+#include "kmyfirewallruleeditortargetmark.h"
+
+#include <qwidget.h>
+#include <qptrlist.h>
+/**
+ *@author Christian Hubinger
+ */
+class QString;
+namespace KMF {
+class IPTRule;
+
+
+class KMFRuleEditTargetMark : public KMyFirewallRuleEditorTargetMark {
+ Q_OBJECT
+public:
+ KMFRuleEditTargetMark( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFRuleEditTargetMark();
+ void loadRule( IPTRule* );
+ void accept();
+ void reject();
+
+public slots:
+ void slotHelp();
+
+private:
+ IPTRule* m_rule;
+
+signals:
+/* void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );
+ void sigDelTargetOpt( QString * );*/
+ void sigDocumentChanged();
+ void sigHideMe();
+
+
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleoption_target_mark_option.xml b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleoption_target_mark_option.xml
new file mode 100644
index 0000000..22a16f3
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruleoption_target_mark_option.xml
@@ -0,0 +1,6 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="target_mark_opt" guiName="Set Mark" >
+ <option guiName="Set Mark Nr.:" command="--set-mark" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptionedit_mark.desktop b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptionedit_mark.desktop
new file mode 100644
index 0000000..5322be4
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptionedit_mark.desktop
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall MARK option edit
+Name[bg]=Редактиране на MARK настройките KMyFirewall
+Name[ca]=Editor de les opcions MARK de KMyFirewall
+Name[cs]=Editace voleb MARK KMyFirewall
+Name[da]=KMyFirewall MARK redigeringstilvalg
+Name[de]=KMyFirewall MARK Optionen-Editor
+Name[el]=Επεξεργασία επιλογής MARK για το KMyFirewall
+Name[es]=Editor de KMyFirewall para opciones de tipo MARK
+Name[et]=KMyFirewalli MARK-võtmete redigeerimine
+Name[fr]=Édition des options MARK de KMyFirewall
+Name[gl]=Edizón de opzóns de MARK de KMyFirewall
+Name[hi]=के-माइ-फायरवाल मार्क विकल्प संपादन
+Name[it]=Modifica delle opzioni MARK di KMyFirewall
+Name[ja]=KMyFirewall MARK オプション編集
+Name[ka]=KMyFirewall MARK პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - MARK-optie bewerken
+Name[pa]=KMyFirewall MARK ਚੋਣ ਸੋਧ
+Name[pt]=Edição da opção MARK do KMFirewall
+Name[pt_BR]=Edição da Opção MARK do KMyFirewall
+Name[ru]=KMyFirewall - MARK
+Name[sr]=KMyFirewall-ово уређивање MARK опција
+Name[sr@Latn]=KMyFirewall-ovo uređivanje MARK opcija
+Name[sv]=Redigera MARK-alternativ i Min brandvägg
+Name[ta]=KMyFirewall MARK தேர்வினை தொகு
+Name[tr]=KMyFirewall MARK seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall MARK option editxx
+Comment=Plugin for editing MARK based iptables rule options
+Comment[bg]=Приставка за редактиране на MARK-базираните настройки на правилата на iptables
+Comment[ca]=Connector per editar les opcions de les regles de iptables basades en MARK
+Comment[cs]=Modul pro editaci MARK iptables pravidel
+Comment[da]=Plugin til at redigere MARK baserede regeltilvalg for iptables
+Comment[de]=Modul für benutzerdefinierte MARK-basierten IP-Regel Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων iptables με βάση το MARK
+Comment[es]=Un complemento para editar las opciones de las reglas de iptables MARK
+Comment[et]=Plugin IPTablesi reegli MARK-võtmete redigeerimiseks
+Comment[fr]=Module d'édition des options de règles IPTables MARK
+Comment[gl]=Extensión para editar regras de iptables baseadas en MARK
+Comment[hi]=मार्क आधारित आईपी-टेबल्स नियम का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni delle regole iptables basate su MARK
+Comment[ka]=MARK დაფუძნებული iptables წესთა რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van MARK-gebaseerde iptables-regelopties
+Comment[pt]='Plugin' para editar opções MARK de regras iptables
+Comment[pt_BR]=Plug-in para a edição de MARK baseado em opções de regras do iptables
+Comment[ru]=Модуль для правки правила iptables на основе MARK
+Comment[sr]=Прикључак за уређивање опција iptables правила на основу MARK-а
+Comment[sr@Latn]=Priključak za uređivanje opcija iptables pravila na osnovu MARK-a
+Comment[sv]=Insticksprogram för att redigera MARK-baserade regelalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி தேர்வினை சார்ந்த MARK முகவரி தொகுப்பின் சொருகுபொருள்
+Comment[tr]=MARK tabanlı iptables kuralı seçeneklerini düzenlemek için eklenti
+Comment[xx]=xxPlugin for editing MARK based iptables rule optionsxx
+X-KDE-Library=libkmfruletargetoptionedit_mark
+ServiceTypes=KMyFirewall/RuleTargetOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptioneditmark.cpp b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptioneditmark.cpp
new file mode 100644
index 0000000..967f3e4
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptioneditmark.cpp
@@ -0,0 +1,131 @@
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruletargetoptioneditmark.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleedittargetmark.h"
+
+namespace KMF {
+KMFRuleTargetOptionEditMark::KMFRuleTargetOptionEditMark(QObject *parent, const char *name)
+ : KMFRuleTargetOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleTargetOptionEditMark::KMFRuleTargetOptionEditMark(QObject *parent, const char *name)" << endl;
+
+ m_managedTargets << "MARK";
+
+
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditTargetMark( 0 , "Edit", 0 );
+ m_edit->hide();
+
+/* connect( m_edit,SIGNAL(sigAddRuleOpt(QString*, QPtrList< QString >* ) ),
+ this,SLOT( slotAddRuleOption(QString*, QPtrList< QString >* ) ) );
+ connect( m_edit,SIGNAL(sigAddTargetOpt(QString*, QPtrList< QString >* ) ),
+ this,SLOT( slotAddTargetOption(QString*, QPtrList< QString >* ) ) );*/
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+
+KMFRuleTargetOptionEditMark::~KMFRuleTargetOptionEditMark() {}
+
+void KMFRuleTargetOptionEditMark::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleTargetOptionEditMark::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+
+const QString& KMFRuleTargetOptionEditMark::optionEditName() const {
+ return *( new QString( i18n("NAT Option") ) );
+}
+const QString& KMFRuleTargetOptionEditMark::description() const {
+ return *( new QString( i18n("This plugin manages the NAT options of iptables.") ) );
+}
+
+void KMFRuleTargetOptionEditMark::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleTargetOptionEditMark::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleTargetOptionEditMark::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleTargetOptionEditMark::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+bool KMFRuleTargetOptionEditMark::setTarget( const QString& target ){
+ if ( ! manageTarget( target ) ) {
+ return false;
+ }
+ return true;
+}
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleTargetOptionEditMarkFactory::s_instance = 0L;
+// KAboutData* KMFRuleTargetOptionEditMarkFactory::s_about = 0L;
+
+KMFRuleTargetOptionEditMarkFactory::KMFRuleTargetOptionEditMarkFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleTargetOptionEditMarkFactory" );
+}
+
+QObject* KMFRuleTargetOptionEditMarkFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleTargetOptionEditMark( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleTargetOptionEditMarkFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleTargetOptionEditMarkFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruletargetoptionedit_mark() {
+ return new KMFRuleTargetOptionEditMarkFactory;
+ }
+}
+
+
+}
+
+#include "kmfruletargetoptioneditmark.moc"
diff --git a/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptioneditmark.h b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptioneditmark.h
new file mode 100644
index 0000000..7b28003
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mark_target_option/kmfruletargetoptioneditmark.h
@@ -0,0 +1,79 @@
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULETARGETOPTIONEDITMARK_H
+#define KMFRULETARGETOPTIONEDITMARK_H
+
+#include "../../core/kmfruletargetoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+class KInstance;
+
+
+namespace KMF {
+class IPTRule;
+class KMFRuleEditTargetMark;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleTargetOptionEditMark : public KMFRuleTargetOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleTargetOptionEditMark(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleTargetOptionEditMark();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+ bool setTarget( const QString& );
+
+private slots:
+
+ void slotShowOverview();
+
+private:
+ KMFRuleEditTargetMark *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleTargetOptionEditMarkFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleTargetOptionEditMarkFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleTargetOptionEditMarkFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/mark_target_option/kmyfirewallruleeditortargetmark.ui b/kmyfirewall/ruleoptionplugins/mark_target_option/kmyfirewallruleeditortargetmark.ui
new file mode 100644
index 0000000..902105f
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/mark_target_option/kmyfirewallruleeditortargetmark.ui
@@ -0,0 +1,142 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorTargetMark</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorTargetMark</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>280</width>
+ <height>129</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>IP Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>Set MARK</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>sb_mark</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_use_mark</cstring>
+ </property>
+ <property name="text">
+ <string>Set MARK</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout24</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Discard</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTargetMark</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>c_use_mark</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_mark</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTargetMark</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTargetMark</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/nat_target_option/Makefile.am b/kmyfirewall/ruleoptionplugins/nat_target_option/Makefile.am
new file mode 100644
index 0000000..38b0bd9
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/nat_target_option/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruletargetoptionedit_nat.la
+
+libkmfruletargetoptionedit_nat_la_LDFLAGS = -module -no-undefined \
+ $(all_libraries) $(KDE_PLUGIN)
+libkmfruletargetoptionedit_nat_la_LIBADD = \
+ ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruletargetoptioneditnat.h kmfruleeditortargetnat.h
+
+libkmfruletargetoptionedit_nat_la_SOURCES = kmfruletargetoptioneditnat.cpp kmfruleeditortargetnat.cpp kmyfirewallruleeditortargetnat.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruletargetoptionedit_nat.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_target_nat_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_target_nat_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_target_nat_option.xml
+
diff --git a/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleeditortargetnat.cpp b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleeditortargetnat.cpp
new file mode 100644
index 0000000..9fc6d4c
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleeditortargetnat.cpp
@@ -0,0 +1,327 @@
+/***************************************************************************
+begin : Sun May 26 2002
+copyright : (C) 2002 by Christian Hubinger
+email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfruleeditortargetnat.h"
+
+// QT includes
+#include <qstring.h>
+#include <qspinbox.h>
+#include <qlineedit.h>
+#include <qcheckbox.h>
+#include <qmessagebox.h>
+
+// KDE include
+#include <kdebug.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+
+// MY includes
+#include "../../core/xmlnames.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmferror.h"
+#include "../../core/kmfcheckinput.h"
+#include "../../core/kmferrorhandler.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+namespace KMF {
+KMFRuleEditorTargetNat::KMFRuleEditorTargetNat( QWidget *parent, const char *name, WFlags fl ) : KMyFirewallRuleEditorTargetNat( parent, name, fl ) {
+ m_CheckInput = new KMFCheckInput();
+ m_ErrorHandler = new KMFErrorHandler( "KMFRuleEditProtocol" );
+ m_err = new KMFError() ;
+
+}
+
+
+
+KMFRuleEditorTargetNat::~KMFRuleEditorTargetNat() {}
+
+void KMFRuleEditorTargetNat::loadRule( IPTRule *rule ) {
+ c_use_ports->setChecked( false );
+ c_use_port_range->setChecked( false );
+ c_ip_range->setChecked( false );
+ t_ip1->clear();
+ t_ip2->clear();
+ sb_port1->setValue(1);
+ sb_port2->setValue(2);
+ m_rule = rule;
+
+ kdDebug() << "KMFRuleEditorTargetNat::loadRule(IPTRule *rule)" << endl;
+ m_rule = rule;
+ bool has_port = false;
+ IPTRuleOption *opt = m_rule->getOptionForName( "tcp_opt" );
+ if ( ! opt->isEmpty() )
+ has_port = true;
+ if ( ! has_port ) {
+ opt = m_rule->getOptionForName( "udp_opt" );
+ if ( ! opt->isEmpty() )
+ has_port = true;
+ }
+ if ( ! has_port ) {
+ opt = m_rule->getOptionForName( "tcp_multiport_opt" );
+ if ( ! opt->isEmpty() )
+ has_port = true;
+ }
+ if ( ! has_port ) {
+ opt = m_rule->getOptionForName( "udp_multiport_opt" );
+ if ( ! opt->isEmpty() )
+ has_port = true;
+ }
+ c_use_ports->setEnabled( has_port );
+
+ if ( mbsnat )
+ opt = m_rule->getOptionForName( "target_snat_opt" );
+ else
+ opt = m_rule->getOptionForName( "target_dnat_opt" );
+
+ QStringList vals;
+ vals = opt->getValues();
+ QString arg = "";
+ arg = *vals.at( 0 );
+ kdDebug() << "Found option String: " << arg << endl;
+ if ( arg != XML::Undefined_Value && !arg.isEmpty() && arg != XML::BoolOff_Value ) {
+ kdDebug() << "Found option String: " << arg << endl;
+ QString ips = "";
+ QString ports = "";
+ QString ip1 = "";
+ QString ip2 = "";
+ QString port1 = "";
+ QString port2 = "";
+ if ( arg.contains( ":" ) && has_port ) {
+ c_use_ports->setChecked( true );
+ int del = arg.find( ':' );
+ ips = arg.left( del );
+ kdDebug() << "IP arg: " << ips << endl;
+ ports = arg.right( arg.length() - del - 1 );
+ kdDebug() << "Port arg: " << ports << endl;
+ if ( ips.contains( "-" ) ) {
+ c_ip_range->setChecked( true );
+ int delim = ips.find( '-' );
+
+ ip1 = ips.left( delim );
+ kdDebug() << "IP arg1: " << ip1 << endl;
+ t_ip1 ->setText( ip1 );
+
+ ip2 = ips.right( ips.length() - delim - 1 );
+ kdDebug() << "IP arg2: " << ip2 << endl;
+ t_ip2 ->setText( ip2 );
+ } else {
+ c_ip_range->setChecked( false );
+ t_ip1 ->setText( ips );
+ }
+ if ( ports.contains( "-" ) ) {
+ c_use_port_range->setChecked( true );
+
+ int delim = ports.find( '-' );
+ port1 = ports.left( delim );
+ kdDebug() << "Port arg1: " << port1 << endl;
+ ;
+ int int_port1 = port1.toInt();
+ sb_port1 ->setValue( int_port1 );
+
+ port2 = ports.right( ports.length() - delim - 1 );
+ kdDebug() << "Port arg2: " << port2 << endl;
+ ;
+ int int_port2 = port2.toInt();
+ sb_port2 ->setValue( int_port2 );
+
+ } else {
+ c_use_port_range->setChecked( false );
+ kdDebug() << "Port arg: " << ports << endl;
+ ;
+ int int_port1 = ports.toInt();
+ sb_port1 ->setValue( int_port1 );
+ }
+ } else if ( arg.contains( "-" ) ) {
+ c_use_ports->setChecked( false );
+ c_ip_range->setChecked( true );
+ int delim = arg.find( '-' );
+ ip1 = arg.left( delim );
+ kdDebug() << "IP arg1: " << ip1 << endl;
+ t_ip1 ->setText( ip1 );
+ ip2 = arg.right( arg.length() - delim - 1 );
+ kdDebug() << "IP arg2: " << ip2 << endl;
+ t_ip2 ->setText( ip2 );
+ } else if ( ! arg.isEmpty() ){
+ c_use_ports->setChecked( false );
+ c_ip_range->setChecked( false );
+ ip1 = arg;
+ t_ip1 ->setText( ip1 );
+ } else {
+ c_use_ports->setChecked( false );
+ c_ip_range->setChecked( false );
+ t_ip1 ->clear();
+ t_ip2 ->clear();
+ }
+ }
+}
+
+
+void KMFRuleEditorTargetNat::accept() {
+ kdDebug() << "KMFRuleEditorTargetNat::accept()";
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 Target NAT Option").arg( m_rule->name() )
+ );
+
+ bool ip_range = c_ip_range->isChecked();
+ bool use_ports = c_use_ports->isChecked();
+ bool use_port_range = c_use_port_range->isChecked();
+ QString ip1, ip2, port1, port2, arg_ip, arg_port;
+
+ if ( ip_range ) {
+ ip1 = t_ip1->text();
+ ip2 = t_ip2->text();
+ if ( ip1.isEmpty() ) {
+ KMessageBox::sorry(this,i18n("You need as a minimum to define an IP address to make NAT working."),
+ i18n("Argument not Valid"));
+ KMFUndoEngine::instance()->abortTransaction();
+ return;
+ }
+ if ( ip2.isEmpty() ) {
+ KMessageBox::sorry(this,i18n("Please also set the upper boundary for your address range.."),
+ i18n("Argument not Valid"));
+ KMFUndoEngine::instance()->abortTransaction();
+ return;
+ }
+
+ // Sanity checks +++++++++++++++++
+ m_CheckInput->checkInput( ip1, "IP", m_err );
+ if ( !m_ErrorHandler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ m_CheckInput->checkInput( ip2, "IP", m_err );
+ if ( !m_ErrorHandler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ // ++++++++++++++++++++++++++++++++
+ arg_ip = ip1 + "-" + ip2;
+ kdDebug() << "IP Argument: " << arg_ip;
+ } else {
+ ip1 = t_ip1->text();
+ // Sanity checks +++++++++++++++++
+ m_CheckInput->checkInput( ip1, "IP", m_err );
+ if ( !m_ErrorHandler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ // ++++++++++++++++++++++++++++++++
+ arg_ip = ip1;
+ kdDebug() << "IP Argument: " << arg_ip;
+ }
+
+ if ( use_ports && c_use_ports->isEnabled() ) {
+ if ( use_port_range ) {
+ port1 = sb_port1->text();
+ port2 = sb_port2->text();
+ // Sanity checks +++++++++++++++++
+ m_CheckInput->checkInput( port1, "PORT", m_err );
+ if ( !m_ErrorHandler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ m_CheckInput->checkInput( port2, "PORT", m_err );
+ if ( !m_ErrorHandler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ // ++++++++++++++++++++++++++++++++
+ arg_port = port1 + "-" + port2;
+ kdDebug() << "Port Argument: " << arg_port;
+ } else {
+ port1 = sb_port1->text();
+ // Sanity checks +++++++++++++++++
+ m_CheckInput->checkInput( port1, "PORT", m_err );
+ if ( !m_ErrorHandler->showError( m_err ) ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ // ++++++++++++++++++++++++++++++++
+
+ arg_port = port1;
+ kdDebug() << "Port Argument: " << arg_port;
+ }
+ }
+
+ if ( mbsnat ) {
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "target_snat_opt" );
+ QString val = arg_ip;
+ QString arg = "";
+ if ( !val.isEmpty() ) {
+ arg.append( val );
+ } else {
+ KMessageBox::sorry( this, i18n( "Unable to work without values.\n"
+ "Please specify at least an IP address." ) ,
+ i18n( "Nat Options" ) );
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+
+ QString val2 = arg_port;
+ if ( !val2.isEmpty() ) {
+ arg.append( ":" );
+ arg.append( val2 );
+ }
+ options->append( new QString( arg ) );
+ // emit sigAddTargetOpt( name, options );
+ m_rule->addTargetOption( *name, *options );
+
+ } else {
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "target_dnat_opt" );
+ QString val = arg_ip;
+ QString arg = "";
+ if ( !val.isEmpty() ) {
+ arg.append( val );
+ } else {
+ KMessageBox::sorry( this, i18n( "Unable to work without values.\n"
+ "Please specify at least an IP address." ) ,
+ i18n( "Nat Options" ) );
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ QString val2 = arg_port;
+ if ( !val2.isEmpty() ) {
+ arg.append( ":" );
+ arg.append( val2 );
+ }
+ options->append( new QString( arg ) );
+ m_rule->addTargetOption( *name, *options );
+ }
+
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigDocumentChanged();
+}
+void KMFRuleEditorTargetNat::slotHelp() {
+ kdDebug() << "void KMFRuleEditorTargetNat::slotHelp()" << endl;
+ kapp->invokeHelp( "targets" );
+}
+void KMFRuleEditorTargetNat::reject() {
+ kdDebug() << "void KMFRuleEditorTargetNat::reject()" << endl;
+ loadRule(m_rule);
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleeditortargetnat.moc"
diff --git a/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleeditortargetnat.h b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleeditortargetnat.h
new file mode 100644
index 0000000..957abc5
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleeditortargetnat.h
@@ -0,0 +1,63 @@
+/***************************************************************************
+ begin : Sun May 26 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITORTARGETNAT_H
+#define KMFRULEEDITORTARGETNAT_H
+#include "kmyfirewallruleeditortargetnat.h"
+
+#include <qwidget.h>
+
+/**
+ *@author Christian Hubinger
+ */
+
+namespace KMF {
+class IPTRule;
+class KMFCheckInput;
+class KMFErrorHandler;
+class KMFError;
+
+class KMFRuleEditorTargetNat : public KMyFirewallRuleEditorTargetNat {
+ Q_OBJECT
+public:
+ KMFRuleEditorTargetNat( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFRuleEditorTargetNat();
+
+
+ void loadRule( IPTRule *rule );
+ void setMode( bool isSnat ) {
+ mbsnat = isSnat;
+ };
+
+public slots:
+ void accept();
+ void reject();
+ void slotHelp();
+
+signals:
+/* void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );*/
+ void sigDocumentChanged();
+ void sigHideMe();
+private:
+ bool mbsnat;
+ IPTRule* m_rule;
+ KMFCheckInput *m_CheckInput;
+ KMFErrorHandler *m_ErrorHandler;
+ KMFError *m_err;
+
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleoption_target_nat_option.xml b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleoption_target_nat_option.xml
new file mode 100644
index 0000000..3634ccb
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruleoption_target_nat_option.xml
@@ -0,0 +1,9 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="target_dnat_opt" guiName="Destination NAT">
+ <option guiName="Translate to Dest.:" command="--to-destination" />
+</ruleoptiondefinition>
+<ruleoptiondefinition name="target_snat_opt" guiName="Source NAT">
+ <option guiName="Translate to Src.:" command="--to-source" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptionedit_nat.desktop b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptionedit_nat.desktop
new file mode 100644
index 0000000..74359c7
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptionedit_nat.desktop
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall NAT option edit
+Name[bg]=Редактиране на настройките на NAT
+Name[ca]=Editor de les opcions NAT de KMyFirewall
+Name[cs]=Editace NAT voleb KMyFirewall
+Name[da]=KMyFirewall NAT redigeringstilvalg
+Name[de]=KMyFirewall NAT Optionen-Editor
+Name[el]=Επεξεργασία επιλογής NAT για το KMyFirewall
+Name[es]=Editor de KMyFirewall para las opciones NAT
+Name[et]=KMyFirewalli NAT võtmete redigeerimine
+Name[fr]=Édition des options NAT de KMyFirewall
+Name[gl]=Edizón de opzóns de NAT de KMyFirewall
+Name[hi]=के-माइ-फायरवाल एनएटी विकल्प संपादन
+Name[it]=Modifica delle opzioni NAT di KMyFirewall
+Name[ja]=KMyFirewall NAT オプション編集
+Name[ka]=KMyFirewall NAT პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - NAT-optie bewerken
+Name[pa]=KMyFirewall NAT ਚੋਣ ਸੋਧ
+Name[pt]=Edição da opção NAT do KMFirewall
+Name[pt_BR]=Edição da opção NAT do KMyFirewall
+Name[ru]=KMyFirewall - NAT
+Name[sr]=KMyFirewall-ово уређивање NAT опција
+Name[sr@Latn]=KMyFirewall-ovo uređivanje NAT opcija
+Name[sv]=Redigera NAT-alternativ i Min brandvägg
+Name[ta]=KMyFirewall NAT தேர்வினை தொகு
+Name[tr]=KMyFirewall NAT seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall NAT option editxx
+Comment=Plugin for editing NAT based iptables rule options
+Comment[bg]=Приставка за редактиране на NAT-базираните настройки на правилата на iptables
+Comment[ca]=Connector per editar les opcions de les regles de iptables basades en NAT
+Comment[cs]=Modul pro editaci NAT iptables pravidel
+Comment[da]=Plugin til at redigere NAT baserede regeltilvalg for iptables
+Comment[de]=Modul für benutzerdefinierte NAT-basierten IP-Regel Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων iptables με βάση το ΝΑΤ
+Comment[es]=Un complemento para la edición de las opciones de las reglas de iptables NAT
+Comment[et]=Plugin IPTablesi reegli NAT võtmete redigeerimiseks
+Comment[fr]=Module d'édition des options de règles IPTables NAT
+Comment[gl]=Extensión para editar regras de iptables baseadas en NAT
+Comment[hi]=एनएटी आधारित आईपी-टेबल्स नियम का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni delle regole di iptables basate su NAT
+Comment[ka]=NAT დაფუძნებული iptables წესთა რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van NAT-gebaseerde iptables-regelopties
+Comment[pt]='Plugin' para editar opções NAT de regras iptables
+Comment[pt_BR]=Plug-in para a edição de NAT baseado em opções de regras do iptables
+Comment[ru]=Модуль для правки правила iptables на основе NAT
+Comment[sr]=Прикључак за уређивање опција iptables правила на основу NAT-а
+Comment[sr@Latn]=Priključak za uređivanje opcija iptables pravila na osnovu NAT-a
+Comment[sv]=Insticksprogram för att redigera NAT-baserade regelalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி தேர்வினை சார்ந்த NAT தொகுப்பின் சொருகுபொருள்
+Comment[tr]=NAT tabanlı iptables kuralı seçeneklerini düzenlemek için eklenti
+Comment[xx]=xxPlugin for editing NAT based iptables rule optionsxx
+X-KDE-Library=libkmfruletargetoptionedit_nat
+ServiceTypes=KMyFirewall/RuleTargetOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptioneditnat.cpp b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptioneditnat.cpp
new file mode 100644
index 0000000..ef54779
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptioneditnat.cpp
@@ -0,0 +1,143 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruletargetoptioneditnat.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditortargetnat.h"
+
+namespace KMF {
+KMFRuleTargetOptionEditNat::KMFRuleTargetOptionEditNat(QObject *parent, const char *name)
+ : KMFRuleTargetOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleTargetOptionEditNat::KMFRuleTargetOptionEditNat(QObject *parent, const char *name)" << endl;
+
+ m_managedTargets << "SNAT" << "DNAT";
+
+
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditorTargetNat( 0 , "Edit", 0 );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+
+KMFRuleTargetOptionEditNat::~KMFRuleTargetOptionEditNat() {}
+
+void KMFRuleTargetOptionEditNat::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleTargetOptionEditNat::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+
+const QString& KMFRuleTargetOptionEditNat::optionEditName() const {
+ return *( new QString( i18n("NAT Option") ) );
+}
+const QString& KMFRuleTargetOptionEditNat::description() const {
+ return *( new QString( i18n("This plugin manages the NAT options of iptables.") ) );
+}
+
+void KMFRuleTargetOptionEditNat::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleTargetOptionEditNat::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleTargetOptionEditNat::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleTargetOptionEditNat::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+bool KMFRuleTargetOptionEditNat::setTarget( const QString& target ){
+ if ( ! manageTarget( target ) ) {
+ return false;
+ }
+ if ( target == "SNAT")
+ m_edit->setMode( true );
+ else
+ m_edit->setMode( false );
+ return true;
+}
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleTargetOptionEditNatFactory::s_instance = 0L;
+// KAboutData* KMFRuleTargetOptionEditNatFactory::s_about = 0L;
+
+KMFRuleTargetOptionEditNatFactory::KMFRuleTargetOptionEditNatFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleTargetOptionEditNatFactory" );
+}
+
+QObject* KMFRuleTargetOptionEditNatFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleTargetOptionEditNat( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleTargetOptionEditNatFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleTargetOptionEditNatFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruletargetoptionedit_nat() {
+ return new KMFRuleTargetOptionEditNatFactory;
+ }
+}
+
+}
+
+
+#include "kmfruletargetoptioneditnat.moc"
diff --git a/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptioneditnat.h b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptioneditnat.h
new file mode 100644
index 0000000..489a26a
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/nat_target_option/kmfruletargetoptioneditnat.h
@@ -0,0 +1,88 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULETARGETOPTIONEDITNAT_H
+#define KMFRULETARGETOPTIONEDITNAT_H
+
+#include "../../core/kmfruletargetoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+class KInstance;
+namespace KMF {
+class IPTRule;
+class KMFRuleEditorTargetNat;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleTargetOptionEditNat : public KMFRuleTargetOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleTargetOptionEditNat(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleTargetOptionEditNat();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+ bool setTarget( const QString& );
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditorTargetNat *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleTargetOptionEditNatFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleTargetOptionEditNatFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleTargetOptionEditNatFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/nat_target_option/kmyfirewallruleeditortargetnat.ui b/kmyfirewall/ruleoptionplugins/nat_target_option/kmyfirewallruleeditortargetnat.ui
new file mode 100644
index 0000000..518b000
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/nat_target_option/kmyfirewallruleeditortargetnat.ui
@@ -0,0 +1,339 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorTargetNat</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorTargetNat</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>331</width>
+ <height>207</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>KMyFirewall - Nat Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>Configure Network Address Translation</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout28</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_ip_range</cstring>
+ </property>
+ <property name="text">
+ <string>Use IP Range</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>TextLabel8</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>to:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>TextLabel9</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>from:</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="2">
+ <property name="name">
+ <cstring>t_ip2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="2">
+ <property name="name">
+ <cstring>t_ip1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Translate to IP:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>c_use_ports</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Use only custom port(s)</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>ATTENTION: This is only available if the rule also defines protcol TCP or UDP as a filter option!</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox20</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_use_port_range</cstring>
+ </property>
+ <property name="text">
+ <string>Use a port range</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>from:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel11</cstring>
+ </property>
+ <property name="text">
+ <string>Map to port:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="2">
+ <property name="name">
+ <cstring>sb_port1</cstring>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="2">
+ <property name="name">
+ <cstring>sb_port2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>to:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout27</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Dismiss</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_cancel_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>c_ip_range</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel8</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_ip_range</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>t_ip2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTargetNat</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>c_ip_range</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel9</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_port_range</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel3</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_port_range</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel5</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_port_range</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_port2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_ports</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>GroupBox20</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_cancel_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTargetNat</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTargetNat</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/protocol_option/Makefile.am b/kmyfirewall/ruleoptionplugins/protocol_option/Makefile.am
new file mode 100644
index 0000000..29e8dcc
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/protocol_option/Makefile.am
@@ -0,0 +1,25 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruleoptionedit_protocol.la
+
+libkmfruleoptionedit_protocol_la_LDFLAGS = -module -no-undefined \
+ $(all_libraries) $(KDE_PLUGIN)
+libkmfruleoptionedit_protocol_la_LIBADD = \
+ ../../kmfwidgets/libkmfwidgets.la ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruleoptioneditprotocol.h kmfruleeditorprotocol.h
+
+libkmfruleoptionedit_protocol_la_SOURCES = kmfruleoptioneditprotocol.cpp kmfruleeditorprotocol.cpp kmyfirewallruleeditorprotocol.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruleoptionedit_protocol.desktop
+
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_protocol_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_protocol_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_protocol_option.xml
+
+
diff --git a/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleeditorprotocol.cpp b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleeditorprotocol.cpp
new file mode 100644
index 0000000..12014fe
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleeditorprotocol.cpp
@@ -0,0 +1,725 @@
+/***************************************************************************
+ begin : Fri Nov 1 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfruleeditorprotocol.h"
+
+// kde includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+
+// qt includes
+#include <qlayout.h>
+#include <qcheckbox.h>
+#include <qtabwidget.h>
+#include <qstring.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+// project includes
+#include "../../core/xmlnames.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+#include "../../core/xmlnames.h"
+#include "../../kmfwidgets/kmfportwidget.h"
+#include "../../kmfwidgets/kmfmultiportwidget.h"
+namespace KMF {
+KMFRuleEditorProtocol::KMFRuleEditorProtocol( QWidget *parent, const char *name, WFlags fl ) : KMyFirewallRuleEditorProtocol( parent, name, fl ) {
+ use_multiport = false;
+ cb_icmp_type->insertItem( "echo-request" );
+ cb_icmp_type->insertItem( "echo-reply" );
+ cb_icmp_type->insertItem( "source-quench" );
+ cb_icmp_type->insertItem( "router-advertisement" );
+ cb_icmp_type->insertItem( "router-solicitation" );
+ cb_icmp_type->insertItem( "timestamp-request" );
+ cb_icmp_type->insertItem( "timestamp-reply" );
+ cb_icmp_type->insertItem( "address-mask-request" );
+ cb_icmp_type->insertItem( "address-mask-reply" );
+ cb_icmp_type->insertItem( "destination-unreachable" );
+ cb_icmp_type->insertItem( "network-unreachable" );
+ cb_icmp_type->insertItem( "host-unreachable" );
+ cb_icmp_type->insertItem( "protocol-unreachable" );
+ cb_icmp_type->insertItem( "port-unreachable" );
+ cb_icmp_type->insertItem( "fragmentation-needed" );
+ cb_icmp_type->insertItem( "source-route-failed" );
+ cb_icmp_type->insertItem( "network-unknown" );
+ cb_icmp_type->insertItem( "host-unknown" );
+ cb_icmp_type->insertItem( "network-prohibited" );
+ cb_icmp_type->insertItem( "host-prohibited" );
+ cb_icmp_type->insertItem( "TOS-network-unreachable" );
+ cb_icmp_type->insertItem( "TOS-host-unreachable" );
+ cb_icmp_type->insertItem( "communication-prohibited" );
+ cb_icmp_type->insertItem( "host-precedence-violation" );
+ cb_icmp_type->insertItem( "precedence-cutoff" );
+ cb_icmp_type->insertItem( "redirect" );
+ cb_icmp_type->insertItem( "network-redirect" );
+ cb_icmp_type->insertItem( "host-redirect" );
+ cb_icmp_type->insertItem( "TOS-network-redirect" );
+ cb_icmp_type->insertItem( "TOS-host-redirect" );
+ cb_icmp_type->insertItem( "time-exceeded" );
+ cb_icmp_type->insertItem( "ttl-zero-during-transit" );
+ cb_icmp_type->insertItem( "ttl-zero-during-reassembly" );
+ cb_icmp_type->insertItem( "parameter-problem" );
+ cb_icmp_type->insertItem( "ip-header-bad" );
+ cb_icmp_type->insertItem( "required-option-missing" );
+
+ mpwid = new KMFMultiPortWidget( tab_multiport, "mpwid" );
+ connect( mpwid, SIGNAL( sigMultiPortChanged( bool ) ), this, SLOT( toggleMultiPort( bool ) ) );
+
+ pw_dest_port = new KMFPortWidget( tab_ports, "pw_dest_port" );
+ pw_dest_port->setEnabled( false );
+ connect( c_dest_port, SIGNAL( toggled( bool ) ) , pw_dest_port, SLOT( setEnabled( bool ) ) );
+
+ pw_src_port = new KMFPortWidget( tab_ports, "pw_src_port" );
+ pw_src_port->setEnabled( false );
+ connect( c_src_port, SIGNAL( toggled( bool ) ) , pw_src_port, SLOT( setEnabled( bool ) ) );
+
+ tab_multiportLayout->addMultiCellWidget( mpwid, 0, 0, 2, 2 );
+ tab_portsLayout->addWidget( pw_src_port, 1, 1 );
+ tab_portsLayout->addWidget( pw_dest_port, 2, 1 );
+
+ connect( c_udp, SIGNAL( toggled( bool ) ), this, SLOT( toggleUdpRule( bool ) ) );
+ connect( c_icmp, SIGNAL( toggled( bool ) ), this, SLOT( toggleIcmpRule( bool ) ) );
+ connect( c_tcp, SIGNAL( toggled( bool ) ), this, SLOT( toggleTcpRule( bool ) ) );
+ tabWidget->setTabEnabled( tab_ports, false );
+ tabWidget->setTabEnabled( tab_multiport, false );
+ tabWidget->setTabEnabled( tab_icmp, false );
+ tabWidget->setTabEnabled( tab_special_tcp, false );
+
+ tabWidget->setEnabled( false );
+ adjustSize();
+}
+
+KMFRuleEditorProtocol::~KMFRuleEditorProtocol() {}
+
+bool KMFRuleEditorProtocol::multiportEnabled() const {
+ return use_multiport;
+}
+
+int KMFRuleEditorProtocol::getItemNum( const QString& option ) {
+ kdDebug() << "int KMFRuleEditorTos::getItemNum(const QString& option)" << endl;
+ int index = -1;
+ for ( int i = 0; i < cb_icmp_type->count(); i++ ) {
+ QString tmp_item = cb_icmp_type->text( i );
+ if ( tmp_item == option ) {
+ index = i;
+ }
+ }
+ return index;
+}
+
+void KMFRuleEditorProtocol::toggleMultiPort( bool enabled ) {
+ kdDebug() << "void KMFRuleEditorProtocol::toggleMultiPort(" << enabled << ")" << endl;
+ if ( enabled ) {
+ tabWidget->setTabEnabled( tab_ports, false );
+ if ( c_tcp->isChecked() )
+ tabWidget->setTabEnabled( tab_special_tcp, false );
+
+ use_multiport = true;
+ } else {
+ tabWidget->setTabEnabled( tab_ports, true );
+ if ( c_tcp->isChecked() )
+ tabWidget->setTabEnabled( tab_special_tcp, true );
+
+ use_multiport = false;
+ }
+}
+
+void KMFRuleEditorProtocol::toggleUdpRule( bool enabled ) {
+ kdDebug() << "void KMFRuleEditorProtocol::toggleMultiPort(bool)" << endl;
+ if ( enabled ) {
+ tabWidget->setTabEnabled( tab_ports, true );
+ tabWidget->setTabEnabled( tab_multiport, true );
+ tabWidget->setTabEnabled( tab_icmp, false );
+ tabWidget->setTabEnabled( tab_special_tcp, false );
+ } else {
+ // tabWidget->setTabEnabled(tab_ports,true);
+ // tabWidget->setTabEnabled(tab_multi_port,true);
+ // tabWidget->setTabEnabled(tab_special_tcp,true);
+ }
+}
+void KMFRuleEditorProtocol::toggleTcpRule( bool enabled ) {
+ kdDebug() << "void KMFRuleEditorProtocol::toggleTcpRule(bool)" << endl;
+ if ( enabled ) {
+ tabWidget->setTabEnabled( tab_ports, true );
+ tabWidget->setTabEnabled( tab_multiport, true );
+ tabWidget->setTabEnabled( tab_special_tcp, true );
+ tabWidget->setTabEnabled( tab_icmp, false );
+ } else {
+ // tabWidget->setTabEnabled(tab_icmp,true);
+ }
+}
+
+void KMFRuleEditorProtocol::toggleIcmpRule( bool enabled ) {
+ kdDebug() << "void KMFRuleEditorProtocol::toggleIcmpRule(bool)" << endl;
+ if ( enabled ) {
+ tabWidget->setTabEnabled( tab_icmp, true );
+ tabWidget->setTabEnabled( tab_special_tcp, false );
+ tabWidget->setTabEnabled( tab_ports, false );
+ tabWidget->setTabEnabled( tab_multiport, false );
+ } else {
+ // tabWidget->setTabEnabled(tab_special_tcp,true);
+ // tabWidget->setTabEnabled(tab_ports,true);
+ // tabWidget->setTabEnabled(tab_multiport,false);
+ }
+}
+
+void KMFRuleEditorProtocol::loadRule( IPTRule* rule ) {
+ kdDebug() << "void KMFRuleEditorProtocol::loadRule(IPTRule* rule)" << endl;
+ m_rule = rule;
+ toggleMultiPort( false );
+ toggleTcpRule( false );
+ pw_dest_port->reset();
+ pw_dest_port->reset();
+ mpwid->reset();
+ c_all->setChecked( false );
+ c_icmp->setChecked( false );
+ c_udp->setChecked( false );
+ c_tcp->setChecked( false );
+ c_src_port->setChecked( false );
+ c_dest_port->setChecked( false );
+ c_icmp_type->setChecked( false );
+ c_inv_icmp->setChecked( false );
+ c_inv_prot->setChecked( false );
+ cb_icmp_type->setCurrentItem( 0 );
+ c_tcp_flags->setChecked( false );
+ c_inv_flags->setChecked( false );
+ c_tcp_option->setChecked( false );
+ c_inv_tcp_option->setChecked( false );
+ sb_tcp_option_num->setValue( 0 );
+ c_all_mask->setChecked( false );
+ c_none_mask->setChecked( false );
+ c_syn_mask->setChecked( false );
+ c_ack_mask->setChecked( false );
+ c_fin_mask->setChecked( false );
+ c_urg_mask->setChecked( false );
+ c_rst_mask->setChecked( false );
+ c_psh_mask->setChecked( false );
+ c_all_comp->setChecked( false );
+ c_none_comp->setChecked( false );
+ c_syn_comp->setChecked( false );
+ c_ack_comp->setChecked( false );
+ c_fin_comp->setChecked( false );
+ c_urg_comp->setChecked( false );
+ c_rst_comp->setChecked( false );
+ c_psh_comp->setChecked( false );
+
+ bool finished = false;
+ IPTRuleOption* option;
+ QStringList vals;
+ //################### start multiport options ######################
+ option = rule->getOptionForName("tcp_multiport_opt");
+ QString enable = "";
+ QString src_port = "";
+ QString dest_port = "";
+ vals = option->getValues();
+ enable = "";
+ enable = *vals.at(0);
+ if ( enable == XML::BoolOn_Value ) {
+ c_tcp->setChecked( true );
+ c_udp->setEnabled( false );
+ finished =true;
+ c_all->setEnabled( false );
+ c_icmp->setEnabled( false );
+ tabWidget->setEnabled( true );
+ toggleMultiPort( true );
+ tabWidget->showPage( tab_ports );
+ } else {
+ option = rule->getOptionForName("udp_multiport_opt");
+ vals = option->getValues();
+ enable = "";
+ enable = *vals.at(0);
+ if ( enable == XML::BoolOn_Value ) {
+ c_udp->setChecked( true );
+ c_tcp->setEnabled( false );
+ finished =true;
+ c_all->setEnabled( false );
+ c_icmp->setEnabled( false );
+ tabWidget->setEnabled( true );
+ toggleMultiPort( true );
+ tabWidget->showPage( tab_multiport );
+ }
+ }
+
+ src_port = "";
+ dest_port = "";
+ QString equ_port = "";
+ src_port = *vals.at(1);
+ dest_port = *vals.at(2);
+ equ_port = *vals.at(3);
+
+ if ( !src_port.isEmpty() && src_port != XML::Undefined_Value && src_port != XML::BoolOff_Value) {
+ mpwid->setType( "src" );
+ mpwid->loadPortString( src_port );
+ kdDebug() << "Option Value -sport: " << src_port << endl;
+ }
+ if ( !dest_port.isEmpty() && dest_port != XML::Undefined_Value && dest_port != XML::BoolOff_Value ) {
+ mpwid->setType( "dest" );
+ mpwid->loadPortString( dest_port );
+ kdDebug() << "Option Value -sport: " << dest_port << endl;
+ }
+ if ( !equ_port.isEmpty() && equ_port != XML::Undefined_Value && equ_port != XML::BoolOff_Value ) {
+ mpwid->setType( "equ" );
+ mpwid->loadPortString( equ_port );
+ kdDebug() << "Option Value -sport: " << equ_port << endl;
+ }
+ if (finished)
+ return;
+
+
+ //################# start tcp options #########################
+ option = rule->getOptionForName("tcp_opt");
+ vals = option->getValues();
+ QString flags = "";
+ QString tcp_option = "";
+ enable = *vals.at(0);
+ src_port = *vals.at(1);
+ dest_port = *vals.at(2);
+ flags = *vals.at(3);
+ tcp_option = *vals.at(4);
+ if ( enable == XML::BoolOn_Value ) {
+ toggleMultiPort( false );
+ toggleTcpRule( true );
+ c_tcp->setChecked( true );
+ c_all->setEnabled( false );
+ c_udp->setEnabled( false );
+ c_icmp->setEnabled( false );
+ tabWidget->setEnabled( true );
+ finished = true;
+ tabWidget->showPage( tab_ports );
+ }
+ if ( !src_port.isEmpty() && src_port != XML::Undefined_Value && src_port != XML::BoolOff_Value) {
+ kdDebug() << "Option Value -sport: " << src_port << endl;
+ c_src_port->setChecked( true );
+ pw_src_port->loadPortString( src_port );
+ }
+ if ( !dest_port.isEmpty() && dest_port != XML::Undefined_Value && dest_port != XML::BoolOff_Value ) {
+ kdDebug() << "Option Value -dport: " << dest_port << endl;
+ c_dest_port->setChecked( true );
+ pw_dest_port->loadPortString( dest_port );
+ }
+ if ( !flags.isEmpty() && flags != XML::Undefined_Value && flags != XML::BoolOff_Value ) {
+ kdDebug() << "Option Value --tcp-flags: " << flags << endl;
+ gb_mask->setEnabled( true );
+ gb_comp->setEnabled( true );
+ c_tcp_flags->setChecked( true );
+ int delim = flags.find( " " );
+ if ( flags.startsWith( "! " ) ) {
+ c_inv_flags->setChecked( true );
+ flags = flags.right( flags.length() - 2 );
+ }
+ delim = flags.find( " " );
+ kdDebug() << "found Whitespace at " << delim << endl;
+ QString mask_lst = flags.left( delim );
+ kdDebug() << "Flags for Mask: " << mask_lst << endl;
+ QString comp_lst = flags.right( flags.length() - delim );
+ kdDebug() << "Flags for Comp: " << comp_lst << endl;
+
+ if ( mask_lst.contains( "SYN" ) > 0 )
+ c_syn_mask->setChecked( true );
+ if ( mask_lst.contains( "ACK" ) > 0 )
+ c_ack_mask->setChecked( true );
+ if ( mask_lst.contains( "FIN" ) > 0 )
+ c_fin_mask->setChecked( true );
+ if ( mask_lst.contains( "RST" ) > 0 )
+ c_rst_mask->setChecked( true );
+ if ( mask_lst.contains( "URG" ) > 0 )
+ c_urg_mask->setChecked( true );
+ if ( mask_lst.contains( "PSH" ) > 0 )
+ c_psh_mask->setChecked( true );
+ if ( mask_lst.contains( "NONE" ) > 0 )
+ c_none_mask->setChecked( true );
+ if ( mask_lst.contains( "ALL" ) > 0 )
+ c_all_mask->setChecked( true );
+
+ if ( comp_lst.contains( "SYN" ) > 0 )
+ c_syn_comp->setChecked( true );
+ if ( comp_lst.contains( "ACK" ) > 0 )
+ c_ack_comp->setChecked( true );
+ if ( comp_lst.contains( "FIN" ) > 0 )
+ c_fin_comp->setChecked( true );
+ if ( comp_lst.contains( "RST" ) > 0 )
+ c_rst_comp->setChecked( true );
+ if ( comp_lst.contains( "URG" ) > 0 )
+ c_urg_comp->setChecked( true );
+ if ( comp_lst.contains( "PSH" ) > 0 )
+ c_psh_comp->setChecked( true );
+ if ( comp_lst.contains( "NONE" ) > 0 )
+ c_none_comp->setChecked( true );
+ if ( comp_lst.contains( "ALL" ) > 0 )
+ c_all_comp->setChecked( true );
+ }
+ if ( !tcp_option.isEmpty() && tcp_option != XML::Undefined_Value && tcp_option != XML::BoolOff_Value ) {
+ kdDebug() << "Option Value --tcp-options: " << tcp_option << endl;
+ c_tcp_option->setChecked( true );
+ sb_tcp_option_num->setEnabled( true );
+ if ( tcp_option.startsWith( "! " ) ) {
+ c_inv_tcp_option->setChecked( true );
+ tcp_option = tcp_option.right( tcp_option.length() - 2 );
+ }
+ int val = tcp_option.toInt();
+ sb_tcp_option_num->setValue( val );
+
+ }
+
+ // Return if tcp option was used
+ if (finished)
+ return;
+ //################# start udp options #########################
+ option = rule->getOptionForName("udp_opt");
+ vals = option->getValues();
+ enable = "";
+ src_port = "";
+ dest_port = "";
+ enable = *vals.at(0);
+ src_port = *vals.at(1);
+ dest_port = *vals.at(2);
+
+ if ( enable == XML::BoolOn_Value ) {
+ finished =true;
+ toggleMultiPort( false );
+ c_udp->setChecked( true );
+ c_all->setEnabled( false );
+ c_tcp->setEnabled( false );
+ c_icmp->setEnabled( false );
+ tabWidget->setEnabled( true );
+ toggleUdpRule( true );
+ tabWidget->showPage( tab_ports );
+ }
+
+ if ( !src_port.isEmpty() && src_port != XML::Undefined_Value && src_port != XML::BoolOff_Value) {
+ kdDebug() << "Option Value -sport: " << src_port << endl;
+ c_src_port->setChecked( true );
+ pw_src_port->loadPortString( src_port );
+ }
+ if ( !dest_port.isEmpty() && dest_port != XML::Undefined_Value && dest_port != XML::BoolOff_Value ) {
+ kdDebug() << "Option Value -dport: " << dest_port << endl;
+ c_dest_port->setChecked( true );
+ pw_dest_port->loadPortString( dest_port );
+ }
+ if (finished)
+ return;
+ //################# start icmp options #########################
+ option = rule->getOptionForName("icmp_opt");
+ vals = option->getValues();
+ enable = "";
+ QString type = "";
+ enable = *vals.at(0);
+ type = *vals.at(1);
+
+ if ( enable == XML::BoolOn_Value ) {
+ c_icmp->animateClick();
+ if ( type != XML::Undefined_Value && !type.isEmpty() ) {
+ if ( type.startsWith( "! " ) ) {
+ c_inv_icmp->setChecked( true );
+ type = type.right( type.length() - 2 );
+ }
+ int index = getItemNum( type );
+ c_icmp_type->setChecked( true );
+ if ( index > 0 ) {
+ cb_icmp_type->setCurrentItem( index );
+ }
+ tabWidget->showPage( tab_icmp );
+ }
+ }
+
+// if ( *opt == "all_prot" ) {
+// c_all->animateClick();
+// }
+// if ( *opt == "icmp" ) {
+// c_icmp->animateClick();
+// for ( uint i = 0;i < options->count();i++ ) {
+// kdDebug() << "OPTION VALUE: " << *options->at( i ) << endl;
+// if ( i == 1 ) {
+// QString cmd = *options->at( i );
+// kdDebug() << "Option Value -sport: " << cmd << endl;
+// if ( cmd.startsWith( "! " ) ) {
+// c_inv_icmp->setChecked( true );
+// cmd = cmd.right( cmd.length() - 2 );
+// }
+// c_icmp_type->setChecked( true );
+// cb_icmp_type->setEditText( cmd );
+// }
+// }
+// }
+}
+
+void KMFRuleEditorProtocol::accept() {
+ kdDebug() << "void KMFRuleEditorProtocol::accept()" << endl;
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 Protocol Option").arg( m_rule->name() )
+ );
+
+ ///////////////////////////////////////////////////////
+ // set options ++++++++++++++++++++++++++++++++++++++++
+ QString* tcp_multiport_name = new QString("tcp_multiport_opt");
+ QString* udp_multiport_name = new QString("udp_multiport_opt");
+ QString* tcp_name = new QString("tcp_opt");
+ QString* udp_name = new QString("udp_opt");
+ QString* icmp_name = new QString("icmp_opt");
+ QString* all_name = new QString("all_prot_opt");
+ QPtrList<QString>* empty_opt = new QPtrList<QString>;
+ empty_opt->append( new QString(XML::BoolOff_Value) );
+ m_rule->addRuleOption( *tcp_multiport_name, *empty_opt );
+ m_rule->addRuleOption( *udp_multiport_name, *empty_opt );
+ m_rule->addRuleOption( *tcp_name, *empty_opt );
+ m_rule->addRuleOption( *udp_name, *empty_opt );
+ m_rule->addRuleOption( *icmp_name, *empty_opt );
+ m_rule->addRuleOption( *all_name, *empty_opt );
+
+ if ( multiportEnabled() ) {
+ kdDebug() << "You like a Multiport Rule" << endl;
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString *s = new QString( "" );
+ mpwid->getPortString( s );
+ QString src = *s;
+ kdDebug() << "Found Multiport:" << src << endl;
+ if ( !src.isEmpty() ) {
+ QString type = "";
+ type = mpwid->type();
+ QString* opt = new QString( src );
+ options->append( new QString(XML::BoolOn_Value) );
+ if ( type == "src" ) {
+ options->append( new QString( src ) );
+ } else if ( type == "dest" ) {
+ options->append( new QString(XML::BoolOff_Value) );
+ options->append( new QString( src ) );
+ } else if ( type == "equ" ) {
+ options->append( new QString(XML::BoolOff_Value) );
+ options->append( new QString(XML::BoolOff_Value) );
+ options->append( new QString( src ) );
+ }
+ kdDebug() << "Found Option Type: " << *opt << endl;
+ }
+ if ( c_tcp->isChecked() ) {
+ m_rule->addRuleOption( *tcp_multiport_name, *options );
+ options->clear();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+
+ } else if ( c_udp->isChecked() ) {
+ m_rule->addRuleOption( *udp_multiport_name, *options );
+ options->clear();
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+ }
+ return;
+ }
+
+
+ if ( c_tcp->isChecked() ) {
+ kdDebug() << "You like a TCP Rule" << endl;
+ QPtrList<QString>* options = new QPtrList<QString>;
+ options->append( new QString( XML::BoolOn_Value ) );
+ QString src = "";
+ QString dest = "";
+ QString flags = "";
+ QString tcp_option = "";
+
+ if ( c_src_port->isChecked() ) {
+ QString * s = new QString( "" );
+ pw_src_port->getPortString( s );
+ if ( !s->isEmpty() )
+ src = *s;
+ if ( src.isEmpty() ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ }
+ if ( c_dest_port->isChecked() ) {
+ QString * s = new QString( "" );
+ pw_dest_port->getPortString( s );
+ if ( !s->isEmpty() )
+ dest = *s;
+ if ( dest.isEmpty() ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ }
+ if ( c_tcp_flags->isChecked() ) {
+ if ( c_inv_flags->isChecked() ) {
+ flags.prepend( "! " );
+ }
+ QString mask = "";
+ if ( ( c_all_comp->isChecked() || c_none_comp->isChecked() || c_syn_comp->isChecked() || c_fin_comp->isChecked() || c_ack_comp->isChecked() || c_rst_comp->isChecked() || c_urg_comp->isChecked() || c_psh_comp->isChecked() ) &&
+ ( c_all_mask->isChecked() || c_none_mask->isChecked() || c_syn_mask->isChecked() || c_fin_mask->isChecked() || c_ack_mask->isChecked() || c_rst_mask->isChecked() || c_urg_mask->isChecked() || c_psh_mask->isChecked() ) ) {
+ if ( c_all_mask->isChecked() )
+ mask.append( "ALL" );
+ if ( c_none_mask->isChecked() )
+ mask.append( "NONE" );
+ if ( !c_all_mask->isChecked() && !c_none_mask->isChecked() ) {
+ if ( c_syn_mask->isChecked() )
+ mask.append( ",SYN" );
+ if ( c_fin_mask->isChecked() )
+ mask.append( ",FIN" );
+ if ( c_ack_mask->isChecked() )
+ mask.append( ",ACK" );
+ if ( c_rst_mask->isChecked() )
+ mask.append( ",RST" );
+ if ( c_psh_mask->isChecked() )
+ mask.append( ",PSH" );
+ if ( c_urg_mask->isChecked() )
+ mask.append( ",URG" );
+ if ( mask.startsWith( "," ) )
+ mask = mask.right( mask.length() - 1 );
+ }
+ QString comp = "";
+ if ( c_all_comp->isChecked() )
+ comp.append( "ALL" );
+ if ( c_none_comp->isChecked() )
+ comp.append( "NONE" );
+ if ( !c_all_comp->isChecked() && !c_none_comp->isChecked() ) {
+ if ( c_syn_comp->isChecked() )
+ comp.append( ",SYN" );
+ if ( c_fin_comp->isChecked() )
+ comp.append( ",FIN" );
+ if ( c_ack_comp->isChecked() )
+ comp.append( ",ACK" );
+ if ( c_rst_comp->isChecked() )
+ comp.append( ",RST" );
+ if ( c_psh_comp->isChecked() )
+ comp.append( ",PSH" );
+ if ( c_urg_comp->isChecked() )
+ comp.append( ",URG" );
+ }
+
+ if ( comp.startsWith( "," ) )
+ comp = comp.right( comp.length() - 1 );
+ flags.append( mask );
+ flags.append( " " );
+ flags.append( comp );
+ } else {
+ KMessageBox::sorry( this, i18n( "<qt><p>You need to select the TCP flags you like to "
+ "check and those your rule should match.</qt>" ) );
+
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ }
+ if ( c_tcp_option->isChecked() ) {
+ tcp_option = sb_tcp_option_num->text();
+ if ( c_inv_tcp_option->isChecked() ) {
+ tcp_option.prepend( "! " );
+ }
+ }
+
+
+ if ( src.isEmpty() )
+ src = XML::BoolOff_Value;
+ options->append( new QString( src ) );
+ if ( dest.isEmpty() )
+ dest = XML::BoolOff_Value;
+ options->append( new QString( dest ) );
+ if ( flags.isEmpty() )
+ flags = XML::BoolOff_Value;
+ options->append( new QString( flags ) );
+ if ( tcp_option.isEmpty() )
+ tcp_option = XML::BoolOff_Value;
+ options->append( new QString( tcp_option ) );
+ m_rule->addRuleOption( *tcp_name, *options );
+ }
+ //////////////////////////////////////////////////////////////////
+ // start udp options
+ if ( c_udp->isChecked() ) {
+ kdDebug() << "You like a UDP Rule" << endl;
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString src = "";
+ QString dest = "";
+ options->append( new QString( XML::BoolOn_Value ) );
+
+ if ( c_src_port->isChecked() ) {
+ QString * s = new QString( "" );
+ pw_src_port->getPortString( s );
+ if ( !s->isEmpty() )
+ src = *s;
+ if ( src.isEmpty() ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ }
+ if ( c_dest_port->isChecked() ) {
+ QString * s = new QString( "" );
+ pw_dest_port->getPortString( s );
+ if ( !s->isEmpty() )
+ dest = *s;
+ if ( dest.isEmpty() ) {
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ }
+ if ( !src.isEmpty() || !dest.isEmpty() ) {
+// options->append( new QString(XML::BoolOn_Value) );
+ if ( src.isEmpty() )
+ src = XML::BoolOff_Value;
+ options->append( new QString( src ) );
+ if ( dest.isEmpty() )
+ dest = XML::BoolOff_Value;
+ options->append( new QString( dest ) );
+ }
+
+ // emit sigAddRuleOpt( udp_name, options );
+ m_rule->addRuleOption( *udp_name, *options );
+ options->clear();
+ }
+
+ if ( c_icmp->isChecked() ) {
+ kdDebug() << "You like a ICMP Rule" << endl;
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* opt = new QString( "" );
+ if ( c_icmp_type->isChecked() ) {
+ opt = new QString( cb_icmp_type->currentText() );
+ if ( c_inv_icmp->isChecked() ) {
+ opt->prepend( "! " );
+ }
+ }
+ options->append( new QString(XML::BoolOn_Value) );
+ options->append( opt );
+ // emit sigAddRuleOpt( icmp_name, options );
+ m_rule->addRuleOption( *icmp_name, *options );
+ options->clear();
+ }
+
+ if ( c_all->isChecked() ) {
+ kdDebug() << "You like an ALL Rule" << endl;
+ QPtrList<QString>* options = new QPtrList<QString>;
+ options->append( new QString(XML::BoolOn_Value) );
+ // emit sigAddRuleOpt( all_name, options );
+ m_rule->addRuleOption( *all_name, *options );
+ options->clear();
+ }
+
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+}
+
+void KMFRuleEditorProtocol::slotHelp() {
+ kapp->invokeHelp( "protocol" );
+}
+void KMFRuleEditorProtocol::reject() {
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleeditorprotocol.moc"
diff --git a/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleeditorprotocol.h b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleeditorprotocol.h
new file mode 100644
index 0000000..960fc19
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleeditorprotocol.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+ begin : Fri Nov 1 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITORPROTOCOL_H
+#define KMFRULEEDITORPROTOCOL_H
+#include "kmyfirewallruleeditorprotocol.h"
+
+#include <qwidget.h>
+#include <qptrlist.h>
+
+/**
+ *@author Christian Hubinger
+ */
+class QString;
+
+namespace KMF {
+class KMFMultiPortWidget;
+class KMFPortWidget;
+class IPTRule;
+
+
+class KMFRuleEditorProtocol : public KMyFirewallRuleEditorProtocol {
+ Q_OBJECT
+public:
+ KMFRuleEditorProtocol( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFRuleEditorProtocol();
+
+ void loadRule( IPTRule* rule );
+private slots:
+ void toggleMultiPort( bool );
+ void toggleUdpRule( bool );
+ void toggleIcmpRule( bool );
+ void toggleTcpRule( bool );
+ void slotHelp();
+ void reject();
+private:
+ KMFMultiPortWidget *mpwid;
+ KMFPortWidget *pw_dest_port, *pw_src_port;
+ IPTRule *m_rule;
+ bool multiportEnabled() const ;
+ void accept();
+ int getItemNum( const QString& );
+
+signals:
+/* void sigAddRuleOpt( QString *, QPtrList<QString> * );
+ void sigAddTargetOpt( QString *, QPtrList<QString> * );*/
+ void sigHideMe();
+
+private: // data
+ bool use_multiport;
+
+
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoption_protocol_option.xml b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoption_protocol_option.xml
new file mode 100644
index 0000000..47bf864
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoption_protocol_option.xml
@@ -0,0 +1,34 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="all_prot_opt" guiName="Match ALL Protocols">
+ <option guiName="" command="-p all" />
+</ruleoptiondefinition>
+<ruleoptiondefinition name="udp_opt" guiName="Protocol UDP">
+ <option guiName="" command="-p udp" />
+ <option guiName="Src. Port:" command="--source-port" />
+ <option guiName="Dest. Port:" command="--destination-port" />
+</ruleoptiondefinition>
+<ruleoptiondefinition name="udp_multiport_opt" guiName="UDP Multiport">
+ <option guiName="" command="-p udp --match multiport" />
+ <option guiName="Src. Ports:" command="--source-ports" />
+ <option guiName="Dest. Ports:" command="--destination-ports" />
+ <option guiName="Equal. Ports:" command="--ports" />
+</ruleoptiondefinition>
+<ruleoptiondefinition name="tcp_opt" guiName="Protocol TCP">
+ <option guiName="" command="-p tcp" />
+ <option guiName="Src. Port:" command="--source-port" />
+ <option guiName="Dest. Port:" command="--destination-port" />
+ <option guiName="TCP Flags:" command="--tcp-flags" />
+ <option guiName="TCP Option:" command="--tcp-option" />
+</ruleoptiondefinition>
+<ruleoptiondefinition name="tcp_multiport_opt" guiName="TCP Multiport">
+ <option guiName="" command="-p tcp --match multiport" />
+ <option guiName="Src. Ports:" command="--source-ports" />
+ <option guiName="Dest. Ports:" command="--destination-ports" />
+ <option guiName="Equal. Ports:" command="--ports" />
+</ruleoptiondefinition>
+<ruleoptiondefinition name="icmp_opt" guiName="Match ICMP">
+ <option guiName="" command="-p icmp" />
+ <option guiName="Type:" command="--icmp-type" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptionedit_protocol.desktop b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptionedit_protocol.desktop
new file mode 100644
index 0000000..271f482
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptionedit_protocol.desktop
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall Protocol option edit
+Name[bg]=Редактиране на настройките за протокол на KMyFirewall
+Name[ca]=Editor de les opcions Protocol de KMyFirewall
+Name[cs]=Editace voleb protokolu KMyFirewall
+Name[da]=KMyFirewall redigering af protokol tilvalg
+Name[de]=KMyFirewall Protokoll-Optionen-Editor
+Name[el]=Επεξεργασία επιλογής πρωτοκόλλου για το KMyFirewall
+Name[es]=Editor de KMyFirewall para las opciones de Protocolo
+Name[et]=KMyFirewalli protokollivõtmete redigeerimine
+Name[fr]=Édition des options de protocoles de KMyFirewall
+Name[gl]=Edizón de opzóns de Protocolo de KMyFirewall
+Name[hi]=के-माइ-फायरवाल प्रोटोकॉल विकल्प संपादन
+Name[it]=Modifica delle opzioni di protocollo di KMyFirewall
+Name[ja]=KMyFirewall プロトコルオプション編集
+Name[ka]=KMyFirewall ოქმის პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - Protocoloptie bewerken
+Name[pa]=KMyFirewall Protocol ਚੋਣ ਸੋਧ
+Name[pt]=Edição da opção Protocolo do KMFirewall
+Name[pt_BR]=Edição da opção Protocol do KMyFirewall
+Name[ru]=KMyFirewall - Протокол
+Name[sr]=KMyFirewall-ово уређивање опција протокола
+Name[sr@Latn]=KMyFirewall-ovo uređivanje opcija protokola
+Name[sv]=Redigera protokollalternativ i Min brandvägg
+Name[ta]=KMyFirewall நெறிமுறை தேர்வினை தொகு
+Name[tr]=KMyFirewall Protokol seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall Protocol option editxx
+Comment=Plugin for edition Protocol based iptables rule options
+Comment[bg]=Приставка за редактиране на базираните на протокол настройки на правилата на iptables
+Comment[ca]=Connector per editar les opcions de les regles de iptables basades en el protocol
+Comment[cs]=Modul pro editaci pravidel iptables založených na protokolu
+Comment[da]=Plugin til redigering af protokolbaserede regeltilvalg for iptables
+Comment[de]=Modul für benutzerdefinierte Protokoll-basierten IP-Regel Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων iptables με βάση το πρωτόκολλο
+Comment[es]=Un complemento para editar las opciones de las reglas de iptables basadas en Protocolo
+Comment[et]=Plugin IPTablesi reegli protokollivõtmete redigeerimiseks
+Comment[fr]=Module d'édition des options de règles IPTables de protocoles
+Comment[gl]=Extensión para editar regras de iptables baseadas en Protocolo
+Comment[hi]=प्रोटोकॉल आधारित आईपी-टेबल्स नियम का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni di protocollo delle regole di iptables
+Comment[ka]=ოქმზე დაფუძნებული iptables წესთა რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van protocol-gebaseerde iptables-regelopties
+Comment[pt]='Plugin' para editar opções de Protocolo de regras iptables
+Comment[pt_BR]=Plug-in para a edição do das opções de protocolo baseadas nas regras do iptables
+Comment[ru]=Модуль для правки правила iptables на основе протоколов
+Comment[sr]=Прикључак за уређивање опција iptables правила на основу протокола
+Comment[sr@Latn]=Priključak za uređivanje opcija iptables pravila na osnovu protokola
+Comment[sv]=Insticksprogram för att redigera protokollbaserade regelalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி தேர்வினை சார்ந்த நெறிமுறை தொகுப்பின் சொருகுபொருள்
+Comment[tr]=Protokol tabanlı iptables kural seçenekleri yayınını düzenlemek için eklenti
+Comment[xx]=xxPlugin for edition Protocol based iptables rule optionsxx
+X-KDE-Library=libkmfruleoptionedit_protocol
+ServiceTypes=KMyFirewall/RuleOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptioneditprotocol.cpp b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptioneditprotocol.cpp
new file mode 100644
index 0000000..d0c8289
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptioneditprotocol.cpp
@@ -0,0 +1,132 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruleoptioneditprotocol.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditorprotocol.h"
+
+namespace KMF {
+KMFRuleOptionEditProtocol::KMFRuleOptionEditProtocol(QObject *parent, const char *name)
+ : KMFRuleOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleOptionEditProtocol::KMFRuleOptionEditProtocol(QObject *parent, const char *name)" << endl;
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditorProtocol( 0 , "Edit", 0 );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+
+KMFRuleOptionEditProtocol::~KMFRuleOptionEditProtocol() {}
+
+
+
+void KMFRuleOptionEditProtocol::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleOptionEditProtocol::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+
+
+const QString& KMFRuleOptionEditProtocol::optionEditName() const {
+ return *( new QString( i18n("Protocol Option") ) );
+}
+const QString& KMFRuleOptionEditProtocol::description() const {
+ return *( new QString( i18n("This plugin manages the Protocol based options of iptables.") ) );
+}
+
+void KMFRuleOptionEditProtocol::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleOptionEditProtocol::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleOptionEditProtocol::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleOptionEditProtocol::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleOptionEditProtocolFactory::s_instance = 0L;
+// KAboutData* KMFRuleOptionEditProtocolFactory::s_about = 0L;
+
+KMFRuleOptionEditProtocolFactory::KMFRuleOptionEditProtocolFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleOptionEditProtocolFactory" );
+}
+
+QObject* KMFRuleOptionEditProtocolFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleOptionEditProtocol( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleOptionEditProtocolFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleOptionEditProtocolFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruleoptionedit_protocol() {
+ return new KMFRuleOptionEditProtocolFactory;
+ }
+}
+
+}
+
+#include "kmfruleoptioneditprotocol.moc"
diff --git a/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptioneditprotocol.h b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptioneditprotocol.h
new file mode 100644
index 0000000..5553514
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/protocol_option/kmfruleoptioneditprotocol.h
@@ -0,0 +1,89 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULEOPTIONEDITPROTOCOL_H
+#define KMFRULEOPTIONEDITPROTOCOL_H
+
+#include "../../core/kmfruleoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+
+class KInstance;
+
+namespace KMF {
+class IPTRule;
+class KMFRuleEditorProtocol;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleOptionEditProtocol : public KMFRuleOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditProtocol(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleOptionEditProtocol();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditorProtocol *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleOptionEditProtocolFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditProtocolFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleOptionEditProtocolFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/protocol_option/kmyfirewallruleeditorprotocol.ui b/kmyfirewall/ruleoptionplugins/protocol_option/kmyfirewallruleeditorprotocol.ui
new file mode 100644
index 0000000..05a8ddd
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/protocol_option/kmyfirewallruleeditorprotocol.ui
@@ -0,0 +1,1189 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorProtocol</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorProtocol</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>527</width>
+ <height>458</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Protocol Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>l_greeting</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <family>Arial</family>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="text">
+ <string>Protocol Options</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignCenter</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>gb_protocol</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Match Protocol</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_all</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>ALL</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>c_tcp</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TCP</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="4">
+ <property name="name">
+ <cstring>c_inv_prot</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Invert Protocol Selection</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="2">
+ <property name="name">
+ <cstring>c_udp</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>UDP</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="3">
+ <property name="name">
+ <cstring>c_icmp</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>ICMP</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QTabWidget" row="2" column="0">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab_ports</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Ports &amp;&amp; Portranges</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>c_dest_port</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Destination port</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_src_port</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Source port</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;Specifie the ports that should match you rule here.&lt;br&gt;
+You may use a portnumber an inclusive portrange or a service name from &lt;i&gt;/etc/sevices&lt;/i&gt; to specifie the port.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab_multiport</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Multiport Extension</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab_special_tcp</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Special TCP Options</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="1" column="1">
+ <property name="name">
+ <cstring>gb_mask</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Mask</string>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <property name="layoutSpacing" stdset="0">
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>5</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_all_mask</cstring>
+ </property>
+ <property name="text">
+ <string>ALL</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>c_none_mask</cstring>
+ </property>
+ <property name="text">
+ <string>NONE</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>c_fin_mask</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>FIN</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="1">
+ <property name="name">
+ <cstring>c_urg_mask</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>URG</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>c_psh_mask</cstring>
+ </property>
+ <property name="text">
+ <string>PSH</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="1">
+ <property name="name">
+ <cstring>c_rst_mask</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>RST</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>c_syn_mask</cstring>
+ </property>
+ <property name="text">
+ <string>SYN</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>c_ack_mask</cstring>
+ </property>
+ <property name="text">
+ <string>ACK</string>
+ </property>
+ </widget>
+ <widget class="Line" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Line3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="1" column="2">
+ <property name="name">
+ <cstring>gb_comp</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Comp</string>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <property name="layoutSpacing" stdset="0">
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>5</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_all_comp</cstring>
+ </property>
+ <property name="text">
+ <string>ALL</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>c_none_comp</cstring>
+ </property>
+ <property name="text">
+ <string>NONE</string>
+ </property>
+ </widget>
+ <widget class="Line" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Line4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>c_syn_comp</cstring>
+ </property>
+ <property name="text">
+ <string>SYN</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>c_fin_comp</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>FIN</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>c_ack_comp</cstring>
+ </property>
+ <property name="text">
+ <string>ACK</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="1">
+ <property name="name">
+ <cstring>c_rst_comp</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>RST</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>c_psh_comp</cstring>
+ </property>
+ <property name="text">
+ <string>PSH</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="1">
+ <property name="name">
+ <cstring>c_urg_comp</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>URG</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;Please make sure that you know what you are doing.&lt;br&gt;
+A misuse of this functionality may result in a hard to detect bug in the firewall.&lt;/p&gt;
+</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>layout21</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSpinBox" row="3" column="0">
+ <property name="name">
+ <cstring>sb_tcp_option_num</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>c_tcp_flags</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TCP flags</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>c_inv_flags</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Invert</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>c_tcp_syn</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>NEW connection.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="1">
+ <property name="name">
+ <cstring>c_inv_tcp_option</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Invert</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>48</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="5" column="1">
+ <property name="name">
+ <cstring>c_inv_syn</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Invert</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>c_tcp_option</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TCP option no.:</string>
+ </property>
+ </widget>
+ <spacer row="5" column="0">
+ <property name="name">
+ <cstring>Spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>48</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab_icmp</cstring>
+ </property>
+ <attribute name="title">
+ <string>ICMP</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="1">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>cb_icmp_type</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_inv_icmp</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Invert ICMP type</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_icmp_type</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Match ICMP type:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Here you can decide which ICMP Type your rulr should Match.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>layout16</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>140</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>140</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorProtocol</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorProtocol</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp_flags</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_inv_flags</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp_option</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>sb_tcp_option_num</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp_option</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_inv_tcp_option</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp_flags</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>gb_mask</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp_flags</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>gb_comp</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp_syn</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_inv_syn</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_icmp_type</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_icmp_type</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_icmp_type</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_inv_icmp</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_icmp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_icmp_type</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_udp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>tabWidget</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>tabWidget</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_all</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_udp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_all</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_icmp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_all</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_tcp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_udp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_all</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_udp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_tcp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_icmp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_tcp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_icmp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_udp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_icmp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_all</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_icmp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_udp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_tcp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_all</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_udp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_icmp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_none_mask</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_all_mask</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_all_mask</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_none_mask</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_all_comp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_none_comp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_none_comp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_all_comp</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_icmp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ButtonGroup1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_ok_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorProtocol</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>c_icmp</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>tabWidget</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>c_all</tabstop>
+ <tabstop>c_tcp</tabstop>
+ <tabstop>c_udp</tabstop>
+ <tabstop>c_icmp</tabstop>
+ <tabstop>c_inv_prot</tabstop>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>c_tcp_flags</tabstop>
+ <tabstop>c_tcp_option</tabstop>
+ <tabstop>c_tcp_syn</tabstop>
+ <tabstop>sb_tcp_option_num</tabstop>
+ <tabstop>c_inv_flags</tabstop>
+ <tabstop>c_inv_tcp_option</tabstop>
+ <tabstop>c_inv_syn</tabstop>
+ <tabstop>c_all_mask</tabstop>
+ <tabstop>c_none_mask</tabstop>
+ <tabstop>c_syn_mask</tabstop>
+ <tabstop>c_fin_mask</tabstop>
+ <tabstop>c_ack_mask</tabstop>
+ <tabstop>c_rst_mask</tabstop>
+ <tabstop>c_psh_mask</tabstop>
+ <tabstop>c_urg_mask</tabstop>
+ <tabstop>c_all_comp</tabstop>
+ <tabstop>c_none_comp</tabstop>
+ <tabstop>c_syn_comp</tabstop>
+ <tabstop>c_fin_comp</tabstop>
+ <tabstop>c_ack_comp</tabstop>
+ <tabstop>c_rst_comp</tabstop>
+ <tabstop>c_psh_comp</tabstop>
+ <tabstop>c_urg_comp</tabstop>
+ <tabstop>c_icmp_type</tabstop>
+ <tabstop>cb_icmp_type</tabstop>
+ <tabstop>c_inv_icmp</tabstop>
+ <tabstop>b_ok_2</tabstop>
+ <tabstop>b_help</tabstop>
+ <tabstop>b_ok</tabstop>
+ <tabstop>c_src_port</tabstop>
+ <tabstop>c_dest_port</tabstop>
+</tabstops>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/state_option/Makefile.am b/kmyfirewall/ruleoptionplugins/state_option/Makefile.am
new file mode 100644
index 0000000..962ac40
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/state_option/Makefile.am
@@ -0,0 +1,23 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruleoptionedit_state.la
+
+libkmfruleoptionedit_state_la_LDFLAGS = -module -no-undefined $(all_libraries) \
+ $(KDE_PLUGIN)
+libkmfruleoptionedit_state_la_LIBADD = \
+ ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruleoptioneditstate.h kmfruleeditorstate.h
+
+libkmfruleoptionedit_state_la_SOURCES = kmyfirewallruleeditorstate.ui kmfruleoptioneditstate.cpp kmfruleeditorstate.cpp
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruleoptionedit_state.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_state_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_state_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_state_option.xml
+
+
diff --git a/kmyfirewall/ruleoptionplugins/state_option/kmfruleeditorstate.cpp b/kmyfirewall/ruleoptionplugins/state_option/kmfruleeditorstate.cpp
new file mode 100644
index 0000000..8c2491d
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/state_option/kmfruleeditorstate.cpp
@@ -0,0 +1,128 @@
+
+/***************************************************************************
+ begin : Wed Mar 13 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfruleeditorstate.h"
+
+// qt includes
+#include <qstring.h>
+#include <qptrlist.h>
+#include <qcheckbox.h>
+
+// kde includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+
+// ProjectIncludes
+#include "../../core/xmlnames.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+namespace KMF {
+KMFRuleEditorState::KMFRuleEditorState( QWidget *parent, const char *name, WFlags fl /*,IPTRule* cr*/ ) : KMyFirewallRuleEditorState( parent, name, fl ) {}
+KMFRuleEditorState::~KMFRuleEditorState() {}
+
+void KMFRuleEditorState::loadRule( IPTRule *rule ) {
+ kdDebug() << "void KMFRuleEditorState::loadRule( IPTRule *rule )" << endl;
+ c_use_conntrack->setChecked( false );
+ c_new->setChecked( false );
+ c_related->setChecked( false );
+ c_established->setChecked( false );
+ c_invalid->setChecked( false );
+ m_rule = rule;
+ readRuleConfig();
+}
+
+void KMFRuleEditorState::slotOk() {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 State Option").arg( m_rule->name() )
+ );
+ bool s_new = c_new->isChecked();
+ bool s_related = c_related->isChecked();
+ bool s_established = c_established->isChecked();
+ bool s_invalid = c_invalid->isChecked();
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "state_opt" );
+
+ if ( c_use_conntrack->isChecked() ) {
+ if ( !s_new && !s_related && !s_established && !s_invalid ) {
+ KMessageBox::sorry( this, i18n( "You must at least choose one of the available states." ), i18n( "Configure Connection Tracking" ) );
+ KMFUndoEngine::instance()->abortTransaction();
+ return ;
+ }
+ QString* opt = new QString( "" );
+ if ( s_new ) {
+ opt->append( ",NEW" );
+ }
+ if ( s_related ) {
+ opt->append( ",RELATED" );
+ }
+ if ( s_established ) {
+ opt->append( ",ESTABLISHED" );
+ }
+ if ( s_invalid ) {
+ opt->append( ",INVALID" );
+ }
+ if ( opt->startsWith( "," ) )
+ * opt = opt->right( opt->length() - 1 );
+ options->append( new QString(XML::BoolOn_Value) );
+ options->append( opt );
+ }
+ // emit sigAddRuleOpt( name, options );
+ m_rule->addRuleOption( *name, *options );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+}
+
+void KMFRuleEditorState::readRuleConfig() {
+ IPTRuleOption *opt = 0;
+ opt = m_rule->getOptionForName("state_opt");
+ if (opt) {
+ QStringList vals = opt->getValues();
+ QString val = "";
+ val = *vals.at(1);
+ if ( val != XML::Undefined_Value ) {
+ c_use_conntrack->setChecked( true );
+ if ( val.contains( "NEW" ) )
+ c_new->setChecked( true );
+ if ( val.contains( "RELATED" ) )
+ c_related->setChecked( true );
+ if ( val.contains( "ESTABLISHED" ) )
+ c_established->setChecked( true );
+ if ( val.contains( "INVALID" ) )
+ c_invalid->setChecked( true );
+ }
+ }
+}
+void KMFRuleEditorState::slotHelp() {
+ kdDebug() << "void KMFRuleEditorState::slotHelp()" << endl;
+ kapp->invokeHelp( "state" );
+}
+void KMFRuleEditorState::reject() {
+ kdDebug() << "void KMFRuleEditorState::reject()" << endl;
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleeditorstate.moc"
diff --git a/kmyfirewall/ruleoptionplugins/state_option/kmfruleeditorstate.h b/kmyfirewall/ruleoptionplugins/state_option/kmfruleeditorstate.h
new file mode 100644
index 0000000..1d468d6
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/state_option/kmfruleeditorstate.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ begin : Wed Mar 13 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITORSTATE_H
+#define KMFRULEEDITORSTATE_H
+#include "kmyfirewallruleeditorstate.h"
+
+#include <qwidget.h>
+namespace KMF {
+class IPTRule;
+/**
+ *@author Christian Hubinger
+ */
+
+class KMFRuleEditorState : public KMyFirewallRuleEditorState {
+ Q_OBJECT
+public:
+ KMFRuleEditorState( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFRuleEditorState();
+ QPtrList<QString>* options;
+
+ void loadRule( IPTRule* );
+public slots: // Public slots
+ void slotOk();
+ void readRuleConfig();
+ void slotHelp();
+ void reject();
+
+private:
+ IPTRule* m_rule;
+
+signals:
+/* void sigAddRuleOpt( QString*, QPtrList<QString>* );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );*/
+ void sigHideMe();
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/state_option/kmfruleoption_state_option.xml b/kmyfirewall/ruleoptionplugins/state_option/kmfruleoption_state_option.xml
new file mode 100644
index 0000000..0d55f5c
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/state_option/kmfruleoption_state_option.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="state_opt" guiName="Stateful Inspection">
+ <option guiName="" command="--match state" />
+ <option guiName="Match State:" command="--state" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/state_option/kmfruleoptionedit_state.desktop b/kmyfirewall/ruleoptionplugins/state_option/kmfruleoptionedit_state.desktop
new file mode 100644
index 0000000..3226d38
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/state_option/kmfruleoptionedit_state.desktop
@@ -0,0 +1,56 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall State option edit
+Name[bg]=Редактиране на настройките по състояние на KMyFirewall
+Name[ca]=Editor de les opcions Estat de KMyFirewall
+Name[cs]=Editace stavových voleb KMyFirewall
+Name[da]=KMyFirewall redigeringstilvalg for tilstand
+Name[de]=KMyFirewall Status-Optionen-Editor
+Name[el]=Επεξεργασία επιλογής κατάστασης για το KMyFirewall
+Name[es]=Editor de KMyFirewall para las opciones State
+Name[et]=KMyFirewalli olekuvõtmete redigeerimine
+Name[fr]=Édition des options d'états de KMyFirewall
+Name[gl]=Edizón de opzóns de Estado de KMyFirewall
+Name[hi]=के-माइ-फायरवाल स्थिति विकल्प संपादन
+Name[it]=Modifica delle opzioni di stato di KMyFirewall
+Name[ka]=KMyFirewall მდგომარეობის პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - State-optie bewerken
+Name[pa]=KMyFirewall State ਚੋਣ ਸੋਧ
+Name[pt]=Edição da opção Estado do KMFirewall
+Name[pt_BR]=Edição da opção State do KMyFirewall
+Name[ru]=KMyFirewall - Состояние
+Name[sr]=KMyFirewall-ово уређивање опција стања
+Name[sr@Latn]=KMyFirewall-ovo uređivanje opcija stanja
+Name[sv]=Redigera tillståndsalternativ i Min brandvägg
+Name[ta]=KMyFirewall நிலை தேர்வினை தொகு
+Name[tr]=KMyFirewall Durum seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall State option editxx
+Comment=Plugin for editing iptables rule State options
+Comment[bg]=Приставка за редактиране на правилата за състояние на iptables
+Comment[ca]=Connector per editar les opcions d'estat de les regles de iptables
+Comment[cs]=Modul pro editaci stavových pravidel iptables
+Comment[da]=Plugin til redigering af regeltilvalg for tilstand
+Comment[de]=Modul für benutzerdefinierte Status-basierten IP-Regel Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων iptables με βάση την κατάσταση
+Comment[es]=Un complemento para editar las opciones de las reglas de iptables State
+Comment[et]=Plugin IPTablesi reegli olekuvõtmete redigeerimiseks
+Comment[fr]=Module d'édition des options de règles IPTables d'états
+Comment[gl]=Extensión para editar a opzón de Estado das regras de iptables
+Comment[hi]=आईपी-टेबल्स नियम स्थिति विकल्प का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni di stato delle regole di iptables
+Comment[ka]=iptables წესთა მდგომარეობის რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van State iptables-regelopties
+Comment[pt]='Plugin' para editar opções de Estado de regras iptables
+Comment[pt_BR]=Plug-in para a edição de regras do iptables para opções State
+Comment[ru]=Модуль для правки правила iptables State
+Comment[sr]=Прикључак за уређивање iptables правила „опције стања“
+Comment[sr@Latn]=Priključak za uređivanje iptables pravila „opcije stanja“
+Comment[sv]=Insticksprogram för att redigera tillståndsregelalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி நிலை தேர்வு தொகுப்பின் சொருகுபொருள்
+Comment[tr]=iptables kural durum seçeneklerini düzenlemek için eklenti
+Comment[xx]=xxPlugin for editing iptables rule State optionsxx
+X-KDE-Library=libkmfruleoptionedit_state
+ServiceTypes=KMyFirewall/RuleOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/state_option/kmfruleoptioneditstate.cpp b/kmyfirewall/ruleoptionplugins/state_option/kmfruleoptioneditstate.cpp
new file mode 100644
index 0000000..8b1465e
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/state_option/kmfruleoptioneditstate.cpp
@@ -0,0 +1,126 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruleoptioneditstate.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditorstate.h"
+
+namespace KMF {
+KMFRuleOptionEditState::KMFRuleOptionEditState(QObject *parent, const char *name)
+ : KMFRuleOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleOptionEditState::KMFRuleOptionEditState(QObject *parent, const char *name)" << endl;
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditorState( 0 , "Edit", 0 );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+
+KMFRuleOptionEditState::~KMFRuleOptionEditState() {}
+
+void KMFRuleOptionEditState::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleOptionEditState::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+const QString& KMFRuleOptionEditState::optionEditName() const {
+ return *( new QString( i18n("State Option") ) );
+}
+const QString& KMFRuleOptionEditState::description() const {
+ return *( new QString( i18n("This plugin manages the State options for iptables rules.") ) );
+}
+
+void KMFRuleOptionEditState::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleOptionEditState::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleOptionEditState::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleOptionEditState::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleOptionEditStateFactory::s_instance = 0L;
+// KAboutData* KMFRuleOptionEditStateFactory::s_about = 0L;
+
+KMFRuleOptionEditStateFactory::KMFRuleOptionEditStateFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleOptionEditStateFactory" );
+}
+
+QObject* KMFRuleOptionEditStateFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleOptionEditState( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleOptionEditStateFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleOptionEditStateFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruleoptionedit_state() {
+ return new KMFRuleOptionEditStateFactory;
+ }
+}
+
+}
+
+
+#include "kmfruleoptioneditstate.moc"
diff --git a/kmyfirewall/ruleoptionplugins/state_option/kmfruleoptioneditstate.h b/kmyfirewall/ruleoptionplugins/state_option/kmfruleoptioneditstate.h
new file mode 100644
index 0000000..469db58
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/state_option/kmfruleoptioneditstate.h
@@ -0,0 +1,87 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULEOPTIONEDITSTATE_H
+#define KMFRULEOPTIONEDITSTATE_H
+
+#include "../../core/kmfruleoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+class KInstance;
+namespace KMF {
+class IPTRule;
+class KMFRuleEditorState;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleOptionEditState : public KMFRuleOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditState(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleOptionEditState();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditorState *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleOptionEditStateFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditStateFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleOptionEditStateFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+
+}
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/state_option/kmyfirewallruleeditorstate.ui b/kmyfirewall/ruleoptionplugins/state_option/kmyfirewallruleeditorstate.ui
new file mode 100644
index 0000000..b9b7ff5
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/state_option/kmyfirewallruleeditorstate.ui
@@ -0,0 +1,438 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorState</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorState</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>493</width>
+ <height>361</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Configure Connection Tracking</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="text">
+ <string>Connection Tracking Options</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignCenter</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>gb_conntrack</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Configure Connection Tracking</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>c_use_conntrack</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Use connection tracking</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>c_new</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>NEW</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>c_related</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>RELATED</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>c_established</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>ESTABLISHED</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>c_invalid</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>INVALID</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Packets that are associated with a connection that has packets sent in both directions.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Packets that are not associated with any known connection.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel6</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Packets that are associated with an existing bi-directional connection and start a new connection (e.g. FTP).</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Packets that start new connections and are not associated with any known connection.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Match packets with state:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout18</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>90</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_help</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>90</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorState</receiver>
+ <slot>slotOk()</slot>
+ </connection>
+ <connection>
+ <sender>c_use_conntrack</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_new</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_conntrack</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_related</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_conntrack</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_established</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_conntrack</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>c_invalid</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_conntrack</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel3</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_conntrack</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel6</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_conntrack</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel5</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_conntrack</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel4</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>c_use_conntrack</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_help</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorState</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorState</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>slotOk()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/tos_option/Makefile.am b/kmyfirewall/ruleoptionplugins/tos_option/Makefile.am
new file mode 100644
index 0000000..8aa8361
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_option/Makefile.am
@@ -0,0 +1,24 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruleoptionedit_tos.la
+
+libkmfruleoptionedit_tos_la_LDFLAGS = -module -no-undefined $(all_libraries) \
+ $(KDE_PLUGIN)
+libkmfruleoptionedit_tos_la_LIBADD = \
+ ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruleoptionedittos.h kmfruleeditortos.h
+
+libkmfruleoptionedit_tos_la_SOURCES = kmfruleoptionedittos.cpp kmfruleeditortos.cpp kmyfirewallruleeditortos.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruleoptionedit_tos.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_tos_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_tos_option.xml
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_tos_option.xml
+
+
+
diff --git a/kmyfirewall/ruleoptionplugins/tos_option/kmfruleeditortos.cpp b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleeditortos.cpp
new file mode 100644
index 0000000..e2951cf
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleeditortos.cpp
@@ -0,0 +1,219 @@
+/***************************************************************************
+ begin : Wed Mar 27 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfruleeditortos.h"
+
+// QT includes
+#include <qcombobox.h>
+#include <qcheckbox.h>
+#include <qstring.h>
+#include <qlabel.h>
+#include <qgroupbox.h>
+
+// kde includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kapplication.h>
+
+// project includes
+#include "../../core/xmlnames.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+namespace KMF {
+KMFRuleEditorTos::KMFRuleEditorTos( QWidget *parent, const char *name, WFlags fl ) : KMyFirewallRuleEditorTos( parent, name, fl ) {
+ m_option_type = "CHECKTOS";
+}
+KMFRuleEditorTos::~KMFRuleEditorTos() {}
+
+void KMFRuleEditorTos::setType( const QString& type ) {
+ m_option_type = type;
+ if ( m_option_type == "SETTOS" ) {
+ gb_title->setTitle( i18n( "Set Type of Service" ) );
+ c_use_tos->setText( i18n( "Set TOS" ) );
+ setItems();
+ } else if ( m_option_type == "CHECKTOS" ) {
+ gb_title->setTitle( i18n( "Match Type of Service" ) );
+ c_use_tos->setText( i18n( "Check TOS" ) );
+ setItems();
+ } else if ( m_option_type == "REJECTTYPE" ) {
+ gb_title->setTitle( i18n( "Reject with icmp-type" ) );
+ c_use_tos->setText( i18n( "Reject with type:" ) );
+ setItems();
+ }
+}
+
+void KMFRuleEditorTos::loadRule( IPTRule* rule ) {
+ kdDebug() << "void KMFRuleEditorTos::loadRule( IPTRule* rule )" << endl;
+ m_rule = rule;
+ if ( m_option_type == "SETTOS" ) {
+ setItems();
+ IPTRuleOption* opt = rule->getOptionForName("target_set_tos_opt");
+ if ( ! opt ->isEmpty()) {
+ QStringList values = opt->getValues();
+ QString val = *values.at(0);
+ if ( val != XML::Undefined_Value ) {
+ c_use_tos->setChecked( true );
+ int index = getItemNum( val );
+ if ( index > 0 )
+ cb_tos->setCurrentItem( index );
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else if ( m_option_type == "CHECKTOS" ) {
+ setItems();
+ IPTRuleOption* opt = rule->getOptionForName("tos_opt");
+ if ( ! opt ->isEmpty() ) {
+ QStringList values = opt->getValues();
+ QString val = *values.at(0);
+ if ( val == XML::BoolOn_Value ) {
+ QString val2 = *values.at(1);
+ c_use_tos->setChecked( true );
+ int index = getItemNum( val2 );
+ if ( index > 0 )
+ cb_tos->setCurrentItem( index );
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else if ( m_option_type == "REJECTTYPE" ) {
+ setItems();
+ IPTRuleOption* opt = rule->getOptionForName("target_reject_type_opt");
+ if ( ! opt ->isEmpty() ) {
+ QStringList values = opt->getValues();
+ QString val = *values.at(0);
+ if ( val != XML::Undefined_Value) {
+ c_use_tos->setChecked( true );
+ int index = getItemNum( val );
+ if ( index > 0 )
+ cb_tos->setCurrentItem( index );
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else {
+ kdDebug() << "Misuse of this class no type set !!" << endl;
+ }
+}
+
+void KMFRuleEditorTos::accept() {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 TOS Option").arg( m_rule->name() )
+ );
+ if ( m_option_type == "SETTOS" ) {
+ bool use_tos = c_use_tos->isChecked();
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "target_set_tos_opt" );
+ if ( use_tos ) {
+ QString val = cb_tos->currentText();
+ options->append( new QString( val ) );
+ } else {
+ options->append( new QString( XML::BoolOff_Value) );
+ }
+ // emit sigAddTargetOpt( name, options );
+ m_rule->addTargetOption( *name, *options );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigDocumentChanged();
+ } else if ( m_option_type == "CHECKTOS" ) {
+ bool use_tos = c_use_tos->isChecked();
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "tos_opt" );
+ if ( use_tos ) {
+ QString val = cb_tos->currentText();
+ options->append( new QString( XML::BoolOn_Value) );
+ options->append( new QString( val ) );
+ } else {
+ options->append( new QString( XML::BoolOff_Value) );
+ }
+ // emit sigAddRuleOpt( name, options );
+ m_rule->addRuleOption( *name, *options );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+
+ } else if ( m_option_type == "REJECTTYPE" ) {
+ bool use_tos = c_use_tos->isChecked();
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "target_reject_type_opt" );
+ if ( use_tos ) {
+ QString val = cb_tos->currentText();
+ options->append( new QString( val ) );
+ } else {
+ options->append( new QString( XML::BoolOff_Value) );
+ }
+ // emit sigAddTargetOpt( name, options );
+ m_rule->addTargetOption( *name, *options );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+ }
+ KMFUndoEngine::instance()->abortTransaction();
+}
+
+void KMFRuleEditorTos::setItems() {
+ kdDebug() << "void KMFRuleEditorTos::setItems(const QString& type)" << endl;
+ cb_tos->clear();
+ if ( m_option_type == "SETTOS" || m_option_type == "CHECKTOS" ) {
+ cb_tos->insertItem( "Normal-Service" );
+ cb_tos->insertItem( "Minimize-Cost" );
+ cb_tos->insertItem( "Maximize-Reliability" );
+ cb_tos->insertItem( "Maximize-Throughput" );
+ cb_tos->insertItem( "Minimize-Delay" );
+ } else if ( m_option_type == "REJECTTYPE" ) {
+ cb_tos->insertItem( "icmp-port-unreachable" );
+ cb_tos->insertItem( "icmp-net-unreachable" );
+ cb_tos->insertItem( "icmp-host-unreachable" );
+ cb_tos->insertItem( "icmp-proto-unreachable" );
+ cb_tos->insertItem( "icmp-net-prohibited" );
+ cb_tos->insertItem( "icmp-host-prohibited" );
+ }
+}
+
+int KMFRuleEditorTos::getItemNum( const QString& option ) {
+ kdDebug() << "int KMFRuleEditorTos::getItemNum(const QString& option)" << endl;
+ int index = -1;
+ for ( int i = 0; i < cb_tos->count(); i++ ) {
+ QString tmp_item = cb_tos->text( i );
+ if ( tmp_item == option ) {
+ index = i;
+ }
+ }
+ return index;
+}
+
+void KMFRuleEditorTos::slotHelp() {
+ kdDebug() << "void KMFRuleEditorTos::slotHelp()" << endl;
+ kapp->invokeHelp( "tos" );
+}
+
+void KMFRuleEditorTos::reject() {
+ kdDebug() << "void KMFRuleEditorTos::reject()" << endl;
+ loadRule(m_rule);
+ emit sigHideMe();
+}
+
+}
+#include "kmfruleeditortos.moc"
diff --git a/kmyfirewall/ruleoptionplugins/tos_option/kmfruleeditortos.h b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleeditortos.h
new file mode 100644
index 0000000..7f5e732
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleeditortos.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ begin : Wed Mar 27 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITORTOS_H
+#define KMFRULEEDITORTOS_H
+#include "kmyfirewallruleeditortos.h"
+
+#include <qwidget.h>
+#include <qptrlist.h>
+#include <qstring.h>
+namespace KMF {
+class IPTRule;
+
+/**
+ *@author Christian Hubinger
+ */
+
+class KMFRuleEditorTos : public KMyFirewallRuleEditorTos {
+ Q_OBJECT
+public:
+ KMFRuleEditorTos( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFRuleEditorTos();
+ QPtrList<QString>* options;
+
+ void loadRule( IPTRule* );
+ void setType( const QString& type );
+
+public slots:
+ void accept();
+ void reject();
+ void slotHelp();
+
+private: // data
+ QString m_option_type;
+ IPTRule *m_rule;
+ void setItems();
+ int getItemNum( const QString& option );
+signals:
+/* void sigAddRuleOpt( QString *, QPtrList<QString> * );
+ void sigDelRuleOpt( QString * );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );
+ void sigDelTargetOpt( QString * );*/
+ void sigDocumentChanged();
+ void sigHideMe();
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoption_tos_option.xml b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoption_tos_option.xml
new file mode 100644
index 0000000..0cd299b
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoption_tos_option.xml
@@ -0,0 +1,7 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="tos_opt" guiName="Match TOS (Type Of Service)" >
+ <option guiName="" command="--match tos" />
+ <option guiName="TOS:" command="--tos" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedit_tos.desktop b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedit_tos.desktop
new file mode 100644
index 0000000..0770292
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedit_tos.desktop
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall Tos option edit
+Name[bg]=Редактиране на настройките на Tos на KMyFirewall
+Name[ca]=Editor de les opcions TOS de KMyFirewall
+Name[cs]=Editace TOP voleb KMyFirewall
+Name[da]=KMyFirewall Tos redigeringstilvalg
+Name[de]=KMyFirewall TOS-Optionen-Editor
+Name[el]=Επεξεργασία επιλογής Tos για το KMyFirewall
+Name[es]=Editor de KMyFirewall para las opciones Tos
+Name[et]=KMyFirewalli TOS võtmete redigeerimine
+Name[fr]=Édition des options Tos de KMyFirewall
+Name[gl]=Edizón de opzóns Tos de KMyFirewall
+Name[hi]=के-माइ-फायरवाल टीओएस विकल्प संपादन
+Name[it]=Modifica delle opzioni Tos di KMyFirewall
+Name[ja]=KMyFirewall Tos オプション編集
+Name[ka]=KMyFirewall Tos პარამეტრთა რედაქტორი
+Name[nl]=KMyFirewall - Tos-optie bewerken
+Name[pa]=KMyFirewall Tos ਚੋਣ ਸੋਧ
+Name[pt]=Edição da opção TOS do KMFirewall
+Name[pt_BR]=Edição da Opção Tos do KMyFirewall
+Name[ru]=KMyFirewall - TOS
+Name[sr]=KMyFirewall-ово уређивање TOS опција
+Name[sr@Latn]=KMyFirewall-ovo uređivanje TOS opcija
+Name[sv]=Redigera TOS-alternativ i Min brandvägg
+Name[ta]=KMyFirewall Tos தேர்வினை தொகு
+Name[tr]=KMyFirewall Tos seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall Tos option editxx
+Comment=Plugin for editing iptables rule Limit options
+Comment[bg]=Приставка за редактиране на настройките на правилата на iptables за ограничения
+Comment[ca]=Connector per editar les opcions Limit de les regles de iptables
+Comment[da]=Plugin til at redigere regelgrænsetilvalg for iptables
+Comment[de]=Modul für benutzerdefinierte Regel-Limit-Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων ορίου iptables
+Comment[es]=Un complemento para editar las opciones de las reglas Limit en iptables
+Comment[et]=Plugin IPTablesi reegli limiidivõtmete redigeerimiseks
+Comment[fr]=Module de modification des options de limites des règles d'IPTables
+Comment[gl]=Extensión para a edizón da opzón de Límite nas regras de iptables
+Comment[hi]=आईपी-टेबल्स नियम सीमा विकल्पों का संपादन करने हेतु प्लगइन
+Comment[it]=Plugin per modificare le opzioni delle regole iptables di limite
+Comment[ka]=iptables წესთა შეზღუდვების რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van iptables regellimiet-opties
+Comment[pa]=Plugin for editing iptables rule Limit ਚੋਣ
+Comment[pt]='Plugin' para editar opções de Limite de regras iptables
+Comment[pt_BR]=Plug-in para a edição de regras do iptables para opções Limit
+Comment[ru]=Модуль для правки правила iptables "Limit"
+Comment[sr]=Прикључак за уређивање iptables правила „опције ограничења“
+Comment[sr@Latn]=Priključak za uređivanje iptables pravila „opcije ograničenja“
+Comment[sv]=Insticksprogram för att redigera regelgränsalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி அளவு தேர்வு தொகுப்பின் சொருகுபொருள்
+Comment[tr]=iptables kuralı sınır seçeneğini düzenlemek için eklenti
+Comment[xx]=xxPlugin for editing iptables rule Limit optionsxx
+X-KDE-Library=libkmfruleoptionedit_tos
+ServiceTypes=KMyFirewall/RuleOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedittos.cpp b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedittos.cpp
new file mode 100644
index 0000000..4c961cd
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedittos.cpp
@@ -0,0 +1,131 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruleoptionedittos.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditortos.h"
+
+namespace KMF {
+KMFRuleOptionEditTos::KMFRuleOptionEditTos(QObject *parent, const char *name)
+ : KMFRuleOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleOptionEditTos::KMFRuleOptionEditTos(QObject *parent, const char *name)" << endl;
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditorTos( 0 , "Edit", 0 );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+
+KMFRuleOptionEditTos::~KMFRuleOptionEditTos() {}
+
+
+void KMFRuleOptionEditTos::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleOptionEditTos::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+
+const QString& KMFRuleOptionEditTos::optionEditName() const {
+ return *( new QString( i18n("Tos Option") ) );
+}
+const QString& KMFRuleOptionEditTos::description() const {
+ return *( new QString( i18n("This plugin manages the Tos options of iptables.") ) );
+}
+
+void KMFRuleOptionEditTos::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleOptionEditTos::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleOptionEditTos::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleOptionEditTos::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleOptionEditTosFactory::s_instance = 0L;
+// KAboutData* KMFRuleOptionEditTosFactory::s_about = 0L;
+
+KMFRuleOptionEditTosFactory::KMFRuleOptionEditTosFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleOptionEditTosFactory" );
+}
+
+QObject* KMFRuleOptionEditTosFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleOptionEditTos( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleOptionEditTosFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleOptionEditTosFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruleoptionedit_tos() {
+ return new KMFRuleOptionEditTosFactory;
+ }
+}
+
+}
+
+
+#include "kmfruleoptionedittos.moc"
diff --git a/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedittos.h b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedittos.h
new file mode 100644
index 0000000..0138e7d
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_option/kmfruleoptionedittos.h
@@ -0,0 +1,87 @@
+/***************************************************************************
+ Copyright (C) 2004 Christian Hubinger
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULEOPTIONEDITTOS_H
+#define KMFRULEOPTIONEDITTOS_H
+
+#include "../../core/kmfruleoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+class KInstance;
+namespace KMF {
+class IPTRule;
+class KMFRuleEditorTos;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleOptionEditTos : public KMFRuleOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditTos(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleOptionEditTos();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditorTos *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleOptionEditTosFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleOptionEditTosFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleOptionEditTosFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/tos_option/kmyfirewallruleeditortos.ui b/kmyfirewall/ruleoptionplugins/tos_option/kmyfirewallruleeditortos.ui
new file mode 100644
index 0000000..66ffd74
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_option/kmyfirewallruleeditortos.ui
@@ -0,0 +1,173 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorTos</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorTos</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>280</width>
+ <height>158</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>IP Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>gb_title</cstring>
+ </property>
+ <property name="title">
+ <string>TOS (Type Of Service) Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="1" column="0">
+ <item>
+ <property name="text">
+ <string>Normal-Service</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Minimize-Delay</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Maximize-Throughput</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Maximize-Reliability</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Minimize-Cost</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>cb_tos</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_use_tos</cstring>
+ </property>
+ <property name="text">
+ <string>TOS</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>layout30</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_cancel_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTos</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>c_use_tos</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_tos</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_cancel_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTos</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTos</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/ruleoptionplugins/tos_target_option/Makefile.am b/kmyfirewall/ruleoptionplugins/tos_target_option/Makefile.am
new file mode 100644
index 0000000..3bd6a4d
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_target_option/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = $(all_includes) -I../../kmfwidgets -I../../ipteditor
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkmfruletargetoptionedit_tos.la
+
+libkmfruletargetoptionedit_tos_la_LDFLAGS = -module -no-undefined \
+ $(all_libraries) $(KDE_PLUGIN)
+libkmfruletargetoptionedit_tos_la_LIBADD = \
+ ../../core/libkmfcore.la $(LIB_KPARTS)
+noinst_HEADERS = kmfruletargetoptionedittos.h kmfruleeditortos.h
+
+libkmfruletargetoptionedit_tos_la_SOURCES = kmfruletargetoptionedittos.cpp kmfruleeditortos.cpp kmyfirewallruleeditortos.ui
+
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kmfruletargetoptionedit_tos.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/
+ $(INSTALL_DATA) $(srcdir)/kmfruleoption_target_tos_reject_option.xml $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_target_tos_reject_option.xml
+
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/ruleoptions/kmfruleoption_target_tos_reject_option.xml
diff --git a/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleeditortos.cpp b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleeditortos.cpp
new file mode 100644
index 0000000..c552000
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleeditortos.cpp
@@ -0,0 +1,218 @@
+/***************************************************************************
+ begin : Wed Mar 27 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmfruleeditortos.h"
+
+// QT includes
+#include <qcombobox.h>
+#include <qcheckbox.h>
+#include <qstring.h>
+#include <qlabel.h>
+#include <qgroupbox.h>
+
+// kde includes
+#include <klocale.h>
+#include <kdebug.h>
+#include <kapplication.h>
+
+// project includes
+#include "../../core/xmlnames.h"
+#include "../../core/iptruleoption.h"
+#include "../../core/iptrule.h"
+#include "../../core/iptchain.h"
+#include "../../core/iptable.h"
+#include "../../core/kmfdoc.h"
+#include "../../core/kmfiptdoc.h"
+#include "../../core/kmfnetwork.h"
+#include "../../core/kmfundoengine.h"
+
+namespace KMF {
+KMFRuleEditorTos::KMFRuleEditorTos( QWidget *parent, const char *name, WFlags fl ) : KMyFirewallRuleEditorTos( parent, name, fl ) {
+ m_option_type = "SETTOS";
+}
+KMFRuleEditorTos::~KMFRuleEditorTos() {}
+
+void KMFRuleEditorTos::setType( const QString& type ) {
+ m_option_type = type;
+ if ( m_option_type == "SETTOS" ) {
+ gb_title->setTitle( i18n( "Set Type of Service" ) );
+ c_use_tos->setText( i18n( "Set TOS" ) );
+ setItems();
+ } else if ( m_option_type == "CHECKTOS" ) {
+ gb_title->setTitle( i18n( "Match Type of Service" ) );
+ c_use_tos->setText( i18n( "Check TOS" ) );
+ setItems();
+ } else if ( m_option_type == "REJECTTYPE" ) {
+ gb_title->setTitle( i18n( "Reject with icmp-type" ) );
+ c_use_tos->setText( i18n( "Reject with type:" ) );
+ setItems();
+ }
+}
+
+void KMFRuleEditorTos::loadRule( IPTRule* rule ) {
+ kdDebug() << "void KMFRuleEditorTos::loadRule( IPTRule* rule )" << endl;
+ m_rule = rule;
+ if ( m_option_type == "SETTOS" ) {
+ setItems();
+ IPTRuleOption* opt = rule->getOptionForName("target_set_tos_opt");
+ if ( ! opt ->isEmpty()) {
+ QStringList values = opt->getValues();
+ QString val = *values.at(0);
+ if ( val != XML::Undefined_Value) {
+ c_use_tos->setChecked( true );
+ int index = getItemNum( val );
+ if ( index > 0 )
+ cb_tos->setCurrentItem( index );
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else if ( m_option_type == "CHECKTOS" ) {
+ setItems();
+ IPTRuleOption* opt = rule->getOptionForName("tos_opt");
+ if ( ! opt ->isEmpty() ) {
+ QStringList values = opt->getValues();
+ QString val = *values.at(0);
+ if ( val != XML::Undefined_Value) {
+ c_use_tos->setChecked( true );
+ int index = getItemNum( val );
+ if ( index > 0 )
+ cb_tos->setCurrentItem( index );
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else if ( m_option_type == "REJECTTYPE" ) {
+ setItems();
+ IPTRuleOption* opt = rule->getOptionForName("target_reject_type_opt");
+ if ( ! opt ->isEmpty() ) {
+ QStringList values = opt->getValues();
+ QString val = *values.at(0);
+ if ( val != XML::Undefined_Value) {
+ c_use_tos->setChecked( true );
+ int index = getItemNum( val );
+ if ( index > 0 )
+ cb_tos->setCurrentItem( index );
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else {
+ c_use_tos->setChecked( false );
+ }
+ } else {
+ kdDebug() << "Misuse of this class no type set !!" << endl;
+ }
+}
+
+void KMFRuleEditorTos::accept() {
+ KMFUndoEngine::instance()->startTransaction(
+ m_rule,
+ i18n("Edit Rule: %1 TOS Target Option").arg( m_rule->name() )
+ );
+ if ( m_option_type == "SETTOS" ) {
+ bool use_tos = c_use_tos->isChecked();
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "target_set_tos_opt" );
+ if ( use_tos ) {
+ QString val = cb_tos->currentText();
+ options->append( new QString( val ) );
+ } else {
+ options->append( new QString( XML::BoolOff_Value) );
+ }
+ // emit sigAddTargetOpt( name, options );
+ m_rule->addTargetOption( *name, *options );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigDocumentChanged();
+ } else if ( m_option_type == "CHECKTOS" ) {
+ bool use_tos = c_use_tos->isChecked();
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "tos_opt" );
+ if ( use_tos ) {
+ QString val = cb_tos->currentText();
+ options->append( new QString( val ) );
+ } else {
+ options->append( new QString( XML::BoolOff_Value) );
+ }
+ // emit sigAddRuleOpt( name, options );
+ m_rule->addRuleOption( *name, *options );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+
+ } else if ( m_option_type == "REJECTTYPE" ) {
+ bool use_tos = c_use_tos->isChecked();
+ QPtrList<QString>* options = new QPtrList<QString>;
+ QString* name = new QString( "target_reject_type_opt" );
+ if ( use_tos ) {
+ QString val = cb_tos->currentText();
+ options->append( new QString( val ) );
+ } else {
+ options->append( new QString( XML::BoolOff_Value) );
+ }
+ // emit sigAddTargetOpt( name, options );
+ m_rule->addTargetOption( *name, *options );
+ KMFUndoEngine::instance()->endTransaction();
+ emit sigHideMe();
+ }
+}
+
+void KMFRuleEditorTos::setItems() {
+ kdDebug() << "void KMFRuleEditorTos::setItems(const QString& type)" << endl;
+ cb_tos->clear();
+ if ( m_option_type == "SETTOS" || m_option_type == "CHECKTOS" ) {
+ cb_tos->insertItem( "Normal-Service" );
+ cb_tos->insertItem( "Minimize-Cost" );
+ cb_tos->insertItem( "Maximize-Reliability" );
+ cb_tos->insertItem( "Maximize-Throughput" );
+ cb_tos->insertItem( "Minimize-Delay" );
+ } else if ( m_option_type == "REJECTTYPE" ) {
+ cb_tos->insertItem( "icmp-port-unreachable" );
+ cb_tos->insertItem( "icmp-net-unreachable" );
+ cb_tos->insertItem( "icmp-host-unreachable" );
+ cb_tos->insertItem( "icmp-proto-unreachable" );
+ cb_tos->insertItem( "icmp-net-prohibited" );
+ cb_tos->insertItem( "icmp-host-prohibited" );
+ }
+}
+
+int KMFRuleEditorTos::getItemNum( const QString& option ) {
+ kdDebug() << "int KMFRuleEditorTos::getItemNum(const QString& option)" << endl;
+ int index = -1;
+ for ( int i = 0; i < cb_tos->count(); i++ ) {
+ QString tmp_item = cb_tos->text( i );
+ if ( tmp_item == option ) {
+ index = i;
+ }
+ }
+ return index;
+}
+
+void KMFRuleEditorTos::slotHelp() {
+ kdDebug() << "void KMFRuleEditorTos::slotHelp()" << endl;
+ kapp->invokeHelp( "tos" );
+}
+
+void KMFRuleEditorTos::reject() {
+ kdDebug() << "void KMFRuleEditorTos::reject()" << endl;
+ loadRule(m_rule);
+ emit sigHideMe();
+}
+
+}
+
+#include "kmfruleeditortos.moc"
diff --git a/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleeditortos.h b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleeditortos.h
new file mode 100644
index 0000000..7f5e732
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleeditortos.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ begin : Wed Mar 27 2002
+ copyright : (C) 2002 by Christian Hubinger
+ email : chubinger@irrsinnig.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMFRULEEDITORTOS_H
+#define KMFRULEEDITORTOS_H
+#include "kmyfirewallruleeditortos.h"
+
+#include <qwidget.h>
+#include <qptrlist.h>
+#include <qstring.h>
+namespace KMF {
+class IPTRule;
+
+/**
+ *@author Christian Hubinger
+ */
+
+class KMFRuleEditorTos : public KMyFirewallRuleEditorTos {
+ Q_OBJECT
+public:
+ KMFRuleEditorTos( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
+ ~KMFRuleEditorTos();
+ QPtrList<QString>* options;
+
+ void loadRule( IPTRule* );
+ void setType( const QString& type );
+
+public slots:
+ void accept();
+ void reject();
+ void slotHelp();
+
+private: // data
+ QString m_option_type;
+ IPTRule *m_rule;
+ void setItems();
+ int getItemNum( const QString& option );
+signals:
+/* void sigAddRuleOpt( QString *, QPtrList<QString> * );
+ void sigDelRuleOpt( QString * );
+ void sigAddTargetOpt( QString*, QPtrList<QString>* );
+ void sigDelTargetOpt( QString * );*/
+ void sigDocumentChanged();
+ void sigHideMe();
+};
+}
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleoption_target_tos_reject_option.xml b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleoption_target_tos_reject_option.xml
new file mode 100644
index 0000000..cadacd4
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruleoption_target_tos_reject_option.xml
@@ -0,0 +1,9 @@
+<!DOCTYPE kmyfirewall-kmfruleoptiondefinition>
+<ruleoptiondefinitionset>
+<ruleoptiondefinition name="target_set_tos_opt" guiName="Set TOS (Type Of Service)">
+ <option guiName=" To TOS:" command="--set-tos" />
+</ruleoptiondefinition>
+<ruleoptiondefinition name="target_reject_type_opt" guiName="Reject With ICMP Type">
+ <option guiName="ICMP Type:" command="--reject-with" />
+</ruleoptiondefinition>
+</ruleoptiondefinitionset>
diff --git a/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedit_tos.desktop b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedit_tos.desktop
new file mode 100644
index 0000000..5b19dff
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedit_tos.desktop
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Exec=lbl
+Name=KMyFirewall TOS option edit
+Name[bg]=Редактиране на настройките на TOS на KMyFirewall
+Name[ca]=Editor de les opcions TOS de KMyFirewall
+Name[cs]=KMyFirewall editor TOS voleb
+Name[da]=KMyFirewall TOS redigeringstilvalg
+Name[de]=KMyFirewall TOS-Optionen-Editor
+Name[el]=Επεξεργασία επιλογής TOS για το KMyFirewall
+Name[es]=Editor de KMyFirewall para las opciones TOS
+Name[et]=KMyFirewalli TOS võtmete redigeerimine
+Name[fr]=Édition des options TOS de KMyFirewall
+Name[gl]=Edizón de opzóns TOS de KMyFirewall
+Name[hi]=के-माइ-फायरवाल टीओएस विकल्प संपादन
+Name[it]=Modifica delle opzioni TOS di KMyFirewall
+Name[ja]=KMyFirewall TOS オプション編集
+Name[ka]=KMyFirewall TOS პარამეტრთა რედაქტორი
+Name[nl]=KmyFirewall - TOS-optie bewerken
+Name[pa]=KMyFirewall TOS ਚੋਣ ਸੋਧ
+Name[pt]=Edição da opção TOS do KMFirewall
+Name[pt_BR]=Edição da Opção TOS do KMyFirewall
+Name[ru]=KMyFirewall - TOS
+Name[sr]=KMyFirewall-ово уређивање TOS опција
+Name[sr@Latn]=KMyFirewall-ovo uređivanje TOS opcija
+Name[sv]=Redigera TOS-alternativ i Min brandvägg
+Name[ta]=KMyFirewall TOS தேர்வினை தொகு
+Name[tr]=KMyFirewall TOS seçeneği düzenleyicisi
+Name[xx]=xxKMyFirewall TOS option editxx
+Comment=Plugin for editing TOS (Type Of Service) based iptables rule options
+Comment[bg]=Приставка за редактиране на базираните на TOS (Type Of Service) настройки на правилата на iptables
+Comment[ca]=Connector per editar les opcions de les regles de iptables basades en TOS (tipus de servei)
+Comment[cs]=Modul pro editaci iptables pravidel založených na TOS (Type Of Service)
+Comment[da]=Plugin til redigering af TOS (Type Of Service) baserede regeltilvalg for iptables
+Comment[de]=Modul für benutzerdefinierte TOS-basierten IP-Regel Optionen
+Comment[el]=Πρόσθετο επεξεργασίας κανόνων iptables με βάση το TOS (Type Of Service)
+Comment[es]=Un complemento para editar las opciones de las reglas de iptables TOS (tipo de servicio)
+Comment[et]=Plugin IPTablesi reegli teenuse tüübi (TOS) võtmete redigeerimiseks
+Comment[fr]=Module d'édition des options de règles IPTables TOS (type de service)
+Comment[gl]=Extensión para editar regras de iptables baseadas en TOS (Tipos de Servizo)
+Comment[hi]=टीओएस (टाइप ऑफ़ सर्विस) आधारित आईपीटेबल नियम विकल्पों का संपादन करने करने के लिए प्लगइन
+Comment[it]=Plugin per modificare le opzioni delle regole di iptables basate sul TOS (tipo di servizio)
+Comment[ka]=TOS (Type Of Service) დაფუძნებული iptables წესთა რედაქტირების მოდული
+Comment[nl]=Plugin voor het bewerken van TOS (Type Of Service) gebaseerde iptables-regelopties
+Comment[pt]='Plugin' para editar opções TOS (Tipo de Serviço) de regras iptables
+Comment[pt_BR]=Plugin para a edição do TOS (Type Of Service ou Tipo de Serviço) baseado em opções de regras do iptables
+Comment[ru]=Модуль для правки правила iptables на основе типов служб (Type Of Service)
+Comment[sr]=Прикључак за уређивање опција iptables правила на основу TOS-а (типа сервиса)
+Comment[sr@Latn]=Priključak za uređivanje opcija iptables pravila na osnovu TOS-a (tipa servisa)
+Comment[sv]=Insticksprogram för att redigera TOS (tjänsttyp)-baserade regelalternativ för IP-tabeller
+Comment[ta]=ip அட்டவணையை விதி தேர்வினை சார்ந்த TOS (சேவையின் வகை) தொகுப்பின் சொருகுபொருள்
+Comment[tr]= TOS (Servis Türü) tabanlı iptables kuralı seçeneklerini düzenlemek için eklenti
+Comment[xx]=xxPlugin for editing TOS (Type Of Service) based iptables rule optionsxx
+X-KDE-Library=libkmfruletargetoptionedit_tos
+ServiceTypes=KMyFirewall/RuleTargetOptionEdit
+
diff --git a/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedittos.cpp b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedittos.cpp
new file mode 100644
index 0000000..ebbda47
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedittos.cpp
@@ -0,0 +1,130 @@
+//
+// C++ Implementation: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kmfruletargetoptionedittos.h"
+
+
+// QT includes
+#include <qstring.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// Project includes
+#include "../../core/iptrule.h"
+#include "../../core/kmfruleeditinterface.h"
+#include "kmfruleeditortos.h"
+
+namespace KMF {
+KMFRuleTargetOptionEditTos::KMFRuleTargetOptionEditTos(QObject *parent, const char *name)
+ : KMFRuleTargetOptionEditInterface(parent, name) {
+ kdDebug() <<"KMFRuleTargetOptionEditTos::KMFRuleTargetOptionEditTos(QObject *parent, const char *name)" << endl;
+
+ m_managedTargets << "TOS" << "REJECT";
+
+
+ kdDebug() << "Parent has Type: " << parent->className() << endl;
+
+ m_edit = new KMFRuleEditorTos( 0 , "Edit", 0 );
+ m_edit->hide();
+
+ connect( m_edit,SIGNAL(sigHideMe() ),
+ this,SLOT( slotShowOverview() ) );
+}
+
+KMFRuleTargetOptionEditTos::~KMFRuleTargetOptionEditTos() {}
+
+void KMFRuleTargetOptionEditTos::slotShowOverview() {
+ if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
+ ruleedit->showOverview();
+ } else {
+ kdDebug() << "KMFRuleTargetOptionEditTos::slotShowOverview(): parent() not of type KMFRuleEditInterface" << endl;
+ }
+}
+
+const QString& KMFRuleTargetOptionEditTos::optionEditName() const {
+ return *( new QString( i18n("Protocol Option") ) );
+}
+const QString& KMFRuleTargetOptionEditTos::description() const {
+ return *( new QString( i18n("This plugin manages the Protocol based options of iptables.") ) );
+}
+
+void KMFRuleTargetOptionEditTos::loadRule( IPTRule* rule ) {
+ if ( !rule ) {
+ kdDebug() << "KMFRuleTargetOptionEditTos::loadRule( IPTRule* rule ) - rule == 0" << endl;
+ return;
+ }
+
+ m_edit->loadRule( rule );
+ m_rule = rule;
+
+}
+
+QWidget* KMFRuleTargetOptionEditTos::editWidget() {
+ if ( ! m_edit ) {
+ kdDebug() << "KMFRuleTargetOptionEditTos::editWidget() - m_edit == 0" << endl;
+ return 0;
+ }
+ return m_edit;
+}
+
+bool KMFRuleTargetOptionEditTos::setTarget( const QString& target ){
+ if ( ! manageTarget( target ) ) {
+ return false;
+ }
+ if ( target == "TOS")
+ m_edit->setType( "SETTOS" );
+ else
+ m_edit->setType( "REJECTTYPE" );
+ return true;
+}
+
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+// KInstance* KMFRuleTargetOptionEditTosFactory::s_instance = 0L;
+// KAboutData* KMFRuleTargetOptionEditTosFactory::s_about = 0L;
+
+KMFRuleTargetOptionEditTosFactory::KMFRuleTargetOptionEditTosFactory( QObject* parent, const char* name )
+ : KLibFactory( parent, name ) {
+// s_instance = new KInstance( "KMFRuleTargetOptionEditTosFactory" );
+}
+
+QObject* KMFRuleTargetOptionEditTosFactory::createObject( QObject* parent, const char* name,
+ const char*, const QStringList & ) {
+ QObject * obj = new KMFRuleTargetOptionEditTos( parent, name );
+ emit objectCreated( obj );
+ return obj;
+}
+
+
+// KInstance* KMFRuleTargetOptionEditTosFactory::instance() {
+// if ( !s_instance ) {
+// s_instance = new KInstance( "KMFRuleTargetOptionEditTosFactory" );
+// }
+// return s_instance;
+// }
+
+extern "C" {
+ void* init_libkmfruletargetoptionedit_tos() {
+ return new KMFRuleTargetOptionEditTosFactory;
+ }
+}
+
+
+}
+
+#include "kmfruletargetoptionedittos.moc"
diff --git a/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedittos.h b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedittos.h
new file mode 100644
index 0000000..ba44c3a
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_target_option/kmfruletargetoptionedittos.h
@@ -0,0 +1,76 @@
+//
+// C++ Interface: kmfruleoptioneditiip
+//
+// Description:
+//
+//
+// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KMFRULETARGETOPTIONEDITTOS_H
+#define KMFRULETARGETOPTIONEDITTOS_H
+
+#include "../../core/kmfruletargetoptioneditinterface.h"
+
+// KDE includes
+#include <kparts/part.h>
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+#include <kxmlgui.h>
+class KInstance;
+namespace KMF {
+class IPTRule;
+class KMFRuleEditorTos;
+/**
+@author Christian Hubinger
+*/
+class KMFRuleTargetOptionEditTos : public KMFRuleTargetOptionEditInterface {
+ Q_OBJECT
+public:
+ KMFRuleTargetOptionEditTos(QObject *parent = 0, const char *name = 0);
+
+ ~KMFRuleTargetOptionEditTos();
+ void loadRule( IPTRule* rule );
+ QWidget* editWidget();
+ const QString& optionEditName() const;
+ const QString& description() const;
+ bool setTarget( const QString& );
+
+private slots:
+ void slotShowOverview();
+
+private:
+ KMFRuleEditorTos *m_edit;
+ IPTRule *m_rule;
+
+};
+
+
+
+class KMFRuleTargetOptionEditTosFactory : public KLibFactory {
+ Q_OBJECT
+public:
+ KMFRuleTargetOptionEditTosFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KMFRuleTargetOptionEditTosFactory() {
+/* delete s_instance; */
+ };
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
+ const char* name = "QObject",
+ const QStringList &args = QStringList() );
+ /* static KInstance* instance(); */
+
+/*private:
+ static KInstance* s_instance;*/
+};
+}
+
+
+
+
+
+
+
+
+#endif
diff --git a/kmyfirewall/ruleoptionplugins/tos_target_option/kmyfirewallruleeditortos.ui b/kmyfirewall/ruleoptionplugins/tos_target_option/kmyfirewallruleeditortos.ui
new file mode 100644
index 0000000..66ffd74
--- /dev/null
+++ b/kmyfirewall/ruleoptionplugins/tos_target_option/kmyfirewallruleeditortos.ui
@@ -0,0 +1,173 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KMyFirewallRuleEditorTos</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KMyFirewallRuleEditorTos</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>280</width>
+ <height>158</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>IP Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>gb_title</cstring>
+ </property>
+ <property name="title">
+ <string>TOS (Type Of Service) Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="1" column="0">
+ <item>
+ <property name="text">
+ <string>Normal-Service</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Minimize-Delay</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Maximize-Throughput</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Maximize-Reliability</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Minimize-Cost</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>cb_tos</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>c_use_tos</cstring>
+ </property>
+ <property name="text">
+ <string>TOS</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>layout30</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_cancel_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>b_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>b_ok</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTos</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>c_use_tos</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>cb_tos</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>b_cancel_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTos</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+ <connection>
+ <sender>b_ok_2</sender>
+ <signal>clicked()</signal>
+ <receiver>KMyFirewallRuleEditorTos</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelp()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmyfirewall/version.h b/kmyfirewall/version.h
new file mode 100644
index 0000000..6121efb
--- /dev/null
+++ b/kmyfirewall/version.h
@@ -0,0 +1,19 @@
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef VERSION_H
+#define VERSION_H
+
+#define KMYFIREWALL_VERSION "1.1.1"
+#define COPYRIGHT_DATE "(c) 2001-2007"
+#define COPYRIGHT_OWNER "The KMyFirewall Team"
+#define COPYRIGHT_STRING "copyright (c) the KMyFirewall developers 2001-2007"
+#define MAINTAINER "Christian Hubinger <chubinegr@irrsinnig.org>"
+#define LICENSE "This program is distributed under the terms of the GPL v2"
+#endif
diff --git a/pics/Makefile.am b/pics/Makefile.am
new file mode 100644
index 0000000..0570290
--- /dev/null
+++ b/pics/Makefile.am
@@ -0,0 +1,131 @@
+EXTRA_DIST = reject.png target.png kmyfirewall-64.png kmyfirewall-48.png kmyfirewall-32.png kmyfirewall-22.png kmyfirewall-16.png kmyfirewall-48-lo.png kmyfirewall-32-lo.png kmyfirewall-16-lo.png rule-16.png rule-22.png rule-32.png rule-48.png rule-64.png
+
+install-data-local:
+
+# App icons
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_icondir)/hicolor/64x64/apps/
+ $(INSTALL_DATA) $(srcdir)/kmyfirewall-64.png $(DESTDIR)$(kde_icondir)/hicolor/64x64/apps/kmyfirewall.png
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_icondir)/hicolor/48x48/apps/
+ $(INSTALL_DATA) $(srcdir)/kmyfirewall-48.png $(DESTDIR)$(kde_icondir)/hicolor/48x48/apps/kmyfirewall.png
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_icondir)/hicolor/32x32/apps/
+ $(INSTALL_DATA) $(srcdir)/kmyfirewall-32.png $(DESTDIR)$(kde_icondir)/hicolor/32x32/apps/kmyfirewall.png
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_icondir)/hicolor/22x22/apps/
+ $(INSTALL_DATA) $(srcdir)/kmyfirewall-22.png $(DESTDIR)$(kde_icondir)/hicolor/22x22/apps/kmyfirewall.png
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_icondir)/hicolor/16x16/apps/
+ $(INSTALL_DATA) $(srcdir)/kmyfirewall-16.png $(DESTDIR)$(kde_icondir)/hicolor/16x16/apps/kmyfirewall.png
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_icondir)/Locolor/48x48/apps/
+ $(INSTALL_DATA) $(srcdir)/kmyfirewall-48-lo.png $(DESTDIR)$(kde_icondir)/Locolor/48x48/apps/kmyfirewall.png
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_icondir)/Locolor/32x32/apps/
+ $(INSTALL_DATA) $(srcdir)/kmyfirewall-32-lo.png $(DESTDIR)$(kde_icondir)/Locolor/32x32/apps/kmyfirewall.png
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_icondir)/Locolor/16x16/apps/
+ $(INSTALL_DATA) $(srcdir)/kmyfirewall-16-lo.png $(DESTDIR)$(kde_icondir)/Locolor/16x16/apps/kmyfirewall.png
+
+
+# Internal icons
+# KMFyFirewall
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/
+ $(INSTALL_DATA) $(srcdir)/kmf_snapshot_generic_interface.png $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/kmf_snapshot_generic_interface.png
+ $(INSTALL_DATA) $(srcdir)/kmf_snapshot_iptables_interface.png $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/kmf_snapshot_iptables_interface.png
+
+ $(INSTALL_DATA) $(srcdir)/reject.png $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/reject.png
+ $(INSTALL_DATA) $(srcdir)/target.png $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/target.png
+
+
+ $(INSTALL_DATA) $(srcdir)/splash.png $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/splash.png
+ $(INSTALL_DATA) $(srcdir)/splash_cut.png $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/splash_cut.png
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/16x16/actions/
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/22x22/actions/
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/32x32/actions/
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/48x48/actions/
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/64x64/actions/
+ $(INSTALL_DATA) $(srcdir)/rule-16.png $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/16x16/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/rule-22.png $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/22x22/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/rule-32.png $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/32x32/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/rule-48.png $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/48x48/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/rule-64.png $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/64x64/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/user_defined-16.png $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/16x16/actions/user_defined.png
+ $(INSTALL_DATA) $(srcdir)/builtin-16.png $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/16x16/actions/builtin.png
+ $(INSTALL_DATA) $(srcdir)/table-16.png $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/16x16/actions/table.png
+
+# KMFSysTray
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmfsystray/pics/
+
+ $(INSTALL_DATA) $(srcdir)/reject.png $(DESTDIR)$(kde_datadir)/kmfsystray/pics/reject.png
+ $(INSTALL_DATA) $(srcdir)/target.png $(DESTDIR)$(kde_datadir)/kmfsystray/pics/target.png
+
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/16x16/actions/
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/22x22/actions/
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/32x32/actions/
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/48x48/actions/
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/64x64/actions/
+ $(INSTALL_DATA) $(srcdir)/rule-16.png $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/16x16/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/rule-22.png $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/22x22/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/rule-32.png $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/32x32/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/rule-48.png $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/48x48/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/rule-64.png $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/64x64/actions/rule.png
+ $(INSTALL_DATA) $(srcdir)/user_defined-16.png $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/16x16/actions/user_defined.png
+ $(INSTALL_DATA) $(srcdir)/builtin-16.png $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/16x16/actions/builtin.png
+ $(INSTALL_DATA) $(srcdir)/table-16.png $(DESTDIR)$(kde_datadir)/kmfsystray/icons/hicolor/16x16/actions/table.png
+
+
+
+
+uninstall-local:
+ -rm -f $(DESTDIR)$(kde_icondir)/hicolor/64x64/apps/kmyfirewall.png
+ -rm -f $(DESTDIR)$(kde_icondir)/hicolor/48x48/apps/kmyfirewall.png
+ -rm -f $(DESTDIR)$(kde_icondir)/hicolor/32x32/apps/kmyfirewall.png
+ -rm -f $(DESTDIR)$(kde_icondir)/hicolor/22x22/apps/kmyfirewall.png
+ -rm -f $(DESTDIR)$(kde_icondir)/hicolor/16x16/apps/kmyfirewall.png
+ -rm -f $(DESTDIR)$(kde_icondir)/Locolor/48x48/apps/kmyfirewall.png
+ -rm -f $(DESTDIR)$(kde_icondir)/Locolor/32x32/apps/kmyfirewall.png
+ -rm -f $(DESTDIR)$(kde_icondir)/Locolor/16x16/apps/kmyfirewall.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/kmf_snapshot_generic_interface.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/kmf_snapshot_iptables_interface.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/reject.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/target.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/splash.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/pics/splash_cut.png
+
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/16x16/actions/rule.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/22x22/actions/rule.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/32x32/actions/rule.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/48x48/actions/rule.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/64x64/actions/rule.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/16x16/actions/user_defined.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/16x16/actions/builtin.png
+ -rm -f $(DESTDIR)$(kde_datadir)/kmyfirewall/icons/hicolor/16x16/actions/table.png
+
+ -rm -rf $(DESTDIR)$(kde_datadir)/kmyfirewall/pics
+ -rm -rf $(DESTDIR)$(kde_datadir)/kmyfirewall/icons
+
+####### kdevelop will overwrite this part!!! (end)############
+# These paths are KDE specific. Use them:
+# kde_appsdir Where your application's menu entry (.desktop) should go to.
+# kde_icondir Where your icon should go to - better use KDE_ICON.
+# kde_sounddir Where your sounds should go to.
+# kde_htmldir Where your docs should go to. (contains lang subdirs)
+# kde_datadir Where you install application data. (Use a subdir)
+# kde_locale Where translation files should go to. (contains lang subdirs)
+# kde_cgidir Where cgi-bin executables should go to.
+# kde_confdir Where config files should go to (system-wide ones with default values).
+# kde_mimedir Where mimetypes .desktop files should go to.
+# kde_servicesdir Where services .desktop files should go to.
+# kde_servicetypesdir Where servicetypes .desktop files should go to.
+# kde_toolbardir Where general toolbar icons should go to (deprecated, use KDE_ICON).
+# kde_wallpaperdir Where general wallpapers should go to.
+# kde_templatesdir Where templates for the "New" menu (Konqueror/KDesktop) should go to.
+# kde_bindir Where executables should go to. Use bin_PROGRAMS or bin_SCRIPTS.
+# kde_libdir Where shared libraries should go to. Use lib_LTLIBRARIES.
+# kde_moduledir Where modules (e.g. parts) should go to. Use kde_module_LTLIBRARIES.
+# kde_styledir Where Qt/KDE widget styles should go to (new in KDE 3).
+# kde_designerdir Where Qt Designer plugins should go to (new in KDE 3).
+
diff --git a/pics/builtin-16.png b/pics/builtin-16.png
new file mode 100644
index 0000000..1d365fa
--- /dev/null
+++ b/pics/builtin-16.png
Binary files differ
diff --git a/pics/flame.png b/pics/flame.png
new file mode 100644
index 0000000..c6bbc75
--- /dev/null
+++ b/pics/flame.png
Binary files differ
diff --git a/pics/kmf_snapshot_generic_interface.png b/pics/kmf_snapshot_generic_interface.png
new file mode 100644
index 0000000..520c3d7
--- /dev/null
+++ b/pics/kmf_snapshot_generic_interface.png
Binary files differ
diff --git a/pics/kmf_snapshot_iptables_interface.png b/pics/kmf_snapshot_iptables_interface.png
new file mode 100644
index 0000000..c7fde4d
--- /dev/null
+++ b/pics/kmf_snapshot_iptables_interface.png
Binary files differ
diff --git a/pics/kmyfirewall-16-lo.png b/pics/kmyfirewall-16-lo.png
new file mode 100644
index 0000000..070251d
--- /dev/null
+++ b/pics/kmyfirewall-16-lo.png
Binary files differ
diff --git a/pics/kmyfirewall-16.png b/pics/kmyfirewall-16.png
new file mode 100644
index 0000000..070251d
--- /dev/null
+++ b/pics/kmyfirewall-16.png
Binary files differ
diff --git a/pics/kmyfirewall-22.png b/pics/kmyfirewall-22.png
new file mode 100644
index 0000000..068d7f6
--- /dev/null
+++ b/pics/kmyfirewall-22.png
Binary files differ
diff --git a/pics/kmyfirewall-32-lo.png b/pics/kmyfirewall-32-lo.png
new file mode 100644
index 0000000..b0f74bb
--- /dev/null
+++ b/pics/kmyfirewall-32-lo.png
Binary files differ
diff --git a/pics/kmyfirewall-32.png b/pics/kmyfirewall-32.png
new file mode 100644
index 0000000..b0f74bb
--- /dev/null
+++ b/pics/kmyfirewall-32.png
Binary files differ
diff --git a/pics/kmyfirewall-48-lo.png b/pics/kmyfirewall-48-lo.png
new file mode 100644
index 0000000..219480b
--- /dev/null
+++ b/pics/kmyfirewall-48-lo.png
Binary files differ
diff --git a/pics/kmyfirewall-48.png b/pics/kmyfirewall-48.png
new file mode 100644
index 0000000..219480b
--- /dev/null
+++ b/pics/kmyfirewall-48.png
Binary files differ
diff --git a/pics/kmyfirewall-64.png b/pics/kmyfirewall-64.png
new file mode 100644
index 0000000..00ada3c
--- /dev/null
+++ b/pics/kmyfirewall-64.png
Binary files differ
diff --git a/pics/reject.png b/pics/reject.png
new file mode 100644
index 0000000..b486c7e
--- /dev/null
+++ b/pics/reject.png
Binary files differ
diff --git a/pics/rule-16.png b/pics/rule-16.png
new file mode 100644
index 0000000..91a7720
--- /dev/null
+++ b/pics/rule-16.png
Binary files differ
diff --git a/pics/rule-22.png b/pics/rule-22.png
new file mode 100644
index 0000000..4c59431
--- /dev/null
+++ b/pics/rule-22.png
Binary files differ
diff --git a/pics/rule-32.png b/pics/rule-32.png
new file mode 100644
index 0000000..3d6de4e
--- /dev/null
+++ b/pics/rule-32.png
Binary files differ
diff --git a/pics/rule-48.png b/pics/rule-48.png
new file mode 100644
index 0000000..cfe0606
--- /dev/null
+++ b/pics/rule-48.png
Binary files differ
diff --git a/pics/rule-64.png b/pics/rule-64.png
new file mode 100644
index 0000000..1062229
--- /dev/null
+++ b/pics/rule-64.png
Binary files differ
diff --git a/pics/splash.png b/pics/splash.png
new file mode 100644
index 0000000..8ae6256
--- /dev/null
+++ b/pics/splash.png
Binary files differ
diff --git a/pics/splash_cut.png b/pics/splash_cut.png
new file mode 100644
index 0000000..c0b9e28
--- /dev/null
+++ b/pics/splash_cut.png
Binary files differ
diff --git a/pics/table-16.png b/pics/table-16.png
new file mode 100644
index 0000000..632623f
--- /dev/null
+++ b/pics/table-16.png
Binary files differ
diff --git a/pics/target.png b/pics/target.png
new file mode 100644
index 0000000..2999cb1
--- /dev/null
+++ b/pics/target.png
Binary files differ
diff --git a/pics/user_defined-16.png b/pics/user_defined-16.png
new file mode 100644
index 0000000..c1cdee7
--- /dev/null
+++ b/pics/user_defined-16.png
Binary files differ
diff --git a/stamp-h.in b/stamp-h.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/stamp-h.in
diff --git a/subdirs b/subdirs
new file mode 100644
index 0000000..67f4bf0
--- /dev/null
+++ b/subdirs
@@ -0,0 +1,6 @@
+KMFIPTInterface
+KMFSysTray
+doc
+kmyfirewall
+pics
+templates
diff --git a/templates/02_workstation_template.tkmfgrs b/templates/02_workstation_template.tkmfgrs
new file mode 100644
index 0000000..7702051
--- /dev/null
+++ b/templates/02_workstation_template.tkmfgrs
@@ -0,0 +1,43 @@
+<!DOCTYPE kmyfirewall-ruleset>
+<kmfgrs>
+<netzone guiName="Incoming Connections" id="13" name="incoming_world" description="This is the global zone that contains
+all valid IP addresses." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+<protocol logging="yes" limit="1/second" io="OUTGOING" id="19" name="SSH" description="Protocol used to enable a secure remote shell connection." >
+ <port protocol="TCP" num="22" />
+</protocol>
+</netzone>
+<netzone guiName="Outgoing Connections" id="14" name="outgoing_world" description="This is the global zone that contains
+all valid IP addresses." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Forbidden Clients" id="17" name="badClients_hosts" description="Hosts in this zone will not be able
+to use services your computer provides." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Forbidden Servers" id="18" name="badServers_hosts" description="You will not be able to use the services
+of the hosts in that list." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Malicious Hosts" id="16" name="malicious_hosts" description="Traffic coming from and going to hosts
+will be dropped always." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Trusted Hosts" id="15" name="trusted_hosts" description="Traffic coming from and going to hosts
+will be accepted always.
+Only add really trusted Hosts to this Zone" >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+ <abstract restrictOutgoingConnections="bool:off" allowIncomingConnections="bool:on" name="Workstation Template" description="Simple configuration for an typical workstation environment.
+Just allow ssh connections from other hosts." />
+ <logging logPrefix="KMF: " logDropped="bool:on" limitLog="bool:on" />
+ <icmp limitPingReply="bool:on" allowPingReply="bool:on" />
+ <nat natAddress="0.0.0.0" useMasquerade="bool:off" useNat="bool:off" outgoingInterface="bool:off" />
+</kmfgrs>
+
diff --git a/templates/02_workstation_template.tkmfrs b/templates/02_workstation_template.tkmfrs
new file mode 100644
index 0000000..e629dca
--- /dev/null
+++ b/templates/02_workstation_template.tkmfrs
@@ -0,0 +1,401 @@
+<!DOCTYPE kmyfirewall-ruleset>
+<kmfnet maxVersion="~" minVersion="1.1.0" version="1.1.0" interface="iptables" uuid="{41b36b2b-68e2-4545-b34d-3cf3609c204f}" >
+<netzone guiName="Gloabl Network" readonly="bool:on" uuid="{3349418e-3923-4f3c-933c-b1bd91a2c84a}" name="mynetwork" description="This is the global zone that contains all valid IP addresses." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+<target sshPort="22" address="127.0.0.1" guiName="My Local Computer" readonly="bool:on" uuid="{42bc1c1f-996f-4f60-a6e3-3e43cd6f0167}" name="localhost" description="Local copmuter running KMyFirewall" >
+<targetconfig uuid="{c3d33a7a-5ba9-45cc-8f34-1617b773e08f}" name="Untitled" description="No Description Available" >
+ <os name="linux" />
+ <backend name="iptables" />
+ <distribution name="" />
+ <initPath name="" />
+ <IPTPath name="" />
+ <modprobePath name="" />
+ <rcDefaultPath name="" />
+</targetconfig>
+ <kmfrs maxVersion="~" minVersion="1.0.0" version="1.1.0" uuid="{8af7181a-bf52-47e3-a00e-2204f8cff57c}" >
+ <abstract use_nat="no" use_filter="yes" use_syn_cookies="yes" use_ipfwd="yes" use_martians="yes" use_modules="yes" use_rp_filter="yes" name="Workstation Template" use_mangle="no" description="This is a template configuration for a typical workstation that does not do any routing.
+Use this as a startingpoint for your firewall setup." />
+<table uuid="{24e22827-5d99-49a3-8767-b9cf25371f7c}" name="filter" description="This table is the main table for filtering
+packets. Here you may define your
+access control rules" >
+<chain default_target="DROP" builtin="yes" uuid="{414166ad-b58e-41e8-8a8f-a9962e769bd1}" name="INPUT" description="In this chain you can filter packets that
+are addressed directly to this computer." >
+<rule num="0" logging="no" target="ICMP_FILTER" custom_rule="no" uuid="{ac00d50c-60b1-4596-9fe6-be5843be3cf4}" name="FWD_ICMP_FILTER" enabled="yes" description="Forward to the chain that handles ICPM packets
+to avoid crap like source-quench etc." />
+<rule num="1" logging="no" target="ANTISPOOF" custom_rule="no" uuid="{214725fa-4179-46e4-800d-5914741921e9}" name="FWD_ANTISPOOF" enabled="yes" description="Forward packets to the ANTISPOOF chain
+which performes some sainity checks for
+the packets to avoid spoofing." />
+<rule num="2" logging="no" target="TCP_CHECKS" custom_rule="no" uuid="{af2b8ac5-3f43-4679-b189-9f031921b7a7}" name="FWD_TCP_CHECKS" enabled="yes" description="Forward to chian TCP_CHECKS which
+filters invalid TCP flag combinations." >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{b5626a02-1808-444a-9e61-e6484318cb8c}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="3" logging="no" target="SERVICES" custom_rule="no" uuid="{f334a3b2-7f69-48d6-8594-54e2a5c4ef60}" name="FWD_SERVICES" enabled="yes" description="This rule forwards all packetst to the SERVICES chain.
+This chain is ment to be used for rules that allow
+access to this host e.g. http if you are running a web
+server." />
+<rule num="4" logging="no" target="ACCEPT" custom_rule="no" uuid="{bece6068-58e4-4cef-83b4-9513d574d471}" name="CONNTRACK" enabled="yes" description="This rule handles the connecktion tracking.
+It simply lets everything in that is a response
+to a network request you made." >
+<ruleoption targetoption="no" type="state_opt" uuid="{0210e1d2-769e-4495-8089-781d20ca2c3a}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="RELATED,ESTABLISHED" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="5" logging="no" target="ACCEPT" custom_rule="no" uuid="{4dc5f9cf-d19b-4030-998d-166ada82d814}" name="LOOPBACK" enabled="yes" description="Allow packets send from the loopback interface" >
+<ruleoption targetoption="no" type="interface_opt" uuid="{d53aa556-afd8-4906-867a-943747470965}" >
+ <ruleoptionvalue value0="lo" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="6" logging="no" target="VPNs" custom_rule="no" uuid="{8508ed2b-7afd-426c-b959-c61583f5ee6c}" name="FWD_VPN" enabled="yes" description="Forward rule for packets coming from a VPN network 192.168.2.0/24" >
+<ruleoption targetoption="no" type="ip_opt" uuid="{40e4dd9e-cf4e-444a-8b26-1b4fd8f137a8}" >
+ <ruleoptionvalue value0="192.168.2.1/24" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain default_target="ACCEPT" builtin="yes" uuid="{e97ee9d7-871f-49f0-b2a0-1912292a2071}" name="OUTPUT" description="In this chain you can decide which
+packets are allowed to be sent away
+from this computer." />
+<chain default_target="DROP" builtin="yes" uuid="{f437654c-62e4-4fee-b129-99ee59755394}" name="FORWARD" description="In this chain you can filter the packets
+that are routed to other hosts by this
+computer." />
+<chain builtin="no" uuid="{a0f476e7-9540-4260-9f61-de89d033fd3e}" name="ANTISPOOF" description="Packet spoof protection is done in
+this chain." >
+<rule num="0" logging="no" target="DROP" custom_rule="no" uuid="{b1e735e2-1b31-4b74-9c14-8613abf8b29c}" name="loopback_spoof" enabled="yes" description="Check if packets are really from the loaclhost." >
+<ruleoption targetoption="no" type="interface_opt" uuid="{774afbfa-c082-4084-878f-69bd9d193104}" >
+ <ruleoptionvalue value0="! lo" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+<ruleoption targetoption="no" type="ip_opt" uuid="{0ff372ce-3e46-499c-9512-0dae87cb2df8}" >
+ <ruleoptionvalue value0="127.0.0.0/8" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain builtin="no" uuid="{49b1df3f-fb0e-4745-9547-612e350101af}" name="SERVICES" description="This rule allows other computer to connect to us on udp port 53" >
+<rule num="0" logging="no" target="ACCEPT" custom_rule="no" uuid="{b5812bdf-cb51-456d-882a-bf7d82f8e13b}" name="Exapmle_DNS" enabled="no" description="This rule allows other computer to connect to us on udp port 53" >
+<ruleoption targetoption="no" type="udp_opt" uuid="{a4b99995-a68d-4163-a931-c8904a138140}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="1024:65535" />
+ <ruleoptionvalue value2="53" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="1" logging="no" target="ACCEPT" custom_rule="no" uuid="{11af5582-60d6-43d5-81b5-18bba8edb31f}" name="Example_SSH" enabled="yes" description="Example rule that allows other to connect
+to your couputer using ssh e.g. tcp port 22" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{22b2c038-2be6-4997-9430-2340f29ba766}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="1024:65535" />
+ <ruleoptionvalue value2="22" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain builtin="no" uuid="{28e8c0e7-84b9-431b-a636-c18777af661b}" name="ICMP_FILTER" description="Here some ICMP packet types are
+filtered to avoid denial of service attacks." >
+<rule num="0" logging="no" target="ACCEPT" custom_rule="no" uuid="{5740f895-e5b8-4b6c-ae75-a07df328b8a0}" name="ping" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="icmp_opt" uuid="{9cf0dfd0-9523-49a0-b7dc-f78b9c759dc2}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="echo-request" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="1" logging="no" target="ACCEPT" custom_rule="no" uuid="{f753a6a0-b7c3-47cd-b08a-ebac149220a8}" name="ping_reply" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="icmp_opt" uuid="{3a184346-683e-4535-99d2-ffe14f034984}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="echo-reply" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="2" logging="no" target="ACCEPT" custom_rule="no" uuid="{9aee9939-1a7b-4f71-a500-635f2ce6793d}" name="host_unreachable" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="icmp_opt" uuid="{fdb12c22-e453-4fbb-aafb-c3cc32c919e2}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="host-unreachable" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="3" logging="no" target="ACCEPT" custom_rule="no" uuid="{fda4fddc-efe8-4bd1-89a0-1e7e2080348d}" name="network_unreachable" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="icmp_opt" uuid="{6768d063-835c-40a2-992d-46d87f7b906a}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="network-unreachable" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain builtin="no" uuid="{a47513dd-a3be-486d-a918-dc0dc01e6bcd}" name="TCP_CHECKS" description="No Description Available" >
+<rule num="0" logging="no" target="DROP" custom_rule="no" uuid="{53f9ce17-a8c8-4dc4-acb9-ea24977883e7}" name="tcp_flags1" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{381457e1-6e7c-422b-b73f-c879865e8bb2}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="ALL NONE" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="1" logging="no" target="DROP" custom_rule="no" uuid="{b5a11f5c-d6cf-400b-bc98-ef42bc7656d9}" name="tcp_flags2" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{4bb35820-e3ac-44be-a9fb-cfc7f1d41e22}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="FIN,ACK FIN" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="2" logging="no" target="DROP" custom_rule="no" uuid="{5751a6c7-5c75-4b20-8747-b10da300f38f}" name="tcp_flags3" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{76df0129-2788-4c66-8124-c96801337df3}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="ACK,PSH PSH" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="3" logging="no" target="DROP" custom_rule="no" uuid="{3f49954b-6a2a-4298-81c6-c54cd2c5c17d}" name="tcp_flags4" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{f51ebe7f-aa2b-452a-9350-66192ba7d322}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="ACK,URG URG" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="4" logging="no" target="DROP" custom_rule="no" uuid="{5e530522-9b04-49aa-8a0c-22d77a143393}" name="tcp_flags5" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{b7dc141d-d632-4ace-8fa5-689a8cfbe640}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="SYN,FIN SYN,FIN" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="5" logging="no" target="DROP" custom_rule="no" uuid="{c44e8a32-aa43-4320-afeb-81b7847cfdf9}" name="tcp_flags6" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{0e05588d-c058-4353-8274-33ad8b79aea9}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="SYN,RST SYN,RST" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="6" logging="no" target="DROP" custom_rule="no" uuid="{d99c29f2-8d22-4c87-96bd-8fae4f003fbf}" name="tcp_flags7" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{9734225e-7963-42a3-bf61-1a3c42c91331}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="FIN,RST FIN,RST" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="7" logging="no" target="DROP" custom_rule="no" uuid="{0943595a-d650-4af0-bf95-0a133e75a72a}" name="tcp_nmapXmas" enabled="yes" description="Avoid nmap-xmas scanns" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{2858dee2-65e8-4097-aa5c-e0f3346ee9b4}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="ALL FIN,PSH,URG" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain builtin="no" uuid="{ba89f1bd-f323-41a4-9b05-96e13146a465}" name="LOCAL_LANS" description="No Description Available" >
+<rule num="0" logging="no" target="ACCEPT" custom_rule="no" uuid="{776e59c2-1940-48e0-8eb2-9f91a84435c6}" name="MyNET" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="ip_opt" uuid="{570f7dab-5384-4e2f-a530-b33375cead6e}" >
+ <ruleoptionvalue value0="192.168.0.0/24" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain builtin="no" uuid="{7152a99c-bf57-44a2-8438-12d69769fecb}" name="VPNs" description="No Description Available" >
+<rule num="0" logging="no" target="ACCEPT" custom_rule="no" uuid="{bab58f0c-73d0-421d-a1cd-74a9350019f0}" name="TCP_SERVICES" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{cc3f37ae-30d0-4ecf-ac5f-1c5faf55b60d}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+<ruleoption targetoption="no" type="state_opt" uuid="{3cb856be-021b-4185-9b69-48d238d7c9c0}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="NEW" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+</table>
+<table uuid="{855aa6cf-d15d-4744-aede-5b93d07b128b}" name="nat" description="This table is made for every kind of
+NAT (Network Address Translation)." >
+<chain default_target="ACCEPT" builtin="yes" uuid="{3410f0f7-e203-4569-a857-dcf922125fa0}" name="OUTPUT" description="In this chain you can decide which
+packets are allowed to be sent away
+from this computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{e44c3748-6c56-4c17-be91-76dd12597593}" name="PREROUTING" description="..." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{1092717a-a346-4c75-9a16-a2ec8d749634}" name="POSTROUTING" description="..." />
+</table>
+<table uuid="{a4ef60e2-55fe-4c2c-bff8-3dacfa47caa4}" name="mangle" description="This table is made for altering packets." >
+<chain default_target="ACCEPT" builtin="yes" uuid="{a990c3d6-75e1-49e9-922f-d31ea7d59ccd}" name="INPUT" description="In this chain you can filter packets that
+are addressed directly to this compter." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{65910037-d1ab-4dfc-a5af-c46a32b20e99}" name="OUTPUT" description="In this chain you can decide which
+packets are allowed to be sent away
+from this computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{c5f40a03-9239-430c-aa1d-18a7a747f621}" name="FORWARD" description="In this chain you can filter the packets
+that are routed to other hosts by this
+computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{34509ced-a1d0-43ca-8bf3-e513cdde985b}" name="PREROUTING" description="..." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{1ee9514d-ed88-4607-a22f-6eb4780ca1d7}" name="POSTROUTING" description="..." />
+</table>
+ </kmfrs>
+</target>
+</netzone>
+</kmfnet>
+
diff --git a/templates/03_nat_router_template.tkmfgrs b/templates/03_nat_router_template.tkmfgrs
new file mode 100644
index 0000000..fdb1f5d
--- /dev/null
+++ b/templates/03_nat_router_template.tkmfgrs
@@ -0,0 +1,39 @@
+<!DOCTYPE kmyfirewall-ruleset>
+<kmfgrs>
+<netzone guiName="Incoming Connections" id="13" name="incoming_world" description="This is the global zone that contains
+all valid IP addresses." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Outgoing Connections" id="14" name="outgoing_world" description="This is the global zone that contains
+all valid IP addresses." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Forbidden Clients" id="17" name="badClients_hosts" description="Hosts in this zone will not be able
+to use services your computer provides." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Forbidden Servers" id="18" name="badServers_hosts" description="You will not be able to use the services
+of the hosts in that list." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Malicious Hosts" id="16" name="malicious_hosts" description="Traffic coming from and going to hosts
+will be dropped always." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Trusted Hosts" id="15" name="trusted_hosts" description="Traffic coming from and going to hosts
+will be accepted always.
+Only add really trusted Hosts to this Zone" >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+ <abstract restrictOutgoingConnections="bool:off" allowIncomingConnections="bool:offf" name="Nat Router" description="This ruleset implements that basic functionality for a NAT (Network Address Translation) Router. If you like to use your computer as the internet gateway for others in you local lan use this as a starting point." />
+ <logging logPrefix="KMF: " logDropped="bool:on" limitLog="bool:on" />
+ <icmp limitPingReply="bool:on" allowPingReply="bool:on" />
+ <nat natAddress="0.0.0.0" useMasquerade="bool:on" useNat="bool:on" outgoingInterface="eth0" />
+</kmfgrs>
+
diff --git a/templates/03_nat_router_template.tkmfrs b/templates/03_nat_router_template.tkmfrs
new file mode 100644
index 0000000..9fe811e
--- /dev/null
+++ b/templates/03_nat_router_template.tkmfrs
@@ -0,0 +1,70 @@
+<!DOCTYPE kmyfirewall-ruleset>
+<kmfnet maxVersion="~" minVersion="1.1.0" version="1.1.0" interface="iptables" uuid="{41b36b2b-68e2-4545-b34d-3cf3609c204f}" >
+<netzone guiName="Gloabl Network" readonly="bool:on" uuid="{3349418e-3923-4f3c-933c-b1bd91a2c84a}" name="mynetwork" description="This is the global zone that contains all valid IP addresses." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+<target sshPort="22" address="127.0.0.1" guiName="My Local Computer" readonly="bool:on" uuid="{f71cacc9-e95c-4867-aab2-7cafd847dab8}" name="localhost" description="Local copmuter running KMyFirewall" >
+<targetconfig uuid="{634f667c-965e-42e8-ade6-5906f4037873}" name="Untitled" description="No Description Available" >
+ <os name="linux" />
+ <backend name="iptables" />
+ <distribution name="" />
+ <initPath name="" />
+ <IPTPath name="" />
+ <modprobePath name="" />
+ <rcDefaultPath name="" />
+</targetconfig>
+ <kmfrs maxVersion="~" minVersion="1.0.0" version="1.1.0" uuid="{2871e950-a8e0-4b00-844c-ad841dc30b2f}" >
+ <abstract use_nat="yes" use_filter="yes" use_syn_cookies="yes" use_ipfwd="yes" use_martians="no" use_modules="yes" use_rp_filter="no" name="Nat Router Template" use_mangle="yes" description="Template for setting up a NAT (Network Address Translation) router.
+This kind of router is ment to be used to share an Internet connection with other hosts on the local LAN." />
+<table uuid="{040a7b73-75b4-4093-a78e-6048063425ae}" name="filter" description="This table is the main table for filtering
+packets. Here you may define your
+access control rules" >
+<chain default_target="ACCEPT" builtin="yes" uuid="{5fa9a7bf-b002-41b9-b5e5-dfc3f1e7fa9a}" name="INPUT" description="In this chain you can filter packets that
+are addressed directly to this computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{41527b27-863a-4adc-bcd1-e6d90f03d355}" name="OUTPUT" description="In this chain you can decide which
+packets are allowed to be sent away
+from this computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{11b0d4a2-2a94-46a3-ad44-b2e223521a6f}" name="FORWARD" description="In this chain you can filter the packets
+that are routed to other hosts by this
+computer." />
+</table>
+<table uuid="{f203117d-ad4f-4f46-929e-43ab3dde01b8}" name="nat" description="This table is made for every kind of
+NAT (Network Address Translation)." >
+<chain default_target="ACCEPT" builtin="yes" uuid="{99c0abdb-88b2-40df-8e66-a4ade347d5e2}" name="OUTPUT" description="In this chain you can decide which
+packets are allowed to be sent away
+from this computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{b8166bcc-b5d0-40dd-ae25-6e0f3a9c51f3}" name="PREROUTING" description="..." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{322bf0ef-dd77-45ec-b702-139ac167c096}" name="POSTROUTING" description="..." >
+<rule num="0" logging="no" target="MASQUERADE" custom_rule="no" uuid="{3b040513-17eb-4dc6-be7c-2e971161317c}" name="NAT" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="interface_opt" uuid="{15ba5aa9-127f-47a7-a8ae-f396d0622215}" >
+ <ruleoptionvalue value0="bool:off" />
+ <ruleoptionvalue value1="eth0" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+</table>
+<table uuid="{3f5d7d33-a987-4cbd-a50f-8416a23ad585}" name="mangle" description="This table is made for altering packets." >
+<chain default_target="ACCEPT" builtin="yes" uuid="{f5fc2c48-f20f-4a4f-8fe9-21f4d5176abe}" name="INPUT" description="In this chain you can filter packets that
+are addressed directly to this compter." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{d25fd085-f1cc-462a-bdb0-cf2bc1128a01}" name="OUTPUT" description="In this chain you can decide which
+packets are allowed to be sent away
+from this computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{028a65ae-ab15-4836-a3eb-4e3a83ccae7e}" name="FORWARD" description="In this chain you can filter the packets
+that are routed to other hosts by this
+computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{c63b0745-9676-4195-aacd-27f3546ceac9}" name="PREROUTING" description="..." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{8778aef6-85be-483f-934e-498f9e2e871f}" name="POSTROUTING" description="..." />
+</table>
+ </kmfrs>
+</target>
+</netzone>
+</kmfnet>
+
diff --git a/templates/04_web_server_template.tkmfgrs b/templates/04_web_server_template.tkmfgrs
new file mode 100644
index 0000000..272e358
--- /dev/null
+++ b/templates/04_web_server_template.tkmfgrs
@@ -0,0 +1,45 @@
+<!DOCTYPE kmyfirewall-ruleset>
+<kmfgrs>
+<netzone guiName="Incoming Connections" id="13" name="incoming_world" description="This is the global zone that contains
+all valid IP addresses." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+<protocol logging="no" limit="-1/" io="OUTGOING" id="19" name="HTTP" description="Protocol used to browse the WWW." >
+ <port protocol="TCP" num="80" />
+</protocol>
+<protocol logging="yes" limit="1/second" io="OUTGOING" id="20" name="SSH" description="Protocol used to enable a secure remote shell connection." >
+ <port protocol="TCP" num="22" />
+</protocol>
+</netzone>
+<netzone guiName="Outgoing Connections" id="14" name="outgoing_world" description="This is the global zone that contains
+all valid IP addresses." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Forbidden Clients" id="17" name="badClients_hosts" description="Hosts in this zone will not be able
+to use services your computer provides." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Forbidden Servers" id="18" name="badServers_hosts" description="You will not be able to use the services
+of the hosts in that list." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Malicious Hosts" id="16" name="malicious_hosts" description="Traffic coming from and going to hosts
+will be dropped always." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+<netzone guiName="Trusted Hosts" id="15" name="trusted_hosts" description="Traffic coming from and going to hosts
+will be accepted always.
+Only add really trusted Hosts to this Zone" >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+</netzone>
+ <abstract restrictOutgoingConnections="bool:off" allowIncomingConnections="bool:on" name="Webserver" description="This is an example for a webserver configuration. It does only enable incomming connections to port 80 (HTTP e.g. the port webservers usually bind) and 22 (SSH e.g. for remote administration)." />
+ <logging logPrefix="KMF: " logDropped="bool:on" limitLog="bool:on" />
+ <icmp limitPingReply="bool:on" allowPingReply="bool:on" />
+ <nat natAddress="0.0.0.0" useMasquerade="bool:off" useNat="bool:off" outgoingInterface="bool:off" />
+</kmfgrs>
+
diff --git a/templates/04_web_server_template.tkmfrs b/templates/04_web_server_template.tkmfrs
new file mode 100644
index 0000000..c108e1d
--- /dev/null
+++ b/templates/04_web_server_template.tkmfrs
@@ -0,0 +1,357 @@
+<!DOCTYPE kmyfirewall-ruleset>
+<kmfnet maxVersion="~" minVersion="1.1.0" version="1.1.0" interface="iptables" uuid="{41b36b2b-68e2-4545-b34d-3cf3609c204f}" >
+<netzone guiName="Gloabl Network" readonly="bool:on" uuid="{3349418e-3923-4f3c-933c-b1bd91a2c84a}" name="mynetwork" description="This is the global zone that contains all valid IP addresses." >
+ <fromIP address="0.0.0.0" />
+ <netMask address="0" />
+<target sshPort="22" address="127.0.0.1" guiName="My Local Computer" readonly="bool:on" uuid="{42bc1c1f-996f-4f60-a6e3-3e43cd6f0167}" name="localhost" description="Local copmuter running KMyFirewall" >
+<targetconfig uuid="{c3d33a7a-5ba9-45cc-8f34-1617b773e08f}" name="Untitled" description="No Description Available" >
+ <os name="linux" />
+ <backend name="iptables" />
+ <distribution name="" />
+ <initPath name="" />
+ <IPTPath name="" />
+ <modprobePath name="" />
+ <rcDefaultPath name="" />
+</targetconfig>
+ <kmfrs maxVersion="~" minVersion="1.0.0" version="1.1.0" uuid="{8af7181a-bf52-47e3-a00e-2204f8cff57c}" >
+ <abstract use_nat="no" use_filter="yes" use_syn_cookies="yes" use_ipfwd="yes" use_martians="yes" use_modules="yes" use_rp_filter="yes" name="Web Server Template" use_mangle="no" description="This is a template configuration for a typical web server. The tcp ports 80,443 and 22 are open (HTTP/HTTPS and SSH)." />
+<table uuid="{24e22827-5d99-49a3-8767-b9cf25371f7c}" name="filter" description="This table is the main table for filtering
+packets. Here you may define your
+access control rules" >
+<chain default_target="DROP" builtin="yes" uuid="{414166ad-b58e-41e8-8a8f-a9962e769bd1}" name="INPUT" description="In this chain you can filter packets that
+are addressed directly to this computer." >
+<rule num="0" logging="no" target="ICMP_FILTER" custom_rule="no" uuid="{ac00d50c-60b1-4596-9fe6-be5843be3cf4}" name="FWD_ICMP_FILTER" enabled="yes" description="Forward to the chain that handles ICPM packets
+to avoid crap like source-quench etc." />
+<rule num="1" logging="no" target="ANTISPOOF" custom_rule="no" uuid="{214725fa-4179-46e4-800d-5914741921e9}" name="FWD_ANTISPOOF" enabled="yes" description="Forward packets to the ANTISPOOF chain
+which performes some sainity checks for
+the packets to avoid spoofing." />
+<rule num="2" logging="no" target="TCP_CHECKS" custom_rule="no" uuid="{af2b8ac5-3f43-4679-b189-9f031921b7a7}" name="FWD_TCP_CHECKS" enabled="yes" description="Forward to chian TCP_CHECKS which
+filters invalid TCP flag combinations." >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{b5626a02-1808-444a-9e61-e6484318cb8c}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="3" logging="no" target="SERVICES" custom_rule="no" uuid="{f334a3b2-7f69-48d6-8594-54e2a5c4ef60}" name="FWD_SERVICES" enabled="yes" description="This rule forwards all packetst to the SERVICES chain.
+This chain is ment to be used for rules that allow
+access to this host e.g. http if you are running a web
+server." />
+<rule num="4" logging="no" target="ACCEPT" custom_rule="no" uuid="{4dc5f9cf-d19b-4030-998d-166ada82d814}" name="LOOPBACK" enabled="yes" description="Allow packets send from the loopback interface" >
+<ruleoption targetoption="no" type="interface_opt" uuid="{d53aa556-afd8-4906-867a-943747470965}" >
+ <ruleoptionvalue value0="lo" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="5" logging="no" target="ACCEPT" custom_rule="no" uuid="{bece6068-58e4-4cef-83b4-9513d574d471}" name="CONNTRACK" enabled="yes" description="This rule handles the connecktion tracking.
+It simply lets everything in that is a response
+to a network request you made." >
+<ruleoption targetoption="no" type="state_opt" uuid="{0210e1d2-769e-4495-8089-781d20ca2c3a}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="RELATED,ESTABLISHED" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain default_target="ACCEPT" builtin="yes" uuid="{e97ee9d7-871f-49f0-b2a0-1912292a2071}" name="OUTPUT" description="In this chain you can decide which
+packets are allowed to be sent away
+from this computer." />
+<chain default_target="DROP" builtin="yes" uuid="{f437654c-62e4-4fee-b129-99ee59755394}" name="FORWARD" description="In this chain you can filter the packets
+that are routed to other hosts by this
+computer." />
+<chain builtin="no" uuid="{a0f476e7-9540-4260-9f61-de89d033fd3e}" name="ANTISPOOF" description="Packet spoof protection is done in
+this chain." >
+<rule num="0" logging="no" target="DROP" custom_rule="no" uuid="{b1e735e2-1b31-4b74-9c14-8613abf8b29c}" name="loopback_spoof" enabled="yes" description="Check if packets are really from the loaclhost." >
+<ruleoption targetoption="no" type="interface_opt" uuid="{774afbfa-c082-4084-878f-69bd9d193104}" >
+ <ruleoptionvalue value0="! lo" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+<ruleoption targetoption="no" type="ip_opt" uuid="{0ff372ce-3e46-499c-9512-0dae87cb2df8}" >
+ <ruleoptionvalue value0="127.0.0.0/8" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain builtin="no" uuid="{49b1df3f-fb0e-4745-9547-612e350101af}" name="SERVICES" description="This rule allows other computer to connect to us on udp port 53" >
+<rule num="0" logging="no" target="ACCEPT" custom_rule="no" uuid="{b5812bdf-cb51-456d-882a-bf7d82f8e13b}" name="HTTP_HTTPS" enabled="yes" description="This rule allows other computer to connect to us on udp port 53" >
+<ruleoption targetoption="no" type="tcp_multiport_opt" uuid="{2625a4e2-ba07-472b-89e3-db0b2e065371}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="80,443" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="1" logging="no" target="ACCEPT" custom_rule="no" uuid="{11af5582-60d6-43d5-81b5-18bba8edb31f}" name="Example_SSH" enabled="yes" description="This rule opens the ports 80 and 443 (e.g. HTTP and HTTPS)" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{22b2c038-2be6-4997-9430-2340f29ba766}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="1024:65535" />
+ <ruleoptionvalue value2="22" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain builtin="no" uuid="{28e8c0e7-84b9-431b-a636-c18777af661b}" name="ICMP_FILTER" description="Here some ICMP packet types are
+filtered to avoid denial of service attacks." >
+<rule num="0" logging="no" target="ACCEPT" custom_rule="no" uuid="{5740f895-e5b8-4b6c-ae75-a07df328b8a0}" name="ping" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="icmp_opt" uuid="{9cf0dfd0-9523-49a0-b7dc-f78b9c759dc2}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="echo-request" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="1" logging="no" target="ACCEPT" custom_rule="no" uuid="{f753a6a0-b7c3-47cd-b08a-ebac149220a8}" name="ping_reply" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="icmp_opt" uuid="{3a184346-683e-4535-99d2-ffe14f034984}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="echo-reply" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="2" logging="no" target="ACCEPT" custom_rule="no" uuid="{9aee9939-1a7b-4f71-a500-635f2ce6793d}" name="host_unreachable" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="icmp_opt" uuid="{fdb12c22-e453-4fbb-aafb-c3cc32c919e2}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="host-unreachable" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="3" logging="no" target="ACCEPT" custom_rule="no" uuid="{fda4fddc-efe8-4bd1-89a0-1e7e2080348d}" name="network_unreachable" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="icmp_opt" uuid="{6768d063-835c-40a2-992d-46d87f7b906a}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="network-unreachable" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain builtin="no" uuid="{a47513dd-a3be-486d-a918-dc0dc01e6bcd}" name="TCP_CHECKS" description="No Description Available" >
+<rule num="0" logging="no" target="DROP" custom_rule="no" uuid="{53f9ce17-a8c8-4dc4-acb9-ea24977883e7}" name="tcp_flags1" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{381457e1-6e7c-422b-b73f-c879865e8bb2}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="ALL NONE" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="1" logging="no" target="DROP" custom_rule="no" uuid="{b5a11f5c-d6cf-400b-bc98-ef42bc7656d9}" name="tcp_flags2" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{4bb35820-e3ac-44be-a9fb-cfc7f1d41e22}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="FIN,ACK FIN" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="2" logging="no" target="DROP" custom_rule="no" uuid="{5751a6c7-5c75-4b20-8747-b10da300f38f}" name="tcp_flags3" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{76df0129-2788-4c66-8124-c96801337df3}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="ACK,PSH PSH" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="3" logging="no" target="DROP" custom_rule="no" uuid="{3f49954b-6a2a-4298-81c6-c54cd2c5c17d}" name="tcp_flags4" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{f51ebe7f-aa2b-452a-9350-66192ba7d322}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="ACK,URG URG" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="4" logging="no" target="DROP" custom_rule="no" uuid="{5e530522-9b04-49aa-8a0c-22d77a143393}" name="tcp_flags5" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{b7dc141d-d632-4ace-8fa5-689a8cfbe640}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="SYN,FIN SYN,FIN" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="5" logging="no" target="DROP" custom_rule="no" uuid="{c44e8a32-aa43-4320-afeb-81b7847cfdf9}" name="tcp_flags6" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{0e05588d-c058-4353-8274-33ad8b79aea9}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="SYN,RST SYN,RST" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="6" logging="no" target="DROP" custom_rule="no" uuid="{d99c29f2-8d22-4c87-96bd-8fae4f003fbf}" name="tcp_flags7" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{9734225e-7963-42a3-bf61-1a3c42c91331}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="FIN,RST FIN,RST" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+<rule num="7" logging="no" target="DROP" custom_rule="no" uuid="{0943595a-d650-4af0-bf95-0a133e75a72a}" name="tcp_nmapXmas" enabled="yes" description="Avoid nmap-xmas scanns" >
+<ruleoption targetoption="no" type="tcp_opt" uuid="{2858dee2-65e8-4097-aa5c-e0f3346ee9b4}" >
+ <ruleoptionvalue value0="bool:on" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="ALL FIN,PSH,URG" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+<chain builtin="no" uuid="{ba89f1bd-f323-41a4-9b05-96e13146a465}" name="LOCAL_LANS" description="No Description Available" >
+<rule num="0" logging="no" target="ACCEPT" custom_rule="no" uuid="{776e59c2-1940-48e0-8eb2-9f91a84435c6}" name="MyNET" enabled="yes" description="No Description Available" >
+<ruleoption targetoption="no" type="ip_opt" uuid="{570f7dab-5384-4e2f-a530-b33375cead6e}" >
+ <ruleoptionvalue value0="192.168.0.0/24" />
+ <ruleoptionvalue value1="bool:off" />
+ <ruleoptionvalue value2="bool:off" />
+ <ruleoptionvalue value3="bool:off" />
+ <ruleoptionvalue value4="bool:off" />
+ <ruleoptionvalue value5="bool:off" />
+ <ruleoptionvalue value6="bool:off" />
+ <ruleoptionvalue value7="bool:off" />
+ <ruleoptionvalue value8="bool:off" />
+ <ruleoptionvalue value9="bool:off" />
+</ruleoption>
+</rule>
+</chain>
+</table>
+<table uuid="{855aa6cf-d15d-4744-aede-5b93d07b128b}" name="nat" description="This table is made for every kind of
+NAT (Network Address Translation)." >
+<chain default_target="ACCEPT" builtin="yes" uuid="{3410f0f7-e203-4569-a857-dcf922125fa0}" name="OUTPUT" description="In this chain you can decide which
+packets are allowed to be sent away
+from this computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{e44c3748-6c56-4c17-be91-76dd12597593}" name="PREROUTING" description="..." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{1092717a-a346-4c75-9a16-a2ec8d749634}" name="POSTROUTING" description="..." />
+</table>
+<table uuid="{a4ef60e2-55fe-4c2c-bff8-3dacfa47caa4}" name="mangle" description="This table is made for altering packets." >
+<chain default_target="ACCEPT" builtin="yes" uuid="{a990c3d6-75e1-49e9-922f-d31ea7d59ccd}" name="INPUT" description="In this chain you can filter packets that
+are addressed directly to this compter." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{65910037-d1ab-4dfc-a5af-c46a32b20e99}" name="OUTPUT" description="In this chain you can decide which
+packets are allowed to be sent away
+from this computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{c5f40a03-9239-430c-aa1d-18a7a747f621}" name="FORWARD" description="In this chain you can filter the packets
+that are routed to other hosts by this
+computer." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{34509ced-a1d0-43ca-8bf3-e513cdde985b}" name="PREROUTING" description="..." />
+<chain default_target="ACCEPT" builtin="yes" uuid="{1ee9514d-ed88-4607-a22f-6eb4780ca1d7}" name="POSTROUTING" description="..." />
+</table>
+ </kmfrs>
+</target>
+</netzone>
+</kmfnet>
+
diff --git a/templates/Makefile.am b/templates/Makefile.am
new file mode 100644
index 0000000..b7b2337
--- /dev/null
+++ b/templates/Makefile.am
@@ -0,0 +1,9 @@
+EXTRA_DIST = workstation_template.tkmfrs
+
+templatedir = $(kde_datadir)/kmyfirewall/templates
+template_DATA = 02_workstation_template.tkmfgrs \
+02_workstation_template.tkmfrs \
+03_nat_router_template.tkmfgrs \
+03_nat_router_template.tkmfrs \
+04_web_server_template.tkmfgrs \
+04_web_server_template.tkmfrs \ No newline at end of file