summaryrefslogtreecommitdiffstats
path: root/kmyfirewall/core/kmfgenericdoc.cpp
blob: 9454a9a244172917c60ad3f50df86327b7a45dac (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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
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 <tqfile.h>
#include <tqdom.h>
#include <tqstring.h>
#include <tqstringlist.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( TQObject *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 TQString& KMFGenericDoc::getFileDialogFilter() {
	return *( new TQString("*.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 TQString& 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 TQString& addr ) {
	m_natAddress->setAddress( addr );
}

void KMFGenericDoc::setOutgoingInterface( const TQString& str ) {
	m_outgoingInterface = str;
}


TQPtrList<KMFNetZone>& KMFGenericDoc::zones() const {
	TQPtrList<KMFNetZone>* ret_val = new TQPtrList<KMFNetZone>;
	*ret_val = m_zones;
	return *ret_val;
}

KMFNetZone* KMFGenericDoc::addZone( const TQString& name, KMFError* err ) {
// 	kdDebug() << "KMFNetZone* addZone( const TQString& name, KMFError* err )" << endl;
	bool found = false;
	TQPtrListIterator<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 TQString& name )" << endl;
	bool found = false;
	TQPtrListIterator<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 TQString& name ) const {
// 	kdDebug() << "KMFNetZone* KMFGenericDoc::findZone( const TQString& name ) const" << endl;
	TQPtrListIterator<KMFNetZone> it ( m_zones );
	while ( it.current() ) {
		KMFNetZone *z = it.current();
		++it;
		if ( z->name() == name )
			return z;
	}
	return 0;
}

const TQString& KMFGenericDoc::compile() {
// 	kdDebug() << "const TQString& KMFGenericDoc::compile()" << endl;
	KMFCompilerInterface* compiler = target()->compiler();
	if ( ! compiler ) {
		return *( new TQString("ERROR") );
	}
	return compiler->compile( this );
}

void KMFGenericDoc::parseDocument( const KURL& url, TQStringList& errors ) {
// 	kdDebug() << "KMFDoc* KMFGenericDoc::parseDocument( const KURL& )" << endl;
	TQString 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();
		TQFile kmfrsFile( xmlfile );
		TQDomDocument 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 TQDomDocument& KMFGenericDoc::getDOMTree() {
	// kdDebug() << "const TQDomDocument& KMFGenericDoc::getDOMTree()" << endl;
	TQDomDocument doc( "kmyfirewall-ruleset" );
	TQDomElement 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() );
	TQDomElement 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 );

	TQDomElement 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 );

	TQDomElement 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 );

	TQDomElement 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() );
	TQString allowedIn = "";

	nat.setAttribute( XML::OutgoingInterface_Attribute, m_outgoingInterface );

	root.appendChild( nat );

	doc.appendChild( root );
	return *( new TQDomDocument( doc ) );
}
void KMFGenericDoc::loadXML( const TQDomDocument& doc, TQStringList& errors ) {
	kdDebug() << "void KMFGenericDoc::loadXML( const TQDomDocument& )" << endl;
	TQDomElement 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( TQDomNode root, TQStringList& errors ) {
// void KMFGenericDoc::loadXML( const TQDomDocument& doc ) {
// 	kdDebug() << "void KMFGenericDoc::loadXML( const TQDomDocument& )" << endl;
//	TQDomElement root = doc.documentElement();
	NetfilterObject::loadUuid ( root, errors );
	TQDomNode curr = root.firstChild();
	while ( !curr.isNull() ) {
		kdDebug() << "Parsing Node: " << curr.nodeName() << endl;
		if ( curr.isElement() && curr.nodeName() == XML::NetZone_Element ) {
			TQString name = "";
			name = curr.toElement().attribute(  XML::Name_Attribute );
			TQDomDocument 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;
			TQString logDropped = "";
			TQString limitLog = "";
			TQString 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;
			TQString allowPing = "";
			TQString 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;
			TQString useNat = "";
			TQString useMasquerade = "";
			TQString natAddress = "";
			TQString 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;
			TQString allowIncomingConnections = "";
			TQString restrictOutgoingConnections = "";
			TQString description = "";
			TQString 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 TQString( description ) ) );
			
			name += curr.toElement().attribute(  XML::Name_Attribute );
			if ( ! name.isNull() )
				setName( *( new TQString( 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();
	}
}

}