chirp_reli.h
Go to the documentation of this file.
/*
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
Copyright (C) 2022 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef CHIRP_RELI_H
#define CHIRP_RELI_H
#include "chirp_types.h"
#include <sys/types.h>
#include <stdio.h>
#include <dirent.h>
struct chirp_file *chirp_reli_open(const char *host, const char *path, INT64_T flags, INT64_T mode, time_t stoptime);
INT64_T chirp_reli_close(struct chirp_file *file, time_t stoptime);
INT64_T chirp_reli_pread(struct chirp_file *file, void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
INT64_T chirp_reli_pwrite(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
INT64_T chirp_reli_pread_unbuffered(struct chirp_file *file, void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
INT64_T chirp_reli_pwrite_unbuffered(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
INT64_T chirp_reli_sread(struct chirp_file *file, void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
INT64_T chirp_reli_swrite(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
INT64_T chirp_reli_fstat(struct chirp_file *file, struct chirp_stat *info, time_t stoptime);
INT64_T chirp_reli_fstatfs(struct chirp_file *file, struct chirp_statfs *info, time_t stoptime);
INT64_T chirp_reli_fchown(struct chirp_file *file, INT64_T uid, INT64_T gid, time_t stoptime);
INT64_T chirp_reli_fchmod(struct chirp_file *file, INT64_T mode, time_t stoptime);
INT64_T chirp_reli_ftruncate(struct chirp_file *file, INT64_T length, time_t stoptime);
INT64_T chirp_reli_flush(struct chirp_file *file, time_t stoptime);
INT64_T chirp_reli_fsync(struct chirp_file *file, time_t stoptime);
INT64_T chirp_reli_getfile(const char *host, const char *path, FILE * stream, time_t stoptime);
INT64_T chirp_reli_getfile_buffer(const char *host, const char *path, char **buffer, time_t stoptime);
INT64_T chirp_reli_putfile(const char *host, const char *path, FILE * stream, INT64_T mode, INT64_T length, time_t stoptime);
INT64_T chirp_reli_putfile_buffer(const char *host, const char *path, const void *buffer, INT64_T mode, size_t length, time_t stoptime);
CHIRP_SEARCH *chirp_reli_opensearch( const char *host, const char *paths, const char *pattern, int flags, time_t stoptime );
INT64_T chirp_reli_getlongdir(const char *host, const char *path, chirp_longdir_t callback, void *arg, time_t stoptime);
INT64_T chirp_reli_getdir(const char *host, const char *path, chirp_dir_t callback, void *arg, time_t stoptime);
struct chirp_dir *chirp_reli_opendir(const char *host, const char *path, time_t stoptime);
struct chirp_dirent *chirp_reli_readdir(struct chirp_dir *dir);
void chirp_reli_closedir(struct chirp_dir *dir);
INT64_T chirp_reli_ticket_create(const char *host, char name[CHIRP_PATH_MAX], unsigned bits, time_t stoptime);
INT64_T chirp_reli_ticket_register(const char *host, const char *name, const char *subject, time_t duration, time_t stoptime);
INT64_T chirp_reli_ticket_modify(const char *host, const char *name, const char *path, const char *aclmask, time_t stoptime);
INT64_T chirp_reli_ticket_get(const char *host, const char *name, char **subject, char **ticket, time_t * duration, char ***rights, time_t stoptime);
INT64_T chirp_reli_ticket_list(const char *host, const char *subject, char ***list, time_t stoptime);
INT64_T chirp_reli_ticket_delete(const char *host, const char *name, time_t stoptime);
INT64_T chirp_reli_getacl(const char *host, const char *path, chirp_dir_t callback, void *arg, time_t stoptime);
INT64_T chirp_reli_setacl(const char *host, const char *path, const char *subject, const char *rights, time_t stoptime);
INT64_T chirp_reli_resetacl(const char *host, const char *path, const char *rights, time_t stoptime);
INT64_T chirp_reli_locate(const char *host, const char *path, chirp_loc_t callback, void *arg, time_t stoptime);
INT64_T chirp_reli_whoami(const char *host, char *subject, INT64_T length, time_t stoptime);
INT64_T chirp_reli_whoareyou(const char *host, const char *rhost, char *subject, INT64_T length, time_t stoptime);
INT64_T chirp_reli_unlink(const char *host, const char *path, time_t stoptime);
INT64_T chirp_reli_rename(const char *host, const char *path, const char *newpath, time_t stoptime);
INT64_T chirp_reli_link(const char *host, const char *path, const char *newpath, time_t stoptime);
INT64_T chirp_reli_symlink(const char *host, const char *path, const char *newpath, time_t stoptime);
INT64_T chirp_reli_readlink(const char *host, const char *path, char *buf, INT64_T length, time_t stoptime);
INT64_T chirp_reli_mkdir(const char *host, const char *path, INT64_T mode, time_t stoptime);
INT64_T chirp_reli_mkdir_recursive(const char *host, const char *path, INT64_T mode, time_t stoptime);
INT64_T chirp_reli_rmdir(const char *host, const char *path, time_t stoptime);
INT64_T chirp_reli_rmall(const char *host, const char *path, time_t stoptime);
INT64_T chirp_reli_stat(const char *host, const char *path, struct chirp_stat *info, time_t stoptime);
INT64_T chirp_reli_lstat(const char *host, const char *path, struct chirp_stat *info, time_t stoptime);
INT64_T chirp_reli_statfs(const char *host, const char *path, struct chirp_statfs *info, time_t stoptime);
INT64_T chirp_reli_access(const char *host, const char *path, INT64_T flags, time_t stoptime);
INT64_T chirp_reli_chmod(const char *host, const char *path, INT64_T mode, time_t stoptime);
INT64_T chirp_reli_chown(const char *host, const char *path, INT64_T uid, INT64_T gid, time_t stoptime);
INT64_T chirp_reli_lchown(const char *host, const char *path, INT64_T uid, INT64_T gid, time_t stoptime);
INT64_T chirp_reli_truncate(const char *host, const char *path, INT64_T length, time_t stoptime);
INT64_T chirp_reli_utime(const char *host, const char *path, time_t actime, time_t modtime, time_t stoptime);
INT64_T chirp_reli_hash(const char *host, const char *path, const char *algorithm, unsigned char digest[CHIRP_DIGEST_MAX], time_t stoptime);
INT64_T chirp_reli_md5(const char *host, const char *path, unsigned char digest[CHIRP_DIGEST_MAX], time_t stoptime);
INT64_T chirp_reli_setrep(const char *host, const char *path, int nreps, time_t stoptime );
INT64_T chirp_reli_getxattr(const char *host, const char *path, const char *name, void *data, size_t size, time_t stoptime);
INT64_T chirp_reli_fgetxattr(struct chirp_file *file, const char *name, void *data, size_t size, time_t stoptime);
INT64_T chirp_reli_lgetxattr(const char *host, const char *path, const char *name, void *data, size_t size, time_t stoptime);
INT64_T chirp_reli_listxattr(const char *host, const char *path, char *list, size_t size, time_t stoptime);
INT64_T chirp_reli_flistxattr(struct chirp_file *file, char *list, size_t size, time_t stoptime);
INT64_T chirp_reli_llistxattr(const char *host, const char *path, char *list, size_t size, time_t stoptime);
INT64_T chirp_reli_setxattr(const char *host, const char *path, const char *name, const void *data, size_t size, int flags, time_t stoptime);
INT64_T chirp_reli_fsetxattr(struct chirp_file *file, const char *name, const void *data, size_t size, int flags, time_t stoptime);
INT64_T chirp_reli_lsetxattr(const char *host, const char *path, const char *name, const void *data, size_t size, int flags, time_t stoptime);
INT64_T chirp_reli_removexattr(const char *host, const char *path, const char *name, time_t stoptime);
INT64_T chirp_reli_fremovexattr(struct chirp_file *file, const char *name, time_t stoptime);
INT64_T chirp_reli_lremovexattr(const char *host, const char *path, const char *name, time_t stoptime);
INT64_T chirp_reli_job_create (const char *host, const char *json, chirp_jobid_t *id, time_t stoptime);
INT64_T chirp_reli_job_commit (const char *host, chirp_jobid_t id, time_t stoptime);
INT64_T chirp_reli_job_kill (const char *host, chirp_jobid_t id, time_t stoptime);
INT64_T chirp_reli_job_status (const char *host, chirp_jobid_t id, char **status, time_t stoptime);
INT64_T chirp_reli_job_wait (const char *host, chirp_jobid_t id, INT64_T timeout, char **status, time_t stoptime);
INT64_T chirp_reli_job_reap (const char *host, chirp_jobid_t id, time_t stoptime);
INT64_T chirp_reli_remote_debug(const char *host, const char *flag, time_t stoptime);
INT64_T chirp_reli_localpath(const char *host, const char *path, char *localpath, int length, time_t stoptime);
INT64_T chirp_reli_audit(const char *host, const char *path, struct chirp_audit **list, time_t stoptime);
INT64_T chirp_reli_thirdput(const char *host, const char *path, const char *thirdhost, const char *thirdpath, time_t stoptime);
INT64_T chirp_reli_mkalloc(const char *host, const char *path, INT64_T size, INT64_T mode, time_t stoptime);
INT64_T chirp_reli_lsalloc(const char *host, const char *path, char *allocpath, INT64_T * total, INT64_T * inuse, time_t stoptime);
INT64_T chirp_reli_bulkio(struct chirp_bulkio *list, int count, time_t stoptime);
INT64_T chirp_reli_blocksize_get();
void chirp_reli_blocksize_set(INT64_T bs);
void chirp_reli_cleanup_before_fork();
void chirp_reli_disconnect( const char *host );
#endif
/* vim: set noexpandtab tabstop=8: */
CHIRP_PATH_MAX
#define CHIRP_PATH_MAX
The maximum length of a full path in any Chirp operation.
Definition chirp_protocol.h:20
chirp_reli_putfile
INT64_T chirp_reli_putfile(const char *host, const char *path, FILE *stream, INT64_T mode, INT64_T length, time_t stoptime)
Put an entire file efficiently.
chirp_reli_rename
INT64_T chirp_reli_rename(const char *host, const char *path, const char *newpath, time_t stoptime)
Rename a file or directory.
chirp_reli_ticket_delete
INT64_T chirp_reli_ticket_delete(const char *host, const char *name, time_t stoptime)
Delete an access control ticket.
chirp_reli_open
struct chirp_file * chirp_reli_open(const char *host, const char *path, INT64_T flags, INT64_T mode, time_t stoptime)
Creates or opens a file in preparation for I/O.
chirp_reli_getdir
INT64_T chirp_reli_getdir(const char *host, const char *path, chirp_dir_t callback, void *arg, time_t stoptime)
Get a simple directory listing.
chirp_reli_fchown
INT64_T chirp_reli_fchown(struct chirp_file *file, INT64_T uid, INT64_T gid, time_t stoptime)
Change the ownership of a file.
chirp_reli_opendir
struct chirp_dir * chirp_reli_opendir(const char *host, const char *path, time_t stoptime)
Open a directory for listing.
chirp_reli_hash
INT64_T chirp_reli_hash(const char *host, const char *path, const char *algorithm, unsigned char digest[CHIRP_DIGEST_MAX], time_t stoptime)
Checksum a remote file.
chirp_reli_ticket_create
INT64_T chirp_reli_ticket_create(const char *host, char name[CHIRP_PATH_MAX], unsigned bits, time_t stoptime)
Create a new blank access control ticket.
chirp_reli_access
INT64_T chirp_reli_access(const char *host, const char *path, INT64_T flags, time_t stoptime)
Check access permissions.
chirp_reli_lstat
INT64_T chirp_reli_lstat(const char *host, const char *path, struct chirp_stat *info, time_t stoptime)
Get file or link status.
chirp_reli_resetacl
INT64_T chirp_reli_resetacl(const char *host, const char *path, const char *rights, time_t stoptime)
Reset an access control list.
chirp_reli_symlink
INT64_T chirp_reli_symlink(const char *host, const char *path, const char *newpath, time_t stoptime)
Create a symbolic link.
chirp_reli_getlongdir
INT64_T chirp_reli_getlongdir(const char *host, const char *path, chirp_longdir_t callback, void *arg, time_t stoptime)
Get a detailed directory listing.
chirp_reli_ticket_register
INT64_T chirp_reli_ticket_register(const char *host, const char *name, const char *subject, time_t duration, time_t stoptime)
Register an access control ticket with a file serer.
chirp_reli_truncate
INT64_T chirp_reli_truncate(const char *host, const char *path, INT64_T length, time_t stoptime)
Truncate a file.
chirp_reli_closedir
void chirp_reli_closedir(struct chirp_dir *dir)
Close a directory.
chirp_reli_readlink
INT64_T chirp_reli_readlink(const char *host, const char *path, char *buf, INT64_T length, time_t stoptime)
Examine a symbolic link.
chirp_reli_locate
INT64_T chirp_reli_locate(const char *host, const char *path, chirp_loc_t callback, void *arg, time_t stoptime)
Identify the true location of a path.
chirp_reli_mkdir
INT64_T chirp_reli_mkdir(const char *host, const char *path, INT64_T mode, time_t stoptime)
Create a new directory.
chirp_reli_bulkio
INT64_T chirp_reli_bulkio(struct chirp_bulkio *list, int count, time_t stoptime)
Perform multiple I/O operations in bulk.
chirp_reli_ftruncate
INT64_T chirp_reli_ftruncate(struct chirp_file *file, INT64_T length, time_t stoptime)
Truncate an open file.
chirp_reli_ticket_get
INT64_T chirp_reli_ticket_get(const char *host, const char *name, char **subject, char **ticket, time_t *duration, char ***rights, time_t stoptime)
Get the details of a registered ticket.
chirp_reli_unlink
INT64_T chirp_reli_unlink(const char *host, const char *path, time_t stoptime)
Delete a file.
chirp_reli_getfile_buffer
INT64_T chirp_reli_getfile_buffer(const char *host, const char *path, char **buffer, time_t stoptime)
Get an entire file efficiently to memory.
chirp_reli_pread_unbuffered
INT64_T chirp_reli_pread_unbuffered(struct chirp_file *file, void *buffer, INT64_T length, INT64_T offset, time_t stoptime)
Read data from a file without buffering.
chirp_reli_statfs
INT64_T chirp_reli_statfs(const char *host, const char *path, struct chirp_statfs *info, time_t stoptime)
Get filesystem status.
chirp_reli_setacl
INT64_T chirp_reli_setacl(const char *host, const char *path, const char *subject, const char *rights, time_t stoptime)
Modify an access control list.
chirp_reli_pwrite
INT64_T chirp_reli_pwrite(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime)
Write data to a file.
chirp_reli_utime
INT64_T chirp_reli_utime(const char *host, const char *path, time_t actime, time_t modtime, time_t stoptime)
Change the modification times of a file.
chirp_reli_chown
INT64_T chirp_reli_chown(const char *host, const char *path, INT64_T uid, INT64_T gid, time_t stoptime)
Change the ownership of a file.
chirp_reli_chmod
INT64_T chirp_reli_chmod(const char *host, const char *path, INT64_T mode, time_t stoptime)
Change mode bits.
chirp_reli_setrep
INT64_T chirp_reli_setrep(const char *host, const char *path, int nreps, time_t stoptime)
Set replication factor.
chirp_reli_getacl
INT64_T chirp_reli_getacl(const char *host, const char *path, chirp_dir_t callback, void *arg, time_t stoptime)
Get an access control list.
chirp_reli_sread
INT64_T chirp_reli_sread(struct chirp_file *file, void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime)
Strided read from a file.
chirp_reli_thirdput
INT64_T chirp_reli_thirdput(const char *host, const char *path, const char *thirdhost, const char *thirdpath, time_t stoptime)
Third party transfer.
chirp_reli_stat
INT64_T chirp_reli_stat(const char *host, const char *path, struct chirp_stat *info, time_t stoptime)
Get file status.
chirp_reli_mkdir_recursive
INT64_T chirp_reli_mkdir_recursive(const char *host, const char *path, INT64_T mode, time_t stoptime)
Create a new directory recursively.
chirp_reli_md5
INT64_T chirp_reli_md5(const char *host, const char *path, unsigned char digest[CHIRP_DIGEST_MAX], time_t stoptime)
Checksum a remote file.
chirp_reli_ticket_list
INT64_T chirp_reli_ticket_list(const char *host, const char *subject, char ***list, time_t stoptime)
List registered tikets on a server.
chirp_reli_fchmod
INT64_T chirp_reli_fchmod(struct chirp_file *file, INT64_T mode, time_t stoptime)
Change the mode bits of a file.
chirp_reli_readdir
struct chirp_dirent * chirp_reli_readdir(struct chirp_dir *dir)
Read one item from a directory.
chirp_reli_pwrite_unbuffered
INT64_T chirp_reli_pwrite_unbuffered(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime)
Write data to a file without buffering.
chirp_reli_lchown
INT64_T chirp_reli_lchown(const char *host, const char *path, INT64_T uid, INT64_T gid, time_t stoptime)
Change the ownership of a file or link.
chirp_reli_close
INT64_T chirp_reli_close(struct chirp_file *file, time_t stoptime)
Closes an open file.
chirp_reli_blocksize_set
void chirp_reli_blocksize_set(INT64_T bs)
Set the buffer block size.
chirp_reli_cleanup_before_fork
void chirp_reli_cleanup_before_fork()
Prepare to fork in a parallel program.
chirp_reli_fstatfs
INT64_T chirp_reli_fstatfs(struct chirp_file *file, struct chirp_statfs *info, time_t stoptime)
Get file system status.
chirp_reli_rmall
INT64_T chirp_reli_rmall(const char *host, const char *path, time_t stoptime)
Delete a directory recursively.
chirp_reli_getfile
INT64_T chirp_reli_getfile(const char *host, const char *path, FILE *stream, time_t stoptime)
Get an entire file efficiently.
chirp_reli_link
INT64_T chirp_reli_link(const char *host, const char *path, const char *newpath, time_t stoptime)
Create a hard link.
chirp_reli_ticket_modify
INT64_T chirp_reli_ticket_modify(const char *host, const char *name, const char *path, const char *aclmask, time_t stoptime)
Modify an access control ticket to grant futher access.
chirp_reli_localpath
INT64_T chirp_reli_localpath(const char *host, const char *path, char *localpath, int length, time_t stoptime)
Return the local path of a file.
chirp_reli_whoareyou
INT64_T chirp_reli_whoareyou(const char *host, const char *rhost, char *subject, INT64_T length, time_t stoptime)
Return the server's identity against another server.
chirp_reli_mkalloc
INT64_T chirp_reli_mkalloc(const char *host, const char *path, INT64_T size, INT64_T mode, time_t stoptime)
Create a space allocation.
chirp_reli_blocksize_get
INT64_T chirp_reli_blocksize_get()
Return the current buffer block size.
chirp_reli_whoami
INT64_T chirp_reli_whoami(const char *host, char *subject, INT64_T length, time_t stoptime)
Return the caller's identity.
chirp_reli_audit
INT64_T chirp_reli_audit(const char *host, const char *path, struct chirp_audit **list, time_t stoptime)
Measure remote space consumption.
chirp_reli_pread
INT64_T chirp_reli_pread(struct chirp_file *file, void *buffer, INT64_T length, INT64_T offset, time_t stoptime)
Read data from a file.
chirp_reli_disconnect
void chirp_reli_disconnect(const char *host)
Closes the link to the host, if active.
chirp_reli_remote_debug
INT64_T chirp_reli_remote_debug(const char *host, const char *flag, time_t stoptime)
Set the debug options on the remote server.
chirp_reli_lsalloc
INT64_T chirp_reli_lsalloc(const char *host, const char *path, char *allocpath, INT64_T *total, INT64_T *inuse, time_t stoptime)
List a space allocation.
chirp_reli_flush
INT64_T chirp_reli_flush(struct chirp_file *file, time_t stoptime)
Flush any pending changes to a file.
chirp_reli_swrite
INT64_T chirp_reli_swrite(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime)
Strided write to a file.
chirp_reli_fstat
INT64_T chirp_reli_fstat(struct chirp_file *file, struct chirp_stat *info, time_t stoptime)
Get file status.
chirp_reli_opensearch
CHIRP_SEARCH * chirp_reli_opensearch(const char *host, const char *paths, const char *pattern, int flags, time_t stoptime)
Open a file search stream Performs a search operation on the Chirp server and stores its results to b...
chirp_reli_rmdir
INT64_T chirp_reli_rmdir(const char *host, const char *path, time_t stoptime)
Delete a directory if it is empty.
chirp_reli_putfile_buffer
INT64_T chirp_reli_putfile_buffer(const char *host, const char *path, const void *buffer, INT64_T mode, size_t length, time_t stoptime)
Put an entire file efficiently from memory.
chirp_types.h
All of the structure and type definitions used by the Chirp API.
chirp_dir_t
void(* chirp_dir_t)(const char *path, void *arg)
A callback function typedef used to display a directory or access control list.
Definition chirp_types.h:190
chirp_loc_t
void(* chirp_loc_t)(const char *location, void *arg)
A callback function typedef used to display a file's location(s).
Definition chirp_types.h:211
chirp_longdir_t
void(* chirp_longdir_t)(const char *path, struct chirp_stat *info, void *arg)
A callback function typedef used to display a detailed directory.
Definition chirp_types.h:201
CHIRP_DIGEST_MAX
#define CHIRP_DIGEST_MAX
Maximum digest size for a supported hash function.
Definition chirp_types.h:222
chirp_jobid_t
int64_t chirp_jobid_t
The type of Chirp job identifiers.
Definition chirp_types.h:216
buffer
Definition buffer.h:26
chirp_audit
Descibes the space consumed by a single user on a Chirp server.
Definition chirp_types.h:175
chirp_bulkio
Describes a bulk I/O operation.
Definition chirp_types.h:158
chirp_dirent
Describes a directory entry returned by chirp_reli_readdir.
Definition chirp_types.h:95
chirp_dirent::name
char * name
The name of the directory entry.
Definition chirp_types.h:96
chirp_dirent::info
struct chirp_stat info
The properties of the directory entry.
Definition chirp_types.h:98
chirp_stat
Describes the properties of a file, much like the Unix stat structure.
Definition chirp_types.h:34
chirp_statfs
Describes the properties of a file system, much like the Unix statfs structure.
Definition chirp_types.h:72