amqp_framing.c

filter: Statementstmt 2.3% 37 / 1567 Branchbran 0.8% 10 / 1232 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 1.6% 47 / 2799 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« rabbitmq-include/amqp_private.h ↑ Summary amqp_api.c »
1 /* Generated code. Do not edit. Edit and re-run codegen.py instead.
2 *
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MIT
5 *
6 * Portions created by Alan Antonuk are Copyright (c) 2012-2013
7 * Alan Antonuk. All Rights Reserved.
8 *
9 * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
10 * All Rights Reserved.
11 *
12 * Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
13 * VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
14 *
15 * Permission is hereby granted, free of charge, to any person
16 * obtaining a copy of this software and associated documentation
17 * files (the "Software"), to deal in the Software without
18 * restriction, including without limitation the rights to use, copy,
19 * modify, merge, publish, distribute, sublicense, and/or sell copies
20 * of the Software, and to permit persons to whom the Software is
21 * furnished to do so, subject to the following conditions:
22 *
23 * The above copyright notice and this permission notice shall be
24 * included in all copies or substantial portions of the Software.
25 *
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
30 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
31 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 * SOFTWARE.
34 * ***** END LICENSE BLOCK *****
35 */
36  
37 #ifdef HAVE_CONFIG_H
38 #include "config.h"
39 #endif
40  
41 #include "amqp_private.h"
42 #include <stdint.h>
43 #include <stdio.h>
44 #include <stdlib.h>
45 #include <string.h>
46  
47  
48 0 char const *amqp_constant_name(int constantNumber) {
49 0 switch (constantNumber) {
50 0 case AMQP_FRAME_METHOD: return "AMQP_FRAME_METHOD";
51 0 case AMQP_FRAME_HEADER: return "AMQP_FRAME_HEADER";
52 0 case AMQP_FRAME_BODY: return "AMQP_FRAME_BODY";
53 0 case AMQP_FRAME_HEARTBEAT: return "AMQP_FRAME_HEARTBEAT";
54 0 case AMQP_FRAME_MIN_SIZE: return "AMQP_FRAME_MIN_SIZE";
55 0 case AMQP_FRAME_END: return "AMQP_FRAME_END";
56 0 case AMQP_REPLY_SUCCESS: return "AMQP_REPLY_SUCCESS";
57 0 case AMQP_CONTENT_TOO_LARGE: return "AMQP_CONTENT_TOO_LARGE";
58 0 case AMQP_NO_ROUTE: return "AMQP_NO_ROUTE";
59 0 case AMQP_NO_CONSUMERS: return "AMQP_NO_CONSUMERS";
60 0 case AMQP_ACCESS_REFUSED: return "AMQP_ACCESS_REFUSED";
61 0 case AMQP_NOT_FOUND: return "AMQP_NOT_FOUND";
62 0 case AMQP_RESOURCE_LOCKED: return "AMQP_RESOURCE_LOCKED";
63 0 case AMQP_PRECONDITION_FAILED: return "AMQP_PRECONDITION_FAILED";
64 0 case AMQP_CONNECTION_FORCED: return "AMQP_CONNECTION_FORCED";
65 0 case AMQP_INVALID_PATH: return "AMQP_INVALID_PATH";
66 0 case AMQP_FRAME_ERROR: return "AMQP_FRAME_ERROR";
67 0 case AMQP_SYNTAX_ERROR: return "AMQP_SYNTAX_ERROR";
68 0 case AMQP_COMMAND_INVALID: return "AMQP_COMMAND_INVALID";
69 0 case AMQP_CHANNEL_ERROR: return "AMQP_CHANNEL_ERROR";
70 0 case AMQP_UNEXPECTED_FRAME: return "AMQP_UNEXPECTED_FRAME";
71 0 case AMQP_RESOURCE_ERROR: return "AMQP_RESOURCE_ERROR";
72 0 case AMQP_NOT_ALLOWED: return "AMQP_NOT_ALLOWED";
73 0 case AMQP_NOT_IMPLEMENTED: return "AMQP_NOT_IMPLEMENTED";
74 0 case AMQP_INTERNAL_ERROR: return "AMQP_INTERNAL_ERROR";
75 0 default: return "(unknown)";
76 }
77 }
78  
79 0 amqp_boolean_t amqp_constant_is_hard_error(int constantNumber) {
80 0 switch (constantNumber) {
81 0 case AMQP_CONNECTION_FORCED: return 1;
82 0 case AMQP_INVALID_PATH: return 1;
83 0 case AMQP_FRAME_ERROR: return 1;
84 0 case AMQP_SYNTAX_ERROR: return 1;
85 0 case AMQP_COMMAND_INVALID: return 1;
86 0 case AMQP_CHANNEL_ERROR: return 1;
87 0 case AMQP_UNEXPECTED_FRAME: return 1;
88 0 case AMQP_RESOURCE_ERROR: return 1;
89 0 case AMQP_NOT_ALLOWED: return 1;
90 0 case AMQP_NOT_IMPLEMENTED: return 1;
91 0 case AMQP_INTERNAL_ERROR: return 1;
92 0 default: return 0;
93 }
94 }
95  
96 0 char const *amqp_method_name(amqp_method_number_t methodNumber) {
97 0 switch (methodNumber) {
98 0 case AMQP_CONNECTION_START_METHOD: return "AMQP_CONNECTION_START_METHOD";
99 0 case AMQP_CONNECTION_START_OK_METHOD: return "AMQP_CONNECTION_START_OK_METHOD";
100 0 case AMQP_CONNECTION_SECURE_METHOD: return "AMQP_CONNECTION_SECURE_METHOD";
101 0 case AMQP_CONNECTION_SECURE_OK_METHOD: return "AMQP_CONNECTION_SECURE_OK_METHOD";
102 0 case AMQP_CONNECTION_TUNE_METHOD: return "AMQP_CONNECTION_TUNE_METHOD";
103 0 case AMQP_CONNECTION_TUNE_OK_METHOD: return "AMQP_CONNECTION_TUNE_OK_METHOD";
104 0 case AMQP_CONNECTION_OPEN_METHOD: return "AMQP_CONNECTION_OPEN_METHOD";
105 0 case AMQP_CONNECTION_OPEN_OK_METHOD: return "AMQP_CONNECTION_OPEN_OK_METHOD";
106 0 case AMQP_CONNECTION_CLOSE_METHOD: return "AMQP_CONNECTION_CLOSE_METHOD";
107 0 case AMQP_CONNECTION_CLOSE_OK_METHOD: return "AMQP_CONNECTION_CLOSE_OK_METHOD";
108 0 case AMQP_CONNECTION_BLOCKED_METHOD: return "AMQP_CONNECTION_BLOCKED_METHOD";
109 0 case AMQP_CONNECTION_UNBLOCKED_METHOD: return "AMQP_CONNECTION_UNBLOCKED_METHOD";
110 0 case AMQP_CHANNEL_OPEN_METHOD: return "AMQP_CHANNEL_OPEN_METHOD";
111 0 case AMQP_CHANNEL_OPEN_OK_METHOD: return "AMQP_CHANNEL_OPEN_OK_METHOD";
112 0 case AMQP_CHANNEL_FLOW_METHOD: return "AMQP_CHANNEL_FLOW_METHOD";
113 0 case AMQP_CHANNEL_FLOW_OK_METHOD: return "AMQP_CHANNEL_FLOW_OK_METHOD";
114 0 case AMQP_CHANNEL_CLOSE_METHOD: return "AMQP_CHANNEL_CLOSE_METHOD";
115 0 case AMQP_CHANNEL_CLOSE_OK_METHOD: return "AMQP_CHANNEL_CLOSE_OK_METHOD";
116 0 case AMQP_ACCESS_REQUEST_METHOD: return "AMQP_ACCESS_REQUEST_METHOD";
117 0 case AMQP_ACCESS_REQUEST_OK_METHOD: return "AMQP_ACCESS_REQUEST_OK_METHOD";
118 0 case AMQP_EXCHANGE_DECLARE_METHOD: return "AMQP_EXCHANGE_DECLARE_METHOD";
119 0 case AMQP_EXCHANGE_DECLARE_OK_METHOD: return "AMQP_EXCHANGE_DECLARE_OK_METHOD";
120 0 case AMQP_EXCHANGE_DELETE_METHOD: return "AMQP_EXCHANGE_DELETE_METHOD";
121 0 case AMQP_EXCHANGE_DELETE_OK_METHOD: return "AMQP_EXCHANGE_DELETE_OK_METHOD";
122 0 case AMQP_EXCHANGE_BIND_METHOD: return "AMQP_EXCHANGE_BIND_METHOD";
123 0 case AMQP_EXCHANGE_BIND_OK_METHOD: return "AMQP_EXCHANGE_BIND_OK_METHOD";
124 0 case AMQP_EXCHANGE_UNBIND_METHOD: return "AMQP_EXCHANGE_UNBIND_METHOD";
125 0 case AMQP_EXCHANGE_UNBIND_OK_METHOD: return "AMQP_EXCHANGE_UNBIND_OK_METHOD";
126 0 case AMQP_QUEUE_DECLARE_METHOD: return "AMQP_QUEUE_DECLARE_METHOD";
127 0 case AMQP_QUEUE_DECLARE_OK_METHOD: return "AMQP_QUEUE_DECLARE_OK_METHOD";
128 0 case AMQP_QUEUE_BIND_METHOD: return "AMQP_QUEUE_BIND_METHOD";
129 0 case AMQP_QUEUE_BIND_OK_METHOD: return "AMQP_QUEUE_BIND_OK_METHOD";
130 0 case AMQP_QUEUE_PURGE_METHOD: return "AMQP_QUEUE_PURGE_METHOD";
131 0 case AMQP_QUEUE_PURGE_OK_METHOD: return "AMQP_QUEUE_PURGE_OK_METHOD";
132 0 case AMQP_QUEUE_DELETE_METHOD: return "AMQP_QUEUE_DELETE_METHOD";
133 0 case AMQP_QUEUE_DELETE_OK_METHOD: return "AMQP_QUEUE_DELETE_OK_METHOD";
134 0 case AMQP_QUEUE_UNBIND_METHOD: return "AMQP_QUEUE_UNBIND_METHOD";
135 0 case AMQP_QUEUE_UNBIND_OK_METHOD: return "AMQP_QUEUE_UNBIND_OK_METHOD";
136 0 case AMQP_BASIC_QOS_METHOD: return "AMQP_BASIC_QOS_METHOD";
137 0 case AMQP_BASIC_QOS_OK_METHOD: return "AMQP_BASIC_QOS_OK_METHOD";
138 0 case AMQP_BASIC_CONSUME_METHOD: return "AMQP_BASIC_CONSUME_METHOD";
139 0 case AMQP_BASIC_CONSUME_OK_METHOD: return "AMQP_BASIC_CONSUME_OK_METHOD";
140 0 case AMQP_BASIC_CANCEL_METHOD: return "AMQP_BASIC_CANCEL_METHOD";
141 0 case AMQP_BASIC_CANCEL_OK_METHOD: return "AMQP_BASIC_CANCEL_OK_METHOD";
142 0 case AMQP_BASIC_PUBLISH_METHOD: return "AMQP_BASIC_PUBLISH_METHOD";
143 0 case AMQP_BASIC_RETURN_METHOD: return "AMQP_BASIC_RETURN_METHOD";
144 0 case AMQP_BASIC_DELIVER_METHOD: return "AMQP_BASIC_DELIVER_METHOD";
145 0 case AMQP_BASIC_GET_METHOD: return "AMQP_BASIC_GET_METHOD";
146 0 case AMQP_BASIC_GET_OK_METHOD: return "AMQP_BASIC_GET_OK_METHOD";
147 0 case AMQP_BASIC_GET_EMPTY_METHOD: return "AMQP_BASIC_GET_EMPTY_METHOD";
148 0 case AMQP_BASIC_ACK_METHOD: return "AMQP_BASIC_ACK_METHOD";
149 0 case AMQP_BASIC_REJECT_METHOD: return "AMQP_BASIC_REJECT_METHOD";
150 0 case AMQP_BASIC_RECOVER_ASYNC_METHOD: return "AMQP_BASIC_RECOVER_ASYNC_METHOD";
151 0 case AMQP_BASIC_RECOVER_METHOD: return "AMQP_BASIC_RECOVER_METHOD";
152 0 case AMQP_BASIC_RECOVER_OK_METHOD: return "AMQP_BASIC_RECOVER_OK_METHOD";
153 0 case AMQP_BASIC_NACK_METHOD: return "AMQP_BASIC_NACK_METHOD";
154 0 case AMQP_TX_SELECT_METHOD: return "AMQP_TX_SELECT_METHOD";
155 0 case AMQP_TX_SELECT_OK_METHOD: return "AMQP_TX_SELECT_OK_METHOD";
156 0 case AMQP_TX_COMMIT_METHOD: return "AMQP_TX_COMMIT_METHOD";
157 0 case AMQP_TX_COMMIT_OK_METHOD: return "AMQP_TX_COMMIT_OK_METHOD";
158 0 case AMQP_TX_ROLLBACK_METHOD: return "AMQP_TX_ROLLBACK_METHOD";
159 0 case AMQP_TX_ROLLBACK_OK_METHOD: return "AMQP_TX_ROLLBACK_OK_METHOD";
160 0 case AMQP_CONFIRM_SELECT_METHOD: return "AMQP_CONFIRM_SELECT_METHOD";
161 0 case AMQP_CONFIRM_SELECT_OK_METHOD: return "AMQP_CONFIRM_SELECT_OK_METHOD";
162 0 default: return NULL;
163 }
164 }
165  
166 0 amqp_boolean_t amqp_method_has_content(amqp_method_number_t methodNumber) {
167 0 switch (methodNumber) {
168 0 case AMQP_BASIC_PUBLISH_METHOD: return 1;
169 0 case AMQP_BASIC_RETURN_METHOD: return 1;
170 0 case AMQP_BASIC_DELIVER_METHOD: return 1;
171 0 case AMQP_BASIC_GET_OK_METHOD: return 1;
172 0 default: return 0;
173 }
174 }
175  
176 0 int amqp_decode_method(amqp_method_number_t methodNumber,
177 amqp_pool_t *pool,
178 amqp_bytes_t encoded,
179 void **decoded)
180 {
181 0 size_t offset = 0;
182 uint8_t bit_buffer;
183  
184 0 switch (methodNumber) {
185 0 case AMQP_CONNECTION_START_METHOD: {
186 0 amqp_connection_start_t *m = (amqp_connection_start_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_start_t));
187 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
188 0 ▶ if (!amqp_decode_8(encoded, &offset, &m->version_major)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &m->version_major)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
189 0 ▶ if (!amqp_decode_8(encoded, &offset, &m->version_minor)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &m->version_minor)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
190 {
191 0 int res = amqp_decode_table(encoded, pool, &(m->server_properties), &offset);
192 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
193 }
194 {
195 uint32_t len;
196 0 ▶ if (!amqp_decode_32(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &len) 0 0 0
197 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->mechanisms, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->mechanisms, len)) 0 0 0
198 0 return AMQP_STATUS_BAD_AMQP_DATA;
199 }
200 {
201 uint32_t len;
202 0 ▶ if (!amqp_decode_32(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &len) 0 0 0
203 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->locales, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->locales, len)) 0 0 0
204 0 return AMQP_STATUS_BAD_AMQP_DATA;
205 }
206 0 *decoded = m;
207 0 return 0;
208 }
209 0 case AMQP_CONNECTION_START_OK_METHOD: {
210 0 amqp_connection_start_ok_t *m = (amqp_connection_start_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_start_ok_t));
211 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
212 {
213 0 int res = amqp_decode_table(encoded, pool, &(m->client_properties), &offset);
214 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
215 }
216 {
217 uint8_t len;
218 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
219 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->mechanism, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->mechanism, len)) 0 0 0
220 0 return AMQP_STATUS_BAD_AMQP_DATA;
221 }
222 {
223 uint32_t len;
224 0 ▶ if (!amqp_decode_32(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &len) 0 0 0
225 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->response, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->response, len)) 0 0 0
226 0 return AMQP_STATUS_BAD_AMQP_DATA;
227 }
228 {
229 uint8_t len;
230 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
231 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->locale, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->locale, len)) 0 0 0
232 0 return AMQP_STATUS_BAD_AMQP_DATA;
233 }
234 0 *decoded = m;
235 0 return 0;
236 }
237 0 case AMQP_CONNECTION_SECURE_METHOD: {
238 0 amqp_connection_secure_t *m = (amqp_connection_secure_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_secure_t));
239 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
240 {
241 uint32_t len;
242 0 ▶ if (!amqp_decode_32(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &len) 0 0 0
243 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->challenge, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->challenge, len)) 0 0 0
244 0 return AMQP_STATUS_BAD_AMQP_DATA;
245 }
246 0 *decoded = m;
247 0 return 0;
248 }
249 0 case AMQP_CONNECTION_SECURE_OK_METHOD: {
250 0 amqp_connection_secure_ok_t *m = (amqp_connection_secure_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_secure_ok_t));
251 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
252 {
253 uint32_t len;
254 0 ▶ if (!amqp_decode_32(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &len) 0 0 0
255 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->response, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->response, len)) 0 0 0
256 0 return AMQP_STATUS_BAD_AMQP_DATA;
257 }
258 0 *decoded = m;
259 0 return 0;
260 }
261 0 case AMQP_CONNECTION_TUNE_METHOD: {
262 0 amqp_connection_tune_t *m = (amqp_connection_tune_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_tune_t));
263 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
264 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->channel_max)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->channel_max)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
265 0 ▶ if (!amqp_decode_32(encoded, &offset, &m->frame_max)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &m->frame_max)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
266 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->heartbeat)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->heartbeat)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
267 0 *decoded = m;
268 0 return 0;
269 }
270 0 case AMQP_CONNECTION_TUNE_OK_METHOD: {
271 0 amqp_connection_tune_ok_t *m = (amqp_connection_tune_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_tune_ok_t));
272 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
273 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->channel_max)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->channel_max)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
274 0 ▶ if (!amqp_decode_32(encoded, &offset, &m->frame_max)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &m->frame_max)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
275 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->heartbeat)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->heartbeat)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
276 0 *decoded = m;
277 0 return 0;
278 }
279 0 case AMQP_CONNECTION_OPEN_METHOD: {
280 0 amqp_connection_open_t *m = (amqp_connection_open_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_open_t));
281 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
282 {
283 uint8_t len;
284 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
285 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->virtual_host, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->virtual_host, len)) 0 0 0
286 0 return AMQP_STATUS_BAD_AMQP_DATA;
287 }
288 {
289 uint8_t len;
290 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
291 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->capabilities, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->capabilities, len)) 0 0 0
292 0 return AMQP_STATUS_BAD_AMQP_DATA;
293 }
294 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
295 0 m->insist = (bit_buffer & (1 << 0)) ? 1 : 0;
296 0 *decoded = m;
297 0 return 0;
298 }
299 0 case AMQP_CONNECTION_OPEN_OK_METHOD: {
300 0 amqp_connection_open_ok_t *m = (amqp_connection_open_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_open_ok_t));
301 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
302 {
303 uint8_t len;
304 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
305 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->known_hosts, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->known_hosts, len)) 0 0 0
306 0 return AMQP_STATUS_BAD_AMQP_DATA;
307 }
308 0 *decoded = m;
309 0 return 0;
310 }
311 0 case AMQP_CONNECTION_CLOSE_METHOD: {
312 0 amqp_connection_close_t *m = (amqp_connection_close_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_close_t));
313 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
314 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
315 {
316 uint8_t len;
317 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
318 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->reply_text, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->reply_text, len)) 0 0 0
319 0 return AMQP_STATUS_BAD_AMQP_DATA;
320 }
321 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->class_id)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->class_id)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
322 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->method_id)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->method_id)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
323 0 *decoded = m;
324 0 return 0;
325 }
326 0 case AMQP_CONNECTION_CLOSE_OK_METHOD: {
327 0 amqp_connection_close_ok_t *m = (amqp_connection_close_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_close_ok_t));
328 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
329 0 *decoded = m;
330 0 return 0;
331 }
332 0 case AMQP_CONNECTION_BLOCKED_METHOD: {
333 0 amqp_connection_blocked_t *m = (amqp_connection_blocked_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_blocked_t));
334 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
335 {
336 uint8_t len;
337 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
338 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->reason, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->reason, len)) 0 0 0
339 0 return AMQP_STATUS_BAD_AMQP_DATA;
340 }
341 0 *decoded = m;
342 0 return 0;
343 }
344 0 case AMQP_CONNECTION_UNBLOCKED_METHOD: {
345 0 amqp_connection_unblocked_t *m = (amqp_connection_unblocked_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_unblocked_t));
346 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
347 0 *decoded = m;
348 0 return 0;
349 }
350 0 case AMQP_CHANNEL_OPEN_METHOD: {
351 0 amqp_channel_open_t *m = (amqp_channel_open_t *) amqp_pool_alloc(pool, sizeof(amqp_channel_open_t));
352 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
353 {
354 uint8_t len;
355 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
356 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->out_of_band, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->out_of_band, len)) 0 0 0
357 0 return AMQP_STATUS_BAD_AMQP_DATA;
358 }
359 0 *decoded = m;
360 0 return 0;
361 }
362 0 case AMQP_CHANNEL_OPEN_OK_METHOD: {
363 0 amqp_channel_open_ok_t *m = (amqp_channel_open_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_channel_open_ok_t));
364 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
365 {
366 uint32_t len;
367 0 ▶ if (!amqp_decode_32(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &len) 0 0 0
368 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->channel_id, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->channel_id, len)) 0 0 0
369 0 return AMQP_STATUS_BAD_AMQP_DATA;
370 }
371 0 *decoded = m;
372 0 return 0;
373 }
374 0 case AMQP_CHANNEL_FLOW_METHOD: {
375 0 amqp_channel_flow_t *m = (amqp_channel_flow_t *) amqp_pool_alloc(pool, sizeof(amqp_channel_flow_t));
376 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
377 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
378 0 m->active = (bit_buffer & (1 << 0)) ? 1 : 0;
379 0 *decoded = m;
380 0 return 0;
381 }
382 0 case AMQP_CHANNEL_FLOW_OK_METHOD: {
383 0 amqp_channel_flow_ok_t *m = (amqp_channel_flow_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_channel_flow_ok_t));
384 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
385 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
386 0 m->active = (bit_buffer & (1 << 0)) ? 1 : 0;
387 0 *decoded = m;
388 0 return 0;
389 }
390 0 case AMQP_CHANNEL_CLOSE_METHOD: {
391 0 amqp_channel_close_t *m = (amqp_channel_close_t *) amqp_pool_alloc(pool, sizeof(amqp_channel_close_t));
392 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
393 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
394 {
395 uint8_t len;
396 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
397 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->reply_text, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->reply_text, len)) 0 0 0
398 0 return AMQP_STATUS_BAD_AMQP_DATA;
399 }
400 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->class_id)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->class_id)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
401 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->method_id)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->method_id)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
402 0 *decoded = m;
403 0 return 0;
404 }
405 0 case AMQP_CHANNEL_CLOSE_OK_METHOD: {
406 0 amqp_channel_close_ok_t *m = (amqp_channel_close_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_channel_close_ok_t));
407 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
408 0 *decoded = m;
409 0 return 0;
410 }
411 0 case AMQP_ACCESS_REQUEST_METHOD: {
412 0 amqp_access_request_t *m = (amqp_access_request_t *) amqp_pool_alloc(pool, sizeof(amqp_access_request_t));
413 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
414 {
415 uint8_t len;
416 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
417 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->realm, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->realm, len)) 0 0 0
418 0 return AMQP_STATUS_BAD_AMQP_DATA;
419 }
420 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
421 0 m->exclusive = (bit_buffer & (1 << 0)) ? 1 : 0;
422 0 m->passive = (bit_buffer & (1 << 1)) ? 1 : 0;
423 0 m->active = (bit_buffer & (1 << 2)) ? 1 : 0;
424 0 m->write = (bit_buffer & (1 << 3)) ? 1 : 0;
425 0 m->read = (bit_buffer & (1 << 4)) ? 1 : 0;
426 0 *decoded = m;
427 0 return 0;
428 }
429 0 case AMQP_ACCESS_REQUEST_OK_METHOD: {
430 0 amqp_access_request_ok_t *m = (amqp_access_request_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_access_request_ok_t));
431 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
432 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
433 0 *decoded = m;
434 0 return 0;
435 }
436 0 case AMQP_EXCHANGE_DECLARE_METHOD: {
437 0 amqp_exchange_declare_t *m = (amqp_exchange_declare_t *) amqp_pool_alloc(pool, sizeof(amqp_exchange_declare_t));
438 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
439 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
440 {
441 uint8_t len;
442 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
443 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->exchange, len)) 0 0 0
444 0 return AMQP_STATUS_BAD_AMQP_DATA;
445 }
446 {
447 uint8_t len;
448 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
449 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->type, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->type, len)) 0 0 0
450 0 return AMQP_STATUS_BAD_AMQP_DATA;
451 }
452 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
453 0 m->passive = (bit_buffer & (1 << 0)) ? 1 : 0;
454 0 m->durable = (bit_buffer & (1 << 1)) ? 1 : 0;
455 0 m->auto_delete = (bit_buffer & (1 << 2)) ? 1 : 0;
456 0 m->internal = (bit_buffer & (1 << 3)) ? 1 : 0;
457 0 m->nowait = (bit_buffer & (1 << 4)) ? 1 : 0;
458 {
459 0 int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
460 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
461 }
462 0 *decoded = m;
463 0 return 0;
464 }
465 0 case AMQP_EXCHANGE_DECLARE_OK_METHOD: {
466 0 amqp_exchange_declare_ok_t *m = (amqp_exchange_declare_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_exchange_declare_ok_t));
467 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
468 0 *decoded = m;
469 0 return 0;
470 }
471 0 case AMQP_EXCHANGE_DELETE_METHOD: {
472 0 amqp_exchange_delete_t *m = (amqp_exchange_delete_t *) amqp_pool_alloc(pool, sizeof(amqp_exchange_delete_t));
473 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
474 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
475 {
476 uint8_t len;
477 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
478 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->exchange, len)) 0 0 0
479 0 return AMQP_STATUS_BAD_AMQP_DATA;
480 }
481 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
482 0 m->if_unused = (bit_buffer & (1 << 0)) ? 1 : 0;
483 0 m->nowait = (bit_buffer & (1 << 1)) ? 1 : 0;
484 0 *decoded = m;
485 0 return 0;
486 }
487 0 case AMQP_EXCHANGE_DELETE_OK_METHOD: {
488 0 amqp_exchange_delete_ok_t *m = (amqp_exchange_delete_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_exchange_delete_ok_t));
489 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
490 0 *decoded = m;
491 0 return 0;
492 }
493 0 case AMQP_EXCHANGE_BIND_METHOD: {
494 0 amqp_exchange_bind_t *m = (amqp_exchange_bind_t *) amqp_pool_alloc(pool, sizeof(amqp_exchange_bind_t));
495 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
496 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
497 {
498 uint8_t len;
499 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
500 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->destination, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->destination, len)) 0 0 0
501 0 return AMQP_STATUS_BAD_AMQP_DATA;
502 }
503 {
504 uint8_t len;
505 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
506 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->source, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->source, len)) 0 0 0
507 0 return AMQP_STATUS_BAD_AMQP_DATA;
508 }
509 {
510 uint8_t len;
511 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
512 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->routing_key, len)) 0 0 0
513 0 return AMQP_STATUS_BAD_AMQP_DATA;
514 }
515 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
516 0 m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
517 {
518 0 int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
519 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
520 }
521 0 *decoded = m;
522 0 return 0;
523 }
524 0 case AMQP_EXCHANGE_BIND_OK_METHOD: {
525 0 amqp_exchange_bind_ok_t *m = (amqp_exchange_bind_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_exchange_bind_ok_t));
526 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
527 0 *decoded = m;
528 0 return 0;
529 }
530 0 case AMQP_EXCHANGE_UNBIND_METHOD: {
531 0 amqp_exchange_unbind_t *m = (amqp_exchange_unbind_t *) amqp_pool_alloc(pool, sizeof(amqp_exchange_unbind_t));
532 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
533 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
534 {
535 uint8_t len;
536 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
537 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->destination, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->destination, len)) 0 0 0
538 0 return AMQP_STATUS_BAD_AMQP_DATA;
539 }
540 {
541 uint8_t len;
542 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
543 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->source, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->source, len)) 0 0 0
544 0 return AMQP_STATUS_BAD_AMQP_DATA;
545 }
546 {
547 uint8_t len;
548 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
549 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->routing_key, len)) 0 0 0
550 0 return AMQP_STATUS_BAD_AMQP_DATA;
551 }
552 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
553 0 m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
554 {
555 0 int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
556 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
557 }
558 0 *decoded = m;
559 0 return 0;
560 }
561 0 case AMQP_EXCHANGE_UNBIND_OK_METHOD: {
562 0 amqp_exchange_unbind_ok_t *m = (amqp_exchange_unbind_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_exchange_unbind_ok_t));
563 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
564 0 *decoded = m;
565 0 return 0;
566 }
567 0 case AMQP_QUEUE_DECLARE_METHOD: {
568 0 amqp_queue_declare_t *m = (amqp_queue_declare_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_declare_t));
569 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
570 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
571 {
572 uint8_t len;
573 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
574 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->queue, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->queue, len)) 0 0 0
575 0 return AMQP_STATUS_BAD_AMQP_DATA;
576 }
577 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
578 0 m->passive = (bit_buffer & (1 << 0)) ? 1 : 0;
579 0 m->durable = (bit_buffer & (1 << 1)) ? 1 : 0;
580 0 m->exclusive = (bit_buffer & (1 << 2)) ? 1 : 0;
581 0 m->auto_delete = (bit_buffer & (1 << 3)) ? 1 : 0;
582 0 m->nowait = (bit_buffer & (1 << 4)) ? 1 : 0;
583 {
584 0 int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
585 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
586 }
587 0 *decoded = m;
588 0 return 0;
589 }
590 0 case AMQP_QUEUE_DECLARE_OK_METHOD: {
591 0 amqp_queue_declare_ok_t *m = (amqp_queue_declare_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_declare_ok_t));
592 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
593 {
594 uint8_t len;
595 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
596 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->queue, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->queue, len)) 0 0 0
597 0 return AMQP_STATUS_BAD_AMQP_DATA;
598 }
599 0 ▶ if (!amqp_decode_32(encoded, &offset, &m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
600 0 ▶ if (!amqp_decode_32(encoded, &offset, &m->consumer_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &m->consumer_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
601 0 *decoded = m;
602 0 return 0;
603 }
604 0 case AMQP_QUEUE_BIND_METHOD: {
605 0 amqp_queue_bind_t *m = (amqp_queue_bind_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_bind_t));
606 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
607 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
608 {
609 uint8_t len;
610 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
611 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->queue, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->queue, len)) 0 0 0
612 0 return AMQP_STATUS_BAD_AMQP_DATA;
613 }
614 {
615 uint8_t len;
616 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
617 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->exchange, len)) 0 0 0
618 0 return AMQP_STATUS_BAD_AMQP_DATA;
619 }
620 {
621 uint8_t len;
622 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
623 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->routing_key, len)) 0 0 0
624 0 return AMQP_STATUS_BAD_AMQP_DATA;
625 }
626 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
627 0 m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
628 {
629 0 int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
630 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
631 }
632 0 *decoded = m;
633 0 return 0;
634 }
635 0 case AMQP_QUEUE_BIND_OK_METHOD: {
636 0 amqp_queue_bind_ok_t *m = (amqp_queue_bind_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_bind_ok_t));
637 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
638 0 *decoded = m;
639 0 return 0;
640 }
641 0 case AMQP_QUEUE_PURGE_METHOD: {
642 0 amqp_queue_purge_t *m = (amqp_queue_purge_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_purge_t));
643 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
644 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
645 {
646 uint8_t len;
647 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
648 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->queue, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->queue, len)) 0 0 0
649 0 return AMQP_STATUS_BAD_AMQP_DATA;
650 }
651 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
652 0 m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
653 0 *decoded = m;
654 0 return 0;
655 }
656 0 case AMQP_QUEUE_PURGE_OK_METHOD: {
657 0 amqp_queue_purge_ok_t *m = (amqp_queue_purge_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_purge_ok_t));
658 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
659 0 ▶ if (!amqp_decode_32(encoded, &offset, &m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
660 0 *decoded = m;
661 0 return 0;
662 }
663 0 case AMQP_QUEUE_DELETE_METHOD: {
664 0 amqp_queue_delete_t *m = (amqp_queue_delete_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_delete_t));
665 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
666 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
667 {
668 uint8_t len;
669 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
670 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->queue, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->queue, len)) 0 0 0
671 0 return AMQP_STATUS_BAD_AMQP_DATA;
672 }
673 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
674 0 m->if_unused = (bit_buffer & (1 << 0)) ? 1 : 0;
675 0 m->if_empty = (bit_buffer & (1 << 1)) ? 1 : 0;
676 0 m->nowait = (bit_buffer & (1 << 2)) ? 1 : 0;
677 0 *decoded = m;
678 0 return 0;
679 }
680 0 case AMQP_QUEUE_DELETE_OK_METHOD: {
681 0 amqp_queue_delete_ok_t *m = (amqp_queue_delete_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_delete_ok_t));
682 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
683 0 ▶ if (!amqp_decode_32(encoded, &offset, &m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
684 0 *decoded = m;
685 0 return 0;
686 }
687 0 case AMQP_QUEUE_UNBIND_METHOD: {
688 0 amqp_queue_unbind_t *m = (amqp_queue_unbind_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_unbind_t));
689 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
690 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
691 {
692 uint8_t len;
693 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
694 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->queue, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->queue, len)) 0 0 0
695 0 return AMQP_STATUS_BAD_AMQP_DATA;
696 }
697 {
698 uint8_t len;
699 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
700 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->exchange, len)) 0 0 0
701 0 return AMQP_STATUS_BAD_AMQP_DATA;
702 }
703 {
704 uint8_t len;
705 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
706 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->routing_key, len)) 0 0 0
707 0 return AMQP_STATUS_BAD_AMQP_DATA;
708 }
709 {
710 0 int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
711 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
712 }
713 0 *decoded = m;
714 0 return 0;
715 }
716 0 case AMQP_QUEUE_UNBIND_OK_METHOD: {
717 0 amqp_queue_unbind_ok_t *m = (amqp_queue_unbind_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_unbind_ok_t));
718 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
719 0 *decoded = m;
720 0 return 0;
721 }
722 0 case AMQP_BASIC_QOS_METHOD: {
723 0 amqp_basic_qos_t *m = (amqp_basic_qos_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_qos_t));
724 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
725 0 ▶ if (!amqp_decode_32(encoded, &offset, &m->prefetch_size)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &m->prefetch_size)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
726 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->prefetch_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->prefetch_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
727 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
728 0 m->global = (bit_buffer & (1 << 0)) ? 1 : 0;
729 0 *decoded = m;
730 0 return 0;
731 }
732 0 case AMQP_BASIC_QOS_OK_METHOD: {
733 0 amqp_basic_qos_ok_t *m = (amqp_basic_qos_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_qos_ok_t));
734 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
735 0 *decoded = m;
736 0 return 0;
737 }
738 0 case AMQP_BASIC_CONSUME_METHOD: {
739 0 amqp_basic_consume_t *m = (amqp_basic_consume_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_consume_t));
740 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
741 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
742 {
743 uint8_t len;
744 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
745 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->queue, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->queue, len)) 0 0 0
746 0 return AMQP_STATUS_BAD_AMQP_DATA;
747 }
748 {
749 uint8_t len;
750 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
751 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len)) 0 0 0
752 0 return AMQP_STATUS_BAD_AMQP_DATA;
753 }
754 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
755 0 m->no_local = (bit_buffer & (1 << 0)) ? 1 : 0;
756 0 m->no_ack = (bit_buffer & (1 << 1)) ? 1 : 0;
757 0 m->exclusive = (bit_buffer & (1 << 2)) ? 1 : 0;
758 0 m->nowait = (bit_buffer & (1 << 3)) ? 1 : 0;
759 {
760 0 int res = amqp_decode_table(encoded, pool, &(m->arguments), &offset);
761 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
762 }
763 0 *decoded = m;
764 0 return 0;
765 }
766 0 case AMQP_BASIC_CONSUME_OK_METHOD: {
767 0 amqp_basic_consume_ok_t *m = (amqp_basic_consume_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_consume_ok_t));
768 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
769 {
770 uint8_t len;
771 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
772 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len)) 0 0 0
773 0 return AMQP_STATUS_BAD_AMQP_DATA;
774 }
775 0 *decoded = m;
776 0 return 0;
777 }
778 0 case AMQP_BASIC_CANCEL_METHOD: {
779 0 amqp_basic_cancel_t *m = (amqp_basic_cancel_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_cancel_t));
780 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
781 {
782 uint8_t len;
783 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
784 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len)) 0 0 0
785 0 return AMQP_STATUS_BAD_AMQP_DATA;
786 }
787 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
788 0 m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
789 0 *decoded = m;
790 0 return 0;
791 }
792 0 case AMQP_BASIC_CANCEL_OK_METHOD: {
793 0 amqp_basic_cancel_ok_t *m = (amqp_basic_cancel_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_cancel_ok_t));
794 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
795 {
796 uint8_t len;
797 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
798 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len)) 0 0 0
799 0 return AMQP_STATUS_BAD_AMQP_DATA;
800 }
801 0 *decoded = m;
802 0 return 0;
803 }
804 0 case AMQP_BASIC_PUBLISH_METHOD: {
805 0 amqp_basic_publish_t *m = (amqp_basic_publish_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_publish_t));
806 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
807 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
808 {
809 uint8_t len;
810 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
811 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->exchange, len)) 0 0 0
812 0 return AMQP_STATUS_BAD_AMQP_DATA;
813 }
814 {
815 uint8_t len;
816 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
817 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->routing_key, len)) 0 0 0
818 0 return AMQP_STATUS_BAD_AMQP_DATA;
819 }
820 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
821 0 m->mandatory = (bit_buffer & (1 << 0)) ? 1 : 0;
822 0 m->immediate = (bit_buffer & (1 << 1)) ? 1 : 0;
823 0 *decoded = m;
824 0 return 0;
825 }
826 0 case AMQP_BASIC_RETURN_METHOD: {
827 0 amqp_basic_return_t *m = (amqp_basic_return_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_return_t));
828 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
829 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
830 {
831 uint8_t len;
832 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
833 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->reply_text, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->reply_text, len)) 0 0 0
834 0 return AMQP_STATUS_BAD_AMQP_DATA;
835 }
836 {
837 uint8_t len;
838 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
839 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->exchange, len)) 0 0 0
840 0 return AMQP_STATUS_BAD_AMQP_DATA;
841 }
842 {
843 uint8_t len;
844 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
845 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->routing_key, len)) 0 0 0
846 0 return AMQP_STATUS_BAD_AMQP_DATA;
847 }
848 0 *decoded = m;
849 0 return 0;
850 }
851 0 case AMQP_BASIC_DELIVER_METHOD: {
852 0 amqp_basic_deliver_t *m = (amqp_basic_deliver_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_deliver_t));
853 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
854 {
855 uint8_t len;
856 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
857 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->consumer_tag, len)) 0 0 0
858 0 return AMQP_STATUS_BAD_AMQP_DATA;
859 }
860 0 ▶ if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
861 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
862 0 m->redelivered = (bit_buffer & (1 << 0)) ? 1 : 0;
863 {
864 uint8_t len;
865 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
866 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->exchange, len)) 0 0 0
867 0 return AMQP_STATUS_BAD_AMQP_DATA;
868 }
869 {
870 uint8_t len;
871 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
872 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->routing_key, len)) 0 0 0
873 0 return AMQP_STATUS_BAD_AMQP_DATA;
874 }
875 0 *decoded = m;
876 0 return 0;
877 }
878 0 case AMQP_BASIC_GET_METHOD: {
879 0 amqp_basic_get_t *m = (amqp_basic_get_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_get_t));
880 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
881 0 ▶ if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
882 {
883 uint8_t len;
884 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
885 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->queue, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->queue, len)) 0 0 0
886 0 return AMQP_STATUS_BAD_AMQP_DATA;
887 }
888 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
889 0 m->no_ack = (bit_buffer & (1 << 0)) ? 1 : 0;
890 0 *decoded = m;
891 0 return 0;
892 }
893 0 case AMQP_BASIC_GET_OK_METHOD: {
894 0 amqp_basic_get_ok_t *m = (amqp_basic_get_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_get_ok_t));
895 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
896 0 ▶ if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
897 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
898 0 m->redelivered = (bit_buffer & (1 << 0)) ? 1 : 0;
899 {
900 uint8_t len;
901 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
902 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->exchange, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->exchange, len)) 0 0 0
903 0 return AMQP_STATUS_BAD_AMQP_DATA;
904 }
905 {
906 uint8_t len;
907 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
908 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->routing_key, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->routing_key, len)) 0 0 0
909 0 return AMQP_STATUS_BAD_AMQP_DATA;
910 }
911 0 ▶ if (!amqp_decode_32(encoded, &offset, &m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_32(encoded, &offset, &m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
912 0 *decoded = m;
913 0 return 0;
914 }
915 0 case AMQP_BASIC_GET_EMPTY_METHOD: {
916 0 amqp_basic_get_empty_t *m = (amqp_basic_get_empty_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_get_empty_t));
917 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
918 {
919 uint8_t len;
920 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
921 0 ▶ || !amqp_decode_bytes(encoded, &offset, &m->cluster_id, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &m->cluster_id, len)) 0 0 0
922 0 return AMQP_STATUS_BAD_AMQP_DATA;
923 }
924 0 *decoded = m;
925 0 return 0;
926 }
927 0 case AMQP_BASIC_ACK_METHOD: {
928 0 amqp_basic_ack_t *m = (amqp_basic_ack_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_ack_t));
929 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
930 0 ▶ if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
931 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
932 0 m->multiple = (bit_buffer & (1 << 0)) ? 1 : 0;
933 0 *decoded = m;
934 0 return 0;
935 }
936 0 case AMQP_BASIC_REJECT_METHOD: {
937 0 amqp_basic_reject_t *m = (amqp_basic_reject_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_reject_t));
938 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
939 0 ▶ if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
940 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
941 0 m->requeue = (bit_buffer & (1 << 0)) ? 1 : 0;
942 0 *decoded = m;
943 0 return 0;
944 }
945 0 case AMQP_BASIC_RECOVER_ASYNC_METHOD: {
946 0 amqp_basic_recover_async_t *m = (amqp_basic_recover_async_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_recover_async_t));
947 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
948 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
949 0 m->requeue = (bit_buffer & (1 << 0)) ? 1 : 0;
950 0 *decoded = m;
951 0 return 0;
952 }
953 0 case AMQP_BASIC_RECOVER_METHOD: {
954 0 amqp_basic_recover_t *m = (amqp_basic_recover_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_recover_t));
955 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
956 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
957 0 m->requeue = (bit_buffer & (1 << 0)) ? 1 : 0;
958 0 *decoded = m;
959 0 return 0;
960 }
961 0 case AMQP_BASIC_RECOVER_OK_METHOD: {
962 0 amqp_basic_recover_ok_t *m = (amqp_basic_recover_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_recover_ok_t));
963 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
964 0 *decoded = m;
965 0 return 0;
966 }
967 0 case AMQP_BASIC_NACK_METHOD: {
968 0 amqp_basic_nack_t *m = (amqp_basic_nack_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_nack_t));
969 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
970 0 ▶ if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_64(encoded, &offset, &m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
971 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
972 0 m->multiple = (bit_buffer & (1 << 0)) ? 1 : 0;
973 0 m->requeue = (bit_buffer & (1 << 1)) ? 1 : 0;
974 0 *decoded = m;
975 0 return 0;
976 }
977 0 case AMQP_TX_SELECT_METHOD: {
978 0 amqp_tx_select_t *m = (amqp_tx_select_t *) amqp_pool_alloc(pool, sizeof(amqp_tx_select_t));
979 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
980 0 *decoded = m;
981 0 return 0;
982 }
983 0 case AMQP_TX_SELECT_OK_METHOD: {
984 0 amqp_tx_select_ok_t *m = (amqp_tx_select_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_tx_select_ok_t));
985 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
986 0 *decoded = m;
987 0 return 0;
988 }
989 0 case AMQP_TX_COMMIT_METHOD: {
990 0 amqp_tx_commit_t *m = (amqp_tx_commit_t *) amqp_pool_alloc(pool, sizeof(amqp_tx_commit_t));
991 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
992 0 *decoded = m;
993 0 return 0;
994 }
995 0 case AMQP_TX_COMMIT_OK_METHOD: {
996 0 amqp_tx_commit_ok_t *m = (amqp_tx_commit_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_tx_commit_ok_t));
997 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
998 0 *decoded = m;
999 0 return 0;
1000 }
1001 0 case AMQP_TX_ROLLBACK_METHOD: {
1002 0 amqp_tx_rollback_t *m = (amqp_tx_rollback_t *) amqp_pool_alloc(pool, sizeof(amqp_tx_rollback_t));
1003 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1004 0 *decoded = m;
1005 0 return 0;
1006 }
1007 0 case AMQP_TX_ROLLBACK_OK_METHOD: {
1008 0 amqp_tx_rollback_ok_t *m = (amqp_tx_rollback_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_tx_rollback_ok_t));
1009 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1010 0 *decoded = m;
1011 0 return 0;
1012 }
1013 0 case AMQP_CONFIRM_SELECT_METHOD: {
1014 0 amqp_confirm_select_t *m = (amqp_confirm_select_t *) amqp_pool_alloc(pool, sizeof(amqp_confirm_select_t));
1015 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1016 0 ▶ if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1017 0 m->nowait = (bit_buffer & (1 << 0)) ? 1 : 0;
1018 0 *decoded = m;
1019 0 return 0;
1020 }
1021 0 case AMQP_CONFIRM_SELECT_OK_METHOD: {
1022 0 amqp_confirm_select_ok_t *m = (amqp_confirm_select_ok_t *) amqp_pool_alloc(pool, sizeof(amqp_confirm_select_ok_t));
1023 0 ▶ if (m == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (m == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1024 0 *decoded = m;
1025 0 return 0;
1026 }
1027 0 default: return AMQP_STATUS_UNKNOWN_METHOD;
1028 }
1029 }
1030  
1031 0 int amqp_decode_properties(uint16_t class_id,
1032 amqp_pool_t *pool,
1033 amqp_bytes_t encoded,
1034 void **decoded)
1035 {
1036 0 size_t offset = 0;
1037  
1038 0 amqp_flags_t flags = 0;
1039 0 int flagword_index = 0;
1040 uint16_t partial_flags;
1041  
1042 do {
1043 0 ▶ if (!amqp_decode_16(encoded, &offset, &partial_flags))
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_16(encoded, &offset, &partial_flags)) 0 0 0
1044 0 return AMQP_STATUS_BAD_AMQP_DATA;
1045 0 flags |= (partial_flags << (flagword_index * 16));
1046 0 flagword_index++;
1047 0 ▶ } while (partial_flags & 1);
Branch: 1 branch
BranchTrueFalseTotal
} while (partial_flags & 1); 0 0 0
1048  
1049 0 switch (class_id) {
1050 0 case 10: {
1051 0 amqp_connection_properties_t *p = (amqp_connection_properties_t *) amqp_pool_alloc(pool, sizeof(amqp_connection_properties_t));
1052 0 ▶ if (p == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (p == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1053 0 p->_flags = flags;
1054 0 *decoded = p;
1055 0 return 0;
1056 }
1057 0 case 20: {
1058 0 amqp_channel_properties_t *p = (amqp_channel_properties_t *) amqp_pool_alloc(pool, sizeof(amqp_channel_properties_t));
1059 0 ▶ if (p == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (p == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1060 0 p->_flags = flags;
1061 0 *decoded = p;
1062 0 return 0;
1063 }
1064 0 case 30: {
1065 0 amqp_access_properties_t *p = (amqp_access_properties_t *) amqp_pool_alloc(pool, sizeof(amqp_access_properties_t));
1066 0 ▶ if (p == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (p == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1067 0 p->_flags = flags;
1068 0 *decoded = p;
1069 0 return 0;
1070 }
1071 0 case 40: {
1072 0 amqp_exchange_properties_t *p = (amqp_exchange_properties_t *) amqp_pool_alloc(pool, sizeof(amqp_exchange_properties_t));
1073 0 ▶ if (p == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (p == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1074 0 p->_flags = flags;
1075 0 *decoded = p;
1076 0 return 0;
1077 }
1078 0 case 50: {
1079 0 amqp_queue_properties_t *p = (amqp_queue_properties_t *) amqp_pool_alloc(pool, sizeof(amqp_queue_properties_t));
1080 0 ▶ if (p == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (p == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1081 0 p->_flags = flags;
1082 0 *decoded = p;
1083 0 return 0;
1084 }
1085 0 case 60: {
1086 0 amqp_basic_properties_t *p = (amqp_basic_properties_t *) amqp_pool_alloc(pool, sizeof(amqp_basic_properties_t));
1087 0 ▶ if (p == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (p == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1088 0 p->_flags = flags;
1089 0 ▶ if (flags & AMQP_BASIC_CONTENT_TYPE_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_CONTENT_TYPE_FLAG) { 0 0 0
1090 {
1091 uint8_t len;
1092 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1093 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->content_type, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->content_type, len)) 0 0 0
1094 0 return AMQP_STATUS_BAD_AMQP_DATA;
1095 }
1096 }
1097 0 ▶ if (flags & AMQP_BASIC_CONTENT_ENCODING_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_CONTENT_ENCODING_FLAG) { 0 0 0
1098 {
1099 uint8_t len;
1100 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1101 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->content_encoding, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->content_encoding, len)) 0 0 0
1102 0 return AMQP_STATUS_BAD_AMQP_DATA;
1103 }
1104 }
1105 0 ▶ if (flags & AMQP_BASIC_HEADERS_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_HEADERS_FLAG) { 0 0 0
1106 {
1107 0 int res = amqp_decode_table(encoded, pool, &(p->headers), &offset);
1108 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1109 }
1110 }
1111 0 ▶ if (flags & AMQP_BASIC_DELIVERY_MODE_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_DELIVERY_MODE_FLAG) { 0 0 0
1112 0 ▶ if (!amqp_decode_8(encoded, &offset, &p->delivery_mode)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &p->delivery_mode)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1113 }
1114 0 ▶ if (flags & AMQP_BASIC_PRIORITY_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_PRIORITY_FLAG) { 0 0 0
1115 0 ▶ if (!amqp_decode_8(encoded, &offset, &p->priority)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &p->priority)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1116 }
1117 0 ▶ if (flags & AMQP_BASIC_CORRELATION_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_CORRELATION_ID_FLAG) { 0 0 0
1118 {
1119 uint8_t len;
1120 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1121 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->correlation_id, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->correlation_id, len)) 0 0 0
1122 0 return AMQP_STATUS_BAD_AMQP_DATA;
1123 }
1124 }
1125 0 ▶ if (flags & AMQP_BASIC_REPLY_TO_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_REPLY_TO_FLAG) { 0 0 0
1126 {
1127 uint8_t len;
1128 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1129 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->reply_to, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->reply_to, len)) 0 0 0
1130 0 return AMQP_STATUS_BAD_AMQP_DATA;
1131 }
1132 }
1133 0 ▶ if (flags & AMQP_BASIC_EXPIRATION_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_EXPIRATION_FLAG) { 0 0 0
1134 {
1135 uint8_t len;
1136 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1137 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->expiration, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->expiration, len)) 0 0 0
1138 0 return AMQP_STATUS_BAD_AMQP_DATA;
1139 }
1140 }
1141 0 ▶ if (flags & AMQP_BASIC_MESSAGE_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_MESSAGE_ID_FLAG) { 0 0 0
1142 {
1143 uint8_t len;
1144 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1145 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->message_id, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->message_id, len)) 0 0 0
1146 0 return AMQP_STATUS_BAD_AMQP_DATA;
1147 }
1148 }
1149 0 ▶ if (flags & AMQP_BASIC_TIMESTAMP_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_TIMESTAMP_FLAG) { 0 0 0
1150 0 ▶ if (!amqp_decode_64(encoded, &offset, &p->timestamp)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_64(encoded, &offset, &p->timestamp)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1151 }
1152 0 ▶ if (flags & AMQP_BASIC_TYPE_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_TYPE_FLAG) { 0 0 0
1153 {
1154 uint8_t len;
1155 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1156 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->type, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->type, len)) 0 0 0
1157 0 return AMQP_STATUS_BAD_AMQP_DATA;
1158 }
1159 }
1160 0 ▶ if (flags & AMQP_BASIC_USER_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_USER_ID_FLAG) { 0 0 0
1161 {
1162 uint8_t len;
1163 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1164 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->user_id, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->user_id, len)) 0 0 0
1165 0 return AMQP_STATUS_BAD_AMQP_DATA;
1166 }
1167 }
1168 0 ▶ if (flags & AMQP_BASIC_APP_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_APP_ID_FLAG) { 0 0 0
1169 {
1170 uint8_t len;
1171 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1172 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->app_id, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->app_id, len)) 0 0 0
1173 0 return AMQP_STATUS_BAD_AMQP_DATA;
1174 }
1175 }
1176 0 ▶ if (flags & AMQP_BASIC_CLUSTER_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_CLUSTER_ID_FLAG) { 0 0 0
1177 {
1178 uint8_t len;
1179 0 ▶ if (!amqp_decode_8(encoded, &offset, &len)
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_decode_8(encoded, &offset, &len) 0 0 0
1180 0 ▶ || !amqp_decode_bytes(encoded, &offset, &p->cluster_id, len))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_decode_bytes(encoded, &offset, &p->cluster_id, len)) 0 0 0
1181 0 return AMQP_STATUS_BAD_AMQP_DATA;
1182 }
1183 }
1184 0 *decoded = p;
1185 0 return 0;
1186 }
1187 0 case 90: {
1188 0 amqp_tx_properties_t *p = (amqp_tx_properties_t *) amqp_pool_alloc(pool, sizeof(amqp_tx_properties_t));
1189 0 ▶ if (p == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (p == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1190 0 p->_flags = flags;
1191 0 *decoded = p;
1192 0 return 0;
1193 }
1194 0 case 85: {
1195 0 amqp_confirm_properties_t *p = (amqp_confirm_properties_t *) amqp_pool_alloc(pool, sizeof(amqp_confirm_properties_t));
1196 0 ▶ if (p == NULL) { return AMQP_STATUS_NO_MEMORY; }
Branch: 1 branch
BranchTrueFalseTotal
if (p == NULL) { return AMQP_STATUS_NO_MEMORY; } 0 0 0
1197 0 p->_flags = flags;
1198 0 *decoded = p;
1199 0 return 0;
1200 }
1201 0 default: return AMQP_STATUS_UNKNOWN_CLASS;
1202 }
1203 }
1204  
1205 36 int amqp_encode_method(amqp_method_number_t methodNumber,
1206 void *decoded,
1207 amqp_bytes_t encoded)
1208 {
1209 36 size_t offset = 0;
1210 uint8_t bit_buffer;
1211  
1212 36 switch (methodNumber) {
1213 0 case AMQP_CONNECTION_START_METHOD: {
1214 0 amqp_connection_start_t *m = (amqp_connection_start_t *) decoded;
1215 0 ▶ if (!amqp_encode_8(encoded, &offset, m->version_major)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, m->version_major)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1216 0 ▶ if (!amqp_encode_8(encoded, &offset, m->version_minor)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, m->version_minor)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1217 {
1218 0 int res = amqp_encode_table(encoded, &(m->server_properties), &offset);
1219 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1220 }
1221 0 ▶ if (UINT32_MAX < m->mechanisms.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT32_MAX < m->mechanisms.len 0 0 0
1222 0 ▶ || !amqp_encode_32(encoded, &offset, (uint32_t)m->mechanisms.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_32(encoded, &offset, (uint32_t)m->mechanisms.len) 0 0 0
1223 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->mechanisms))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->mechanisms)) 0 0 0
1224 0 return AMQP_STATUS_BAD_AMQP_DATA;
1225 0 ▶ if (UINT32_MAX < m->locales.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT32_MAX < m->locales.len 0 0 0
1226 0 ▶ || !amqp_encode_32(encoded, &offset, (uint32_t)m->locales.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_32(encoded, &offset, (uint32_t)m->locales.len) 0 0 0
1227 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->locales))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->locales)) 0 0 0
1228 0 return AMQP_STATUS_BAD_AMQP_DATA;
1229 0 return (int)offset;
1230 }
1231 0 case AMQP_CONNECTION_START_OK_METHOD: {
1232 0 amqp_connection_start_ok_t *m = (amqp_connection_start_ok_t *) decoded;
1233 {
1234 0 int res = amqp_encode_table(encoded, &(m->client_properties), &offset);
1235 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1236 }
1237 0 ▶ if (UINT8_MAX < m->mechanism.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->mechanism.len 0 0 0
1238 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->mechanism.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->mechanism.len) 0 0 0
1239 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->mechanism))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->mechanism)) 0 0 0
1240 0 return AMQP_STATUS_BAD_AMQP_DATA;
1241 0 ▶ if (UINT32_MAX < m->response.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT32_MAX < m->response.len 0 0 0
1242 0 ▶ || !amqp_encode_32(encoded, &offset, (uint32_t)m->response.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_32(encoded, &offset, (uint32_t)m->response.len) 0 0 0
1243 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->response))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->response)) 0 0 0
1244 0 return AMQP_STATUS_BAD_AMQP_DATA;
1245 0 ▶ if (UINT8_MAX < m->locale.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->locale.len 0 0 0
1246 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->locale.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->locale.len) 0 0 0
1247 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->locale))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->locale)) 0 0 0
1248 0 return AMQP_STATUS_BAD_AMQP_DATA;
1249 0 return (int)offset;
1250 }
1251 0 case AMQP_CONNECTION_SECURE_METHOD: {
1252 0 amqp_connection_secure_t *m = (amqp_connection_secure_t *) decoded;
1253 0 ▶ if (UINT32_MAX < m->challenge.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT32_MAX < m->challenge.len 0 0 0
1254 0 ▶ || !amqp_encode_32(encoded, &offset, (uint32_t)m->challenge.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_32(encoded, &offset, (uint32_t)m->challenge.len) 0 0 0
1255 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->challenge))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->challenge)) 0 0 0
1256 0 return AMQP_STATUS_BAD_AMQP_DATA;
1257 0 return (int)offset;
1258 }
1259 0 case AMQP_CONNECTION_SECURE_OK_METHOD: {
1260 0 amqp_connection_secure_ok_t *m = (amqp_connection_secure_ok_t *) decoded;
1261 0 ▶ if (UINT32_MAX < m->response.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT32_MAX < m->response.len 0 0 0
1262 0 ▶ || !amqp_encode_32(encoded, &offset, (uint32_t)m->response.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_32(encoded, &offset, (uint32_t)m->response.len) 0 0 0
1263 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->response))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->response)) 0 0 0
1264 0 return AMQP_STATUS_BAD_AMQP_DATA;
1265 0 return (int)offset;
1266 }
1267 0 case AMQP_CONNECTION_TUNE_METHOD: {
1268 0 amqp_connection_tune_t *m = (amqp_connection_tune_t *) decoded;
1269 0 ▶ if (!amqp_encode_16(encoded, &offset, m->channel_max)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->channel_max)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1270 0 ▶ if (!amqp_encode_32(encoded, &offset, m->frame_max)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_32(encoded, &offset, m->frame_max)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1271 0 ▶ if (!amqp_encode_16(encoded, &offset, m->heartbeat)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->heartbeat)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1272 0 return (int)offset;
1273 }
1274 0 case AMQP_CONNECTION_TUNE_OK_METHOD: {
1275 0 amqp_connection_tune_ok_t *m = (amqp_connection_tune_ok_t *) decoded;
1276 0 ▶ if (!amqp_encode_16(encoded, &offset, m->channel_max)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->channel_max)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1277 0 ▶ if (!amqp_encode_32(encoded, &offset, m->frame_max)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_32(encoded, &offset, m->frame_max)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1278 0 ▶ if (!amqp_encode_16(encoded, &offset, m->heartbeat)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->heartbeat)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1279 0 return (int)offset;
1280 }
1281 0 case AMQP_CONNECTION_OPEN_METHOD: {
1282 0 amqp_connection_open_t *m = (amqp_connection_open_t *) decoded;
1283 0 ▶ if (UINT8_MAX < m->virtual_host.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->virtual_host.len 0 0 0
1284 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->virtual_host.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->virtual_host.len) 0 0 0
1285 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->virtual_host))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->virtual_host)) 0 0 0
1286 0 return AMQP_STATUS_BAD_AMQP_DATA;
1287 0 ▶ if (UINT8_MAX < m->capabilities.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->capabilities.len 0 0 0
1288 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->capabilities.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->capabilities.len) 0 0 0
1289 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->capabilities))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->capabilities)) 0 0 0
1290 0 return AMQP_STATUS_BAD_AMQP_DATA;
1291 0 bit_buffer = 0;
1292 0 ▶ if (m->insist) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->insist) bit_buffer |= (1 << 0); 0 0 0
1293 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1294 0 return (int)offset;
1295 }
1296 0 case AMQP_CONNECTION_OPEN_OK_METHOD: {
1297 0 amqp_connection_open_ok_t *m = (amqp_connection_open_ok_t *) decoded;
1298 0 ▶ if (UINT8_MAX < m->known_hosts.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->known_hosts.len 0 0 0
1299 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->known_hosts.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->known_hosts.len) 0 0 0
1300 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->known_hosts))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->known_hosts)) 0 0 0
1301 0 return AMQP_STATUS_BAD_AMQP_DATA;
1302 0 return (int)offset;
1303 }
1304 32 case AMQP_CONNECTION_CLOSE_METHOD: {
1305 32 amqp_connection_close_t *m = (amqp_connection_close_t *) decoded;
1306 32 ▶ if (!amqp_encode_16(encoded, &offset, m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA; 0 32 32
1307 32 ▶ if (UINT8_MAX < m->reply_text.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->reply_text.len 32 0 32
1308 32 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->reply_text.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->reply_text.len) 32 0 32
1309 32 ▶ || !amqp_encode_bytes(encoded, &offset, m->reply_text))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->reply_text)) 0 32 32
1310 0 return AMQP_STATUS_BAD_AMQP_DATA;
1311 32 ▶ if (!amqp_encode_16(encoded, &offset, m->class_id)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->class_id)) return AMQP_STATUS_BAD_AMQP_DATA; 0 32 32
1312 32 ▶ if (!amqp_encode_16(encoded, &offset, m->method_id)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->method_id)) return AMQP_STATUS_BAD_AMQP_DATA; 0 32 32
1313 32 return (int)offset;
1314 }
1315 0 case AMQP_CONNECTION_CLOSE_OK_METHOD: {
1316 0 return (int)offset;
1317 }
1318 0 case AMQP_CONNECTION_BLOCKED_METHOD: {
1319 0 amqp_connection_blocked_t *m = (amqp_connection_blocked_t *) decoded;
1320 0 ▶ if (UINT8_MAX < m->reason.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->reason.len 0 0 0
1321 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->reason.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->reason.len) 0 0 0
1322 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->reason))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->reason)) 0 0 0
1323 0 return AMQP_STATUS_BAD_AMQP_DATA;
1324 0 return (int)offset;
1325 }
1326 0 case AMQP_CONNECTION_UNBLOCKED_METHOD: {
1327 0 return (int)offset;
1328 }
1329 0 case AMQP_CHANNEL_OPEN_METHOD: {
1330 0 amqp_channel_open_t *m = (amqp_channel_open_t *) decoded;
1331 0 ▶ if (UINT8_MAX < m->out_of_band.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->out_of_band.len 0 0 0
1332 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->out_of_band.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->out_of_band.len) 0 0 0
1333 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->out_of_band))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->out_of_band)) 0 0 0
1334 0 return AMQP_STATUS_BAD_AMQP_DATA;
1335 0 return (int)offset;
1336 }
1337 0 case AMQP_CHANNEL_OPEN_OK_METHOD: {
1338 0 amqp_channel_open_ok_t *m = (amqp_channel_open_ok_t *) decoded;
1339 0 ▶ if (UINT32_MAX < m->channel_id.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT32_MAX < m->channel_id.len 0 0 0
1340 0 ▶ || !amqp_encode_32(encoded, &offset, (uint32_t)m->channel_id.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_32(encoded, &offset, (uint32_t)m->channel_id.len) 0 0 0
1341 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->channel_id))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->channel_id)) 0 0 0
1342 0 return AMQP_STATUS_BAD_AMQP_DATA;
1343 0 return (int)offset;
1344 }
1345 0 case AMQP_CHANNEL_FLOW_METHOD: {
1346 0 amqp_channel_flow_t *m = (amqp_channel_flow_t *) decoded;
1347 0 bit_buffer = 0;
1348 0 ▶ if (m->active) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->active) bit_buffer |= (1 << 0); 0 0 0
1349 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1350 0 return (int)offset;
1351 }
1352 0 case AMQP_CHANNEL_FLOW_OK_METHOD: {
1353 0 amqp_channel_flow_ok_t *m = (amqp_channel_flow_ok_t *) decoded;
1354 0 bit_buffer = 0;
1355 0 ▶ if (m->active) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->active) bit_buffer |= (1 << 0); 0 0 0
1356 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1357 0 return (int)offset;
1358 }
1359 0 case AMQP_CHANNEL_CLOSE_METHOD: {
1360 0 amqp_channel_close_t *m = (amqp_channel_close_t *) decoded;
1361 0 ▶ if (!amqp_encode_16(encoded, &offset, m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1362 0 ▶ if (UINT8_MAX < m->reply_text.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->reply_text.len 0 0 0
1363 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->reply_text.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->reply_text.len) 0 0 0
1364 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->reply_text))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->reply_text)) 0 0 0
1365 0 return AMQP_STATUS_BAD_AMQP_DATA;
1366 0 ▶ if (!amqp_encode_16(encoded, &offset, m->class_id)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->class_id)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1367 0 ▶ if (!amqp_encode_16(encoded, &offset, m->method_id)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->method_id)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1368 0 return (int)offset;
1369 }
1370 0 case AMQP_CHANNEL_CLOSE_OK_METHOD: {
1371 0 return (int)offset;
1372 }
1373 0 case AMQP_ACCESS_REQUEST_METHOD: {
1374 0 amqp_access_request_t *m = (amqp_access_request_t *) decoded;
1375 0 ▶ if (UINT8_MAX < m->realm.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->realm.len 0 0 0
1376 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->realm.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->realm.len) 0 0 0
1377 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->realm))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->realm)) 0 0 0
1378 0 return AMQP_STATUS_BAD_AMQP_DATA;
1379 0 bit_buffer = 0;
1380 0 ▶ if (m->exclusive) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->exclusive) bit_buffer |= (1 << 0); 0 0 0
1381 0 ▶ if (m->passive) bit_buffer |= (1 << 1);
Branch: 1 branch
BranchTrueFalseTotal
if (m->passive) bit_buffer |= (1 << 1); 0 0 0
1382 0 ▶ if (m->active) bit_buffer |= (1 << 2);
Branch: 1 branch
BranchTrueFalseTotal
if (m->active) bit_buffer |= (1 << 2); 0 0 0
1383 0 ▶ if (m->write) bit_buffer |= (1 << 3);
Branch: 1 branch
BranchTrueFalseTotal
if (m->write) bit_buffer |= (1 << 3); 0 0 0
1384 0 ▶ if (m->read) bit_buffer |= (1 << 4);
Branch: 1 branch
BranchTrueFalseTotal
if (m->read) bit_buffer |= (1 << 4); 0 0 0
1385 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1386 0 return (int)offset;
1387 }
1388 0 case AMQP_ACCESS_REQUEST_OK_METHOD: {
1389 0 amqp_access_request_ok_t *m = (amqp_access_request_ok_t *) decoded;
1390 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1391 0 return (int)offset;
1392 }
1393 0 case AMQP_EXCHANGE_DECLARE_METHOD: {
1394 0 amqp_exchange_declare_t *m = (amqp_exchange_declare_t *) decoded;
1395 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1396 0 ▶ if (UINT8_MAX < m->exchange.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->exchange.len 0 0 0
1397 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len) 0 0 0
1398 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->exchange))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->exchange)) 0 0 0
1399 0 return AMQP_STATUS_BAD_AMQP_DATA;
1400 0 ▶ if (UINT8_MAX < m->type.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->type.len 0 0 0
1401 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->type.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->type.len) 0 0 0
1402 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->type))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->type)) 0 0 0
1403 0 return AMQP_STATUS_BAD_AMQP_DATA;
1404 0 bit_buffer = 0;
1405 0 ▶ if (m->passive) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->passive) bit_buffer |= (1 << 0); 0 0 0
1406 0 ▶ if (m->durable) bit_buffer |= (1 << 1);
Branch: 1 branch
BranchTrueFalseTotal
if (m->durable) bit_buffer |= (1 << 1); 0 0 0
1407 0 ▶ if (m->auto_delete) bit_buffer |= (1 << 2);
Branch: 1 branch
BranchTrueFalseTotal
if (m->auto_delete) bit_buffer |= (1 << 2); 0 0 0
1408 0 ▶ if (m->internal) bit_buffer |= (1 << 3);
Branch: 1 branch
BranchTrueFalseTotal
if (m->internal) bit_buffer |= (1 << 3); 0 0 0
1409 0 ▶ if (m->nowait) bit_buffer |= (1 << 4);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 4); 0 0 0
1410 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1411 {
1412 0 int res = amqp_encode_table(encoded, &(m->arguments), &offset);
1413 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1414 }
1415 0 return (int)offset;
1416 }
1417 0 case AMQP_EXCHANGE_DECLARE_OK_METHOD: {
1418 0 return (int)offset;
1419 }
1420 0 case AMQP_EXCHANGE_DELETE_METHOD: {
1421 0 amqp_exchange_delete_t *m = (amqp_exchange_delete_t *) decoded;
1422 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1423 0 ▶ if (UINT8_MAX < m->exchange.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->exchange.len 0 0 0
1424 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len) 0 0 0
1425 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->exchange))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->exchange)) 0 0 0
1426 0 return AMQP_STATUS_BAD_AMQP_DATA;
1427 0 bit_buffer = 0;
1428 0 ▶ if (m->if_unused) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->if_unused) bit_buffer |= (1 << 0); 0 0 0
1429 0 ▶ if (m->nowait) bit_buffer |= (1 << 1);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 1); 0 0 0
1430 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1431 0 return (int)offset;
1432 }
1433 0 case AMQP_EXCHANGE_DELETE_OK_METHOD: {
1434 0 return (int)offset;
1435 }
1436 0 case AMQP_EXCHANGE_BIND_METHOD: {
1437 0 amqp_exchange_bind_t *m = (amqp_exchange_bind_t *) decoded;
1438 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1439 0 ▶ if (UINT8_MAX < m->destination.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->destination.len 0 0 0
1440 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->destination.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->destination.len) 0 0 0
1441 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->destination))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->destination)) 0 0 0
1442 0 return AMQP_STATUS_BAD_AMQP_DATA;
1443 0 ▶ if (UINT8_MAX < m->source.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->source.len 0 0 0
1444 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->source.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->source.len) 0 0 0
1445 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->source))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->source)) 0 0 0
1446 0 return AMQP_STATUS_BAD_AMQP_DATA;
1447 0 ▶ if (UINT8_MAX < m->routing_key.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->routing_key.len 0 0 0
1448 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len) 0 0 0
1449 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->routing_key))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->routing_key)) 0 0 0
1450 0 return AMQP_STATUS_BAD_AMQP_DATA;
1451 0 bit_buffer = 0;
1452 0 ▶ if (m->nowait) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 0); 0 0 0
1453 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1454 {
1455 0 int res = amqp_encode_table(encoded, &(m->arguments), &offset);
1456 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1457 }
1458 0 return (int)offset;
1459 }
1460 0 case AMQP_EXCHANGE_BIND_OK_METHOD: {
1461 0 return (int)offset;
1462 }
1463 0 case AMQP_EXCHANGE_UNBIND_METHOD: {
1464 0 amqp_exchange_unbind_t *m = (amqp_exchange_unbind_t *) decoded;
1465 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1466 0 ▶ if (UINT8_MAX < m->destination.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->destination.len 0 0 0
1467 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->destination.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->destination.len) 0 0 0
1468 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->destination))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->destination)) 0 0 0
1469 0 return AMQP_STATUS_BAD_AMQP_DATA;
1470 0 ▶ if (UINT8_MAX < m->source.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->source.len 0 0 0
1471 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->source.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->source.len) 0 0 0
1472 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->source))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->source)) 0 0 0
1473 0 return AMQP_STATUS_BAD_AMQP_DATA;
1474 0 ▶ if (UINT8_MAX < m->routing_key.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->routing_key.len 0 0 0
1475 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len) 0 0 0
1476 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->routing_key))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->routing_key)) 0 0 0
1477 0 return AMQP_STATUS_BAD_AMQP_DATA;
1478 0 bit_buffer = 0;
1479 0 ▶ if (m->nowait) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 0); 0 0 0
1480 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1481 {
1482 0 int res = amqp_encode_table(encoded, &(m->arguments), &offset);
1483 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1484 }
1485 0 return (int)offset;
1486 }
1487 0 case AMQP_EXCHANGE_UNBIND_OK_METHOD: {
1488 0 return (int)offset;
1489 }
1490 0 case AMQP_QUEUE_DECLARE_METHOD: {
1491 0 amqp_queue_declare_t *m = (amqp_queue_declare_t *) decoded;
1492 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1493 0 ▶ if (UINT8_MAX < m->queue.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->queue.len 0 0 0
1494 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len) 0 0 0
1495 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->queue))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->queue)) 0 0 0
1496 0 return AMQP_STATUS_BAD_AMQP_DATA;
1497 0 bit_buffer = 0;
1498 0 ▶ if (m->passive) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->passive) bit_buffer |= (1 << 0); 0 0 0
1499 0 ▶ if (m->durable) bit_buffer |= (1 << 1);
Branch: 1 branch
BranchTrueFalseTotal
if (m->durable) bit_buffer |= (1 << 1); 0 0 0
1500 0 ▶ if (m->exclusive) bit_buffer |= (1 << 2);
Branch: 1 branch
BranchTrueFalseTotal
if (m->exclusive) bit_buffer |= (1 << 2); 0 0 0
1501 0 ▶ if (m->auto_delete) bit_buffer |= (1 << 3);
Branch: 1 branch
BranchTrueFalseTotal
if (m->auto_delete) bit_buffer |= (1 << 3); 0 0 0
1502 0 ▶ if (m->nowait) bit_buffer |= (1 << 4);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 4); 0 0 0
1503 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1504 {
1505 0 int res = amqp_encode_table(encoded, &(m->arguments), &offset);
1506 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1507 }
1508 0 return (int)offset;
1509 }
1510 0 case AMQP_QUEUE_DECLARE_OK_METHOD: {
1511 0 amqp_queue_declare_ok_t *m = (amqp_queue_declare_ok_t *) decoded;
1512 0 ▶ if (UINT8_MAX < m->queue.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->queue.len 0 0 0
1513 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len) 0 0 0
1514 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->queue))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->queue)) 0 0 0
1515 0 return AMQP_STATUS_BAD_AMQP_DATA;
1516 0 ▶ if (!amqp_encode_32(encoded, &offset, m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_32(encoded, &offset, m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1517 0 ▶ if (!amqp_encode_32(encoded, &offset, m->consumer_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_32(encoded, &offset, m->consumer_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1518 0 return (int)offset;
1519 }
1520 0 case AMQP_QUEUE_BIND_METHOD: {
1521 0 amqp_queue_bind_t *m = (amqp_queue_bind_t *) decoded;
1522 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1523 0 ▶ if (UINT8_MAX < m->queue.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->queue.len 0 0 0
1524 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len) 0 0 0
1525 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->queue))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->queue)) 0 0 0
1526 0 return AMQP_STATUS_BAD_AMQP_DATA;
1527 0 ▶ if (UINT8_MAX < m->exchange.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->exchange.len 0 0 0
1528 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len) 0 0 0
1529 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->exchange))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->exchange)) 0 0 0
1530 0 return AMQP_STATUS_BAD_AMQP_DATA;
1531 0 ▶ if (UINT8_MAX < m->routing_key.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->routing_key.len 0 0 0
1532 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len) 0 0 0
1533 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->routing_key))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->routing_key)) 0 0 0
1534 0 return AMQP_STATUS_BAD_AMQP_DATA;
1535 0 bit_buffer = 0;
1536 0 ▶ if (m->nowait) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 0); 0 0 0
1537 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1538 {
1539 0 int res = amqp_encode_table(encoded, &(m->arguments), &offset);
1540 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1541 }
1542 0 return (int)offset;
1543 }
1544 0 case AMQP_QUEUE_BIND_OK_METHOD: {
1545 0 return (int)offset;
1546 }
1547 0 case AMQP_QUEUE_PURGE_METHOD: {
1548 0 amqp_queue_purge_t *m = (amqp_queue_purge_t *) decoded;
1549 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1550 0 ▶ if (UINT8_MAX < m->queue.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->queue.len 0 0 0
1551 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len) 0 0 0
1552 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->queue))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->queue)) 0 0 0
1553 0 return AMQP_STATUS_BAD_AMQP_DATA;
1554 0 bit_buffer = 0;
1555 0 ▶ if (m->nowait) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 0); 0 0 0
1556 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1557 0 return (int)offset;
1558 }
1559 0 case AMQP_QUEUE_PURGE_OK_METHOD: {
1560 0 amqp_queue_purge_ok_t *m = (amqp_queue_purge_ok_t *) decoded;
1561 0 ▶ if (!amqp_encode_32(encoded, &offset, m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_32(encoded, &offset, m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1562 0 return (int)offset;
1563 }
1564 0 case AMQP_QUEUE_DELETE_METHOD: {
1565 0 amqp_queue_delete_t *m = (amqp_queue_delete_t *) decoded;
1566 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1567 0 ▶ if (UINT8_MAX < m->queue.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->queue.len 0 0 0
1568 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len) 0 0 0
1569 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->queue))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->queue)) 0 0 0
1570 0 return AMQP_STATUS_BAD_AMQP_DATA;
1571 0 bit_buffer = 0;
1572 0 ▶ if (m->if_unused) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->if_unused) bit_buffer |= (1 << 0); 0 0 0
1573 0 ▶ if (m->if_empty) bit_buffer |= (1 << 1);
Branch: 1 branch
BranchTrueFalseTotal
if (m->if_empty) bit_buffer |= (1 << 1); 0 0 0
1574 0 ▶ if (m->nowait) bit_buffer |= (1 << 2);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 2); 0 0 0
1575 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1576 0 return (int)offset;
1577 }
1578 0 case AMQP_QUEUE_DELETE_OK_METHOD: {
1579 0 amqp_queue_delete_ok_t *m = (amqp_queue_delete_ok_t *) decoded;
1580 0 ▶ if (!amqp_encode_32(encoded, &offset, m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_32(encoded, &offset, m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1581 0 return (int)offset;
1582 }
1583 0 case AMQP_QUEUE_UNBIND_METHOD: {
1584 0 amqp_queue_unbind_t *m = (amqp_queue_unbind_t *) decoded;
1585 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1586 0 ▶ if (UINT8_MAX < m->queue.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->queue.len 0 0 0
1587 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len) 0 0 0
1588 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->queue))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->queue)) 0 0 0
1589 0 return AMQP_STATUS_BAD_AMQP_DATA;
1590 0 ▶ if (UINT8_MAX < m->exchange.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->exchange.len 0 0 0
1591 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len) 0 0 0
1592 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->exchange))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->exchange)) 0 0 0
1593 0 return AMQP_STATUS_BAD_AMQP_DATA;
1594 0 ▶ if (UINT8_MAX < m->routing_key.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->routing_key.len 0 0 0
1595 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len) 0 0 0
1596 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->routing_key))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->routing_key)) 0 0 0
1597 0 return AMQP_STATUS_BAD_AMQP_DATA;
1598 {
1599 0 int res = amqp_encode_table(encoded, &(m->arguments), &offset);
1600 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1601 }
1602 0 return (int)offset;
1603 }
1604 0 case AMQP_QUEUE_UNBIND_OK_METHOD: {
1605 0 return (int)offset;
1606 }
1607 1 case AMQP_BASIC_QOS_METHOD: {
1608 1 amqp_basic_qos_t *m = (amqp_basic_qos_t *) decoded;
1609 1 ▶ if (!amqp_encode_32(encoded, &offset, m->prefetch_size)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_32(encoded, &offset, m->prefetch_size)) return AMQP_STATUS_BAD_AMQP_DATA; 0 1 1
1610 1 ▶ if (!amqp_encode_16(encoded, &offset, m->prefetch_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->prefetch_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 1 1
1611 1 bit_buffer = 0;
1612 1 ▶ if (m->global) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->global) bit_buffer |= (1 << 0); 0 1 1
1613 1 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 1 1
1614 1 return (int)offset;
1615 }
1616 0 case AMQP_BASIC_QOS_OK_METHOD: {
1617 0 return (int)offset;
1618 }
1619 0 case AMQP_BASIC_CONSUME_METHOD: {
1620 0 amqp_basic_consume_t *m = (amqp_basic_consume_t *) decoded;
1621 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1622 0 ▶ if (UINT8_MAX < m->queue.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->queue.len 0 0 0
1623 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len) 0 0 0
1624 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->queue))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->queue)) 0 0 0
1625 0 return AMQP_STATUS_BAD_AMQP_DATA;
1626 0 ▶ if (UINT8_MAX < m->consumer_tag.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->consumer_tag.len 0 0 0
1627 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len) 0 0 0
1628 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->consumer_tag))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->consumer_tag)) 0 0 0
1629 0 return AMQP_STATUS_BAD_AMQP_DATA;
1630 0 bit_buffer = 0;
1631 0 ▶ if (m->no_local) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->no_local) bit_buffer |= (1 << 0); 0 0 0
1632 0 ▶ if (m->no_ack) bit_buffer |= (1 << 1);
Branch: 1 branch
BranchTrueFalseTotal
if (m->no_ack) bit_buffer |= (1 << 1); 0 0 0
1633 0 ▶ if (m->exclusive) bit_buffer |= (1 << 2);
Branch: 1 branch
BranchTrueFalseTotal
if (m->exclusive) bit_buffer |= (1 << 2); 0 0 0
1634 0 ▶ if (m->nowait) bit_buffer |= (1 << 3);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 3); 0 0 0
1635 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1636 {
1637 0 int res = amqp_encode_table(encoded, &(m->arguments), &offset);
1638 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1639 }
1640 0 return (int)offset;
1641 }
1642 0 case AMQP_BASIC_CONSUME_OK_METHOD: {
1643 0 amqp_basic_consume_ok_t *m = (amqp_basic_consume_ok_t *) decoded;
1644 0 ▶ if (UINT8_MAX < m->consumer_tag.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->consumer_tag.len 0 0 0
1645 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len) 0 0 0
1646 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->consumer_tag))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->consumer_tag)) 0 0 0
1647 0 return AMQP_STATUS_BAD_AMQP_DATA;
1648 0 return (int)offset;
1649 }
1650 0 case AMQP_BASIC_CANCEL_METHOD: {
1651 0 amqp_basic_cancel_t *m = (amqp_basic_cancel_t *) decoded;
1652 0 ▶ if (UINT8_MAX < m->consumer_tag.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->consumer_tag.len 0 0 0
1653 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len) 0 0 0
1654 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->consumer_tag))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->consumer_tag)) 0 0 0
1655 0 return AMQP_STATUS_BAD_AMQP_DATA;
1656 0 bit_buffer = 0;
1657 0 ▶ if (m->nowait) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 0); 0 0 0
1658 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1659 0 return (int)offset;
1660 }
1661 0 case AMQP_BASIC_CANCEL_OK_METHOD: {
1662 0 amqp_basic_cancel_ok_t *m = (amqp_basic_cancel_ok_t *) decoded;
1663 0 ▶ if (UINT8_MAX < m->consumer_tag.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->consumer_tag.len 0 0 0
1664 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len) 0 0 0
1665 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->consumer_tag))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->consumer_tag)) 0 0 0
1666 0 return AMQP_STATUS_BAD_AMQP_DATA;
1667 0 return (int)offset;
1668 }
1669 0 case AMQP_BASIC_PUBLISH_METHOD: {
1670 0 amqp_basic_publish_t *m = (amqp_basic_publish_t *) decoded;
1671 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1672 0 ▶ if (UINT8_MAX < m->exchange.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->exchange.len 0 0 0
1673 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len) 0 0 0
1674 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->exchange))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->exchange)) 0 0 0
1675 0 return AMQP_STATUS_BAD_AMQP_DATA;
1676 0 ▶ if (UINT8_MAX < m->routing_key.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->routing_key.len 0 0 0
1677 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len) 0 0 0
1678 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->routing_key))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->routing_key)) 0 0 0
1679 0 return AMQP_STATUS_BAD_AMQP_DATA;
1680 0 bit_buffer = 0;
1681 0 ▶ if (m->mandatory) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->mandatory) bit_buffer |= (1 << 0); 0 0 0
1682 0 ▶ if (m->immediate) bit_buffer |= (1 << 1);
Branch: 1 branch
BranchTrueFalseTotal
if (m->immediate) bit_buffer |= (1 << 1); 0 0 0
1683 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1684 0 return (int)offset;
1685 }
1686 0 case AMQP_BASIC_RETURN_METHOD: {
1687 0 amqp_basic_return_t *m = (amqp_basic_return_t *) decoded;
1688 0 ▶ if (!amqp_encode_16(encoded, &offset, m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->reply_code)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1689 0 ▶ if (UINT8_MAX < m->reply_text.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->reply_text.len 0 0 0
1690 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->reply_text.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->reply_text.len) 0 0 0
1691 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->reply_text))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->reply_text)) 0 0 0
1692 0 return AMQP_STATUS_BAD_AMQP_DATA;
1693 0 ▶ if (UINT8_MAX < m->exchange.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->exchange.len 0 0 0
1694 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len) 0 0 0
1695 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->exchange))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->exchange)) 0 0 0
1696 0 return AMQP_STATUS_BAD_AMQP_DATA;
1697 0 ▶ if (UINT8_MAX < m->routing_key.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->routing_key.len 0 0 0
1698 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len) 0 0 0
1699 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->routing_key))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->routing_key)) 0 0 0
1700 0 return AMQP_STATUS_BAD_AMQP_DATA;
1701 0 return (int)offset;
1702 }
1703 0 case AMQP_BASIC_DELIVER_METHOD: {
1704 0 amqp_basic_deliver_t *m = (amqp_basic_deliver_t *) decoded;
1705 0 ▶ if (UINT8_MAX < m->consumer_tag.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->consumer_tag.len 0 0 0
1706 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->consumer_tag.len) 0 0 0
1707 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->consumer_tag))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->consumer_tag)) 0 0 0
1708 0 return AMQP_STATUS_BAD_AMQP_DATA;
1709 0 ▶ if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1710 0 bit_buffer = 0;
1711 0 ▶ if (m->redelivered) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->redelivered) bit_buffer |= (1 << 0); 0 0 0
1712 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1713 0 ▶ if (UINT8_MAX < m->exchange.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->exchange.len 0 0 0
1714 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len) 0 0 0
1715 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->exchange))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->exchange)) 0 0 0
1716 0 return AMQP_STATUS_BAD_AMQP_DATA;
1717 0 ▶ if (UINT8_MAX < m->routing_key.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->routing_key.len 0 0 0
1718 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len) 0 0 0
1719 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->routing_key))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->routing_key)) 0 0 0
1720 0 return AMQP_STATUS_BAD_AMQP_DATA;
1721 0 return (int)offset;
1722 }
1723 0 case AMQP_BASIC_GET_METHOD: {
1724 0 amqp_basic_get_t *m = (amqp_basic_get_t *) decoded;
1725 0 ▶ if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, m->ticket)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1726 0 ▶ if (UINT8_MAX < m->queue.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->queue.len 0 0 0
1727 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->queue.len) 0 0 0
1728 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->queue))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->queue)) 0 0 0
1729 0 return AMQP_STATUS_BAD_AMQP_DATA;
1730 0 bit_buffer = 0;
1731 0 ▶ if (m->no_ack) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->no_ack) bit_buffer |= (1 << 0); 0 0 0
1732 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1733 0 return (int)offset;
1734 }
1735 0 case AMQP_BASIC_GET_OK_METHOD: {
1736 0 amqp_basic_get_ok_t *m = (amqp_basic_get_ok_t *) decoded;
1737 0 ▶ if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1738 0 bit_buffer = 0;
1739 0 ▶ if (m->redelivered) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->redelivered) bit_buffer |= (1 << 0); 0 0 0
1740 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1741 0 ▶ if (UINT8_MAX < m->exchange.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->exchange.len 0 0 0
1742 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->exchange.len) 0 0 0
1743 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->exchange))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->exchange)) 0 0 0
1744 0 return AMQP_STATUS_BAD_AMQP_DATA;
1745 0 ▶ if (UINT8_MAX < m->routing_key.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->routing_key.len 0 0 0
1746 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->routing_key.len) 0 0 0
1747 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->routing_key))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->routing_key)) 0 0 0
1748 0 return AMQP_STATUS_BAD_AMQP_DATA;
1749 0 ▶ if (!amqp_encode_32(encoded, &offset, m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_32(encoded, &offset, m->message_count)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1750 0 return (int)offset;
1751 }
1752 0 case AMQP_BASIC_GET_EMPTY_METHOD: {
1753 0 amqp_basic_get_empty_t *m = (amqp_basic_get_empty_t *) decoded;
1754 0 ▶ if (UINT8_MAX < m->cluster_id.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < m->cluster_id.len 0 0 0
1755 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)m->cluster_id.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)m->cluster_id.len) 0 0 0
1756 0 ▶ || !amqp_encode_bytes(encoded, &offset, m->cluster_id))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, m->cluster_id)) 0 0 0
1757 0 return AMQP_STATUS_BAD_AMQP_DATA;
1758 0 return (int)offset;
1759 }
1760 0 case AMQP_BASIC_ACK_METHOD: {
1761 0 amqp_basic_ack_t *m = (amqp_basic_ack_t *) decoded;
1762 0 ▶ if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1763 0 bit_buffer = 0;
1764 0 ▶ if (m->multiple) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->multiple) bit_buffer |= (1 << 0); 0 0 0
1765 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1766 0 return (int)offset;
1767 }
1768 0 case AMQP_BASIC_REJECT_METHOD: {
1769 0 amqp_basic_reject_t *m = (amqp_basic_reject_t *) decoded;
1770 0 ▶ if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1771 0 bit_buffer = 0;
1772 0 ▶ if (m->requeue) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->requeue) bit_buffer |= (1 << 0); 0 0 0
1773 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1774 0 return (int)offset;
1775 }
1776 0 case AMQP_BASIC_RECOVER_ASYNC_METHOD: {
1777 0 amqp_basic_recover_async_t *m = (amqp_basic_recover_async_t *) decoded;
1778 0 bit_buffer = 0;
1779 0 ▶ if (m->requeue) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->requeue) bit_buffer |= (1 << 0); 0 0 0
1780 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1781 0 return (int)offset;
1782 }
1783 0 case AMQP_BASIC_RECOVER_METHOD: {
1784 0 amqp_basic_recover_t *m = (amqp_basic_recover_t *) decoded;
1785 0 bit_buffer = 0;
1786 0 ▶ if (m->requeue) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->requeue) bit_buffer |= (1 << 0); 0 0 0
1787 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1788 0 return (int)offset;
1789 }
1790 0 case AMQP_BASIC_RECOVER_OK_METHOD: {
1791 0 return (int)offset;
1792 }
1793 0 case AMQP_BASIC_NACK_METHOD: {
1794 0 amqp_basic_nack_t *m = (amqp_basic_nack_t *) decoded;
1795 0 ▶ if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_64(encoded, &offset, m->delivery_tag)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1796 0 bit_buffer = 0;
1797 0 ▶ if (m->multiple) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->multiple) bit_buffer |= (1 << 0); 0 0 0
1798 0 ▶ if (m->requeue) bit_buffer |= (1 << 1);
Branch: 1 branch
BranchTrueFalseTotal
if (m->requeue) bit_buffer |= (1 << 1); 0 0 0
1799 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1800 0 return (int)offset;
1801 }
1802 1 case AMQP_TX_SELECT_METHOD: {
1803 1 return (int)offset;
1804 }
1805 0 case AMQP_TX_SELECT_OK_METHOD: {
1806 0 return (int)offset;
1807 }
1808 1 case AMQP_TX_COMMIT_METHOD: {
1809 1 return (int)offset;
1810 }
1811 0 case AMQP_TX_COMMIT_OK_METHOD: {
1812 0 return (int)offset;
1813 }
1814 1 case AMQP_TX_ROLLBACK_METHOD: {
1815 1 return (int)offset;
1816 }
1817 0 case AMQP_TX_ROLLBACK_OK_METHOD: {
1818 0 return (int)offset;
1819 }
1820 0 case AMQP_CONFIRM_SELECT_METHOD: {
1821 0 amqp_confirm_select_t *m = (amqp_confirm_select_t *) decoded;
1822 0 bit_buffer = 0;
1823 0 ▶ if (m->nowait) bit_buffer |= (1 << 0);
Branch: 1 branch
BranchTrueFalseTotal
if (m->nowait) bit_buffer |= (1 << 0); 0 0 0
1824 0 ▶ if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, bit_buffer)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1825 0 return (int)offset;
1826 }
1827 0 case AMQP_CONFIRM_SELECT_OK_METHOD: {
1828 0 return (int)offset;
1829 }
1830 0 default: return AMQP_STATUS_UNKNOWN_METHOD;
1831 }
1832 }
1833  
1834 0 int amqp_encode_properties(uint16_t class_id,
1835 void *decoded,
1836 amqp_bytes_t encoded)
1837 {
1838 0 size_t offset = 0;
1839  
1840 /* Cheat, and get the flags out generically, relying on the
1841 similarity of structure between classes */
1842 0 amqp_flags_t flags = * (amqp_flags_t *) decoded; /* cheating! */
1843  
1844 {
1845 /* We take a copy of flags to avoid destroying it, as it is used
1846 in the autogenerated code below. */
1847 0 amqp_flags_t remaining_flags = flags;
1848 do {
1849 0 amqp_flags_t remainder = remaining_flags >> 16;
1850 0 uint16_t partial_flags = remaining_flags & 0xFFFE;
1851 0 ▶ if (remainder != 0) { partial_flags |= 1; }
Branch: 1 branch
BranchTrueFalseTotal
if (remainder != 0) { partial_flags |= 1; } 0 0 0
1852 0 ▶ if (!amqp_encode_16(encoded, &offset, partial_flags))
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_16(encoded, &offset, partial_flags)) 0 0 0
1853 0 return AMQP_STATUS_BAD_AMQP_DATA;
1854 0 remaining_flags = remainder;
1855 0 ▶ } while (remaining_flags != 0);
Branch: 1 branch
BranchTrueFalseTotal
} while (remaining_flags != 0); 0 0 0
1856 }
1857  
1858 0 switch (class_id) {
1859 0 case 10: {
1860 0 return (int)offset;
1861 }
1862 0 case 20: {
1863 0 return (int)offset;
1864 }
1865 0 case 30: {
1866 0 return (int)offset;
1867 }
1868 0 case 40: {
1869 0 return (int)offset;
1870 }
1871 0 case 50: {
1872 0 return (int)offset;
1873 }
1874 0 case 60: {
1875 0 amqp_basic_properties_t *p = (amqp_basic_properties_t *) decoded;
1876 0 ▶ if (flags & AMQP_BASIC_CONTENT_TYPE_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_CONTENT_TYPE_FLAG) { 0 0 0
1877 0 ▶ if (UINT8_MAX < p->content_type.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->content_type.len 0 0 0
1878 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->content_type.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->content_type.len) 0 0 0
1879 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->content_type))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->content_type)) 0 0 0
1880 0 return AMQP_STATUS_BAD_AMQP_DATA;
1881 }
1882 0 ▶ if (flags & AMQP_BASIC_CONTENT_ENCODING_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_CONTENT_ENCODING_FLAG) { 0 0 0
1883 0 ▶ if (UINT8_MAX < p->content_encoding.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->content_encoding.len 0 0 0
1884 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->content_encoding.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->content_encoding.len) 0 0 0
1885 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->content_encoding))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->content_encoding)) 0 0 0
1886 0 return AMQP_STATUS_BAD_AMQP_DATA;
1887 }
1888 0 ▶ if (flags & AMQP_BASIC_HEADERS_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_HEADERS_FLAG) { 0 0 0
1889 {
1890 0 int res = amqp_encode_table(encoded, &(p->headers), &offset);
1891 0 ▶ if (res < 0) return res;
Branch: 1 branch
BranchTrueFalseTotal
if (res < 0) return res; 0 0 0
1892 }
1893 }
1894 0 ▶ if (flags & AMQP_BASIC_DELIVERY_MODE_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_DELIVERY_MODE_FLAG) { 0 0 0
1895 0 ▶ if (!amqp_encode_8(encoded, &offset, p->delivery_mode)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, p->delivery_mode)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1896 }
1897 0 ▶ if (flags & AMQP_BASIC_PRIORITY_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_PRIORITY_FLAG) { 0 0 0
1898 0 ▶ if (!amqp_encode_8(encoded, &offset, p->priority)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_8(encoded, &offset, p->priority)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1899 }
1900 0 ▶ if (flags & AMQP_BASIC_CORRELATION_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_CORRELATION_ID_FLAG) { 0 0 0
1901 0 ▶ if (UINT8_MAX < p->correlation_id.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->correlation_id.len 0 0 0
1902 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->correlation_id.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->correlation_id.len) 0 0 0
1903 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->correlation_id))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->correlation_id)) 0 0 0
1904 0 return AMQP_STATUS_BAD_AMQP_DATA;
1905 }
1906 0 ▶ if (flags & AMQP_BASIC_REPLY_TO_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_REPLY_TO_FLAG) { 0 0 0
1907 0 ▶ if (UINT8_MAX < p->reply_to.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->reply_to.len 0 0 0
1908 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->reply_to.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->reply_to.len) 0 0 0
1909 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->reply_to))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->reply_to)) 0 0 0
1910 0 return AMQP_STATUS_BAD_AMQP_DATA;
1911 }
1912 0 ▶ if (flags & AMQP_BASIC_EXPIRATION_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_EXPIRATION_FLAG) { 0 0 0
1913 0 ▶ if (UINT8_MAX < p->expiration.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->expiration.len 0 0 0
1914 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->expiration.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->expiration.len) 0 0 0
1915 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->expiration))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->expiration)) 0 0 0
1916 0 return AMQP_STATUS_BAD_AMQP_DATA;
1917 }
1918 0 ▶ if (flags & AMQP_BASIC_MESSAGE_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_MESSAGE_ID_FLAG) { 0 0 0
1919 0 ▶ if (UINT8_MAX < p->message_id.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->message_id.len 0 0 0
1920 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->message_id.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->message_id.len) 0 0 0
1921 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->message_id))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->message_id)) 0 0 0
1922 0 return AMQP_STATUS_BAD_AMQP_DATA;
1923 }
1924 0 ▶ if (flags & AMQP_BASIC_TIMESTAMP_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_TIMESTAMP_FLAG) { 0 0 0
1925 0 ▶ if (!amqp_encode_64(encoded, &offset, p->timestamp)) return AMQP_STATUS_BAD_AMQP_DATA;
Branch: 1 branch
BranchTrueFalseTotal
if (!amqp_encode_64(encoded, &offset, p->timestamp)) return AMQP_STATUS_BAD_AMQP_DATA; 0 0 0
1926 }
1927 0 ▶ if (flags & AMQP_BASIC_TYPE_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_TYPE_FLAG) { 0 0 0
1928 0 ▶ if (UINT8_MAX < p->type.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->type.len 0 0 0
1929 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->type.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->type.len) 0 0 0
1930 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->type))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->type)) 0 0 0
1931 0 return AMQP_STATUS_BAD_AMQP_DATA;
1932 }
1933 0 ▶ if (flags & AMQP_BASIC_USER_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_USER_ID_FLAG) { 0 0 0
1934 0 ▶ if (UINT8_MAX < p->user_id.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->user_id.len 0 0 0
1935 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->user_id.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->user_id.len) 0 0 0
1936 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->user_id))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->user_id)) 0 0 0
1937 0 return AMQP_STATUS_BAD_AMQP_DATA;
1938 }
1939 0 ▶ if (flags & AMQP_BASIC_APP_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_APP_ID_FLAG) { 0 0 0
1940 0 ▶ if (UINT8_MAX < p->app_id.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->app_id.len 0 0 0
1941 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->app_id.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->app_id.len) 0 0 0
1942 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->app_id))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->app_id)) 0 0 0
1943 0 return AMQP_STATUS_BAD_AMQP_DATA;
1944 }
1945 0 ▶ if (flags & AMQP_BASIC_CLUSTER_ID_FLAG) {
Branch: 1 branch
BranchTrueFalseTotal
if (flags & AMQP_BASIC_CLUSTER_ID_FLAG) { 0 0 0
1946 0 ▶ if (UINT8_MAX < p->cluster_id.len
Branch: 1 branch
BranchTrueFalseTotal
if (UINT8_MAX < p->cluster_id.len 0 0 0
1947 0 ▶ || !amqp_encode_8(encoded, &offset, (uint8_t)p->cluster_id.len)
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_8(encoded, &offset, (uint8_t)p->cluster_id.len) 0 0 0
1948 0 ▶ || !amqp_encode_bytes(encoded, &offset, p->cluster_id))
Branch: 1 branch
BranchTrueFalseTotal
|| !amqp_encode_bytes(encoded, &offset, p->cluster_id)) 0 0 0
1949 0 return AMQP_STATUS_BAD_AMQP_DATA;
1950 }
1951 0 return (int)offset;
1952 }
1953 0 case 90: {
1954 0 return (int)offset;
1955 }
1956 0 case 85: {
1957 0 return (int)offset;
1958 }
1959 0 default: return AMQP_STATUS_UNKNOWN_CLASS;
1960 }
1961 }
1962  
1963 /**
1964 * amqp_channel_open
1965 *
1966 * @param [in] state connection state
1967 * @param [in] channel the channel to do the RPC on
1968 * @returns amqp_channel_open_ok_t
1969 */
1970 AMQP_PUBLIC_FUNCTION
1971 amqp_channel_open_ok_t *
1972 0 AMQP_CALL amqp_channel_open(amqp_connection_state_t state, amqp_channel_t channel)
1973 {
1974 amqp_channel_open_t req;
1975 0 req.out_of_band = amqp_empty_bytes;
1976  
1977 0 return amqp_simple_rpc_decoded(state, channel, AMQP_CHANNEL_OPEN_METHOD, AMQP_CHANNEL_OPEN_OK_METHOD, &req);
1978 }
1979  
1980  
1981 /**
1982 * amqp_channel_flow
1983 *
1984 * @param [in] state connection state
1985 * @param [in] channel the channel to do the RPC on
1986 * @param [in] active active
1987 * @returns amqp_channel_flow_ok_t
1988 */
1989 AMQP_PUBLIC_FUNCTION
1990 amqp_channel_flow_ok_t *
1991 0 AMQP_CALL amqp_channel_flow(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t active)
1992 {
1993 amqp_channel_flow_t req;
1994 0 req.active = active;
1995  
1996 0 return amqp_simple_rpc_decoded(state, channel, AMQP_CHANNEL_FLOW_METHOD, AMQP_CHANNEL_FLOW_OK_METHOD, &req);
1997 }
1998  
1999  
2000 /**
2001 * amqp_exchange_declare
2002 *
2003 * @param [in] state connection state
2004 * @param [in] channel the channel to do the RPC on
2005 * @param [in] exchange exchange
2006 * @param [in] type type
2007 * @param [in] passive passive
2008 * @param [in] durable durable
2009 * @param [in] auto_delete auto_delete
2010 * @param [in] internal internal
2011 * @param [in] arguments arguments
2012 * @returns amqp_exchange_declare_ok_t
2013 */
2014 AMQP_PUBLIC_FUNCTION
2015 amqp_exchange_declare_ok_t *
2016 0 AMQP_CALL amqp_exchange_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t type, amqp_boolean_t passive, amqp_boolean_t durable, amqp_boolean_t auto_delete, amqp_boolean_t internal, amqp_table_t arguments)
2017 {
2018 amqp_exchange_declare_t req;
2019 0 req.ticket = 0;
2020 0 req.exchange = exchange;
2021 0 req.type = type;
2022 0 req.passive = passive;
2023 0 req.durable = durable;
2024 0 req.auto_delete = auto_delete;
2025 0 req.internal = internal;
2026 0 req.nowait = 0;
2027 0 req.arguments = arguments;
2028  
2029 0 return amqp_simple_rpc_decoded(state, channel, AMQP_EXCHANGE_DECLARE_METHOD, AMQP_EXCHANGE_DECLARE_OK_METHOD, &req);
2030 }
2031  
2032  
2033 /**
2034 * amqp_exchange_delete
2035 *
2036 * @param [in] state connection state
2037 * @param [in] channel the channel to do the RPC on
2038 * @param [in] exchange exchange
2039 * @param [in] if_unused if_unused
2040 * @returns amqp_exchange_delete_ok_t
2041 */
2042 AMQP_PUBLIC_FUNCTION
2043 amqp_exchange_delete_ok_t *
2044 0 AMQP_CALL amqp_exchange_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_boolean_t if_unused)
2045 {
2046 amqp_exchange_delete_t req;
2047 0 req.ticket = 0;
2048 0 req.exchange = exchange;
2049 0 req.if_unused = if_unused;
2050 0 req.nowait = 0;
2051  
2052 0 return amqp_simple_rpc_decoded(state, channel, AMQP_EXCHANGE_DELETE_METHOD, AMQP_EXCHANGE_DELETE_OK_METHOD, &req);
2053 }
2054  
2055  
2056 /**
2057 * amqp_exchange_bind
2058 *
2059 * @param [in] state connection state
2060 * @param [in] channel the channel to do the RPC on
2061 * @param [in] destination destination
2062 * @param [in] source source
2063 * @param [in] routing_key routing_key
2064 * @param [in] arguments arguments
2065 * @returns amqp_exchange_bind_ok_t
2066 */
2067 AMQP_PUBLIC_FUNCTION
2068 amqp_exchange_bind_ok_t *
2069 0 AMQP_CALL amqp_exchange_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments)
2070 {
2071 amqp_exchange_bind_t req;
2072 0 req.ticket = 0;
2073 0 req.destination = destination;
2074 0 req.source = source;
2075 0 req.routing_key = routing_key;
2076 0 req.nowait = 0;
2077 0 req.arguments = arguments;
2078  
2079 0 return amqp_simple_rpc_decoded(state, channel, AMQP_EXCHANGE_BIND_METHOD, AMQP_EXCHANGE_BIND_OK_METHOD, &req);
2080 }
2081  
2082  
2083 /**
2084 * amqp_exchange_unbind
2085 *
2086 * @param [in] state connection state
2087 * @param [in] channel the channel to do the RPC on
2088 * @param [in] destination destination
2089 * @param [in] source source
2090 * @param [in] routing_key routing_key
2091 * @param [in] arguments arguments
2092 * @returns amqp_exchange_unbind_ok_t
2093 */
2094 AMQP_PUBLIC_FUNCTION
2095 amqp_exchange_unbind_ok_t *
2096 0 AMQP_CALL amqp_exchange_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t destination, amqp_bytes_t source, amqp_bytes_t routing_key, amqp_table_t arguments)
2097 {
2098 amqp_exchange_unbind_t req;
2099 0 req.ticket = 0;
2100 0 req.destination = destination;
2101 0 req.source = source;
2102 0 req.routing_key = routing_key;
2103 0 req.nowait = 0;
2104 0 req.arguments = arguments;
2105  
2106 0 return amqp_simple_rpc_decoded(state, channel, AMQP_EXCHANGE_UNBIND_METHOD, AMQP_EXCHANGE_UNBIND_OK_METHOD, &req);
2107 }
2108  
2109  
2110 /**
2111 * amqp_queue_declare
2112 *
2113 * @param [in] state connection state
2114 * @param [in] channel the channel to do the RPC on
2115 * @param [in] queue queue
2116 * @param [in] passive passive
2117 * @param [in] durable durable
2118 * @param [in] exclusive exclusive
2119 * @param [in] auto_delete auto_delete
2120 * @param [in] arguments arguments
2121 * @returns amqp_queue_declare_ok_t
2122 */
2123 AMQP_PUBLIC_FUNCTION
2124 amqp_queue_declare_ok_t *
2125 0 AMQP_CALL amqp_queue_declare(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t passive, amqp_boolean_t durable, amqp_boolean_t exclusive, amqp_boolean_t auto_delete, amqp_table_t arguments)
2126 {
2127 amqp_queue_declare_t req;
2128 0 req.ticket = 0;
2129 0 req.queue = queue;
2130 0 req.passive = passive;
2131 0 req.durable = durable;
2132 0 req.exclusive = exclusive;
2133 0 req.auto_delete = auto_delete;
2134 0 req.nowait = 0;
2135 0 req.arguments = arguments;
2136  
2137 0 return amqp_simple_rpc_decoded(state, channel, AMQP_QUEUE_DECLARE_METHOD, AMQP_QUEUE_DECLARE_OK_METHOD, &req);
2138 }
2139  
2140  
2141 /**
2142 * amqp_queue_bind
2143 *
2144 * @param [in] state connection state
2145 * @param [in] channel the channel to do the RPC on
2146 * @param [in] queue queue
2147 * @param [in] exchange exchange
2148 * @param [in] routing_key routing_key
2149 * @param [in] arguments arguments
2150 * @returns amqp_queue_bind_ok_t
2151 */
2152 AMQP_PUBLIC_FUNCTION
2153 amqp_queue_bind_ok_t *
2154 0 AMQP_CALL amqp_queue_bind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments)
2155 {
2156 amqp_queue_bind_t req;
2157 0 req.ticket = 0;
2158 0 req.queue = queue;
2159 0 req.exchange = exchange;
2160 0 req.routing_key = routing_key;
2161 0 req.nowait = 0;
2162 0 req.arguments = arguments;
2163  
2164 0 return amqp_simple_rpc_decoded(state, channel, AMQP_QUEUE_BIND_METHOD, AMQP_QUEUE_BIND_OK_METHOD, &req);
2165 }
2166  
2167  
2168 /**
2169 * amqp_queue_purge
2170 *
2171 * @param [in] state connection state
2172 * @param [in] channel the channel to do the RPC on
2173 * @param [in] queue queue
2174 * @returns amqp_queue_purge_ok_t
2175 */
2176 AMQP_PUBLIC_FUNCTION
2177 amqp_queue_purge_ok_t *
2178 0 AMQP_CALL amqp_queue_purge(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue)
2179 {
2180 amqp_queue_purge_t req;
2181 0 req.ticket = 0;
2182 0 req.queue = queue;
2183 0 req.nowait = 0;
2184  
2185 0 return amqp_simple_rpc_decoded(state, channel, AMQP_QUEUE_PURGE_METHOD, AMQP_QUEUE_PURGE_OK_METHOD, &req);
2186 }
2187  
2188  
2189 /**
2190 * amqp_queue_delete
2191 *
2192 * @param [in] state connection state
2193 * @param [in] channel the channel to do the RPC on
2194 * @param [in] queue queue
2195 * @param [in] if_unused if_unused
2196 * @param [in] if_empty if_empty
2197 * @returns amqp_queue_delete_ok_t
2198 */
2199 AMQP_PUBLIC_FUNCTION
2200 amqp_queue_delete_ok_t *
2201 0 AMQP_CALL amqp_queue_delete(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t if_unused, amqp_boolean_t if_empty)
2202 {
2203 amqp_queue_delete_t req;
2204 0 req.ticket = 0;
2205 0 req.queue = queue;
2206 0 req.if_unused = if_unused;
2207 0 req.if_empty = if_empty;
2208 0 req.nowait = 0;
2209  
2210 0 return amqp_simple_rpc_decoded(state, channel, AMQP_QUEUE_DELETE_METHOD, AMQP_QUEUE_DELETE_OK_METHOD, &req);
2211 }
2212  
2213  
2214 /**
2215 * amqp_queue_unbind
2216 *
2217 * @param [in] state connection state
2218 * @param [in] channel the channel to do the RPC on
2219 * @param [in] queue queue
2220 * @param [in] exchange exchange
2221 * @param [in] routing_key routing_key
2222 * @param [in] arguments arguments
2223 * @returns amqp_queue_unbind_ok_t
2224 */
2225 AMQP_PUBLIC_FUNCTION
2226 amqp_queue_unbind_ok_t *
2227 0 AMQP_CALL amqp_queue_unbind(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_table_t arguments)
2228 {
2229 amqp_queue_unbind_t req;
2230 0 req.ticket = 0;
2231 0 req.queue = queue;
2232 0 req.exchange = exchange;
2233 0 req.routing_key = routing_key;
2234 0 req.arguments = arguments;
2235  
2236 0 return amqp_simple_rpc_decoded(state, channel, AMQP_QUEUE_UNBIND_METHOD, AMQP_QUEUE_UNBIND_OK_METHOD, &req);
2237 }
2238  
2239  
2240 /**
2241 * amqp_basic_qos
2242 *
2243 * @param [in] state connection state
2244 * @param [in] channel the channel to do the RPC on
2245 * @param [in] prefetch_size prefetch_size
2246 * @param [in] prefetch_count prefetch_count
2247 * @param [in] global global
2248 * @returns amqp_basic_qos_ok_t
2249 */
2250 AMQP_PUBLIC_FUNCTION
2251 amqp_basic_qos_ok_t *
2252 1 AMQP_CALL amqp_basic_qos(amqp_connection_state_t state, amqp_channel_t channel, uint32_t prefetch_size, uint16_t prefetch_count, amqp_boolean_t global)
2253 {
2254 amqp_basic_qos_t req;
2255 1 req.prefetch_size = prefetch_size;
2256 1 req.prefetch_count = prefetch_count;
2257 1 req.global = global;
2258  
2259 1 return amqp_simple_rpc_decoded(state, channel, AMQP_BASIC_QOS_METHOD, AMQP_BASIC_QOS_OK_METHOD, &req);
2260 }
2261  
2262  
2263 /**
2264 * amqp_basic_consume
2265 *
2266 * @param [in] state connection state
2267 * @param [in] channel the channel to do the RPC on
2268 * @param [in] queue queue
2269 * @param [in] consumer_tag consumer_tag
2270 * @param [in] no_local no_local
2271 * @param [in] no_ack no_ack
2272 * @param [in] exclusive exclusive
2273 * @param [in] arguments arguments
2274 * @returns amqp_basic_consume_ok_t
2275 */
2276 AMQP_PUBLIC_FUNCTION
2277 amqp_basic_consume_ok_t *
2278 0 AMQP_CALL amqp_basic_consume(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_bytes_t consumer_tag, amqp_boolean_t no_local, amqp_boolean_t no_ack, amqp_boolean_t exclusive, amqp_table_t arguments)
2279 {
2280 amqp_basic_consume_t req;
2281 0 req.ticket = 0;
2282 0 req.queue = queue;
2283 0 req.consumer_tag = consumer_tag;
2284 0 req.no_local = no_local;
2285 0 req.no_ack = no_ack;
2286 0 req.exclusive = exclusive;
2287 0 req.nowait = 0;
2288 0 req.arguments = arguments;
2289  
2290 0 return amqp_simple_rpc_decoded(state, channel, AMQP_BASIC_CONSUME_METHOD, AMQP_BASIC_CONSUME_OK_METHOD, &req);
2291 }
2292  
2293  
2294 /**
2295 * amqp_basic_cancel
2296 *
2297 * @param [in] state connection state
2298 * @param [in] channel the channel to do the RPC on
2299 * @param [in] consumer_tag consumer_tag
2300 * @returns amqp_basic_cancel_ok_t
2301 */
2302 AMQP_PUBLIC_FUNCTION
2303 amqp_basic_cancel_ok_t *
2304 0 AMQP_CALL amqp_basic_cancel(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t consumer_tag)
2305 {
2306 amqp_basic_cancel_t req;
2307 0 req.consumer_tag = consumer_tag;
2308 0 req.nowait = 0;
2309  
2310 0 return amqp_simple_rpc_decoded(state, channel, AMQP_BASIC_CANCEL_METHOD, AMQP_BASIC_CANCEL_OK_METHOD, &req);
2311 }
2312  
2313  
2314 /**
2315 * amqp_basic_recover
2316 *
2317 * @param [in] state connection state
2318 * @param [in] channel the channel to do the RPC on
2319 * @param [in] requeue requeue
2320 * @returns amqp_basic_recover_ok_t
2321 */
2322 AMQP_PUBLIC_FUNCTION
2323 amqp_basic_recover_ok_t *
2324 0 AMQP_CALL amqp_basic_recover(amqp_connection_state_t state, amqp_channel_t channel, amqp_boolean_t requeue)
2325 {
2326 amqp_basic_recover_t req;
2327 0 req.requeue = requeue;
2328  
2329 0 return amqp_simple_rpc_decoded(state, channel, AMQP_BASIC_RECOVER_METHOD, AMQP_BASIC_RECOVER_OK_METHOD, &req);
2330 }
2331  
2332  
2333 /**
2334 * amqp_tx_select
2335 *
2336 * @param [in] state connection state
2337 * @param [in] channel the channel to do the RPC on
2338 * @returns amqp_tx_select_ok_t
2339 */
2340 AMQP_PUBLIC_FUNCTION
2341 amqp_tx_select_ok_t *
2342 1 AMQP_CALL amqp_tx_select(amqp_connection_state_t state, amqp_channel_t channel)
2343 {
2344 amqp_tx_select_t req;
2345  
2346 1 return amqp_simple_rpc_decoded(state, channel, AMQP_TX_SELECT_METHOD, AMQP_TX_SELECT_OK_METHOD, &req);
2347 }
2348  
2349  
2350 /**
2351 * amqp_tx_commit
2352 *
2353 * @param [in] state connection state
2354 * @param [in] channel the channel to do the RPC on
2355 * @returns amqp_tx_commit_ok_t
2356 */
2357 AMQP_PUBLIC_FUNCTION
2358 amqp_tx_commit_ok_t *
2359 1 AMQP_CALL amqp_tx_commit(amqp_connection_state_t state, amqp_channel_t channel)
2360 {
2361 amqp_tx_commit_t req;
2362  
2363 1 return amqp_simple_rpc_decoded(state, channel, AMQP_TX_COMMIT_METHOD, AMQP_TX_COMMIT_OK_METHOD, &req);
2364 }
2365  
2366  
2367 /**
2368 * amqp_tx_rollback
2369 *
2370 * @param [in] state connection state
2371 * @param [in] channel the channel to do the RPC on
2372 * @returns amqp_tx_rollback_ok_t
2373 */
2374 AMQP_PUBLIC_FUNCTION
2375 amqp_tx_rollback_ok_t *
2376 1 AMQP_CALL amqp_tx_rollback(amqp_connection_state_t state, amqp_channel_t channel)
2377 {
2378 amqp_tx_rollback_t req;
2379  
2380 1 return amqp_simple_rpc_decoded(state, channel, AMQP_TX_ROLLBACK_METHOD, AMQP_TX_ROLLBACK_OK_METHOD, &req);
2381 }
2382  
2383  
2384 /**
2385 * amqp_confirm_select
2386 *
2387 * @param [in] state connection state
2388 * @param [in] channel the channel to do the RPC on
2389 * @returns amqp_confirm_select_ok_t
2390 */
2391 AMQP_PUBLIC_FUNCTION
2392 amqp_confirm_select_ok_t *
2393 0 AMQP_CALL amqp_confirm_select(amqp_connection_state_t state, amqp_channel_t channel)
2394 {
2395 amqp_confirm_select_t req;
2396 0 req.nowait = 0;
2397  
2398 0 return amqp_simple_rpc_decoded(state, channel, AMQP_CONFIRM_SELECT_METHOD, AMQP_CONFIRM_SELECT_OK_METHOD, &req);
2399 }
2400  
« rabbitmq-include/amqp_private.h ↑ Summary amqp_api.c »