FaspManagerTypes.h
Go to the documentation of this file.
1 
7 #ifndef __FASP_MANAGER_TYPES_H__
8 #define __FASP_MANAGER_TYPES_H__
9 
10 #include "FaspManagerCommon.h"
11 #include <list>
12 
13 #ifndef _AS_PLATFORM_H_
14 #ifdef WIN32
15 #ifdef VSTUDIO
16  typedef char int8_t;
17  typedef short int16_t;
18  typedef long int32_t;
19  typedef __int64 int64_t;
20  typedef unsigned char u_int8_t;
21  typedef unsigned short u_int16_t;
22  typedef unsigned long u_int32_t;
23  typedef unsigned __int64 u_int64_t;
24 #else
25  typedef unsigned char u_int8_t;
26  typedef unsigned short u_int16_t;
27  typedef unsigned long u_int32_t;
28  typedef unsigned long long u_int64_t;
29 #endif
30 #endif
31 
32 #ifdef WIN32
33 #define strtoll(str, end, base) _strtoi64(str, end, base)
34 #define strtoull(str, end, base) _strtoui64(str, end, base)
35 #endif
36 
37 #ifdef WIN32
38 # define LLD "%I64d"
39 # define LLU "%I64u"
40 # define LLX "%I64x"
41 # define NLLD(n) "%" #n "I64d"
42 # define NLLU(n) "%" #n "I64u"
43 #else
44 # if __WORDSIZE == 64
45 # define LLD "%ld"
46 # define LLU "%lu"
47 # define LLX "%lx"
48 # define NLLD(n) "%" #n "ld"
49 # define NLLU(n) "%" #n "lu"
50 # else
51 # define LLD "%lld"
52 # define LLU "%llu"
53 # define LLX "%llx"
54 # define NLLD(n) "%" #n "lld"
55 # define NLLU(n) "%" #n "llu"
56 # endif
57 #endif
58 #endif
59 
60 namespace Aspera
61 {
62 namespace FaspManager
63 {
64 /* Forward declaration */
65 class Job;
66 class Location;
67 class Functor;
68 class Queue;
69 struct XferParams;
70 struct FileStats;
71 
73 typedef enum job_state_e
74 {
75  J_STATE_IDLE = 0x00,
76  J_STATE_CONNECTING = 0x01,
77  J_STATE_AUTHENTICATING = 0x02,
78  J_STATE_STARTING = 0x03,
79  J_STATE_TRANSFERRING = 0x04,
80  J_STATE_FAILED = 0x05,
81  J_STATE_FINISHED = 0x06,
82 
83  J_STATE_MAX
84 } job_state_e;
85 
87 typedef enum file_state_e
88 {
89  F_STATE_IDLE = 0x00,
90  F_STATE_TRANSFERRING = 0x01,
91  F_STATE_FAILED = 0x02,
92  F_STATE_FINISHED = 0x03,
93  F_STATE_SKIPPED = 0x04,
94 
95  F_STATE_MAX
96 } file_state_e;
97 
100 typedef enum content_protect_e
101 {
108 
110 
112 typedef enum encryption_type_e
113 {
114  ENCRYPT_NONE = 0x00,
115  ENCRYPT_AES128 = 0x01
116 
118 
120 typedef enum resume_type_e
121 {
123  RESUME_NONE = 0x00,
130 
131 } resume_type_e;
132 
135 typedef enum policy_e
136 {
138  POLICY_FIXED = 0x00,
141  POLICY_HIGH = 0x01,
143  POLICY_FAIR = 0x02,
145  POLICY_LOW = 0x03
146 
147 } policy_e;
148 
150 typedef enum fasp_version_e
151 {
156 
158 
160 typedef enum xfer_direction_e
161 {
166 
168 
170 typedef enum symlink_policy_e
171 {
181 
183 typedef enum manifest_e
184 {
186  TEXT = 1,
188  NONE = 2
189 } manifest_e;
190 
192 typedef enum overwrite_e
193 {
195  NEVER = 1,
197  ALWAYS = 2,
199  DIFF = 3,
201  OLDER = 4,
204 } overwrite_e;
205 
207 typedef enum callback_event_e
208 {
209 /* File Transfer Events */
210  F_EVENT_BANDWIDTH_MEASUREMENT = 0x00,
211  F_EVENT_CONNECTING = 0x01,
212  F_EVENT_FILE_ERROR = 0x02,
213  F_EVENT_FILE_START = 0x03,
214  F_EVENT_FILE_STOP = 0x04,
215  F_EVENT_PROGRESS = 0x05,
216  F_EVENT_RATE_MODIFICATION = 0x06,
217  F_EVENT_SESSION_ERROR = 0x07,
218  F_EVENT_SESSION_START = 0x08,
219  F_EVENT_SESSION_STOP = 0x09,
220  F_EVENT_FILE_SKIP = 0x0a,
221 
222  FS_EVENT_MAX
223 
225 
227 struct JobOrder
228 {
235 };
236 
238 typedef struct XferParams
239 {
241  char const * config;
243  unsigned short tcp_port;
245  unsigned short udp_port;
247  u_int64_t target_rate;
249  u_int64_t min_rate;
265  char const * token;
267  char const * cookie;
275  char const * license;
277  char const * fasp_log_path;
279  char const * fasp_remote_log_path;
281  unsigned long dgram_size;
283  unsigned long rexmsg_size;
285  unsigned long write_blk_size;
287  unsigned long read_blk_size;
291  bool persist;
309  unsigned long retry_timeout_s;
311  std::list<char const *> exclude_patterns;
315  char const * source_prefix;
317  char const * source_base;
319  char const * destination_root;
320 
322  char const *local_user;
323 
326 
327  // tags64 will be used if both are defined
328  const char * tags;
329  const char * tags64;
330 
331  // By default, ascp does not report a notification when a file is skipped.
332  // Set to true to get a SKIP message
333  bool report_skipped_files;
334 
335  // Default is empty, format must be: dnat(s)://[user[:password]@]host[:post]
336  char const * proxy;
337 
339  XferParams();
340 
342  XferParams(const XferParams &xp);
343 
344 } XferParams;
345 
348 {
350  u_int64_t target_rate;
352  u_int64_t min_rate;
355 };
356 
358 struct JobStats
359 {
361  char* job_id;
369  unsigned short udp_port;
371  u_int64_t target_rate;
373  u_int64_t min_rate;
375  char* encryption;
377  char* policy;
383  u_int64_t files_complete;
385  u_int64_t files_failed;
387  unsigned long err_code;
393  char* cookie;
397  char* host;
399  u_int64_t start_time_ms;
401  char* token;
407  u_int64_t total_lost_bytes;
411  char* user;
413  bool remote;
417  u_int32_t delay;
418 
421 
425  u_int64_t transfers_failed;
427  u_int64_t transfers_passed;
429  u_int64_t transfers_skipped;
433  u_int64_t pathscans_failed;
440  char * meta_tags;
441 };
442 
444 struct FileStats
445 {
447  char* filename;
451  u_int64_t file_size;
453  u_int64_t bytes_written;
455  u_int64_t bytes_cont;
457  u_int64_t start_byte;
459  u_int64_t end_byte;
461  u_int64_t rate_cap;
463  unsigned long err_code;
466 };
467 
468 } /* namespace FaspManager */
469 } /* namespace Aspera */
470 
471 #endif /* __FASP_MANAGER_TYPES_H__ */
content_protect_e
Definition: FaspManagerTypes.h:100
bool create_dirs
Create target path directories if they don't exist. Default: false.
Definition: FaspManagerTypes.h:261
symlink_policy_e
An enumeration for symlink policy.
Definition: FaspManagerTypes.h:170
char * encryption
The encryption algorithm.
Definition: FaspManagerTypes.h:375
manifest_e file_manifest
Generate a manifest file to log the transfer. Default: None.
Definition: FaspManagerTypes.h:305
u_int64_t file_size
Current file size.
Definition: FaspManagerTypes.h:451
char * cookie
Cookie set the user application.
Definition: FaspManagerTypes.h:393
A structure of FASP Job individual file level statistics.
Definition: FaspManagerTypes.h:444
job_state_e
An enumeration of FASP Job states.
Definition: FaspManagerTypes.h:73
A structure of update parameters.
Definition: FaspManagerTypes.h:347
A structure of FASP Job job level statistics.
Definition: FaspManagerTypes.h:358
fasp_version_e fasp_version
FASP Protocol Version. Defaults to FASP2, if not set.
Definition: FaspManagerTypes.h:255
u_int64_t total_elapsed_msec
The current total elapsed transfer time (in milliseconds)
Definition: FaspManagerTypes.h:379
char const * local_user
Username used at local.
Definition: FaspManagerTypes.h:322
bool preserve_group_id
Preserve file owner group id (gid). No effect on Windows. Default: false.
Definition: FaspManagerTypes.h:295
xfer_direction_e
An enumeration of fasp version.
Definition: FaspManagerTypes.h:160
manifest_e
An enumeration for manifest.
Definition: FaspManagerTypes.h:183
Overwrite when different.
Definition: FaspManagerTypes.h:199
u_int64_t min_rate
The min transfer rate.
Definition: FaspManagerTypes.h:352
std::list< char const * > exclude_patterns
List of patterns (maximum 16) used to exclude files from transferring. Two special symbols are accept...
Definition: FaspManagerTypes.h:311
u_int64_t start_time_ms
Time at which the job started in milliseconds.
Definition: FaspManagerTypes.h:399
job_state_e job_state
The current job state.
Definition: FaspManagerTypes.h:363
Do not resume.
Definition: FaspManagerTypes.h:123
u_int64_t pathscans_irregular
The number of source path scans pointing to irregular files (char/block devices)
Definition: FaspManagerTypes.h:435
u_int64_t files_complete
Number of files completed so far.
Definition: FaspManagerTypes.h:383
XferParams * xfer_params
The transfer parameters.
Definition: FaspManagerTypes.h:234
Location * src_location
The source location.
Definition: FaspManagerTypes.h:230
u_int32_t delay
Delay, the last measured roundtrip time in milliseconds.
Definition: FaspManagerTypes.h:417
policy_e policy
The transfer rate policy. Default: POLICY_FAIR.
Definition: FaspManagerTypes.h:259
u_int64_t min_rate
The min transfer rate. Default: 0.
Definition: FaspManagerTypes.h:249
bool skip_special_files
Skipe special files. Default: false.
Definition: FaspManagerTypes.h:297
bool remove_after_transfer
Remove source files after transferring. Default: false.
Definition: FaspManagerTypes.h:301
unsigned long rexmsg_size
Retransmission request size. Capped at 1440 bytes. Default: 0 (ascp determined)
Definition: FaspManagerTypes.h:283
Resume if the file attributes match.
Definition: FaspManagerTypes.h:125
char * err_description
The current error description.
Definition: FaspManagerTypes.h:389
u_int64_t rate_cap
The fasp session negotiated rate cap.
Definition: FaspManagerTypes.h:461
Definition: FaspManagerTypes.h:141
u_int64_t precalc_total_bytes
Pre-calculated total no of bytes for this job.
Definition: FaspManagerTypes.h:403
u_int64_t pathscans_attempted
The number of source path scans attempted.
Definition: FaspManagerTypes.h:431
file_state_e file_state
State of of the current file.
Definition: FaspManagerTypes.h:449
Leave the content encrypted at the destination.
Definition: FaspManagerTypes.h:105
unsigned long err_code
The current error code, if any.
Definition: FaspManagerTypes.h:463
char * user
username used at the remote endpoint
Definition: FaspManagerTypes.h:411
u_int64_t transfers_attempted
The number of file transfers attempted.
Definition: FaspManagerTypes.h:423
encryption_type_e
An enumeration of encryption options.
Definition: FaspManagerTypes.h:112
u_int64_t target_rate
The current target transfer rate.
Definition: FaspManagerTypes.h:371
FASP Protocol Version 2.
Definition: FaspManagerTypes.h:155
char const * config
Configuration-file name.
Definition: FaspManagerTypes.h:241
u_int64_t measured_link_rate_kbps
Measured bandwidth in kbps.
Definition: FaspManagerTypes.h:391
A structure of transfer parameters.
Definition: FaspManagerTypes.h:238
fasp_version_e
An enumeration of fasp version.
Definition: FaspManagerTypes.h:150
fasp_version_e fasp_version
FASP version.
Definition: FaspManagerTypes.h:395
Generate Nonthing.
Definition: FaspManagerTypes.h:188
unsigned short udp_port
The UDP (FASP) port pertaining to the transfer. Default: 33001.
Definition: FaspManagerTypes.h:245
unsigned long write_blk_size
Write block size in bytes. Default: 0 (ascp determined)
Definition: FaspManagerTypes.h:285
char const * destination_root
The destination root for the transfer. Default: 0 (ascp determined)
Definition: FaspManagerTypes.h:319
FASP Protocol Version 1.
Definition: FaspManagerTypes.h:153
u_int64_t target_rate
The target transfer rate.
Definition: FaspManagerTypes.h:350
resume_type_e
An enumeration of modes of resuming a broken transfer.
Definition: FaspManagerTypes.h:120
char const * source_prefix
Prepend to each source path.
Definition: FaspManagerTypes.h:315
unsigned long retry_timeout_s
Remove source files after transferring. Default: 0 - no retry.
Definition: FaspManagerTypes.h:309
bool remote
indicates if this job has been remotely initiated
Definition: FaspManagerTypes.h:413
u_int64_t min_rate
The current min transfer rate.
Definition: FaspManagerTypes.h:373
unsigned short udp_port
The effective UDP (FASP) port.
Definition: FaspManagerTypes.h:369
u_int64_t target_rate
The target transfer rate. Default: 10000.
Definition: FaspManagerTypes.h:247
u_int64_t end_byte
Offset in the file where the transfer is to end. Non zero only if a range of bytes is requested...
Definition: FaspManagerTypes.h:459
A structure of the components that define a FASP Job transfer.
Definition: FaspManagerTypes.h:227
FASP Protocol Version 2.
Definition: FaspManagerTypes.h:165
char * manifestfile_path
The path to manifest file, if it is generated.
Definition: FaspManagerTypes.h:439
char const * license
License key to be used for this transfer (Do NOT include the hyphens). Default: "".
Definition: FaspManagerTypes.h:275
u_int64_t total_transferred_bytes
Total no of bytes transferred.
Definition: FaspManagerTypes.h:409
u_int64_t transfers_failed
The number of file transfers that failed.
Definition: FaspManagerTypes.h:425
Try to match the target rate, while being fair to other traffic.
Definition: FaspManagerTypes.h:143
xfer_direction_e direction
indicates if this is an upload or download
Definition: FaspManagerTypes.h:415
bool initiatedByOther
indicates if this transfer initiated by a process other than FaspManager
Definition: FaspManagerTypes.h:420
char const * source_base
Specify the prefix to be stripped off from each source object. The remaining portion of the source pa...
Definition: FaspManagerTypes.h:317
bool pre_calculate_job_size
Pre-calculate full job size. Default: false.
Definition: FaspManagerTypes.h:273
Never Overwrite.
Definition: FaspManagerTypes.h:195
unsigned long err_code
The current error code (if applicable)
Definition: FaspManagerTypes.h:387
Follow symlinks.
Definition: FaspManagerTypes.h:173
A class representing a transfer end point.
Definition: FaspManagerLocation.h:21
callback_event_e
An enumeration of FASP Manager callback events.
Definition: FaspManagerTypes.h:207
unsigned short tcp_port
The TCP (SSH) port pertaining to the transfer. Default: 22.
Definition: FaspManagerTypes.h:243
resume_type_e resume_check
Incomplete transfer resume policy. Default: RESUME_SPARSE_CHKSUM.
Definition: FaspManagerTypes.h:263
char * job_id
The job id.
Definition: FaspManagerTypes.h:361
Generate Text.
Definition: FaspManagerTypes.h:186
C++ namespace for Aspera, Inc.
Definition: Environment.h:10
file_state_e
An enumeration of FASP Job file states.
Definition: FaspManagerTypes.h:87
bool persist
Make a transfer job persistent. Such a job stays active and accepts more transfer sources using AddSo...
Definition: FaspManagerTypes.h:291
symlink_policy_e symlink_policy
How symbolic links are treated. No effect on Windows. Default: SYMLINK_P_FOLLOW.
Definition: FaspManagerTypes.h:313
u_int64_t bytes_written
The number of bytes written to this file.
Definition: FaspManagerTypes.h:453
Decrypt when transferring from an encrypted source.
Definition: FaspManagerTypes.h:107
u_int64_t files_failed
Number of files that failed so far.
Definition: FaspManagerTypes.h:385
u_int64_t bytes_cont
Number of contiguous bytes present at the destination.
Definition: FaspManagerTypes.h:455
u_int64_t start_byte
Starting offset in the file. Non zero only if the transfer is a resume or if a range of bytes is requ...
Definition: FaspManagerTypes.h:457
Take lower priority than all other network traffic.
Definition: FaspManagerTypes.h:145
unsigned long read_blk_size
Read block size in bytes. Default: 0 (ascp determined)
Definition: FaspManagerTypes.h:287
u_int64_t transfers_skipped
The number of file transfers skipped (i.e. file already at the destination, overwrite policy violatio...
Definition: FaspManagerTypes.h:429
Overwrite when different and older.
Definition: FaspManagerTypes.h:203
u_int64_t transfers_passed
The number of file transfers that passed.
Definition: FaspManagerTypes.h:427
Resume only if the full checksum matches. (Could introduce delay with large files) ...
Definition: FaspManagerTypes.h:129
u_int64_t pathscans_excluded
The number of source path scans excluded due to matching exclude arguments.
Definition: FaspManagerTypes.h:437
char * token
Security token set by user application.
Definition: FaspManagerTypes.h:401
bool auto_bwidth_discovery
Definition: FaspManagerTypes.h:253
char * err_description
The current error description, if any.
Definition: FaspManagerTypes.h:465
char * src_loc_path
The source location path.
Definition: FaspManagerTypes.h:365
char * policy
The current bandwidth sharing policy.
Definition: FaspManagerTypes.h:377
char const * fasp_remote_log_path
Path to the location of FASP transfer logs on the remote machine. Default: "".
Definition: FaspManagerTypes.h:279
Overwrite when older.
Definition: FaspManagerTypes.h:201
bool preserve_user_id
Preserve file owner user id (uid). No effect on Windows. Default: false.
Definition: FaspManagerTypes.h:293
char * filename
Name of the current file.
Definition: FaspManagerTypes.h:447
unsigned long dgram_size
Datagram size for FASP. Default: 0 (ascp determined)
Definition: FaspManagerTypes.h:281
Let the actual transfer rate match the target rate.
Definition: FaspManagerTypes.h:138
overwrite_e
An enumeration for overwrite.
Definition: FaspManagerTypes.h:192
char * host
Hostname of the remote end point.
Definition: FaspManagerTypes.h:397
u_int64_t total_lost_bytes
Total no of bytes lost during this job.
Definition: FaspManagerTypes.h:407
u_int64_t precalc_total_files
Pre-calculated total no of files for this job.
Definition: FaspManagerTypes.h:405
bool apply_local_docroot
Apply local docroot.
Definition: FaspManagerTypes.h:325
char const * fasp_log_path
Path to the location of FASP transfer logs. Default: "".
Definition: FaspManagerTypes.h:277
bool preserve_dates
Preserve file timestamp. Default: false.
Definition: FaspManagerTypes.h:289
FASP Protocol Version 1.
Definition: FaspManagerTypes.h:163
Force copy symlinks.
Definition: FaspManagerTypes.h:177
bool remove_empty_directories
Remove source empty directories after transferring. Default: false.
Definition: FaspManagerTypes.h:299
Location * dst_location
The destination location.
Definition: FaspManagerTypes.h:232
content_protect_e content_protection
Definition: FaspManagerTypes.h:269
policy_e
Definition: FaspManagerTypes.h:135
Skip symlinks.
Definition: FaspManagerTypes.h:179
Always Overwrite.
Definition: FaspManagerTypes.h:197
u_int64_t total_bytes_written
The current total number of bytes written.
Definition: FaspManagerTypes.h:381
char const * token
Security token. Default: "".
Definition: FaspManagerTypes.h:265
No protection.
Definition: FaspManagerTypes.h:103
char const * file_manifest_directory
Directory where the manifest should be written too. Default: "".
Definition: FaspManagerTypes.h:307
encryption_type_e encryption
Enable encryption ("None" or "AES-128"). Default: AES-128.
Definition: FaspManagerTypes.h:257
char * dst_loc_path
The destination location path.
Definition: FaspManagerTypes.h:367
char const * cookie
Input cookie for server side consumption. Default: "".
Definition: FaspManagerTypes.h:267
overwrite_e overwrite
Policy to overwrite files that already exist at the destination. Default: Different.
Definition: FaspManagerTypes.h:303
char const * content_protect_passwd
Password for encryption at rest. Default: "".
Definition: FaspManagerTypes.h:271
u_int64_t pathscans_failed
The number of source path scans failed.
Definition: FaspManagerTypes.h:433
Resume if sparse checksum matches.
Definition: FaspManagerTypes.h:127
Copy symlink.
Definition: FaspManagerTypes.h:175
policy_e policy
The transfer rate policy.
Definition: FaspManagerTypes.h:354

Copyright © 2005 - 2016 Aspera, an IBM company. | asperasoft.com