XrdProofdClientMgr.h

Go to the documentation of this file.
00001 // @(#)root/proofd:$Id: XrdProofdClientMgr.h 29058 2009-06-17 15:21:39Z ganis $
00002 // Author: G. Ganis Jan 2008
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_XrdProofdClientMgr
00013 #define ROOT_XrdProofdClientMgr
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // XrdProofdClientMgr                                                   //
00018 //                                                                      //
00019 // Author: G. Ganis, CERN, 2008                                         //
00020 //                                                                      //
00021 // Class managing clients.                                              //
00022 //                                                                      //
00023 //////////////////////////////////////////////////////////////////////////
00024 
00025 #include <list>
00026 #ifdef OLDXRDOUC
00027 #  include "XrdSysToOuc.h"
00028 #  include "XrdOuc/XrdOucSemWait.hh"
00029 #  include "XrdOuc/XrdOucPthread.hh"
00030 #else
00031 #  include "XrdSys/XrdSysPthread.hh"
00032 #endif
00033 
00034 #include "XrdProofdConfig.h"
00035 
00036 #include "XrdOuc/XrdOucString.hh"
00037 
00038 #define XPD_LOGGEDIN       1
00039 #define XPD_NEED_AUTH      2
00040 #define XPD_ADMINUSER      4
00041 #define XPD_NEED_MAP       8
00042 
00043 class XrdProofdClient;
00044 class XrdProofdConfig;
00045 class XrdProofdManager;
00046 class XrdProofdProtocol;
00047 class XrdProtocol_Config;
00048 class XrdSysError;
00049 class XrdSecService;
00050 
00051 
00052 class XrdProofdClientMgr : public XrdProofdConfig {
00053 
00054    XrdSysRecMutex    *fMutex;
00055    XrdProofdManager  *fMgr;
00056    XrdOucString       fSecLib;
00057    XrdSecService     *fCIA;            // Authentication Server
00058 
00059    int                fCheckFrequency;
00060    XrdProofdPipe      fPipe;
00061 
00062    XrdOucString       fClntAdminPath;  // Client admin area
00063    int                fNDisconnected;  // Clients previously connected still offline
00064    int                fReconnectTimeOut;
00065    int                fActivityTimeOut;
00066 
00067    std::list<XrdProofdClient *> fProofdClients;        // keeps track of all users
00068 
00069    int                CheckAdminPath(XrdProofdProtocol *p,
00070                                      XrdOucString &cidpath, XrdOucString &emsg);
00071    int                CreateAdminPath(XrdProofdProtocol *p,
00072                                       XrdOucString &path, XrdOucString &e);
00073    int                RestoreAdminPath(XrdOucString &cpath, XrdOucString &emsg);
00074    int                ParsePreviousClients(XrdOucString &emsg);
00075    int                MapClient(XrdProofdProtocol *xp, bool all = 1);
00076    char              *FilterSecConfig(int &nd);
00077 
00078    void               RegisterDirectives();
00079    int                DoDirectiveClientMgr(char *, XrdOucStream *, bool);
00080 
00081    // Security service
00082    XrdSecService     *LoadSecurity();
00083 
00084 public:
00085    XrdProofdClientMgr(XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e);
00086    virtual ~XrdProofdClientMgr() { SafeDel(fMutex); }
00087 
00088    enum CMProtocol { kClientDisconnect = 0 };
00089 
00090    int               Config(bool rcf = 0);
00091    int               DoDirective(XrdProofdDirective *d,
00092                                  char *val, XrdOucStream *cfg, bool rcf);
00093    int               CheckClients();
00094 
00095    XrdProofdClient  *GetClient(const char *usr, const char *grp = 0, bool create = 1);
00096    int               GetNClients() const { XrdSysMutexHelper mh(fMutex);
00097                                            return fProofdClients.size(); }
00098 
00099    void              Broadcast(XrdProofdClient *c, const char *msg);
00100    void              TerminateSessions(XrdProofdClient *c, const char *msg, int srvtype);
00101 
00102    int               Process(XrdProofdProtocol *p);
00103 
00104    int               Auth(XrdProofdProtocol *xp);
00105    int               Login(XrdProofdProtocol *xp);
00106 
00107    int               CheckFrequency() const { return fCheckFrequency; }
00108    inline XrdProofdPipe *Pipe() { return &fPipe; }
00109 };
00110 #endif

Generated on Tue Jul 5 14:51:45 2011 for ROOT_528-00b_version by  doxygen 1.5.1