server/clientsocket.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Daniel Rocher                                   *
00003  *   daniel.rocher@adella.org                                              *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef CLIENTSOCKET_H
00022 #define CLIENTSOCKET_H
00023 
00024 //SSL
00025 #include<openssl/ssl.h>
00026 #include <openssl/err.h>
00027 
00028 //Qt
00029 #include <QObject>
00030 
00031 class Q3SocketDevice;
00032 class QSocketNotifier;
00033 class Q3CString;
00034 class QTimer;
00035 
00036 #include "process_smbd_exist.h"
00037 #include "sendmessage_manager.h"
00038 #include "smbmanager.h"
00039 #include "pamthread.h"
00040 #include "../common/core_syntax.h"
00041 
00042 extern void debugQt(const QString & message);
00043 extern void SSL_print_error(int errorcode);
00044 extern void Socket_print_error (int errorcode);
00045 
00046 extern bool debug_qtsmbstatus;
00047 extern bool daemonize;
00048 extern Q_UINT16 port_server;
00049 extern QString Certificat;
00050 extern QString Private_key;
00051 extern QString ssl_password;
00052 extern QString version_qtsmbstatus;
00053 extern QStringList AllowUserDisconnect;
00054 extern QStringList AllowUserSendMsg;
00055 
00056 class ClientSocket: public QObject {
00057         Q_OBJECT
00058 public:
00059         ClientSocket( const int & sock, QObject *parent=0);
00060         virtual ~ClientSocket();
00061         static int compteur_objet;
00062 private: //attributes
00063         Q3SocketDevice *socketdevice;
00064         QSocketNotifier * sn_read;
00065         QSocketNotifier * sn_exception;
00066         int echo;
00067         static int TimoutTimerEcho;
00068         QTimer * echo_timer;
00069         int socket;
00071         bool AuthUser;
00073         bool permitDisconnectUser;
00075         bool permitSendMsg;
00076         bool SSL_init;
00077         SSL* ssl;
00078         PamThread * pamthread;
00079         QTimer *timer;
00080         enum command {auth_rq,auth_ack,end,kill_user,send_msg,smb_rq,smb_data,end_smb_rq,not_imp1,server_info,error_auth,error_command,error_obj,echo_request,echo_reply} ;
00081 private slots:
00082         void readClient();
00083         void Exception();
00084         void ObjError(const QString & error_txt);
00085         void slot_smbstatus(const QStringList &);
00086         void slot_pam();
00087         void slot_echo_timer();
00088 public slots:
00089         void socketConnectionClose();
00090 private://methods
00091         void sendToClient(int cmd,const QString & em_txt="");
00092         void core (const Q3CString & rcv_txt) ;
00093         void CmdKillUser(const QString & texte);
00094         void CmdSendMsg(const QString & texte);
00095         void CmdSmbRq();
00096         void CmdAuthRq(const QString & texte);
00097 };
00098 
00099 #endif

Generated on Fri Nov 2 21:44:58 2007 for qtsmbstatus.kdevelop by  doxygen 1.5.3