Qpid Proton C API  0.17.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
transport.h
Go to the documentation of this file.
1 #ifndef PROTON_TRANSPORT_H
2 #define PROTON_TRANSPORT_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 <stddef.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
57 typedef int pn_trace_t;
58 
62 typedef void (*pn_tracer_t)(pn_transport_t *transport, const char *message);
63 
67 #define PN_TRACE_OFF (0)
68 
72 #define PN_TRACE_RAW (1)
73 
77 #define PN_TRACE_FRM (2)
78 
82 #define PN_TRACE_DRV (4)
83 
87 #define PN_TRACE_EVT (8)
88 
109 PN_EXTERN pn_transport_t *pn_transport(void);
110 
116 PN_EXTERN void pn_transport_set_server(pn_transport_t *transport);
117 
126 PN_EXTERN void pn_transport_free(pn_transport_t *transport);
127 
146 PN_EXTERN const char *pn_transport_get_user(pn_transport_t *transport);
147 
162 PN_EXTERN void pn_transport_require_auth(pn_transport_t *transport, bool required);
163 
173 PN_EXTERN bool pn_transport_is_authenticated(pn_transport_t *transport);
174 
187 PN_EXTERN void pn_transport_require_encryption(pn_transport_t *transport, bool required);
188 
198 PN_EXTERN bool pn_transport_is_encrypted(pn_transport_t *transport);
199 
213 
217 PN_EXTERN pn_error_t *pn_transport_error(pn_transport_t *transport);
218 
224 PN_EXTERN int pn_transport_bind(pn_transport_t *transport, pn_connection_t *connection);
225 
231 PN_EXTERN int pn_transport_unbind(pn_transport_t *transport);
232 
244 PN_EXTERN void pn_transport_trace(pn_transport_t *transport, pn_trace_t trace);
245 
258 PN_EXTERN void pn_transport_set_tracer(pn_transport_t *transport, pn_tracer_t tracer);
259 
269 
281 PN_EXTERN void *pn_transport_get_context(pn_transport_t *transport);
282 
294 PN_EXTERN void pn_transport_set_context(pn_transport_t *transport, void *context);
295 
302 PN_EXTERN pn_record_t *pn_transport_attachments(pn_transport_t *transport);
303 
315 PN_EXTERN void pn_transport_log(pn_transport_t *transport, const char *message);
316 
330 PN_EXTERN void pn_transport_vlogf(pn_transport_t *transport, const char *fmt, va_list ap);
331 
344 PN_EXTERN void pn_transport_logf(pn_transport_t *transport, const char *fmt, ...);
345 
358 PN_EXTERN uint16_t pn_transport_get_channel_max(pn_transport_t *transport);
359 
379 PN_EXTERN int pn_transport_set_channel_max(pn_transport_t *transport, uint16_t channel_max);
380 
389 PN_EXTERN uint16_t pn_transport_remote_channel_max(pn_transport_t *transport);
390 
399 PN_EXTERN uint32_t pn_transport_get_max_frame(pn_transport_t *transport);
400 
409 PN_EXTERN void pn_transport_set_max_frame(pn_transport_t *transport, uint32_t size);
410 
419 PN_EXTERN uint32_t pn_transport_get_remote_max_frame(pn_transport_t *transport);
420 
432 
443 PN_EXTERN void pn_transport_set_idle_timeout(pn_transport_t *transport, pn_millis_t timeout);
444 
456 
460 PN_EXTERN ssize_t pn_transport_input(pn_transport_t *transport, const char *bytes, size_t available);
461 
465 PN_EXTERN ssize_t pn_transport_output(pn_transport_t *transport, char *bytes, size_t size);
466 
481 PN_EXTERN ssize_t pn_transport_capacity(pn_transport_t *transport);
482 
493 PN_EXTERN char *pn_transport_tail(pn_transport_t *transport);
494 
510 PN_EXTERN ssize_t pn_transport_push(pn_transport_t *transport, const char *src, size_t size);
511 
525 PN_EXTERN int pn_transport_process(pn_transport_t *transport, size_t size);
526 
535 PN_EXTERN int pn_transport_close_tail(pn_transport_t *transport);
536 
551 PN_EXTERN ssize_t pn_transport_pending(pn_transport_t *transport);
552 
565 PN_EXTERN const char *pn_transport_head(pn_transport_t *transport);
566 
579 PN_EXTERN ssize_t pn_transport_peek(pn_transport_t *transport, char *dst, size_t size);
580 
592 PN_EXTERN void pn_transport_pop(pn_transport_t *transport, size_t size);
593 
602 PN_EXTERN int pn_transport_close_head(pn_transport_t *transport);
603 
610 PN_EXTERN bool pn_transport_quiesced(pn_transport_t *transport);
611 
622 PN_EXTERN bool pn_transport_closed(pn_transport_t *transport);
623 
640 
647 PN_EXTERN uint64_t pn_transport_get_frames_output(const pn_transport_t *transport);
648 
655 PN_EXTERN uint64_t pn_transport_get_frames_input(const pn_transport_t *transport);
656 
665 
666 #ifdef __cplusplus
667 }
668 #endif
669 
674 #endif /* transport.h */