00001
00002 #ifndef __SUT_PFENTRY_H
00003 #define __SUT_PFENTRY_H
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <XProtocol/XProtocol.hh>
00016
00017
00018
00019
00020
00021
00022
00023 enum kPFEntryStatus {
00024 kPFE_inactive = -2,
00025 kPFE_disabled,
00026 kPFE_allowed,
00027 kPFE_ok,
00028 kPFE_onetime,
00029 kPFE_expired,
00030 kPFE_special,
00031 kPFE_anonymous,
00032 kPFE_crypt
00033 };
00034
00035
00036
00037
00038 class XrdSutPFBuf {
00039 public:
00040 char *buf;
00041 kXR_int32 len;
00042 XrdSutPFBuf(char *b = 0, kXR_int32 l = 0);
00043 XrdSutPFBuf(const XrdSutPFBuf &b);
00044
00045 virtual ~XrdSutPFBuf() { if (len > 0 && buf) delete[] buf; }
00046
00047 void SetBuf(const char *b = 0, kXR_int32 l = 0);
00048 };
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 class XrdSutPFEntry {
00062 public:
00063 char *name;
00064 short status;
00065 short cnt;
00066 kXR_int32 mtime;
00067 XrdSutPFBuf buf1;
00068 XrdSutPFBuf buf2;
00069 XrdSutPFBuf buf3;
00070 XrdSutPFBuf buf4;
00071 XrdSutPFEntry(const char *n = 0, short st = 0, short cn = 0,
00072 kXR_int32 mt = 0);
00073 XrdSutPFEntry(const XrdSutPFEntry &e);
00074 virtual ~XrdSutPFEntry() { if (name) delete[] name; }
00075 kXR_int32 Length() const { return (buf1.len + buf2.len + 2*sizeof(short) +
00076 buf3.len + buf4.len + 5*sizeof(kXR_int32)); }
00077 void Reset();
00078 void SetName(const char *n = 0);
00079 char *AsString() const;
00080
00081 XrdSutPFEntry &operator=(const XrdSutPFEntry &pfe);
00082 };
00083
00084 #endif