xref: /illumos-gate/usr/src/lib/udapl/udapl_tavor/include/dapl_provider.h (revision 9e39c5ba00a55fa05777cc94b148296af305e135)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
24  */
25 
26 /*
27  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 /*
32  *
33  * HEADER: dapl_provider.h
34  *
35  * PURPOSE: Provider function table
36  * Description: DAT Interfaces to this provider
37  *
38  * $Id: dapl_provider.h,v 1.4 2003/07/31 14:04:17 jlentini Exp $
39  */
40 
41 #ifndef _DAPL_PROVIDER_H_
42 #define	_DAPL_PROVIDER_H_
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 #include "dapl.h"
49 
50 
51 /*
52  *
53  * Structures
54  *
55  */
56 
57 typedef struct DAPL_PROVIDER_LIST_NODE
58 {
59 	char				name[DAT_NAME_MAX_LENGTH];
60 	DAT_PROVIDER 			data;
61 	struct DAPL_PROVIDER_LIST_NODE	*next;
62 	struct DAPL_PROVIDER_LIST_NODE	*prev;
63 } DAPL_PROVIDER_LIST_NODE;
64 
65 
66 typedef struct DAPL_PROVIDER_LIST
67 {
68     DAPL_PROVIDER_LIST_NODE 		*head;
69     DAPL_PROVIDER_LIST_NODE 		*tail;
70     DAT_COUNT				size;
71 } DAPL_PROVIDER_LIST;
72 
73 
74 /*
75  *
76  * Global Data
77  *
78  */
79 
80 extern DAPL_PROVIDER_LIST 	g_dapl_provider_list;
81 extern DAT_PROVIDER 		g_dapl_provider_template;
82 extern int 			g_dapl_loopback_connection;
83 
84 
85 /*
86  *
87  * Function Prototypes
88  *
89  */
90 
91 extern DAT_RETURN
92 dapl_provider_list_create(void);
93 
94 extern DAT_RETURN
95 dapl_provider_list_destroy(void);
96 
97 extern DAT_COUNT
98 dapl_provider_list_size(void);
99 
100 extern DAT_RETURN
101 dapl_provider_list_insert(
102     IN  const char *name,
103     OUT DAT_PROVIDER **p_data);
104 
105 extern DAT_RETURN
106 dapl_provider_list_search(
107     IN  const char *name,
108     OUT DAT_PROVIDER **p_data);
109 
110 extern DAT_RETURN
111 dapl_provider_list_remove(
112     IN  const char *name);
113 
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 #endif /* _DAPL_PROVIDER_H_ */
119