Use build-time configured curl_socklen_t instead of socklen_t
[platform/upstream/curl.git] / lib / setup-os400.h
1 #ifndef __SETUP_OS400_H
2 #define __SETUP_OS400_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at http://curl.haxx.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * $Id$
24  ***************************************************************************/
25
26
27 /* OS/400 netdb.h does not define NI_MAXHOST. */
28 #define NI_MAXHOST      1025
29
30 /* OS/400 netdb.h does not define NI_MAXSERV. */
31 #define NI_MAXSERV      32
32
33 /* No OS/400 header file defines u_int32_t. */
34 typedef unsigned long   u_int32_t;
35
36
37 /* System API wrapper prototypes and definitions to support ASCII parameters. */
38
39 #include <sys/socket.h>
40 #include <netdb.h>
41 #include <qsossl.h>
42 #include <gssapi.h>
43
44 extern int      Curl_getaddrinfo_a(const char * nodename, const char * servname,
45                                    const struct addrinfo * hints,
46                                    struct addrinfo * * res);
47 #define getaddrinfo             Curl_getaddrinfo_a
48
49
50 extern int      Curl_getnameinfo_a(const struct sockaddr * sa,
51                                    curl_socklen_t salen,
52                                    char * nodename, curl_socklen_t nodenamelen,
53                                    char * servname, curl_socklen_t servnamelen,
54                                    int flags);
55 #define getnameinfo             Curl_getnameinfo_a
56
57
58 /* SSL wrappers. */
59
60 extern int      Curl_SSL_Init_Application_a(SSLInitApp * init_app);
61 #define SSL_Init_Application    Curl_SSL_Init_Application_a
62
63
64 extern int      Curl_SSL_Init_a(SSLInit * init);
65 #define SSL_Init                Curl_SSL_Init_a
66
67
68 extern char *   Curl_SSL_Strerror_a(int sslreturnvalue, SSLErrorMsg * serrmsgp);
69 #define SSL_Strerror            Curl_SSL_Strerror_a
70
71
72 /* GSSAPI wrappers. */
73
74 extern OM_uint32 Curl_gss_import_name_a(OM_uint32 * minor_status,
75                                         gss_buffer_t in_name,
76                                         gss_OID in_name_type,
77                                         gss_name_t * out_name);
78 #define gss_import_name         Curl_gss_import_name_a
79
80
81 extern OM_uint32 Curl_gss_display_status_a(OM_uint32 * minor_status,
82                                            OM_uint32 status_value,
83                                            int status_type, gss_OID mech_type,
84                                            gss_msg_ctx_t * message_context,
85                                            gss_buffer_t status_string);
86 #define gss_display_status      Curl_gss_display_status_a
87
88
89 extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 * minor_status,
90                                              gss_cred_id_t cred_handle,
91                                              gss_ctx_id_t * context_handle,
92                                              gss_name_t target_name,
93                                              gss_OID mech_type,
94                                              gss_flags_t req_flags,
95                                              OM_uint32 time_req,
96                                              gss_channel_bindings_t
97                                              input_chan_bindings,  
98                                              gss_buffer_t input_token,
99                                              gss_OID * actual_mech_type,
100                                              gss_buffer_t output_token,
101                                              gss_flags_t * ret_flags,
102                                              OM_uint32 * time_rec);
103 #define gss_init_sec_context    Curl_gss_init_sec_context_a
104
105
106 extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 * minor_status,
107                                                gss_ctx_id_t * context_handle,
108                                                gss_buffer_t output_token);
109 #define gss_delete_sec_context  Curl_gss_delete_sec_context_a
110
111 /* LDAP wrappers. */
112
113 #define BerValue                struct berval
114
115 #define ldap_url_parse          ldap_url_parse_utf8
116 #define ldap_init               Curl_ldap_init_a
117 #define ldap_simple_bind_s      Curl_ldap_simple_bind_s_a
118 #define ldap_search_s           Curl_ldap_search_s_a
119 #define ldap_get_values_len     Curl_ldap_get_values_len_a
120 #define ldap_err2string         Curl_ldap_err2string_a
121 #define ldap_get_dn             Curl_ldap_get_dn_a
122 #define ldap_first_attribute    Curl_ldap_first_attribute_a
123 #define ldap_next_attribute     Curl_ldap_next_attribute_a
124
125 /* Some socket functions must be wrapped to process textual addresses
126    like AF_UNIX. */
127
128 extern int Curl_os400_connect(int sd, struct sockaddr * destaddr, int addrlen);
129 extern int Curl_os400_bind(int sd, struct sockaddr * localaddr, int addrlen);
130 extern int Curl_os400_sendto(int sd, char * buffer, int buflen, int flags,
131             struct sockaddr * dstaddr, int addrlen);
132 extern int Curl_os400_recvfrom(int sd, char * buffer, int buflen, int flags,
133                                 struct sockaddr * fromaddr, int * addrlen);
134
135 #define connect                 Curl_os400_connect
136 #define bind                    Curl_os400_bind
137 #define sendto                  Curl_os400_sendto
138 #define recvfrom                Curl_os400_recvfrom
139
140
141 #endif /* __SETUP_OS400_H */