2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
9 * Copyright (c) 2007, The Storage Networking Industry Association.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * - Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
17 * - Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in
19 * the documentation and/or other materials provided with the
22 * - Neither the name of The Storage Networking Industry Association (SNIA)
23 * nor the names of its contributors may be used to endorse or promote
24 * products derived from this software without specific prior written
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
42 #include <rpc/types.h>
46 #define NDMP_DOOR_SVC "/var/run/ndmp_door_svc"
47 #define NDMP_DOOR_SIZE (8 * 1024)
48 #define NDMP_DOOR_SRV_SUCCESS 0
49 #define NDMP_DOOR_SRV_ERROR -1
51 #define NDMP_SESSION_DATA 1
52 #define NDMP_SESSION_NODATA 0
55 /* door status message */
56 #define NDMP_GET_DOOR_STATUS 0
58 /* set subcommand messages */
59 #define NDMP_SET_DEBUG_LEVEL 1
60 #define NDMP_SET_DEBUG_PATH 2
61 #define NDMP_SET_DUMP_PATHNODE 3
62 #define NDMP_SET_TAR_PATHNODE 4
63 #define NDMP_SET_IGNOR_CTIME 5
64 #define NDMP_SET_MAXSEQ 6
65 #define NDMP_SET_VERSION 7
66 #define NDMP_SET_DAR 8
67 #define NDMP_SET_BACKUP_QTN 9
68 #define NDMP_SET_RESTORE_QTN 10
69 #define NDMP_SET_OVERWRITE_QTN 11
71 /* get subcommand messages */
72 #define NDMP_GET_DEBUG_LEVEL 20
73 #define NDMP_GET_DEBUG_PATH 21
74 #define NDMP_GET_DUMP_PATHNODE 22
75 #define NDMP_GET_TAR_PATHNODE 23
76 #define NDMP_GET_IGNOR_CTIME 24
77 #define NDMP_GET_MAXSEQ 25
78 #define NDMP_GET_VERSION 26
79 #define NDMP_GET_DAR 27
80 #define NDMP_GET_BACKUP_QTN 28
81 #define NDMP_GET_RESTORE_QTN 29
82 #define NDMP_GET_OVERWRITE_QTN 30
83 #define NDMP_GET_ALL 31
84 #define NDMP_GET_DEV_CNT 32
86 /* ndmpstat messages */
87 #define NDMP_GET_STAT 33
89 /* device subcommand message */
90 #define NDMP_DEVICES_GET_INFO 40
92 /* show subcommand messages */
95 /* terminate subcommand messages */
96 #define NDMP_TERMINATE_SESSION_ID 80
97 #define NDMP_TERMINATE_SESSION_ALL 81
102 extern ndmp_stat_t ndstat
;
103 #define NS_INC(s) (atomic_inc_32((volatile uint32_t *)&ndstat.ns_##s))
104 #define NS_DEC(s) (atomic_dec_32((volatile uint32_t *)&ndstat.ns_##s))
105 #define NS_ADD(s, d) (atomic_add_64((volatile uint64_t *)&ndstat.ns_##s, \
107 #define NS_UPD(s, t) { \
108 atomic_inc_32((volatile uint32_t *)&ndstat.ns_##s); \
109 atomic_dec_32((volatile uint32_t *)&ndstat.ns_##t); \
111 #endif /* _NDMPD_DOOR_H */