irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

miscServerFunct.hpp File Reference
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "rods.h"
#include "rcConnect.h"
#include "fileOpen.h"
#include "dataObjInpOut.h"
#include "dataCopy.h"
#include "rodsConnect.h"
#include "structFileSync.h"
Include dependency graph for miscServerFunct.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PortalTransferInp
 

Macros

#define MAX_RECON_ERROR_CNT   10
 

Typedefs

typedef struct PortalTransferInp portalTransferInp_t
 

Functions

int singleL1Copy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
int svrToSvrConnect (rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
 
int svrToSvrConnectNoLogin (rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
 
int createSrvPortal (rsComm_t *rsComm, portList_t *thisPortList, int proto)
 
int acceptSrvPortal (rsComm_t *rsComm, portList_t *thisPortList)
 
int svrPortalPutGet (rsComm_t *rsComm)
 
void partialDataPut (portalTransferInp_t *myInput)
 
void partialDataGet (portalTransferInp_t *myInput)
 
int fillPortalTransferInp (portalTransferInp_t *myInput, rsComm_t *rsComm, int srcFd, int destFd, int destRescTypeInx, int srcRescTypeInx, int threadNum, rodsLong_t size, rodsLong_t offset, int flags)
 
int sameHostCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
void sameHostPartialCopy (portalTransferInp_t *myInput)
 
int rbudpRemLocCopy (dataCopyInp_t *dataCopyInp)
 
int remLocCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
void remToLocPartialCopy (portalTransferInp_t *myInput)
 
void locToRemPartialCopy (portalTransferInp_t *myInput)
 
int singleRemLocCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
int singleRemToLocCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
int singleLocToRemCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
int isUserPrivileged (rsComm_t *rsComm)
 
int intNoSupport (...)
 
rodsLong_t longNoSupport (...)
 
void getZoneServerId (char *zoneName, char *zoneSID)
 
int svrPortalPutGetRbudp (rsComm_t *rsComm)
 
void reconnManager (rsComm_t *rsComm)
 
int svrChkReconnAtReadStart (rsComm_t *rsComm)
 
int svrChkReconnAtReadEnd (rsComm_t *rsComm)
 
int svrChkReconnAtSendStart (rsComm_t *rsComm)
 
int svrChkReconnAtSendEnd (rsComm_t *rsComm)
 
int svrSockOpenForInConn (rsComm_t *rsComm, int *portNum, char **addr, int proto)
 
char * getLocalSvrAddr ()
 
char * _getSvrAddr (rodsServerHost_t *rodsServerHost)
 
char * getSvrAddr (rodsServerHost_t *rodsServerHost)
 
int setLocalSrvAddr (char *outLocalAddr)
 
int forkAndExec (char *av[])
 
int setupSrvPortalForParaOpr (rsComm_t *rsComm, dataOprInp_t *dataOprInp, int oprType, portalOprOut_t **portalOprOut)
 
int initServiceUser ()
 
int isServiceUserSet ()
 
int changeToRootUser ()
 
int changeToServiceUser ()
 
int changeToUser (uid_t uid)
 
int dropRootPrivilege ()
 
int checkModArgType (const char *arg)
 

Macro Definition Documentation

◆ MAX_RECON_ERROR_CNT

#define MAX_RECON_ERROR_CNT   10

Definition at line 27 of file miscServerFunct.hpp.

Typedef Documentation

◆ portalTransferInp_t

Function Documentation

◆ _getSvrAddr()

char* _getSvrAddr ( rodsServerHost_t rodsServerHost)

Definition at line 2404 of file miscServerFunct.cpp.

References rodsServerHost::hostName, isLoopbackAddress(), hostName::name, hostName::next, and NULL.

Referenced by getLocalSvrAddr(), and getSvrAddr().

Here is the call graph for this function:

◆ acceptSrvPortal()

int acceptSrvPortal ( rsComm_t rsComm,
portList_t thisPortList 
)

Definition at line 283 of file miscServerFunct.cpp.

References CLOSE_SOCK, portList_t::cookie, getTcpSockFromPortList(), LOG_ERROR, LOG_NOTICE, NULL, rodsLog(), rodsSetSockOpt(), SELECT_TIMEOUT_FOR_CONN, SYS_PORT_COOKIE_ERR, SYS_SOCK_ACCEPT_ERR, SYS_SOCK_SELECT_ERR, and rsComm_t::windowSize.

Referenced by svrPortalPutGet(), and svrPortalPutGetRbudp().

Here is the call graph for this function:

◆ changeToRootUser()

int changeToRootUser ( )

Definition at line 2871 of file miscServerFunct.cpp.

References isServiceUserSet(), LOG_ERROR, rodsLogError(), and SYS_USER_NO_PERMISSION.

Referenced by changeToUser(), and dropRootPrivilege().

Here is the call graph for this function:

◆ changeToServiceUser()

int changeToServiceUser ( )

Definition at line 2899 of file miscServerFunct.cpp.

References isServiceUserSet(), LOG_ERROR, rodsLog(), rodsLogError(), ServiceGid, ServiceUid, and SYS_USER_NO_PERMISSION.

Referenced by initServiceUser().

Here is the call graph for this function:

◆ changeToUser()

int changeToUser ( uid_t  uid)

Definition at line 2931 of file miscServerFunct.cpp.

References changeToRootUser(), isServiceUserSet(), LOG_ERROR, rodsLogError(), and SYS_USER_NO_PERMISSION.

Here is the call graph for this function:

◆ checkModArgType()

int checkModArgType ( const char *  arg)

Definition at line 3002 of file miscServerFunct.cpp.

References CAT_INVALID_ARGUMENT, and NULL.

Referenced by _rsModAVUMetadata().

◆ createSrvPortal()

int createSrvPortal ( rsComm_t rsComm,
portList_t thisPortList,
int  proto 
)

◆ dropRootPrivilege()

int dropRootPrivilege ( )

Definition at line 2962 of file miscServerFunct.cpp.

References changeToRootUser(), isServiceUserSet(), LOG_ERROR, rodsLogError(), ServiceUid, and SYS_USER_NO_PERMISSION.

Here is the call graph for this function:

◆ fillPortalTransferInp()

◆ forkAndExec()

int forkAndExec ( char *  av[])

Definition at line 2456 of file miscServerFunct.cpp.

References EXEC_CMD_ERROR, LOG_ERROR, RODS_FORK, rodsLog(), irods.pypyodbc::status, and SYS_FORK_ERROR.

Here is the call graph for this function:

◆ getLocalSvrAddr()

char* getLocalSvrAddr ( )

Definition at line 2397 of file miscServerFunct.cpp.

References _getSvrAddr(), and LocalServerHost.

Referenced by svrSockOpenForInConn().

Here is the call graph for this function:

◆ getSvrAddr()

char* getSvrAddr ( rodsServerHost_t rodsServerHost)

Definition at line 2425 of file miscServerFunct.cpp.

References _getSvrAddr(), rodsServerHost::hostName, hostName::name, and NULL.

Referenced by setLocalSrvAddr().

Here is the call graph for this function:

◆ getZoneServerId()

void getZoneServerId ( char *  zoneName,
char *  zoneSID 
)

Definition at line 1945 of file miscServerFunct.cpp.

References LOCAL_ICAT, localSID, LOG_ERROR, zoneInfo::masterServerHost, MAX_NAME_LEN, MAX_PASSWORD_LEN, zoneInfo::next, NULL, rodsServerHost::rcatEnabled, remote_SID_key_map, rodsLog(), ZoneInfoHead, and zoneInfo::zoneName.

Referenced by rsAuthCheck().

Here is the call graph for this function:

◆ initServiceUser()

int initServiceUser ( )

Definition at line 2821 of file miscServerFunct.cpp.

References changeToServiceUser(), LOG_ERROR, NULL, rodsLogError(), ServiceGid, ServiceUid, and SYS_USER_RETRIEVE_ERR.

Here is the call graph for this function:

◆ intNoSupport()

int intNoSupport (   ...)

Definition at line 2010 of file miscServerFunct.cpp.

References SYS_NOT_SUPPORTED.

◆ isServiceUserSet()

int isServiceUserSet ( )

Definition at line 2858 of file miscServerFunct.cpp.

References ServiceUid.

Referenced by changeToRootUser(), changeToServiceUser(), changeToUser(), and dropRootPrivilege().

◆ isUserPrivileged()

◆ locToRemPartialCopy()

◆ longNoSupport()

rodsLong_t longNoSupport (   ...)

Definition at line 2015 of file miscServerFunct.cpp.

References SYS_NOT_SUPPORTED.

◆ partialDataGet()

◆ partialDataPut()

◆ rbudpRemLocCopy()

int rbudpRemLocCopy ( dataCopyInp_t dataCopyInp)

◆ reconnManager()

◆ remLocCopy()

◆ remToLocPartialCopy()

◆ sameHostCopy()

◆ sameHostPartialCopy()

◆ setLocalSrvAddr()

int setLocalSrvAddr ( char *  outLocalAddr)

Definition at line 2437 of file miscServerFunct.cpp.

References getSvrAddr(), LocalServerHost, NAME_LEN, NULL, rstrcpy(), SYS_INVALID_SERVER_HOST, and USER__NULL_INPUT_ERR.

Referenced by _rsProcStatAll(), and localProcStat().

Here is the call graph for this function:

◆ setupSrvPortalForParaOpr()

int setupSrvPortalForParaOpr ( rsComm_t rsComm,
dataOprInp_t dataOprInp,
int  oprType,
portalOprOut_t **  portalOprOut 
)

◆ singleL1Copy()

◆ singleLocToRemCopy()

◆ singleRemLocCopy()

int singleRemLocCopy ( rsComm_t rsComm,
dataCopyInp_t dataCopyInp 
)

Definition at line 2489 of file miscServerFunct.cpp.

References COPY_TO_LOCAL_OPR, DataCopyInp::dataOprInp, LOG_NOTICE, NULL, DataOprInp::oprType, rodsLog(), singleLocToRemCopy(), singleRemToLocCopy(), irods.pypyodbc::status, and SYS_INTERNAL_NULL_INPUT_ERR.

Referenced by remLocCopy().

Here is the call graph for this function:

◆ singleRemToLocCopy()

◆ svrChkReconnAtReadEnd()

◆ svrChkReconnAtReadStart()

int svrChkReconnAtReadStart ( rsComm_t rsComm)

Definition at line 2334 of file miscServerFunct.cpp.

References rsComm_t::agentState, thread_context::cond, CONN_WAIT_STATE, thread_context::lock, LOG_NOTICE, PROCESSING_STATE, RECEIVING_STATE, rsComm_t::reconnSock, rsComm_t::reconnThrState, rodsLog(), svrSwitchConnect(), and rsComm_t::thread_ctx.

Referenced by readAndProcClientMsg().

Here is the call graph for this function:

◆ svrChkReconnAtSendEnd()

◆ svrChkReconnAtSendStart()

int svrChkReconnAtSendStart ( rsComm_t rsComm)

Definition at line 2300 of file miscServerFunct.cpp.

References rsComm_t::agentState, thread_context::cond, CONN_WAIT_STATE, thread_context::lock, LOG_NOTICE, PROCESSING_STATE, rsComm_t::reconnSock, rsComm_t::reconnThrState, rodsLog(), SENDING_STATE, svrSwitchConnect(), and rsComm_t::thread_ctx.

Referenced by sendApiReply().

Here is the call graph for this function:

◆ svrPortalPutGet()

◆ svrPortalPutGetRbudp()

◆ svrSockOpenForInConn()

int svrSockOpenForInConn ( rsComm_t rsComm,
int portNum,
char **  addr,
int  proto 
)

Definition at line 2368 of file miscServerFunct.cpp.

References getLocalSvrAddr(), isLoopbackAddress(), LOG_NOTICE, NULL, rodsLog(), sockOpenForInConn(), and irods.pypyodbc::status.

Referenced by createSrvPortal(), and initAgent().

Here is the call graph for this function:

◆ svrToSvrConnect()

int svrToSvrConnect ( rsComm_t rsComm,
rodsServerHost_t rodsServerHost 
)

Definition at line 106 of file miscServerFunct.cpp.

References clientLogin(), rodsServerHost::conn, rodsServerHost::hostName, rodsServerHost::localFlag, LOG_NOTICE, hostName::name, rodsLog(), irods.pypyodbc::status, and svrToSvrConnectNoLogin().

Referenced by agentMain(), get_server_reports(), getAndConnRcatHost(), getAndConnReHost(), getAndConnRemoteZone(), getRemoteZoneHost(), remoteChkNVPathPerm(), remoteDataCopy(), remoteDataGet(), remoteDataPut(), remoteExecCmd(), remoteExecMyRule(), remoteFileChksum(), remoteFileChmod(), remoteFileClose(), remoteFileClosedir(), remoteFileCreate(), remoteFileGet(), remoteFileGetFsFreeSpace(), remoteFileLseek(), remoteFileMkdir(), remoteFileOpen(), remoteFileOpendir(), remoteFilePut(), remoteFileRead(), remoteFileReaddir(), remoteFileRename(), remoteFileRmdir(), remoteFileStageToCache(), remoteFileStat(), remoteFileSyncToArch(), remoteFileTruncate(), remoteFileUnlink(), remoteFileWrite(), remotePhyBundleColl(), remotePhyPathReg(), remoteProcStat(), remoteStructFileBundle(), remoteStructFileExtract(), remoteStructFileSync(), remoteSubStructFileClose(), remoteSubStructFileClosedir(), remoteSubStructFileCreate(), remoteSubStructFileGet(), remoteSubStructFileLseek(), remoteSubStructFileMkdir(), remoteSubStructFileOpen(), remoteSubStructFileOpendir(), remoteSubStructFilePut(), remoteSubStructFileRead(), remoteSubStructFileReaddir(), remoteSubStructFileRename(), remoteSubStructFileRmdir(), remoteSubStructFileStat(), remoteSubStructFileTruncate(), remoteSubStructFileUnlink(), remoteSubStructFileWrite(), remoteUnbunAndRegPhyBunfile(), resoAndConnHostByDataObjInfo(), and irods::resource_redirect().

Here is the call graph for this function:

◆ svrToSvrConnectNoLogin()

int svrToSvrConnectNoLogin ( rsComm_t rsComm,
rodsServerHost_t rodsServerHost 
)