• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

XrdFrmAdmin.hh

Go to the documentation of this file.
00001 #ifndef __FRMADMIN__HH
00002 #define __FRMADMIN__HH
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                        X r d F r m A d m i n . h h                         */
00006 /*                                                                            */
00007 /* (c) 2009 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*                            All Rights Reserved                             */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC02-76-SFO0515 with the Department of Energy              */
00011 /******************************************************************************/
00012   
00013 //          $Id: XrdFrmAdmin.hh,v 1.1 2009/05/22 00:52:36 abh Exp $
00014 
00015 #include <stdlib.h>
00016 #include <sys/types.h>
00017 
00018 #include "XrdOuc/XrdOucNSWalk.hh"
00019 
00020 class  XrdFrmFileset;
00021 class  XrdOucArgs;
00022 class  XrdOucTList;
00023 
00024 class XrdFrmAdmin
00025 {
00026 public:
00027 
00028 int  Audit();
00029 
00030 int  Copy();
00031 
00032 int  Create();
00033 
00034 int  Find();
00035 
00036 int  Help();
00037 
00038 int  MakeLF();
00039 
00040 int  Pin();
00041 
00042 int  Query();
00043 
00044 int  Quit() {exit(finalRC); return 0;}
00045 
00046 int  Reloc();
00047 
00048 int  Remove();
00049 
00050 int  Rename();
00051 
00052 void setArgs(int argc, char **argv);
00053 
00054 void setArgs(char *argv);
00055 
00056 int  xeqArgs(char *Cmd);
00057 
00058      XrdFrmAdmin() : finalRC(0) {}
00059     ~XrdFrmAdmin() {}
00060 
00061 private:
00062 int  AuditNameNB(XrdFrmFileset *sP);
00063 int  AuditNameNF(XrdFrmFileset *sP);
00064 int  AuditNameNL(XrdFrmFileset *sP);
00065 int  AuditNames();
00066 int  AuditNameXA(XrdFrmFileset *sP);
00067 int  AuditNameXL(XrdFrmFileset *sP, int dorm);
00068 int  AuditRemove(XrdFrmFileset *sP);
00069 int  AuditSpace();
00070 int  AuditSpaceAX(const char *Path);
00071 int  AuditSpaceAXDB(const char *Path);
00072 int  AuditSpaceAXDC(const char *Path, XrdOucNSWalk::NSEnt *nP);
00073 int  AuditSpaceAXDL(int dorm, const char *Path, const char *Dest);
00074 int  AuditSpaceXA(const char *Space, const char *Path);
00075 int  AuditSpaceXANB(XrdFrmFileset *sP);
00076 int  AuditUsage();
00077 int  AuditUsage(char *Space);
00078 int  AuditUsageAX(const char *Path);
00079 int  AuditUsageXA(const char *Path, const char *Space);
00080 int  isXA(XrdOucNSWalk::NSEnt *nP);
00081 
00082 int  FindFail(XrdOucArgs &Spec);
00083 int  FindNolk(XrdOucArgs &Spec);
00084 int  FindUnmi(XrdOucArgs &Spec);
00085 
00086 void Emsg(const char *tx1, const char *tx2=0, const char *tx3=0,
00087                            const char *tx4=0, const char *tx5=0);
00088 void Emsg(int Enum,        const char *tx2=0, const char *tx3=0,
00089                            const char *tx4=0, const char *tx5=0);
00090 void Msg(const char *tx1,  const char *tx2=0, const char *tx3=0,
00091                            const char *tx4=0, const char *tx5=0);
00092 
00093 int          Parse(const char *What, XrdOucArgs &Spec, const char **Reqs);
00094 int          ParseKeep(const char *What, const char *kTime);
00095 int          ParseOwner(const char *What, char *Uname);
00096 XrdOucTList *ParseSpace(char *Space, char **Path);
00097 
00098 int  mkLock(const char *Lfn);
00099 int  mkFile(int What, const char *Path, const char *Data=0, int Dlen=0);
00100 int  mkPin(const char *Lfn, const char *Pdata, int Pdlen);
00101 char mkStat(int What, const char *Lfn, char *Pfn, int Pfnsz);
00102 
00103 // For mkFile and mkStat the following options may be passed via What
00104 //
00105 static const int isPFN= 0x0001; // Filename is actual physical name
00106 static const int mkLF = 0x0002; // Make lock file
00107 static const int mkPF = 0x0004; // Make pin  file
00108 
00109 int  QueryPfn(XrdOucArgs &Spec);
00110 int  QueryRfn(XrdOucArgs &Spec);
00111 int  QuerySpace(XrdOucArgs &Spec);
00112 int  QuerySpace(const char *Pfn, char *Lnk=0, int Lsz=0);
00113 int  QueryUsage(XrdOucArgs &Spec);
00114 
00115 int  Reloc(char *srcLfn, char *Space);
00116 int  RelocCP(const char *srcpfn, const char *trgpfn, off_t srcSz);
00117 int  RelocWR(const char *outFn,  int oFD, char *Buff, size_t BLen, off_t Boff);
00118 
00119 int  Unlink(const char *Path);
00120 int  UnlinkDir(const char *Path, const char *lclPath);
00121 int  UnlinkDir(XrdOucNSWalk::NSEnt *&nP, XrdOucNSWalk::NSEnt *&dP);
00122 int  UnlinkFile(const char *lclPath);
00123 
00124 int  VerifyAll(char *path);
00125 char VerifyMP(const char *func, const char *path);
00126 
00127 static const char *AuditHelp;
00128 static const char *FindHelp;
00129 static const char *HelpHelp;
00130 static const char *MakeLFHelp;
00131 static const char *PinHelp;
00132 static const char *QueryHelp;
00133 static const char *RelocHelp;
00134 static const char *RemoveHelp;
00135 
00136 // Command control
00137 //
00138 char    **ArgV;
00139 char     *ArgS;
00140 int       ArgC;
00141 
00142 // The following are common variables for audit functions
00143 //
00144 long long numBytes;
00145 int       numDirs;
00146 int       numFiles;
00147 int       numProb;
00148 int       numFix;
00149 int       finalRC;
00150 
00151 // Options from the command
00152 //
00153 struct {char   All;
00154         char   Echo;
00155         char   Erase;
00156         char   Fix;
00157         char   Force;
00158         char   Keep;
00159         char   ktAlways;
00160         char   ktIdle;
00161         char   Local;
00162         char   MPType;
00163         char   Notify;
00164         char   Recurse;
00165         char  *Args[2];
00166         uid_t  Uid;
00167         gid_t  Gid;
00168         time_t KeepTime;
00169        } Opt;
00170 };
00171 namespace XrdFrm
00172 {
00173 extern XrdFrmAdmin Admin;
00174 }
00175 #endif

Generated on Wed Sep 1 2010 for xrootd by  doxygen 1.7.1