00001 #ifndef PROTON_CONNECTION_H 00002 #define PROTON_CONNECTION_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/codec.h> 00027 #include <proton/condition.h> 00028 #include <proton/error.h> 00029 #include <proton/type_compat.h> 00030 #include <proton/types.h> 00031 00032 #include <stddef.h> 00033 00034 #ifdef __cplusplus 00035 extern "C" { 00036 #endif 00037 00050 #define PN_LOCAL_UNINIT (1) 00051 00055 #define PN_LOCAL_ACTIVE (2) 00056 00060 #define PN_LOCAL_CLOSED (4) 00061 00065 #define PN_REMOTE_UNINIT (8) 00066 00070 #define PN_REMOTE_ACTIVE (16) 00071 00075 #define PN_REMOTE_CLOSED (32) 00076 00081 #define PN_LOCAL_MASK (PN_LOCAL_UNINIT | PN_LOCAL_ACTIVE | PN_LOCAL_CLOSED) 00082 00087 #define PN_REMOTE_MASK (PN_REMOTE_UNINIT | PN_REMOTE_ACTIVE | PN_REMOTE_CLOSED) 00088 00089 PN_EXTERN pn_connection_t *pn_connection(void); 00090 00096 PN_EXTERN pn_connection_t *pn_connection(void); 00097 00107 PN_EXTERN void pn_connection_free(pn_connection_t *connection); 00108 00118 PN_EXTERN void pn_connection_release(pn_connection_t *connection); 00119 00136 /* PN_DEPRECATED("Use pn_connection_condition") */ 00137 PN_EXTERN pn_error_t *pn_connection_error(pn_connection_t *connection); 00138 00157 PN_EXTERN void pn_connection_collect(pn_connection_t *connection, pn_collector_t *collector); 00158 00163 PN_EXTERN pn_collector_t* pn_connection_collector(pn_connection_t *connection); 00164 00175 PN_EXTERN void *pn_connection_get_context(pn_connection_t *connection); 00176 00186 PN_EXTERN void pn_connection_set_context(pn_connection_t *connection, void *context); 00187 00194 PN_EXTERN pn_record_t *pn_connection_attachments(pn_connection_t *connection); 00195 00202 PN_EXTERN pn_state_t pn_connection_state(pn_connection_t *connection); 00203 00212 PN_EXTERN void pn_connection_open(pn_connection_t *connection); 00213 00224 PN_EXTERN void pn_connection_close(pn_connection_t *connection); 00225 00234 PN_EXTERN void pn_connection_reset(pn_connection_t *connection); 00235 00252 PN_EXTERN pn_condition_t *pn_connection_condition(pn_connection_t *connection); 00253 00268 PN_EXTERN pn_condition_t *pn_connection_remote_condition(pn_connection_t *connection); 00269 00280 PN_EXTERN const char *pn_connection_get_container(pn_connection_t *connection); 00281 00288 PN_EXTERN void pn_connection_set_container(pn_connection_t *connection, const char *container); 00289 00304 PN_EXTERN void pn_connection_set_user(pn_connection_t *connection, const char *user); 00305 00319 PN_EXTERN void pn_connection_set_password(pn_connection_t *connection, const char *password); 00320 00327 PN_EXTERN const char *pn_connection_get_user(pn_connection_t *connection); 00328 00339 PN_EXTERN const char *pn_connection_get_hostname(pn_connection_t *connection); 00340 00354 PN_EXTERN void pn_connection_set_hostname(pn_connection_t *connection, const char *hostname); 00355 00370 PN_EXTERN const char *pn_connection_remote_container(pn_connection_t *connection); 00371 00385 PN_EXTERN const char *pn_connection_remote_hostname(pn_connection_t *connection); 00386 00403 PN_EXTERN pn_data_t *pn_connection_offered_capabilities(pn_connection_t *connection); 00404 00421 PN_EXTERN pn_data_t *pn_connection_desired_capabilities(pn_connection_t *connection); 00422 00438 PN_EXTERN pn_data_t *pn_connection_properties(pn_connection_t *connection); 00439 00452 PN_EXTERN pn_data_t *pn_connection_remote_offered_capabilities(pn_connection_t *connection); 00453 00466 PN_EXTERN pn_data_t *pn_connection_remote_desired_capabilities(pn_connection_t *connection); 00467 00480 PN_EXTERN pn_data_t *pn_connection_remote_properties(pn_connection_t *connection); 00481 00491 PN_EXTERN pn_transport_t *pn_connection_transport(pn_connection_t *connection); 00492 00497 #ifdef __cplusplus 00498 } 00499 #endif 00500 00501 #endif /* connection.h */