00001 #ifndef PROTON_FRAMING_H
00002 #define PROTON_FRAMING_H 1
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <proton/import_export.h>
00026 #ifndef __cplusplus
00027 #include <stdint.h>
00028 #else
00029 #include <proton/type_compat.h>
00030 #endif
00031 #include <sys/types.h>
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 #define AMQP_HEADER_SIZE (8)
00038 #define AMQP_MIN_MAX_FRAME_SIZE ((uint32_t)512) // minimum allowable max-frame
00039
00040 typedef struct {
00041 uint8_t type;
00042 uint16_t channel;
00043 size_t ex_size;
00044 const char *extended;
00045 size_t size;
00046 const char *payload;
00047 } pn_frame_t;
00048
00049 PN_EXTERN size_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available);
00050 PN_EXTERN size_t pn_write_frame(char *bytes, size_t size, pn_frame_t frame);
00051
00052 #ifdef __cplusplus
00053 }
00054 #endif
00055
00056 #endif