Debian Codegraph @

dat/include/dat2/dat_registry.h

raw
1 /*
2 * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved.
3 *
4 * This Software is licensed under all of the following licenses:
5 *
6 * 1) under the terms of the "Common Public License 1.0" a copy of which is
7 * in the file LICENSE.txt in the root directory. The license is also
8 * available from the Open Source Initiative, see
9 * http://www.opensource.org/licenses/cpl.php.
10 *
11 * 2) under the terms of the "The BSD License" a copy of which is in the file
12 * LICENSE2.txt in the root directory. The license is also available from
13 * the Open Source Initiative, see
14 * http://www.opensource.org/licenses/bsd-license.php.
15 *
16 * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
17 * copy of which is in the file LICENSE3.txt in the root directory. The
18 * license is also available from the Open Source Initiative, see
19 * http://www.opensource.org/licenses/gpl-license.php.
20 *
21 * Licensee has the right to choose one of the above licenses.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions are
25 * met:
26 *
27 * Redistributions of source code must retain both the above copyright
28 * notice and one of the license notices.
29 *
30 * Redistributions in binary form must reproduce both the above copyright
31 * notice, one of the license notices in the documentation
32 * and/or other materials provided with the distribution.
33 *
34 * Neither the name of Network Appliance, Inc. nor the names of other DAT
35 * Collaborative contributors may be used to endorse or promote
36 * products derived from this software without specific prior written
37 * permission.
38 */
39
40 /****************************************************************
41 *
42 * HEADER: dat_registry.h
43 *
44 * PURPOSE: DAT registration API signatures
45 *
46 * Description: Header file for "DAPL: Direct Access Programming
47 * Library, Version: 2.0"
48 *
49 * Contains registration external reference signatures
50 * for dat registry functions. This file is *only*
51 * included by providers, not consumers.
52 *
53 * Mapping rules:
54 * All global symbols are prepended with DAT_ or dat_
55 * All DAT objects have an 'api' tag which, such as 'ep' or 'lmr'
56 * The method table is in the provider definition structure.
57 *
58 **********************************************************/
59 #ifndef _DAT_REGISTRY_H_
60 #define _DAT_REGISTRY_H_
61
62 #ifdef __cplusplus
63 extern "C"
64 {
65 #endif
66
67 #if defined(_UDAT_H_)
68 #include <dat2/udat_redirection.h>
69 #elif defined(_KDAT_H_)
70 #include <dat2/kdat_redirection.h>
71 #else
72 #error Must include udat.h or kdat.h
73 #endif
74
75 /*
76 * dat registration API.
77 *
78 * Technically the dat_ia_open is part of the registration API. This
79 * is so the registration module can map the device name to a provider
80 * structure and then call the provider dat_ia_open function.
81 * dat_is_close is also part of the registration API so that the
82 * registration code can be aware when an ia is no longer in use.
83 *
84 */
85
86 extern DAT_RETURN DAT_API dat_registry_add_provider (
87 IN const DAT_PROVIDER *, /* provider */
88 IN const DAT_PROVIDER_INFO* ); /* provider info */
89
90 extern DAT_RETURN DAT_API dat_registry_remove_provider (
91 IN const DAT_PROVIDER *, /* provider */
92 IN const DAT_PROVIDER_INFO* ); /* provider info */
93
94 /*
95 * Provider initialization APIs.
96 *
97 * Providers that support being automatically loaded by the Registry must
98 * implement these APIs and export them as public symbols.
99 */
100
101 #define DAT_PROVIDER_INIT_FUNC_NAME dat_provider_init
102 #define DAT_PROVIDER_FINI_FUNC_NAME dat_provider_fini
103
104 #define DAT_PROVIDER_INIT_FUNC_STR "dat_provider_init"
105 #define DAT_PROVIDER_FINI_FUNC_STR "dat_provider_fini"
106
107 typedef void ( DAT_API *DAT_PROVIDER_INIT_FUNC) (
108 IN const DAT_PROVIDER_INFO *, /* provider info */
109 IN const char *); /* instance data */
110
111 typedef void ( DAT_API *DAT_PROVIDER_FINI_FUNC) (
112 IN const DAT_PROVIDER_INFO *); /* provider info */
113
114 typedef enum dat_ha_relationship
115 {
116 DAT_HA_FALSE, /* two IAs are not related */
117 DAT_HA_TRUE, /* two IAs are related */
118 DAT_HA_UNKNOWN, /* relationship is not known */
119 DAT_HA_CONFLICTING, /* 2 IAs do not agree on the relationship */
120 DAT_HA_EXTENSION_BASE
121 } DAT_HA_RELATIONSHIP;
122
123 extern DAT_RETURN DAT_API dat_registry_providers_related (
124 IN const DAT_NAME_PTR,
125 IN const DAT_NAME_PTR,
126 OUT DAT_HA_RELATIONSHIP * );
127
128 #ifdef __cplusplus
129 }
130 #endif
131
132 #endif /* _DAT_REGISTRY_H_ */