/
ndmp3.x
1109 lines (954 loc) · 23.2 KB
/
ndmp3.x
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
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2000
* Traakan, Inc., Los Altos, CA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice unmodified, this list of conditions, and the following
* disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Project: NDMJOB
* Ident: $Id: $
*
* Description:
*
*/
/*
* ndmp3.x
*
* Description : NDMP protocol rpcgen file.
*
* Copyright (c) 1999 Intelliguard Software, Network Appliance.
* All Rights Reserved.
*
* $Id: ndmp.x,v 1.11 1998/05/26 03:52:12 tim Exp $
*/
%#ifndef NDMOS_OPTION_NO_NDMP3
const NDMP3VER = 3;
const NDMP3PORT = 10000;
%#define ndmp3_u_quad unsigned long long
%extern bool_t xdr_ndmp3_u_quad();
struct _ndmp3_u_quad
{
u_long high;
u_long low;
};
struct ndmp3_pval
{
string name<>;
string value<>;
};
enum ndmp3_error
{
NDMP3_NO_ERR, /* No error */
NDMP3_NOT_SUPPORTED_ERR, /* Call is not supported */
NDMP3_DEVICE_BUSY_ERR, /* The device is in use */
NDMP3_DEVICE_OPENED_ERR, /* Another tape or scsi device
* is already open */
NDMP3_NOT_AUTHORIZED_ERR, /* connection has not been authorized*/
NDMP3_PERMISSION_ERR, /* some sort of permission problem */
NDMP3_DEV_NOT_OPEN_ERR, /* SCSI device is not open */
NDMP3_IO_ERR, /* I/O error */
NDMP3_TIMEOUT_ERR, /* command timed out */
NDMP3_ILLEGAL_ARGS_ERR, /* illegal arguments in request */
NDMP3_NO_TAPE_LOADED_ERR, /* Cannot open because there is
* no tape loaded */
NDMP3_WRITE_PROTECT_ERR, /* tape cannot be open for write */
NDMP3_EOF_ERR, /* Command encountered EOF */
NDMP3_EOM_ERR, /* Command encountered EOM */
NDMP3_FILE_NOT_FOUND_ERR, /* File not found during restore */
NDMP3_BAD_FILE_ERR, /* The file descriptor is invalid */
NDMP3_NO_DEVICE_ERR, /* The device is not at that target */
NDMP3_NO_BUS_ERR, /* Invalid controller */
NDMP3_XDR_DECODE_ERR, /* Can't decode the request argument */
NDMP3_ILLEGAL_STATE_ERR, /* Call can't be done at this state */
NDMP3_UNDEFINED_ERR, /* Undefined Error */
NDMP3_XDR_ENCODE_ERR, /* Can't encode the reply argument */
NDMP3_NO_MEM_ERR, /* no memory */
NDMP3_CONNECT_ERR /* Error connecting to another
* NDMP server */
};
enum ndmp3_header_message_type
{
NDMP3_MESSAGE_REQUEST,
NDMP3_MESSAGE_REPLY
};
enum ndmp3_message
{
NDMP3_CONNECT_OPEN = 0x900, /* CONNECT INTERFACE */
NDMP3_CONNECT_CLIENT_AUTH = 0x901,
NDMP3_CONNECT_CLOSE = 0x902,
NDMP3_CONNECT_SERVER_AUTH = 0x903,
NDMP3_CONFIG_GET_HOST_INFO = 0x100, /* CONFIG INTERFACE */
NDMP3_CONFIG_GET_CONNECTION_TYPE = 0x102, /* NDMP2_CONFIG_GET_MOVER_TYPE on v2*/
NDMP3_CONFIG_GET_AUTH_ATTR = 0x103,
NDMP3_CONFIG_GET_BUTYPE_INFO = 0x104, /* new from v3 */
NDMP3_CONFIG_GET_FS_INFO = 0x105, /* new from v3 */
NDMP3_CONFIG_GET_TAPE_INFO = 0x106, /* new from v3 */
NDMP3_CONFIG_GET_SCSI_INFO = 0x107, /* new from v3 */
NDMP3_CONFIG_GET_SERVER_INFO =0x108, /* new from v3 */
NDMP3_SCSI_OPEN = 0x200, /* SCSI INTERFACE */
NDMP3_SCSI_CLOSE = 0x201,
NDMP3_SCSI_GET_STATE = 0x202,
NDMP3_SCSI_SET_TARGET = 0x203,
NDMP3_SCSI_RESET_DEVICE = 0x204,
NDMP3_SCSI_RESET_BUS = 0x205,
NDMP3_SCSI_EXECUTE_CDB = 0x206,
NDMP3_TAPE_OPEN = 0x300, /* TAPE INTERFACE */
NDMP3_TAPE_CLOSE = 0x301,
NDMP3_TAPE_GET_STATE = 0x302,
NDMP3_TAPE_MTIO = 0x303,
NDMP3_TAPE_WRITE = 0x304,
NDMP3_TAPE_READ = 0x305,
NDMP3_TAPE_EXECUTE_CDB = 0x307,
NDMP3_DATA_GET_STATE = 0x400, /* DATA INTERFACE */
NDMP3_DATA_START_BACKUP = 0x401,
NDMP3_DATA_START_RECOVER = 0x402,
NDMP3_DATA_ABORT = 0x403,
NDMP3_DATA_GET_ENV = 0x404,
NDMP3_DATA_STOP = 0x407,
NDMP3_DATA_LISTEN = 0x409, /* new from V3 */
NDMP3_DATA_CONNECT = 0x40a, /* new from V3 */
NDMP3_DATA_START_RECOVER_FILEHIST = 0x40b, /* same as V3.1 */
NDMP3_NOTIFY_DATA_HALTED =0x501,/* NOTIFY INTERFACE */
NDMP3_NOTIFY_CONNECTED = 0x502,
NDMP3_NOTIFY_MOVER_HALTED = 0x503,
NDMP3_NOTIFY_MOVER_PAUSED = 0x504,
NDMP3_NOTIFY_DATA_READ =0x505,
NDMP3_LOG_FILE = 0x602, /* LOGGING INTERFACE */
NDMP3_LOG_MESSAGE = 0x603, /* new from v3 */
NDMP3_FH_ADD_FILE = 0x703, /* FILE HISTORY INTERFACE */
NDMP3_FH_ADD_DIR = 0x704,
NDMP3_FH_ADD_NODE = 0x705,
NDMP3_MOVER_GET_STATE = 0xa00, /* MOVER INTERFACE */
NDMP3_MOVER_LISTEN = 0xa01,
NDMP3_MOVER_CONTINUE = 0xa02,
NDMP3_MOVER_ABORT = 0xa03,
NDMP3_MOVER_STOP = 0xa04,
NDMP3_MOVER_SET_WINDOW = 0xa05,
NDMP3_MOVER_READ = 0xa06,
NDMP3_MOVER_CLOSE =0xa07,
NDMP3_MOVER_SET_RECORD_SIZE =0xa08,
NDMP3_MOVER_CONNECT =0xa09, /* new from V3 */
NDMP3_VENDORS_BASE = 0xf000, /* Reserved for the vendor
* specific usage
* from 0xf000 to 0xfeff */
NDMP3_RESERVED_BASE = 0xff00 /* Reserved for prototyping
* from 0xff00 to 0xffff */
};
struct ndmp3_header
{
u_long sequence; /* monotonically increasing */
u_long time_stamp; /* time stamp of message */
ndmp3_header_message_type message_type; /* what type of message */
ndmp3_message message; /* message number */
u_long reply_sequence; /* reply is in response to */
ndmp3_error error; /* communications errors */
};
/**********************/
/* CONNECT INTERFACE */
/**********************/
/* NDMP3_CONNECT_OPEN */
struct ndmp3_connect_open_request
{
u_short protocol_version; /* the version of protocol supported */
};
struct ndmp3_connect_open_reply
{
ndmp3_error error;
};
/* NDMP3_CONNECT_CLIENT_AUTH */
enum ndmp3_auth_type
{
NDMP3_AUTH_NONE, /* no password is required */
NDMP3_AUTH_TEXT, /* the clear text password */
NDMP3_AUTH_MD5 /* md5 */
};
struct ndmp3_auth_text
{
string auth_id<>;
string auth_password<>;
};
struct ndmp3_auth_md5
{
string auth_id<>;
opaque auth_digest[16];
};
union ndmp3_auth_data switch (enum ndmp3_auth_type auth_type)
{
case NDMP3_AUTH_NONE:
void;
case NDMP3_AUTH_TEXT:
struct ndmp3_auth_text auth_text;
case NDMP3_AUTH_MD5:
struct ndmp3_auth_md5 auth_md5;
};
struct ndmp3_connect_client_auth_request
{
ndmp3_auth_data auth_data;
};
struct ndmp3_connect_client_auth_reply
{
ndmp3_error error;
};
/* NDMP3_CONNECT_CLOSE */
/* no request arguments */
/* no reply arguments */
/* NDMP3_CONNECT_SERVER_AUTH */
union ndmp3_auth_attr switch (enum ndmp3_auth_type auth_type)
{
case NDMP3_AUTH_NONE:
void;
case NDMP3_AUTH_TEXT:
void;
case NDMP3_AUTH_MD5:
opaque challenge[64];
};
struct ndmp3_connect_server_auth_request
{
ndmp3_auth_attr client_attr;
};
struct ndmp3_connect_server_auth_reply
{
ndmp3_error error;
ndmp3_auth_data server_result;
};
/********************/
/* CONFIG INTERFACE */
/********************/
/* NDMP3_CONFIG_GET_HOST_INFO */
/* no request arguments */
struct ndmp3_config_get_host_info_reply
{
ndmp3_error error;
string hostname<>; /* host name */
string os_type<>; /* The O/S type (e.g. SOLARIS) */
string os_vers<>; /* The O/S version (e.g. 2.5) */
string hostid<>;
};
enum ndmp3_addr_type
{
NDMP3_ADDR_LOCAL,
NDMP3_ADDR_TCP,
NDMP3_ADDR_FC,
NDMP3_ADDR_IPC
};
/* NDMP3_CONFIG_GET_CONNECTION_TYPE */
/* no request arguments */
struct ndmp3_config_get_connection_type_reply
{
ndmp3_error error;
ndmp3_addr_type addr_types<>;
};
/* NDMP3_CONFIG_GET_AUTH_ATTR */
struct ndmp3_config_get_auth_attr_request
{
ndmp3_auth_type auth_type;
};
struct ndmp3_config_get_auth_attr_reply
{
ndmp3_error error;
ndmp3_auth_attr server_attr;
};
/* NDMP3_CONFIG_GET_SERVER_INFO */
/* no requset arguments */
struct ndmp3_config_get_server_info_reply
{
ndmp3_error error;
string vendor_name<>;
string product_name<>;
string revision_number<>;
ndmp3_auth_type auth_type<>;
};
/* backup type attributes */
const NDMP3_BUTYPE_BACKUP_FILE_HISTORY = 0x0001;
const NDMP3_BUTYPE_BACKUP_FILELIST = 0x0002;
const NDMP3_BUTYPE_RECOVER_FILELIST = 0x0004;
const NDMP3_BUTYPE_BACKUP_DIRECT = 0x0008;
const NDMP3_BUTYPE_RECOVER_DIRECT = 0x0010;
const NDMP3_BUTYPE_BACKUP_INCREMENTAL = 0x0020;
const NDMP3_BUTYPE_RECOVER_INCREMENTAL = 0x0040;
const NDMP3_BUTYPE_BACKUP_UTF8 = 0x0080;
const NDMP3_BUTYPE_RECOVER_UTF8 = 0x0100;
const NDMP3_BUTYPE_RECOVER_FILE_HISTORY = 0x0200;
struct ndmp3_butype_info
{
string butype_name<>;
ndmp3_pval default_env<>;
u_long attrs;
};
/* NDMP3_CONFIG_GET_BUTYPE_INFO */
/* no request arguments */
struct ndmp3_config_get_butype_info_reply
{
ndmp3_error error;
ndmp3_butype_info butype_info<>;
};
/* invalid bit */
const NDMP3_FS_INFO_TOTAL_SIZE_INVALID = 0x00000001;
const NDMP3_FS_INFO_USED_SIZE_INVALID = 0x00000002;
const NDMP3_FS_INFO_AVAIL_SIZE_INVALID = 0x00000004;
const NDMP3_FS_INFO_TOTAL_INODES_INVALID = 0x00000008;
const NDMP3_FS_INFO_USED_INODES_INVALID = 0x00000010;
struct ndmp3_fs_info
{
u_long invalid;
string fs_type<>;
string fs_logical_device<>;
string fs_physical_device<>;
ndmp3_u_quad total_size;
ndmp3_u_quad used_size;
ndmp3_u_quad avail_size;
ndmp3_u_quad total_inodes;
ndmp3_u_quad used_inodes;
ndmp3_pval fs_env<>;
string fs_status<>;
};
/* NDMP3_CONFIG_GET_FS_INFO */
/* no request arguments */
struct ndmp3_config_get_fs_info_reply
{
ndmp3_error error;
ndmp3_fs_info fs_info<>;
};
/* NDMP3_CONFIG_GET_TAPE_INFO */
/* no request arguments */
/* tape attributes */
const NDMP3_TAPE_ATTR_REWIND = 0x00000001;
const NDMP3_TAPE_ATTR_UNLOAD = 0x00000002;
struct ndmp3_device_capability
{
string device<>;
u_long attr;
ndmp3_pval capability<>;
};
struct ndmp3_device_info
{
string model<>;
ndmp3_device_capability caplist<>;
};
struct ndmp3_config_get_tape_info_reply
{
ndmp3_error error;
ndmp3_device_info tape_info<>;
};
/* NDMP3_CONFIG_GET_SCSI_INFO */
/* jukebox attributes */
struct ndmp3_config_get_scsi_info_reply
{
ndmp3_error error;
ndmp3_device_info scsi_info<>;
};
/******************/
/* SCSI INTERFACE */
/******************/
/* NDMP3_SCSI_OPEN */
struct ndmp3_scsi_open_request
{
string device<>;
};
struct ndmp3_scsi_open_reply
{
ndmp3_error error;
};
/* NDMP3_SCSI_CLOSE */
/* no request arguments */
struct ndmp3_scsi_close_reply
{
ndmp3_error error;
};
/* NDMP3_SCSI_GET_STATE */
/* no request arguments */
struct ndmp3_scsi_get_state_reply
{
ndmp3_error error;
short target_controller;
short target_id;
short target_lun;
};
/* NDMP3_SCSI_SET_TARGET */
struct ndmp3_scsi_set_target_request
{
string device<>;
u_short target_controller;
u_short target_id;
u_short target_lun;
};
struct ndmp3_scsi_set_target_reply
{
ndmp3_error error;
};
/* NDMP3_SCSI_RESET_DEVICE */
/* no request arguments */
struct ndmp3_scsi_reset_device_reply
{
ndmp3_error error;
};
/* NDMP3_SCSI_RESET_BUS */
/* no request arguments */
struct ndmp3_scsi_reset_bus_reply
{
ndmp3_error error;
};
/* NDMP3_SCSI_EXECUTE_CDB */
const NDMP3_SCSI_DATA_IN = 0x00000001; /* Expect data from SCSI device */
const NDMP3_SCSI_DATA_OUT = 0x00000002; /* Transfer data to SCSI device */
struct ndmp3_execute_cdb_request
{
u_long flags;
u_long timeout;
u_long datain_len; /* Set for expected datain */
opaque cdb<>;
opaque dataout<>;
};
struct ndmp3_execute_cdb_reply
{
ndmp3_error error;
u_char status; /* SCSI status bytes */
u_long dataout_len;
opaque datain<>; /* SCSI datain */
opaque ext_sense<>; /* Extended sense data */
};
typedef ndmp3_execute_cdb_request ndmp3_scsi_execute_cdb_request;
typedef ndmp3_execute_cdb_reply ndmp3_scsi_execute_cdb_reply;
/******************/
/* TAPE INTERFACE */
/******************/
/* NDMP3_TAPE_OPEN */
enum ndmp3_tape_open_mode
{
NDMP3_TAPE_READ_MODE,
NDMP3_TAPE_RDWR_MODE
};
struct ndmp3_tape_open_request
{
string device<>;
ndmp3_tape_open_mode mode;
};
struct ndmp3_tape_open_reply
{
ndmp3_error error;
};
/* NDMP3_TAPE_CLOSE */
/* no request arguments */
struct ndmp3_tape_close_reply
{
ndmp3_error error;
};
/*NDMP3_TAPE_GET_STATE */
/* no request arguments */
const NDMP3_TAPE_STATE_NOREWIND = 0x0008; /* non-rewind device */
const NDMP3_TAPE_STATE_WR_PROT = 0x0010; /* write-protected */
const NDMP3_TAPE_STATE_ERROR = 0x0020; /* media error */
const NDMP3_TAPE_STATE_UNLOAD = 0x0040; /* tape will be unloaded when
* the device is closed */
/* invalid bit */
const NDMP3_TAPE_STATE_FILE_NUM_INVALID = 0x00000001;
const NDMP3_TAPE_STATE_SOFT_ERRORS_INVALID = 0x00000002;
const NDMP3_TAPE_STATE_BLOCK_SIZE_INVALID = 0x00000004;
const NDMP3_TAPE_STATE_BLOCKNO_INVALID = 0x00000008;
const NDMP3_TAPE_STATE_TOTAL_SPACE_INVALID = 0x00000010;
const NDMP3_TAPE_STATE_SPACE_REMAIN_INVALID = 0x00000020;
const NDMP3_TAPE_STATE_PARTITION_INVALID = 0x00000040;
struct ndmp3_tape_get_state_reply
{
u_long invalid;
ndmp3_error error;
u_long flags;
u_long file_num;
u_long soft_errors;
u_long block_size;
u_long blockno;
ndmp3_u_quad total_space;
ndmp3_u_quad space_remain;
u_long partition;
};
/* NDMP3_TAPE_MTIO */
enum ndmp3_tape_mtio_op
{
NDMP3_MTIO_FSF,
NDMP3_MTIO_BSF,
NDMP3_MTIO_FSR,
NDMP3_MTIO_BSR,
NDMP3_MTIO_REW,
NDMP3_MTIO_EOF,
NDMP3_MTIO_OFF
};
struct ndmp3_tape_mtio_request
{
ndmp3_tape_mtio_op tape_op;
u_long count;
};
struct ndmp3_tape_mtio_reply
{
ndmp3_error error;
u_long resid_count;
};
/* NDMP3_TAPE_WRITE */
struct ndmp3_tape_write_request
{
opaque data_out<>;
};
struct ndmp3_tape_write_reply
{
ndmp3_error error;
u_long count;
};
/* NDMP3_TAPE_READ */
struct ndmp3_tape_read_request
{
u_long count;
};
struct ndmp3_tape_read_reply
{
ndmp3_error error;
opaque data_in<>;
};
/* NDMP3_TAPE_EXECUTE_CDB */
typedef ndmp3_execute_cdb_request ndmp3_tape_execute_cdb_request;
typedef ndmp3_execute_cdb_reply ndmp3_tape_execute_cdb_reply;
/********************************/
/* MOVER INTERFACE */
/********************************/
/* NDMP3_MOVER_GET_STATE */
enum ndmp3_mover_state
{
NDMP3_MOVER_STATE_IDLE,
NDMP3_MOVER_STATE_LISTEN,
NDMP3_MOVER_STATE_ACTIVE,
NDMP3_MOVER_STATE_PAUSED,
NDMP3_MOVER_STATE_HALTED
};
enum ndmp3_mover_pause_reason
{
NDMP3_MOVER_PAUSE_NA,
NDMP3_MOVER_PAUSE_EOM,
NDMP3_MOVER_PAUSE_EOF,
NDMP3_MOVER_PAUSE_SEEK,
NDMP3_MOVER_PAUSE_MEDIA_ERROR,
NDMP3_MOVER_PAUSE_EOW
};
enum ndmp3_mover_halt_reason
{
NDMP3_MOVER_HALT_NA,
NDMP3_MOVER_HALT_CONNECT_CLOSED,
NDMP3_MOVER_HALT_ABORTED,
NDMP3_MOVER_HALT_INTERNAL_ERROR,
NDMP3_MOVER_HALT_CONNECT_ERROR
};
/* mover address */
enum ndmp3_mover_mode
{
NDMP3_MOVER_MODE_READ, /* read from data connection; write to tape */
NDMP3_MOVER_MODE_WRITE /* write to data connection; read from tape */
};
struct ndmp3_tcp_addr
{
u_long ip_addr;
u_short port;
};
struct ndmp3_fc_addr
{
u_long loop_id;
};
struct ndmp3_ipc_addr
{
opaque comm_data<>;
};
union ndmp3_addr switch (ndmp3_addr_type addr_type)
{
case NDMP3_ADDR_LOCAL:
void;
case NDMP3_ADDR_TCP:
ndmp3_tcp_addr tcp_addr;
case NDMP3_ADDR_FC:
ndmp3_fc_addr fc_addr;
case NDMP3_ADDR_IPC:
ndmp3_ipc_addr ipc_addr;
};
/* no request arguments */
struct ndmp3_mover_get_state_reply
{
ndmp3_error error;
ndmp3_mover_state state;
ndmp3_mover_pause_reason pause_reason;
ndmp3_mover_halt_reason halt_reason;
u_long record_size;
u_long record_num;
ndmp3_u_quad data_written;
ndmp3_u_quad seek_position;
ndmp3_u_quad bytes_left_to_read;
ndmp3_u_quad window_offset;
ndmp3_u_quad window_length;
ndmp3_addr data_connection_addr;
};
/* NDMP3_MOVER_LISTEN */
struct ndmp3_mover_listen_request
{
ndmp3_mover_mode mode;
ndmp3_addr_type addr_type;
};
struct ndmp3_mover_listen_reply
{
ndmp3_error error;
ndmp3_addr data_connection_addr;
};
/* NDMP3_MOVER_CONNECT */
struct ndmp3_mover_connect_request
{
ndmp3_mover_mode mode;
ndmp3_addr addr;
};
struct ndmp3_mover_connect_reply
{
ndmp3_error error;
};
/* NDMP3_MOVER_SET_RECORD_SIZE */
struct ndmp3_mover_set_record_size_request
{
u_long len;
};
struct ndmp3_mover_set_record_size_reply
{
ndmp3_error error;
};
/* NDMP3_MOVER_SET_WINDOW */
struct ndmp3_mover_set_window_request
{
ndmp3_u_quad offset;
ndmp3_u_quad length;
};
struct ndmp3_mover_set_window_reply
{
ndmp3_error error;
};
/* NDMP3_MOVER_CONTINUE */
/* no request arguments */
struct ndmp3_mover_continue_reply
{
ndmp3_error error;
};
/* NDMP3_MOVER_ABORT */
/* no request arguments */
struct ndmp3_mover_abort_reply
{
ndmp3_error error;
};
/* NDMP3_MOVER_STOP */
/* no request arguments */
struct ndmp3_mover_stop_reply
{
ndmp3_error error;
};
/* NDMP3_MOVER_READ */
struct ndmp3_mover_read_request
{
ndmp3_u_quad offset;
ndmp3_u_quad length;
};
struct ndmp3_mover_read_reply
{
ndmp3_error error;
};
/* NDMP3_MOVER_CLOSE */
/* no request arguments */
struct ndmp3_mover_close_reply
{
ndmp3_error error;
};
/********************************/
/* DATA INTERFACE */
/********************************/
/* NDMP3_DATA_GET_STATE */
/* no request arguments */
enum ndmp3_data_operation
{
NDMP3_DATA_OP_NOACTION,
NDMP3_DATA_OP_BACKUP,
NDMP3_DATA_OP_RESTORE,
NDMP3_DATA_OP_RESTORE_FILEHIST
};
enum ndmp3_data_state
{
NDMP3_DATA_STATE_IDLE,
NDMP3_DATA_STATE_ACTIVE,
NDMP3_DATA_STATE_HALTED,
NDMP3_DATA_STATE_LISTEN,
NDMP3_DATA_STATE_CONNECTED
};
enum ndmp3_data_halt_reason
{
NDMP3_DATA_HALT_NA,
NDMP3_DATA_HALT_SUCCESSFUL,
NDMP3_DATA_HALT_ABORTED,
NDMP3_DATA_HALT_INTERNAL_ERROR,
NDMP3_DATA_HALT_CONNECT_ERROR
};
/* invalid bit */
const NDMP3_DATA_STATE_EST_BYTES_REMAIN_INVALID = 0x00000001;
const NDMP3_DATA_STATE_EST_TIME_REMAIN_INVALID = 0x00000002;
struct ndmp3_data_get_state_reply
{
u_long invalid;
ndmp3_error error;
ndmp3_data_operation operation;
ndmp3_data_state state;
ndmp3_data_halt_reason halt_reason;
ndmp3_u_quad bytes_processed;
ndmp3_u_quad est_bytes_remain;
u_long est_time_remain;
ndmp3_addr data_connection_addr;
ndmp3_u_quad read_offset;
ndmp3_u_quad read_length;
};
/* NDMP3_DATA_START_BACKUP */
struct ndmp3_data_start_backup_request
{
string bu_type<>; /* backup method to use */
ndmp3_pval env<>; /* Parameters that may modify backup */
};
struct ndmp3_data_start_backup_reply
{
ndmp3_error error;
};
/* NDMP3_DATA_START_RECOVER */
struct ndmp3_name
{
string original_path<>;
string destination_dir<>;
string new_name<>; /* Direct access restore only */
string other_name<>; /* Direct access restore only */
ndmp3_u_quad node; /* Direct access restore only */
ndmp3_u_quad fh_info; /* Direct access restore only */
};
struct ndmp3_data_start_recover_request
{
ndmp3_pval env<>;
ndmp3_name nlist<>;
string bu_type<>;
};
struct ndmp3_data_start_recover_reply
{
ndmp3_error error;
};
/* NDMP3_DATA_START_RECOVER_FILEHIST */
typedef ndmp3_data_start_recover_request ndmp3_data_start_recover_filehist_request;
typedef ndmp3_data_start_recover_reply ndmp3_data_start_recover_filehist_reply;
/* NDMP3_DATA_ABORT */
/* no request arguments */
struct ndmp3_data_abort_reply
{
ndmp3_error error;
};
/* NDMP3_DATA_STOP */
/* no request arguments */
struct ndmp3_data_stop_reply
{
ndmp3_error error;
};
/* NDMP3_DATA_GET_ENV */
/* no request arguments */
struct ndmp3_data_get_env_reply
{
ndmp3_error error;
ndmp3_pval env<>;
};
/* NDMP3_DATA_LISTEN */
struct ndmp3_data_listen_request
{
ndmp3_addr_type addr_type;
};
struct ndmp3_data_listen_reply
{
ndmp3_error error;
ndmp3_addr data_connection_addr;
};
/* NDMP3_DATA_CONNECT */
struct ndmp3_data_connect_request
{
ndmp3_addr addr;
};
struct ndmp3_data_connect_reply
{
ndmp3_error error;
};
/****************************************/
/* NOTIFY INTERFACE */
/****************************************/
/* NDMP3_NOTIFY_DATA_HALTED */
struct ndmp3_notify_data_halted_request
{
ndmp3_data_halt_reason reason;
string text_reason<>;
};
/* NDMP3_NOTIFY_CONNECTED */
enum ndmp3_connect_reason
{
NDMP3_CONNECTED, /* Connect sucessfully */
NDMP3_SHUTDOWN, /* Connection shutdown */
NDMP3_REFUSED /* reach the maximum number of connections */
};
struct ndmp3_notify_connected_request
{
ndmp3_connect_reason reason;
u_short protocol_version;
string text_reason<>;
};
/* NDMP3_NOTIFY_MOVER_PAUSED */
struct ndmp3_notify_mover_paused_request
{
ndmp3_mover_pause_reason reason;
ndmp3_u_quad seek_position;
};
/* No reply */
/* NDMP3_NOTIFY_MOVER_HALTED */
struct ndmp3_notify_mover_halted_request
{
ndmp3_mover_halt_reason reason;
string text_reason<>;
};
/* No reply */
/* NDMP3_NOTIFY_DATA_READ */
struct ndmp3_notify_data_read_request
{
ndmp3_u_quad offset;
ndmp3_u_quad length;
};
/* No reply */
/********************************/
/* LOG INTERFACE */
/********************************/
/* NDMP3_LOG_MESSAGE */
enum ndmp3_log_type
{
NDMP3_LOG_NORMAL,
NDMP3_LOG_DEBUG,
NDMP3_LOG_ERROR,
NDMP3_LOG_WARNING
};
struct ndmp3_log_message_request
{
ndmp3_log_type log_type;
u_long message_id;
string entry<>;
};
/* No reply */
/* NDMP3_LOG_FILE */
struct ndmp3_log_file_request
{
string name<>;
ndmp3_error error;
};
/* No reply */