DaemonUtils.h

Go to the documentation of this file.
00001 // @(#)root/auth:$Id: DaemonUtils.h 36126 2010-10-06 15:14:52Z ganis $
00002 // Author: Gerri Ganis  19/1/2004
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2003, 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_DaemonUtils
00013 #define ROOT_DaemonUtils
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // DaemonUtils                                                          //
00019 //                                                                      //
00020 // This file defines wrappers to client utils calls used by server      //
00021 // authentication daemons.                                              //
00022 //                                                                      //
00023 //////////////////////////////////////////////////////////////////////////
00024 
00025 #include <string>
00026 
00027 #ifndef ROOT_TSocket
00028 #include "TSocket.h"
00029 #endif
00030 #ifndef ROOT_TSeqCollection
00031 #include "TSeqCollection.h"
00032 #endif
00033 #ifndef ROOT_NetErrors
00034 #include "NetErrors.h"
00035 #endif
00036 #ifndef ROOT_rpddefs
00037 #include "rpddefs.h"
00038 #endif
00039 
00040 
00041 extern Int_t SrvAuthImpl(TSocket *socket, const char *, const char *,
00042                          std::string &user, Int_t &meth,
00043                          Int_t &type, std::string &ctoken, TSeqCollection *);
00044 extern Int_t SrvClupImpl(TSeqCollection *);
00045 
00046 typedef void (*ErrorHandler_t)(int level, const char *msg, int size);
00047 
00048 
00049 namespace ROOT {
00050 
00051 // Error handlers prototypes ...
00052 extern ErrorHandler_t gErrSys;
00053 extern ErrorHandler_t gErrFatal;
00054 extern ErrorHandler_t gErr;
00055 
00056 int  GetErrno();
00057 void ResetErrno();
00058 void ErrorInit(const char *ident);
00059 void ErrorInfo(const char *fmt, ...);
00060 void Perror(char *buf, int size);
00061 void Error(ErrorHandler_t ErrHand,int code,const char *fmt, ...);
00062 
00063 void RpdAuthCleanup(const char *sstr, int opt);
00064 int  RpdCleanupAuthTab(const char *crypttoken);
00065 int  RpdGenRSAKeys(int);
00066 void RpdSetErrorHandler(ErrorHandler_t Err, ErrorHandler_t Sys,
00067                         ErrorHandler_t Fatal);
00068 void RpdSetMethInitFlag(int methinit);
00069 int  RpdInitSession(int, std::string &, int &, int &, int &, std::string &);
00070 void RpdInit(EService serv, int pid, int sproto,
00071              unsigned int opts, int rumsk, int sshp,
00072              const char *tmpd, const char *asrpp, int login = 0);
00073 
00074 void SrvSetSocket(TSocket *socket);
00075 
00076 void NetClose();
00077 int NetParOpen(int port, int size);
00078 int NetRecv(char *msg, int max);
00079 int NetRecv(char *msg, int len, EMessageTypes &kind);
00080 int NetRecv(void *&buf, int &len, EMessageTypes &kind);
00081 int NetRecvRaw(void *buf, int len);
00082 int NetRecvRaw(int sock, void *buf, int len);
00083 int NetSend(int code, EMessageTypes kind);
00084 int NetSend(const char *msg, EMessageTypes kind);
00085 int NetSend(const void *buf, int len, EMessageTypes kind);
00086 int NetSendAck();
00087 int NetSendError(ERootdErrors err);
00088 int NetSendRaw(const void *buf, int len);
00089 void NetGetRemoteHost(std::string &openhost);
00090 int NetGetSockFd();
00091 
00092 }
00093 
00094 #endif

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