/
rabbit_framing_amqp_0_9_1.erl
1182 lines (1159 loc) · 62.2 KB
/
rabbit_framing_amqp_0_9_1.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%% Autogenerated code. Do not edit.
%%
%% The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at http://www.mozilla.org/MPL/
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and
%% limitations under the License.
%%
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
%% Copyright (c) 2007-2013 VMware, Inc. All rights reserved.
%%
-module(rabbit_framing_amqp_0_9_1).
-include("rabbit_framing.hrl").
-export([version/0]).
-export([lookup_method_name/1]).
-export([lookup_class_name/1]).
-export([method_id/1]).
-export([method_has_content/1]).
-export([is_method_synchronous/1]).
-export([method_record/1]).
-export([method_fieldnames/1]).
-export([decode_method_fields/2]).
-export([decode_properties/2]).
-export([encode_method_fields/1]).
-export([encode_properties/1]).
-export([lookup_amqp_exception/1]).
-export([amqp_exception/1]).
%% Various types
-ifdef(use_specs).
-export_type([amqp_field_type/0, amqp_property_type/0,
amqp_table/0, amqp_array/0, amqp_value/0,
amqp_method_name/0, amqp_method/0, amqp_method_record/0,
amqp_method_field_name/0, amqp_property_record/0,
amqp_exception/0, amqp_exception_code/0, amqp_class_id/0]).
-type(amqp_field_type() ::
'longstr' | 'signedint' | 'decimal' | 'timestamp' |
'table' | 'byte' | 'double' | 'float' | 'long' |
'short' | 'bool' | 'binary' | 'void' | 'array').
-type(amqp_property_type() ::
'shortstr' | 'longstr' | 'octet' | 'short' | 'long' |
'longlong' | 'timestamp' | 'bit' | 'table').
-type(amqp_table() :: [{binary(), amqp_field_type(), amqp_value()}]).
-type(amqp_array() :: [{amqp_field_type(), amqp_value()}]).
-type(amqp_value() :: binary() | % longstr
integer() | % signedint
{non_neg_integer(), non_neg_integer()} | % decimal
amqp_table() |
amqp_array() |
byte() | % byte
float() | % double
integer() | % long
integer() | % short
boolean() | % bool
binary() | % binary
'undefined' | % void
non_neg_integer() % timestamp
).
-type(amqp_method_name() ::
( 'connection.start' | 'connection.start_ok' | 'connection.secure' | 'connection.secure_ok'
| 'connection.tune' | 'connection.tune_ok' | 'connection.open' | 'connection.open_ok'
| 'connection.close' | 'connection.close_ok' | 'channel.open' | 'channel.open_ok'
| 'channel.flow' | 'channel.flow_ok' | 'channel.close' | 'channel.close_ok'
| 'access.request' | 'access.request_ok' | 'exchange.declare' | 'exchange.declare_ok'
| 'exchange.delete' | 'exchange.delete_ok' | 'exchange.bind' | 'exchange.bind_ok'
| 'exchange.unbind' | 'exchange.unbind_ok' | 'queue.declare' | 'queue.declare_ok'
| 'queue.bind' | 'queue.bind_ok' | 'queue.purge' | 'queue.purge_ok'
| 'queue.delete' | 'queue.delete_ok' | 'queue.unbind' | 'queue.unbind_ok'
| 'basic.qos' | 'basic.qos_ok' | 'basic.consume' | 'basic.consume_ok'
| 'basic.cancel' | 'basic.cancel_ok' | 'basic.publish' | 'basic.return'
| 'basic.deliver' | 'basic.get' | 'basic.get_ok' | 'basic.get_empty'
| 'basic.ack' | 'basic.reject' | 'basic.recover_async' | 'basic.recover'
| 'basic.recover_ok' | 'basic.nack' | 'tx.select' | 'tx.select_ok'
| 'tx.commit' | 'tx.commit_ok' | 'tx.rollback' | 'tx.rollback_ok'
| 'confirm.select' | 'confirm.select_ok' )).
-type(amqp_method() ::
( {10, 10} | {10, 11} | {10, 20} | {10, 21} | {10, 30} | {10, 31}
| {10, 40} | {10, 41} | {10, 50} | {10, 51} | {20, 10} | {20, 11}
| {20, 20} | {20, 21} | {20, 40} | {20, 41} | {30, 10} | {30, 11}
| {40, 10} | {40, 11} | {40, 20} | {40, 21} | {40, 30} | {40, 31}
| {40, 40} | {40, 51} | {50, 10} | {50, 11} | {50, 20} | {50, 21}
| {50, 30} | {50, 31} | {50, 40} | {50, 41} | {50, 50} | {50, 51}
| {60, 10} | {60, 11} | {60, 20} | {60, 21} | {60, 30} | {60, 31}
| {60, 40} | {60, 50} | {60, 60} | {60, 70} | {60, 71} | {60, 72}
| {60, 80} | {60, 90} | {60, 100} | {60, 110} | {60, 111} | {60, 120}
| {90, 10} | {90, 11} | {90, 20} | {90, 21} | {90, 30} | {90, 31}
| {85, 10} | {85, 11} )).
-type(amqp_method_record() ::
( #'connection.start'{} | #'connection.start_ok'{} | #'connection.secure'{} | #'connection.secure_ok'{}
| #'connection.tune'{} | #'connection.tune_ok'{} | #'connection.open'{} | #'connection.open_ok'{}
| #'connection.close'{} | #'connection.close_ok'{} | #'channel.open'{} | #'channel.open_ok'{}
| #'channel.flow'{} | #'channel.flow_ok'{} | #'channel.close'{} | #'channel.close_ok'{}
| #'access.request'{} | #'access.request_ok'{} | #'exchange.declare'{} | #'exchange.declare_ok'{}
| #'exchange.delete'{} | #'exchange.delete_ok'{} | #'exchange.bind'{} | #'exchange.bind_ok'{}
| #'exchange.unbind'{} | #'exchange.unbind_ok'{} | #'queue.declare'{} | #'queue.declare_ok'{}
| #'queue.bind'{} | #'queue.bind_ok'{} | #'queue.purge'{} | #'queue.purge_ok'{}
| #'queue.delete'{} | #'queue.delete_ok'{} | #'queue.unbind'{} | #'queue.unbind_ok'{}
| #'basic.qos'{} | #'basic.qos_ok'{} | #'basic.consume'{} | #'basic.consume_ok'{}
| #'basic.cancel'{} | #'basic.cancel_ok'{} | #'basic.publish'{} | #'basic.return'{}
| #'basic.deliver'{} | #'basic.get'{} | #'basic.get_ok'{} | #'basic.get_empty'{}
| #'basic.ack'{} | #'basic.reject'{} | #'basic.recover_async'{} | #'basic.recover'{}
| #'basic.recover_ok'{} | #'basic.nack'{} | #'tx.select'{} | #'tx.select_ok'{}
| #'tx.commit'{} | #'tx.commit_ok'{} | #'tx.rollback'{} | #'tx.rollback_ok'{}
| #'confirm.select'{} | #'confirm.select_ok'{} )).
-type(amqp_method_field_name() ::
( queue | challenge | consumer_tag | realm
| exclusive | passive | active | ticket
| queue | write | exchange | read
| ticket | exchange | routing_key | ticket
| exchange | type | passive | durable
| consumer_tag | auto_delete | no_local | internal
| queue | requeue | nowait | arguments
| nowait | routing_key | mandatory | exchange
| ticket | no_ack | no_ack | nowait
| exchange | if_unused | nowait | reply_text
| exchange | ticket | frame_max | exclusive
| destination | consumer_tag | source | reply_code
| routing_key | nowait | ticket | arguments
| exchange | nowait | routing_key | nowait
| ticket | destination | source | routing_key
| nowait | arguments | arguments | delivery_tag
| redelivered | exchange | routing_key | ticket
| ticket | queue | passive | durable
| exclusive | queue | ticket | auto_delete
| nowait | arguments | delivery_tag | queue
| queue | if_unused | message_count | consumer_count
| requeue | version_major | version_minor | routing_key
| server_properties | message_count | mechanisms | routing_key
| nowait | client_properties | mechanism | locales
| prefetch_count | response | nowait | locale
| ticket | queue | response | consumer_tag
| channel_max | requeue | message_count | heartbeat
| channel_max | arguments | cluster_id | frame_max
| consumer_tag | heartbeat | if_empty | virtual_host
| capabilities | requeue | insist | delivery_tag
| delivery_tag | message_count | known_hosts | reply_code
| reply_text | class_id | multiple | method_id
| redelivered | arguments | out_of_band | channel_id
| delivery_tag | active | prefetch_size | active
| global | multiple | reply_code | ticket
| reply_text | immediate | class_id | method_id
| ticket )).
-type(amqp_property_record() ::
( #'P_connection'{} | #'P_channel'{} | #'P_access'{} | #'P_exchange'{}
| #'P_queue'{} | #'P_basic'{} | #'P_tx'{} | #'P_confirm'{} )).
-type(amqp_exception() ::
( 'frame_method' | 'frame_header' | 'frame_body' | 'frame_heartbeat'
| 'frame_min_size' | 'frame_end' | 'reply_success' | 'content_too_large'
| 'no_route' | 'no_consumers' | 'access_refused' | 'not_found'
| 'resource_locked' | 'precondition_failed' | 'connection_forced' | 'invalid_path'
| 'frame_error' | 'syntax_error' | 'command_invalid' | 'channel_error'
| 'unexpected_frame' | 'resource_error' | 'not_allowed' | 'not_implemented'
| 'internal_error' )).
-type(amqp_exception_code() ::
( 1 | 2 | 3 | 8
| 4096 | 206 | 200 | 311
| 312 | 313 | 403 | 404
| 405 | 406 | 320 | 402
| 501 | 502 | 503 | 504
| 505 | 506 | 530 | 540
| 541 )).
-type(amqp_class_id() ::
( 40 | 10 | 50 | 20
| 85 | 90 | 60 | 30 )).
-type(amqp_class_name() ::
( 'connection' | 'channel' | 'access' | 'exchange'
| 'queue' | 'basic' | 'tx' | 'confirm' )).
-endif. % use_specs
%% Method signatures
-ifdef(use_specs).
-spec(version/0 :: () -> {non_neg_integer(), non_neg_integer(), non_neg_integer()}).
-spec(lookup_method_name/1 :: (amqp_method()) -> amqp_method_name()).
-spec(lookup_class_name/1 :: (amqp_class_id()) -> amqp_class_name()).
-spec(method_id/1 :: (amqp_method_name()) -> amqp_method()).
-spec(method_has_content/1 :: (amqp_method_name()) -> boolean()).
-spec(is_method_synchronous/1 :: (amqp_method_record()) -> boolean()).
-spec(method_record/1 :: (amqp_method_name()) -> amqp_method_record()).
-spec(method_fieldnames/1 :: (amqp_method_name()) -> [amqp_method_field_name()]).
-spec(decode_method_fields/2 ::
(amqp_method_name(), binary()) -> amqp_method_record() | rabbit_types:connection_exit()).
-spec(decode_properties/2 :: (non_neg_integer(), binary()) -> amqp_property_record()).
-spec(encode_method_fields/1 :: (amqp_method_record()) -> binary()).
-spec(encode_properties/1 :: (amqp_property_record()) -> binary()).
-spec(lookup_amqp_exception/1 :: (amqp_exception()) -> {boolean(), amqp_exception_code(), binary()}).
-spec(amqp_exception/1 :: (amqp_exception_code()) -> amqp_exception()).
-endif. % use_specs
bitvalue(true) -> 1;
bitvalue(false) -> 0;
bitvalue(undefined) -> 0.
shortstr_size(S) ->
case size(S) of
Len when Len =< 255 -> Len;
_ -> exit(method_field_shortstr_overflow)
end.
-define(SHORTSTR_VAL(R, L, V, X),
begin
<<L:8/unsigned, V:L/binary, X/binary>> = R,
{V, X}
end).
-define(LONGSTR_VAL(R, L, V, X),
begin
<<L:32/unsigned, V:L/binary, X/binary>> = R,
{V, X}
end).
-define(SHORT_VAL(R, L, V, X),
begin
<<V:8/unsigned, X/binary>> = R,
{V, X}
end).
-define(LONG_VAL(R, L, V, X),
begin
<<V:32/unsigned, X/binary>> = R,
{V, X}
end).
-define(LONGLONG_VAL(R, L, V, X),
begin
<<V:64/unsigned, X/binary>> = R,
{V, X}
end).
-define(OCTET_VAL(R, L, V, X),
begin
<<V:8/unsigned, X/binary>> = R,
{V, X}
end).
-define(TABLE_VAL(R, L, V, X),
begin
<<L:32/unsigned, V:L/binary, X/binary>> = R,
{rabbit_binary_parser:parse_table(V), X}
end).
-define(TIMESTAMP_VAL(R, L, V, X),
begin
<<V:64/unsigned, X/binary>> = R,
{V, X}
end).
-define(SHORTSTR_PROP(X, L),
begin
L = size(X),
if L < 256 -> <<L:8, X:L/binary>>;
true -> exit(content_properties_shortstr_overflow)
end
end).
-define(LONGSTR_PROP(X, L),
begin
L = size(X),
<<L:32, X:L/binary>>
end).
-define(OCTET_PROP(X, L), <<X:8/unsigned>>).
-define(SHORT_PROP(X, L), <<X:16/unsigned>>).
-define(LONG_PROP(X, L), <<X:32/unsigned>>).
-define(LONGLONG_PROP(X, L), <<X:64/unsigned>>).
-define(TIMESTAMP_PROP(X, L), <<X:64/unsigned>>).
-define(TABLE_PROP(X, T),
begin
T = rabbit_binary_generator:generate_table(X),
<<(size(T)):32, T/binary>>
end).
version() -> {0, 9, 1}.
lookup_method_name({10, 10}) -> 'connection.start';
lookup_method_name({10, 11}) -> 'connection.start_ok';
lookup_method_name({10, 20}) -> 'connection.secure';
lookup_method_name({10, 21}) -> 'connection.secure_ok';
lookup_method_name({10, 30}) -> 'connection.tune';
lookup_method_name({10, 31}) -> 'connection.tune_ok';
lookup_method_name({10, 40}) -> 'connection.open';
lookup_method_name({10, 41}) -> 'connection.open_ok';
lookup_method_name({10, 50}) -> 'connection.close';
lookup_method_name({10, 51}) -> 'connection.close_ok';
lookup_method_name({20, 10}) -> 'channel.open';
lookup_method_name({20, 11}) -> 'channel.open_ok';
lookup_method_name({20, 20}) -> 'channel.flow';
lookup_method_name({20, 21}) -> 'channel.flow_ok';
lookup_method_name({20, 40}) -> 'channel.close';
lookup_method_name({20, 41}) -> 'channel.close_ok';
lookup_method_name({30, 10}) -> 'access.request';
lookup_method_name({30, 11}) -> 'access.request_ok';
lookup_method_name({40, 10}) -> 'exchange.declare';
lookup_method_name({40, 11}) -> 'exchange.declare_ok';
lookup_method_name({40, 20}) -> 'exchange.delete';
lookup_method_name({40, 21}) -> 'exchange.delete_ok';
lookup_method_name({40, 30}) -> 'exchange.bind';
lookup_method_name({40, 31}) -> 'exchange.bind_ok';
lookup_method_name({40, 40}) -> 'exchange.unbind';
lookup_method_name({40, 51}) -> 'exchange.unbind_ok';
lookup_method_name({50, 10}) -> 'queue.declare';
lookup_method_name({50, 11}) -> 'queue.declare_ok';
lookup_method_name({50, 20}) -> 'queue.bind';
lookup_method_name({50, 21}) -> 'queue.bind_ok';
lookup_method_name({50, 30}) -> 'queue.purge';
lookup_method_name({50, 31}) -> 'queue.purge_ok';
lookup_method_name({50, 40}) -> 'queue.delete';
lookup_method_name({50, 41}) -> 'queue.delete_ok';
lookup_method_name({50, 50}) -> 'queue.unbind';
lookup_method_name({50, 51}) -> 'queue.unbind_ok';
lookup_method_name({60, 10}) -> 'basic.qos';
lookup_method_name({60, 11}) -> 'basic.qos_ok';
lookup_method_name({60, 20}) -> 'basic.consume';
lookup_method_name({60, 21}) -> 'basic.consume_ok';
lookup_method_name({60, 30}) -> 'basic.cancel';
lookup_method_name({60, 31}) -> 'basic.cancel_ok';
lookup_method_name({60, 40}) -> 'basic.publish';
lookup_method_name({60, 50}) -> 'basic.return';
lookup_method_name({60, 60}) -> 'basic.deliver';
lookup_method_name({60, 70}) -> 'basic.get';
lookup_method_name({60, 71}) -> 'basic.get_ok';
lookup_method_name({60, 72}) -> 'basic.get_empty';
lookup_method_name({60, 80}) -> 'basic.ack';
lookup_method_name({60, 90}) -> 'basic.reject';
lookup_method_name({60, 100}) -> 'basic.recover_async';
lookup_method_name({60, 110}) -> 'basic.recover';
lookup_method_name({60, 111}) -> 'basic.recover_ok';
lookup_method_name({60, 120}) -> 'basic.nack';
lookup_method_name({90, 10}) -> 'tx.select';
lookup_method_name({90, 11}) -> 'tx.select_ok';
lookup_method_name({90, 20}) -> 'tx.commit';
lookup_method_name({90, 21}) -> 'tx.commit_ok';
lookup_method_name({90, 30}) -> 'tx.rollback';
lookup_method_name({90, 31}) -> 'tx.rollback_ok';
lookup_method_name({85, 10}) -> 'confirm.select';
lookup_method_name({85, 11}) -> 'confirm.select_ok';
lookup_method_name({_ClassId, _MethodId} = Id) -> exit({unknown_method_id, Id}).
lookup_class_name(10) -> 'connection';
lookup_class_name(20) -> 'channel';
lookup_class_name(30) -> 'access';
lookup_class_name(40) -> 'exchange';
lookup_class_name(50) -> 'queue';
lookup_class_name(60) -> 'basic';
lookup_class_name(90) -> 'tx';
lookup_class_name(85) -> 'confirm';
lookup_class_name(ClassId) -> exit({unknown_class_id, ClassId}).
method_id('connection.start') -> {10, 10};
method_id('connection.start_ok') -> {10, 11};
method_id('connection.secure') -> {10, 20};
method_id('connection.secure_ok') -> {10, 21};
method_id('connection.tune') -> {10, 30};
method_id('connection.tune_ok') -> {10, 31};
method_id('connection.open') -> {10, 40};
method_id('connection.open_ok') -> {10, 41};
method_id('connection.close') -> {10, 50};
method_id('connection.close_ok') -> {10, 51};
method_id('channel.open') -> {20, 10};
method_id('channel.open_ok') -> {20, 11};
method_id('channel.flow') -> {20, 20};
method_id('channel.flow_ok') -> {20, 21};
method_id('channel.close') -> {20, 40};
method_id('channel.close_ok') -> {20, 41};
method_id('access.request') -> {30, 10};
method_id('access.request_ok') -> {30, 11};
method_id('exchange.declare') -> {40, 10};
method_id('exchange.declare_ok') -> {40, 11};
method_id('exchange.delete') -> {40, 20};
method_id('exchange.delete_ok') -> {40, 21};
method_id('exchange.bind') -> {40, 30};
method_id('exchange.bind_ok') -> {40, 31};
method_id('exchange.unbind') -> {40, 40};
method_id('exchange.unbind_ok') -> {40, 51};
method_id('queue.declare') -> {50, 10};
method_id('queue.declare_ok') -> {50, 11};
method_id('queue.bind') -> {50, 20};
method_id('queue.bind_ok') -> {50, 21};
method_id('queue.purge') -> {50, 30};
method_id('queue.purge_ok') -> {50, 31};
method_id('queue.delete') -> {50, 40};
method_id('queue.delete_ok') -> {50, 41};
method_id('queue.unbind') -> {50, 50};
method_id('queue.unbind_ok') -> {50, 51};
method_id('basic.qos') -> {60, 10};
method_id('basic.qos_ok') -> {60, 11};
method_id('basic.consume') -> {60, 20};
method_id('basic.consume_ok') -> {60, 21};
method_id('basic.cancel') -> {60, 30};
method_id('basic.cancel_ok') -> {60, 31};
method_id('basic.publish') -> {60, 40};
method_id('basic.return') -> {60, 50};
method_id('basic.deliver') -> {60, 60};
method_id('basic.get') -> {60, 70};
method_id('basic.get_ok') -> {60, 71};
method_id('basic.get_empty') -> {60, 72};
method_id('basic.ack') -> {60, 80};
method_id('basic.reject') -> {60, 90};
method_id('basic.recover_async') -> {60, 100};
method_id('basic.recover') -> {60, 110};
method_id('basic.recover_ok') -> {60, 111};
method_id('basic.nack') -> {60, 120};
method_id('tx.select') -> {90, 10};
method_id('tx.select_ok') -> {90, 11};
method_id('tx.commit') -> {90, 20};
method_id('tx.commit_ok') -> {90, 21};
method_id('tx.rollback') -> {90, 30};
method_id('tx.rollback_ok') -> {90, 31};
method_id('confirm.select') -> {85, 10};
method_id('confirm.select_ok') -> {85, 11};
method_id(Name) -> exit({unknown_method_name, Name}).
method_has_content('connection.start') -> false;
method_has_content('connection.start_ok') -> false;
method_has_content('connection.secure') -> false;
method_has_content('connection.secure_ok') -> false;
method_has_content('connection.tune') -> false;
method_has_content('connection.tune_ok') -> false;
method_has_content('connection.open') -> false;
method_has_content('connection.open_ok') -> false;
method_has_content('connection.close') -> false;
method_has_content('connection.close_ok') -> false;
method_has_content('channel.open') -> false;
method_has_content('channel.open_ok') -> false;
method_has_content('channel.flow') -> false;
method_has_content('channel.flow_ok') -> false;
method_has_content('channel.close') -> false;
method_has_content('channel.close_ok') -> false;
method_has_content('access.request') -> false;
method_has_content('access.request_ok') -> false;
method_has_content('exchange.declare') -> false;
method_has_content('exchange.declare_ok') -> false;
method_has_content('exchange.delete') -> false;
method_has_content('exchange.delete_ok') -> false;
method_has_content('exchange.bind') -> false;
method_has_content('exchange.bind_ok') -> false;
method_has_content('exchange.unbind') -> false;
method_has_content('exchange.unbind_ok') -> false;
method_has_content('queue.declare') -> false;
method_has_content('queue.declare_ok') -> false;
method_has_content('queue.bind') -> false;
method_has_content('queue.bind_ok') -> false;
method_has_content('queue.purge') -> false;
method_has_content('queue.purge_ok') -> false;
method_has_content('queue.delete') -> false;
method_has_content('queue.delete_ok') -> false;
method_has_content('queue.unbind') -> false;
method_has_content('queue.unbind_ok') -> false;
method_has_content('basic.qos') -> false;
method_has_content('basic.qos_ok') -> false;
method_has_content('basic.consume') -> false;
method_has_content('basic.consume_ok') -> false;
method_has_content('basic.cancel') -> false;
method_has_content('basic.cancel_ok') -> false;
method_has_content('basic.publish') -> true;
method_has_content('basic.return') -> true;
method_has_content('basic.deliver') -> true;
method_has_content('basic.get') -> false;
method_has_content('basic.get_ok') -> true;
method_has_content('basic.get_empty') -> false;
method_has_content('basic.ack') -> false;
method_has_content('basic.reject') -> false;
method_has_content('basic.recover_async') -> false;
method_has_content('basic.recover') -> false;
method_has_content('basic.recover_ok') -> false;
method_has_content('basic.nack') -> false;
method_has_content('tx.select') -> false;
method_has_content('tx.select_ok') -> false;
method_has_content('tx.commit') -> false;
method_has_content('tx.commit_ok') -> false;
method_has_content('tx.rollback') -> false;
method_has_content('tx.rollback_ok') -> false;
method_has_content('confirm.select') -> false;
method_has_content('confirm.select_ok') -> false;
method_has_content(Name) -> exit({unknown_method_name, Name}).
is_method_synchronous(#'connection.start'{}) -> true;
is_method_synchronous(#'connection.start_ok'{}) -> false;
is_method_synchronous(#'connection.secure'{}) -> true;
is_method_synchronous(#'connection.secure_ok'{}) -> false;
is_method_synchronous(#'connection.tune'{}) -> true;
is_method_synchronous(#'connection.tune_ok'{}) -> false;
is_method_synchronous(#'connection.open'{}) -> true;
is_method_synchronous(#'connection.open_ok'{}) -> false;
is_method_synchronous(#'connection.close'{}) -> true;
is_method_synchronous(#'connection.close_ok'{}) -> false;
is_method_synchronous(#'channel.open'{}) -> true;
is_method_synchronous(#'channel.open_ok'{}) -> false;
is_method_synchronous(#'channel.flow'{}) -> true;
is_method_synchronous(#'channel.flow_ok'{}) -> false;
is_method_synchronous(#'channel.close'{}) -> true;
is_method_synchronous(#'channel.close_ok'{}) -> false;
is_method_synchronous(#'access.request'{}) -> true;
is_method_synchronous(#'access.request_ok'{}) -> false;
is_method_synchronous(#'exchange.declare'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'exchange.declare_ok'{}) -> false;
is_method_synchronous(#'exchange.delete'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'exchange.delete_ok'{}) -> false;
is_method_synchronous(#'exchange.bind'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'exchange.bind_ok'{}) -> false;
is_method_synchronous(#'exchange.unbind'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'exchange.unbind_ok'{}) -> false;
is_method_synchronous(#'queue.declare'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'queue.declare_ok'{}) -> false;
is_method_synchronous(#'queue.bind'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'queue.bind_ok'{}) -> false;
is_method_synchronous(#'queue.purge'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'queue.purge_ok'{}) -> false;
is_method_synchronous(#'queue.delete'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'queue.delete_ok'{}) -> false;
is_method_synchronous(#'queue.unbind'{}) -> true;
is_method_synchronous(#'queue.unbind_ok'{}) -> false;
is_method_synchronous(#'basic.qos'{}) -> true;
is_method_synchronous(#'basic.qos_ok'{}) -> false;
is_method_synchronous(#'basic.consume'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'basic.consume_ok'{}) -> false;
is_method_synchronous(#'basic.cancel'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'basic.cancel_ok'{}) -> false;
is_method_synchronous(#'basic.publish'{}) -> false;
is_method_synchronous(#'basic.return'{}) -> false;
is_method_synchronous(#'basic.deliver'{}) -> false;
is_method_synchronous(#'basic.get'{}) -> true;
is_method_synchronous(#'basic.get_ok'{}) -> false;
is_method_synchronous(#'basic.get_empty'{}) -> false;
is_method_synchronous(#'basic.ack'{}) -> false;
is_method_synchronous(#'basic.reject'{}) -> false;
is_method_synchronous(#'basic.recover_async'{}) -> false;
is_method_synchronous(#'basic.recover'{}) -> true;
is_method_synchronous(#'basic.recover_ok'{}) -> false;
is_method_synchronous(#'basic.nack'{}) -> false;
is_method_synchronous(#'tx.select'{}) -> true;
is_method_synchronous(#'tx.select_ok'{}) -> false;
is_method_synchronous(#'tx.commit'{}) -> true;
is_method_synchronous(#'tx.commit_ok'{}) -> false;
is_method_synchronous(#'tx.rollback'{}) -> true;
is_method_synchronous(#'tx.rollback_ok'{}) -> false;
is_method_synchronous(#'confirm.select'{nowait = NoWait}) -> not(NoWait);
is_method_synchronous(#'confirm.select_ok'{}) -> false;
is_method_synchronous(Name) -> exit({unknown_method_name, Name}).
method_record('connection.start') -> #'connection.start'{};
method_record('connection.start_ok') -> #'connection.start_ok'{};
method_record('connection.secure') -> #'connection.secure'{};
method_record('connection.secure_ok') -> #'connection.secure_ok'{};
method_record('connection.tune') -> #'connection.tune'{};
method_record('connection.tune_ok') -> #'connection.tune_ok'{};
method_record('connection.open') -> #'connection.open'{};
method_record('connection.open_ok') -> #'connection.open_ok'{};
method_record('connection.close') -> #'connection.close'{};
method_record('connection.close_ok') -> #'connection.close_ok'{};
method_record('channel.open') -> #'channel.open'{};
method_record('channel.open_ok') -> #'channel.open_ok'{};
method_record('channel.flow') -> #'channel.flow'{};
method_record('channel.flow_ok') -> #'channel.flow_ok'{};
method_record('channel.close') -> #'channel.close'{};
method_record('channel.close_ok') -> #'channel.close_ok'{};
method_record('access.request') -> #'access.request'{};
method_record('access.request_ok') -> #'access.request_ok'{};
method_record('exchange.declare') -> #'exchange.declare'{};
method_record('exchange.declare_ok') -> #'exchange.declare_ok'{};
method_record('exchange.delete') -> #'exchange.delete'{};
method_record('exchange.delete_ok') -> #'exchange.delete_ok'{};
method_record('exchange.bind') -> #'exchange.bind'{};
method_record('exchange.bind_ok') -> #'exchange.bind_ok'{};
method_record('exchange.unbind') -> #'exchange.unbind'{};
method_record('exchange.unbind_ok') -> #'exchange.unbind_ok'{};
method_record('queue.declare') -> #'queue.declare'{};
method_record('queue.declare_ok') -> #'queue.declare_ok'{};
method_record('queue.bind') -> #'queue.bind'{};
method_record('queue.bind_ok') -> #'queue.bind_ok'{};
method_record('queue.purge') -> #'queue.purge'{};
method_record('queue.purge_ok') -> #'queue.purge_ok'{};
method_record('queue.delete') -> #'queue.delete'{};
method_record('queue.delete_ok') -> #'queue.delete_ok'{};
method_record('queue.unbind') -> #'queue.unbind'{};
method_record('queue.unbind_ok') -> #'queue.unbind_ok'{};
method_record('basic.qos') -> #'basic.qos'{};
method_record('basic.qos_ok') -> #'basic.qos_ok'{};
method_record('basic.consume') -> #'basic.consume'{};
method_record('basic.consume_ok') -> #'basic.consume_ok'{};
method_record('basic.cancel') -> #'basic.cancel'{};
method_record('basic.cancel_ok') -> #'basic.cancel_ok'{};
method_record('basic.publish') -> #'basic.publish'{};
method_record('basic.return') -> #'basic.return'{};
method_record('basic.deliver') -> #'basic.deliver'{};
method_record('basic.get') -> #'basic.get'{};
method_record('basic.get_ok') -> #'basic.get_ok'{};
method_record('basic.get_empty') -> #'basic.get_empty'{};
method_record('basic.ack') -> #'basic.ack'{};
method_record('basic.reject') -> #'basic.reject'{};
method_record('basic.recover_async') -> #'basic.recover_async'{};
method_record('basic.recover') -> #'basic.recover'{};
method_record('basic.recover_ok') -> #'basic.recover_ok'{};
method_record('basic.nack') -> #'basic.nack'{};
method_record('tx.select') -> #'tx.select'{};
method_record('tx.select_ok') -> #'tx.select_ok'{};
method_record('tx.commit') -> #'tx.commit'{};
method_record('tx.commit_ok') -> #'tx.commit_ok'{};
method_record('tx.rollback') -> #'tx.rollback'{};
method_record('tx.rollback_ok') -> #'tx.rollback_ok'{};
method_record('confirm.select') -> #'confirm.select'{};
method_record('confirm.select_ok') -> #'confirm.select_ok'{};
method_record(Name) -> exit({unknown_method_name, Name}).
method_fieldnames('connection.start') -> [version_major, version_minor, server_properties, mechanisms, locales];
method_fieldnames('connection.start_ok') -> [client_properties, mechanism, response, locale];
method_fieldnames('connection.secure') -> [challenge];
method_fieldnames('connection.secure_ok') -> [response];
method_fieldnames('connection.tune') -> [channel_max, frame_max, heartbeat];
method_fieldnames('connection.tune_ok') -> [channel_max, frame_max, heartbeat];
method_fieldnames('connection.open') -> [virtual_host, capabilities, insist];
method_fieldnames('connection.open_ok') -> [known_hosts];
method_fieldnames('connection.close') -> [reply_code, reply_text, class_id, method_id];
method_fieldnames('connection.close_ok') -> [];
method_fieldnames('channel.open') -> [out_of_band];
method_fieldnames('channel.open_ok') -> [channel_id];
method_fieldnames('channel.flow') -> [active];
method_fieldnames('channel.flow_ok') -> [active];
method_fieldnames('channel.close') -> [reply_code, reply_text, class_id, method_id];
method_fieldnames('channel.close_ok') -> [];
method_fieldnames('access.request') -> [realm, exclusive, passive, active, write, read];
method_fieldnames('access.request_ok') -> [ticket];
method_fieldnames('exchange.declare') -> [ticket, exchange, type, passive, durable, auto_delete, internal, nowait, arguments];
method_fieldnames('exchange.declare_ok') -> [];
method_fieldnames('exchange.delete') -> [ticket, exchange, if_unused, nowait];
method_fieldnames('exchange.delete_ok') -> [];
method_fieldnames('exchange.bind') -> [ticket, destination, source, routing_key, nowait, arguments];
method_fieldnames('exchange.bind_ok') -> [];
method_fieldnames('exchange.unbind') -> [ticket, destination, source, routing_key, nowait, arguments];
method_fieldnames('exchange.unbind_ok') -> [];
method_fieldnames('queue.declare') -> [ticket, queue, passive, durable, exclusive, auto_delete, nowait, arguments];
method_fieldnames('queue.declare_ok') -> [queue, message_count, consumer_count];
method_fieldnames('queue.bind') -> [ticket, queue, exchange, routing_key, nowait, arguments];
method_fieldnames('queue.bind_ok') -> [];
method_fieldnames('queue.purge') -> [ticket, queue, nowait];
method_fieldnames('queue.purge_ok') -> [message_count];
method_fieldnames('queue.delete') -> [ticket, queue, if_unused, if_empty, nowait];
method_fieldnames('queue.delete_ok') -> [message_count];
method_fieldnames('queue.unbind') -> [ticket, queue, exchange, routing_key, arguments];
method_fieldnames('queue.unbind_ok') -> [];
method_fieldnames('basic.qos') -> [prefetch_size, prefetch_count, global];
method_fieldnames('basic.qos_ok') -> [];
method_fieldnames('basic.consume') -> [ticket, queue, consumer_tag, no_local, no_ack, exclusive, nowait, arguments];
method_fieldnames('basic.consume_ok') -> [consumer_tag];
method_fieldnames('basic.cancel') -> [consumer_tag, nowait];
method_fieldnames('basic.cancel_ok') -> [consumer_tag];
method_fieldnames('basic.publish') -> [ticket, exchange, routing_key, mandatory, immediate];
method_fieldnames('basic.return') -> [reply_code, reply_text, exchange, routing_key];
method_fieldnames('basic.deliver') -> [consumer_tag, delivery_tag, redelivered, exchange, routing_key];
method_fieldnames('basic.get') -> [ticket, queue, no_ack];
method_fieldnames('basic.get_ok') -> [delivery_tag, redelivered, exchange, routing_key, message_count];
method_fieldnames('basic.get_empty') -> [cluster_id];
method_fieldnames('basic.ack') -> [delivery_tag, multiple];
method_fieldnames('basic.reject') -> [delivery_tag, requeue];
method_fieldnames('basic.recover_async') -> [requeue];
method_fieldnames('basic.recover') -> [requeue];
method_fieldnames('basic.recover_ok') -> [];
method_fieldnames('basic.nack') -> [delivery_tag, multiple, requeue];
method_fieldnames('tx.select') -> [];
method_fieldnames('tx.select_ok') -> [];
method_fieldnames('tx.commit') -> [];
method_fieldnames('tx.commit_ok') -> [];
method_fieldnames('tx.rollback') -> [];
method_fieldnames('tx.rollback_ok') -> [];
method_fieldnames('confirm.select') -> [nowait];
method_fieldnames('confirm.select_ok') -> [];
method_fieldnames(Name) -> exit({unknown_method_name, Name}).
decode_method_fields('connection.start', <<F0:8/unsigned, F1:8/unsigned, F2Len:32/unsigned, F2Tab:F2Len/binary, F3Len:32/unsigned, F3:F3Len/binary, F4Len:32/unsigned, F4:F4Len/binary>>) ->
F2 = rabbit_binary_parser:parse_table(F2Tab),
#'connection.start'{version_major = F0, version_minor = F1, server_properties = F2, mechanisms = F3, locales = F4};
decode_method_fields('connection.start_ok', <<F0Len:32/unsigned, F0Tab:F0Len/binary, F1Len:8/unsigned, F1:F1Len/binary, F2Len:32/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary>>) ->
F0 = rabbit_binary_parser:parse_table(F0Tab),
#'connection.start_ok'{client_properties = F0, mechanism = F1, response = F2, locale = F3};
decode_method_fields('connection.secure', <<F0Len:32/unsigned, F0:F0Len/binary>>) ->
#'connection.secure'{challenge = F0};
decode_method_fields('connection.secure_ok', <<F0Len:32/unsigned, F0:F0Len/binary>>) ->
#'connection.secure_ok'{response = F0};
decode_method_fields('connection.tune', <<F0:16/unsigned, F1:32/unsigned, F2:16/unsigned>>) ->
#'connection.tune'{channel_max = F0, frame_max = F1, heartbeat = F2};
decode_method_fields('connection.tune_ok', <<F0:16/unsigned, F1:32/unsigned, F2:16/unsigned>>) ->
#'connection.tune_ok'{channel_max = F0, frame_max = F1, heartbeat = F2};
decode_method_fields('connection.open', <<F0Len:8/unsigned, F0:F0Len/binary, F1Len:8/unsigned, F1:F1Len/binary, F2Bits:8>>) ->
F2 = ((F2Bits band 1) /= 0),
#'connection.open'{virtual_host = F0, capabilities = F1, insist = F2};
decode_method_fields('connection.open_ok', <<F0Len:8/unsigned, F0:F0Len/binary>>) ->
#'connection.open_ok'{known_hosts = F0};
decode_method_fields('connection.close', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2:16/unsigned, F3:16/unsigned>>) ->
#'connection.close'{reply_code = F0, reply_text = F1, class_id = F2, method_id = F3};
decode_method_fields('connection.close_ok', <<>>) ->
#'connection.close_ok'{};
decode_method_fields('channel.open', <<F0Len:8/unsigned, F0:F0Len/binary>>) ->
#'channel.open'{out_of_band = F0};
decode_method_fields('channel.open_ok', <<F0Len:32/unsigned, F0:F0Len/binary>>) ->
#'channel.open_ok'{channel_id = F0};
decode_method_fields('channel.flow', <<F0Bits:8>>) ->
F0 = ((F0Bits band 1) /= 0),
#'channel.flow'{active = F0};
decode_method_fields('channel.flow_ok', <<F0Bits:8>>) ->
F0 = ((F0Bits band 1) /= 0),
#'channel.flow_ok'{active = F0};
decode_method_fields('channel.close', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2:16/unsigned, F3:16/unsigned>>) ->
#'channel.close'{reply_code = F0, reply_text = F1, class_id = F2, method_id = F3};
decode_method_fields('channel.close_ok', <<>>) ->
#'channel.close_ok'{};
decode_method_fields('access.request', <<F0Len:8/unsigned, F0:F0Len/binary, F1Bits:8>>) ->
F1 = ((F1Bits band 1) /= 0),
F2 = ((F1Bits band 2) /= 0),
F3 = ((F1Bits band 4) /= 0),
F4 = ((F1Bits band 8) /= 0),
F5 = ((F1Bits band 16) /= 0),
#'access.request'{realm = F0, exclusive = F1, passive = F2, active = F3, write = F4, read = F5};
decode_method_fields('access.request_ok', <<F0:16/unsigned>>) ->
#'access.request_ok'{ticket = F0};
decode_method_fields('exchange.declare', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Bits:8, F8Len:32/unsigned, F8Tab:F8Len/binary>>) ->
F3 = ((F3Bits band 1) /= 0),
F4 = ((F3Bits band 2) /= 0),
F5 = ((F3Bits band 4) /= 0),
F6 = ((F3Bits band 8) /= 0),
F7 = ((F3Bits band 16) /= 0),
F8 = rabbit_binary_parser:parse_table(F8Tab),
#'exchange.declare'{ticket = F0, exchange = F1, type = F2, passive = F3, durable = F4, auto_delete = F5, internal = F6, nowait = F7, arguments = F8};
decode_method_fields('exchange.declare_ok', <<>>) ->
#'exchange.declare_ok'{};
decode_method_fields('exchange.delete', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Bits:8>>) ->
F2 = ((F2Bits band 1) /= 0),
F3 = ((F2Bits band 2) /= 0),
#'exchange.delete'{ticket = F0, exchange = F1, if_unused = F2, nowait = F3};
decode_method_fields('exchange.delete_ok', <<>>) ->
#'exchange.delete_ok'{};
decode_method_fields('exchange.bind', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary, F4Bits:8, F5Len:32/unsigned, F5Tab:F5Len/binary>>) ->
F4 = ((F4Bits band 1) /= 0),
F5 = rabbit_binary_parser:parse_table(F5Tab),
#'exchange.bind'{ticket = F0, destination = F1, source = F2, routing_key = F3, nowait = F4, arguments = F5};
decode_method_fields('exchange.bind_ok', <<>>) ->
#'exchange.bind_ok'{};
decode_method_fields('exchange.unbind', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary, F4Bits:8, F5Len:32/unsigned, F5Tab:F5Len/binary>>) ->
F4 = ((F4Bits band 1) /= 0),
F5 = rabbit_binary_parser:parse_table(F5Tab),
#'exchange.unbind'{ticket = F0, destination = F1, source = F2, routing_key = F3, nowait = F4, arguments = F5};
decode_method_fields('exchange.unbind_ok', <<>>) ->
#'exchange.unbind_ok'{};
decode_method_fields('queue.declare', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Bits:8, F7Len:32/unsigned, F7Tab:F7Len/binary>>) ->
F2 = ((F2Bits band 1) /= 0),
F3 = ((F2Bits band 2) /= 0),
F4 = ((F2Bits band 4) /= 0),
F5 = ((F2Bits band 8) /= 0),
F6 = ((F2Bits band 16) /= 0),
F7 = rabbit_binary_parser:parse_table(F7Tab),
#'queue.declare'{ticket = F0, queue = F1, passive = F2, durable = F3, exclusive = F4, auto_delete = F5, nowait = F6, arguments = F7};
decode_method_fields('queue.declare_ok', <<F0Len:8/unsigned, F0:F0Len/binary, F1:32/unsigned, F2:32/unsigned>>) ->
#'queue.declare_ok'{queue = F0, message_count = F1, consumer_count = F2};
decode_method_fields('queue.bind', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary, F4Bits:8, F5Len:32/unsigned, F5Tab:F5Len/binary>>) ->
F4 = ((F4Bits band 1) /= 0),
F5 = rabbit_binary_parser:parse_table(F5Tab),
#'queue.bind'{ticket = F0, queue = F1, exchange = F2, routing_key = F3, nowait = F4, arguments = F5};
decode_method_fields('queue.bind_ok', <<>>) ->
#'queue.bind_ok'{};
decode_method_fields('queue.purge', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Bits:8>>) ->
F2 = ((F2Bits band 1) /= 0),
#'queue.purge'{ticket = F0, queue = F1, nowait = F2};
decode_method_fields('queue.purge_ok', <<F0:32/unsigned>>) ->
#'queue.purge_ok'{message_count = F0};
decode_method_fields('queue.delete', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Bits:8>>) ->
F2 = ((F2Bits band 1) /= 0),
F3 = ((F2Bits band 2) /= 0),
F4 = ((F2Bits band 4) /= 0),
#'queue.delete'{ticket = F0, queue = F1, if_unused = F2, if_empty = F3, nowait = F4};
decode_method_fields('queue.delete_ok', <<F0:32/unsigned>>) ->
#'queue.delete_ok'{message_count = F0};
decode_method_fields('queue.unbind', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary, F4Len:32/unsigned, F4Tab:F4Len/binary>>) ->
F4 = rabbit_binary_parser:parse_table(F4Tab),
#'queue.unbind'{ticket = F0, queue = F1, exchange = F2, routing_key = F3, arguments = F4};
decode_method_fields('queue.unbind_ok', <<>>) ->
#'queue.unbind_ok'{};
decode_method_fields('basic.qos', <<F0:32/unsigned, F1:16/unsigned, F2Bits:8>>) ->
F2 = ((F2Bits band 1) /= 0),
#'basic.qos'{prefetch_size = F0, prefetch_count = F1, global = F2};
decode_method_fields('basic.qos_ok', <<>>) ->
#'basic.qos_ok'{};
decode_method_fields('basic.consume', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Bits:8, F7Len:32/unsigned, F7Tab:F7Len/binary>>) ->
F3 = ((F3Bits band 1) /= 0),
F4 = ((F3Bits band 2) /= 0),
F5 = ((F3Bits band 4) /= 0),
F6 = ((F3Bits band 8) /= 0),
F7 = rabbit_binary_parser:parse_table(F7Tab),
#'basic.consume'{ticket = F0, queue = F1, consumer_tag = F2, no_local = F3, no_ack = F4, exclusive = F5, nowait = F6, arguments = F7};
decode_method_fields('basic.consume_ok', <<F0Len:8/unsigned, F0:F0Len/binary>>) ->
#'basic.consume_ok'{consumer_tag = F0};
decode_method_fields('basic.cancel', <<F0Len:8/unsigned, F0:F0Len/binary, F1Bits:8>>) ->
F1 = ((F1Bits band 1) /= 0),
#'basic.cancel'{consumer_tag = F0, nowait = F1};
decode_method_fields('basic.cancel_ok', <<F0Len:8/unsigned, F0:F0Len/binary>>) ->
#'basic.cancel_ok'{consumer_tag = F0};
decode_method_fields('basic.publish', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Bits:8>>) ->
F3 = ((F3Bits band 1) /= 0),
F4 = ((F3Bits band 2) /= 0),
#'basic.publish'{ticket = F0, exchange = F1, routing_key = F2, mandatory = F3, immediate = F4};
decode_method_fields('basic.return', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary>>) ->
#'basic.return'{reply_code = F0, reply_text = F1, exchange = F2, routing_key = F3};
decode_method_fields('basic.deliver', <<F0Len:8/unsigned, F0:F0Len/binary, F1:64/unsigned, F2Bits:8, F3Len:8/unsigned, F3:F3Len/binary, F4Len:8/unsigned, F4:F4Len/binary>>) ->
F2 = ((F2Bits band 1) /= 0),
#'basic.deliver'{consumer_tag = F0, delivery_tag = F1, redelivered = F2, exchange = F3, routing_key = F4};
decode_method_fields('basic.get', <<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Bits:8>>) ->
F2 = ((F2Bits band 1) /= 0),
#'basic.get'{ticket = F0, queue = F1, no_ack = F2};
decode_method_fields('basic.get_ok', <<F0:64/unsigned, F1Bits:8, F2Len:8/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary, F4:32/unsigned>>) ->
F1 = ((F1Bits band 1) /= 0),
#'basic.get_ok'{delivery_tag = F0, redelivered = F1, exchange = F2, routing_key = F3, message_count = F4};
decode_method_fields('basic.get_empty', <<F0Len:8/unsigned, F0:F0Len/binary>>) ->
#'basic.get_empty'{cluster_id = F0};
decode_method_fields('basic.ack', <<F0:64/unsigned, F1Bits:8>>) ->
F1 = ((F1Bits band 1) /= 0),
#'basic.ack'{delivery_tag = F0, multiple = F1};
decode_method_fields('basic.reject', <<F0:64/unsigned, F1Bits:8>>) ->
F1 = ((F1Bits band 1) /= 0),
#'basic.reject'{delivery_tag = F0, requeue = F1};
decode_method_fields('basic.recover_async', <<F0Bits:8>>) ->
F0 = ((F0Bits band 1) /= 0),
#'basic.recover_async'{requeue = F0};
decode_method_fields('basic.recover', <<F0Bits:8>>) ->
F0 = ((F0Bits band 1) /= 0),
#'basic.recover'{requeue = F0};
decode_method_fields('basic.recover_ok', <<>>) ->
#'basic.recover_ok'{};
decode_method_fields('basic.nack', <<F0:64/unsigned, F1Bits:8>>) ->
F1 = ((F1Bits band 1) /= 0),
F2 = ((F1Bits band 2) /= 0),
#'basic.nack'{delivery_tag = F0, multiple = F1, requeue = F2};
decode_method_fields('tx.select', <<>>) ->
#'tx.select'{};
decode_method_fields('tx.select_ok', <<>>) ->
#'tx.select_ok'{};
decode_method_fields('tx.commit', <<>>) ->
#'tx.commit'{};
decode_method_fields('tx.commit_ok', <<>>) ->
#'tx.commit_ok'{};
decode_method_fields('tx.rollback', <<>>) ->
#'tx.rollback'{};
decode_method_fields('tx.rollback_ok', <<>>) ->
#'tx.rollback_ok'{};
decode_method_fields('confirm.select', <<F0Bits:8>>) ->
F0 = ((F0Bits band 1) /= 0),
#'confirm.select'{nowait = F0};
decode_method_fields('confirm.select_ok', <<>>) ->
#'confirm.select_ok'{};
decode_method_fields(Name, BinaryFields) ->
rabbit_misc:frame_error(Name, BinaryFields).
decode_properties(10, <<>>) ->
#'P_connection'{};
decode_properties(20, <<>>) ->
#'P_channel'{};
decode_properties(30, <<>>) ->
#'P_access'{};
decode_properties(40, <<>>) ->
#'P_exchange'{};
decode_properties(50, <<>>) ->
#'P_queue'{};
decode_properties(60, <<P0:1, P1:1, P2:1, P3:1, P4:1, P5:1, P6:1, P7:1, P8:1, P9:1, P10:1, P11:1, P12:1, P13:1, _:2, R0/binary>>) ->
{F0, R1} = if P0 =:= 0 -> {undefined, R0}; true -> ?SHORTSTR_VAL(R0, L0, V0, X0) end,
{F1, R2} = if P1 =:= 0 -> {undefined, R1}; true -> ?SHORTSTR_VAL(R1, L1, V1, X1) end,
{F2, R3} = if P2 =:= 0 -> {undefined, R2}; true -> ?TABLE_VAL(R2, L2, V2, X2) end,
{F3, R4} = if P3 =:= 0 -> {undefined, R3}; true -> ?OCTET_VAL(R3, L3, V3, X3) end,
{F4, R5} = if P4 =:= 0 -> {undefined, R4}; true -> ?OCTET_VAL(R4, L4, V4, X4) end,
{F5, R6} = if P5 =:= 0 -> {undefined, R5}; true -> ?SHORTSTR_VAL(R5, L5, V5, X5) end,
{F6, R7} = if P6 =:= 0 -> {undefined, R6}; true -> ?SHORTSTR_VAL(R6, L6, V6, X6) end,
{F7, R8} = if P7 =:= 0 -> {undefined, R7}; true -> ?SHORTSTR_VAL(R7, L7, V7, X7) end,
{F8, R9} = if P8 =:= 0 -> {undefined, R8}; true -> ?SHORTSTR_VAL(R8, L8, V8, X8) end,
{F9, R10} = if P9 =:= 0 -> {undefined, R9}; true -> ?TIMESTAMP_VAL(R9, L9, V9, X9) end,
{F10, R11} = if P10 =:= 0 -> {undefined, R10}; true -> ?SHORTSTR_VAL(R10, L10, V10, X10) end,
{F11, R12} = if P11 =:= 0 -> {undefined, R11}; true -> ?SHORTSTR_VAL(R11, L11, V11, X11) end,
{F12, R13} = if P12 =:= 0 -> {undefined, R12}; true -> ?SHORTSTR_VAL(R12, L12, V12, X12) end,
{F13, R14} = if P13 =:= 0 -> {undefined, R13}; true -> ?SHORTSTR_VAL(R13, L13, V13, X13) end,
<<>> = R14,
#'P_basic'{content_type = F0, content_encoding = F1, headers = F2, delivery_mode = F3, priority = F4, correlation_id = F5, reply_to = F6, expiration = F7, message_id = F8, timestamp = F9, type = F10, user_id = F11, app_id = F12, cluster_id = F13};
decode_properties(90, <<>>) ->
#'P_tx'{};
decode_properties(85, <<>>) ->
#'P_confirm'{};
decode_properties(ClassId, _BinaryFields) -> exit({unknown_class_id, ClassId}).
encode_method_fields(#'connection.start'{version_major = F0, version_minor = F1, server_properties = F2, mechanisms = F3, locales = F4}) ->
F2Tab = rabbit_binary_generator:generate_table(F2),
F2Len = size(F2Tab),
F3Len = size(F3),
F4Len = size(F4),
<<F0:8/unsigned, F1:8/unsigned, F2Len:32/unsigned, F2Tab:F2Len/binary, F3Len:32/unsigned, F3:F3Len/binary, F4Len:32/unsigned, F4:F4Len/binary>>;
encode_method_fields(#'connection.start_ok'{client_properties = F0, mechanism = F1, response = F2, locale = F3}) ->
F0Tab = rabbit_binary_generator:generate_table(F0),
F0Len = size(F0Tab),
F1Len = shortstr_size(F1),
F2Len = size(F2),
F3Len = shortstr_size(F3),
<<F0Len:32/unsigned, F0Tab:F0Len/binary, F1Len:8/unsigned, F1:F1Len/binary, F2Len:32/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary>>;
encode_method_fields(#'connection.secure'{challenge = F0}) ->
F0Len = size(F0),
<<F0Len:32/unsigned, F0:F0Len/binary>>;
encode_method_fields(#'connection.secure_ok'{response = F0}) ->
F0Len = size(F0),
<<F0Len:32/unsigned, F0:F0Len/binary>>;
encode_method_fields(#'connection.tune'{channel_max = F0, frame_max = F1, heartbeat = F2}) ->
<<F0:16/unsigned, F1:32/unsigned, F2:16/unsigned>>;
encode_method_fields(#'connection.tune_ok'{channel_max = F0, frame_max = F1, heartbeat = F2}) ->
<<F0:16/unsigned, F1:32/unsigned, F2:16/unsigned>>;
encode_method_fields(#'connection.open'{virtual_host = F0, capabilities = F1, insist = F2}) ->
F0Len = shortstr_size(F0),
F1Len = shortstr_size(F1),
F2Bits = ((bitvalue(F2) bsl 0)),
<<F0Len:8/unsigned, F0:F0Len/binary, F1Len:8/unsigned, F1:F1Len/binary, F2Bits:8>>;
encode_method_fields(#'connection.open_ok'{known_hosts = F0}) ->
F0Len = shortstr_size(F0),
<<F0Len:8/unsigned, F0:F0Len/binary>>;
encode_method_fields(#'connection.close'{reply_code = F0, reply_text = F1, class_id = F2, method_id = F3}) ->
F1Len = shortstr_size(F1),
<<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2:16/unsigned, F3:16/unsigned>>;
encode_method_fields(#'connection.close_ok'{}) ->
<<>>;
encode_method_fields(#'channel.open'{out_of_band = F0}) ->
F0Len = shortstr_size(F0),
<<F0Len:8/unsigned, F0:F0Len/binary>>;
encode_method_fields(#'channel.open_ok'{channel_id = F0}) ->
F0Len = size(F0),
<<F0Len:32/unsigned, F0:F0Len/binary>>;
encode_method_fields(#'channel.flow'{active = F0}) ->
F0Bits = ((bitvalue(F0) bsl 0)),
<<F0Bits:8>>;
encode_method_fields(#'channel.flow_ok'{active = F0}) ->
F0Bits = ((bitvalue(F0) bsl 0)),
<<F0Bits:8>>;
encode_method_fields(#'channel.close'{reply_code = F0, reply_text = F1, class_id = F2, method_id = F3}) ->
F1Len = shortstr_size(F1),
<<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2:16/unsigned, F3:16/unsigned>>;
encode_method_fields(#'channel.close_ok'{}) ->
<<>>;
encode_method_fields(#'access.request'{realm = F0, exclusive = F1, passive = F2, active = F3, write = F4, read = F5}) ->
F0Len = shortstr_size(F0),
F1Bits = ((bitvalue(F1) bsl 0) bor (bitvalue(F2) bsl 1) bor (bitvalue(F3) bsl 2) bor (bitvalue(F4) bsl 3) bor (bitvalue(F5) bsl 4)),
<<F0Len:8/unsigned, F0:F0Len/binary, F1Bits:8>>;
encode_method_fields(#'access.request_ok'{ticket = F0}) ->
<<F0:16/unsigned>>;
encode_method_fields(#'exchange.declare'{ticket = F0, exchange = F1, type = F2, passive = F3, durable = F4, auto_delete = F5, internal = F6, nowait = F7, arguments = F8}) ->
F1Len = shortstr_size(F1),
F2Len = shortstr_size(F2),
F3Bits = ((bitvalue(F3) bsl 0) bor (bitvalue(F4) bsl 1) bor (bitvalue(F5) bsl 2) bor (bitvalue(F6) bsl 3) bor (bitvalue(F7) bsl 4)),
F8Tab = rabbit_binary_generator:generate_table(F8),
F8Len = size(F8Tab),
<<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Bits:8, F8Len:32/unsigned, F8Tab:F8Len/binary>>;
encode_method_fields(#'exchange.declare_ok'{}) ->
<<>>;
encode_method_fields(#'exchange.delete'{ticket = F0, exchange = F1, if_unused = F2, nowait = F3}) ->
F1Len = shortstr_size(F1),
F2Bits = ((bitvalue(F2) bsl 0) bor (bitvalue(F3) bsl 1)),
<<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Bits:8>>;
encode_method_fields(#'exchange.delete_ok'{}) ->
<<>>;
encode_method_fields(#'exchange.bind'{ticket = F0, destination = F1, source = F2, routing_key = F3, nowait = F4, arguments = F5}) ->
F1Len = shortstr_size(F1),
F2Len = shortstr_size(F2),
F3Len = shortstr_size(F3),
F4Bits = ((bitvalue(F4) bsl 0)),
F5Tab = rabbit_binary_generator:generate_table(F5),
F5Len = size(F5Tab),
<<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary, F4Bits:8, F5Len:32/unsigned, F5Tab:F5Len/binary>>;
encode_method_fields(#'exchange.bind_ok'{}) ->
<<>>;
encode_method_fields(#'exchange.unbind'{ticket = F0, destination = F1, source = F2, routing_key = F3, nowait = F4, arguments = F5}) ->
F1Len = shortstr_size(F1),
F2Len = shortstr_size(F2),
F3Len = shortstr_size(F3),
F4Bits = ((bitvalue(F4) bsl 0)),
F5Tab = rabbit_binary_generator:generate_table(F5),
F5Len = size(F5Tab),
<<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary, F4Bits:8, F5Len:32/unsigned, F5Tab:F5Len/binary>>;
encode_method_fields(#'exchange.unbind_ok'{}) ->
<<>>;
encode_method_fields(#'queue.declare'{ticket = F0, queue = F1, passive = F2, durable = F3, exclusive = F4, auto_delete = F5, nowait = F6, arguments = F7}) ->
F1Len = shortstr_size(F1),
F2Bits = ((bitvalue(F2) bsl 0) bor (bitvalue(F3) bsl 1) bor (bitvalue(F4) bsl 2) bor (bitvalue(F5) bsl 3) bor (bitvalue(F6) bsl 4)),
F7Tab = rabbit_binary_generator:generate_table(F7),
F7Len = size(F7Tab),
<<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Bits:8, F7Len:32/unsigned, F7Tab:F7Len/binary>>;
encode_method_fields(#'queue.declare_ok'{queue = F0, message_count = F1, consumer_count = F2}) ->
F0Len = shortstr_size(F0),
<<F0Len:8/unsigned, F0:F0Len/binary, F1:32/unsigned, F2:32/unsigned>>;
encode_method_fields(#'queue.bind'{ticket = F0, queue = F1, exchange = F2, routing_key = F3, nowait = F4, arguments = F5}) ->
F1Len = shortstr_size(F1),
F2Len = shortstr_size(F2),
F3Len = shortstr_size(F3),
F4Bits = ((bitvalue(F4) bsl 0)),
F5Tab = rabbit_binary_generator:generate_table(F5),
F5Len = size(F5Tab),
<<F0:16/unsigned, F1Len:8/unsigned, F1:F1Len/binary, F2Len:8/unsigned, F2:F2Len/binary, F3Len:8/unsigned, F3:F3Len/binary, F4Bits:8, F5Len:32/unsigned, F5Tab:F5Len/binary>>;
encode_method_fields(#'queue.bind_ok'{}) ->
<<>>;
encode_method_fields(#'queue.purge'{ticket = F0, queue = F1, nowait = F2}) ->
F1Len = shortstr_size(F1),
F2Bits = ((bitvalue(F2) bsl 0)),