Imported Upstream version 3.1.0
[debian/amanda] / ndmp-src / ndmp2.x
1 /*
2  * Copyright (c) 2000
3  *      Traakan, Inc., Los Altos, CA
4  *      All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice unmodified, this list of conditions, and the following
11  *    disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28
29 /*
30  * Project:  NDMJOB
31  * Ident:    $Id: $
32  *
33  * Description:
34  *
35  */
36
37
38 /*
39  * Copyright (c) 1997 Network Appliance. All Rights Reserved.
40  *
41  * Network Appliance makes no representations concerning either
42  * the merchantability of this software or the suitability of this
43  * software for any particular purpose. It is provided "as is"
44  * without express or implied warranty of any kind.
45  *
46  * These notices must be retained in any copies of any part of this
47  * documentation and/or software.
48  *
49  */
50
51 %#ifndef NDMOS_OPTION_NO_NDMP2
52
53 const NDMP2VER = 2;
54 const NDMP2PORT = 10000;
55
56 %#define ndmp2_u_quad unsigned long long
57 %extern bool_t xdr_ndmp2_u_quad();
58
59 struct _ndmp2_u_quad
60 {
61         u_long          high;
62         u_long          low;
63 };
64
65 struct ndmp2_pval
66 {
67         string          name<>;
68         string          value<>;
69 };
70
71 struct ndmp2_scsi_device
72 {
73         string          name<>;
74 };
75
76 struct ndmp2_tape_device
77 {
78         string          name<>;
79 };
80
81 enum ndmp2_error
82 {
83         NDMP2_NO_ERR,                   /* No error */
84         NDMP2_NOT_SUPPORTED_ERR,        /* Call is not supported */
85         NDMP2_DEVICE_BUSY_ERR,          /* The device is in use */
86         NDMP2_DEVICE_OPENED_ERR,        /* Another tape or scsi device
87                                          * is already open */
88         NDMP2_NOT_AUTHORIZED_ERR,       /* connection has not been authorized*/
89         NDMP2_PERMISSION_ERR,           /* some sort of permission problem */
90         NDMP2_DEV_NOT_OPEN_ERR,         /* SCSI device is not open */
91         NDMP2_IO_ERR,                   /* I/O error */
92         NDMP2_TIMEOUT_ERR,              /* command timed out */
93         NDMP2_ILLEGAL_ARGS_ERR,         /* illegal arguments in request */
94         NDMP2_NO_TAPE_LOADED_ERR,       /* Cannot open because there is
95                                            no tape loaded */
96         NDMP2_WRITE_PROTECT_ERR,        /* tape cannot be open for write */
97         NDMP2_EOF_ERR,                  /* Command encountered EOF */
98         NDMP2_EOM_ERR,                  /* Command encountered EOM */
99         NDMP2_FILE_NOT_FOUND_ERR,       /* File not found during restore */
100         NDMP2_BAD_FILE_ERR,             /* The file descriptor is invalid */
101         NDMP2_NO_DEVICE_ERR,            /* The device is not at that target */
102         NDMP2_NO_BUS_ERR,               /* Invalid controller */
103         NDMP2_XDR_DECODE_ERR,           /* Can't decode the request argument */
104         NDMP2_ILLEGAL_STATE_ERR,        /* Call can't be done at this state */
105         NDMP2_UNDEFINED_ERR,            /* Undefined Error */
106         NDMP2_XDR_ENCODE_ERR,           /* Can't encode the reply argument */
107         NDMP2_NO_MEM_ERR                /* no memory */
108 };
109
110 enum ndmp2_header_message_type
111 {
112         NDMP2_MESSAGE_REQUEST,
113         NDMP2_MESSAGE_REPLY
114 };
115
116 enum ndmp2_message
117 {
118         NDMP2_CONNECT_OPEN = 0x900,     /* CONNECT INTERFACE */
119         NDMP2_CONNECT_CLIENT_AUTH,
120         NDMP2_CONNECT_CLOSE,
121         NDMP2_CONNECT_SERVER_AUTH,
122
123         NDMP2_CONFIG_GET_HOST_INFO = 0x100, /* CONFIG INTERFACE */
124         NDMP2_CONFIG_GET_BUTYPE_ATTR,
125         NDMP2_CONFIG_GET_MOVER_TYPE,
126         NDMP2_CONFIG_GET_AUTH_ATTR,
127
128         NDMP2_SCSI_OPEN = 0x200,        /* SCSI INTERFACE */
129         NDMP2_SCSI_CLOSE,
130         NDMP2_SCSI_GET_STATE,
131         NDMP2_SCSI_SET_TARGET,
132         NDMP2_SCSI_RESET_DEVICE,
133         NDMP2_SCSI_RESET_BUS,
134         NDMP2_SCSI_EXECUTE_CDB,
135
136         NDMP2_TAPE_OPEN = 0x300,        /* TAPE INTERFACE */
137         NDMP2_TAPE_CLOSE,
138         NDMP2_TAPE_GET_STATE,
139         NDMP2_TAPE_MTIO,
140         NDMP2_TAPE_WRITE,
141         NDMP2_TAPE_READ,
142         NDMP2_TAPE_RESVD1,
143         NDMP2_TAPE_EXECUTE_CDB,
144
145         NDMP2_DATA_GET_STATE = 0x400,   /* DATA INTERFACE */
146         NDMP2_DATA_START_BACKUP,
147         NDMP2_DATA_START_RECOVER,
148         NDMP2_DATA_ABORT,
149         NDMP2_DATA_GET_ENV,
150         NDMP2_DATA_RESVD1,
151         NDMP2_DATA_RESVD2,
152         NDMP2_DATA_STOP,
153         NDMP2_DATA_START_RECOVER_FILEHIST = 0x40b, /* same as V3.1 */
154
155         NDMP2_NOTIFY_RESVD1 = 0x500,    /* NOTIFY INTERFACE */
156         NDMP2_NOTIFY_DATA_HALTED,
157         NDMP2_NOTIFY_CONNECTED,
158         NDMP2_NOTIFY_MOVER_HALTED,
159         NDMP2_NOTIFY_MOVER_PAUSED,
160         NDMP2_NOTIFY_DATA_READ,
161
162         NDMP2_LOG_LOG = 0x600,          /* LOGGING INTERFACE */
163         NDMP2_LOG_DEBUG,
164         NDMP2_LOG_FILE,
165
166         NDMP2_FH_ADD_UNIX_PATH = 0x700, /* FILE HISTORY INTERFACE */
167         NDMP2_FH_ADD_UNIX_DIR,
168         NDMP2_FH_ADD_UNIX_NODE,
169
170         NDMP2_MOVER_GET_STATE = 0xa00,  /* MOVER INTERFACE */
171         NDMP2_MOVER_LISTEN,
172         NDMP2_MOVER_CONTINUE,
173         NDMP2_MOVER_ABORT,
174         NDMP2_MOVER_STOP,
175         NDMP2_MOVER_SET_WINDOW,
176         NDMP2_MOVER_READ,
177         NDMP2_MOVER_CLOSE,
178         NDMP2_MOVER_SET_RECORD_SIZE,
179
180         NDMP2_RESERVED = 0xff00         /* Reserved for prototyping */
181 };
182
183 struct ndmp2_header
184 {
185         u_long                  sequence;       /* monotonically increasing */
186         u_long                  time_stamp;     /* time stamp of message */
187         ndmp2_header_message_type message_type; /* what type of message */
188         ndmp2_message           message;        /* message number */
189         u_long                  reply_sequence; /* reply is in response to */
190         ndmp2_error             error;          /* communications errors */
191 };
192
193 /**********************/
194 /*  CONNECT INTERFACE */
195 /**********************/
196 /* NDMP2_CONNECT_OPEN */
197 struct ndmp2_connect_open_request
198 {
199         u_short protocol_version;       /* the version of protocol supported */
200 };
201
202 struct ndmp2_connect_open_reply
203 {
204         ndmp2_error     error;
205 };
206
207 /* NDMP2_CONNECT_CLIENT_AUTH */
208 enum ndmp2_auth_type
209 {
210         NDMP2_AUTH_NONE,                /* no password is required */
211         NDMP2_AUTH_TEXT,                /* the clear text password */
212         NDMP2_AUTH_MD5                  /* md5 */
213 };
214
215 struct ndmp2_auth_text
216 {
217         string          auth_id<>;
218         string          auth_password<>;
219 };
220
221 struct ndmp2_auth_md5
222 {
223         string          auth_id<>;
224         opaque          auth_digest[16];
225 };
226
227 union ndmp2_auth_data switch (enum ndmp2_auth_type auth_type)
228 {
229     case NDMP2_AUTH_NONE:
230         void;
231     case NDMP2_AUTH_TEXT:
232         ndmp2_auth_text auth_text;
233     case NDMP2_AUTH_MD5:
234         ndmp2_auth_md5  auth_md5;
235 };
236
237 struct ndmp2_connect_client_auth_request
238 {
239         ndmp2_auth_data auth_data;
240 };
241
242 struct ndmp2_connect_client_auth_reply
243 {
244         ndmp2_error     error;
245 };
246
247 /* NDMP2_CONNECT_CLOSE */
248 /* no request arguments */
249 /* no reply arguments */
250
251 /* NDMP2_CONNECT_SERVER_AUTH */
252 union ndmp2_auth_attr switch (enum ndmp2_auth_type auth_type)
253 {
254     case NDMP2_AUTH_NONE:
255         void;
256     case NDMP2_AUTH_TEXT:
257         void;
258     case NDMP2_AUTH_MD5:
259         opaque  challenge[64];
260 };
261
262 struct ndmp2_connect_server_auth_request
263 {
264         ndmp2_auth_attr client_attr;
265 };
266
267 struct ndmp2_connect_server_auth_reply
268 {
269         ndmp2_error     error;
270         ndmp2_auth_data auth_result;
271 };
272
273 /********************/
274 /* CONFIG INTERFACE */
275 /********************/
276 /* NDMP2_CONFIG_GET_HOST_INFO */
277 /* no request arguments */
278 struct ndmp2_config_get_host_info_reply
279 {
280         ndmp2_error     error;
281         string          hostname<>;     /* host name */
282         string          os_type<>;      /* The O/S type (e.g. SOLARIS) */
283         string          os_vers<>;      /* The O/S version (e.g. 2.5) */
284         string          hostid<>;
285         ndmp2_auth_type auth_type<>;
286 };
287
288 /* NDMP2_CONFIG_GET_BUTYPE_ATTR */
289 const NDMP2_NO_BACKUP_FILELIST  = 0x0001;
290 const NDMP2_NO_BACKUP_FHINFO    = 0x0002;
291 const NDMP2_NO_RECOVER_FILELIST = 0x0004;
292 const NDMP2_NO_RECOVER_FHINFO   = 0x0008;
293 const NDMP2_NO_RECOVER_RESVD    = 0x0010;
294 const NDMP2_NO_RECOVER_INC_ONLY = 0x0020;
295
296 struct ndmp2_config_get_butype_attr_request
297 {
298         string          name<>;         /* backup type name */
299 };
300
301 struct ndmp2_config_get_butype_attr_reply
302 {
303         ndmp2_error     error;
304         u_long          attrs;
305 };
306
307 /* NDMP2_CONFIG_GET_MOVER_TYPE */
308 /* no request arguments */
309 enum ndmp2_mover_addr_type
310 {
311         NDMP2_ADDR_LOCAL,
312         NDMP2_ADDR_TCP
313 };
314
315 struct ndmp2_config_get_mover_type_reply
316 {
317         ndmp2_error             error;
318         ndmp2_mover_addr_type   methods<>;
319 };
320
321 /* NDMP2_CONFIG_GET_AUTH_ATTR */
322 struct ndmp2_config_get_auth_attr_request
323 {
324         ndmp2_auth_type auth_type;
325 };
326
327 struct ndmp2_config_get_auth_attr_reply
328 {
329         ndmp2_error     error;
330         ndmp2_auth_attr server_attr;
331 };
332
333 /******************/
334 /* SCSI INTERFACE */
335 /******************/
336 /* NDMP2_SCSI_OPEN */
337 struct ndmp2_scsi_open_request
338 {
339         ndmp2_scsi_device device;
340 };
341
342 struct ndmp2_scsi_open_reply
343 {
344         ndmp2_error     error;
345 };
346
347 /* NDMP2_SCSI_CLOSE */
348 /* no request arguments */
349 struct ndmp2_scsi_close_reply
350 {
351         ndmp2_error     error;
352 };
353
354 /* NDMP2_SCSI_GET_STATE */
355 /* no request arguments */
356 struct ndmp2_scsi_get_state_reply
357 {
358         ndmp2_error     error;
359         short           target_controller;
360         short           target_id;
361         short           target_lun;
362 };
363
364 /* NDMP2_SCSI_SET_TARGET */
365 struct ndmp2_scsi_set_target_request
366 {
367         ndmp2_scsi_device device;
368         u_short         target_controller;
369         u_short         target_id;
370         u_short         target_lun;
371 };
372
373 struct ndmp2_scsi_set_target_reply
374 {
375         ndmp2_error     error;
376 };
377
378 /* NDMP2_SCSI_RESET_DEVICE */
379 /* no request arguments */
380 struct ndmp2_scsi_reset_device_reply
381 {
382         ndmp2_error     error;
383 };
384
385 /* NDMP2_SCSI_RESET_BUS */
386 /* no request arguments */
387 struct ndmp2_scsi_reset_bus_reply
388 {
389         ndmp2_error     error;
390 };
391
392 /* NDMP2_SCSI_EXECUTE_CDB */
393 const NDMP2_SCSI_DATA_IN  = 0x00000001; /* Expect data from SCSI device */
394 const NDMP2_SCSI_DATA_OUT = 0x00000002; /* Transfer data to SCSI device */
395
396 struct ndmp2_execute_cdb_request
397 {
398         u_long          flags;
399         u_long          timeout;
400         u_long          datain_len;     /* Set for expected datain */
401         opaque          cdb<>;
402         opaque          dataout<>;
403 };
404
405 struct ndmp2_execute_cdb_reply
406 {
407         ndmp2_error     error;
408         u_char          status;         /* SCSI status bytes */
409         u_long          dataout_len;
410         opaque          datain<>;       /* SCSI datain */
411         opaque          ext_sense<>;    /* Extended sense data */
412 };
413 typedef ndmp2_execute_cdb_request       ndmp2_scsi_execute_cdb_request;
414 typedef ndmp2_execute_cdb_reply         ndmp2_scsi_execute_cdb_reply;
415
416
417 /******************/
418 /* TAPE INTERFACE */
419 /******************/
420 /* NDMP2_TAPE_OPEN */
421 enum ndmp2_tape_open_mode
422 {
423         NDMP2_TAPE_READ_MODE,
424         NDMP2_TAPE_WRITE_MODE
425 };
426
427 struct ndmp2_tape_open_request
428 {
429         ndmp2_tape_device       device;
430         ndmp2_tape_open_mode    mode;
431 };
432
433 struct ndmp2_tape_open_reply
434 {
435         ndmp2_error     error;
436 };
437
438 /* NDMP2_TAPE_CLOSE */
439 /* no request arguments */
440 struct ndmp2_tape_close_reply
441 {
442         ndmp2_error     error;
443 };
444
445 /* NDMP2_TAPE_GET_STATE */
446 /* no request arguments */
447 const NDMP2_TAPE_NOREWIND = 0x0008;     /* non-rewind device */
448 const NDMP2_TAPE_WR_PROT  = 0x0010;     /* write-protected */
449 const NDMP2_TAPE_ERROR    = 0x0020;     /* media error */
450 const NDMP2_TAPE_UNLOAD   = 0x0040;     /* tape will be unloaded when
451                                          * the device is closed */
452 struct ndmp2_tape_get_state_reply
453 {
454         ndmp2_error     error;
455         u_long          flags;
456         u_long          file_num;
457         u_long          soft_errors;
458         u_long          block_size;
459         u_long          blockno;
460         ndmp2_u_quad    total_space;
461         ndmp2_u_quad    space_remain;
462 };
463
464 /* NDMP2_TAPE_MTIO */
465 enum ndmp2_tape_mtio_op
466 {
467         NDMP2_MTIO_FSF,
468         NDMP2_MTIO_BSF,
469         NDMP2_MTIO_FSR,
470         NDMP2_MTIO_BSR,
471         NDMP2_MTIO_REW,
472         NDMP2_MTIO_EOF,
473         NDMP2_MTIO_OFF
474 };
475
476 struct ndmp2_tape_mtio_request
477 {
478         ndmp2_tape_mtio_op      tape_op;
479         u_long                  count;
480 };
481
482 struct ndmp2_tape_mtio_reply
483 {
484         ndmp2_error     error;
485         u_long          resid_count;
486 };
487
488 /* NDMP2_TAPE_WRITE */
489 struct ndmp2_tape_write_request
490 {
491         opaque          data_out<>;
492 };
493
494 struct ndmp2_tape_write_reply
495 {
496         ndmp2_error     error;
497         u_long          count;
498 };
499
500 /* NDMP2_TAPE_READ */
501 struct ndmp2_tape_read_request
502 {
503         u_long          count;
504 };
505
506 struct ndmp2_tape_read_reply
507 {
508         ndmp2_error     error;
509         opaque          data_in<>;
510 };
511
512 /* NDMP2_TAPE_EXECUTE_CDB */
513 typedef ndmp2_execute_cdb_request       ndmp2_tape_execute_cdb_request;
514 typedef ndmp2_execute_cdb_reply         ndmp2_tape_execute_cdb_reply;
515
516 /********************************/
517 /* MOVER INTERFACE              */
518 /********************************/
519 /* NDMP2_MOVER_GET_STATE */
520 enum ndmp2_mover_state
521 {
522         NDMP2_MOVER_STATE_IDLE,
523         NDMP2_MOVER_STATE_LISTEN,
524         NDMP2_MOVER_STATE_ACTIVE,
525         NDMP2_MOVER_STATE_PAUSED,
526         NDMP2_MOVER_STATE_HALTED
527 };
528
529 enum ndmp2_mover_pause_reason
530 {
531         NDMP2_MOVER_PAUSE_NA,
532         NDMP2_MOVER_PAUSE_EOM,
533         NDMP2_MOVER_PAUSE_EOF,
534         NDMP2_MOVER_PAUSE_SEEK,
535         NDMP2_MOVER_PAUSE_MEDIA_ERROR
536 };
537
538 enum ndmp2_mover_halt_reason
539 {
540         NDMP2_MOVER_HALT_NA,
541         NDMP2_MOVER_HALT_CONNECT_CLOSED,
542         NDMP2_MOVER_HALT_ABORTED,
543         NDMP2_MOVER_HALT_INTERNAL_ERROR,
544         NDMP2_MOVER_HALT_CONNECT_ERROR
545 };
546
547 /* no request arguments */
548 struct ndmp2_mover_get_state_reply
549 {
550         ndmp2_error             error;
551         ndmp2_mover_state       state;
552         ndmp2_mover_pause_reason pause_reason;
553         ndmp2_mover_halt_reason halt_reason;
554         u_long                  record_size;
555         u_long                  record_num;
556         ndmp2_u_quad            data_written;
557         ndmp2_u_quad            seek_position;
558         ndmp2_u_quad            bytes_left_to_read;
559         ndmp2_u_quad            window_offset;
560         ndmp2_u_quad            window_length;
561 };
562
563 /* NDMP2_MOVER_LISTEN */
564 enum ndmp2_mover_mode
565 {
566         NDMP2_MOVER_MODE_READ,  /* read from data conn; write to tape */
567         NDMP2_MOVER_MODE_WRITE, /* write to data conn; read from tape */
568         NDMP2_MOVER_MODE_DATA   /* write to data conn; read from data conn */
569 };
570
571 struct ndmp2_mover_tcp_addr
572 {
573         u_long          ip_addr;
574         u_short         port;
575 };
576
577 union ndmp2_mover_addr switch (ndmp2_mover_addr_type addr_type)
578 {
579     case NDMP2_ADDR_LOCAL:
580         void;
581     case NDMP2_ADDR_TCP:
582         ndmp2_mover_tcp_addr    addr;
583 };
584
585 struct ndmp2_mover_listen_request
586 {
587         ndmp2_mover_mode        mode;
588         ndmp2_mover_addr_type   addr_type;
589 };
590
591 struct ndmp2_mover_listen_reply
592 {
593         ndmp2_error             error;
594         ndmp2_mover_addr        mover;
595 };
596
597 /* NDMP2_MOVER_SET_RECORD_SIZE */
598 struct ndmp2_mover_set_record_size_request
599 {
600         u_long          len;
601 };
602
603 struct ndmp2_mover_set_record_size_reply
604 {
605         ndmp2_error     error;
606 };
607
608 /* NDMP2_MOVER_SET_WINDOW */
609 struct ndmp2_mover_set_window_request
610 {
611         ndmp2_u_quad    offset;
612         ndmp2_u_quad    length;
613 };
614
615 struct ndmp2_mover_set_window_reply
616 {
617         ndmp2_error     error;
618 };
619
620 /* NDMP2_MOVER_CONTINUE */
621 /* no request arguments */
622 struct ndmp2_mover_continue_reply
623 {
624         ndmp2_error     error;
625 };
626
627 /* NDMP2_MOVER_ABORT */
628 /* no request arguments */
629 struct ndmp2_mover_abort_reply
630 {
631         ndmp2_error     error;
632 };
633
634 /* NDMP2_MOVER_STOP */
635 /* no request arguments */
636 struct ndmp2_mover_stop_reply
637 {
638         ndmp2_error     error;
639 };
640
641 /* NDMP2_MOVER_READ */
642 struct ndmp2_mover_read_request
643 {
644         ndmp2_u_quad    offset;
645         ndmp2_u_quad    length;
646 };
647
648 struct ndmp2_mover_read_reply
649 {
650         ndmp2_error     error;
651 };
652
653 /* NDMP2_MOVER_CLOSE */
654 /* no request arguments */
655 struct ndmp2_mover_close_reply
656 {
657         ndmp2_error     error;
658 };
659
660 /****************************/
661 /* DATA INTERFACE           */
662 /****************************/
663 /* NDMP2_DATA_GET_STATE */
664 /* no request arguments */
665 enum ndmp2_data_operation
666 {
667         NDMP2_DATA_OP_NOACTION,
668         NDMP2_DATA_OP_BACKUP,
669         NDMP2_DATA_OP_RESTORE,
670         NDMP2_DATA_OP_RESTORE_FILEHIST
671 };
672
673 enum ndmp2_data_state
674 {
675         NDMP2_DATA_STATE_IDLE,
676         NDMP2_DATA_STATE_ACTIVE,
677         NDMP2_DATA_STATE_HALTED
678 };
679
680 enum ndmp2_data_halt_reason
681 {
682         NDMP2_DATA_HALT_NA,
683         NDMP2_DATA_HALT_SUCCESSFUL,
684         NDMP2_DATA_HALT_ABORTED,
685         NDMP2_DATA_HALT_INTERNAL_ERROR,
686         NDMP2_DATA_HALT_CONNECT_ERROR
687 };
688
689 struct ndmp2_data_get_state_reply
690 {
691         ndmp2_error             error;
692         ndmp2_data_operation    operation;
693         ndmp2_data_state        state;
694         ndmp2_data_halt_reason  halt_reason;
695         ndmp2_u_quad            bytes_processed;
696         ndmp2_u_quad            est_bytes_remain;
697         u_long                  est_time_remain;
698         ndmp2_mover_addr        mover;
699         ndmp2_u_quad            read_offset;
700         ndmp2_u_quad            read_length;
701 };
702
703 /* NDMP2_DATA_START_BACKUP */
704 struct ndmp2_data_start_backup_request
705 {
706         ndmp2_mover_addr mover;         /* mover to receive data */
707         string          bu_type<>;      /* backup method to use */
708         ndmp2_pval      env<>;          /* Parameters that may modify backup */
709 };
710
711 struct ndmp2_data_start_backup_reply
712 {
713         ndmp2_error     error;
714 };
715
716 /* NDMP2_DATA_START_RECOVER */
717 struct ndmp2_name
718 {
719         string          name<>;
720         string          dest<>;
721         u_short         ssid;
722         ndmp2_u_quad    fh_info;
723 };
724
725 struct ndmp2_data_start_recover_request
726 {
727         ndmp2_mover_addr mover;
728         ndmp2_pval      env<>;
729         ndmp2_name      nlist<>;
730         string          bu_type<>;
731 };
732
733 struct ndmp2_data_start_recover_reply
734 {
735         ndmp2_error     error;
736 };
737
738 /* NDMP2_DATA_START_RECOVER_FILEHIST */
739 typedef ndmp2_data_start_recover_request ndmp2_data_start_recover_filehist_request;
740 typedef ndmp2_data_start_recover_reply ndmp2_data_start_recover_filehist_reply;
741
742 /* NDMP2_DATA_ABORT */
743 /* no request arguments */
744 struct ndmp2_data_abort_reply
745 {
746         ndmp2_error     error;
747 };
748
749 /* NDMP2_DATA_STOP */
750 /* no request arguments */
751 struct ndmp2_data_stop_reply
752 {
753         ndmp2_error     error;
754 };
755
756 /* NDMP2_DATA_GET_ENV */
757 /* no request arguments */
758 struct ndmp2_data_get_env_reply
759 {
760         ndmp2_error     error;
761         ndmp2_pval      env<>;
762 };
763
764 /****************************/
765 /* NOTIFY INTERFACE         */
766 /****************************/
767 /* NDMP2_NOTIFY_DATA_HALTED */
768 struct ndmp2_notify_data_halted_request
769 {
770         ndmp2_data_halt_reason  reason;
771         string                  text_reason<>;
772 };
773
774 /* No reply */
775
776 /* NDMP2_NOTIFY_CONNECTED */
777 enum ndmp2_connect_reason
778 {
779         NDMP2_CONNECTED,        /* Connect sucessfully */
780         NDMP2_SHUTDOWN,         /* Connection shutdown */
781         NDMP2_REFUSED           /* reach the maximum number of connections */
782 };
783
784 struct ndmp2_notify_connected_request
785 {
786         ndmp2_connect_reason    reason;
787         u_short                 protocol_version;
788         string                  text_reason<>;
789 };
790
791 /* NDMP2_NOTIFY_MOVER_PAUSED */
792 struct ndmp2_notify_mover_paused_request
793 {
794         ndmp2_mover_pause_reason reason;
795         ndmp2_u_quad            seek_position;
796 };
797 /* No reply */
798
799 /* NDMP2_NOTIFY_MOVER_HALTED */
800 struct ndmp2_notify_mover_halted_request
801 {
802         ndmp2_mover_halt_reason reason;
803         string                  text_reason<>;
804 };
805 /* No reply */
806
807 /* NDMP2_NOTIFY_DATA_READ */
808 struct ndmp2_notify_data_read_request
809 {
810         ndmp2_u_quad    offset;
811         ndmp2_u_quad    length;
812 };
813 /* No reply */
814
815 /********************************/
816 /* LOG INTERFACE                                */
817 /********************************/
818 /* NDMP2_LOG_LOG */
819 struct ndmp2_log_log_request
820 {
821         string          entry<>;
822 };
823 /* No reply */
824
825 /* NDMP2_LOG_DEBUG */
826 enum ndmp2_debug_level
827 {
828         NDMP2_DBG_USER_INFO,
829         NDMP2_DBG_USER_SUMMARY,
830         NDMP2_DBG_USER_DETAIL,
831         NDMP2_DBG_DIAG_INFO,
832         NDMP2_DBG_DIAG_SUMMARY,
833         NDMP2_DBG_DIAG_DETAIL,
834         NDMP2_DBG_PROG_INFO,
835         NDMP2_DBG_PROG_SUMMARY,
836         NDMP2_DBG_PROG_DETAIL
837 };
838
839 struct ndmp2_log_debug_request
840 {
841         ndmp2_debug_level level;
842         string          message<>;
843 };
844 /* No reply */
845
846 /* NDMP2_LOG_FILE */
847 struct ndmp2_log_file_request
848 {
849         string          name<>;
850         u_short         ssid;
851         ndmp2_error     error;
852 };
853 /* No reply */
854
855 /********************************/
856 /* File History INTERFACE           */
857 /********************************/
858 /* NDMP2_FH_ADD_UNIX_PATH */
859 typedef string ndmp2_unix_path<>;
860 enum ndmp2_unix_file_type
861 {
862         NDMP2_FILE_DIR,
863         NDMP2_FILE_FIFO,
864         NDMP2_FILE_CSPEC,
865         NDMP2_FILE_BSPEC,
866         NDMP2_FILE_REG,
867         NDMP2_FILE_SLINK,
868         NDMP2_FILE_SOCK
869 };
870
871 struct ndmp2_unix_file_stat
872 {
873         ndmp2_unix_file_type    ftype;
874         u_long                  mtime;
875         u_long                  atime;
876         u_long                  ctime;
877         u_long                  uid;
878         u_long                  gid;
879         u_long                  mode;
880         ndmp2_u_quad            size;
881         ndmp2_u_quad            fh_info;
882 };
883
884 struct ndmp2_fh_unix_path
885 {
886         ndmp2_unix_path         name;
887         ndmp2_unix_file_stat    fstat;
888 };
889
890 struct ndmp2_fh_add_unix_path_request
891 {
892         ndmp2_fh_unix_path      paths<>;
893 };
894 /* No reply */
895
896 /* NDMP2_FH_ADD_UNIX_DIR */
897 struct ndmp2_fh_unix_dir
898 {
899         ndmp2_unix_path         name;
900         u_long                  node;
901         u_long                  parent;
902 };
903
904 struct ndmp2_fh_add_unix_dir_request
905 {
906         ndmp2_fh_unix_dir       dirs<>;
907 };
908 /* No reply */
909
910 struct ndmp2_fh_unix_node
911 {
912         ndmp2_unix_file_stat    fstat;
913         u_long                  node;
914 };
915
916 struct ndmp2_fh_add_unix_node_request
917 {
918         ndmp2_fh_unix_node      nodes<>;
919 };
920 /* No reply */
921
922
923 /****************************************************************
924 *
925 *       End of file     :       ndmp.x
926 *
927 ****************************************************************/
928 %#endif /* !NDMOS_OPTION_NO_NDMP2 */