cctools
chirp_client.h
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2022 The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See the file COPYING for details.
6 */
7 
8 #ifndef CHIRP_CLIENT_H
9 #define CHIRP_CLIENT_H
10 
11 #include "int_sizes.h"
12 
13 #include "chirp_protocol.h"
14 #include "chirp_types.h"
15 
16 #include <fcntl.h>
17 #include <unistd.h>
18 #include <stdio.h>
19 #include <time.h>
20 
21 /* Authentication Environment Variable */
22 #define CHIRP_CLIENT_TICKETS "CHIRP_CLIENT_TICKETS"
23 
24 struct chirp_client *chirp_client_connect(const char *host, int negotiate_auth, time_t stoptime);
25 struct chirp_client *chirp_client_connect_condor(time_t stoptime);
26 
27 void chirp_client_disconnect(struct chirp_client *c);
28 INT64_T chirp_client_serial(struct chirp_client *c);
29 
30 INT64_T chirp_client_open(struct chirp_client *c, const char *path, INT64_T flags, INT64_T mode, struct chirp_stat *buf, time_t stoptime);
31 INT64_T chirp_client_close(struct chirp_client *c, INT64_T fd, time_t stoptime);
32 INT64_T chirp_client_pread(struct chirp_client *c, INT64_T fd, void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
33 INT64_T chirp_client_pwrite(struct chirp_client *c, INT64_T fd, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
34 INT64_T chirp_client_sread(struct chirp_client *c, INT64_T fd, void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
35 INT64_T chirp_client_swrite(struct chirp_client *c, INT64_T fd, const void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
36 INT64_T chirp_client_fsync(struct chirp_client *c, INT64_T fd, time_t stoptime);
37 INT64_T chirp_client_fstat(struct chirp_client *c, INT64_T fd, struct chirp_stat *buf, time_t stoptime);
38 INT64_T chirp_client_fstatfs(struct chirp_client *c, INT64_T fd, struct chirp_statfs *buf, time_t stoptime);
39 INT64_T chirp_client_fchown(struct chirp_client *c, INT64_T fd, INT64_T uid, INT64_T gid, time_t stoptime);
40 INT64_T chirp_client_fchmod(struct chirp_client *c, INT64_T fd, INT64_T mode, time_t stoptime);
41 INT64_T chirp_client_ftruncate(struct chirp_client *c, INT64_T fd, INT64_T length, time_t stoptime);
42 
43 INT64_T chirp_client_getfile(struct chirp_client *c, const char *name, FILE * stream, time_t stoptime);
44 INT64_T chirp_client_getfile_buffer(struct chirp_client *c, const char *name, char **buffer, time_t stoptime);
45 INT64_T chirp_client_putfile(struct chirp_client *c, const char *name, FILE * stream, INT64_T mode, INT64_T length, time_t stoptime);
46 INT64_T chirp_client_putfile_buffer(struct chirp_client *c, const char *name, const void *buffer, INT64_T mode, size_t length, time_t stoptime);
47 INT64_T chirp_client_thirdput(struct chirp_client *c, const char *path, const char *hostname, const char *newpath, time_t stoptime);
48 
49 INT64_T chirp_client_getstream(struct chirp_client *c, const char *path, time_t stoptime);
50 INT64_T chirp_client_getstream_read(struct chirp_client *c, void *buffer, INT64_T length, time_t stoptime);
51 
52 INT64_T chirp_client_putstream(struct chirp_client *c, const char *path, time_t stoptime);
53 INT64_T chirp_client_putstream_write(struct chirp_client *c, const char *data, INT64_T length, time_t stoptime);
54 
55 INT64_T chirp_client_cookie(struct chirp_client *c, const char *cookie, time_t stoptime);
56 
57 CHIRP_SEARCH *chirp_client_opensearch(struct chirp_client *c, const char *paths, const char *pattern, int flags, time_t stoptime);
58 struct chirp_searchent *chirp_client_readsearch(CHIRP_SEARCH *search);
59 int chirp_client_closesearch(CHIRP_SEARCH *search);
60 
61 INT64_T chirp_client_getlongdir(struct chirp_client *c, const char *path, chirp_longdir_t callback, void *arg, time_t stoptime);
62 INT64_T chirp_client_getdir(struct chirp_client *c, const char *path, chirp_dir_t callback, void *arg, time_t stoptime);
63 INT64_T chirp_client_opendir(struct chirp_client *c, const char *path, time_t stoptime);
64 const char *chirp_client_readdir(struct chirp_client *c, time_t stoptime);
65 INT64_T chirp_client_getacl(struct chirp_client *c, const char *path, chirp_dir_t callback, void *arg, time_t stoptime);
66 INT64_T chirp_client_openacl(struct chirp_client *c, const char *path, time_t stoptime);
67 const char *chirp_client_readacl(struct chirp_client *c, time_t stoptime);
68 INT64_T chirp_client_ticket_create(struct chirp_client *c, char name[CHIRP_PATH_MAX], unsigned bits, time_t stoptime);
69 INT64_T chirp_client_ticket_register(struct chirp_client *c, const char *name, const char *subject, time_t duration, time_t stoptime);
70 INT64_T chirp_client_ticket_delete(struct chirp_client *c, const char *name, time_t stoptime);
71 INT64_T chirp_client_ticket_list(struct chirp_client *c, const char *subject, char ***list, time_t stoptime);
72 INT64_T chirp_client_ticket_get(struct chirp_client *c, const char *name, char **subject, char **ticket, time_t * duration, char ***rights, time_t stoptime);
73 INT64_T chirp_client_ticket_modify(struct chirp_client *c, const char *name, const char *path, const char *aclmask, time_t stoptime);
74 INT64_T chirp_client_setacl(struct chirp_client *c, const char *path, const char *user, const char *acl, time_t stoptime);
75 INT64_T chirp_client_resetacl(struct chirp_client *c, const char *path, const char *acl, time_t stoptime);
76 INT64_T chirp_client_locate(struct chirp_client *c, const char *path, chirp_loc_t callback, void *arg, time_t stoptime);
77 INT64_T chirp_client_whoami(struct chirp_client *c, char *buf, INT64_T length, time_t stoptime);
78 INT64_T chirp_client_whoareyou(struct chirp_client *c, const char *rhost, char *buffer, INT64_T length, time_t stoptime);
79 INT64_T chirp_client_unlink(struct chirp_client *c, const char *path, time_t stoptime);
80 INT64_T chirp_client_rename(struct chirp_client *c, const char *path, const char *newpath, time_t stoptime);
81 INT64_T chirp_client_link(struct chirp_client *c, const char *path, const char *newpath, time_t stoptime);
82 INT64_T chirp_client_symlink(struct chirp_client *c, const char *path, const char *newpath, time_t stoptime);
83 INT64_T chirp_client_readlink(struct chirp_client *c, const char *path, char *buf, INT64_T length, time_t stoptime);
84 INT64_T chirp_client_mkdir(struct chirp_client *c, char const *path, INT64_T mode, time_t stoptime);
85 INT64_T chirp_client_rmdir(struct chirp_client *c, char const *path, time_t stoptime);
86 INT64_T chirp_client_rmall(struct chirp_client *c, char const *path, time_t stoptime);
87 INT64_T chirp_client_stat(struct chirp_client *c, const char *path, struct chirp_stat *buf, time_t stoptime);
88 INT64_T chirp_client_lstat(struct chirp_client *c, const char *path, struct chirp_stat *buf, time_t stoptime);
89 INT64_T chirp_client_statfs(struct chirp_client *c, const char *path, struct chirp_statfs *buf, time_t stoptime);
90 INT64_T chirp_client_access(struct chirp_client *c, const char *path, INT64_T mode, time_t stoptime);
91 INT64_T chirp_client_chmod(struct chirp_client *c, const char *path, INT64_T mode, time_t stoptime);
92 INT64_T chirp_client_chown(struct chirp_client *c, const char *path, INT64_T uid, INT64_T gid, time_t stoptime);
93 INT64_T chirp_client_lchown(struct chirp_client *c, const char *path, INT64_T uid, INT64_T gid, time_t stoptime);
94 INT64_T chirp_client_truncate(struct chirp_client *c, const char *path, INT64_T length, time_t stoptime);
95 INT64_T chirp_client_utime(struct chirp_client *c, const char *path, time_t actime, time_t modtime, time_t stoptime);
96 INT64_T chirp_client_hash(struct chirp_client *c, const char *path, const char *algorithm, unsigned char digest[CHIRP_DIGEST_MAX], time_t stoptime);
97 INT64_T chirp_client_md5(struct chirp_client *c, const char *path, unsigned char digest[CHIRP_DIGEST_MAX], time_t stoptime);
98 INT64_T chirp_client_setrep(struct chirp_client *c, const char *path, int nreps, time_t stoptime);
99 
100 INT64_T chirp_client_getxattr(struct chirp_client *c, const char *path, const char *name, void *data, size_t size, time_t stoptime);
101 INT64_T chirp_client_fgetxattr(struct chirp_client *c, INT64_T fd, const char *name, void *data, size_t size, time_t stoptime);
102 INT64_T chirp_client_lgetxattr(struct chirp_client *c, const char *path, const char *name, void *data, size_t size, time_t stoptime);
103 INT64_T chirp_client_listxattr(struct chirp_client *c, const char *path, char *list, size_t size, time_t stoptime);
104 INT64_T chirp_client_flistxattr(struct chirp_client *c, INT64_T fd, char *list, size_t size, time_t stoptime);
105 INT64_T chirp_client_llistxattr(struct chirp_client *c, const char *path, char *list, size_t size, time_t stoptime);
106 INT64_T chirp_client_setxattr(struct chirp_client *c, const char *path, const char *name, const void *data, size_t size, int flags, time_t stoptime);
107 INT64_T chirp_client_fsetxattr(struct chirp_client *c, INT64_T fd, const char *name, const void *data, size_t size, int flags, time_t stoptime);
108 INT64_T chirp_client_lsetxattr(struct chirp_client *c, const char *path, const char *name, const void *data, size_t size, int flags, time_t stoptime);
109 INT64_T chirp_client_removexattr(struct chirp_client *c, const char *path, const char *name, time_t stoptime);
110 INT64_T chirp_client_fremovexattr(struct chirp_client *c, INT64_T fd, const char *name, time_t stoptime);
111 INT64_T chirp_client_lremovexattr(struct chirp_client *c, const char *path, const char *name, time_t stoptime);
112 
113 INT64_T chirp_client_remote_debug(struct chirp_client *c, const char *flag, time_t stoptime);
114 INT64_T chirp_client_localpath(struct chirp_client *c, const char *path, char *localpath, int length, time_t stoptime);
115 INT64_T chirp_client_audit(struct chirp_client *c, const char *path, struct chirp_audit **list, time_t stoptime);
116 
117 INT64_T chirp_client_mkalloc(struct chirp_client *c, char const *path, INT64_T size, INT64_T mode, time_t stoptime);
118 INT64_T chirp_client_lsalloc(struct chirp_client *c, char const *path, char *allocpath, INT64_T * total, INT64_T * inuse, time_t stoptime);
119 
120 INT64_T chirp_client_pread_begin(struct chirp_client *c, INT64_T fd, void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
121 INT64_T chirp_client_pread_finish(struct chirp_client *c, INT64_T fd, void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
122 INT64_T chirp_client_sread_begin(struct chirp_client *c, INT64_T fd, void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
123 INT64_T chirp_client_sread_finish(struct chirp_client *c, INT64_T fd, void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
124 INT64_T chirp_client_pwrite_begin(struct chirp_client *c, INT64_T fd, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
125 INT64_T chirp_client_pwrite_finish(struct chirp_client *c, INT64_T fd, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
126 INT64_T chirp_client_swrite_begin(struct chirp_client *c, INT64_T fd, const void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
127 INT64_T chirp_client_swrite_finish(struct chirp_client *c, INT64_T fd, const void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
128 INT64_T chirp_client_fsync_begin(struct chirp_client *c, INT64_T fd, time_t stoptime);
129 INT64_T chirp_client_fsync_finish(struct chirp_client *c, INT64_T fd, time_t stoptime);
130 INT64_T chirp_client_fstat_begin(struct chirp_client *c, INT64_T fd, struct chirp_stat *buf, time_t stoptime);
131 INT64_T chirp_client_fstat_finish(struct chirp_client *c, INT64_T fd, struct chirp_stat *buf, time_t stoptime);
132 
133 INT64_T chirp_client_job_create(struct chirp_client *c, const char *json, chirp_jobid_t *id, time_t stoptime);
134 INT64_T chirp_client_job_commit(struct chirp_client *c, const char *json, time_t stoptime);
135 INT64_T chirp_client_job_kill(struct chirp_client *c, const char *json, time_t stoptime);
136 INT64_T chirp_client_job_status(struct chirp_client *c, const char *json, char **status, time_t stoptime);
137 INT64_T chirp_client_job_wait(struct chirp_client *c, chirp_jobid_t id, INT64_T timeout, char **status, time_t stoptime);
138 INT64_T chirp_client_job_reap(struct chirp_client *c, const char *json, time_t stoptime);
139 
140 #endif
141 
142 /* vim: set noexpandtab tabstop=8: */
chirp_searchent::path
char path[CHIRP_PATH_MAX]
Path of the matching file.
Definition: chirp_types.h:105
CHIRP_DIGEST_MAX
#define CHIRP_DIGEST_MAX
Maximum digest size for a supported hash function.
Definition: chirp_types.h:222
chirp_searchent
Describes a result from a search operation.
Definition: chirp_types.h:104
chirp_statfs
Describes the properties of a file system, much like the Unix statfs structure.
Definition: chirp_types.h:72
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_protocol.h
chirp_audit
Descibes the space consumed by a single user on a Chirp server.
Definition: chirp_types.h:175
buffer
Definition: buffer.h:26
chirp_jobid_t
int64_t chirp_jobid_t
The type of Chirp job identifiers.
Definition: chirp_types.h:216
chirp_types.h
CHIRP_PATH_MAX
#define CHIRP_PATH_MAX
The maximum length of a full path in any Chirp operation.
Definition: chirp_protocol.h:20
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_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_stat
Describes the properties of a file, much like the Unix stat structure.
Definition: chirp_types.h:34