Imported Upstream version 3.1.0
[debian/amanda] / ndmp-src / ndmp4_enum_strs.c
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 #include "ndmos.h"              /* rpc/rpc.h */
39 #include "ndmprotocol.h"
40
41
42 #ifndef NDMOS_OPTION_NO_NDMP4
43
44
45 extern struct ndmp_enum_str_table ndmp4_error_table[];
46 extern char * ndmp4_error_to_str (ndmp4_error val);
47 extern int    ndmp4_error_from_str (ndmp4_error *valp, char *str);
48
49 char * ndmp4_error_to_str (ndmp4_error val) {
50         return ndmp_enum_to_str ((int)val, ndmp4_error_table);
51 }
52
53 int ndmp4_error_from_str (ndmp4_error *valp, char *str) {
54         return ndmp_enum_from_str ((int*)valp, str, ndmp4_error_table);
55 }
56
57 struct ndmp_enum_str_table ndmp4_error_table[] = {
58         { "NDMP4_NO_ERR",               NDMP4_NO_ERR, },
59         { "NDMP4_NOT_SUPPORTED_ERR",    NDMP4_NOT_SUPPORTED_ERR, },
60         { "NDMP4_DEVICE_BUSY_ERR",      NDMP4_DEVICE_BUSY_ERR, },
61         { "NDMP4_DEVICE_OPENED_ERR",    NDMP4_DEVICE_OPENED_ERR, },
62         { "NDMP4_NOT_AUTHORIZED_ERR",   NDMP4_NOT_AUTHORIZED_ERR, },
63         { "NDMP4_PERMISSION_ERR",       NDMP4_PERMISSION_ERR, },
64         { "NDMP4_DEV_NOT_OPEN_ERR",     NDMP4_DEV_NOT_OPEN_ERR, },
65         { "NDMP4_IO_ERR",               NDMP4_IO_ERR, },
66         { "NDMP4_TIMEOUT_ERR",          NDMP4_TIMEOUT_ERR, },
67         { "NDMP4_ILLEGAL_ARGS_ERR",     NDMP4_ILLEGAL_ARGS_ERR, },
68         { "NDMP4_NO_TAPE_LOADED_ERR",   NDMP4_NO_TAPE_LOADED_ERR, },
69         { "NDMP4_WRITE_PROTECT_ERR",    NDMP4_WRITE_PROTECT_ERR, },
70         { "NDMP4_EOF_ERR",              NDMP4_EOF_ERR, },
71         { "NDMP4_EOM_ERR",              NDMP4_EOM_ERR, },
72         { "NDMP4_FILE_NOT_FOUND_ERR",   NDMP4_FILE_NOT_FOUND_ERR, },
73         { "NDMP4_BAD_FILE_ERR",         NDMP4_BAD_FILE_ERR, },
74         { "NDMP4_NO_DEVICE_ERR",        NDMP4_NO_DEVICE_ERR, },
75         { "NDMP4_NO_BUS_ERR",           NDMP4_NO_BUS_ERR, },
76         { "NDMP4_XDR_DECODE_ERR",       NDMP4_XDR_DECODE_ERR, },
77         { "NDMP4_ILLEGAL_STATE_ERR",    NDMP4_ILLEGAL_STATE_ERR, },
78         { "NDMP4_UNDEFINED_ERR",        NDMP4_UNDEFINED_ERR, },
79         { "NDMP4_XDR_ENCODE_ERR",       NDMP4_XDR_ENCODE_ERR, },
80         { "NDMP4_NO_MEM_ERR",           NDMP4_NO_MEM_ERR, },
81         { "NDMP4_CONNECT_ERR",          NDMP4_CONNECT_ERR, },
82         { 0 }
83 };
84
85
86 extern struct ndmp_enum_str_table ndmp4_header_message_type_table[];
87 extern char * ndmp4_header_message_type_to_str (ndmp4_header_message_type val);
88 extern int    ndmp4_header_message_type_from_str (ndmp4_header_message_type *valp, char *str);
89
90 char * ndmp4_header_message_type_to_str (ndmp4_header_message_type val) {
91         return ndmp_enum_to_str ((int)val, ndmp4_header_message_type_table);
92 }
93
94 int ndmp4_header_message_type_from_str (ndmp4_header_message_type *valp, char *str) {
95         return ndmp_enum_from_str ((int*)valp, str, ndmp4_header_message_type_table);
96 }
97
98 struct ndmp_enum_str_table ndmp4_header_message_type_table[] = {
99         { "NDMP4_MESSAGE_REQUEST",      NDMP4_MESSAGE_REQUEST, },
100         { "NDMP4_MESSAGE_REPLY",        NDMP4_MESSAGE_REPLY, },
101         { 0 }
102 };
103
104
105 extern struct ndmp_enum_str_table ndmp4_message_table[];
106 extern char * ndmp4_message_to_str (ndmp4_message val);
107 extern int    ndmp4_message_from_str (ndmp4_message *valp, char *str);
108
109 char * ndmp4_message_to_str (ndmp4_message val) {
110         return ndmp_enum_to_str ((int)val, ndmp4_message_table);
111 }
112
113 int ndmp4_message_from_str (ndmp4_message *valp, char *str) {
114         return ndmp_enum_from_str ((int*)valp, str, ndmp4_message_table);
115 }
116
117 struct ndmp_enum_str_table ndmp4_message_table[] = {
118         { "NDMP4_CONNECT_OPEN",         NDMP4_CONNECT_OPEN, },
119         { "NDMP4_CONNECT_CLIENT_AUTH",  NDMP4_CONNECT_CLIENT_AUTH, },
120         { "NDMP4_CONNECT_CLOSE",        NDMP4_CONNECT_CLOSE, },
121         { "NDMP4_CONNECT_SERVER_AUTH",  NDMP4_CONNECT_SERVER_AUTH, },
122         { "NDMP4_CONFIG_GET_HOST_INFO", NDMP4_CONFIG_GET_HOST_INFO, },
123         { "NDMP4_CONFIG_GET_CONNECTION_TYPE",
124                                         NDMP4_CONFIG_GET_CONNECTION_TYPE, },
125         { "NDMP4_CONFIG_GET_AUTH_ATTR", NDMP4_CONFIG_GET_AUTH_ATTR, },
126         { "NDMP4_CONFIG_GET_BUTYPE_INFO", NDMP4_CONFIG_GET_BUTYPE_INFO, },
127         { "NDMP4_CONFIG_GET_FS_INFO",   NDMP4_CONFIG_GET_FS_INFO, },
128         { "NDMP4_CONFIG_GET_TAPE_INFO", NDMP4_CONFIG_GET_TAPE_INFO, },
129         { "NDMP4_CONFIG_GET_SCSI_INFO", NDMP4_CONFIG_GET_SCSI_INFO, },
130         { "NDMP4_CONFIG_GET_SERVER_INFO",NDMP4_CONFIG_GET_SERVER_INFO, },
131         { "NDMP4_SCSI_OPEN",            NDMP4_SCSI_OPEN, },
132         { "NDMP4_SCSI_CLOSE",           NDMP4_SCSI_CLOSE, },
133         { "NDMP4_SCSI_GET_STATE",       NDMP4_SCSI_GET_STATE, },
134 /*      { "NDMP4_SCSI_SET_TARGET",      NDMP4_SCSI_SET_TARGET, }, */
135         { "NDMP4_SCSI_RESET_DEVICE",    NDMP4_SCSI_RESET_DEVICE, },
136 /*      { "NDMP4_SCSI_RESET_BUS",       NDMP4_SCSI_RESET_BUS, }, */
137         { "NDMP4_SCSI_EXECUTE_CDB",     NDMP4_SCSI_EXECUTE_CDB, },
138         { "NDMP4_TAPE_OPEN",            NDMP4_TAPE_OPEN, },
139         { "NDMP4_TAPE_CLOSE",           NDMP4_TAPE_CLOSE, },
140         { "NDMP4_TAPE_GET_STATE",       NDMP4_TAPE_GET_STATE, },
141         { "NDMP4_TAPE_MTIO",            NDMP4_TAPE_MTIO, },
142         { "NDMP4_TAPE_WRITE",           NDMP4_TAPE_WRITE, },
143         { "NDMP4_TAPE_READ",            NDMP4_TAPE_READ, },
144         { "NDMP4_TAPE_EXECUTE_CDB",     NDMP4_TAPE_EXECUTE_CDB, },
145         { "NDMP4_DATA_GET_STATE",       NDMP4_DATA_GET_STATE, },
146         { "NDMP4_DATA_START_BACKUP",    NDMP4_DATA_START_BACKUP, },
147         { "NDMP4_DATA_START_RECOVER",   NDMP4_DATA_START_RECOVER, },
148         { "NDMP4_DATA_START_RECOVER_FILEHIST",
149                                         NDMP4_DATA_START_RECOVER_FILEHIST, },
150         { "NDMP4_DATA_ABORT",           NDMP4_DATA_ABORT, },
151         { "NDMP4_DATA_GET_ENV",         NDMP4_DATA_GET_ENV, },
152         { "NDMP4_DATA_STOP",            NDMP4_DATA_STOP, },
153         { "NDMP4_DATA_LISTEN",          NDMP4_DATA_LISTEN, },
154         { "NDMP4_DATA_CONNECT",         NDMP4_DATA_CONNECT, },
155         { "NDMP4_NOTIFY_DATA_HALTED",   NDMP4_NOTIFY_DATA_HALTED, },
156         { "NDMP4_NOTIFY_CONNECTION_STATUS",
157                                         NDMP4_NOTIFY_CONNECTION_STATUS, },
158         { "NDMP4_NOTIFY_MOVER_HALTED",  NDMP4_NOTIFY_MOVER_HALTED, },
159         { "NDMP4_NOTIFY_MOVER_PAUSED",  NDMP4_NOTIFY_MOVER_PAUSED, },
160         { "NDMP4_NOTIFY_DATA_READ",     NDMP4_NOTIFY_DATA_READ, },
161         { "NDMP4_LOG_FILE",             NDMP4_LOG_FILE, },
162         { "NDMP4_LOG_MESSAGE",          NDMP4_LOG_MESSAGE, },
163         { "NDMP4_FH_ADD_FILE",          NDMP4_FH_ADD_FILE, },
164         { "NDMP4_FH_ADD_DIR",           NDMP4_FH_ADD_DIR, },
165         { "NDMP4_FH_ADD_NODE",          NDMP4_FH_ADD_NODE, },
166         { "NDMP4_MOVER_GET_STATE",      NDMP4_MOVER_GET_STATE, },
167         { "NDMP4_MOVER_LISTEN",         NDMP4_MOVER_LISTEN, },
168         { "NDMP4_MOVER_CONTINUE",       NDMP4_MOVER_CONTINUE, },
169         { "NDMP4_MOVER_ABORT",          NDMP4_MOVER_ABORT, },
170         { "NDMP4_MOVER_STOP",           NDMP4_MOVER_STOP, },
171         { "NDMP4_MOVER_SET_WINDOW",     NDMP4_MOVER_SET_WINDOW, },
172         { "NDMP4_MOVER_READ",           NDMP4_MOVER_READ, },
173         { "NDMP4_MOVER_CLOSE",          NDMP4_MOVER_CLOSE, },
174         { "NDMP4_MOVER_SET_RECORD_SIZE", NDMP4_MOVER_SET_RECORD_SIZE, },
175         { "NDMP4_MOVER_CONNECT",        NDMP4_MOVER_CONNECT, },
176 /*      { "NDMP4_VENDORS_BASE",         NDMP4_VENDORS_BASE, }, */
177 /*      { "NDMP4_RESERVED_BASE",        NDMP4_RESERVED_BASE, }, */
178         { 0 }
179 };
180
181
182 extern struct ndmp_enum_str_table ndmp4_auth_type_table[];
183 extern char * ndmp4_auth_type_to_str (ndmp4_auth_type val);
184 extern int    ndmp4_auth_type_from_str (ndmp4_auth_type *valp, char *str);
185
186 char * ndmp4_auth_type_to_str (ndmp4_auth_type val) {
187         return ndmp_enum_to_str ((int)val, ndmp4_auth_type_table);
188 }
189
190 int ndmp4_auth_type_from_str (ndmp4_auth_type *valp, char *str) {
191         return ndmp_enum_from_str ((int*)valp, str, ndmp4_auth_type_table);
192 }
193
194 struct ndmp_enum_str_table ndmp4_auth_type_table[] = {
195         { "NDMP4_AUTH_NONE",            NDMP4_AUTH_NONE, },
196         { "NDMP4_AUTH_TEXT",            NDMP4_AUTH_TEXT, },
197         { "NDMP4_AUTH_MD5",             NDMP4_AUTH_MD5, },
198         { 0 }
199 };
200
201
202 extern struct ndmp_enum_str_table ndmp4_addr_type_table[];
203 extern char * ndmp4_addr_type_to_str (ndmp4_addr_type val);
204 extern int    ndmp4_addr_type_from_str (ndmp4_addr_type *valp, char *str);
205
206 char * ndmp4_addr_type_to_str (ndmp4_addr_type val) {
207         return ndmp_enum_to_str ((int)val, ndmp4_addr_type_table);
208 }
209
210 int ndmp4_addr_type_from_str (ndmp4_addr_type *valp, char *str) {
211         return ndmp_enum_from_str ((int*)valp, str, ndmp4_addr_type_table);
212 }
213
214 struct ndmp_enum_str_table ndmp4_addr_type_table[] = {
215         { "NDMP4_ADDR_LOCAL",           NDMP4_ADDR_LOCAL, },
216         { "NDMP4_ADDR_TCP",             NDMP4_ADDR_TCP, },
217         { "NDMP4_ADDR_RESERVED",        NDMP4_ADDR_RESERVED, },
218         { "NDMP4_ADDR_IPC",             NDMP4_ADDR_IPC, },
219         { 0 }
220 };
221
222
223 extern struct ndmp_enum_str_table ndmp4_tape_open_mode_table[];
224 extern char * ndmp4_tape_open_mode_to_str (ndmp4_tape_open_mode val);
225 extern int    ndmp4_tape_open_mode_from_str (ndmp4_tape_open_mode *valp, char *str);
226
227 char * ndmp4_tape_open_mode_to_str (ndmp4_tape_open_mode val) {
228         return ndmp_enum_to_str ((int)val, ndmp4_tape_open_mode_table);
229 }
230
231 int ndmp4_tape_open_mode_from_str (ndmp4_tape_open_mode *valp, char *str) {
232         return ndmp_enum_from_str ((int*)valp, str, ndmp4_tape_open_mode_table);
233 }
234
235 struct ndmp_enum_str_table ndmp4_tape_open_mode_table[] = {
236         { "NDMP4_TAPE_READ_MODE",       NDMP4_TAPE_READ_MODE, },
237         { "NDMP4_TAPE_RDWR_MODE",       NDMP4_TAPE_RDWR_MODE, },
238         { 0 }
239 };
240
241
242 extern struct ndmp_enum_str_table ndmp4_tape_mtio_op_table[];
243 extern char * ndmp4_tape_mtio_op_to_str (ndmp4_tape_mtio_op val);
244 extern int    ndmp4_tape_mtio_op_from_str (ndmp4_tape_mtio_op *valp, char *str);
245
246 char * ndmp4_tape_mtio_op_to_str (ndmp4_tape_mtio_op val) {
247         return ndmp_enum_to_str ((int)val, ndmp4_tape_mtio_op_table);
248 }
249
250 int ndmp4_tape_mtio_op_from_str (ndmp4_tape_mtio_op *valp, char *str) {
251         return ndmp_enum_from_str ((int*)valp, str, ndmp4_tape_mtio_op_table);
252 }
253
254 struct ndmp_enum_str_table ndmp4_tape_mtio_op_table[] = {
255         { "NDMP4_MTIO_FSF",             NDMP4_MTIO_FSF, },
256         { "NDMP4_MTIO_BSF",             NDMP4_MTIO_BSF, },
257         { "NDMP4_MTIO_FSR",             NDMP4_MTIO_FSR, },
258         { "NDMP4_MTIO_BSR",             NDMP4_MTIO_BSR, },
259         { "NDMP4_MTIO_REW",             NDMP4_MTIO_REW, },
260         { "NDMP4_MTIO_EOF",             NDMP4_MTIO_EOF, },
261         { "NDMP4_MTIO_OFF",             NDMP4_MTIO_OFF, },
262         { 0 }
263 };
264
265
266 extern struct ndmp_enum_str_table ndmp4_mover_state_table[];
267 extern char * ndmp4_mover_state_to_str (ndmp4_mover_state val);
268 extern int    ndmp4_mover_state_from_str (ndmp4_mover_state *valp, char *str);
269
270 char * ndmp4_mover_state_to_str (ndmp4_mover_state val) {
271         return ndmp_enum_to_str ((int)val, ndmp4_mover_state_table);
272 }
273
274 int ndmp4_mover_state_from_str (ndmp4_mover_state *valp, char *str) {
275         return ndmp_enum_from_str ((int*)valp, str, ndmp4_mover_state_table);
276 }
277
278 struct ndmp_enum_str_table ndmp4_mover_state_table[] = {
279         { "NDMP4_MOVER_STATE_IDLE",     NDMP4_MOVER_STATE_IDLE, },
280         { "NDMP4_MOVER_STATE_LISTEN",   NDMP4_MOVER_STATE_LISTEN, },
281         { "NDMP4_MOVER_STATE_ACTIVE",   NDMP4_MOVER_STATE_ACTIVE, },
282         { "NDMP4_MOVER_STATE_PAUSED",   NDMP4_MOVER_STATE_PAUSED, },
283         { "NDMP4_MOVER_STATE_HALTED",   NDMP4_MOVER_STATE_HALTED, },
284         { 0 }
285 };
286
287
288 extern struct ndmp_enum_str_table ndmp4_mover_pause_reason_table[];
289 extern char * ndmp4_mover_pause_reason_to_str (ndmp4_mover_pause_reason val);
290 extern int    ndmp4_mover_pause_reason_from_str (ndmp4_mover_pause_reason *valp, char *str);
291
292 char * ndmp4_mover_pause_reason_to_str (ndmp4_mover_pause_reason val) {
293         return ndmp_enum_to_str ((int)val, ndmp4_mover_pause_reason_table);
294 }
295
296 int ndmp4_mover_pause_reason_from_str (ndmp4_mover_pause_reason *valp, char *str) {
297         return ndmp_enum_from_str ((int*)valp, str, ndmp4_mover_pause_reason_table);
298 }
299
300 struct ndmp_enum_str_table ndmp4_mover_pause_reason_table[] = {
301         { "NDMP4_MOVER_PAUSE_NA",       NDMP4_MOVER_PAUSE_NA, },
302         { "NDMP4_MOVER_PAUSE_EOM",      NDMP4_MOVER_PAUSE_EOM, },
303         { "NDMP4_MOVER_PAUSE_EOF",      NDMP4_MOVER_PAUSE_EOF, },
304         { "NDMP4_MOVER_PAUSE_SEEK",     NDMP4_MOVER_PAUSE_SEEK, },
305         { "NDMP4_MOVER_PAUSE_EOW",      NDMP4_MOVER_PAUSE_EOW, },
306         { 0 }
307 };
308
309
310 extern struct ndmp_enum_str_table ndmp4_mover_halt_reason_table[];
311 extern char * ndmp4_mover_halt_reason_to_str (ndmp4_mover_halt_reason val);
312 extern int    ndmp4_mover_halt_reason_from_str (ndmp4_mover_halt_reason *valp, char *str);
313
314 char * ndmp4_mover_halt_reason_to_str (ndmp4_mover_halt_reason val) {
315         return ndmp_enum_to_str ((int)val, ndmp4_mover_halt_reason_table);
316 }
317
318 int ndmp4_mover_halt_reason_from_str (ndmp4_mover_halt_reason *valp, char *str) {
319         return ndmp_enum_from_str ((int*)valp, str, ndmp4_mover_halt_reason_table);
320 }
321
322 struct ndmp_enum_str_table ndmp4_mover_halt_reason_table[] = {
323         { "NDMP4_MOVER_HALT_NA",        NDMP4_MOVER_HALT_NA, },
324         { "NDMP4_MOVER_HALT_CONNECT_CLOSED",
325                                         NDMP4_MOVER_HALT_CONNECT_CLOSED, },
326         { "NDMP4_MOVER_HALT_ABORTED",   NDMP4_MOVER_HALT_ABORTED, },
327         { "NDMP4_MOVER_HALT_INTERNAL_ERROR",
328                                         NDMP4_MOVER_HALT_INTERNAL_ERROR, },
329         { "NDMP4_MOVER_HALT_CONNECT_ERROR",
330                                         NDMP4_MOVER_HALT_CONNECT_ERROR, },
331         { "NDMP4_MOVER_HALT_MEDIA_ERROR",
332                                         NDMP4_MOVER_HALT_MEDIA_ERROR, },
333         { 0 }
334 };
335
336
337 extern struct ndmp_enum_str_table ndmp4_mover_mode_table[];
338 extern char * ndmp4_mover_mode_to_str (ndmp4_mover_mode val);
339 extern int    ndmp4_mover_mode_from_str (ndmp4_mover_mode *valp, char *str);
340
341 char * ndmp4_mover_mode_to_str (ndmp4_mover_mode val) {
342         return ndmp_enum_to_str ((int)val, ndmp4_mover_mode_table);
343 }
344
345 int ndmp4_mover_mode_from_str (ndmp4_mover_mode *valp, char *str) {
346         return ndmp_enum_from_str ((int*)valp, str, ndmp4_mover_mode_table);
347 }
348
349 struct ndmp_enum_str_table ndmp4_mover_mode_table[] = {
350         { "NDMP4_MOVER_MODE_READ",      NDMP4_MOVER_MODE_READ, },
351         { "NDMP4_MOVER_MODE_WRITE",     NDMP4_MOVER_MODE_WRITE, },
352         { 0 }
353 };
354
355
356 extern struct ndmp_enum_str_table ndmp4_data_operation_table[];
357 extern char * ndmp4_data_operation_to_str (ndmp4_data_operation val);
358 extern int    ndmp4_data_operation_from_str (ndmp4_data_operation *valp, char *str);
359
360 char * ndmp4_data_operation_to_str (ndmp4_data_operation val) {
361         return ndmp_enum_to_str ((int)val, ndmp4_data_operation_table);
362 }
363
364 int ndmp4_data_operation_from_str (ndmp4_data_operation *valp, char *str) {
365         return ndmp_enum_from_str ((int*)valp, str, ndmp4_data_operation_table);
366 }
367
368 struct ndmp_enum_str_table ndmp4_data_operation_table[] = {
369         { "NDMP4_DATA_OP_NOACTION",     NDMP4_DATA_OP_NOACTION, },
370         { "NDMP4_DATA_OP_BACKUP",       NDMP4_DATA_OP_BACKUP, },
371         { "NDMP4_DATA_OP_RECOVER",      NDMP4_DATA_OP_RECOVER, },
372         { "NDMP4_DATA_OP_RECOVER_FILEHIST",
373                                         NDMP4_DATA_OP_RECOVER_FILEHIST, },
374         { 0 }
375 };
376
377
378 extern struct ndmp_enum_str_table ndmp4_data_state_table[];
379 extern char * ndmp4_data_state_to_str (ndmp4_data_state val);
380 extern int    ndmp4_data_state_from_str (ndmp4_data_state *valp, char *str);
381
382 char * ndmp4_data_state_to_str (ndmp4_data_state val) {
383         return ndmp_enum_to_str ((int)val, ndmp4_data_state_table);
384 }
385
386 int ndmp4_data_state_from_str (ndmp4_data_state *valp, char *str) {
387         return ndmp_enum_from_str ((int*)valp, str, ndmp4_data_state_table);
388 }
389
390 struct ndmp_enum_str_table ndmp4_data_state_table[] = {
391         { "NDMP4_DATA_STATE_IDLE",      NDMP4_DATA_STATE_IDLE, },
392         { "NDMP4_DATA_STATE_ACTIVE",    NDMP4_DATA_STATE_ACTIVE, },
393         { "NDMP4_DATA_STATE_HALTED",    NDMP4_DATA_STATE_HALTED, },
394         { "NDMP4_DATA_STATE_LISTEN",    NDMP4_DATA_STATE_LISTEN, },
395         { "NDMP4_DATA_STATE_CONNECTED", NDMP4_DATA_STATE_CONNECTED, },
396         { 0 }
397 };
398
399
400 extern struct ndmp_enum_str_table ndmp4_data_halt_reason_table[];
401 extern char * ndmp4_data_halt_reason_to_str (ndmp4_data_halt_reason val);
402 extern int    ndmp4_data_halt_reason_from_str (ndmp4_data_halt_reason *valp, char *str);
403
404 char * ndmp4_data_halt_reason_to_str (ndmp4_data_halt_reason val) {
405         return ndmp_enum_to_str ((int)val, ndmp4_data_halt_reason_table);
406 }
407
408 int ndmp4_data_halt_reason_from_str (ndmp4_data_halt_reason *valp, char *str) {
409         return ndmp_enum_from_str ((int*)valp, str, ndmp4_data_halt_reason_table);
410 }
411
412 struct ndmp_enum_str_table ndmp4_data_halt_reason_table[] = {
413         { "NDMP4_DATA_HALT_NA",         NDMP4_DATA_HALT_NA, },
414         { "NDMP4_DATA_HALT_SUCCESSFUL", NDMP4_DATA_HALT_SUCCESSFUL, },
415         { "NDMP4_DATA_HALT_ABORTED",    NDMP4_DATA_HALT_ABORTED, },
416         { "NDMP4_DATA_HALT_INTERNAL_ERROR", NDMP4_DATA_HALT_INTERNAL_ERROR, },
417         { "NDMP4_DATA_HALT_CONNECT_ERROR", NDMP4_DATA_HALT_CONNECT_ERROR, },
418         { 0 }
419 };
420
421
422 extern struct ndmp_enum_str_table ndmp4_connection_status_reason_table[];
423 extern char * ndmp4_connection_status_reason_to_str (ndmp4_connection_status_reason val);
424 extern int    ndmp4_connection_status_reason_from_str (ndmp4_connection_status_reason *valp, char *str);
425
426 char * ndmp4_connection_status_reason_to_str (ndmp4_connection_status_reason val) {
427         return ndmp_enum_to_str ((int)val, ndmp4_connection_status_reason_table);
428 }
429
430 int ndmp4_connection_status_reason_from_str (ndmp4_connection_status_reason *valp, char *str) {
431         return ndmp_enum_from_str ((int*)valp, str, ndmp4_connection_status_reason_table);
432 }
433
434 struct ndmp_enum_str_table ndmp4_connection_status_reason_table[] = {
435         { "NDMP4_CONNECTED",            NDMP4_CONNECTED, },
436         { "NDMP4_SHUTDOWN",             NDMP4_SHUTDOWN, },
437         { "NDMP4_REFUSED",              NDMP4_REFUSED, },
438         { 0 }
439 };
440
441
442 extern struct ndmp_enum_str_table ndmp4_log_type_table[];
443 extern char * ndmp4_log_type_to_str (ndmp4_log_type val);
444 extern int    ndmp4_log_type_from_str (ndmp4_log_type *valp, char *str);
445
446 char * ndmp4_log_type_to_str (ndmp4_log_type val) {
447         return ndmp_enum_to_str ((int)val, ndmp4_log_type_table);
448 }
449
450 int ndmp4_log_type_from_str (ndmp4_log_type *valp, char *str) {
451         return ndmp_enum_from_str ((int*)valp, str, ndmp4_log_type_table);
452 }
453
454 struct ndmp_enum_str_table ndmp4_log_type_table[] = {
455         { "NDMP4_LOG_NORMAL",           NDMP4_LOG_NORMAL, },
456         { "NDMP4_LOG_DEBUG",            NDMP4_LOG_DEBUG, },
457         { "NDMP4_LOG_ERROR",            NDMP4_LOG_ERROR, },
458         { "NDMP4_LOG_WARNING",          NDMP4_LOG_WARNING, },
459         { 0 }
460 };
461
462
463 extern struct ndmp_enum_str_table ndmp4_fs_type_table[];
464 extern char * ndmp4_fs_type_to_str (ndmp4_fs_type val);
465 extern int    ndmp4_fs_type_from_str (ndmp4_fs_type *valp, char *str);
466
467 char * ndmp4_fs_type_to_str (ndmp4_fs_type val) {
468         return ndmp_enum_to_str ((int)val, ndmp4_fs_type_table);
469 }
470
471 int ndmp4_fs_type_from_str (ndmp4_fs_type *valp, char *str) {
472         return ndmp_enum_from_str ((int*)valp, str, ndmp4_fs_type_table);
473 }
474
475 struct ndmp_enum_str_table ndmp4_fs_type_table[] = {
476         { "NDMP4_FS_UNIX",              NDMP4_FS_UNIX, },
477         { "NDMP4_FS_NT",                NDMP4_FS_NT, },
478         { "NDMP4_FS_OTHER",             NDMP4_FS_OTHER, },
479         { 0 }
480 };
481
482
483 extern struct ndmp_enum_str_table ndmp4_file_type_table[];
484 extern char * ndmp4_file_type_to_str (ndmp4_file_type val);
485 extern int    ndmp4_file_type_from_str (ndmp4_file_type *valp, char *str);
486
487 char * ndmp4_file_type_to_str (ndmp4_file_type val) {
488         return ndmp_enum_to_str ((int)val, ndmp4_file_type_table);
489 }
490
491 int ndmp4_file_type_from_str (ndmp4_file_type *valp, char *str) {
492         return ndmp_enum_from_str ((int*)valp, str, ndmp4_file_type_table);
493 }
494
495 struct ndmp_enum_str_table ndmp4_file_type_table[] = {
496         { "NDMP4_FILE_DIR",             NDMP4_FILE_DIR, },
497         { "NDMP4_FILE_FIFO",            NDMP4_FILE_FIFO, },
498         { "NDMP4_FILE_CSPEC",           NDMP4_FILE_CSPEC, },
499         { "NDMP4_FILE_BSPEC",           NDMP4_FILE_BSPEC, },
500         { "NDMP4_FILE_REG",             NDMP4_FILE_REG, },
501         { "NDMP4_FILE_SLINK",           NDMP4_FILE_SLINK, },
502         { "NDMP4_FILE_SOCK",            NDMP4_FILE_SOCK, },
503         { "NDMP4_FILE_REGISTRY",        NDMP4_FILE_REGISTRY, },
504         { "NDMP4_FILE_OTHER",           NDMP4_FILE_OTHER, },
505         { 0 }
506 };
507
508
509 extern struct ndmp_enum_str_table ndmp4_recovery_status_table[];
510 extern char * ndmp4_recovery_status_to_str (ndmp4_recovery_status val);
511 extern int    ndmp4_recovery_status_from_str (ndmp4_recovery_status *valp, char *str);
512
513 char * ndmp4_recovery_status_to_str (ndmp4_recovery_status val) {
514         return ndmp_enum_to_str ((int)val, ndmp4_recovery_status_table);
515 }
516
517 int ndmp4_recovery_status_from_str (ndmp4_recovery_status *valp, char *str) {
518         return ndmp_enum_from_str ((int*)valp, str, ndmp4_recovery_status_table);
519 }
520
521 struct ndmp_enum_str_table ndmp4_recovery_status_table[] = {
522         { "NDMP4_RECOVERY_SUCCESSFUL",
523                         NDMP4_RECOVERY_SUCCESSFUL, },
524         { "NDMP4_RECOVERY_FAILED_PERMISSION",
525                         NDMP4_RECOVERY_FAILED_PERMISSION, },
526         { "NDMP4_RECOVERY_FAILED_NOT_FOUND",
527                         NDMP4_RECOVERY_FAILED_NOT_FOUND, },
528         { "NDMP4_RECOVERY_FAILED_NO_DIRECTORY",
529                         NDMP4_RECOVERY_FAILED_NO_DIRECTORY, },
530         { "NDMP4_RECOVERY_FAILED_OUT_OF_MEMORY",
531                         NDMP4_RECOVERY_FAILED_OUT_OF_MEMORY, },
532         { "NDMP4_RECOVERY_FAILED_IO_ERROR",
533                         NDMP4_RECOVERY_FAILED_IO_ERROR, },
534         { "NDMP4_RECOVERY_FAILED_UNDEFINED_ERROR",
535                         NDMP4_RECOVERY_FAILED_UNDEFINED_ERROR, },
536         { 0 }
537 };
538
539 #endif /* !NDMOS_OPTION_NO_NDMP4 */
540