C AMQP Protocol Engine API  0.7
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros 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 <stddef.h>
28 #include <sys/types.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 
94 
104 
120 
126 PN_EXTERN int pn_transport_bind(pn_transport_t *transport, pn_connection_t *connection);
127 
134 
144 PN_EXTERN void pn_transport_trace(pn_transport_t *transport, pn_trace_t trace);
145 
157 
165 
176 
186 PN_EXTERN void pn_transport_set_context(pn_transport_t *transport, void *context);
187 
197 PN_EXTERN void pn_transport_log(pn_transport_t *transport, const char *message);
198 
209 PN_EXTERN void pn_transport_logf(pn_transport_t *transport, const char *fmt, ...);
210 
218 
225 PN_EXTERN void pn_transport_set_channel_max(pn_transport_t *transport, uint16_t channel_max);
226 
234 
242 
249 PN_EXTERN void pn_transport_set_max_frame(pn_transport_t *transport, uint32_t size);
250 
258 
268 
278 
288 
292 PN_EXTERN ssize_t pn_transport_input(pn_transport_t *transport, const char *bytes, size_t available);
296 PN_EXTERN ssize_t pn_transport_output(pn_transport_t *transport, char *bytes, size_t size);
297 
313 
324 PN_EXTERN char *pn_transport_tail(pn_transport_t *transport);
325 
340 PN_EXTERN int pn_transport_push(pn_transport_t *transport, const char *src, size_t size);
341 
355 PN_EXTERN int pn_transport_process(pn_transport_t *transport, size_t size);
356 
366 
381 PN_EXTERN ssize_t pn_transport_pending(pn_transport_t *transport);
382 
395 PN_EXTERN const char *pn_transport_head(pn_transport_t *transport);
396 
409 PN_EXTERN int pn_transport_peek(pn_transport_t *transport, char *dst, size_t size);
410 
422 PN_EXTERN void pn_transport_pop(pn_transport_t *transport, size_t size);
423 
433 
441 
453 
470 
477 PN_EXTERN uint64_t pn_transport_get_frames_output(const pn_transport_t *transport);
478 
485 PN_EXTERN uint64_t pn_transport_get_frames_input(const pn_transport_t *transport);
486 
487 #ifdef __cplusplus
488 }
489 #endif
490 
494 #endif /* transport.h */