Qpid Proton C API  0.37.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 <proton/object.h>
31 #include <stddef.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
58 PN_EXTERN pn_link_t *pn_sender(pn_session_t *session, const char *name);
59 
72 PN_EXTERN pn_link_t *pn_receiver(pn_session_t *session, const char *name);
73 
83 PN_EXTERN void pn_link_free(pn_link_t *link);
84 
94 PN_EXTERN void *pn_link_get_context(pn_link_t *link);
95 
105 PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context);
106 
113 PN_EXTERN pn_record_t *pn_link_attachments(pn_link_t *link);
114 
121 PN_EXTERN const char *pn_link_name(pn_link_t *link);
122 
129 PN_EXTERN bool pn_link_is_sender(pn_link_t *link);
130 
137 PN_EXTERN bool pn_link_is_receiver(pn_link_t *link);
138 
146 
163 /* PN_DEPRECATED("Use pn_link_condition") */
165 
186 
202 
213 
229 PN_EXTERN pn_link_t *pn_link_head(pn_connection_t *connection, pn_state_t state);
230 
244 PN_EXTERN pn_link_t *pn_link_next(pn_link_t *link, pn_state_t state);
245 
254 PN_EXTERN void pn_link_open(pn_link_t *link);
255 
266 PN_EXTERN void pn_link_close(pn_link_t *link);
267 
273 PN_EXTERN void pn_link_detach(pn_link_t *link);
274 
285 
296 
309 
322 
339 
364 PN_EXTERN bool pn_link_advance(pn_link_t *link);
365 
389 PN_EXTERN int pn_link_credit(pn_link_t *link);
390 
403 PN_EXTERN int pn_link_queued(pn_link_t *link);
404 
416 PN_EXTERN int pn_link_remote_credit(pn_link_t *link);
417 
430 PN_EXTERN bool pn_link_get_drain(pn_link_t *link);
431 
451 PN_EXTERN int pn_link_drained(pn_link_t *link);
452 
464 PN_EXTERN int pn_link_available(pn_link_t *link);
465 
474 typedef enum {
475  PN_SND_UNSETTLED = 0,
477  PN_SND_SETTLED = 1,
479  PN_SND_MIXED = 2
482 
491 typedef enum {
492  PN_RCV_FIRST = 0,
494  PN_RCV_SECOND = 1
497 
505 
513 
521 
529 
537 
545 
552 PN_EXTERN int pn_link_unsettled(pn_link_t *link);
553 
561 
569 
577 PN_EXTERN void pn_link_offered(pn_link_t *sender, int credit);
578 
587 PN_EXTERN ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n);
588 
595 PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit);
596 
606 PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit);
607 
614 PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain);
615 
640 PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n);
641 
651 PN_EXTERN bool pn_link_draining(pn_link_t *receiver);
652 
661 PN_EXTERN uint64_t pn_link_max_message_size(pn_link_t *link);
662 
671 PN_EXTERN void pn_link_set_max_message_size(pn_link_t *link, uint64_t size);
672 
681 PN_EXTERN uint64_t pn_link_remote_max_message_size(pn_link_t *link);
682 
698 
711 
716 #ifdef __cplusplus
717 }
718 #endif
719 
720 #endif /* link.h */
721 
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:375
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.