xref: /titanic_50/usr/src/cmd/ndmpd/include/ndmpd_prop.h (revision 4297a3b0d0a35d80f86fff155e288e885a100e6d)
1 /*
2  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
3  */
4 
5 /*
6  * BSD 3 Clause License
7  *
8  * Copyright (c) 2007, The Storage Networking Industry Association.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 	- Redistributions of source code must retain the above copyright
14  *	  notice, this list of conditions and the following disclaimer.
15  *
16  * 	- Redistributions in binary form must reproduce the above copyright
17  *	  notice, this list of conditions and the following disclaimer in
18  *	  the documentation and/or other materials provided with the
19  *	  distribution.
20  *
21  *	- Neither the name of The Storage Networking Industry Association (SNIA)
22  *	  nor the names of its contributors may be used to endorse or promote
23  *	  products derived from this software without specific prior written
24  *	  permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  * POSSIBILITY OF SUCH DAMAGE.
37  */
38 #ifndef	_NDMPD_PROP_H
39 #define	_NDMPD_PROP_H
40 
41 #include <sys/types.h>
42 #include <libscf.h>
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /* NDMP property parameter flags */
49 #define	NDMP_CF_NOTINIT		0x00	/* Not initialized yet */
50 #define	NDMP_CF_DEFINED		0x01	/* Defined/read from env */
51 #define	NDMP_CF_MODIFIED	0x02	/* Has been modified */
52 
53 typedef enum {
54 	NDMP_DAR_SUPPORT = 0,
55 	NDMP_MOVER_NIC,
56 	/*
57 	 * Force backing up the directories leading to
58 	 * a modified object for 'dump' format backup.
59 	 */
60 	NDMP_DUMP_PATHNODE_ENV,
61 	/*
62 	 * Force backing up the directories leading to
63 	 * a modified object for 'tar' format backup.
64 	 */
65 	NDMP_TAR_PATHNODE_ENV,
66 	/*
67 	 * Force to send the file history node entries
68 	 * along with the file history dir entries for
69 	 * all directories containing the changed files
70 	 * to the client for incremental backup.
71 	 *
72 	 * Note: This variable is added to support BakBone
73 	 * Software's NetVault DMA which expects to get the
74 	 * FH ADD NODES for all upper directories which
75 	 * contain the changed files in incremental backup
76 	 * along with the FH ADD DIRS.
77 	 */
78 	NDMP_FHIST_INCR_ENV,
79 	/* Ignore st_ctime when backing up. */
80 	NDMP_IGNCTIME_ENV,
81 	/* If we should check for the last modification time. */
82 	NDMP_INCLMTIME_ENV,
83 	/*
84 	 * Environment variable name for the maximum permitted
85 	 * token sequence for token-based backups.
86 	 */
87 	NDMP_MAXSEQ_ENV,
88 	/* Environment variable name for the active version. */
89 	NDMP_VERSION_ENV,
90 	/*
91 	 * Environment variable name for restore path.
92 	 * Suppose that a dircetroy named "/d1/d11" is backed
93 	 * up and there is a file "/d1/d11/d111/f" under that
94 	 * directory and  the restore path is "/d1/r1".
95 	 * If restore path mechanism is set to 0 which means
96 	 * partial path restore, then the result will be
97 	 * "/d1/r1/d111/f". If it is set to 1 which means full
98 	 * path restore, the result will be "/d1/r1/d1/d11/d111/f"
99 	 */
100 	NDMP_FULL_RESTORE_PATH,
101 	NDMP_DEBUG_PATH,
102 	NDMP_PLUGIN_PATH,
103 	NDMP_SOCKET_CSS,
104 	NDMP_SOCKET_CRS,
105 	NDMP_MOVER_RECSIZE,
106 	NDMP_RESTORE_WILDCARD_ENABLE,
107 	NDMP_CRAM_MD5_USERNAME,
108 	NDMP_CRAM_MD5_PASSWORD,
109 	NDMP_CLEARTEXT_USERNAME,
110 	NDMP_CLEARTEXT_PASSWORD,
111 	NDMP_TCP_PORT,
112 	NDMP_BACKUP_QTN,
113 	NDMP_RESTORE_QTN,
114 	NDMP_OVERWRITE_QTN,
115 	NDMP_ZFS_FORCE_OVERRIDE,
116 	NDMP_MAXALL
117 } ndmpd_cfg_id_t;
118 
119 extern int ndmpd_load_prop(void);
120 extern char *ndmpd_get_prop(ndmpd_cfg_id_t);
121 extern char *ndmpd_get_prop_default(ndmpd_cfg_id_t, char *);
122 extern int ndmpd_get_prop_yorn(ndmpd_cfg_id_t);
123 
124 #ifdef	__cplusplus
125 }
126 #endif
127 
128 #endif /* _NDMPD_PROP_H */
129