00001 #ifndef __CLIENTLIST_H 00002 #define __CLIENTLIST_H 00003 00004 #include<time.h> 00005 #include<stdlib.h> 00006 #include<stdio.h> 00007 #include "openssl/ssl.h" 00008 #include <arpa/inet.h> 00009 00010 #include "common.h" 00011 00018 class ClientList 00019 { 00020 private: 00021 enum{SLEEP, ACTIVE, BUSY}; 00022 long clientIP[MAX_CLIENT_LIST]; 00023 short status[MAX_CLIENT_LIST]; 00024 X509 *certificate[MAX_CLIENT_LIST]; 00025 long LastActivity[MAX_CLIENT_LIST]; 00026 SSL* sslList[MAX_CLIENT_LIST]; 00028 int numClients; 00029 int updateStatus(); 00030 public: 00031 ClientList(); 00032 ~ClientList(); 00033 void setActive(long clientId) ; 00034 long getNewID(); 00035 long getClientID(long clientIP); 00036 char *getClientList(int clientId,int &len); 00037 X509 *getClientCertificate(int clientID); 00038 SSL *getClientStream(int clientID); 00039 EVP_PKEY *getClientPublicKey(int clientID); 00040 int add(long clientIP,X509 *cert,SSL* ssl); 00041 }; 00042 00043 #endif