#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <fcntl.h>
#include <time.h>
#include <stdlib.h>
#include "rawdefn.h"
#include "rawapin.h"
#include "rawentn.h"
#include "rawapitd.h"
#include "rawapitd-gsin.h"
#include "rawapplcli.h"
Go to the source code of this file.
Defines | |
#define | MAX_LOG_FILE 64 |
#define | MAX_BUFSIZE 32768 |
Functions | |
char * | rawGetFSpName (char *) |
int | rfio_open (const char *pcFile, int iFlags, int iOpenMode) |
int | rfio_open_gsidaq (const char *pcFile, int iFlags, int iOpenMode, int iCopyMode, char *pcCopyPath, int iCopyFraction, int iMaxFile, int iPathConvention) |
int | rfio_endfile (int iFileId) |
ssize_t | rfio_read (int iFileId, char *pcBuffer, size_t iItems) |
ssize_t | rfio_write (int iFileId, const char *pcBuffer, size_t iItems) |
int | rfio_newfile (int iFileId, char *pcFile) |
int | rfio_close (int iFileId) |
int | rfio_lseek (int iFileId, int ilocOffset, int ilocSeekMode) |
RFILE * | rfio_fopen (char *pcFile, char *pcOptions) |
RFILE * | rfio_fopen_gsidaq_dm (char *pcFile, char *pcOptions, char *pcDataMover, int *piDataMover, int iCopyMode, char *pcCopyPath, int iCopyFraction, int iMaxFile, int iPathConvention) |
RFILE * | rfio_fopen_gsidaq (char *pcFile, char *pcOptions, int iCopyMode, char *pcCopyPath, int iCopyFraction, int iMaxFile, int iPathConvention) |
int | rfio_fnewfile (RFILE *pRemFile, char *pcFile) |
size_t | rfio_fread (char *pcBuffer, size_t iSize, size_t iItems, RFILE *pRemFile) |
size_t | rfio_fwrite (const char *pcBuffer, size_t iSize, size_t iItems, RFILE *pRemFile) |
int | rfio_fendfile (RFILE *pRemFile) |
int | rfio_fclose (RFILE *pRemFile) |
int | rfio_access (const char *pcFile, int iMode) |
int | rfio_fstat (int iFileId, struct stat *pStatBuf) |
int | rfio_parse (char *pcFile, char **pcNode, char **pcPath) |
void | rfio_perror (const char *pUMsg) |
char * | rfio_serror () |
int | rfio_unlink (const char *pcFile) |
int | rfiosetopt (int iopt, int *pival, int ilen) |
int | rfio_mkdir (const char *path, int mode) |
void * | rfio_opendir (const char *dirpath) |
void * | rfio_readdir (void *dirp) |
int | rfio_closedir (void *dirp) |
int | rfio_stat (const char *pcFile, struct stat *pStatBuf) |
int | rfio_cache_stat (const char *pcFile) |
int | rfio_gsi_query (int iFileId, int iFull, int iOut, char *pInfo) |
Variables | |
FILE * | fLogClient = NULL |
static char | cLogClient [MAX_LOG_FILE] = "" |
static int | iLogFile = 1 |
static int | iOS64 = 0 |
int * | piEntryList |
int | imySigS |
FILE * | fLogFile = NULL |
int | serrno |
int | rfio_errno |
int | tStageHostKey |
int | tStagePortKey |
int | tSvcClassKey |
int | tCastorVersionKey |
static char | rfio_errmsg [STATUS_LEN] = "" |
static int | iint = sizeof(int) |
static int | irawComm = sizeof(srawComm) |
static int | iObjAttr = sizeof(srawObjAttr) |
static int | irawFileSystem = sizeof(srawFileSystem) |
static int | irawCopyCache = sizeof(srawCopyCache) |
static int | irawAPIFile = sizeof(srawAPIFile) |
static int | iOnlyQuery = 0 |
static char | cPrefix [MAX_FULL_FILE] = "" |
static char | cNodePrefix [MAX_NODE] = "" |
static char | cNodeMaster [MAX_NODE] = "" |
static char | cNodeMover [MAX_NODE] = "" |
static int | iPortMaster = PORT_MASTER |
static int | iPortMover = PORT_MOVER |
static int | iATLServer |
static int | iStatusLoopMax = MAXLOOP_CACHE_FULL |
static int | iSleepCacheFull = SLEEP_CACHE_FULL |
static int | iFileCount = 0 |
static int | iFileMax = 10 |
static RFILE * | pAPIFile [10] |
char* rawGetFSpName | ( | char * | ) |
Definition at line 599 of file rawProcn.c.
References cNamefs, fLogFile, pcNull, pcQM, and pcStar.
Referenced by rfio_open_gsidaq().
int rfio_access | ( | const char * | pcFile, | |
int | iMode | |||
) |
Definition at line 4443 of file rawapin.c.
References rfio_close(), and rfio_open().
int rfio_cache_stat | ( | const char * | pcFile | ) |
Definition at line 5183 of file rawapin.c.
References srawComm::cNamefs, srawComm::cNamehl, srawComm::cNamell, fLogClient, iFileCount, iFileMax, srawComm::iFileSize, srawComm::iFSidWC, iOnlyQuery, srawComm::iStageFSid, pAPIFile, and rfio_open().
int rfio_close | ( | int | iFileId | ) |
Definition at line 3717 of file rawapin.c.
References ARCH_TAPE, ARCHIVE_RECORD, srawComm::cNamefs, srawComm::cNamehl, srawComm::cNamell, srawAPIFile::cNodeMover, fLogClient, HEAD_LEN, srawComm::iAction, srawComm::iArchDev, iFileCount, iFileMax, srawAPIFile::iMassSto, srawAPIFile::iOpMode, srawAPIFile::iSockMaster, srawAPIFile::iSockMover, srawStatus::iStatus, pAPIFile, rawRecvStatus(), rawSendStatus(), and srawAPIFile::sCommAPI.
Referenced by rfio_access(), and rfio_fclose().
int rfio_closedir | ( | void * | dirp | ) |
Definition at line 4931 of file rawapin.c.
References fLogClient.
int rfio_endfile | ( | int | iFileId | ) |
Definition at line 2395 of file rawapin.c.
References srawComm::cNamefs, srawComm::cNamehl, srawComm::cNamell, srawStatus::cStatus, fLogClient, HEAD_LEN, srawAPIFile::iBufnoServ, iFileCount, iFileMax, srawAPIFile::iMassSto, srawAPIFile::iOpMode, srawAPIFile::iSockMover, srawStatus::iStatus, pAPIFile, rawRecvStatus(), rawSendStatus(), srawAPIFile::sCommAPI, srawAPIFile::sCommServ, srawAPIFile::sCopyCacheServ, STA_CACHE_COPY, and STA_CACHE_COPY_ERROR.
Referenced by rfio_fendfile().
int rfio_fclose | ( | RFILE * | pRemFile | ) |
Definition at line 4415 of file rawapin.c.
References rfio_close().
int rfio_fendfile | ( | RFILE * | pRemFile | ) |
Definition at line 4386 of file rawapin.c.
References rfio_endfile().
int rfio_fnewfile | ( | RFILE * | pRemFile, | |
char * | pcFile | |||
) |
Definition at line 4239 of file rawapin.c.
References fLogClient, iFileCount, iFileMax, pAPIFile, and rfio_newfile().
RFILE* rfio_fopen | ( | char * | pcFile, | |
char * | pcOptions | |||
) |
Definition at line 4003 of file rawapin.c.
References RFILE, and rfio_fopen_gsidaq().
RFILE* rfio_fopen_gsidaq | ( | char * | pcFile, | |
char * | pcOptions, | |||
int | iCopyMode, | |||
char * | pcCopyPath, | |||
int | iCopyFraction, | |||
int | iMaxFile, | |||
int | iPathConvention | |||
) |
Definition at line 4152 of file rawapin.c.
References pAPIFile, and rfio_open_gsidaq().
Referenced by rfio_fopen().
RFILE* rfio_fopen_gsidaq_dm | ( | char * | pcFile, | |
char * | pcOptions, | |||
char * | pcDataMover, | |||
int * | piDataMover, | |||
int | iCopyMode, | |||
char * | pcCopyPath, | |||
int | iCopyFraction, | |||
int | iMaxFile, | |||
int | iPathConvention | |||
) |
Definition at line 4043 of file rawapin.c.
References cNodeMover, pAPIFile, and rfio_open_gsidaq().
size_t rfio_fread | ( | char * | pcBuffer, | |
size_t | iSize, | |||
size_t | iItems, | |||
RFILE * | pRemFile | |||
) |
Definition at line 4308 of file rawapin.c.
References fLogClient, and rfio_read().
int rfio_fstat | ( | int | iFileId, | |
struct stat * | pStatBuf | |||
) |
Definition at line 4646 of file rawapin.c.
References srawComm::cNamefs, srawComm::cNamehl, srawComm::cNamell, fLogClient, iFileCount, iFileMax, srawComm::iFileSize, and pAPIFile.
size_t rfio_fwrite | ( | const char * | pcBuffer, | |
size_t | iSize, | |||
size_t | iItems, | |||
RFILE * | pRemFile | |||
) |
Definition at line 4346 of file rawapin.c.
References fLogClient, and rfio_write().
int rfio_gsi_query | ( | int | iFileId, | |
int | iFull, | |||
int | iOut, | |||
char * | pInfo | |||
) |
Definition at line 5311 of file rawapin.c.
References iFileCount, iFileMax, pAPIFile, rawQueryString(), and srawAPIFile::sQueryAPI.
int rfio_lseek | ( | int | iFileId, | |
int | ilocOffset, | |||
int | ilocSeekMode | |||
) |
Definition at line 3940 of file rawapin.c.
References fLogClient, srawAPIFile::iOffset, srawAPIFile::iSeekMode, srawAPIFile::iSockMover, pAPIFile, and rawSendRequest().
int rfio_mkdir | ( | const char * | path, | |
int | mode | |||
) |
Definition at line 4856 of file rawapin.c.
References fLogClient.
int rfio_newfile | ( | int | iFileId, | |
char * | pcFile | |||
) |
Definition at line 3017 of file rawapin.c.
References ARCH_TAPE, ARCHIVE_RECORD, srawComm::cNamefs, cNamefs, srawComm::cNamehl, cNamehl, srawComm::cNamell, srawAPIFile::cNodeMover, cNodeMover, cPrefix, srawStatus::cStatus, fLogClient, HEAD_LEN, srawComm::iAction, srawAPIFile::iAction, srawComm::iArchDev, srawComm::iATLServer, iATLServer, srawComm::iBufsizeFile, srawComm::iCommLen, srawCopyCache::iCopyLen, srawCopyCache::iCopyMode, iFileCount, iFileMax, srawComm::iIdent, srawAPIFile::iMassSto, iPortMover, irawComm, irawCopyCache, iSleepCacheFull, srawAPIFile::iSockMaster, srawAPIFile::iSockMover, srawStatus::iStatus, iStatusLoopMax, MAX_OBJ_FS, MAX_OBJ_HL, MAX_OBJ_LL, srawQueryResult::objAttr, pAPIFile, pcDevDelim, QUERY_ARCHIVE_RECORD, rawGetHLName(), rawQueryFile(), rawRecvStatus(), rconnect(), RETRIEVE_RECORD, rfio_errmsg, srawAPIFile::sCommAPI, srawAPIFile::sCommServ, srawAPIFile::sCopyCacheServ, STA_CACHE_FULL, STA_ERROR_EOF, and STA_SWITCH_SERVER.
Referenced by rfio_fnewfile().
int rfio_open | ( | const char * | pcFile, | |
int | iFlags, | |||
int | iOpenMode | |||
) |
Definition at line 275 of file rawapin.c.
References rfio_open_gsidaq().
Referenced by rfio_access(), rfio_cache_stat(), and rfio_stat().
int rfio_open_gsidaq | ( | const char * | pcFile, | |
int | iFlags, | |||
int | iOpenMode, | |||
int | iCopyMode, | |||
char * | pcCopyPath, | |||
int | iCopyFraction, | |||
int | iMaxFile, | |||
int | iPathConvention | |||
) |
Definition at line 314 of file rawapin.c.
References cApplType, srawComm::cApplType, srawFileSystem::cArchiveDate, srawFileSystem::cArchiveUser, srawCopyCache::cCopyPath, srawComm::cDataFS, cDataFSHigh1, cDataFSHigh2, srawObjAttr::cDateCreate, srawComm::cliNode, cLogClient, srawComm::cNamefs, cNamefs, srawComm::cNamehl, cNamehl, srawComm::cNamell, srawDataMoverAttr::cNode, srawFileSystem::cNode, srawObjAttr::cNode, srawComm::cNodeCacheMgr, srawAPIFile::cNodeMaster, cNodeMaster, cNodeMaster0, srawAPIFile::cNodeMover, cNodeMover, cNodePrefix, srawComm::cNodeRC, srawComm::cNodeWC, srawFileSystem::cOS, srawComm::cOS, srawObjAttr::cOwner, srawComm::cOwner, cPrefix, srawStatus::cStatus, srawComm::cTapeLib, fLogClient, fLogFile, GSI_CACHE_INCOMPLETE, GSI_CACHE_LOCKED, GSI_MEDIA_CACHE, GSI_MEDIA_INCOMPLETE, GSI_MEDIA_LOCKED, GSI_MEDIA_STAGE, srawComm::iAction, srawAPIFile::iAction, srawComm::iArchDev, srawDataMoverAttr::iATLServer, srawObjAttr::iATLServer, srawComm::iATLServer, iATLServer, srawAPIFile::iBufnoServ, srawAPIFile::iBufsizeAct, srawObjAttr::iBufsizeFile, srawComm::iBufsizeFile, srawComm::iClient32, srawComm::iCommLen, srawCopyCache::iCopyFraction, srawCopyCache::iCopyLen, srawCopyCache::iCopyMode, srawComm::iDataFS, srawAPIFile::iDataServ, IDENT_COPY_CACHE, srawDataMoverAttr::iExecStatus, srawComm::iExecStatus, iFileCount, srawAPIFile::iFileId, iFileMax, srawObjAttr::iFileSize, srawComm::iFileSize, srawObjAttr::iFileSize2, srawComm::iFileSize2, srawFileSystem::iFileSystem, srawObjAttr::iFileType, srawComm::iFileType, srawAPIFile::iFlags, srawObjAttr::iFS, srawComm::iFSidWC, srawCopyCache::iIdent, srawComm::iIdent, iLogFile, srawAPIFile::iMassSto, srawCopyCache::iMaxFile, srawObjAttr::iMediaClass, srawAPIFile::iMode, iObjAttr, srawObjAttr::iObjHigh, srawComm::iObjHigh, srawObjAttr::iObjLow, srawComm::iObjLow, srawAPIFile::iOffset, iOnlyQuery, srawAPIFile::iOpMode, iOS64, srawCopyCache::iPathConvention, srawObjAttr::iPoolId, srawComm::iPoolIdRC, srawComm::iPoolIdWC, iPortMaster, iPortMover, irawAPIFile, irawComm, irawFileSystem, srawAPIFile::iSeekMode, iSleepCacheFull, srawAPIFile::iSockMaster, srawAPIFile::iSockMover, srawComm::iStageFSid, srawStatus::iStatus, iStatusLoopMax, srawComm::iSynchId, srawDataMoverAttr::iWaitTime, srawComm::iWaitTime, MAX_ATLSERVER, MAX_NODE, MAX_OBJ_FS, MAX_OBJ_HL, MAX_OBJ_LL, srawQueryResult::objAttr, pAPIFile, pcDevDelim, pcPerc, pcQM, pcStar, rawGetFSpName(), rawGetHLName(), rawGetLLName(), rawGetUserid(), rawQueryFile(), rawQueryString(), rawRecvHeadC(), rawRecvStatus(), rawSendStatus(), rconnect(), rfio_errmsg, srawAPIFile::sCommAPI, srawAPIFile::sCommServ, srawAPIFile::sCopyCacheServ, SPM_REQUEST_MOVER, srawAPIFile::sQueryAPI, STA_CACHE_FULL, STA_SWITCH_SERVER, and STREAM.
Referenced by rfio_fopen_gsidaq(), rfio_fopen_gsidaq_dm(), and rfio_open().
void* rfio_opendir | ( | const char * | dirpath | ) |
Definition at line 4881 of file rawapin.c.
References fLogClient.
int rfio_parse | ( | char * | pcFile, | |
char ** | pcNode, | |||
char ** | pcPath | |||
) |
void rfio_perror | ( | const char * | pUMsg | ) |
Definition at line 4752 of file rawapin.c.
References rfio_errmsg.
ssize_t rfio_read | ( | int | iFileId, | |
char * | pcBuffer, | |||
size_t | iItems | |||
) |
Definition at line 2530 of file rawapin.c.
References srawComm::cNamefs, srawComm::cNamehl, srawComm::cNamell, fLogClient, HEAD_LEN, srawAPIFile::iBufnoServ, srawAPIFile::iBufsizeAct, srawAPIFile::iDataServ, IDENT_STATUS, iFileCount, iFileMax, iint, srawAPIFile::iOffset, srawAPIFile::iSeekMode, srawAPIFile::iSockMover, pAPIFile, rawRecvError(), rawSendRequest(), srawAPIFile::sCommAPI, srawAPIFile::sCommServ, STA_END_OF_FILE, STA_END_OF_SESSION, STA_ERROR, and STA_ERROR_EOF.
Referenced by rfio_fread().
void* rfio_readdir | ( | void * | dirp | ) |
Definition at line 4906 of file rawapin.c.
References fLogClient.
char* rfio_serror | ( | ) |
Definition at line 4780 of file rawapin.c.
References fLogClient, and rfio_errmsg.
int rfio_stat | ( | const char * | pcFile, | |
struct stat * | pStatBuf | |||
) |
Definition at line 5074 of file rawapin.c.
References srawComm::cNamefs, srawComm::cNamehl, srawComm::cNamell, fLogClient, iFileCount, iFileMax, srawComm::iFileSize, iOnlyQuery, pAPIFile, and rfio_open().
int rfio_unlink | ( | const char * | pcFile | ) |
Definition at line 4809 of file rawapin.c.
References fLogClient.
ssize_t rfio_write | ( | int | iFileId, | |
const char * | pcBuffer, | |||
size_t | iItems | |||
) |
Definition at line 2843 of file rawapin.c.
References fLogClient, srawAPIFile::iBufnoServ, srawAPIFile::iBufsizeAct, srawComm::iBufsizeFile, srawAPIFile::iDataServ, iFileCount, iFileMax, iint, srawAPIFile::iSockMover, pAPIFile, srawAPIFile::sCommAPI, and srawAPIFile::sCommServ.
Referenced by rfio_fwrite().
char cLogClient[MAX_LOG_FILE] = "" [static] |
Definition at line 161 of file rawapin.c.
Referenced by rfio_open_gsidaq().
char cNodeMaster[MAX_NODE] = "" [static] |
Definition at line 210 of file rawapin.c.
Referenced by rfio_open_gsidaq().
char cNodeMover[MAX_NODE] = "" [static] |
Definition at line 211 of file rawapin.c.
Referenced by rfio_fopen_gsidaq_dm(), rfio_newfile(), and rfio_open_gsidaq().
char cNodePrefix[MAX_NODE] = "" [static] |
Definition at line 209 of file rawapin.c.
Referenced by rfio_open_gsidaq().
char cPrefix[MAX_FULL_FILE] = "" [static] |
Definition at line 208 of file rawapin.c.
Referenced by rfio_newfile(), and rfio_open_gsidaq().
FILE* fLogClient = NULL |
Definition at line 159 of file rawapin.c.
Referenced by rfio_cache_stat(), rfio_close(), rfio_closedir(), rfio_endfile(), rfio_fnewfile(), rfio_fread(), rfio_fstat(), rfio_fwrite(), rfio_lseek(), rfio_mkdir(), rfio_newfile(), rfio_open_gsidaq(), rfio_opendir(), rfio_read(), rfio_readdir(), rfio_serror(), rfio_stat(), rfio_unlink(), and rfio_write().
FILE* fLogFile = NULL |
Definition at line 185 of file rawapin.c.
Referenced by rawAddStrings(), rawCheckClientFile(), rawCheckFilelist(), rawCheckObjlist(), rawGetDirEntries(), rawGetDirEntryList(), rawGetFileAttr(), rawGetFileList(), rawGetFilelistEntries(), rawGetFileSize(), rawGetFSEntries(), rawGetFSfree(), rawGetFSpName(), rawGetFSSpace(), rawGetFullFile(), rawGetHLName(), rawGetHostConn(), rawGetLLName(), rawGetPathName(), rawGetUserid(), rawQueryFile(), rawQueryPrint(), rawQueryString(), rawRecvError(), rawRecvHead(), rawRecvHeadC(), rawRecvRequest(), rawRecvStatus(), rawSendRequest(), rawSendStatus(), rawSortValues(), rawTestFileName(), and rfio_open_gsidaq().
int iATLServer [static] |
Definition at line 214 of file rawapin.c.
Referenced by rawGetWSInfo(), rawQueryFile(), rawQueryPrint(), rawQueryString(), rfio_newfile(), and rfio_open_gsidaq().
int iFileCount = 0 [static] |
Definition at line 221 of file rawapin.c.
Referenced by rfio_cache_stat(), rfio_close(), rfio_endfile(), rfio_fnewfile(), rfio_fstat(), rfio_gsi_query(), rfio_newfile(), rfio_open_gsidaq(), rfio_read(), rfio_stat(), and rfio_write().
int iFileMax = 10 [static] |
Definition at line 222 of file rawapin.c.
Referenced by rfio_cache_stat(), rfio_close(), rfio_endfile(), rfio_fnewfile(), rfio_fstat(), rfio_gsi_query(), rfio_newfile(), rfio_open_gsidaq(), rfio_read(), rfio_stat(), and rfio_write().
int iint = sizeof(int) [static] |
Definition at line 200 of file rawapin.c.
Referenced by rfio_read(), and rfio_write().
int iLogFile = 1 [static] |
Definition at line 162 of file rawapin.c.
Referenced by rfio_open_gsidaq().
int imySigS |
Definition at line 184 of file rawapin.c.
Referenced by rconnect().
int iObjAttr = sizeof(srawObjAttr) [static] |
Definition at line 202 of file rawapin.c.
Referenced by rfio_open_gsidaq().
int iOnlyQuery = 0 [static] |
Definition at line 207 of file rawapin.c.
Referenced by rfio_cache_stat(), rfio_open_gsidaq(), and rfio_stat().
int iOS64 = 0 [static] |
Definition at line 163 of file rawapin.c.
Referenced by rfio_open_gsidaq().
int iPortMaster = PORT_MASTER [static] |
Definition at line 212 of file rawapin.c.
Referenced by rfio_open_gsidaq().
int iPortMover = PORT_MOVER [static] |
Definition at line 213 of file rawapin.c.
Referenced by rfio_newfile(), and rfio_open_gsidaq().
int irawAPIFile = sizeof(srawAPIFile) [static] |
Definition at line 205 of file rawapin.c.
Referenced by rfio_open_gsidaq().
Definition at line 201 of file rawapin.c.
Referenced by rfio_newfile(), and rfio_open_gsidaq().
int irawCopyCache = sizeof(srawCopyCache) [static] |
Definition at line 204 of file rawapin.c.
Referenced by rfio_newfile().
int irawFileSystem = sizeof(srawFileSystem) [static] |
Definition at line 203 of file rawapin.c.
Referenced by rfio_open_gsidaq().
int iSleepCacheFull = SLEEP_CACHE_FULL [static] |
Definition at line 219 of file rawapin.c.
Referenced by rfio_newfile(), and rfio_open_gsidaq().
int iStatusLoopMax = MAXLOOP_CACHE_FULL [static] |
Definition at line 217 of file rawapin.c.
Referenced by rfio_newfile(), and rfio_open_gsidaq().
RFILE* pAPIFile[10] [static] |
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
Definition at line 223 of file rawapin.c.
Referenced by rfio_cache_stat(), rfio_close(), rfio_endfile(), rfio_fnewfile(), rfio_fopen_gsidaq(), rfio_fopen_gsidaq_dm(), rfio_fstat(), rfio_gsi_query(), rfio_lseek(), rfio_newfile(), rfio_open_gsidaq(), rfio_read(), rfio_stat(), and rfio_write().
int* piEntryList |
Definition at line 183 of file rawapin.c.
Referenced by rawGetFilelistEntries().
char rfio_errmsg[STATUS_LEN] = "" [static] |
Definition at line 197 of file rawapin.c.
Referenced by rfio_newfile(), rfio_open_gsidaq(), rfio_perror(), and rfio_serror().
int rfio_errno |
int tStageHostKey |
int tStagePortKey |
int tSvcClassKey |