ROOT logo
// @(#)root/krb5auth:$Id$
// Author: Maarten Ballintijn   27/10/2003

#ifndef ROOT_TKSocket
#define ROOT_TKSocket

#if !defined(__CINT__)

#ifndef ROOT_Krb5Auth
#include "Krb5Auth.h"
#endif

#else

typedef void* krb5_principal;
typedef void* krb5_auth_context;
typedef void* krb5_context;
typedef void* krb5_ccache;
typedef void* krb5_principal;

#endif

#ifndef ROOT_TObject
#include "TObject.h"
#endif


class TSocket;


class TKSocket : public TObject {

private:
   TSocket                *fSocket;       //underlying socket
   krb5_principal          fServer;       //server principal
   krb5_auth_context       fAuthContext;  //per connection kerberos authentication context

   static krb5_context     fgContext;     //shared kerberos context
   static krb5_ccache      fgCCDef;       //shared default credential cache
   static krb5_principal   fgClient;      //client principal

   TKSocket(TSocket *s = 0);

public:
   ~TKSocket();

   enum EEncoding { kNone = 0, kSafe = 1, kPriv = 2 };

   struct Desc_t {
      Short_t  fLength;
      Short_t  fType;
   };

   Int_t BlockRead(char *&buf, EEncoding &type);
   Int_t BlockWrite(const char *buf, Int_t len, EEncoding type);

   static TKSocket *Connect(const char *server, Int_t port);

   ClassDef(TKSocket,0) // General kerberized socket
};

#endif
 TKSocket.h:1
 TKSocket.h:2
 TKSocket.h:3
 TKSocket.h:4
 TKSocket.h:5
 TKSocket.h:6
 TKSocket.h:7
 TKSocket.h:8
 TKSocket.h:9
 TKSocket.h:10
 TKSocket.h:11
 TKSocket.h:12
 TKSocket.h:13
 TKSocket.h:14
 TKSocket.h:15
 TKSocket.h:16
 TKSocket.h:17
 TKSocket.h:18
 TKSocket.h:19
 TKSocket.h:20
 TKSocket.h:21
 TKSocket.h:22
 TKSocket.h:23
 TKSocket.h:24
 TKSocket.h:25
 TKSocket.h:26
 TKSocket.h:27
 TKSocket.h:28
 TKSocket.h:29
 TKSocket.h:30
 TKSocket.h:31
 TKSocket.h:32
 TKSocket.h:33
 TKSocket.h:34
 TKSocket.h:35
 TKSocket.h:36
 TKSocket.h:37
 TKSocket.h:38
 TKSocket.h:39
 TKSocket.h:40
 TKSocket.h:41
 TKSocket.h:42
 TKSocket.h:43
 TKSocket.h:44
 TKSocket.h:45
 TKSocket.h:46
 TKSocket.h:47
 TKSocket.h:48
 TKSocket.h:49
 TKSocket.h:50
 TKSocket.h:51
 TKSocket.h:52
 TKSocket.h:53
 TKSocket.h:54
 TKSocket.h:55
 TKSocket.h:56
 TKSocket.h:57
 TKSocket.h:58
 TKSocket.h:59
 TKSocket.h:60
 TKSocket.h:61
 TKSocket.h:62