1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef INCLUDED_CALLBACKS_HXX
24 #define INCLUDED_CALLBACKS_HXX
25 
26 #include <serf/serf.h>
27 
28 extern "C" apr_status_t Serf_ConnectSetup( apr_socket_t *skt,
29                                            serf_bucket_t **read_bkt,
30                                            serf_bucket_t **write_bkt,
31                                            void *setup_baton,
32                                            apr_pool_t *pool );
33 
34 extern "C" apr_status_t Serf_Credentials( char **username,
35                                           char **password,
36                                           serf_request_t *request,
37                                           void *baton,
38                                           int code,
39                                           const char *authn_type,
40                                           const char *realm,
41                                           apr_pool_t *pool );
42 
43 extern "C" apr_status_t Serf_CertificateChainValidation(
44     void* pSerfSession,
45     int nFailures,
46     int error_depth,
47     const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
48     apr_size_t nCertificateChainLength);
49 
50 extern "C" apr_status_t Serf_SetupRequest( serf_request_t *request,
51                                            void *setup_baton,
52                                            serf_bucket_t **req_bkt,
53                                            serf_response_acceptor_t *acceptor,
54                                            void **acceptor_baton,
55                                            serf_response_handler_t *handler,
56                                            void **handler_baton,
57                                            apr_pool_t * pool );
58 
59 extern "C" serf_bucket_t* Serf_AcceptResponse( serf_request_t *request,
60                                                serf_bucket_t *stream,
61                                                void *acceptor_baton,
62                                                apr_pool_t *pool );
63 
64 extern "C" apr_status_t Serf_HandleResponse( serf_request_t *request,
65                                              serf_bucket_t *response,
66                                              void *handler_baton,
67                                              apr_pool_t *pool );
68 
69 #endif // INCLUDED_CALLBACKS_HXX
70