Qpid Proton C API  0.18.0
connection.h
Go to the documentation of this file.
1 #ifndef PROTON_CONNECTION_H
2 #define PROTON_CONNECTION_H 1
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include <proton/import_export.h>
26 #include <proton/codec.h>
27 #include <proton/condition.h>
28 #include <proton/error.h>
29 #include <proton/type_compat.h>
30 #include <proton/types.h>
31 
32 #include <stddef.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
50 #define PN_LOCAL_UNINIT (1)
51 
55 #define PN_LOCAL_ACTIVE (2)
56 
60 #define PN_LOCAL_CLOSED (4)
61 
65 #define PN_REMOTE_UNINIT (8)
66 
70 #define PN_REMOTE_ACTIVE (16)
71 
75 #define PN_REMOTE_CLOSED (32)
76 
81 #define PN_LOCAL_MASK (PN_LOCAL_UNINIT | PN_LOCAL_ACTIVE | PN_LOCAL_CLOSED)
82 
87 #define PN_REMOTE_MASK (PN_REMOTE_UNINIT | PN_REMOTE_ACTIVE | PN_REMOTE_CLOSED)
88 
89 PN_EXTERN pn_connection_t *pn_connection(void);
90 
96 PN_EXTERN pn_connection_t *pn_connection(void);
97 
107 PN_EXTERN void pn_connection_free(pn_connection_t *connection);
108 
118 PN_EXTERN void pn_connection_release(pn_connection_t *connection);
119 
136 PN_EXTERN pn_error_t *pn_connection_error(pn_connection_t *connection);
137 
156 PN_EXTERN void pn_connection_collect(pn_connection_t *connection, pn_collector_t *collector);
157 
163 
176 PN_EXTERN void *pn_connection_get_context(pn_connection_t *connection);
177 
189 PN_EXTERN void pn_connection_set_context(pn_connection_t *connection, void *context);
190 
197 PN_EXTERN pn_record_t *pn_connection_attachments(pn_connection_t *connection);
198 
205 PN_EXTERN pn_state_t pn_connection_state(pn_connection_t *connection);
206 
215 PN_EXTERN void pn_connection_open(pn_connection_t *connection);
216 
227 PN_EXTERN void pn_connection_close(pn_connection_t *connection);
228 
237 PN_EXTERN void pn_connection_reset(pn_connection_t *connection);
238 
256 
272 
283 PN_EXTERN const char *pn_connection_get_container(pn_connection_t *connection);
284 
291 PN_EXTERN void pn_connection_set_container(pn_connection_t *connection, const char *container);
292 
307 PN_EXTERN void pn_connection_set_user(pn_connection_t *connection, const char *user);
308 
322 PN_EXTERN void pn_connection_set_password(pn_connection_t *connection, const char *password);
323 
330 PN_EXTERN const char *pn_connection_get_user(pn_connection_t *connection);
331 
342 PN_EXTERN const char *pn_connection_get_hostname(pn_connection_t *connection);
343 
357 PN_EXTERN void pn_connection_set_hostname(pn_connection_t *connection, const char *hostname);
358 
373 PN_EXTERN const char *pn_connection_remote_container(pn_connection_t *connection);
374 
388 PN_EXTERN const char *pn_connection_remote_hostname(pn_connection_t *connection);
389 
407 
425 
441 PN_EXTERN pn_data_t *pn_connection_properties(pn_connection_t *connection);
442 
456 
470 
484 
495 
500 #ifdef __cplusplus
501 }
502 #endif
503 
504 #endif /* connection.h */
void * pn_connection_get_context(pn_connection_t *connection)
Deprecated - Use pn_connection_attachments().
pn_data_t * pn_connection_remote_properties(pn_connection_t *connection)
Access the AMQP connection properties supplied by the remote connection endpoint. ...
AMQP and API data types.
pn_condition_t * pn_connection_remote_condition(pn_connection_t *connection)
Get the remote condition associated with the connection endpoint.
pn_state_t pn_connection_state(pn_connection_t *connection)
Get the endpoint state flags for a connection.
struct pn_transport_t pn_transport_t
A network channel supporting an AMQP connection.
Definition: types.h:431
AMQP data encoding and decoding.
pn_data_t * pn_connection_remote_desired_capabilities(pn_connection_t *connection)
Access the AMQP desired capabilites supplied by the remote connection endpoint.
const char * pn_connection_remote_container(pn_connection_t *connection)
Get the AMQP Container name advertised by the remote connection endpoint.
struct pn_error_t pn_error_t
An int error code and some string text to describe the error.
Definition: error.h:44
void pn_connection_set_user(pn_connection_t *connection, const char *user)
Set the authentication username for a client connection.
struct pn_collector_t pn_collector_t
An event collector.
Definition: types.h:413
A Proton API error.
pn_data_t * pn_connection_desired_capabilities(pn_connection_t *connection)
Access/modify the AMQP desired capabilities data for a connection object.
void pn_connection_free(pn_connection_t *connection)
Free a connection object.
An endpoint error state.
pn_condition_t * pn_connection_condition(pn_connection_t *connection)
Get the local condition associated with the connection endpoint.
void pn_connection_set_context(pn_connection_t *connection, void *context)
Deprecated - Use pn_connection_attachments().
const char * pn_connection_get_container(pn_connection_t *connection)
Get the AMQP Container name advertised by a connection object.
pn_data_t * pn_connection_offered_capabilities(pn_connection_t *connection)
Access/modify the AMQP offered capabilities data for a connection object.
pn_record_t * pn_connection_attachments(pn_connection_t *connection)
Get the attachments that are associated with a connection object.
const char * pn_connection_get_hostname(pn_connection_t *connection)
Get the value of the AMQP Hostname used by a connection object.
void pn_connection_close(pn_connection_t *connection)
Close a connection.
struct pn_data_t pn_data_t
An AMQP Data object.
Definition: codec.h:364
void pn_connection_set_password(pn_connection_t *connection, const char *password)
Set the authentication password for a client connection.
pn_data_t * pn_connection_properties(pn_connection_t *connection)
Access/modify the AMQP properties data for a connection object.
void pn_connection_release(pn_connection_t *connection)
Release a connection object.
pn_data_t * pn_connection_remote_offered_capabilities(pn_connection_t *connection)
Access the AMQP offered capabilites supplied by the remote connection endpoint.
void pn_connection_set_container(pn_connection_t *connection, const char *container)
Set the AMQP Container name advertised by a connection object.
void pn_connection_collect(pn_connection_t *connection, pn_collector_t *collector)
Associate a connection object with an event collector.
void pn_connection_open(pn_connection_t *connection)
Open a connection.
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition: types.h:281
const char * pn_connection_get_user(pn_connection_t *connection)
Get the authentication username for a client connection.
const char * pn_connection_remote_hostname(pn_connection_t *connection)
Get the AMQP Hostname set by the remote connection endpoint.
struct pn_condition_t pn_condition_t
An AMQP Condition object.
Definition: condition.h:64
pn_error_t * pn_connection_error(pn_connection_t *connection)
Deprecated
int pn_state_t
Holds the state flags for an AMQP endpoint.
Definition: types.h:267
pn_connection_t * pn_connection(void)
Factory to construct a new Connection.
void pn_connection_set_hostname(pn_connection_t *connection, const char *hostname)
Set the name of the virtual host (either fully qualified or relative) to which this connection is con...
pn_transport_t * pn_connection_transport(pn_connection_t *connection)
Get the transport bound to a connection object.
void pn_connection_reset(pn_connection_t *connection)
Reset a connection object back to the uninitialized state.
pn_collector_t * pn_connection_collector(pn_connection_t *connection)
Get the collector set with pn_connection_collect()