summaryrefslogtreecommitdiffstats
path: root/kmyfirewall/core/kmftargetconfig.h
blob: b3db3ab166aa7bfae75ee527c901572047317149 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
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 <tqptrlist.h>
#include <tqstring.h>
#include <tqdom.h>
#include <tqobject.h>


#include <tqstring.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 TQDomDocument& getDOMTree();
	virtual void loadXML(const TQDomDocument&, TQStringList& errors );
	virtual void loadXML( TQDomNode, TQStringList& errors );
	
	/**
	Get the target object for this configuration
	*/
	KMFTarget* target() const {
		return m_target;
	}
	
	/**
	Set Which OS are we using.
	*/
	void setOS( const TQString & v );

	/**
	Get Which OS are we using.
	*/
	const TQString& oS() const {
		return m_OS;
	}

	/**
	Set Firewalling backend name.
	*/
	void setBackend( const TQString & );

	/**
	Get Firewalling backend name.
	*/
	const TQString& backend() const {
		return m_Backend;
	}


	/**
	Set What kind of ditribution are we using.
	*/
	void setDistribution( const TQString & v );

	/**
	Get What kind of ditribution are we using.
	*/
	const TQString& distribution() const {
		return m_Distribution;
	}

	/**
	Set Path to the init scripts
	*/
	void setInitPath( const TQString & v );

	/**
	Get Path to the init scripts
	*/
	const TQString& initPath() const {
		return m_InitPath;
	}

	/**
	Set Path to the default runlevel directory.
	*/
	void setRcDefaultPath( const TQString & v );

	/**
	Get Path to the default runlevel directory.
	*/
	const TQString& rcDefaultPath() const {
		return m_RcDefaultPath;
	}

	/**
	Set Path to iptables binary.
	*/
	void setIPTPath( const TQString & v );

	/**
	Get Path to iptables binary.
	*/
	const TQString& IPTPath() const {
		return m_IPTPath;
	}

	/**
	Set Path to the modprobe binary.
	*/
	void setModprobePath( const TQString & v );

	/**
	Get Path to the modprobe binary.
	*/
	const TQString& modprobePath() const {
		return m_ModprobePath;
	}
	


	/**
	Set Network interfaces
	*/
	void setInterfaces( const TQStringList & v );

	/**
	Get Network interfaces
	*/
	TQStringList& interfaces() {
		return m_Interfaces;
	}
	
	/** 
	Get Indicator if the config is valid
	*/
	bool isValid() const;
	
	TQString toString();

private:
	KMFTarget* m_target;
	
	TQString m_targetName;
	KURL m_configFile;
	
	// GENERAL
	TQString m_OS;
	TQString m_Backend;

	// PATHS
	TQString m_Distribution;
	TQString m_InitPath;
	TQString m_RcDefaultPath;
	TQString m_IPTPath;
	TQString m_ModprobePath;
	TQString m_CurrentGenericConfiguration;
	TQString m_CurrentIPTConfiguration;

	// INTERFACES
	TQStringList m_Interfaces;
};
}
#endif