C AMQP Protocol Engine API  0.5
proton/driver.h
Go to the documentation of this file.
00001 #ifndef PROTON_DRIVER_H
00002 #define PROTON_DRIVER_H 1
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  *
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
00022  *
00023  */
00024 
00025 #include <proton/import_export.h>
00026 #include <proton/error.h>
00027 #include <proton/engine.h>
00028 #include <proton/sasl.h>
00029 #include <proton/ssl.h>
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00050 typedef struct pn_driver_t pn_driver_t;
00051 typedef struct pn_listener_t pn_listener_t;
00052 typedef struct pn_connector_t pn_connector_t;
00053 
00054 typedef enum {
00055   PN_CONNECTOR_WRITABLE,
00056   PN_CONNECTOR_READABLE
00057 } pn_activate_criteria_t;
00058 
00064 PN_EXTERN pn_driver_t *pn_driver(void);
00065 
00072 PN_EXTERN int pn_driver_errno(pn_driver_t *d);
00073 
00080 PN_EXTERN const char *pn_driver_error(pn_driver_t *d);
00081 
00088 PN_EXTERN void pn_driver_trace(pn_driver_t *driver, pn_trace_t trace);
00089 
00096 PN_EXTERN int pn_driver_wakeup(pn_driver_t *driver);
00097 
00106 PN_EXTERN int pn_driver_wait(pn_driver_t *driver, int timeout);
00107 
00113 PN_EXTERN pn_listener_t *pn_driver_listener(pn_driver_t *driver);
00114 
00123 PN_EXTERN pn_connector_t *pn_driver_connector(pn_driver_t *driver);
00124 
00131 PN_EXTERN void pn_driver_free(pn_driver_t *driver);
00132 
00133 
00145 PN_EXTERN pn_listener_t *pn_listener(pn_driver_t *driver, const char *host,
00146                            const char *port, void* context);
00147 
00154 PN_EXTERN pn_listener_t *pn_listener_head(pn_driver_t *driver);
00155 
00163 PN_EXTERN pn_listener_t *pn_listener_next(pn_listener_t *listener);
00164 
00168 PN_EXTERN void pn_listener_trace(pn_listener_t *listener, pn_trace_t trace);
00169 
00175 PN_EXTERN pn_connector_t *pn_listener_accept(pn_listener_t *listener);
00176 
00183 PN_EXTERN void *pn_listener_context(pn_listener_t *listener);
00184 
00185 PN_EXTERN void pn_listener_set_context(pn_listener_t *listener, void *context);
00186 
00191 PN_EXTERN void pn_listener_close(pn_listener_t *listener);
00192 
00200 PN_EXTERN void pn_listener_free(pn_listener_t *listener);
00201 
00202 
00203 
00204 
00216 PN_EXTERN pn_connector_t *pn_connector(pn_driver_t *driver, const char *host,
00217                              const char *port, void* context);
00218 
00225 PN_EXTERN pn_connector_t *pn_connector_head(pn_driver_t *driver);
00226 
00234 PN_EXTERN pn_connector_t *pn_connector_next(pn_connector_t *connector);
00235 
00241 PN_EXTERN void pn_connector_trace(pn_connector_t *connector, pn_trace_t trace);
00242 
00250 PN_EXTERN void pn_connector_process(pn_connector_t *connector);
00251 
00259 PN_EXTERN pn_listener_t *pn_connector_listener(pn_connector_t *connector);
00260 
00268 PN_EXTERN pn_sasl_t *pn_connector_sasl(pn_connector_t *connector);
00269 
00276 PN_EXTERN pn_connection_t *pn_connector_connection(pn_connector_t *connector);
00277 
00284 PN_EXTERN void pn_connector_set_connection(pn_connector_t *connector, pn_connection_t *connection);
00285 
00293 PN_EXTERN void *pn_connector_context(pn_connector_t *connector);
00294 
00301 PN_EXTERN void pn_connector_set_context(pn_connector_t *connector, void *context);
00302 
00308 PN_EXTERN const char *pn_connector_name(const pn_connector_t *connector);
00309 
00315 PN_EXTERN pn_transport_t *pn_connector_transport(pn_connector_t *connector);
00316 
00321 PN_EXTERN void pn_connector_close(pn_connector_t *connector);
00322 
00327 PN_EXTERN bool pn_connector_closed(pn_connector_t *connector);
00328 
00336 PN_EXTERN void pn_connector_free(pn_connector_t *connector);
00337 
00346 PN_EXTERN void pn_connector_activate(pn_connector_t *connector, pn_activate_criteria_t criteria);
00347 
00362 PN_EXTERN bool pn_connector_activated(pn_connector_t *connector, pn_activate_criteria_t criteria);
00363 
00364 
00365 #ifdef __cplusplus
00366 }
00367 #endif
00368 
00369 #endif /* driver.h */