libDtSearch: Coverity 86579
[oweals/cde.git] / cde / lib / csa / connection.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: connection.h /main/1 1996/04/21 19:22:23 drk $ */
24 /*
25  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
26  *  (c) Copyright 1993, 1994 International Business Machines Corp.
27  *  (c) Copyright 1993, 1994 Novell, Inc.
28  *  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
29  */
30
31 #ifndef _CONNECTION_H
32 #define _CONNECTION_H
33
34 #include <rpc/rpc.h>
35 #include "ansi_c.h"
36 #include "csa.h"
37
38 #define _DtCM_DEFAULT_TIMEOUT   5
39 #define _DtCM_INITIAL_TIMEOUT   25
40 #define _DtCM_LONG_TIMEOUT      60
41
42 #define DAYSEC                  86400
43
44 typedef enum Transport_type
45 {
46         tcp_transport,
47         udp_transport
48 } _DtCm_Transport_Type;
49
50 typedef struct targetlist {
51         char            *cal;
52         unsigned long   update_type;
53         struct targetlist *next;
54 } _DtCm_Target_List;
55
56 typedef struct cl_info {
57         char            *host;
58         CLIENT          *tcpcl;
59         CLIENT          *udpcl;
60         u_long          vers_out;
61         long            last_used;
62         int             nregistered;
63         _DtCm_Target_List       *tlist;
64         struct cl_info *next;
65         struct cl_info *prev;
66 } _DtCm_Client_Info;
67
68 typedef struct conn {
69         _DtCm_Client_Info       *ci;
70         int             retry;
71         _DtCm_Transport_Type    use;
72         enum clnt_stat  stat;
73 } _DtCm_Connection;
74
75 #ifdef SunOS
76 extern enum clnt_stat _DtCm_clnt_call P((
77                                 _DtCm_Connection *conn,
78                                 u_long proc,
79                                 xdrproc_t inproc,
80                                 caddr_t in,
81                                 xdrproc_t outproc,
82                                 caddr_t out,
83                                 struct timeval tout));
84 #endif
85
86 extern CSA_return_code _DtCm_add_registration P((
87                                 _DtCm_Client_Info *ci,
88                                 char *cal,
89                                 unsigned long update_type));
90
91 extern void _DtCm_remove_registration P((
92                                 _DtCm_Client_Info *ci,
93                                 char *cal));
94
95 extern CSA_return_code _DtCm_create_udp_client P((
96                                 char *host,
97                                 int version,
98                                 int timeout,
99                                 _DtCm_Client_Info **clnt));
100
101 extern CSA_return_code _DtCm_create_tcp_client P((
102                                 char *host,
103                                 int version,
104                                 int timeout,
105                                 _DtCm_Client_Info **clnt));
106
107 extern CSA_return_code _DtCm_get_server_rpc_version P((char *host, int *vers));
108
109 extern CSA_return_code _DtCm_clntstat_to_csastat P((enum clnt_stat clntstat));
110
111 #endif
112