37 #ifndef AMQP_FRAMING_H
38 #define AMQP_FRAMING_H
44 #define AMQP_PROTOCOL_VERSION_MAJOR 0
45 #define AMQP_PROTOCOL_VERSION_MINOR 9
46 #define AMQP_PROTOCOL_VERSION_REVISION 1
47 #define AMQP_PROTOCOL_PORT 5672
48 #define AMQP_FRAME_METHOD 1
49 #define AMQP_FRAME_HEADER 2
50 #define AMQP_FRAME_BODY 3
51 #define AMQP_FRAME_HEARTBEAT 8
52 #define AMQP_FRAME_MIN_SIZE 4096
53 #define AMQP_FRAME_END 206
54 #define AMQP_REPLY_SUCCESS 200
55 #define AMQP_CONTENT_TOO_LARGE 311
56 #define AMQP_NO_ROUTE 312
57 #define AMQP_NO_CONSUMERS 313
58 #define AMQP_ACCESS_REFUSED 403
59 #define AMQP_NOT_FOUND 404
60 #define AMQP_RESOURCE_LOCKED 405
61 #define AMQP_PRECONDITION_FAILED 406
62 #define AMQP_CONNECTION_FORCED 320
63 #define AMQP_INVALID_PATH 402
64 #define AMQP_FRAME_ERROR 501
65 #define AMQP_SYNTAX_ERROR 502
66 #define AMQP_COMMAND_INVALID 503
67 #define AMQP_CHANNEL_ERROR 504
68 #define AMQP_UNEXPECTED_FRAME 505
69 #define AMQP_RESOURCE_ERROR 506
70 #define AMQP_NOT_ALLOWED 530
71 #define AMQP_NOT_IMPLEMENTED 540
72 #define AMQP_INTERNAL_ERROR 541
78 AMQP_CALL amqp_constant_name(
int constantNumber);
82 AMQP_CALL amqp_constant_is_hard_error(
int constantNumber);
101 AMQP_CALL amqp_decode_properties(uint16_t class_id,
114 AMQP_CALL amqp_encode_properties(uint16_t class_id,
120 #define AMQP_CONNECTION_START_METHOD ((amqp_method_number_t) 0x000A000A)
121 typedef struct amqp_connection_start_t_ {
122 uint8_t version_major;
123 uint8_t version_minor;
129 #define AMQP_CONNECTION_START_OK_METHOD ((amqp_method_number_t) 0x000A000B)
130 typedef struct amqp_connection_start_ok_t_ {
137 #define AMQP_CONNECTION_SECURE_METHOD ((amqp_method_number_t) 0x000A0014)
138 typedef struct amqp_connection_secure_t_ {
142 #define AMQP_CONNECTION_SECURE_OK_METHOD ((amqp_method_number_t) 0x000A0015)
143 typedef struct amqp_connection_secure_ok_t_ {
147 #define AMQP_CONNECTION_TUNE_METHOD ((amqp_method_number_t) 0x000A001E)
148 typedef struct amqp_connection_tune_t_ {
149 uint16_t channel_max;
154 #define AMQP_CONNECTION_TUNE_OK_METHOD ((amqp_method_number_t) 0x000A001F)
155 typedef struct amqp_connection_tune_ok_t_ {
156 uint16_t channel_max;
161 #define AMQP_CONNECTION_OPEN_METHOD ((amqp_method_number_t) 0x000A0028)
162 typedef struct amqp_connection_open_t_ {
168 #define AMQP_CONNECTION_OPEN_OK_METHOD ((amqp_method_number_t) 0x000A0029)
169 typedef struct amqp_connection_open_ok_t_ {
173 #define AMQP_CONNECTION_CLOSE_METHOD ((amqp_method_number_t) 0x000A0032)
174 typedef struct amqp_connection_close_t_ {
181 #define AMQP_CONNECTION_CLOSE_OK_METHOD ((amqp_method_number_t) 0x000A0033)
182 typedef struct amqp_connection_close_ok_t_ {
186 #define AMQP_CHANNEL_OPEN_METHOD ((amqp_method_number_t) 0x0014000A)
187 typedef struct amqp_channel_open_t_ {
191 #define AMQP_CHANNEL_OPEN_OK_METHOD ((amqp_method_number_t) 0x0014000B)
192 typedef struct amqp_channel_open_ok_t_ {
196 #define AMQP_CHANNEL_FLOW_METHOD ((amqp_method_number_t) 0x00140014)
197 typedef struct amqp_channel_flow_t_ {
201 #define AMQP_CHANNEL_FLOW_OK_METHOD ((amqp_method_number_t) 0x00140015)
202 typedef struct amqp_channel_flow_ok_t_ {
206 #define AMQP_CHANNEL_CLOSE_METHOD ((amqp_method_number_t) 0x00140028)
207 typedef struct amqp_channel_close_t_ {
214 #define AMQP_CHANNEL_CLOSE_OK_METHOD ((amqp_method_number_t) 0x00140029)
215 typedef struct amqp_channel_close_ok_t_ {
219 #define AMQP_ACCESS_REQUEST_METHOD ((amqp_method_number_t) 0x001E000A)
220 typedef struct amqp_access_request_t_ {
229 #define AMQP_ACCESS_REQUEST_OK_METHOD ((amqp_method_number_t) 0x001E000B)
230 typedef struct amqp_access_request_ok_t_ {
234 #define AMQP_EXCHANGE_DECLARE_METHOD ((amqp_method_number_t) 0x0028000A)
235 typedef struct amqp_exchange_declare_t_ {
247 #define AMQP_EXCHANGE_DECLARE_OK_METHOD ((amqp_method_number_t) 0x0028000B)
248 typedef struct amqp_exchange_declare_ok_t_ {
252 #define AMQP_EXCHANGE_DELETE_METHOD ((amqp_method_number_t) 0x00280014)
253 typedef struct amqp_exchange_delete_t_ {
260 #define AMQP_EXCHANGE_DELETE_OK_METHOD ((amqp_method_number_t) 0x00280015)
261 typedef struct amqp_exchange_delete_ok_t_ {
265 #define AMQP_EXCHANGE_BIND_METHOD ((amqp_method_number_t) 0x0028001E)
266 typedef struct amqp_exchange_bind_t_ {
275 #define AMQP_EXCHANGE_BIND_OK_METHOD ((amqp_method_number_t) 0x0028001F)
276 typedef struct amqp_exchange_bind_ok_t_ {
280 #define AMQP_EXCHANGE_UNBIND_METHOD ((amqp_method_number_t) 0x00280028)
281 typedef struct amqp_exchange_unbind_t_ {
290 #define AMQP_EXCHANGE_UNBIND_OK_METHOD ((amqp_method_number_t) 0x00280033)
291 typedef struct amqp_exchange_unbind_ok_t_ {
295 #define AMQP_QUEUE_DECLARE_METHOD ((amqp_method_number_t) 0x0032000A)
296 typedef struct amqp_queue_declare_t_ {
307 #define AMQP_QUEUE_DECLARE_OK_METHOD ((amqp_method_number_t) 0x0032000B)
308 typedef struct amqp_queue_declare_ok_t_ {
310 uint32_t message_count;
311 uint32_t consumer_count;
314 #define AMQP_QUEUE_BIND_METHOD ((amqp_method_number_t) 0x00320014)
315 typedef struct amqp_queue_bind_t_ {
324 #define AMQP_QUEUE_BIND_OK_METHOD ((amqp_method_number_t) 0x00320015)
325 typedef struct amqp_queue_bind_ok_t_ {
329 #define AMQP_QUEUE_PURGE_METHOD ((amqp_method_number_t) 0x0032001E)
330 typedef struct amqp_queue_purge_t_ {
336 #define AMQP_QUEUE_PURGE_OK_METHOD ((amqp_method_number_t) 0x0032001F)
337 typedef struct amqp_queue_purge_ok_t_ {
338 uint32_t message_count;
341 #define AMQP_QUEUE_DELETE_METHOD ((amqp_method_number_t) 0x00320028)
342 typedef struct amqp_queue_delete_t_ {
350 #define AMQP_QUEUE_DELETE_OK_METHOD ((amqp_method_number_t) 0x00320029)
351 typedef struct amqp_queue_delete_ok_t_ {
352 uint32_t message_count;
355 #define AMQP_QUEUE_UNBIND_METHOD ((amqp_method_number_t) 0x00320032)
356 typedef struct amqp_queue_unbind_t_ {
364 #define AMQP_QUEUE_UNBIND_OK_METHOD ((amqp_method_number_t) 0x00320033)
365 typedef struct amqp_queue_unbind_ok_t_ {
369 #define AMQP_BASIC_QOS_METHOD ((amqp_method_number_t) 0x003C000A)
370 typedef struct amqp_basic_qos_t_ {
371 uint32_t prefetch_size;
372 uint16_t prefetch_count;
376 #define AMQP_BASIC_QOS_OK_METHOD ((amqp_method_number_t) 0x003C000B)
377 typedef struct amqp_basic_qos_ok_t_ {
381 #define AMQP_BASIC_CONSUME_METHOD ((amqp_method_number_t) 0x003C0014)
382 typedef struct amqp_basic_consume_t_ {
393 #define AMQP_BASIC_CONSUME_OK_METHOD ((amqp_method_number_t) 0x003C0015)
394 typedef struct amqp_basic_consume_ok_t_ {
398 #define AMQP_BASIC_CANCEL_METHOD ((amqp_method_number_t) 0x003C001E)
399 typedef struct amqp_basic_cancel_t_ {
404 #define AMQP_BASIC_CANCEL_OK_METHOD ((amqp_method_number_t) 0x003C001F)
405 typedef struct amqp_basic_cancel_ok_t_ {
409 #define AMQP_BASIC_PUBLISH_METHOD ((amqp_method_number_t) 0x003C0028)
410 typedef struct amqp_basic_publish_t_ {
418 #define AMQP_BASIC_RETURN_METHOD ((amqp_method_number_t) 0x003C0032)
419 typedef struct amqp_basic_return_t_ {
426 #define AMQP_BASIC_DELIVER_METHOD ((amqp_method_number_t) 0x003C003C)
427 typedef struct amqp_basic_deliver_t_ {
429 uint64_t delivery_tag;
435 #define AMQP_BASIC_GET_METHOD ((amqp_method_number_t) 0x003C0046)
436 typedef struct amqp_basic_get_t_ {
442 #define AMQP_BASIC_GET_OK_METHOD ((amqp_method_number_t) 0x003C0047)
443 typedef struct amqp_basic_get_ok_t_ {
444 uint64_t delivery_tag;
448 uint32_t message_count;
451 #define AMQP_BASIC_GET_EMPTY_METHOD ((amqp_method_number_t) 0x003C0048)
452 typedef struct amqp_basic_get_empty_t_ {
456 #define AMQP_BASIC_ACK_METHOD ((amqp_method_number_t) 0x003C0050)
457 typedef struct amqp_basic_ack_t_ {
458 uint64_t delivery_tag;
462 #define AMQP_BASIC_REJECT_METHOD ((amqp_method_number_t) 0x003C005A)
463 typedef struct amqp_basic_reject_t_ {
464 uint64_t delivery_tag;
468 #define AMQP_BASIC_RECOVER_ASYNC_METHOD ((amqp_method_number_t) 0x003C0064)
469 typedef struct amqp_basic_recover_async_t_ {
473 #define AMQP_BASIC_RECOVER_METHOD ((amqp_method_number_t) 0x003C006E)
474 typedef struct amqp_basic_recover_t_ {
478 #define AMQP_BASIC_RECOVER_OK_METHOD ((amqp_method_number_t) 0x003C006F)
479 typedef struct amqp_basic_recover_ok_t_ {
483 #define AMQP_BASIC_NACK_METHOD ((amqp_method_number_t) 0x003C0078)
484 typedef struct amqp_basic_nack_t_ {
485 uint64_t delivery_tag;
490 #define AMQP_TX_SELECT_METHOD ((amqp_method_number_t) 0x005A000A)
491 typedef struct amqp_tx_select_t_ {
495 #define AMQP_TX_SELECT_OK_METHOD ((amqp_method_number_t) 0x005A000B)
496 typedef struct amqp_tx_select_ok_t_ {
500 #define AMQP_TX_COMMIT_METHOD ((amqp_method_number_t) 0x005A0014)
501 typedef struct amqp_tx_commit_t_ {
505 #define AMQP_TX_COMMIT_OK_METHOD ((amqp_method_number_t) 0x005A0015)
506 typedef struct amqp_tx_commit_ok_t_ {
510 #define AMQP_TX_ROLLBACK_METHOD ((amqp_method_number_t) 0x005A001E)
511 typedef struct amqp_tx_rollback_t_ {
515 #define AMQP_TX_ROLLBACK_OK_METHOD ((amqp_method_number_t) 0x005A001F)
516 typedef struct amqp_tx_rollback_ok_t_ {
520 #define AMQP_CONFIRM_SELECT_METHOD ((amqp_method_number_t) 0x0055000A)
521 typedef struct amqp_confirm_select_t_ {
525 #define AMQP_CONFIRM_SELECT_OK_METHOD ((amqp_method_number_t) 0x0055000B)
526 typedef struct amqp_confirm_select_ok_t_ {
531 #define AMQP_CONNECTION_CLASS (0x000A)
532 typedef struct amqp_connection_properties_t_ {
537 #define AMQP_CHANNEL_CLASS (0x0014)
538 typedef struct amqp_channel_properties_t_ {
543 #define AMQP_ACCESS_CLASS (0x001E)
544 typedef struct amqp_access_properties_t_ {
549 #define AMQP_EXCHANGE_CLASS (0x0028)
550 typedef struct amqp_exchange_properties_t_ {
555 #define AMQP_QUEUE_CLASS (0x0032)
556 typedef struct amqp_queue_properties_t_ {
561 #define AMQP_BASIC_CLASS (0x003C)
562 #define AMQP_BASIC_CONTENT_TYPE_FLAG (1 << 15)
563 #define AMQP_BASIC_CONTENT_ENCODING_FLAG (1 << 14)
564 #define AMQP_BASIC_HEADERS_FLAG (1 << 13)
565 #define AMQP_BASIC_DELIVERY_MODE_FLAG (1 << 12)
566 #define AMQP_BASIC_PRIORITY_FLAG (1 << 11)
567 #define AMQP_BASIC_CORRELATION_ID_FLAG (1 << 10)
568 #define AMQP_BASIC_REPLY_TO_FLAG (1 << 9)
569 #define AMQP_BASIC_EXPIRATION_FLAG (1 << 8)
570 #define AMQP_BASIC_MESSAGE_ID_FLAG (1 << 7)
571 #define AMQP_BASIC_TIMESTAMP_FLAG (1 << 6)
572 #define AMQP_BASIC_TYPE_FLAG (1 << 5)
573 #define AMQP_BASIC_USER_ID_FLAG (1 << 4)
574 #define AMQP_BASIC_APP_ID_FLAG (1 << 3)
575 #define AMQP_BASIC_CLUSTER_ID_FLAG (1 << 2)
576 typedef struct amqp_basic_properties_t_ {
581 uint8_t delivery_mode;
594 #define AMQP_TX_CLASS (0x005A)
595 typedef struct amqp_tx_properties_t_ {
600 #define AMQP_CONFIRM_CLASS (0x0055)
601 typedef struct amqp_confirm_properties_t_ {