summaryrefslogtreecommitdiffstats
path: root/kmyfirewall/compilers/iptables/kmfiptablesscriptgenerator.h
blob: 772aedfaeb3918de1f567c3a98d09038736e8e73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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 <tqstring.h>
#include <tqobject.h>
#include <tqtextstream.h>

// KDE includes
#include <tdeparts/part.h>
#include <tdeparts/plugin.h>
#include <tdeparts/factory.h>
#include <kxmlgui.h>

namespace KMF {
class IPTable;
class KMFIPTDoc;

class KMFIPTablesScriptGenerator{
public:
    KMFIPTablesScriptGenerator();

    ~KMFIPTablesScriptGenerator();

	const TQString& 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 TQString& printScriptDebug( const TQString&, bool newLine = true);

	
private: // DATA
	KMFIPTDoc *m_iptDoc;
	TQTextOStream *m_stream;
};
}
#endif