summaryrefslogtreecommitdiffstats
path: root/kmyfirewall/core/kmfnethost.h
blob: b370836c11ca405210c0cbcca912c3dfec5413df (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
//
// 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 <tqptrlist.h>
#include <tqguardedptr.h>
#include <tqstring.h>
#include <tqdom.h>
#include <tquuid.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 {
	TQ_OBJECT
  
public:
	KMFNetHost( NetfilterObject *parent, const char* name, const TQString& 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 TQString& scale );
	
	bool limit() const;
	int limitRate() const;
	const TQString& limitScale() const;
	
	virtual const TQDomDocument& getDOMTree();
	virtual void loadXML(const TQDomDocument&, TQStringList& errors );
	virtual void loadXML( TQDomNode, TQStringList& errors );
	
	KMFProtocolUsage* addProtocolUsage( const TQUuid& protocolUuid, const TQDomDocument& xml );
	
	void delProtocolUsage( KMFProtocolUsage*, bool destructive = true );
	bool protocolInherited( const TQUuid& uuid ) const;
	KMFProtocolUsage* findProtocolUsageByProtocolUuid( const TQUuid& uuid ) const;
	
	TQPtrList<KMFProtocolUsage>& protocols() const;

protected slots:
	void slotOnProtocolUsageDeleted( TQObject* protocol );
	
private: // Data
// 	int m_maskLen;
	TQPtrList<KMFProtocolUsage> m_protocols;
	bool m_logIncoming, m_logOutgoing;
	TQString m_limitScale;
	int m_limitNum;
};
}
#endif