Qpid Proton C API  0.38.0
link.h
Go to the documentation of this file.
1 #ifndef PROTON_LINK_H
2 #define PROTON_LINK_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/type_compat.h>
27 #include <proton/condition.h>
28 #include <proton/terminus.h>
29 #include <proton/types.h>
30 #include <stddef.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
57 PN_EXTERN pn_link_t *pn_sender(pn_session_t *session, const char *name);
58 
71 PN_EXTERN pn_link_t *pn_receiver(pn_session_t *session, const char *name);
72 
82 PN_EXTERN void pn_link_free(pn_link_t *link);
83 
93 PN_EXTERN void *pn_link_get_context(pn_link_t *link);
94 
104 PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context);
105 
113 
120 PN_EXTERN const char *pn_link_name(pn_link_t *link);
121 
128 PN_EXTERN bool pn_link_is_sender(pn_link_t *link);
129 
136 PN_EXTERN bool pn_link_is_receiver(pn_link_t *link);
137 
145 
162 /* PN_DEPRECATED("Use pn_link_condition") */
164 
185 
201 
212 
228 PN_EXTERN pn_link_t *pn_link_head(pn_connection_t *connection, pn_state_t state);
229 
243 PN_EXTERN pn_link_t *pn_link_next(pn_link_t *link, pn_state_t state);
244 
253 PN_EXTERN void pn_link_open(pn_link_t *link);
254 
265 PN_EXTERN void pn_link_close(pn_link_t *link);
266 
272 PN_EXTERN void pn_link_detach(pn_link_t *link);
273 
284 
295 
308 
321 
338 
363 PN_EXTERN bool pn_link_advance(pn_link_t *link);
364 
388 PN_EXTERN int pn_link_credit(pn_link_t *link);
389 
402 PN_EXTERN int pn_link_queued(pn_link_t *link);
403 
415 PN_EXTERN int pn_link_remote_credit(pn_link_t *link);
416 
429 PN_EXTERN bool pn_link_get_drain(pn_link_t *link);
430 
450 PN_EXTERN int pn_link_drained(pn_link_t *link);
451 
463 PN_EXTERN int pn_link_available(pn_link_t *link);
464 
473 typedef enum {
474  PN_SND_UNSETTLED = 0,
476  PN_SND_SETTLED = 1,
478  PN_SND_MIXED = 2
481 
490 typedef enum {
491  PN_RCV_FIRST = 0,
493  PN_RCV_SECOND = 1
496 
504 
512 
520 
528 
536 
544 
551 PN_EXTERN int pn_link_unsettled(pn_link_t *link);
552 
560 
568 
576 PN_EXTERN void pn_link_offered(pn_link_t *sender, int credit);
577 
586 PN_EXTERN ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n);
587 
594 PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit);
595 
605 PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit);
606 
613 PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain);
614 
639 PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n);
640 
650 PN_EXTERN bool pn_link_draining(pn_link_t *receiver);
651 
660 PN_EXTERN uint64_t pn_link_max_message_size(pn_link_t *link);
661 
670 PN_EXTERN void pn_link_set_max_message_size(pn_link_t *link, uint64_t size);
671 
680 PN_EXTERN uint64_t pn_link_remote_max_message_size(pn_link_t *link);
681 
697 
710 
715 #ifdef __cplusplus
716 }
717 #endif
718 
719 #endif /* link.h */
720 
An endpoint error state.
struct pn_condition_t pn_condition_t
An AMQP Condition object.
Definition: condition.h:64
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition: types.h:285
int pn_state_t
Holds the state flags for an AMQP endpoint.
Definition: types.h:271
struct pn_data_t pn_data_t
An AMQP Data object.
Definition: codec.h:374
struct pn_delivery_t pn_delivery_t
An AMQP Delivery object.
Definition: types.h:405
struct pn_error_t pn_error_t
An int error code and some string text to describe the error.
Definition: error.h:44
struct pn_session_t pn_session_t
An AMQP Session object.
Definition: types.h:296
struct pn_terminus_t pn_terminus_t
Encapsulates the endpoint state associated with an AMQP Terminus.
Definition: terminus.h:53
A source or target for messages.
AMQP and API data types.
struct pn_record_t pn_record_t
A type representing attached context information.
Definition: types.h:477