00001
00007 #ifndef __FASP_MANAGER_TYPES_H__
00008 #define __FASP_MANAGER_TYPES_H__
00009
00010 #include "FaspManagerCommon.h"
00011 #include <list>
00012
00013 #ifndef _AS_PLATFORM_H_
00014 #ifdef WIN32
00015 #ifdef VSTUDIO
00016 typedef char int8_t;
00017 typedef short int16_t;
00018 typedef long int32_t;
00019 typedef __int64 int64_t;
00020 typedef unsigned char u_int8_t;
00021 typedef unsigned short u_int16_t;
00022 typedef unsigned long u_int32_t;
00023 typedef unsigned __int64 u_int64_t;
00024 #else
00025 #ifndef _STDINT_H // Ming stdint.h defines the int bitdepth types
00026 typedef char int8_t;
00027 typedef short int16_t;
00028 typedef long int32_t;
00029 typedef long long int64_t;
00030 #endif
00031 typedef unsigned char u_int8_t;
00032 typedef unsigned short u_int16_t;
00033 typedef unsigned long u_int32_t;
00034 typedef unsigned long long u_int64_t;
00035 #endif
00036 #endif
00037
00038 #ifdef WIN32
00039 #define strtoll(str, end, base) _strtoi64(str, end, base)
00040 #define strtoull(str, end, base) _strtoui64(str, end, base)
00041 #endif
00042
00043 #ifdef WIN32
00044 # define LLD "%I64d"
00045 # define LLU "%I64u"
00046 # define LLX "%I64x"
00047 # define NLLD(n) "%" #n "I64d"
00048 # define NLLU(n) "%" #n "I64u"
00049 #else
00050 # if __WORDSIZE == 64
00051 # define LLD "%ld"
00052 # define LLU "%lu"
00053 # define LLX "%lx"
00054 # define NLLD(n) "%" #n "ld"
00055 # define NLLU(n) "%" #n "lu"
00056 # else
00057 # define LLD "%lld"
00058 # define LLU "%llu"
00059 # define LLX "%llx"
00060 # define NLLD(n) "%" #n "lld"
00061 # define NLLU(n) "%" #n "llu"
00062 # endif
00063 #endif
00064 #endif
00065
00066 namespace Aspera
00067 {
00068 namespace FaspManager
00069 {
00070
00071 class Job;
00072 class Location;
00073 class Functor;
00074 class Queue;
00075 struct XferParams;
00076 struct FileStats;
00077
00079 typedef enum job_state_e
00080 {
00081 J_STATE_IDLE = 0x00,
00082 J_STATE_CONNECTING = 0x01,
00083 J_STATE_AUTHENTICATING = 0x02,
00084 J_STATE_STARTING = 0x03,
00085 J_STATE_TRANSFERRING = 0x04,
00086 J_STATE_FAILED = 0x05,
00087 J_STATE_FINISHED = 0x06,
00088
00089 J_STATE_MAX
00090 } job_state_e;
00091
00093 typedef enum file_state_e
00094 {
00095 F_STATE_IDLE = 0x00,
00096 F_STATE_TRANSFERRING = 0x01,
00097 F_STATE_FAILED = 0x02,
00098 F_STATE_FINISHED = 0x03,
00099
00100 F_STATE_MAX
00101 } file_state_e;
00102
00105 typedef enum content_protect_e
00106 {
00108 CPROTECT_NONE = 0x00,
00110 CPROTECT_ENCRYPT = 0x01,
00112 CPROTECT_DECRYPT = 0x02
00113
00114 } content_protect_e;
00115
00117 typedef enum encryption_type_e
00118 {
00119 ENCRYPT_NONE = 0x00,
00120 ENCRYPT_AES128 = 0x01
00121
00122 } encryption_type_e;
00123
00125 typedef enum resume_type_e
00126 {
00128 RESUME_NONE = 0x00,
00130 RESUME_FILE_ATTRIB = 0x01,
00132 RESUME_SPARSE_CHKSUM = 0x02,
00134 RESUME_FULL_CHKSUM = 0x03
00135
00136 } resume_type_e;
00137
00140 typedef enum policy_e
00141 {
00143 POLICY_FIXED = 0x00,
00146 POLICY_HIGH = 0x01,
00148 POLICY_FAIR = 0x02,
00150 POLICY_LOW = 0x03
00151
00152 } policy_e;
00153
00155 typedef enum fasp_version_e
00156 {
00158 VERSION_FASP1 = 0x01,
00160 VERSION_FASP2 = 0x02
00161
00162 } fasp_version_e;
00163
00165 typedef enum xfer_direction_e
00166 {
00168 DIRECTION_SEND = 0x01,
00170 DIRECTION_RECEIVE = 0x02
00171
00172 } xfer_direction_e;
00173
00175 typedef enum symlink_policy_e
00176 {
00178 SYMLINK_P_FOLLOW = 1,
00180 SYMLINK_P_COPY = 2,
00182 SYMLINK_P_COPY_FORCE = 3,
00183
00184 SYMLINK_P_SKIP = 4
00185 } symlink_policy_e;
00186
00188 typedef enum manifest_e
00189 {
00191 TEXT = 1,
00193 NONE = 2
00194 } manifest_e;
00195
00197 typedef enum overwrite_e
00198 {
00200 NEVER = 1,
00202 ALWAYS = 2,
00204 DIFF = 3,
00206 OLDER = 4,
00208 DIFF_AND_OLDER = 5
00209 } overwrite_e;
00210
00212 typedef enum callback_event_e
00213 {
00214
00215 F_EVENT_BANDWIDTH_MEASUREMENT = 0x00,
00216 F_EVENT_CONNECTING = 0x01,
00217 F_EVENT_FILE_ERROR = 0x02,
00218 F_EVENT_FILE_START = 0x03,
00219 F_EVENT_FILE_STOP = 0x04,
00220 F_EVENT_PROGRESS = 0x05,
00221 F_EVENT_RATE_MODIFICATION = 0x06,
00222 F_EVENT_SESSION_ERROR = 0x07,
00223 F_EVENT_SESSION_START = 0x08,
00224 F_EVENT_SESSION_STOP = 0x09,
00225
00226 FS_EVENT_MAX
00227
00228 } callback_event_e;
00229
00231 struct JobOrder
00232 {
00234 Location *src_location;
00236 Location *dst_location;
00238 XferParams *xfer_params;
00239 };
00240
00242 typedef struct XferParams
00243 {
00245 unsigned short tcp_port;
00247 unsigned short udp_port;
00249 u_int64_t target_rate;
00251 u_int64_t min_rate;
00255 bool auto_bwidth_discovery;
00257 fasp_version_e fasp_version;
00259 encryption_type_e encryption;
00261 policy_e policy;
00263 bool create_dirs;
00265 resume_type_e resume_check;
00267 char const * token;
00269 char const * cookie;
00273 content_protect_e content_protection;
00275 char const * content_protect_passwd;
00277 bool pre_calculate_job_size;
00279 char const * license;
00281 char const * fasp_log_path;
00283 char const * fasp_remote_log_path;
00285 unsigned long dgram_size;
00287 unsigned long rexmsg_size;
00289 unsigned long write_blk_size;
00291 unsigned long read_blk_size;
00293 bool preserve_dates;
00297 bool persist;
00299 bool preserve_user_id;
00301 bool preserve_group_id;
00303 bool skip_special_files;
00305 bool remove_empty_directories;
00307 bool remove_after_transfer;
00309 overwrite_e overwrite;
00311 manifest_e file_manifest;
00313 char const * file_manifest_directory;
00315 unsigned long retry_timeout_s;
00319 std::list<char const *> exclude_patterns;
00321 symlink_policy_e symlink_policy;
00325 char const * source_base;
00327 char const * destination_root;
00329 XferParams();
00330
00332 XferParams(const XferParams &xp);
00333
00334 } XferParams;
00335
00337 struct UpdateParams
00338 {
00340 u_int64_t target_rate;
00342 u_int64_t min_rate;
00344 policy_e policy;
00345 };
00346
00348 struct JobStats
00349 {
00351 char* job_id;
00353 job_state_e job_state;
00355 char* src_loc_path;
00357 char* dst_loc_path;
00359 unsigned short udp_port;
00361 u_int64_t target_rate;
00363 u_int64_t min_rate;
00365 char* encryption;
00367 char* policy;
00369 u_int64_t total_elapsed_msec;
00371 u_int64_t total_bytes_written;
00373 u_int64_t files_complete;
00375 u_int64_t files_failed;
00377 unsigned long err_code;
00379 char* err_description;
00381 u_int64_t measured_link_rate_kbps;
00383 char* cookie;
00385 fasp_version_e fasp_version;
00387 char* host;
00389 u_int64_t start_time_ms;
00391 char* token;
00393 u_int64_t precalc_total_bytes;
00395 u_int64_t precalc_total_files;
00397 u_int64_t total_lost_bytes;
00399 u_int64_t total_transferred_bytes;
00401 char* user;
00403 bool remote;
00405 xfer_direction_e direction;
00407 u_int32_t delay;
00408
00410 bool initiatedByOther;
00411
00413 u_int64_t transfers_attempted;
00415 u_int64_t transfers_failed;
00417 u_int64_t transfers_passed;
00419 u_int64_t transfers_skipped;
00421 u_int64_t pathscans_attempted;
00423 u_int64_t pathscans_failed;
00425 u_int64_t pathscans_irregular;
00427 u_int64_t pathscans_excluded;
00429 char* manifestfile_path;
00430 };
00431
00433 struct FileStats
00434 {
00436 char* filename;
00438 file_state_e file_state;
00440 u_int64_t file_size;
00442 u_int64_t bytes_written;
00444 u_int64_t bytes_cont;
00446 u_int64_t start_byte;
00448 u_int64_t end_byte;
00450 u_int64_t rate_cap;
00452 unsigned long err_code;
00454 char* err_description;
00455 };
00456
00457 }
00458 }
00459
00460 #endif