Qpid Proton C API  0.18.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 
96 PN_EXTERN void *pn_link_get_context(pn_link_t *link);
97 
109 PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context);
110 
117 PN_EXTERN pn_record_t *pn_link_attachments(pn_link_t *link);
118 
125 PN_EXTERN const char *pn_link_name(pn_link_t *link);
126 
133 PN_EXTERN bool pn_link_is_sender(pn_link_t *link);
134 
141 PN_EXTERN bool pn_link_is_receiver(pn_link_t *link);
142 
149 PN_EXTERN pn_state_t pn_link_state(pn_link_t *link);
150 
167 PN_EXTERN pn_error_t *pn_link_error(pn_link_t *link);
168 
185 PN_EXTERN pn_condition_t *pn_link_condition(pn_link_t *link);
186 
202 
212 PN_EXTERN pn_session_t *pn_link_session(pn_link_t *link);
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 
284 PN_EXTERN pn_terminus_t *pn_link_source(pn_link_t *link);
285 
295 PN_EXTERN pn_terminus_t *pn_link_target(pn_link_t *link);
296 
309 
322 
338 PN_EXTERN pn_delivery_t *pn_link_current(pn_link_t *link);
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 {
482 
491 typedef enum {
497 
505 
513 
521 
529 
537 
545 
552 PN_EXTERN int pn_link_unsettled(pn_link_t *link);
553 
560 PN_EXTERN pn_delivery_t *pn_unsettled_head(pn_link_t *link);
561 
568 PN_EXTERN pn_delivery_t *pn_unsettled_next(pn_delivery_t *delivery);
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 
687 #ifdef __cplusplus
688 }
689 #endif
690 
691 #endif /* link.h */
692 
AMQP and API data types.
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_terminus_t pn_terminus_t
Encapsulates the endpoint state associated with an AMQP Terminus.
Definition: terminus.h:53
struct pn_session_t pn_session_t
An AMQP Session object.
Definition: types.h:292
A source or target for messages.
An endpoint error state.
struct pn_delivery_t pn_delivery_t
An AMQP Delivery object.
Definition: types.h:401
struct pn_connection_t pn_connection_t
An AMQP Connection object.
Definition: types.h:281
struct pn_condition_t pn_condition_t
An AMQP Condition object.
Definition: condition.h:64
int pn_state_t
Holds the state flags for an AMQP endpoint.
Definition: types.h:267