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