GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
rawapin.c File Reference
#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.

Macros

#define MAX_BUFSIZE   32768
 
#define MAX_LOG_FILE   64 /* max length of client log file name */
 

Functions

char * rawGetFSpName (char *)
 
int rfio_access (const char *pcFile, int iMode)
 
int rfio_cache_stat (const char *pcFile)
 
int rfio_close (int iFileId)
 
int rfio_closedir (void *dirp)
 
int rfio_endfile (int iFileId)
 
int rfio_fclose (RFILE *pRemFile)
 
int rfio_fendfile (RFILE *pRemFile)
 
int rfio_fnewfile (RFILE *pRemFile, char *pcFile)
 
RFILErfio_fopen (char *pcFile, char *pcOptions)
 
RFILErfio_fopen_gsidaq (char *pcFile, char *pcOptions, int iCopyMode, char *pcCopyPath, int iCopyFraction, int iMaxFile, int iPathConvention)
 
RFILErfio_fopen_gsidaq_dm (char *pcFile, char *pcOptions, char *pcDataMover, int *piDataMover, int iCopyMode, char *pcCopyPath, int iCopyFraction, int iMaxFile, int iPathConvention)
 
size_t rfio_fread (char *pcBuffer, size_t iSize, size_t iItems, RFILE *pRemFile)
 
int rfio_fstat (int iFileId, struct stat *pStatBuf)
 
size_t rfio_fwrite (const char *pcBuffer, size_t iSize, size_t iItems, RFILE *pRemFile)
 
int rfio_gsi_query (int iFileId, int iFull, int iOut, char *pInfo)
 
int rfio_lseek (int iFileId, int ilocOffset, int ilocSeekMode)
 
int rfio_mkdir (const char *path, int mode)
 
int rfio_newfile (int iFileId, char *pcFile)
 
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)
 
void * rfio_opendir (const char *dirpath)
 
int rfio_parse (char *pcFile, char **pcNode, char **pcPath)
 
void rfio_perror (const char *pUMsg)
 
ssize_t rfio_read (int iFileId, char *pcBuffer, size_t iItems)
 
void * rfio_readdir (void *dirp)
 
char * rfio_serror ()
 
int rfio_stat (const char *pcFile, struct stat *pStatBuf)
 
int rfio_unlink (const char *pcFile)
 
ssize_t rfio_write (int iFileId, const char *pcBuffer, size_t iItems)
 
int rfiosetopt (int iopt, int *pival, int ilen)
 

Variables

static char cLogClient [MAX_LOG_FILE] = ""
 
static char cNodeMaster [MAX_NODE] = ""
 
static char cNodeMover [MAX_NODE] = ""
 
static char cNodePrefix [MAX_NODE] = ""
 
static char cPrefix [MAX_FULL_FILE] = ""
 
FILE * fLogClient = NULL
 
FILE * fLogFile = NULL
 
static int iATLServer
 
static int iFileCount = 0
 
static int iFileMax = 10
 
static int iint = sizeof(int)
 
static int iLogFile = 1
 
int imySigS
 
static int iObjAttr = sizeof(srawObjAttr)
 
static int iOnlyQuery = 0
 
static int iOS64 = 0
 
static int iPortMaster = PORT_MASTER
 
static int iPortMover = PORT_MOVER
 
static int irawAPIFile = sizeof(srawAPIFile)
 
static int irawComm = sizeof(srawComm)
 
static int irawCopyCache = sizeof(srawCopyCache)
 
static int irawFileSystem = sizeof(srawFileSystem)
 
static int iSleepCacheFull = SLEEP_CACHE_FULL
 
static int iStatusLoopMax = MAXLOOP_CACHE_FULL
 
static RFILEpAPIFile [10]
 
int * piEntryList
 
static char rfio_errmsg [STATUS_LEN] = ""
 
int rfio_errno
 
int serrno
 
int tCastorVersionKey
 
int tStageHostKey
 
int tStagePortKey
 
int tSvcClassKey
 

Macro Definition Documentation

◆ MAX_BUFSIZE

#define MAX_BUFSIZE   32768

Definition at line 199 of file rawapin.c.

◆ MAX_LOG_FILE

#define MAX_LOG_FILE   64 /* max length of client log file name */

Definition at line 160 of file rawapin.c.

Referenced by rfio_open_gsidaq().

Function Documentation

◆ rawGetFSpName()

char * rawGetFSpName ( char * pcUser)

Definition at line 600 of file rawProcn.c.

References cNamefs, fLogFile, pcNull, pcQM, and pcStar.

Referenced by rfio_open_gsidaq().

◆ rfio_access()

int rfio_access ( const char * pcFile,
int iMode )

Definition at line 4442 of file rawapin.c.

References rfio_close(), and rfio_open().

◆ rfio_cache_stat()

◆ rfio_close()

◆ rfio_closedir()

int rfio_closedir ( void * dirp)

Definition at line 4930 of file rawapin.c.

References fLogClient.

◆ rfio_endfile()

◆ rfio_fclose()

int rfio_fclose ( RFILE * pRemFile)

Definition at line 4414 of file rawapin.c.

References RFILE, and rfio_close().

◆ rfio_fendfile()

int rfio_fendfile ( RFILE * pRemFile)

Definition at line 4385 of file rawapin.c.

References RFILE, and rfio_endfile().

◆ rfio_fnewfile()

int rfio_fnewfile ( RFILE * pRemFile,
char * pcFile )

Definition at line 4238 of file rawapin.c.

References fLogClient, iFileCount, iFileMax, pAPIFile, RFILE, and rfio_newfile().

◆ rfio_fopen()

RFILE * rfio_fopen ( char * pcFile,
char * pcOptions )

Definition at line 4002 of file rawapin.c.

References RFILE, and rfio_fopen_gsidaq().

◆ rfio_fopen_gsidaq()

RFILE * rfio_fopen_gsidaq ( char * pcFile,
char * pcOptions,
int iCopyMode,
char * pcCopyPath,
int iCopyFraction,
int iMaxFile,
int iPathConvention )

Definition at line 4151 of file rawapin.c.

References pAPIFile, RFILE, and rfio_open_gsidaq().

Referenced by rfio_fopen().

◆ rfio_fopen_gsidaq_dm()

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 4042 of file rawapin.c.

References cNodeMover, pAPIFile, RFILE, and rfio_open_gsidaq().

◆ rfio_fread()

size_t rfio_fread ( char * pcBuffer,
size_t iSize,
size_t iItems,
RFILE * pRemFile )

Definition at line 4307 of file rawapin.c.

References fLogClient, RFILE, and rfio_read().

◆ rfio_fstat()

int rfio_fstat ( int iFileId,
struct stat * pStatBuf )

◆ rfio_fwrite()

size_t rfio_fwrite ( const char * pcBuffer,
size_t iSize,
size_t iItems,
RFILE * pRemFile )

Definition at line 4345 of file rawapin.c.

References fLogClient, RFILE, and rfio_write().

◆ rfio_gsi_query()

int rfio_gsi_query ( int iFileId,
int iFull,
int iOut,
char * pInfo )

Definition at line 5309 of file rawapin.c.

References iFileCount, iFileMax, pAPIFile, rawQueryString(), and srawAPIFile::sQueryAPI.

◆ rfio_lseek()

int rfio_lseek ( int iFileId,
int ilocOffset,
int ilocSeekMode )

◆ rfio_mkdir()

int rfio_mkdir ( const char * path,
int mode )

Definition at line 4855 of file rawapin.c.

References fLogClient.

◆ rfio_newfile()

◆ rfio_open()

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().

◆ rfio_open_gsidaq()

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 ARCH_DAQ_DISK, ARCH_DISK, ARCH_TAPE, ARCHIVE_RECORD, ATLSERVER_ARCHIVE, cApplType, srawComm::cApplType, srawFileSystem::cArchiveDate, srawFileSystem::cArchiveUser, srawCopyCache::cCopyPath, srawComm::cDataFS, cDataFSHigh1, cDataFSHigh2, srawObjAttr::cDateCreate, srawComm::cliNode, cLogClient, cNamefs, srawComm::cNamefs, cNamehl, srawComm::cNamehl, srawComm::cNamell, srawDataMoverAttr::cNode, srawFileSystem::cNode, srawObjAttr::cNode, srawComm::cNodeCacheMgr, cNodeMaster, srawAPIFile::cNodeMaster, cNodeMaster0, cNodeMover, srawAPIFile::cNodeMover, cNodePrefix, srawComm::cNodeRC, srawComm::cNodeWC, srawComm::cOS, srawFileSystem::cOS, srawComm::cOwner, srawObjAttr::cOwner, cPrefix, srawStatus::cStatus, srawComm::cTapeLib, DSM_MAX_OWNER_LENGTH, fLogClient, fLogFile, GSI_CACHE_INCOMPLETE, GSI_CACHE_LOCKED, GSI_MEDIA_CACHE, GSI_MEDIA_INCOMPLETE, GSI_MEDIA_LOCKED, GSI_MEDIA_STAGE, HEAD_LEN, srawAPIFile::iAction, srawComm::iAction, srawComm::iArchDev, iATLServer, srawComm::iATLServer, srawDataMoverAttr::iATLServer, srawObjAttr::iATLServer, srawAPIFile::iBufnoServ, srawAPIFile::iBufsizeAct, srawComm::iBufsizeFile, srawObjAttr::iBufsizeFile, srawComm::iClient32, srawComm::iCommLen, srawCopyCache::iCopyFraction, srawCopyCache::iCopyLen, srawCopyCache::iCopyMode, srawComm::iDataFS, srawAPIFile::iDataServ, IDENT_COMM, IDENT_COPY_CACHE, srawComm::iExecStatus, srawDataMoverAttr::iExecStatus, iFileCount, srawAPIFile::iFileId, iFileMax, srawComm::iFileSize, srawObjAttr::iFileSize, srawComm::iFileSize2, srawObjAttr::iFileSize2, srawFileSystem::iFileSystem, srawComm::iFileType, srawObjAttr::iFileType, srawAPIFile::iFlags, srawObjAttr::iFS, srawComm::iFSidWC, srawComm::iIdent, srawCopyCache::iIdent, iLogFile, srawAPIFile::iMassSto, srawCopyCache::iMaxFile, srawObjAttr::iMediaClass, srawAPIFile::iMode, iObjAttr, srawComm::iObjHigh, srawObjAttr::iObjHigh, srawComm::iObjLow, srawObjAttr::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, srawComm::iWaitTime, srawDataMoverAttr::iWaitTime, MAX_ATLSERVER, MAX_FULL_FILE, MAX_LOG_FILE, MAX_NODE, MAX_OBJ_FS, MAX_OBJ_HL, MAX_OBJ_LL, srawQueryResult::objAttr, pAPIFile, pcDevDelim, pcPerc, pcQM, pcStar, PORT_MASTER, PORT_MOVER, PORT_MOVER_DATAFS, PORT_RFIO_SERV, QUERY, QUERY_ARCHIVE_RECORD, QUERY_RETRIEVE_RECORD, rawGetFSpName(), rawGetHLName(), rawGetLLName(), rawGetUserid(), rawQueryFile(), rawQueryString(), rawRecvHeadC(), rawRecvStatus(), rawSendStatus(), rconnect(), RETR_STAGE_TEMP, RETRIEVE_RECORD, rfio_errmsg, srawAPIFile::sCommAPI, srawAPIFile::sCommServ, srawAPIFile::sCopyCacheServ, SPM_REQUEST_MOVER, srawAPIFile::sQueryAPI, STA_CACHE_FULL, STA_END_OF_SESSION, STA_SWITCH_SERVER, STATUS_LEN, and STREAM.

Referenced by rfio_fopen_gsidaq(), rfio_fopen_gsidaq_dm(), and rfio_open().

◆ rfio_opendir()

void * rfio_opendir ( const char * dirpath)

Definition at line 4880 of file rawapin.c.

References fLogClient.

◆ rfio_parse()

int rfio_parse ( char * pcFile,
char ** pcNode,
char ** pcPath )

Definition at line 4726 of file rawapin.c.

◆ rfio_perror()

void rfio_perror ( const char * pUMsg)

Definition at line 4751 of file rawapin.c.

References rfio_errmsg.

◆ rfio_read()

◆ rfio_readdir()

void * rfio_readdir ( void * dirp)

Definition at line 4905 of file rawapin.c.

References fLogClient.

◆ rfio_serror()

char * rfio_serror ( )

Definition at line 4779 of file rawapin.c.

References fLogClient, and rfio_errmsg.

◆ rfio_stat()

int rfio_stat ( const char * pcFile,
struct stat * pStatBuf )

◆ rfio_unlink()

int rfio_unlink ( const char * pcFile)

Definition at line 4808 of file rawapin.c.

References fLogClient.

◆ rfio_write()

ssize_t rfio_write ( int iFileId,
const char * pcBuffer,
size_t iItems )

◆ rfiosetopt()

int rfiosetopt ( int iopt,
int * pival,
int ilen )

Definition at line 4833 of file rawapin.c.

Variable Documentation

◆ cLogClient

char cLogClient[MAX_LOG_FILE] = ""
static

Definition at line 161 of file rawapin.c.

Referenced by rfio_open_gsidaq().

◆ cNodeMaster

char cNodeMaster[MAX_NODE] = ""
static

Definition at line 210 of file rawapin.c.

Referenced by rfio_open_gsidaq().

◆ cNodeMover

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().

◆ cNodePrefix

char cNodePrefix[MAX_NODE] = ""
static

Definition at line 209 of file rawapin.c.

Referenced by rfio_open_gsidaq().

◆ cPrefix

char cPrefix[MAX_FULL_FILE] = ""
static

Definition at line 208 of file rawapin.c.

Referenced by rfio_newfile(), and rfio_open_gsidaq().

◆ fLogClient

◆ fLogFile

◆ iATLServer

int iATLServer
static

◆ iFileCount

◆ iFileMax

◆ iint

int iint = sizeof(int)
static

Definition at line 200 of file rawapin.c.

Referenced by rawCheckObjlist(), rawSortValues(), rfio_read(), and rfio_write().

◆ iLogFile

int iLogFile = 1
static

Definition at line 162 of file rawapin.c.

Referenced by rfio_open_gsidaq().

◆ imySigS

int imySigS

Definition at line 184 of file rawapin.c.

Referenced by rconnect().

◆ iObjAttr

int iObjAttr = sizeof(srawObjAttr)
static

Definition at line 202 of file rawapin.c.

Referenced by rfio_open_gsidaq().

◆ iOnlyQuery

int iOnlyQuery = 0
static

Definition at line 207 of file rawapin.c.

Referenced by rfio_cache_stat(), rfio_open_gsidaq(), and rfio_stat().

◆ iOS64

int iOS64 = 0
static

Definition at line 163 of file rawapin.c.

Referenced by rfio_open_gsidaq().

◆ iPortMaster

int iPortMaster = PORT_MASTER
static

Definition at line 212 of file rawapin.c.

Referenced by rfio_open_gsidaq().

◆ iPortMover

int iPortMover = PORT_MOVER
static

Definition at line 213 of file rawapin.c.

Referenced by rfio_newfile(), and rfio_open_gsidaq().

◆ irawAPIFile

int irawAPIFile = sizeof(srawAPIFile)
static

Definition at line 205 of file rawapin.c.

Referenced by rfio_open_gsidaq().

◆ irawComm

int irawComm = sizeof(srawComm)
static

Definition at line 201 of file rawapin.c.

Referenced by rfio_newfile(), and rfio_open_gsidaq().

◆ irawCopyCache

int irawCopyCache = sizeof(srawCopyCache)
static

Definition at line 204 of file rawapin.c.

Referenced by rfio_newfile().

◆ irawFileSystem

int irawFileSystem = sizeof(srawFileSystem)
static

Definition at line 203 of file rawapin.c.

Referenced by rfio_open_gsidaq().

◆ iSleepCacheFull

int iSleepCacheFull = SLEEP_CACHE_FULL
static

Definition at line 219 of file rawapin.c.

Referenced by rfio_newfile(), and rfio_open_gsidaq().

◆ iStatusLoopMax

int iStatusLoopMax = MAXLOOP_CACHE_FULL
static

Definition at line 217 of file rawapin.c.

Referenced by rfio_newfile(), and rfio_open_gsidaq().

◆ pAPIFile

RFILE* pAPIFile[10]
static
Initial value:
=
{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().

◆ piEntryList

int* piEntryList

Definition at line 183 of file rawapin.c.

Referenced by rawGetFilelistEntries().

◆ rfio_errmsg

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().

◆ rfio_errno

int rfio_errno

Definition at line 189 of file rawapin.c.

◆ serrno

int serrno

Definition at line 188 of file rawapin.c.

◆ tCastorVersionKey

int tCastorVersionKey

Definition at line 193 of file rawapin.c.

◆ tStageHostKey

int tStageHostKey

Definition at line 190 of file rawapin.c.

◆ tStagePortKey

int tStagePortKey

Definition at line 191 of file rawapin.c.

◆ tSvcClassKey

int tSvcClassKey

Definition at line 192 of file rawapin.c.