Qpid Proton C API  0.17.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
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 
589 //PN_EXTERN void pn_link_abort(pn_sender_t *sender);
590 
597 PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit);
598 
608 PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit);
609 
616 PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain);
617 
636 PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n);
637 
647 PN_EXTERN bool pn_link_draining(pn_link_t *receiver);
648 
657 PN_EXTERN uint64_t pn_link_max_message_size(pn_link_t *link);
658 
667 PN_EXTERN void pn_link_set_max_message_size(pn_link_t *link, uint64_t size);
668 
677 PN_EXTERN uint64_t pn_link_remote_max_message_size(pn_link_t *link);
678 
683 #ifdef __cplusplus
684 }
685 #endif
686 
687 #endif /* link.h */
688