Qpid Proton C API  0.17.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
messenger.h
Go to the documentation of this file.
1 #ifndef PROTON_MESSENGER_H
2 #define PROTON_MESSENGER_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/message.h>
27 #include <proton/selectable.h>
28 #include <proton/link.h>
29 #include <proton/transport.h>
30 #include <proton/ssl.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
157 
166 
171 typedef int64_t pn_tracker_t;
172 
177 typedef enum {
188 } pn_status_t;
189 
199 PNX_EXTERN pn_messenger_t *pn_messenger(const char *name);
200 
207 PNX_EXTERN const char *pn_messenger_name(pn_messenger_t *messenger);
208 
218 PNX_EXTERN int pn_messenger_set_certificate(pn_messenger_t *messenger, const char *certificate);
219 
227 PNX_EXTERN const char *pn_messenger_get_certificate(pn_messenger_t *messenger);
228 
237 PNX_EXTERN int pn_messenger_set_private_key(pn_messenger_t *messenger, const char *private_key);
238 
245 PNX_EXTERN const char *pn_messenger_get_private_key(pn_messenger_t *messenger);
246 
255 PNX_EXTERN int pn_messenger_set_password(pn_messenger_t *messenger, const char *password);
256 
263 PNX_EXTERN const char *pn_messenger_get_password(pn_messenger_t *messenger);
264 
276 PNX_EXTERN int pn_messenger_set_trusted_certificates(pn_messenger_t *messenger, const char *cert_db);
277 
284 PNX_EXTERN const char *pn_messenger_get_trusted_certificates(pn_messenger_t *messenger);
285 
298 PNX_EXTERN int pn_messenger_set_timeout(pn_messenger_t *messenger, int timeout);
299 
308 PNX_EXTERN int pn_messenger_get_timeout(pn_messenger_t *messenger);
309 
316 PNX_EXTERN bool pn_messenger_is_blocking(pn_messenger_t *messenger);
317 
326 PNX_EXTERN int pn_messenger_set_blocking(pn_messenger_t *messenger, bool blocking);
327 
340 PNX_EXTERN bool pn_messenger_is_passive(pn_messenger_t *messenger);
341 
352 PNX_EXTERN int pn_messenger_set_passive(pn_messenger_t *messenger, bool passive);
353 
359 PNX_EXTERN void pn_messenger_free(pn_messenger_t *messenger);
360 
374 PNX_EXTERN int pn_messenger_errno(pn_messenger_t *messenger);
375 
387 PNX_EXTERN pn_error_t *pn_messenger_error(pn_messenger_t *messenger);
388 
404 PNX_EXTERN int pn_messenger_get_outgoing_window(pn_messenger_t *messenger);
405 
416 PNX_EXTERN int pn_messenger_set_outgoing_window(pn_messenger_t *messenger, int window);
417 
436 PNX_EXTERN int pn_messenger_get_incoming_window(pn_messenger_t *messenger);
437 
448 PNX_EXTERN int pn_messenger_set_incoming_window(pn_messenger_t *messenger,
449  int window);
450 
459 PNX_EXTERN int pn_messenger_start(pn_messenger_t *messenger);
460 
475 PNX_EXTERN int pn_messenger_stop(pn_messenger_t *messenger);
476 
484 PNX_EXTERN bool pn_messenger_stopped(pn_messenger_t *messenger);
485 
493 PNX_EXTERN pn_subscription_t *pn_messenger_subscribe(pn_messenger_t *messenger, const char *source);
494 
505 PNX_EXTERN pn_subscription_t *
506 pn_messenger_subscribe_ttl(pn_messenger_t *messenger, const char *source,
507  pn_seconds_t timeout);
508 
518 PNX_EXTERN pn_link_t *pn_messenger_get_link(pn_messenger_t *messenger,
519  const char *address, bool sender);
520 
529 PNX_EXTERN void *pn_subscription_get_context(pn_subscription_t *sub);
530 
537 PNX_EXTERN void pn_subscription_set_context(pn_subscription_t *sub, void *context);
538 
545 PNX_EXTERN const char *pn_subscription_address(pn_subscription_t *sub);
546 
557 PNX_EXTERN int pn_messenger_put(pn_messenger_t *messenger, pn_message_t *msg);
558 
570 PNX_EXTERN pn_status_t pn_messenger_status(pn_messenger_t *messenger, pn_tracker_t tracker);
571 
583 PNX_EXTERN pn_delivery_t *pn_messenger_delivery(pn_messenger_t *messenger,
584  pn_tracker_t tracker);
585 
598 PNX_EXTERN bool pn_messenger_buffered(pn_messenger_t *messenger, pn_tracker_t tracker);
599 
612 PNX_EXTERN int pn_messenger_settle(pn_messenger_t *messenger, pn_tracker_t tracker, int flags);
613 
627 PNX_EXTERN pn_tracker_t pn_messenger_outgoing_tracker(pn_messenger_t *messenger);
628 
639 PNX_EXTERN int pn_messenger_work(pn_messenger_t *messenger, int timeout);
640 
652 PNX_EXTERN int pn_messenger_interrupt(pn_messenger_t *messenger);
653 
686 PNX_EXTERN int pn_messenger_send(pn_messenger_t *messenger, int n);
687 
712 PNX_EXTERN int pn_messenger_recv(pn_messenger_t *messenger, int limit);
713 
724 PNX_EXTERN int pn_messenger_receiving(pn_messenger_t *messenger);
725 
740 PNX_EXTERN int pn_messenger_get(pn_messenger_t *messenger, pn_message_t *message);
741 
755 PNX_EXTERN pn_tracker_t pn_messenger_incoming_tracker(pn_messenger_t *messenger);
756 
767 
771 #define PN_CUMULATIVE (0x1)
772 
794 PNX_EXTERN int pn_messenger_accept(pn_messenger_t *messenger, pn_tracker_t tracker, int flags);
795 
817 PNX_EXTERN int pn_messenger_reject(pn_messenger_t *messenger, pn_tracker_t tracker, int flags);
818 
826 PNX_EXTERN pn_link_t *pn_messenger_tracker_link(pn_messenger_t *messenger,
827  pn_tracker_t tracker);
828 
836 PNX_EXTERN int pn_messenger_outgoing(pn_messenger_t *messenger);
837 
844 PNX_EXTERN int pn_messenger_incoming(pn_messenger_t *messenger);
845 
908 PNX_EXTERN int pn_messenger_route(pn_messenger_t *messenger, const char *pattern,
909  const char *address);
910 
933 PNX_EXTERN int pn_messenger_rewrite(pn_messenger_t *messenger, const char *pattern,
934  const char *address);
935 
962 PNX_EXTERN pn_selectable_t *pn_messenger_selectable(pn_messenger_t *messenger);
963 
971 
972 #define PN_FLAGS_CHECK_ROUTES \
973  (0x1)
977 #define PN_FLAGS_ALLOW_INSECURE_MECHS \
978  (0x2)
990 PNX_EXTERN int pn_messenger_set_flags(pn_messenger_t *messenger,
991  const int flags);
992 
999 PNX_EXTERN int pn_messenger_get_flags(pn_messenger_t *messenger);
1000 
1007 PNX_EXTERN int pn_messenger_set_snd_settle_mode(pn_messenger_t *messenger,
1008  const pn_snd_settle_mode_t mode);
1009 
1016 PNX_EXTERN int pn_messenger_set_rcv_settle_mode(pn_messenger_t *messenger,
1017  const pn_rcv_settle_mode_t mode);
1018 
1025 PNX_EXTERN void pn_messenger_set_tracer(pn_messenger_t *messenger,
1026  pn_tracer_t tracer);
1027 
1035 PNX_EXTERN pn_millis_t
1037  const char *address);
1038 
1048 PNX_EXTERN int
1050  const pn_ssl_verify_mode_t mode);
1051 
1056 #ifdef __cplusplus
1057 }
1058 #endif
1059 
1060 #endif /* messenger.h */