-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnumerations.cs
710 lines (520 loc) · 21.9 KB
/
Enumerations.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
//
// @(#) Enumerations.cs
//
// Project: usis.Net.Bits
// System: Microsoft Visual Studio 2022
// Author: Udo Schäfer
//
// Copyright (c) 2017-2022 usis GmbH. All rights reserved.
using System;
namespace usis.Net.Bits
{
#region Constants class
// ---------------
// Constants class
// ---------------
/// <summary>
/// Provides constants for the BITS class library.
/// </summary>
public static class Constants
{
/// <summary>
/// Indicates that a range extends to the end of the file.
/// </summary>
public const long LengthToEndOfFile = -1;
}
#endregion Constants class
#region BackgroundCopyJobType enumeration
// ---------------------------------
// BackgroundCopyJobType enumeration
// ---------------------------------
/// <summary>
/// Defines constant values that specify the type of transfer job, such as download.
/// </summary>
public enum BackgroundCopyJobType
{
/// <summary>
/// Specifies that the job downloads files to the client.
/// </summary>
Download = 0,
/// <summary>
/// Specifies that the job uploads a file to the server.
/// </summary>
Upload = 1,
/// <summary>
/// Specifies that the job uploads a file to the server
/// and receives a reply file from the server application.
/// </summary>
UploadReply = 2,
}
#endregion BackgroundCopyJobType enumeration
#region BackgroundCopyJobState enumeration
// ----------------------------------
// BackgroundCopyJobState enumeration
// ----------------------------------
/// <summary>
/// Defines constant values for the different states of a job.
/// </summary>
public enum BackgroundCopyJobState
{
/// <summary>
/// Specifies that the job is in the queue and waiting to run.
/// If a user logs off while their job is transferring,
/// the job transitions to the queued state.
/// </summary>
Queued = 0,
/// <summary>
/// Specifies that BITS is trying to connect to the server.
/// If the connection succeeds,
/// the state of the job becomes <see cref="Transferring"/>;
/// otherwise, the state becomes <see cref="Error"/>.
/// </summary>
Connecting = 1,
/// <summary>
/// Specifies that BITS is transferring data for the job.
/// </summary>
Transferring = 2,
/// <summary>
/// Specifies that the job is suspended (paused).
/// To suspend a job, call the
/// <see cref="BackgroundCopyJob.Suspend"/> method.
/// BITS automatically suspends a job when it is created.
/// The job remains suspended until you call the
/// <see cref="BackgroundCopyJob.Resume"/>,
/// <see cref="BackgroundCopyJob.Complete"/>, or
/// <see cref="BackgroundCopyJob.Cancel"/> method.
/// </summary>
Suspended = 3,
/// <summary>
/// Specifies that a non-recoverable error occurred
/// (the service is unable to transfer the file).
/// If the error, such as an access-denied error,
/// can be corrected, call the
/// <see cref="BackgroundCopyJob.Resume"/>
/// method after the error is fixed. However,
/// if the error cannot be corrected, call the
/// <see cref="BackgroundCopyJob.Cancel"/> method
/// to cancel the job, or call the
/// <see cref="BackgroundCopyJob.Complete"/> method
/// to accept the portion of a download job
/// that transferred successfully.
/// </summary>
Error = 4,
/// <summary>
/// Specifies that a recoverable error occurred.
/// BITS will retry jobs in the transient error state
/// based on the retry interval you specify
/// (see <see cref="BackgroundCopyJob.MinimumRetryDelay"/>).
/// The state of the job changes to <see cref="Error"/>
/// if the job fails to make progress
/// (see <see cref="BackgroundCopyJob.NoProgressTimeout"/>).
/// BITS does not retry the job if a network disconnect
/// or disk lock error occurred
/// (for example, chkdsk is running)
/// or the MaxInternetBandwidth Group Policy is zero.
/// </summary>
TransientError = 5,
/// <summary>
/// Specifies that your job was successfully processed.
/// You must call the <see cref="BackgroundCopyJob.Complete"/>
/// method to acknowledge completion of the job
/// and to make the files available to the client.
/// </summary>
Transferred = 6,
/// <summary>
/// Specifies that you called the <see cref="BackgroundCopyJob.Complete"/>
/// method to acknowledge that your job completed successfully.
/// </summary>
Acknowledged = 7,
/// <summary>
/// Specifies that you called the <see cref="BackgroundCopyJob.Cancel"/>
/// method to cancel the job (remove the job from the transfer queue).
/// </summary>
Canceled = 8,
}
#endregion BackgroundCopyJobState enumeration
#region BackgroundCopyJobPriority enumeration
// -------------------------------------
// BackgroundCopyJobPriority enumeration
// -------------------------------------
/// <summary>
/// Defines the constant values that specify the priority level of a job.
/// </summary>
public enum BackgroundCopyJobPriority
{
/// <summary>
/// Transfers the job in the foreground.
/// Foreground transfers compete for network bandwidth
/// with other applications,
/// which can impede the user's network experience.
/// This is the highest priority level.
/// </summary>
Foreground = 0,
/// <summary>
/// Transfers the job in the background with a high priority.
/// Background transfers use idle network bandwidth
/// of the client to transfer files.
/// This is the highest background priority level.
/// </summary>
High = 1,
/// <summary>
/// Transfers the job in the background with a normal priority.
/// Background transfers use idle network bandwidth
/// of the client to transfer files.
/// This is the default priority level.
/// </summary>
Normal = 2,
/// <summary>
/// Transfers the job in the background with a low priority.
/// Background transfers use idle network bandwidth
/// of the client to transfer files.
/// This is the lowest background priority level.
/// </summary>
Low = 3,
}
#endregion BackgroundCopyJobPriority enumeration
#region BackgroundCopyJobProxyUsage enumeration
// ---------------------------------------
// BackgroundCopyJobProxyUsage enumeration
// ---------------------------------------
/// <summary>
/// defines constant values that specify which proxy to use for file transfers.
/// You can define different proxy settings for each job.
/// </summary>
public enum BackgroundCopyJobProxyUsage
{
/// <summary>
/// Use the proxy and proxy bypass list settings defined by each user to transfer files.
/// Settings are user-defined from Control Panel, Internet Options, Connections,
/// Local Area Network (LAN) settings (or Dial-up settings, depending on the network connection).
/// </summary>
Preconfigured = 0,
/// <summary>
/// Do not use a proxy to transfer files. Use this option when you transfer files within a LAN.
/// </summary>
NoProxy = 1,
/// <summary>
/// Use the application's proxy and proxy bypass list to transfer files.
/// Use this option when you cannot trust that the system settings are correct.
/// Also use this option when you want to transfer files using a special account,
/// such as LocalSystem, to which the system settings do not apply.
/// </summary>
Override = 2,
/// <summary>
/// Automatically detect proxy settings. BITS detects proxy settings for each file in the job.
/// </summary>
/// <remarks>
/// Not available for BITS 1.5 and earlier.
/// </remarks>
AutoDetect = 3,
}
#endregion BackgroundCopyJobProxyUsage enumeration
#region BackgroundCopyJobNotifications enumeration
// ------------------------------------------
// BackgroundCopyJobNotifications enumeration
// ------------------------------------------
/// <summary>
/// Defines the constant values that specify the type of
/// events you will receive, such as job transferred events.
/// </summary>
[Flags]
public enum BackgroundCopyJobNotifications
{
/// <summary>
/// All of the files in the job have been transferred.
/// </summary>
Transferred = 1,
/// <summary>
/// An error has occurred.
/// </summary>
Error = 2,
/// <summary>
/// Event notification is disabled.
/// </summary>
Disabled = 4,
/// <summary>
/// The job has been modified.
/// For example, a property value changed,
/// the state of the job changed,
/// or progress is made transferring the files.
/// </summary>
Modification = 8,
/// <summary>
/// A file in the job has been transferred. This flag is ignored in
/// command-line callbacks if command line notification is specified.
/// </summary>
FileTransferred = 0x10,
}
#endregion BackgroundCopyJobNotifications enumeration
#region BackgroundCopyErrorContext enumeration
// --------------------------------------
// BackgroundCopyErrorContext enumeration
// --------------------------------------
/// <summary>
/// Defines the constant values that specify the context in which the error occurred.
/// </summary>
public enum BackgroundCopyErrorContext
{
/// <summary>
/// An error has not occurred.
/// </summary>
None,
/// <summary>
/// The error context is unknown.
/// </summary>
Unknown,
/// <summary>
/// The transfer queue manager generated the error.
/// </summary>
GeneralQueueManager,
/// <summary>
/// The error was generated while the queue manager was notifying the client of an event.
/// </summary>
QueueManagerNotification,
/// <summary>
/// The error was related to the specified local file.
/// For example, permission was denied or the volume was unavailable.
/// </summary>
LocalFile,
/// <summary>
/// he error was related to the specified remote file.
/// For example, the URL was not accessible.
/// </summary>
RemoteFile,
/// <summary>
/// The transport layer generated the error.
/// These errors are general transport failures (these errors are not specific to the remote file).
/// </summary>
GeneralTransport,
/// <summary>
/// The transport layer generated the error.
/// These errors are general transport failures (these errors are not specific to the remote file).
/// </summary>
RemoteApplication
}
#endregion BackgroundCopyErrorContext enumeration
#region BackgroundCopyAuthenticationTarget enumeration
// ----------------------------------------------
// BackgroundCopyAuthenticationTarget enumeration
// ----------------------------------------------
/// <summary>
/// Defines the constant values that specify whether the credentials
/// are used for proxy or server user authentication requests.
/// </summary>
public enum BackgroundCopyAuthenticationTarget
{
/// <summary>
/// Undefined
/// </summary>
None = 0,
/// <summary>
/// Use credentials for server requests.
/// </summary>
Server = 1,
/// <summary>
/// Use credentials for proxy requests.
/// </summary>
Proxy = 2
}
#endregion BackgroundCopyAuthenticationTarget enumeration
#region BackgroundCopyAuthenticationScheme enumeration
// ----------------------------------------------
// BackgroundCopyAuthenticationScheme enumeration
// ----------------------------------------------
/// <summary>
/// Defines the constant values that specify the authentication scheme
/// to use when a proxy or server requests user authentication.
/// </summary>
public enum BackgroundCopyAuthenticationScheme
{
/// <summary>
/// No authentication scheme specified.
/// </summary>
None,
/// <summary>
/// Basic is a scheme in which the user name and password are sent in clear-text to the server or proxy.
/// </summary>
Basic,
/// <summary>
/// Digest is a challenge-response scheme that uses a server-specified data string for the challenge.
/// </summary>
Digest,
/// <summary>
/// NTLM is a challenge-response scheme that uses the credentials of the user for authentication in a Windows network environment.
/// </summary>
Ntlm,
/// <summary>
/// Simple and Protected Negotiation protocol (Snego) is a challenge-response scheme that negotiates with the server or proxy to determine which scheme to use for authentication. Examples are the Kerberos protocol and NTLM.
/// </summary>
Negotiate,
/// <summary>
/// Passport is a centralized authentication service provided by Microsoft that offers a single logon for member sites.
/// </summary>
Passport
}
#endregion BackgroundCopyAuthenticationScheme enumeration
#region BackgroundCopyJobFileAclOptions enumeration
// -------------------------------------------
// BackgroundCopyJobFileAclOptions enumeration
// -------------------------------------------
/// <summary>
/// Flags that identify the owner and ACL information to maintain when transferring a file using SMB.
/// </summary>
[Flags]
public enum BackgroundCopyJobFileAclOptions
{
/// <summary>
/// If set, the file's owner information is maintained. Otherwise, the job's owner becomes the owner of the file.
/// </summary>
FileOwner = 1,
/// <summary>
/// If set, the file's group information is maintained.
/// Otherwise, BITS uses the job owner's primary group to assign the group information to the file.
/// </summary>
FileGroup = 2,
/// <summary>
/// If set, BITS copies the explicit ACEs from the source file and inheritable ACEs from the destination parent folder.
/// Otherwise, BITS copies the inheritable ACEs from the destination parent folder.
/// If the parent folder does not contain inheritable ACEs, BITS uses the default DACL from the account.
/// </summary>
FileDacl = 4,
/// <summary>
/// If set, BITS copies the explicit ACEs from the source file and inheritable ACEs from the destination parent folder.
/// Otherwise, BITS copies the inheritable ACEs from the destination parent folder.
/// </summary>
FileSacl = 8,
/// <summary>
/// If set, BITS copies the owner and ACL information. This is the same as setting all the flags individually.
/// </summary>
FileAll = FileOwner | FileGroup | FileDacl | FileSacl
}
#endregion BackgroundCopyJobFileAclOptions enumeration
#region BackgroundCopyCertificateStoreLocation enumeration
// --------------------------------------------------
// BackgroundCopyCertificateStoreLocation enumeration
// --------------------------------------------------
// BG_CERT_STORE_LOCATION
/// <summary>
/// Defines the location of the certificate store.
/// </summary>
public enum BackgroundCopyCertificateStoreLocation
{
/// <summary>
/// Use the current user's certificate store.
/// </summary>
CurrentUser,
/// <summary>
/// Use the local computer's certificate store.
/// </summary>
LocalMachine,
/// <summary>
/// Use the current service's certificate store.
/// </summary>
CurrentService,
/// <summary>
/// Use a specific service's certificate store.
/// </summary>
Services,
/// <summary>
/// Use a specific user's certificate store.
/// </summary>
Users,
/// <summary>
/// Use the current user's group policy certificate store.
/// In a network setting, stores in this location are downloaded to the client computer
/// from the Group Policy Template (GPT) during computer startup or user logon.
/// </summary>
CurrentUserGroupPolicy,
/// <summary>
/// Use the local computer's certificate store.
/// In a network setting, stores in this location are downloaded to the client computer
/// from the Group Policy Template (GPT) during computer startup or user logon.
/// </summary>
LocalMachineGroupPolicy,
/// <summary>
/// Use the enterprise certificate store.
/// The enterprise store is shared across domains in the enterprise and downloaded
/// from the global enterprise directory.
/// </summary>
LocalMachineEnterprise
}
#endregion BackgroundCopyCertificateStoreLocation enumeration
#region BackgroundCopyJobHttpSecurityFlags enumeration
// ----------------------------------------------
// BackgroundCopyJobHttpSecurityFlags enumeration
// ----------------------------------------------
/// <summary>
/// HTTP security flags that indicate which errors to ignore when connecting to the server.
/// </summary>
[Flags]
public enum BackgroundCopyJobHttpSecurityOptions
{
/// <summary>
/// Allows the server to redirect your request to another server. This is the default.
/// </summary>
None = 0x000,
/// <summary>
/// Check the certificate revocation list (CRL) to verify that the server certificate has not been revoked.
/// </summary>
EnableCertificateRevocationListCheck = 0x0001,
/// <summary>
/// Ignores errors caused when the certificate host name of the server does not match the host name in the request.
/// </summary>
IgnoreCertificateHostNameInvalid = 0x0002,
/// <summary>
/// Ignores errors caused by an expired certificate.
/// </summary>
IgnoreCertificateDateInvalid = 0x0004,
/// <summary>
/// Ignore errors associated with an unknown certification authority (CA).
/// </summary>
IgnoreUnknownCertificationAuthority = 0x0008,
/// <summary>
/// Ignore errors associated with the use of a certificate.
/// </summary>
IgnoreCertificateWrongUsage = 0x0010,
/// <summary>
/// Allows the server to redirect your request to another server.
/// BITS updates the remote name with the final URL.
/// </summary>
HttpRedirectPolicyAllowReport = 0x0100,
/// <summary>
/// Places the job in the fatal error state when the server redirects your request to another server.
/// BITS updates the remote name with the redirected URL.
/// </summary>
HttpRedirectPolicyDisallow = 0x0200,
/// <summary>
/// Bitmask that you can use with the security flag value to determine which redirect policy is in effect.
/// It does not include the flag <see cref="HttpRedirectPolicyAllowHttpsToHttp"/>.
/// </summary>
HttpRedirectPolicyMask = 0x0700,
/// <summary>
/// Allows the server to redirect an HTTPS request to an HTTP URL.
/// You can combine this flag with <see cref="HttpRedirectPolicyAllowReport"/>.
/// </summary>
HttpRedirectPolicyAllowHttpsToHttp = 0x0800,
}
#endregion BackgroundCopyJobHttpSecurityFlags enumeration
#region BackgroundCopyJobPeerCachingOptions enumeration
// -----------------------------------------------
// BackgroundCopyJobPeerCachingOptions enumeration
// -----------------------------------------------
/// <summary>
/// Flags that indicate determine if the files of the job can be cached and served to peers
/// and if BITS can download content for the job from peers
/// </summary>
[Flags]
public enum BackgroundCopyJobPeerCachingOptions
{
/// <summary>
/// The job can download content from peers.
/// </summary>
EnableClient = 0x0001,
/// <summary>
/// The files of the job can be cached and served to peers.
/// </summary>
EnableServer = 0x0002
}
#endregion BackgroundCopyJobPeerCachingOptions enumeration
}
// eof "Enumerations.cs"