• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

krfb

kinetd.h

Go to the documentation of this file.
00001 
00002 /***************************************************************************
00003                                   kinetd.h
00004                                 ------------
00005     begin                : Mon Feb 11 2002
00006     copyright            : (C) 2002 by Tim Jansen
00007     email                : tim@tjansen.de
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef _KINETD_H_
00020 #define _KINETD_H_
00021 
00022 #include <kdedmodule.h>
00023 #include <kservice.h>
00024 #include <k3process.h>
00025 #include <qstringlist.h>
00026 #include <qstring.h>
00027 #include <qdatetime.h>
00028 #include <qtimer.h>
00029 #include <kserversocket.h>
00030 #include <dnssd/publicservice.h>
00031 #include <q3ptrlist.h>
00032 #include "kserviceregistry.h"
00033 
00034 class PortListener : public QObject {
00035     Q_OBJECT
00036 private:
00037     bool m_valid;
00038     QString m_serviceName;
00039     QString m_serviceURL, m_serviceAttributes;
00040     QStringList m_registeredServiceURLs;
00041     QString m_dnssdName, m_dnssdType;
00042     QMap<QString,QString> m_dnssdData;
00043     int m_serviceLifetime;
00044     int m_port;
00045     int m_portBase, m_autoPortRange;
00046     int m_defaultPortBase, m_defaultAutoPortRange;
00047     bool m_multiInstance;
00048     QString m_execPath;
00049     QString m_argument;
00050     bool m_enabled;
00051     bool m_serviceRegistered, m_registerService;
00052     bool m_dnssdRegister, m_dnssdRegistered;
00053     QDateTime m_expirationTime;
00054     QDateTime m_slpLifetimeEnd;
00055     QString m_uuid;
00056 
00057     KNetwork::KServerSocket *m_socket;
00058     K3Process m_process;
00059 
00060     KConfig *m_config;
00061     KServiceRegistry *m_srvreg;
00062     DNSSD::PublicService *m_dnssdreg;
00063 
00064     void freePort();
00065     void loadConfig(KService::Ptr s);
00066     void setEnabledInternal(bool e, const QDateTime &ex);
00067     void dnssdRegister(bool enabled);
00068     void setServiceRegistrationEnabledInternal(bool enabled);
00069 
00070 public:
00071     PortListener(KService::Ptr s, KConfig *c, KServiceRegistry *srvreg);
00072     ~PortListener();
00073 
00074     bool acquirePort();
00075     bool isValid();
00076     QString name();
00077     void setEnabled(bool enabled);
00078     void setEnabled(const QDateTime &expiration);
00079     void setServiceRegistrationEnabled(bool enabled);
00080     bool isServiceRegistrationEnabled();
00081     QDateTime expiration();
00082     QDateTime serviceLifetimeEnd();
00083     bool isEnabled();
00084     int port();
00085     QStringList processServiceTemplate(const QString &a);
00086     bool setPort(int port = -1, int autoProbeRange = 1);
00087     void refreshRegistration();
00088 
00089 private slots:
00090     void accepted(KSocket*);
00091 };
00092 
00093 class KInetD : public KDEDModule {
00094     Q_OBJECT
00095 
00096 public slots:
00104     QStringList services();
00105 
00111     bool isEnabled(QString service);
00112 
00119     void setEnabled(QString service, bool enable);
00120 
00127     void setEnabled(QString service, QDateTime expiration);
00128 
00134     int port(QString service);
00135 
00146     bool setPort(QString service, int port = -1, int autoPortRange = 1);
00147 
00153     bool isInstalled(QString service);
00154 
00162     void setServiceRegistrationEnabled(QString service, bool enabled);
00163 
00171     bool isServiceRegistrationEnabled(QString service);
00172 
00173  private:
00174     QDateTime getNextExpirationTime();
00175     void setPortRetryTimer(bool retry);
00176     void setReregistrationTimer();
00177 
00178     KConfig *m_config;
00179     KServiceRegistry *m_srvreg;
00180     Q3PtrList<PortListener> m_portListeners;
00181     QTimer m_expirationTimer;
00182     QTimer m_portRetryTimer;
00183     QTimer m_reregistrationTimer;
00184 
00185  private slots:
00186     void setExpirationTimer();
00187     void expirationTimer();
00188     void portRetryTimer();
00189     void reregistrationTimer();
00190 
00191  public:
00192     KInetD(QObject* parent, const QList<QVariant>&);
00193     virtual ~KInetD();
00194     void loadServiceList();
00195     PortListener *getListenerByName(QString name);
00196 };
00197 
00198 
00199 #endif

krfb

Skip menu "krfb"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal