ClientSocket Class Reference

This class dialogs with server. More...

List of all members.

Public Slots

void socketConnectionClose ()

Signals

void SignalClosed ()
 Connection closed.
void SignalConnected ()
 Client connected.
void SignalErrorAuth ()
 Authentication error.
void SignalShortMessage (const QString &)
 Short messages for statusBar.

Public Member Functions

 ClientSocket (const int &sock, QObject *parent=0)
 ClientSocket (Q3ListView *mylistView, QObject *parent=0)
void connectionToServer (const QString &username, const QString &passwd)
void Disconnect ()
virtual ~ClientSocket ()
virtual ~ClientSocket ()

Static Public Attributes

static int compteur_objet = 0

Private Types

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, 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
}
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, 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
}

Private Slots

void add_lockedfile (const QString &, const QString &, const QString &, const QString &, const QString &, const QString &)
void add_share (const QString &, const QString &, const QString &)
void add_user (const QString &, const QString &, const QString &, const QString &, const QString &)
void AnalysisSmbDestroyed ()
void core (const Q3CString &rcv_txt)
void Exception ()
void InfoMachine ()
void InfoServer ()
void InfoService ()
void InfoUser ()
void ObjError (const QString &error_txt)
void readClient ()
void setSambaVersion (const QString &)
void slot_echo_timer ()
void slot_echo_timer ()
void slot_pam ()
void slot_smbstatus (const QStringList &)
void slot_timer ()
void slotDisconnectUser ()
void slotPopupMenu (Q3ListViewItem *, const QPoint &, int)
void slotSendMessage ()
void slotSendMessageAllUsers ()
void socketclosed ()
void socketconnected ()
void UnreachableHost ()

Private Member Functions

void AnalysisSmbstatus ()
void CmdAuthRq (const QString &texte)
void CmdKillUser (const QString &texte)
void CmdSendMsg (const QString &texte)
void CmdSmbRq ()
void core (const Q3CString &rcv_txt)
void infoserver (const QString &text)
void sendToClient (int cmd, const QString &em_txt="")
void sendToServer (int cmd, const QString &inputText="")

Private Attributes

bool AuthUser
 if user authenticated
Q3ListViewItem * currentPopupMenuItem
int echo
QTimer * echo_timer
QTimer * echo_timer
smbstatusInstanceSmbstatus
serveritem_server
QStringList ListSmbstatus
Q3ListView * listView
Q3PopupMenu * menu
QErrorMessage * msgError
PamThreadpamthread
QString passwd_login
bool permitDisconnectUser
 if client is authorized to disconnect user
bool permitSendMsg
 if client is authorized to send popup message
QSocketNotifier * sn_exception
QSocketNotifier * sn_read
int socket
ClientSSLsocketclient
Q3SocketDevice * socketdevice
SSL * ssl
bool ssl_connected
bool SSL_init
QTimer * timer
QTimer * timer
QString username_login

Static Private Attributes

static int TimoutTimerEcho = 30000
 Time between 2 echo request.


Detailed Description

This class dialogs with server.

This class dialogs with client. (One object per client).

Date:
2007-07-05
Version:
1.1
Author:
Daniel Rocher
See also:
ClientSocket::command
Date:
2007-06-18
Version:
1.0
Author:
Daniel Rocher
See also:
Server
Parameters:
sock Socket number
parent pointer to parent for this object

Member Enumeration Documentation

enum ClientSocket::command [private]

Enumerator:
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 
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 

enum ClientSocket::command [private]

Protocol between server and client.

See also:
core_syntax
Enumerator:
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 
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 


Constructor & Destructor Documentation

ClientSocket::ClientSocket ( Q3ListView *  mylistView,
QObject *  parent = 0 
)

Parameters:
mylistView pointer to listview
parent pointer to parent for this object

ClientSocket::~ClientSocket (  )  [virtual]

ClientSocket::ClientSocket ( const int &  sock,
QObject *  parent = 0 
)

virtual ClientSocket::~ClientSocket (  )  [virtual]


Member Function Documentation

void ClientSocket::add_lockedfile ( const QString &  strPid,
const QString &  strName,
const QString &  strMode,
const QString &  strRW,
const QString &  strOplock,
const QString &  strDateOpen 
) [private, slot]

InstanceSmbstatus has found a file opened (locked file)

Parameters:
strPid PID
strName File name
strMode Mode
strRW RW
strOplock Oplock
strDateOpen date
See also:
smbstatus

void ClientSocket::add_share ( const QString &  strPid,
const QString &  strShare,
const QString &  strConnected 
) [private, slot]

InstanceSmbstatus has found a share

Parameters:
strPid PID
strShare Share name
strConnected date
See also:
smbstatus

void ClientSocket::add_user ( const QString &  strPid,
const QString &  strUser,
const QString &  strGroup,
const QString &  strMachineName,
const QString &  strMachineIP 
) [private, slot]

InstanceSmbstatus has found an user

Parameters:
strPid PID
strUser User name
strGroup Group name
strMachineName Machine name
strMachineIP IP address
See also:
smbstatus

void ClientSocket::AnalysisSmbDestroyed (  )  [private, slot]

InstanceSmbstatus has finished his work

See also:
smbstatus

void ClientSocket::AnalysisSmbstatus (  )  [private]

Interpret smbstatus reply.

See also:
smbstatus

void ClientSocket::CmdAuthRq ( const QString &  texte  )  [private]

Authentication Request

Parameters:
texte arg=1=username, arg2=password
See also:
core_syntax PamThread

void ClientSocket::CmdKillUser ( const QString &  texte  )  [private]

Request from client to disconnect an user

Parameters:
texte arg1=PID, arg2=username
See also:
ClientSocket::permitDisconnectUser

process_smbd_exist

void ClientSocket::CmdSendMsg ( const QString &  texte  )  [private]

Request from client to send popup message

Parameters:
texte arg1=machine, arg2=message to be sent
See also:
ClientSocket::permitSendMsg

Sendmessage_manager

void ClientSocket::CmdSmbRq (  )  [private]

Run Smbstatus request

void ClientSocket::connectionToServer ( const QString &  username,
const QString &  passwd 
)

Connect to server

Parameters:
username username (a valid login on server)
passwd password (a valid password on server)

void ClientSocket::core ( const Q3CString &  rcv_txt  )  [private]

void ClientSocket::core ( const Q3CString &  rcv_txt  )  [private, slot]

Protocol interpreter. analyze the server's answers.

Parameters:
rcv_txt data sent by server
See also:
ClientSSL core_syntax
Protocol interpreter. analyze the client's answers.
Parameters:
rcv_txt data sent by client
See also:
core_syntax

void ClientSocket::Disconnect (  ) 

Close TCP connection

void ClientSocket::Exception (  )  [private, slot]

There is a TCP error

void ClientSocket::InfoMachine (  )  [private, slot]

View machine informations

See also:
slotPopupMenu

server::ViewInfoMachine

void ClientSocket::infoserver ( const QString &  text  )  [private]

Receive informations from server (right for current client)

Parameters:
text client's right:
	0000 0001 : permit client to disconnect an user
	0000 0010 : permit client to send popup messages (popupwindows)
	

void ClientSocket::InfoServer (  )  [private, slot]

View samba version

See also:
slotPopupMenu

server::ViewInfoUser

void ClientSocket::InfoService (  )  [private, slot]

View service informations (locked file or share)

See also:
slotPopupMenu

server::ViewInfoService

void ClientSocket::InfoUser (  )  [private, slot]

View user informations

See also:
slotPopupMenu

server::ViewInfoUser

void ClientSocket::ObjError ( const QString &  error_txt  )  [private, slot]

Slot : receive objects errors and send it to client.

Parameters:
error_txt error to be sent

void ClientSocket::readClient (  )  [private, slot]

Receive datas from client

See also:
sendToClient

void ClientSocket::sendToClient ( int  cmd,
const QString &  em_txt = "" 
) [private]

Send datas to client

Parameters:
inputText datas to send
cmd command
See also:
ClientSocket::command

readClient

core_syntax

void ClientSocket::sendToServer ( int  cmd,
const QString &  inputText = "" 
) [private]

Send data to server.

Parameters:
cmd command
See also:
ClientSocket::command

ClientSSL core_syntax

void ClientSocket::setSambaVersion ( const QString &  version_samba  )  [private, slot]

InstanceSmbstatus sends samba version.

Parameters:
version_samba samba version
See also:
smbstatus

void ClientSocket::SignalClosed (  )  [signal]

Connection closed.

void ClientSocket::SignalConnected (  )  [signal]

Client connected.

void ClientSocket::SignalErrorAuth (  )  [signal]

Authentication error.

void ClientSocket::SignalShortMessage ( const QString &  _t1  )  [signal]

Short messages for statusBar.

void ClientSocket::slot_echo_timer (  )  [private, slot]

void ClientSocket::slot_echo_timer (  )  [private, slot]

Timer ending (echo), sends a new echo request. After 3 failures, disconnect.

void ClientSocket::slot_pam (  )  [private, slot]

test if pamthread has terminated

void ClientSocket::slot_smbstatus ( const QStringList &  rcv_smb  )  [private, slot]

Slot : Receive smbstatus reply.

void ClientSocket::slot_timer (  )  [private, slot]

Slot smbstatus timer Request smbstatus to server

void ClientSocket::slotDisconnectUser (  )  [private, slot]

Disconnect an user

See also:
slotPopupMenu

void ClientSocket::slotPopupMenu ( Q3ListViewItem *  Item,
const QPoint &  point,
int   
) [private, slot]

popup menu

void ClientSocket::slotSendMessage (  )  [private, slot]

send out messages (popupwindows) to one user

See also:
slotPopupMenu

void ClientSocket::slotSendMessageAllUsers (  )  [private, slot]

send out messages (popupwindows) to all users

See also:
slotPopupMenu

void ClientSocket::socketclosed (  )  [private, slot]

Slot connection is closed

void ClientSocket::socketconnected (  )  [private, slot]

SLot connection is OK

void ClientSocket::socketConnectionClose (  )  [slot]

Close connection.

void ClientSocket::UnreachableHost (  )  [private, slot]

Host is unreachable


Member Data Documentation

bool ClientSocket::AuthUser [private]

if user authenticated

static int ClientSocket::compteur_objet = 0 [static]

Q3ListViewItem* ClientSocket::currentPopupMenuItem [private]

int ClientSocket::echo [private]

QTimer* ClientSocket::echo_timer [private]

QTimer* ClientSocket::echo_timer [private]

smbstatus* ClientSocket::InstanceSmbstatus [private]

server* ClientSocket::item_server [private]

QStringList ClientSocket::ListSmbstatus [private]

Q3ListView* ClientSocket::listView [private]

Q3PopupMenu* ClientSocket::menu [private]

QErrorMessage* ClientSocket::msgError [private]

PamThread* ClientSocket::pamthread [private]

QString ClientSocket::passwd_login [private]

bool ClientSocket::permitDisconnectUser [private]

if client is authorized to disconnect user

bool ClientSocket::permitSendMsg [private]

if client is authorized to send popup message

QSocketNotifier* ClientSocket::sn_exception [private]

QSocketNotifier* ClientSocket::sn_read [private]

int ClientSocket::socket [private]

ClientSSL* ClientSocket::socketclient [private]

Q3SocketDevice* ClientSocket::socketdevice [private]

SSL* ClientSocket::ssl [private]

bool ClientSocket::ssl_connected [private]

bool ClientSocket::SSL_init [private]

QTimer* ClientSocket::timer [private]

QTimer* ClientSocket::timer [private]

static int ClientSocket::TimoutTimerEcho = 30000 [static, private]

Time between 2 echo request.

QString ClientSocket::username_login [private]


The documentation for this class was generated from the following files:
Generated on Fri Nov 2 21:44:59 2007 for qtsmbstatus.kdevelop by  doxygen 1.5.3