// // C++ Interface: $MODULE$ // // Description: // // // Author: Christian Hubinger , (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" // TQt includes #include #include #include #include #include #include // KDE includes #include #include // Project includes #include "kmfprotocolcategory.h" /** @author Christian Hubinger */ namespace KMF { class KMFGenericDoc; class KMFNetZone; class KMFError; class KMFProtocolCategory; class KMFProtocolUsage; class TDE_EXPORT KMFProtocol : public NetfilterObject { friend class KMFProtocolCategory; public: ~KMFProtocol(); virtual int type(); virtual void clear(); void addPort( const TQString& , int ); void delPort( const TQString&, int ); void setCustomProtocol( bool ); void setCategory( KMFProtocolCategory* ); virtual const TQDomDocument& getDOMTree(); virtual void loadXML(const TQDomDocument&, TQStringList& errors ); virtual void loadXML( TQDomNode, TQStringList& errors ); bool customProtocol() const { return m_customProtocol; }; KMFProtocolCategory* category() const { return m_category; } TQValueList& udpPorts() { return m_udpPorts; } TQValueList& tcpPorts() { return m_tcpPorts; } const TQString& udpPortsList(); const TQString& 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: TQValueList m_usages; KMFProtocolCategory* m_category; TQValueList m_udpPorts; TQValueList m_tcpPorts; bool m_customProtocol; }; } #endif