xrootd
Loading...
Searching...
No Matches
XrdFrmCns.hh
Go to the documentation of this file.
1#ifndef __XRDFRMCNS_HH__
2#define __XRDFRMCNS_HH__
3/******************************************************************************/
4/* */
5/* X r d F r m C n s . h h */
6/* */
7/* (c) 2011 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
33#include <sys/types.h>
34#include <sys/uio.h>
35
37{
38public:
39
40static void Add(const char *tID,const char *Path,long long Size,mode_t Mode);
41
42static
43const int cnsAuto = -1; // Init Opts: Use cnsd if there, ignore o/w
44static
45const int cnsIgnore = 0; // Init Opts: Always ignore the cnsd
46static
47const int cnsRequire = 1; // Init Opts: Wait for cnsd if not present
48
49static int Init(const char *aPath, int Opts);
50
51static int Init(const char *myID, const char *aPath, const char *iName);
52
53static void Rm (const char *Path, int islfn=0)
54 {if (cnsMode) Del(Path, HdrRmf, islfn);}
55
56static void Rmd(const char *Path, int islfn=0)
57 {if (cnsMode) Del(Path, HdrRmd, islfn);}
58
61
62private:
63
64static const int HdrRmd = 0;
65static const int HdrRmf = 1;
66
67static void Del(const char *Path, int HdrType, int islfn=0);
68static int Init();
69static int Retry(int eNum, int &pMsg);
70static int Send2Cnsd(struct iovec *iov, int iovn);
71static int setPath(const char *aPath, const char *iName);
72
73static char *cnsPath;
74static char *cnsHdr[2];
75static int cnsHdrLen;
76static int cnsInit;
77static int cnsFD;
78static int cnsMode;
79};
80#endif
Definition XrdFrmCns.hh:37
static char * cnsHdr[2]
Definition XrdFrmCns.hh:74
static int Init(const char *aPath, int Opts)
static void Add(const char *tID, const char *Path, long long Size, mode_t Mode)
~XrdFrmCns()
Definition XrdFrmCns.hh:60
static void Rmd(const char *Path, int islfn=0)
Definition XrdFrmCns.hh:56
static int cnsFD
Definition XrdFrmCns.hh:77
static int Retry(int eNum, int &pMsg)
static int setPath(const char *aPath, const char *iName)
static int cnsHdrLen
Definition XrdFrmCns.hh:75
static int Send2Cnsd(struct iovec *iov, int iovn)
static const int cnsAuto
Definition XrdFrmCns.hh:43
static void Rm(const char *Path, int islfn=0)
Definition XrdFrmCns.hh:53
static void Del(const char *Path, int HdrType, int islfn=0)
static char * cnsPath
Definition XrdFrmCns.hh:73
static int Init(const char *myID, const char *aPath, const char *iName)
static int Init()
static const int cnsIgnore
Definition XrdFrmCns.hh:45
static const int cnsRequire
Definition XrdFrmCns.hh:47
XrdFrmCns()
Definition XrdFrmCns.hh:59
static const int HdrRmf
Definition XrdFrmCns.hh:65
static const int HdrRmd
Definition XrdFrmCns.hh:64
static int cnsInit
Definition XrdFrmCns.hh:76
static int cnsMode
Definition XrdFrmCns.hh:78
Definition XrdOucIOVec.hh:65