A small memory footprint AMQP implimentation
Dependents: iothub_client_sample_amqp remote_monitoring simplesample_amqp
amqp_definitions.c@17:923575db8b2d, 2017-01-24 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Tue Jan 24 15:23:52 2017 -0800
- Revision:
- 17:923575db8b2d
- Parent:
- 16:22a72cf8e416
- Child:
- 19:000ab4e6a2c1
1.1.5
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Azure.IoT Build | 0:6ae2f7bca550 | 1 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3 | // Copyright (c) Microsoft. All rights reserved. |
Azure.IoT Build | 0:6ae2f7bca550 | 4 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
Azure.IoT Build | 0:6ae2f7bca550 | 5 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6 | #include <stdlib.h> |
Azure.IoT Build | 0:6ae2f7bca550 | 7 | #include "azure_uamqp_c/amqpvalue.h" |
Azure.IoT Build | 0:6ae2f7bca550 | 8 | #include "azure_uamqp_c/amqp_definitions.h" |
Azure.IoT Build | 0:6ae2f7bca550 | 9 | #include "azure_uamqp_c/amqpalloc.h" |
Azure.IoT Build | 0:6ae2f7bca550 | 10 | #include <stdlib.h> |
Azure.IoT Build | 0:6ae2f7bca550 | 11 | #include <stdbool.h> |
Azure.IoT Build | 0:6ae2f7bca550 | 12 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13 | /* role */ |
Azure.IoT Build | 0:6ae2f7bca550 | 14 | |
Azure.IoT Build | 0:6ae2f7bca550 | 15 | AMQP_VALUE amqpvalue_create_role(role value) |
Azure.IoT Build | 0:6ae2f7bca550 | 16 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 17 | return amqpvalue_create_boolean(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 18 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 19 | |
Azure.IoT Build | 0:6ae2f7bca550 | 20 | /* sender-settle-mode */ |
Azure.IoT Build | 0:6ae2f7bca550 | 21 | |
Azure.IoT Build | 0:6ae2f7bca550 | 22 | AMQP_VALUE amqpvalue_create_sender_settle_mode(sender_settle_mode value) |
Azure.IoT Build | 0:6ae2f7bca550 | 23 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 24 | return amqpvalue_create_ubyte(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 25 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 26 | |
Azure.IoT Build | 0:6ae2f7bca550 | 27 | /* receiver-settle-mode */ |
Azure.IoT Build | 0:6ae2f7bca550 | 28 | |
Azure.IoT Build | 0:6ae2f7bca550 | 29 | AMQP_VALUE amqpvalue_create_receiver_settle_mode(receiver_settle_mode value) |
Azure.IoT Build | 0:6ae2f7bca550 | 30 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 31 | return amqpvalue_create_ubyte(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 32 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 33 | |
Azure.IoT Build | 0:6ae2f7bca550 | 34 | /* handle */ |
Azure.IoT Build | 0:6ae2f7bca550 | 35 | |
Azure.IoT Build | 0:6ae2f7bca550 | 36 | AMQP_VALUE amqpvalue_create_handle(handle value) |
Azure.IoT Build | 0:6ae2f7bca550 | 37 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 38 | return amqpvalue_create_uint(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 39 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 40 | |
Azure.IoT Build | 0:6ae2f7bca550 | 41 | /* seconds */ |
Azure.IoT Build | 0:6ae2f7bca550 | 42 | |
Azure.IoT Build | 0:6ae2f7bca550 | 43 | AMQP_VALUE amqpvalue_create_seconds(seconds value) |
Azure.IoT Build | 0:6ae2f7bca550 | 44 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 45 | return amqpvalue_create_uint(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 46 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 47 | |
Azure.IoT Build | 0:6ae2f7bca550 | 48 | /* milliseconds */ |
Azure.IoT Build | 0:6ae2f7bca550 | 49 | |
Azure.IoT Build | 0:6ae2f7bca550 | 50 | AMQP_VALUE amqpvalue_create_milliseconds(milliseconds value) |
Azure.IoT Build | 0:6ae2f7bca550 | 51 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 52 | return amqpvalue_create_uint(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 53 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 54 | |
Azure.IoT Build | 0:6ae2f7bca550 | 55 | /* delivery-tag */ |
Azure.IoT Build | 0:6ae2f7bca550 | 56 | |
Azure.IoT Build | 0:6ae2f7bca550 | 57 | AMQP_VALUE amqpvalue_create_delivery_tag(delivery_tag value) |
Azure.IoT Build | 0:6ae2f7bca550 | 58 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 59 | return amqpvalue_create_binary(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 60 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 61 | |
Azure.IoT Build | 0:6ae2f7bca550 | 62 | /* sequence-no */ |
Azure.IoT Build | 0:6ae2f7bca550 | 63 | |
Azure.IoT Build | 0:6ae2f7bca550 | 64 | AMQP_VALUE amqpvalue_create_sequence_no(sequence_no value) |
Azure.IoT Build | 0:6ae2f7bca550 | 65 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 66 | return amqpvalue_create_uint(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 67 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 68 | |
Azure.IoT Build | 0:6ae2f7bca550 | 69 | /* delivery-number */ |
Azure.IoT Build | 0:6ae2f7bca550 | 70 | |
Azure.IoT Build | 0:6ae2f7bca550 | 71 | AMQP_VALUE amqpvalue_create_delivery_number(delivery_number value) |
Azure.IoT Build | 0:6ae2f7bca550 | 72 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 73 | return amqpvalue_create_sequence_no(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 74 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 75 | |
Azure.IoT Build | 0:6ae2f7bca550 | 76 | /* transfer-number */ |
Azure.IoT Build | 0:6ae2f7bca550 | 77 | |
Azure.IoT Build | 0:6ae2f7bca550 | 78 | AMQP_VALUE amqpvalue_create_transfer_number(transfer_number value) |
Azure.IoT Build | 0:6ae2f7bca550 | 79 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 80 | return amqpvalue_create_sequence_no(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 81 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 82 | |
Azure.IoT Build | 0:6ae2f7bca550 | 83 | /* message-format */ |
Azure.IoT Build | 0:6ae2f7bca550 | 84 | |
Azure.IoT Build | 0:6ae2f7bca550 | 85 | AMQP_VALUE amqpvalue_create_message_format(message_format value) |
Azure.IoT Build | 0:6ae2f7bca550 | 86 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 87 | return amqpvalue_create_uint(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 88 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 89 | |
Azure.IoT Build | 0:6ae2f7bca550 | 90 | /* ietf-language-tag */ |
Azure.IoT Build | 0:6ae2f7bca550 | 91 | |
Azure.IoT Build | 0:6ae2f7bca550 | 92 | AMQP_VALUE amqpvalue_create_ietf_language_tag(ietf_language_tag value) |
Azure.IoT Build | 0:6ae2f7bca550 | 93 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 94 | return amqpvalue_create_symbol(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 95 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 96 | |
Azure.IoT Build | 0:6ae2f7bca550 | 97 | /* fields */ |
Azure.IoT Build | 0:6ae2f7bca550 | 98 | |
Azure.IoT Build | 0:6ae2f7bca550 | 99 | AMQP_VALUE amqpvalue_create_fields(AMQP_VALUE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 100 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 101 | return amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 102 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 103 | |
Azure.IoT Build | 0:6ae2f7bca550 | 104 | /* error */ |
Azure.IoT Build | 0:6ae2f7bca550 | 105 | |
Azure.IoT Build | 0:6ae2f7bca550 | 106 | typedef struct ERROR_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 107 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 108 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 109 | } ERROR_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 110 | |
Azure.IoT Build | 0:6ae2f7bca550 | 111 | static ERROR_HANDLE error_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 112 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 113 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)amqpalloc_malloc(sizeof(ERROR_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 114 | if (error_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 115 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 116 | error_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 117 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 118 | |
Azure.IoT Build | 0:6ae2f7bca550 | 119 | return error_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 120 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 121 | |
Azure.IoT Build | 0:6ae2f7bca550 | 122 | ERROR_HANDLE error_create(const char* condition_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 123 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 124 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)amqpalloc_malloc(sizeof(ERROR_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 125 | if (error_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 126 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 127 | error_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(29); |
Azure.IoT Build | 0:6ae2f7bca550 | 128 | if (error_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 129 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 130 | amqpalloc_free(error_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 131 | error_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 132 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 133 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 134 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 135 | AMQP_VALUE condition_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 136 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 137 | |
Azure.IoT Build | 0:6ae2f7bca550 | 138 | condition_amqp_value = amqpvalue_create_symbol(condition_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 139 | if ((result == 0) && (amqpvalue_set_composite_item(error_instance->composite_value, 0, condition_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 140 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 141 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 142 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 143 | |
Azure.IoT Build | 0:6ae2f7bca550 | 144 | amqpvalue_destroy(condition_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 145 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 146 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 147 | |
Azure.IoT Build | 0:6ae2f7bca550 | 148 | return error_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 149 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 150 | |
Azure.IoT Build | 0:6ae2f7bca550 | 151 | ERROR_HANDLE error_clone(ERROR_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 152 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 153 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)amqpalloc_malloc(sizeof(ERROR_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 154 | if (error_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 155 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 156 | error_instance->composite_value = amqpvalue_clone(((ERROR_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 157 | if (error_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 158 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 159 | amqpalloc_free(error_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 160 | error_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 161 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 162 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 163 | |
Azure.IoT Build | 0:6ae2f7bca550 | 164 | return error_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 165 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 166 | |
Azure.IoT Build | 0:6ae2f7bca550 | 167 | void error_destroy(ERROR_HANDLE error) |
Azure.IoT Build | 0:6ae2f7bca550 | 168 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 169 | if (error != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 170 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 171 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)error; |
Azure.IoT Build | 0:6ae2f7bca550 | 172 | amqpvalue_destroy(error_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 173 | amqpalloc_free(error_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 174 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 175 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 176 | |
Azure.IoT Build | 0:6ae2f7bca550 | 177 | AMQP_VALUE amqpvalue_create_error(ERROR_HANDLE error) |
Azure.IoT Build | 0:6ae2f7bca550 | 178 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 179 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 180 | |
Azure.IoT Build | 0:6ae2f7bca550 | 181 | if (error == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 182 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 183 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 184 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 185 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 186 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 187 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)error; |
Azure.IoT Build | 0:6ae2f7bca550 | 188 | result = amqpvalue_clone(error_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 189 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 190 | |
Azure.IoT Build | 0:6ae2f7bca550 | 191 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 192 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 193 | |
Azure.IoT Build | 0:6ae2f7bca550 | 194 | bool is_error_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 195 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 196 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 197 | |
Azure.IoT Build | 0:6ae2f7bca550 | 198 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 199 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 200 | (descriptor_ulong == 29)) |
Azure.IoT Build | 0:6ae2f7bca550 | 201 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 202 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 203 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 204 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 205 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 206 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 207 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 208 | |
Azure.IoT Build | 0:6ae2f7bca550 | 209 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 210 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 211 | |
Azure.IoT Build | 0:6ae2f7bca550 | 212 | |
Azure.IoT Build | 0:6ae2f7bca550 | 213 | int amqpvalue_get_error(AMQP_VALUE value, ERROR_HANDLE* error_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 214 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 215 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 216 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)error_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 217 | *error_handle = error_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 218 | if (*error_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 219 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 220 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 221 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 222 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 223 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 224 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 225 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 226 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 227 | error_destroy(*error_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 228 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 229 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 230 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 231 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 232 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 233 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 234 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 235 | /* condition */ |
Azure.IoT Build | 0:6ae2f7bca550 | 236 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 237 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 238 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 239 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 240 | error_destroy(*error_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 241 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 242 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 243 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 244 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 245 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 246 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 247 | const char* condition; |
Azure.IoT Build | 0:6ae2f7bca550 | 248 | if (amqpvalue_get_symbol(item_value, &condition) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 249 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 250 | error_destroy(*error_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 251 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 252 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 253 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 254 | |
Azure.IoT Build | 0:6ae2f7bca550 | 255 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 256 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 257 | /* description */ |
Azure.IoT Build | 0:6ae2f7bca550 | 258 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 259 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 260 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 261 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 262 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 263 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 264 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 265 | const char* description; |
Azure.IoT Build | 0:6ae2f7bca550 | 266 | if (amqpvalue_get_string(item_value, &description) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 267 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 268 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 269 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 270 | error_destroy(*error_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 271 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 272 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 273 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 274 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 275 | |
Azure.IoT Build | 0:6ae2f7bca550 | 276 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 277 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 278 | /* info */ |
Azure.IoT Build | 0:6ae2f7bca550 | 279 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 280 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 281 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 282 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 283 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 284 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 285 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 286 | fields info; |
Azure.IoT Build | 0:6ae2f7bca550 | 287 | if (amqpvalue_get_fields(item_value, &info) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 288 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 289 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 290 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 291 | error_destroy(*error_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 292 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 293 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 294 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 295 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 296 | |
Azure.IoT Build | 0:6ae2f7bca550 | 297 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 298 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 299 | |
Azure.IoT Build | 0:6ae2f7bca550 | 300 | error_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 301 | |
Azure.IoT Build | 0:6ae2f7bca550 | 302 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 303 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 304 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 305 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 306 | |
Azure.IoT Build | 0:6ae2f7bca550 | 307 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 308 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 309 | |
Azure.IoT Build | 0:6ae2f7bca550 | 310 | int error_get_condition(ERROR_HANDLE error, const char** condition_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 311 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 312 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 313 | |
Azure.IoT Build | 0:6ae2f7bca550 | 314 | if (error == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 315 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 316 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 317 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 318 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 319 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 320 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)error; |
Azure.IoT Build | 0:6ae2f7bca550 | 321 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(error_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 322 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 323 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 324 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 325 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 326 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 327 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 328 | if (amqpvalue_get_symbol(item_value, condition_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 329 | { |
AzureIoTClient | 16:22a72cf8e416 | 330 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 331 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 332 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 333 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 334 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 335 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 336 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 337 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 338 | |
Azure.IoT Build | 0:6ae2f7bca550 | 339 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 340 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 341 | |
Azure.IoT Build | 0:6ae2f7bca550 | 342 | int error_set_condition(ERROR_HANDLE error, const char* condition_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 343 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 344 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 345 | |
Azure.IoT Build | 0:6ae2f7bca550 | 346 | if (error == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 347 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 348 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 349 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 350 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 351 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 352 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)error; |
Azure.IoT Build | 0:6ae2f7bca550 | 353 | AMQP_VALUE condition_amqp_value = amqpvalue_create_symbol(condition_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 354 | if (condition_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 355 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 356 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 357 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 358 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 359 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 360 | if (amqpvalue_set_composite_item(error_instance->composite_value, 0, condition_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 361 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 362 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 363 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 364 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 365 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 366 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 367 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 368 | |
Azure.IoT Build | 0:6ae2f7bca550 | 369 | amqpvalue_destroy(condition_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 370 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 371 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 372 | |
Azure.IoT Build | 0:6ae2f7bca550 | 373 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 374 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 375 | |
Azure.IoT Build | 0:6ae2f7bca550 | 376 | int error_get_description(ERROR_HANDLE error, const char** description_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 377 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 378 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 379 | |
Azure.IoT Build | 0:6ae2f7bca550 | 380 | if (error == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 381 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 382 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 383 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 384 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 385 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 386 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)error; |
Azure.IoT Build | 0:6ae2f7bca550 | 387 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(error_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 388 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 389 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 390 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 391 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 392 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 393 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 394 | if (amqpvalue_get_string(item_value, description_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 395 | { |
AzureIoTClient | 16:22a72cf8e416 | 396 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 397 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 398 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 399 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 400 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 401 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 402 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 403 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 404 | |
Azure.IoT Build | 0:6ae2f7bca550 | 405 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 406 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 407 | |
Azure.IoT Build | 0:6ae2f7bca550 | 408 | int error_set_description(ERROR_HANDLE error, const char* description_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 409 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 410 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 411 | |
Azure.IoT Build | 0:6ae2f7bca550 | 412 | if (error == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 413 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 414 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 415 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 416 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 417 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 418 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)error; |
Azure.IoT Build | 0:6ae2f7bca550 | 419 | AMQP_VALUE description_amqp_value = amqpvalue_create_string(description_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 420 | if (description_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 421 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 422 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 423 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 424 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 425 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 426 | if (amqpvalue_set_composite_item(error_instance->composite_value, 1, description_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 427 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 428 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 429 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 430 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 431 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 432 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 433 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 434 | |
Azure.IoT Build | 0:6ae2f7bca550 | 435 | amqpvalue_destroy(description_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 436 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 437 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 438 | |
Azure.IoT Build | 0:6ae2f7bca550 | 439 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 440 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 441 | |
Azure.IoT Build | 0:6ae2f7bca550 | 442 | int error_get_info(ERROR_HANDLE error, fields* info_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 443 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 444 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 445 | |
Azure.IoT Build | 0:6ae2f7bca550 | 446 | if (error == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 447 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 448 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 449 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 450 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 451 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 452 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)error; |
Azure.IoT Build | 0:6ae2f7bca550 | 453 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(error_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 454 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 455 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 456 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 457 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 458 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 459 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 460 | if (amqpvalue_get_fields(item_value, info_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 461 | { |
AzureIoTClient | 16:22a72cf8e416 | 462 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 463 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 464 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 465 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 466 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 467 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 468 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 469 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 470 | |
Azure.IoT Build | 0:6ae2f7bca550 | 471 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 472 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 473 | |
Azure.IoT Build | 0:6ae2f7bca550 | 474 | int error_set_info(ERROR_HANDLE error, fields info_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 475 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 476 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 477 | |
Azure.IoT Build | 0:6ae2f7bca550 | 478 | if (error == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 479 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 480 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 481 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 482 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 483 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 484 | ERROR_INSTANCE* error_instance = (ERROR_INSTANCE*)error; |
Azure.IoT Build | 0:6ae2f7bca550 | 485 | AMQP_VALUE info_amqp_value = amqpvalue_create_fields(info_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 486 | if (info_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 487 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 488 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 489 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 490 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 491 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 492 | if (amqpvalue_set_composite_item(error_instance->composite_value, 2, info_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 493 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 494 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 495 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 496 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 497 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 498 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 499 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 500 | |
Azure.IoT Build | 0:6ae2f7bca550 | 501 | amqpvalue_destroy(info_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 502 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 503 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 504 | |
Azure.IoT Build | 0:6ae2f7bca550 | 505 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 506 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 507 | |
Azure.IoT Build | 0:6ae2f7bca550 | 508 | |
Azure.IoT Build | 0:6ae2f7bca550 | 509 | /* amqp-error */ |
Azure.IoT Build | 0:6ae2f7bca550 | 510 | |
Azure.IoT Build | 0:6ae2f7bca550 | 511 | AMQP_VALUE amqpvalue_create_amqp_error(amqp_error value) |
Azure.IoT Build | 0:6ae2f7bca550 | 512 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 513 | return amqpvalue_create_symbol(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 514 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 515 | |
Azure.IoT Build | 0:6ae2f7bca550 | 516 | /* connection-error */ |
Azure.IoT Build | 0:6ae2f7bca550 | 517 | |
Azure.IoT Build | 0:6ae2f7bca550 | 518 | AMQP_VALUE amqpvalue_create_connection_error(connection_error value) |
Azure.IoT Build | 0:6ae2f7bca550 | 519 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 520 | return amqpvalue_create_symbol(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 521 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 522 | |
Azure.IoT Build | 0:6ae2f7bca550 | 523 | /* session-error */ |
Azure.IoT Build | 0:6ae2f7bca550 | 524 | |
Azure.IoT Build | 0:6ae2f7bca550 | 525 | AMQP_VALUE amqpvalue_create_session_error(session_error value) |
Azure.IoT Build | 0:6ae2f7bca550 | 526 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 527 | return amqpvalue_create_symbol(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 528 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 529 | |
Azure.IoT Build | 0:6ae2f7bca550 | 530 | /* link-error */ |
Azure.IoT Build | 0:6ae2f7bca550 | 531 | |
Azure.IoT Build | 0:6ae2f7bca550 | 532 | AMQP_VALUE amqpvalue_create_link_error(link_error value) |
Azure.IoT Build | 0:6ae2f7bca550 | 533 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 534 | return amqpvalue_create_symbol(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 535 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 536 | |
Azure.IoT Build | 0:6ae2f7bca550 | 537 | /* open */ |
Azure.IoT Build | 0:6ae2f7bca550 | 538 | |
Azure.IoT Build | 0:6ae2f7bca550 | 539 | typedef struct OPEN_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 540 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 541 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 542 | } OPEN_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 543 | |
Azure.IoT Build | 0:6ae2f7bca550 | 544 | static OPEN_HANDLE open_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 545 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 546 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)amqpalloc_malloc(sizeof(OPEN_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 547 | if (open_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 548 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 549 | open_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 550 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 551 | |
Azure.IoT Build | 0:6ae2f7bca550 | 552 | return open_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 553 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 554 | |
Azure.IoT Build | 0:6ae2f7bca550 | 555 | OPEN_HANDLE open_create(const char* container_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 556 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 557 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)amqpalloc_malloc(sizeof(OPEN_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 558 | if (open_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 559 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 560 | open_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(16); |
Azure.IoT Build | 0:6ae2f7bca550 | 561 | if (open_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 562 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 563 | amqpalloc_free(open_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 564 | open_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 565 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 566 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 567 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 568 | AMQP_VALUE container_id_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 569 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 570 | |
Azure.IoT Build | 0:6ae2f7bca550 | 571 | container_id_amqp_value = amqpvalue_create_string(container_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 572 | if ((result == 0) && (amqpvalue_set_composite_item(open_instance->composite_value, 0, container_id_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 573 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 574 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 575 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 576 | |
Azure.IoT Build | 0:6ae2f7bca550 | 577 | amqpvalue_destroy(container_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 578 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 579 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 580 | |
Azure.IoT Build | 0:6ae2f7bca550 | 581 | return open_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 582 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 583 | |
Azure.IoT Build | 0:6ae2f7bca550 | 584 | OPEN_HANDLE open_clone(OPEN_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 585 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 586 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)amqpalloc_malloc(sizeof(OPEN_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 587 | if (open_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 588 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 589 | open_instance->composite_value = amqpvalue_clone(((OPEN_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 590 | if (open_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 591 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 592 | amqpalloc_free(open_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 593 | open_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 594 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 595 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 596 | |
Azure.IoT Build | 0:6ae2f7bca550 | 597 | return open_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 598 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 599 | |
Azure.IoT Build | 0:6ae2f7bca550 | 600 | void open_destroy(OPEN_HANDLE open) |
Azure.IoT Build | 0:6ae2f7bca550 | 601 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 602 | if (open != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 603 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 604 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 605 | amqpvalue_destroy(open_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 606 | amqpalloc_free(open_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 607 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 608 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 609 | |
Azure.IoT Build | 0:6ae2f7bca550 | 610 | AMQP_VALUE amqpvalue_create_open(OPEN_HANDLE open) |
Azure.IoT Build | 0:6ae2f7bca550 | 611 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 612 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 613 | |
Azure.IoT Build | 0:6ae2f7bca550 | 614 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 615 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 616 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 617 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 618 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 619 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 620 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 621 | result = amqpvalue_clone(open_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 622 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 623 | |
Azure.IoT Build | 0:6ae2f7bca550 | 624 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 625 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 626 | |
Azure.IoT Build | 0:6ae2f7bca550 | 627 | bool is_open_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 628 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 629 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 630 | |
Azure.IoT Build | 0:6ae2f7bca550 | 631 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 632 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 633 | (descriptor_ulong == 16)) |
Azure.IoT Build | 0:6ae2f7bca550 | 634 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 635 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 636 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 637 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 638 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 639 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 640 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 641 | |
Azure.IoT Build | 0:6ae2f7bca550 | 642 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 643 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 644 | |
Azure.IoT Build | 0:6ae2f7bca550 | 645 | |
Azure.IoT Build | 0:6ae2f7bca550 | 646 | int amqpvalue_get_open(AMQP_VALUE value, OPEN_HANDLE* open_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 647 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 648 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 649 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 650 | *open_handle = open_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 651 | if (*open_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 652 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 653 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 654 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 655 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 656 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 657 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 658 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 659 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 660 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 661 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 662 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 663 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 664 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 665 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 666 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 667 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 668 | /* container-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 669 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 670 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 671 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 672 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 673 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 674 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 675 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 676 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 677 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 678 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 679 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 680 | const char* container_id; |
Azure.IoT Build | 0:6ae2f7bca550 | 681 | if (amqpvalue_get_string(item_value, &container_id) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 682 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 683 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 684 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 685 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 686 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 687 | |
Azure.IoT Build | 0:6ae2f7bca550 | 688 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 689 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 690 | /* hostname */ |
Azure.IoT Build | 0:6ae2f7bca550 | 691 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 692 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 693 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 694 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 695 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 696 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 697 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 698 | const char* hostname; |
Azure.IoT Build | 0:6ae2f7bca550 | 699 | if (amqpvalue_get_string(item_value, &hostname) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 700 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 701 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 702 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 703 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 704 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 705 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 706 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 707 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 708 | |
Azure.IoT Build | 0:6ae2f7bca550 | 709 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 710 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 711 | /* max-frame-size */ |
Azure.IoT Build | 0:6ae2f7bca550 | 712 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 713 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 714 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 715 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 716 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 717 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 718 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 719 | uint32_t max_frame_size; |
Azure.IoT Build | 0:6ae2f7bca550 | 720 | if (amqpvalue_get_uint(item_value, &max_frame_size) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 721 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 722 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 723 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 724 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 725 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 726 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 727 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 728 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 729 | |
Azure.IoT Build | 0:6ae2f7bca550 | 730 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 731 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 732 | /* channel-max */ |
Azure.IoT Build | 0:6ae2f7bca550 | 733 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 734 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 735 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 736 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 737 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 738 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 739 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 740 | uint16_t channel_max; |
Azure.IoT Build | 0:6ae2f7bca550 | 741 | if (amqpvalue_get_ushort(item_value, &channel_max) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 742 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 743 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 744 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 745 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 746 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 747 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 748 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 749 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 750 | |
Azure.IoT Build | 0:6ae2f7bca550 | 751 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 752 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 753 | /* idle-time-out */ |
Azure.IoT Build | 0:6ae2f7bca550 | 754 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 755 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 756 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 757 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 758 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 759 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 760 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 761 | milliseconds idle_time_out; |
Azure.IoT Build | 0:6ae2f7bca550 | 762 | if (amqpvalue_get_milliseconds(item_value, &idle_time_out) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 763 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 764 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 765 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 766 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 767 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 768 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 769 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 770 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 771 | |
Azure.IoT Build | 0:6ae2f7bca550 | 772 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 773 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 774 | /* outgoing-locales */ |
Azure.IoT Build | 0:6ae2f7bca550 | 775 | item_value = amqpvalue_get_list_item(list_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 776 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 777 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 778 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 779 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 780 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 781 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 782 | ietf_language_tag outgoing_locales; |
Azure.IoT Build | 0:6ae2f7bca550 | 783 | AMQP_VALUE outgoing_locales_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 784 | if ((amqpvalue_get_array(item_value, &outgoing_locales_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 785 | (amqpvalue_get_ietf_language_tag(item_value, &outgoing_locales) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 786 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 787 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 788 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 789 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 790 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 791 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 792 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 793 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 794 | |
Azure.IoT Build | 0:6ae2f7bca550 | 795 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 796 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 797 | /* incoming-locales */ |
Azure.IoT Build | 0:6ae2f7bca550 | 798 | item_value = amqpvalue_get_list_item(list_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 799 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 800 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 801 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 802 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 803 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 804 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 805 | ietf_language_tag incoming_locales; |
Azure.IoT Build | 0:6ae2f7bca550 | 806 | AMQP_VALUE incoming_locales_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 807 | if ((amqpvalue_get_array(item_value, &incoming_locales_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 808 | (amqpvalue_get_ietf_language_tag(item_value, &incoming_locales) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 809 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 810 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 811 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 812 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 813 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 814 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 815 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 816 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 817 | |
Azure.IoT Build | 0:6ae2f7bca550 | 818 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 819 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 820 | /* offered-capabilities */ |
Azure.IoT Build | 0:6ae2f7bca550 | 821 | item_value = amqpvalue_get_list_item(list_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 822 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 823 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 824 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 825 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 826 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 827 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 828 | const char* offered_capabilities; |
Azure.IoT Build | 0:6ae2f7bca550 | 829 | AMQP_VALUE offered_capabilities_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 830 | if ((amqpvalue_get_array(item_value, &offered_capabilities_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 831 | (amqpvalue_get_symbol(item_value, &offered_capabilities) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 832 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 833 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 834 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 835 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 836 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 837 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 838 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 839 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 840 | |
Azure.IoT Build | 0:6ae2f7bca550 | 841 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 842 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 843 | /* desired-capabilities */ |
Azure.IoT Build | 0:6ae2f7bca550 | 844 | item_value = amqpvalue_get_list_item(list_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 845 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 846 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 847 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 848 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 849 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 850 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 851 | const char* desired_capabilities; |
Azure.IoT Build | 0:6ae2f7bca550 | 852 | AMQP_VALUE desired_capabilities_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 853 | if ((amqpvalue_get_array(item_value, &desired_capabilities_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 854 | (amqpvalue_get_symbol(item_value, &desired_capabilities) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 855 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 856 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 857 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 858 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 859 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 860 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 861 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 862 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 863 | |
Azure.IoT Build | 0:6ae2f7bca550 | 864 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 865 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 866 | /* properties */ |
Azure.IoT Build | 0:6ae2f7bca550 | 867 | item_value = amqpvalue_get_list_item(list_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 868 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 869 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 870 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 871 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 872 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 873 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 874 | fields properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 875 | if (amqpvalue_get_fields(item_value, &properties) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 876 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 877 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 878 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 879 | open_destroy(*open_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 880 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 881 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 882 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 883 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 884 | |
Azure.IoT Build | 0:6ae2f7bca550 | 885 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 886 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 887 | |
Azure.IoT Build | 0:6ae2f7bca550 | 888 | open_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 889 | |
Azure.IoT Build | 0:6ae2f7bca550 | 890 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 891 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 892 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 893 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 894 | |
Azure.IoT Build | 0:6ae2f7bca550 | 895 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 896 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 897 | |
Azure.IoT Build | 0:6ae2f7bca550 | 898 | int open_get_container_id(OPEN_HANDLE open, const char** container_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 899 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 900 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 901 | |
Azure.IoT Build | 0:6ae2f7bca550 | 902 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 903 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 904 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 905 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 906 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 907 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 908 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 909 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 910 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 911 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 912 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 913 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 914 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 915 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 916 | if (amqpvalue_get_string(item_value, container_id_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 917 | { |
AzureIoTClient | 16:22a72cf8e416 | 918 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 919 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 920 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 921 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 922 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 923 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 924 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 925 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 926 | |
Azure.IoT Build | 0:6ae2f7bca550 | 927 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 928 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 929 | |
Azure.IoT Build | 0:6ae2f7bca550 | 930 | int open_set_container_id(OPEN_HANDLE open, const char* container_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 931 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 932 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 933 | |
Azure.IoT Build | 0:6ae2f7bca550 | 934 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 935 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 936 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 937 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 938 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 939 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 940 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 941 | AMQP_VALUE container_id_amqp_value = amqpvalue_create_string(container_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 942 | if (container_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 943 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 944 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 945 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 946 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 947 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 948 | if (amqpvalue_set_composite_item(open_instance->composite_value, 0, container_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 949 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 950 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 951 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 952 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 953 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 954 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 955 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 956 | |
Azure.IoT Build | 0:6ae2f7bca550 | 957 | amqpvalue_destroy(container_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 958 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 959 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 960 | |
Azure.IoT Build | 0:6ae2f7bca550 | 961 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 962 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 963 | |
Azure.IoT Build | 0:6ae2f7bca550 | 964 | int open_get_hostname(OPEN_HANDLE open, const char** hostname_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 965 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 966 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 967 | |
Azure.IoT Build | 0:6ae2f7bca550 | 968 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 969 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 970 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 971 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 972 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 973 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 974 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 975 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 976 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 977 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 978 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 979 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 980 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 981 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 982 | if (amqpvalue_get_string(item_value, hostname_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 983 | { |
AzureIoTClient | 16:22a72cf8e416 | 984 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 985 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 986 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 987 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 988 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 989 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 990 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 991 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 992 | |
Azure.IoT Build | 0:6ae2f7bca550 | 993 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 994 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 995 | |
Azure.IoT Build | 0:6ae2f7bca550 | 996 | int open_set_hostname(OPEN_HANDLE open, const char* hostname_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 997 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 998 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 999 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1000 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1001 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1002 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1003 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1004 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1005 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1006 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1007 | AMQP_VALUE hostname_amqp_value = amqpvalue_create_string(hostname_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1008 | if (hostname_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1009 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1010 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1011 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1012 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1013 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1014 | if (amqpvalue_set_composite_item(open_instance->composite_value, 1, hostname_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1015 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1016 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1017 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1018 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1019 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1020 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1021 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1022 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1023 | amqpvalue_destroy(hostname_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1024 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1025 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1026 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1027 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1028 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1029 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1030 | int open_get_max_frame_size(OPEN_HANDLE open, uint32_t* max_frame_size_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1031 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1032 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1033 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1034 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1035 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1036 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1037 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1038 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1039 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1040 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1041 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 1042 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1043 | { |
AzureIoTClient | 16:22a72cf8e416 | 1044 | *max_frame_size_value = 4294967295u; |
AzureIoTClient | 16:22a72cf8e416 | 1045 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1046 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1047 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1048 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1049 | if (amqpvalue_get_uint(item_value, max_frame_size_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1050 | { |
AzureIoTClient | 16:22a72cf8e416 | 1051 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 1052 | { |
AzureIoTClient | 16:22a72cf8e416 | 1053 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 1054 | } |
AzureIoTClient | 16:22a72cf8e416 | 1055 | else |
AzureIoTClient | 16:22a72cf8e416 | 1056 | { |
AzureIoTClient | 16:22a72cf8e416 | 1057 | *max_frame_size_value = 4294967295u; |
AzureIoTClient | 16:22a72cf8e416 | 1058 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 1059 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1060 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1061 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1062 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1063 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1064 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1065 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1066 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1067 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1068 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1069 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1070 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1071 | int open_set_max_frame_size(OPEN_HANDLE open, uint32_t max_frame_size_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1072 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1073 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1074 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1075 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1076 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1077 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1078 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1079 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1080 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1081 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1082 | AMQP_VALUE max_frame_size_amqp_value = amqpvalue_create_uint(max_frame_size_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1083 | if (max_frame_size_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1084 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1085 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1086 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1087 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1088 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1089 | if (amqpvalue_set_composite_item(open_instance->composite_value, 2, max_frame_size_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1090 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1091 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1092 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1093 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1094 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1095 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1096 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1097 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1098 | amqpvalue_destroy(max_frame_size_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1099 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1100 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1101 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1102 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1103 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1104 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1105 | int open_get_channel_max(OPEN_HANDLE open, uint16_t* channel_max_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1106 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1107 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1108 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1109 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1110 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1111 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1112 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1113 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1114 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1115 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1116 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 1117 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1118 | { |
AzureIoTClient | 16:22a72cf8e416 | 1119 | *channel_max_value = 65535; |
AzureIoTClient | 16:22a72cf8e416 | 1120 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1121 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1122 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1123 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1124 | if (amqpvalue_get_ushort(item_value, channel_max_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1125 | { |
AzureIoTClient | 16:22a72cf8e416 | 1126 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 1127 | { |
AzureIoTClient | 16:22a72cf8e416 | 1128 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 1129 | } |
AzureIoTClient | 16:22a72cf8e416 | 1130 | else |
AzureIoTClient | 16:22a72cf8e416 | 1131 | { |
AzureIoTClient | 16:22a72cf8e416 | 1132 | *channel_max_value = 65535; |
AzureIoTClient | 16:22a72cf8e416 | 1133 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 1134 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1135 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1136 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1137 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1138 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1139 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1140 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1141 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1142 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1143 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1144 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1145 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1146 | int open_set_channel_max(OPEN_HANDLE open, uint16_t channel_max_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1147 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1148 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1149 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1150 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1151 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1152 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1153 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1154 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1155 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1156 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1157 | AMQP_VALUE channel_max_amqp_value = amqpvalue_create_ushort(channel_max_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1158 | if (channel_max_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1159 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1160 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1161 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1162 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1163 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1164 | if (amqpvalue_set_composite_item(open_instance->composite_value, 3, channel_max_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1165 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1166 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1167 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1168 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1169 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1170 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1171 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1172 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1173 | amqpvalue_destroy(channel_max_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1174 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1175 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1176 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1177 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1178 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1179 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1180 | int open_get_idle_time_out(OPEN_HANDLE open, milliseconds* idle_time_out_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1181 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1182 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1183 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1184 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1185 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1186 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1187 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1188 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1189 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1190 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1191 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 1192 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1193 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1194 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1195 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1196 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1197 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1198 | if (amqpvalue_get_milliseconds(item_value, idle_time_out_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1199 | { |
AzureIoTClient | 16:22a72cf8e416 | 1200 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1201 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1202 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1203 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1204 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1205 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1206 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1207 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1208 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1209 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1210 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1211 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1212 | int open_set_idle_time_out(OPEN_HANDLE open, milliseconds idle_time_out_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1213 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1214 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1215 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1216 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1217 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1218 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1219 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1220 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1221 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1222 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1223 | AMQP_VALUE idle_time_out_amqp_value = amqpvalue_create_milliseconds(idle_time_out_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1224 | if (idle_time_out_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1225 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1226 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1227 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1228 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1229 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1230 | if (amqpvalue_set_composite_item(open_instance->composite_value, 4, idle_time_out_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1231 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1232 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1233 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1234 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1235 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1236 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1237 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1238 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1239 | amqpvalue_destroy(idle_time_out_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1240 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1241 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1242 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1243 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1244 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1245 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1246 | int open_get_outgoing_locales(OPEN_HANDLE open, AMQP_VALUE* outgoing_locales_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1247 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1248 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1249 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1250 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1251 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1252 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1253 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1254 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1255 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1256 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1257 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 1258 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1259 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1260 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1261 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1262 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1263 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1264 | if (amqpvalue_get_array(item_value, outgoing_locales_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1265 | { |
AzureIoTClient | 16:22a72cf8e416 | 1266 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1267 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1268 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1269 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1270 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1271 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1272 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1273 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1274 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1275 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1276 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1277 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1278 | int open_set_outgoing_locales(OPEN_HANDLE open, AMQP_VALUE outgoing_locales_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1279 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1280 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1281 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1282 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1283 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1284 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1285 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1286 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1287 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1288 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1289 | AMQP_VALUE outgoing_locales_amqp_value = amqpvalue_clone(outgoing_locales_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1290 | if (outgoing_locales_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1291 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1292 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1293 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1294 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1295 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1296 | if (amqpvalue_set_composite_item(open_instance->composite_value, 5, outgoing_locales_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1297 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1298 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1299 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1300 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1301 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1302 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1303 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1304 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1305 | amqpvalue_destroy(outgoing_locales_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1306 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1307 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1308 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1309 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1310 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1311 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1312 | int open_get_incoming_locales(OPEN_HANDLE open, AMQP_VALUE* incoming_locales_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1313 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1314 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1315 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1316 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1317 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1318 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1319 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1320 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1321 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1322 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1323 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 1324 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1325 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1326 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1327 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1328 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1329 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1330 | if (amqpvalue_get_array(item_value, incoming_locales_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1331 | { |
AzureIoTClient | 16:22a72cf8e416 | 1332 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1333 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1334 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1335 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1336 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1337 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1338 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1339 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1340 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1341 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1342 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1343 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1344 | int open_set_incoming_locales(OPEN_HANDLE open, AMQP_VALUE incoming_locales_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1345 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1346 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1347 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1348 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1349 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1350 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1351 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1352 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1353 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1354 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1355 | AMQP_VALUE incoming_locales_amqp_value = amqpvalue_clone(incoming_locales_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1356 | if (incoming_locales_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1357 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1358 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1359 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1360 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1361 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1362 | if (amqpvalue_set_composite_item(open_instance->composite_value, 6, incoming_locales_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1363 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1364 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1365 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1366 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1367 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1368 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1369 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1370 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1371 | amqpvalue_destroy(incoming_locales_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1372 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1373 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1374 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1375 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1376 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1377 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1378 | int open_get_offered_capabilities(OPEN_HANDLE open, AMQP_VALUE* offered_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1379 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1380 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1381 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1382 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1383 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1384 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1385 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1386 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1387 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1388 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1389 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 1390 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1391 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1392 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1393 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1394 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1395 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1396 | if (amqpvalue_get_array(item_value, offered_capabilities_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1397 | { |
AzureIoTClient | 16:22a72cf8e416 | 1398 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1399 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1400 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1401 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1402 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1403 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1404 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1405 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1406 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1407 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1408 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1409 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1410 | int open_set_offered_capabilities(OPEN_HANDLE open, AMQP_VALUE offered_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1411 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1412 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1413 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1414 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1415 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1416 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1417 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1418 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1419 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1420 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1421 | AMQP_VALUE offered_capabilities_amqp_value = amqpvalue_clone(offered_capabilities_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1422 | if (offered_capabilities_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1423 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1424 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1425 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1426 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1427 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1428 | if (amqpvalue_set_composite_item(open_instance->composite_value, 7, offered_capabilities_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1429 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1430 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1431 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1432 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1433 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1434 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1435 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1436 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1437 | amqpvalue_destroy(offered_capabilities_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1438 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1439 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1440 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1441 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1442 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1443 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1444 | int open_get_desired_capabilities(OPEN_HANDLE open, AMQP_VALUE* desired_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1445 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1446 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1447 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1448 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1449 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1450 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1451 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1452 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1453 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1454 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1455 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 1456 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1457 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1458 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1459 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1460 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1461 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1462 | if (amqpvalue_get_array(item_value, desired_capabilities_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1463 | { |
AzureIoTClient | 16:22a72cf8e416 | 1464 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1465 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1466 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1467 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1468 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1469 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1470 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1471 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1472 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1473 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1474 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1475 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1476 | int open_set_desired_capabilities(OPEN_HANDLE open, AMQP_VALUE desired_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1477 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1478 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1479 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1480 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1481 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1482 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1483 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1484 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1485 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1486 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1487 | AMQP_VALUE desired_capabilities_amqp_value = amqpvalue_clone(desired_capabilities_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1488 | if (desired_capabilities_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1489 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1490 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1491 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1492 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1493 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1494 | if (amqpvalue_set_composite_item(open_instance->composite_value, 8, desired_capabilities_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1495 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1496 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1497 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1498 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1499 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1500 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1501 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1502 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1503 | amqpvalue_destroy(desired_capabilities_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1504 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1505 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1506 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1507 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1508 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1509 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1510 | int open_get_properties(OPEN_HANDLE open, fields* properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1511 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1512 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1513 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1514 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1515 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1516 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1517 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1518 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1519 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1520 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1521 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(open_instance->composite_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 1522 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1523 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1524 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1525 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1526 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1527 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1528 | if (amqpvalue_get_fields(item_value, properties_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1529 | { |
AzureIoTClient | 16:22a72cf8e416 | 1530 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1531 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1532 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1533 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1534 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1535 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1536 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1537 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1538 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1539 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1540 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1541 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1542 | int open_set_properties(OPEN_HANDLE open, fields properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1543 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1544 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1545 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1546 | if (open == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1547 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1548 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1549 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1550 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1551 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1552 | OPEN_INSTANCE* open_instance = (OPEN_INSTANCE*)open; |
Azure.IoT Build | 0:6ae2f7bca550 | 1553 | AMQP_VALUE properties_amqp_value = amqpvalue_create_fields(properties_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1554 | if (properties_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1555 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1556 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1557 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1558 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1559 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1560 | if (amqpvalue_set_composite_item(open_instance->composite_value, 9, properties_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1561 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1562 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1563 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1564 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1565 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1566 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1567 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1568 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1569 | amqpvalue_destroy(properties_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1570 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1571 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1572 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1573 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1574 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1575 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1576 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1577 | /* begin */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1578 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1579 | typedef struct BEGIN_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 1580 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1581 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 1582 | } BEGIN_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 1583 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1584 | static BEGIN_HANDLE begin_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 1585 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1586 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)amqpalloc_malloc(sizeof(BEGIN_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 1587 | if (begin_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1588 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1589 | begin_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 1590 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1591 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1592 | return begin_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 1593 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1594 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1595 | BEGIN_HANDLE begin_create(transfer_number next_outgoing_id_value, uint32_t incoming_window_value, uint32_t outgoing_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1596 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1597 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)amqpalloc_malloc(sizeof(BEGIN_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 1598 | if (begin_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1599 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1600 | begin_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(17); |
Azure.IoT Build | 0:6ae2f7bca550 | 1601 | if (begin_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1602 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1603 | amqpalloc_free(begin_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 1604 | begin_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 1605 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1606 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1607 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1608 | AMQP_VALUE next_outgoing_id_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 1609 | AMQP_VALUE incoming_window_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 1610 | AMQP_VALUE outgoing_window_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 1611 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1612 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1613 | next_outgoing_id_amqp_value = amqpvalue_create_transfer_number(next_outgoing_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1614 | if ((result == 0) && (amqpvalue_set_composite_item(begin_instance->composite_value, 1, next_outgoing_id_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 1615 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1616 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1617 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1618 | incoming_window_amqp_value = amqpvalue_create_uint(incoming_window_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1619 | if ((result == 0) && (amqpvalue_set_composite_item(begin_instance->composite_value, 2, incoming_window_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 1620 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1621 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1622 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1623 | outgoing_window_amqp_value = amqpvalue_create_uint(outgoing_window_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1624 | if ((result == 0) && (amqpvalue_set_composite_item(begin_instance->composite_value, 3, outgoing_window_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 1625 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1626 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1627 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1628 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1629 | amqpvalue_destroy(next_outgoing_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1630 | amqpvalue_destroy(incoming_window_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1631 | amqpvalue_destroy(outgoing_window_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1632 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1633 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1634 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1635 | return begin_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 1636 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1637 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1638 | BEGIN_HANDLE begin_clone(BEGIN_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1639 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1640 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)amqpalloc_malloc(sizeof(BEGIN_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 1641 | if (begin_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1642 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1643 | begin_instance->composite_value = amqpvalue_clone(((BEGIN_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1644 | if (begin_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1645 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1646 | amqpalloc_free(begin_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 1647 | begin_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 1648 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1649 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1650 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1651 | return begin_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 1652 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1653 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1654 | void begin_destroy(BEGIN_HANDLE begin) |
Azure.IoT Build | 0:6ae2f7bca550 | 1655 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1656 | if (begin != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1657 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1658 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 1659 | amqpvalue_destroy(begin_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1660 | amqpalloc_free(begin_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 1661 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1662 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1663 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1664 | AMQP_VALUE amqpvalue_create_begin(BEGIN_HANDLE begin) |
Azure.IoT Build | 0:6ae2f7bca550 | 1665 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1666 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1667 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1668 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1669 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1670 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 1671 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1672 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1673 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1674 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 1675 | result = amqpvalue_clone(begin_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1676 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1677 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1678 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1679 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1680 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1681 | bool is_begin_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 1682 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1683 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1684 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1685 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 1686 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 1687 | (descriptor_ulong == 17)) |
Azure.IoT Build | 0:6ae2f7bca550 | 1688 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1689 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 1690 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1691 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1692 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1693 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 1694 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1695 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1696 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1697 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1698 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1699 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1700 | int amqpvalue_get_begin(AMQP_VALUE value, BEGIN_HANDLE* begin_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 1701 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1702 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1703 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 1704 | *begin_handle = begin_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 1705 | if (*begin_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1706 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1707 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1708 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1709 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1710 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1711 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1712 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1713 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1714 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1715 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1716 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1717 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1718 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1719 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 1720 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1721 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 1722 | /* remote-channel */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1723 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 1724 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1725 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1726 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1727 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1728 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1729 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1730 | uint16_t remote_channel; |
Azure.IoT Build | 0:6ae2f7bca550 | 1731 | if (amqpvalue_get_ushort(item_value, &remote_channel) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1732 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1733 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1734 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1735 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1736 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1737 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1738 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1739 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1740 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1741 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1742 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1743 | /* next-outgoing-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1744 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 1745 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1746 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1747 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1748 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1749 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1750 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1751 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1752 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1753 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1754 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1755 | transfer_number next_outgoing_id; |
Azure.IoT Build | 0:6ae2f7bca550 | 1756 | if (amqpvalue_get_transfer_number(item_value, &next_outgoing_id) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1757 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1758 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1759 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1760 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1761 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1762 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1763 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1764 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1765 | /* incoming-window */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1766 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 1767 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1768 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1769 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1770 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1771 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1772 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1773 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1774 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1775 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1776 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1777 | uint32_t incoming_window; |
Azure.IoT Build | 0:6ae2f7bca550 | 1778 | if (amqpvalue_get_uint(item_value, &incoming_window) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1779 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1780 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1781 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1782 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1783 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1784 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1785 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1786 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1787 | /* outgoing-window */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1788 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 1789 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1790 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1791 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1792 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1793 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1794 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1795 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1796 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1797 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1798 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1799 | uint32_t outgoing_window; |
Azure.IoT Build | 0:6ae2f7bca550 | 1800 | if (amqpvalue_get_uint(item_value, &outgoing_window) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1801 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1802 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1803 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1804 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1805 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1806 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1807 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1808 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1809 | /* handle-max */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1810 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 1811 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1812 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1813 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1814 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1815 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1816 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1817 | handle handle_max; |
Azure.IoT Build | 0:6ae2f7bca550 | 1818 | if (amqpvalue_get_handle(item_value, &handle_max) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1819 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1820 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1821 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1822 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1823 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1824 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1825 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1826 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1827 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1828 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1829 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1830 | /* offered-capabilities */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1831 | item_value = amqpvalue_get_list_item(list_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 1832 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1833 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1834 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1835 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1836 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1837 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1838 | const char* offered_capabilities; |
Azure.IoT Build | 0:6ae2f7bca550 | 1839 | AMQP_VALUE offered_capabilities_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 1840 | if ((amqpvalue_get_array(item_value, &offered_capabilities_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 1841 | (amqpvalue_get_symbol(item_value, &offered_capabilities) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 1842 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1843 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1844 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1845 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1846 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1847 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1848 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1849 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1850 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1851 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1852 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1853 | /* desired-capabilities */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1854 | item_value = amqpvalue_get_list_item(list_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 1855 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1856 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1857 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1858 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1859 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1860 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1861 | const char* desired_capabilities; |
Azure.IoT Build | 0:6ae2f7bca550 | 1862 | AMQP_VALUE desired_capabilities_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 1863 | if ((amqpvalue_get_array(item_value, &desired_capabilities_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 1864 | (amqpvalue_get_symbol(item_value, &desired_capabilities) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 1865 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1866 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1867 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1868 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1869 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1870 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1871 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1872 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1873 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1874 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1875 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1876 | /* properties */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1877 | item_value = amqpvalue_get_list_item(list_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 1878 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1879 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1880 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 1881 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1882 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1883 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1884 | fields properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 1885 | if (amqpvalue_get_fields(item_value, &properties) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1886 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1887 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1888 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1889 | begin_destroy(*begin_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 1890 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1891 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 1892 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1893 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1894 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1895 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1896 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1897 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1898 | begin_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1899 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1900 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1901 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 1902 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1903 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1904 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1905 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1906 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1907 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1908 | int begin_get_remote_channel(BEGIN_HANDLE begin, uint16_t* remote_channel_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1909 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1910 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1911 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1912 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1913 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1914 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1915 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1916 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1917 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1918 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 1919 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(begin_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 1920 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1921 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1922 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1923 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1924 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1925 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1926 | if (amqpvalue_get_ushort(item_value, remote_channel_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1927 | { |
AzureIoTClient | 16:22a72cf8e416 | 1928 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1929 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1930 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1931 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1932 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1933 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1934 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1935 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1936 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1937 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1938 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1939 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1940 | int begin_set_remote_channel(BEGIN_HANDLE begin, uint16_t remote_channel_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1941 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1942 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1943 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1944 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1945 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1946 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1947 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1948 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1949 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1950 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 1951 | AMQP_VALUE remote_channel_amqp_value = amqpvalue_create_ushort(remote_channel_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1952 | if (remote_channel_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1953 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1954 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1955 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1956 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1957 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1958 | if (amqpvalue_set_composite_item(begin_instance->composite_value, 0, remote_channel_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1959 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1960 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1961 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1962 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1963 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1964 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1965 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1966 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1967 | amqpvalue_destroy(remote_channel_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 1968 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1969 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1970 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1971 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1972 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1973 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1974 | int begin_get_next_outgoing_id(BEGIN_HANDLE begin, transfer_number* next_outgoing_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 1975 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1976 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 1977 | |
Azure.IoT Build | 0:6ae2f7bca550 | 1978 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1979 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1980 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1981 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1982 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1983 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1984 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 1985 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(begin_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 1986 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 1987 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1988 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1989 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1990 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1991 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1992 | if (amqpvalue_get_transfer_number(item_value, next_outgoing_id_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 1993 | { |
AzureIoTClient | 16:22a72cf8e416 | 1994 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 1995 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 1996 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 1997 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 1998 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 1999 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2000 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2001 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2002 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2003 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2004 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2005 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2006 | int begin_set_next_outgoing_id(BEGIN_HANDLE begin, transfer_number next_outgoing_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2007 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2008 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2009 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2010 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2011 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2012 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2013 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2014 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2015 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2016 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2017 | AMQP_VALUE next_outgoing_id_amqp_value = amqpvalue_create_transfer_number(next_outgoing_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2018 | if (next_outgoing_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2019 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2020 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2021 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2022 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2023 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2024 | if (amqpvalue_set_composite_item(begin_instance->composite_value, 1, next_outgoing_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2025 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2026 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2027 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2028 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2029 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2030 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2031 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2032 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2033 | amqpvalue_destroy(next_outgoing_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2034 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2035 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2036 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2037 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2038 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2039 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2040 | int begin_get_incoming_window(BEGIN_HANDLE begin, uint32_t* incoming_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2041 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2042 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2043 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2044 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2045 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2046 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2047 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2048 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2049 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2050 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2051 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(begin_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 2052 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2053 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2054 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2055 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2056 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2057 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2058 | if (amqpvalue_get_uint(item_value, incoming_window_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2059 | { |
AzureIoTClient | 16:22a72cf8e416 | 2060 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2061 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2062 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2063 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2064 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2065 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2066 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2067 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2068 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2069 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2070 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2071 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2072 | int begin_set_incoming_window(BEGIN_HANDLE begin, uint32_t incoming_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2073 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2074 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2075 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2076 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2077 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2078 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2079 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2080 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2081 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2082 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2083 | AMQP_VALUE incoming_window_amqp_value = amqpvalue_create_uint(incoming_window_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2084 | if (incoming_window_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2085 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2086 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2087 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2088 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2089 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2090 | if (amqpvalue_set_composite_item(begin_instance->composite_value, 2, incoming_window_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2091 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2092 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2093 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2094 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2095 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2096 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2097 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2098 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2099 | amqpvalue_destroy(incoming_window_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2100 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2101 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2102 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2103 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2104 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2105 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2106 | int begin_get_outgoing_window(BEGIN_HANDLE begin, uint32_t* outgoing_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2107 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2108 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2109 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2110 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2111 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2112 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2113 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2114 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2115 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2116 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2117 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(begin_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 2118 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2119 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2120 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2121 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2122 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2123 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2124 | if (amqpvalue_get_uint(item_value, outgoing_window_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2125 | { |
AzureIoTClient | 16:22a72cf8e416 | 2126 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2127 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2128 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2129 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2130 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2131 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2132 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2133 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2134 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2135 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2136 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2137 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2138 | int begin_set_outgoing_window(BEGIN_HANDLE begin, uint32_t outgoing_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2139 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2140 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2141 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2142 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2143 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2144 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2145 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2146 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2147 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2148 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2149 | AMQP_VALUE outgoing_window_amqp_value = amqpvalue_create_uint(outgoing_window_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2150 | if (outgoing_window_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2151 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2152 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2153 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2154 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2155 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2156 | if (amqpvalue_set_composite_item(begin_instance->composite_value, 3, outgoing_window_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2157 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2158 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2159 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2160 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2161 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2162 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2163 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2164 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2165 | amqpvalue_destroy(outgoing_window_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2166 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2167 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2168 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2169 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2170 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2171 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2172 | int begin_get_handle_max(BEGIN_HANDLE begin, handle* handle_max_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2173 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2174 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2175 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2176 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2177 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2178 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2179 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2180 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2181 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2182 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2183 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(begin_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 2184 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2185 | { |
AzureIoTClient | 16:22a72cf8e416 | 2186 | *handle_max_value = 4294967295u; |
AzureIoTClient | 16:22a72cf8e416 | 2187 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2188 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2189 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2190 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2191 | if (amqpvalue_get_handle(item_value, handle_max_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2192 | { |
AzureIoTClient | 16:22a72cf8e416 | 2193 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 2194 | { |
AzureIoTClient | 16:22a72cf8e416 | 2195 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 2196 | } |
AzureIoTClient | 16:22a72cf8e416 | 2197 | else |
AzureIoTClient | 16:22a72cf8e416 | 2198 | { |
AzureIoTClient | 16:22a72cf8e416 | 2199 | *handle_max_value = 4294967295u; |
AzureIoTClient | 16:22a72cf8e416 | 2200 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 2201 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2202 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2203 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2204 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2205 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2206 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2207 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2208 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2209 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2210 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2211 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2212 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2213 | int begin_set_handle_max(BEGIN_HANDLE begin, handle handle_max_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2214 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2215 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2216 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2217 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2218 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2219 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2220 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2221 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2222 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2223 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2224 | AMQP_VALUE handle_max_amqp_value = amqpvalue_create_handle(handle_max_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2225 | if (handle_max_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2226 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2227 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2228 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2229 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2230 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2231 | if (amqpvalue_set_composite_item(begin_instance->composite_value, 4, handle_max_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2232 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2233 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2234 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2235 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2236 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2237 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2238 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2239 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2240 | amqpvalue_destroy(handle_max_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2241 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2242 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2243 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2244 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2245 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2246 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2247 | int begin_get_offered_capabilities(BEGIN_HANDLE begin, AMQP_VALUE* offered_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2248 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2249 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2250 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2251 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2252 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2253 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2254 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2255 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2256 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2257 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2258 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(begin_instance->composite_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 2259 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2260 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2261 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2262 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2263 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2264 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2265 | if (amqpvalue_get_array(item_value, offered_capabilities_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2266 | { |
AzureIoTClient | 16:22a72cf8e416 | 2267 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2268 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2269 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2270 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2271 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2272 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2273 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2274 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2275 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2276 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2277 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2278 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2279 | int begin_set_offered_capabilities(BEGIN_HANDLE begin, AMQP_VALUE offered_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2280 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2281 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2282 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2283 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2284 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2285 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2286 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2287 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2288 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2289 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2290 | AMQP_VALUE offered_capabilities_amqp_value = amqpvalue_clone(offered_capabilities_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2291 | if (offered_capabilities_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2292 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2293 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2294 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2295 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2296 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2297 | if (amqpvalue_set_composite_item(begin_instance->composite_value, 5, offered_capabilities_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2298 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2299 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2300 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2301 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2302 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2303 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2304 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2305 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2306 | amqpvalue_destroy(offered_capabilities_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2307 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2308 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2309 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2310 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2311 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2312 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2313 | int begin_get_desired_capabilities(BEGIN_HANDLE begin, AMQP_VALUE* desired_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2314 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2315 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2316 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2317 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2318 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2319 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2320 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2321 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2322 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2323 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2324 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(begin_instance->composite_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 2325 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2326 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2327 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2328 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2329 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2330 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2331 | if (amqpvalue_get_array(item_value, desired_capabilities_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2332 | { |
AzureIoTClient | 16:22a72cf8e416 | 2333 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2334 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2335 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2336 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2337 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2338 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2339 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2340 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2341 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2342 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2343 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2344 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2345 | int begin_set_desired_capabilities(BEGIN_HANDLE begin, AMQP_VALUE desired_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2346 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2347 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2348 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2349 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2350 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2351 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2352 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2353 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2354 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2355 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2356 | AMQP_VALUE desired_capabilities_amqp_value = amqpvalue_clone(desired_capabilities_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2357 | if (desired_capabilities_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2358 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2359 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2360 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2361 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2362 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2363 | if (amqpvalue_set_composite_item(begin_instance->composite_value, 6, desired_capabilities_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2364 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2365 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2366 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2367 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2368 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2369 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2370 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2371 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2372 | amqpvalue_destroy(desired_capabilities_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2373 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2374 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2375 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2376 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2377 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2378 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2379 | int begin_get_properties(BEGIN_HANDLE begin, fields* properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2380 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2381 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2382 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2383 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2384 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2385 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2386 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2387 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2388 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2389 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2390 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(begin_instance->composite_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 2391 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2392 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2393 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2394 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2395 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2396 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2397 | if (amqpvalue_get_fields(item_value, properties_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2398 | { |
AzureIoTClient | 16:22a72cf8e416 | 2399 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2400 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2401 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2402 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2403 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2404 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2405 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2406 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2407 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2408 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2409 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2410 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2411 | int begin_set_properties(BEGIN_HANDLE begin, fields properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2412 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2413 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2414 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2415 | if (begin == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2416 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2417 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2418 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2419 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2420 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2421 | BEGIN_INSTANCE* begin_instance = (BEGIN_INSTANCE*)begin; |
Azure.IoT Build | 0:6ae2f7bca550 | 2422 | AMQP_VALUE properties_amqp_value = amqpvalue_create_fields(properties_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2423 | if (properties_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2424 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2425 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2426 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2427 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2428 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2429 | if (amqpvalue_set_composite_item(begin_instance->composite_value, 7, properties_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2430 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2431 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2432 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2433 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2434 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2435 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2436 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2437 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2438 | amqpvalue_destroy(properties_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2439 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2440 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2441 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2442 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2443 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2444 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2445 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2446 | /* attach */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2447 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2448 | typedef struct ATTACH_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 2449 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2450 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 2451 | } ATTACH_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 2452 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2453 | static ATTACH_HANDLE attach_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 2454 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2455 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)amqpalloc_malloc(sizeof(ATTACH_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 2456 | if (attach_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2457 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2458 | attach_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 2459 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2460 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2461 | return attach_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 2462 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2463 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2464 | ATTACH_HANDLE attach_create(const char* name_value, handle handle_value, role role_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2465 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2466 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)amqpalloc_malloc(sizeof(ATTACH_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 2467 | if (attach_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2468 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2469 | attach_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(18); |
Azure.IoT Build | 0:6ae2f7bca550 | 2470 | if (attach_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2471 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2472 | amqpalloc_free(attach_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 2473 | attach_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 2474 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2475 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2476 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2477 | AMQP_VALUE name_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 2478 | AMQP_VALUE handle_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 2479 | AMQP_VALUE role_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 2480 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2481 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2482 | name_amqp_value = amqpvalue_create_string(name_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2483 | if ((result == 0) && (amqpvalue_set_composite_item(attach_instance->composite_value, 0, name_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 2484 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2485 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2486 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2487 | handle_amqp_value = amqpvalue_create_handle(handle_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2488 | if ((result == 0) && (amqpvalue_set_composite_item(attach_instance->composite_value, 1, handle_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 2489 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2490 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2491 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2492 | role_amqp_value = amqpvalue_create_role(role_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2493 | if ((result == 0) && (amqpvalue_set_composite_item(attach_instance->composite_value, 2, role_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 2494 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2495 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2496 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2497 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2498 | amqpvalue_destroy(name_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2499 | amqpvalue_destroy(handle_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2500 | amqpvalue_destroy(role_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2501 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2502 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2503 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2504 | return attach_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 2505 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2506 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2507 | ATTACH_HANDLE attach_clone(ATTACH_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2508 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2509 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)amqpalloc_malloc(sizeof(ATTACH_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 2510 | if (attach_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2511 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2512 | attach_instance->composite_value = amqpvalue_clone(((ATTACH_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2513 | if (attach_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2514 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2515 | amqpalloc_free(attach_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 2516 | attach_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 2517 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2518 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2519 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2520 | return attach_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 2521 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2522 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2523 | void attach_destroy(ATTACH_HANDLE attach) |
Azure.IoT Build | 0:6ae2f7bca550 | 2524 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2525 | if (attach != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2526 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2527 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 2528 | amqpvalue_destroy(attach_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2529 | amqpalloc_free(attach_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 2530 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2531 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2532 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2533 | AMQP_VALUE amqpvalue_create_attach(ATTACH_HANDLE attach) |
Azure.IoT Build | 0:6ae2f7bca550 | 2534 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2535 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2536 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2537 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2538 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2539 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 2540 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2541 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2542 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2543 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 2544 | result = amqpvalue_clone(attach_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2545 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2546 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2547 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2548 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2549 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2550 | bool is_attach_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 2551 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2552 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2553 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2554 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 2555 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 2556 | (descriptor_ulong == 18)) |
Azure.IoT Build | 0:6ae2f7bca550 | 2557 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2558 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 2559 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2560 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2561 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2562 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 2563 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2564 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2565 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2566 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2567 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2568 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2569 | int amqpvalue_get_attach(AMQP_VALUE value, ATTACH_HANDLE* attach_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 2570 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2571 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2572 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 2573 | *attach_handle = attach_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 2574 | if (*attach_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2575 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2576 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2577 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2578 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2579 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2580 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2581 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2582 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2583 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2584 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2585 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2586 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2587 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2588 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 2589 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2590 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 2591 | /* name */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2592 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 2593 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2594 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2595 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2596 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2597 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2598 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2599 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2600 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2601 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2602 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2603 | const char* name; |
Azure.IoT Build | 0:6ae2f7bca550 | 2604 | if (amqpvalue_get_string(item_value, &name) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2605 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2606 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2607 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2608 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2609 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2610 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2611 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2612 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2613 | /* handle */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2614 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 2615 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2616 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2617 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2618 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2619 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2620 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2621 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2622 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2623 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2624 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2625 | handle handle; |
Azure.IoT Build | 0:6ae2f7bca550 | 2626 | if (amqpvalue_get_handle(item_value, &handle) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2627 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2628 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2629 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2630 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2631 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2632 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2633 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2634 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2635 | /* role */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2636 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 2637 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2638 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2639 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2640 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2641 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2642 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2643 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2644 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2645 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2646 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2647 | role role; |
Azure.IoT Build | 0:6ae2f7bca550 | 2648 | if (amqpvalue_get_role(item_value, &role) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2649 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2650 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2651 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2652 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2653 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2654 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2655 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2656 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2657 | /* snd-settle-mode */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2658 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 2659 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2660 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2661 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2662 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2663 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2664 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2665 | sender_settle_mode snd_settle_mode; |
Azure.IoT Build | 0:6ae2f7bca550 | 2666 | if (amqpvalue_get_sender_settle_mode(item_value, &snd_settle_mode) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2667 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2668 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2669 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2670 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2671 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2672 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2673 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2674 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2675 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2676 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2677 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2678 | /* rcv-settle-mode */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2679 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 2680 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2681 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2682 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2683 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2684 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2685 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2686 | receiver_settle_mode rcv_settle_mode; |
Azure.IoT Build | 0:6ae2f7bca550 | 2687 | if (amqpvalue_get_receiver_settle_mode(item_value, &rcv_settle_mode) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2688 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2689 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2690 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2691 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2692 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2693 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2694 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2695 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2696 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2697 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2698 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2699 | /* source */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2700 | item_value = amqpvalue_get_list_item(list_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 2701 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2702 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2703 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2704 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2705 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2706 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2707 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2708 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2709 | /* target */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2710 | item_value = amqpvalue_get_list_item(list_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 2711 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2712 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2713 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2714 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2715 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2716 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2717 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2718 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2719 | /* unsettled */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2720 | item_value = amqpvalue_get_list_item(list_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 2721 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2722 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2723 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2724 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2725 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2726 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2727 | AMQP_VALUE unsettled; |
Azure.IoT Build | 0:6ae2f7bca550 | 2728 | if (amqpvalue_get_map(item_value, &unsettled) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2729 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2730 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2731 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2732 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2733 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2734 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2735 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2736 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2737 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2738 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2739 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2740 | /* incomplete-unsettled */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2741 | item_value = amqpvalue_get_list_item(list_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 2742 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2743 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2744 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2745 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2746 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2747 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2748 | bool incomplete_unsettled; |
Azure.IoT Build | 0:6ae2f7bca550 | 2749 | if (amqpvalue_get_boolean(item_value, &incomplete_unsettled) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2750 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2751 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2752 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2753 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2754 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2755 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2756 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2757 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2758 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2759 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2760 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2761 | /* initial-delivery-count */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2762 | item_value = amqpvalue_get_list_item(list_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 2763 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2764 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2765 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2766 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2767 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2768 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2769 | sequence_no initial_delivery_count; |
Azure.IoT Build | 0:6ae2f7bca550 | 2770 | if (amqpvalue_get_sequence_no(item_value, &initial_delivery_count) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2771 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2772 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2773 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2774 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2775 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2776 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2777 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2778 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2779 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2780 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2781 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2782 | /* max-message-size */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2783 | item_value = amqpvalue_get_list_item(list_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 2784 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2785 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2786 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2787 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2788 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2789 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2790 | uint64_t max_message_size; |
Azure.IoT Build | 0:6ae2f7bca550 | 2791 | if (amqpvalue_get_ulong(item_value, &max_message_size) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2792 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2793 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2794 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2795 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2796 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2797 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2798 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2799 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2800 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2801 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2802 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2803 | /* offered-capabilities */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2804 | item_value = amqpvalue_get_list_item(list_value, 11); |
Azure.IoT Build | 0:6ae2f7bca550 | 2805 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2806 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2807 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2808 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2809 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2810 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2811 | const char* offered_capabilities; |
Azure.IoT Build | 0:6ae2f7bca550 | 2812 | AMQP_VALUE offered_capabilities_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 2813 | if ((amqpvalue_get_array(item_value, &offered_capabilities_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 2814 | (amqpvalue_get_symbol(item_value, &offered_capabilities) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 2815 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2816 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2817 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2818 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2819 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2820 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2821 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2822 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2823 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2824 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2825 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2826 | /* desired-capabilities */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2827 | item_value = amqpvalue_get_list_item(list_value, 12); |
Azure.IoT Build | 0:6ae2f7bca550 | 2828 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2829 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2830 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2831 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2832 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2833 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2834 | const char* desired_capabilities; |
Azure.IoT Build | 0:6ae2f7bca550 | 2835 | AMQP_VALUE desired_capabilities_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 2836 | if ((amqpvalue_get_array(item_value, &desired_capabilities_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 2837 | (amqpvalue_get_symbol(item_value, &desired_capabilities) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 2838 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2839 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2840 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2841 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2842 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2843 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2844 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2845 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2846 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2847 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2848 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2849 | /* properties */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2850 | item_value = amqpvalue_get_list_item(list_value, 13); |
Azure.IoT Build | 0:6ae2f7bca550 | 2851 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2852 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2853 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 2854 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2855 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2856 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2857 | fields properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 2858 | if (amqpvalue_get_fields(item_value, &properties) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2859 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2860 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2861 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2862 | attach_destroy(*attach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 2863 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2864 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 2865 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2866 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2867 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2868 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2869 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2870 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2871 | attach_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2872 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2873 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2874 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 2875 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2876 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2877 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2878 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2879 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2880 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2881 | int attach_get_name(ATTACH_HANDLE attach, const char** name_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2882 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2883 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2884 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2885 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2886 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2887 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2888 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2889 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2890 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2891 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 2892 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 2893 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2894 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2895 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2896 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2897 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2898 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2899 | if (amqpvalue_get_string(item_value, name_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2900 | { |
AzureIoTClient | 16:22a72cf8e416 | 2901 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2902 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2903 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2904 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2905 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2906 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2907 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2908 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2909 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2910 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2911 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2912 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2913 | int attach_set_name(ATTACH_HANDLE attach, const char* name_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2914 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2915 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2916 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2917 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2918 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2919 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2920 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2921 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2922 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2923 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 2924 | AMQP_VALUE name_amqp_value = amqpvalue_create_string(name_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2925 | if (name_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2926 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2927 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2928 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2929 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2930 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2931 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 0, name_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2932 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2933 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2934 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2935 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2936 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2937 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2938 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2939 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2940 | amqpvalue_destroy(name_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2941 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2942 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2943 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2944 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2945 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2946 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2947 | int attach_get_handle(ATTACH_HANDLE attach, handle* handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2948 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2949 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2950 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2951 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2952 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2953 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2954 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2955 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2956 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2957 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 2958 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 2959 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2960 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2961 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2962 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2963 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2964 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2965 | if (amqpvalue_get_handle(item_value, handle_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2966 | { |
AzureIoTClient | 16:22a72cf8e416 | 2967 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2968 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2969 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2970 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2971 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 2972 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2973 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2974 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2975 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2976 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2977 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2978 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2979 | int attach_set_handle(ATTACH_HANDLE attach, handle handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 2980 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2981 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 2982 | |
Azure.IoT Build | 0:6ae2f7bca550 | 2983 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2984 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2985 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2986 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2987 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2988 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2989 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 2990 | AMQP_VALUE handle_amqp_value = amqpvalue_create_handle(handle_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 2991 | if (handle_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 2992 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2993 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 2994 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 2995 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 2996 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2997 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 1, handle_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 2998 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 2999 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3000 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3001 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3002 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3003 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3004 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3005 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3006 | amqpvalue_destroy(handle_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3007 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3008 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3009 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3010 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3011 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3012 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3013 | int attach_get_role(ATTACH_HANDLE attach, role* role_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3014 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3015 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3016 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3017 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3018 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3019 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3020 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3021 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3022 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3023 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3024 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 3025 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3026 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3027 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3028 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3029 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3030 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3031 | if (amqpvalue_get_role(item_value, role_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3032 | { |
AzureIoTClient | 16:22a72cf8e416 | 3033 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3034 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3035 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3036 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3037 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3038 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3039 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3040 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3041 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3042 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3043 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3044 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3045 | int attach_set_role(ATTACH_HANDLE attach, role role_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3046 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3047 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3048 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3049 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3050 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3051 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3052 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3053 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3054 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3055 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3056 | AMQP_VALUE role_amqp_value = amqpvalue_create_role(role_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3057 | if (role_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3058 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3059 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3060 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3061 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3062 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3063 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 2, role_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3064 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3065 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3066 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3067 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3068 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3069 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3070 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3071 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3072 | amqpvalue_destroy(role_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3073 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3074 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3075 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3076 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3077 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3078 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3079 | int attach_get_snd_settle_mode(ATTACH_HANDLE attach, sender_settle_mode* snd_settle_mode_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3080 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3081 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3082 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3083 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3084 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3085 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3086 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3087 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3088 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3089 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3090 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 3091 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3092 | { |
AzureIoTClient | 16:22a72cf8e416 | 3093 | *snd_settle_mode_value = sender_settle_mode_mixed; |
AzureIoTClient | 16:22a72cf8e416 | 3094 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3095 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3096 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3097 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3098 | if (amqpvalue_get_sender_settle_mode(item_value, snd_settle_mode_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3099 | { |
AzureIoTClient | 16:22a72cf8e416 | 3100 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 3101 | { |
AzureIoTClient | 16:22a72cf8e416 | 3102 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 3103 | } |
AzureIoTClient | 16:22a72cf8e416 | 3104 | else |
AzureIoTClient | 16:22a72cf8e416 | 3105 | { |
AzureIoTClient | 16:22a72cf8e416 | 3106 | *snd_settle_mode_value = sender_settle_mode_mixed; |
AzureIoTClient | 16:22a72cf8e416 | 3107 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 3108 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3109 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3110 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3111 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3112 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3113 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3114 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3115 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3116 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3117 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3118 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3119 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3120 | int attach_set_snd_settle_mode(ATTACH_HANDLE attach, sender_settle_mode snd_settle_mode_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3121 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3122 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3123 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3124 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3125 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3126 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3127 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3128 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3129 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3130 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3131 | AMQP_VALUE snd_settle_mode_amqp_value = amqpvalue_create_sender_settle_mode(snd_settle_mode_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3132 | if (snd_settle_mode_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3133 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3134 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3135 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3136 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3137 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3138 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 3, snd_settle_mode_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3139 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3140 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3141 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3142 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3143 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3144 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3145 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3146 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3147 | amqpvalue_destroy(snd_settle_mode_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3148 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3149 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3150 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3151 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3152 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3153 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3154 | int attach_get_rcv_settle_mode(ATTACH_HANDLE attach, receiver_settle_mode* rcv_settle_mode_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3155 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3156 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3157 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3158 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3159 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3160 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3161 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3162 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3163 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3164 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3165 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 3166 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3167 | { |
AzureIoTClient | 16:22a72cf8e416 | 3168 | *rcv_settle_mode_value = receiver_settle_mode_first; |
AzureIoTClient | 16:22a72cf8e416 | 3169 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3170 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3171 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3172 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3173 | if (amqpvalue_get_receiver_settle_mode(item_value, rcv_settle_mode_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3174 | { |
AzureIoTClient | 16:22a72cf8e416 | 3175 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 3176 | { |
AzureIoTClient | 16:22a72cf8e416 | 3177 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 3178 | } |
AzureIoTClient | 16:22a72cf8e416 | 3179 | else |
AzureIoTClient | 16:22a72cf8e416 | 3180 | { |
AzureIoTClient | 16:22a72cf8e416 | 3181 | *rcv_settle_mode_value = receiver_settle_mode_first; |
AzureIoTClient | 16:22a72cf8e416 | 3182 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 3183 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3184 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3185 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3186 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3187 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3188 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3189 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3190 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3191 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3192 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3193 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3194 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3195 | int attach_set_rcv_settle_mode(ATTACH_HANDLE attach, receiver_settle_mode rcv_settle_mode_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3196 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3197 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3198 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3199 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3200 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3201 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3202 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3203 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3204 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3205 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3206 | AMQP_VALUE rcv_settle_mode_amqp_value = amqpvalue_create_receiver_settle_mode(rcv_settle_mode_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3207 | if (rcv_settle_mode_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3208 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3209 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3210 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3211 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3212 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3213 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 4, rcv_settle_mode_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3214 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3215 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3216 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3217 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3218 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3219 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3220 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3221 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3222 | amqpvalue_destroy(rcv_settle_mode_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3223 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3224 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3225 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3226 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3227 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3228 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3229 | int attach_get_source(ATTACH_HANDLE attach, AMQP_VALUE* source_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3230 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3231 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3232 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3233 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3234 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3235 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3236 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3237 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3238 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3239 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3240 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 3241 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3242 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3243 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3244 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3245 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3246 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3247 | *source_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 3248 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3249 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3250 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3251 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3252 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3253 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3254 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3255 | int attach_set_source(ATTACH_HANDLE attach, AMQP_VALUE source_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3256 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3257 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3258 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3259 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3260 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3261 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3262 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3263 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3264 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3265 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3266 | AMQP_VALUE source_amqp_value = amqpvalue_clone(source_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3267 | if (source_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3268 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3269 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3270 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3271 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3272 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3273 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 5, source_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3274 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3275 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3276 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3277 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3278 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3279 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3280 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3281 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3282 | amqpvalue_destroy(source_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3283 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3284 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3285 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3286 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3287 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3288 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3289 | int attach_get_target(ATTACH_HANDLE attach, AMQP_VALUE* target_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3290 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3291 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3292 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3293 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3294 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3295 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3296 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3297 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3298 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3299 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3300 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 3301 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3302 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3303 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3304 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3305 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3306 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3307 | *target_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 3308 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3309 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3310 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3311 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3312 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3313 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3314 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3315 | int attach_set_target(ATTACH_HANDLE attach, AMQP_VALUE target_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3316 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3317 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3318 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3319 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3320 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3321 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3322 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3323 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3324 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3325 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3326 | AMQP_VALUE target_amqp_value = amqpvalue_clone(target_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3327 | if (target_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3328 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3329 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3330 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3331 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3332 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3333 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 6, target_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3334 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3335 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3336 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3337 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3338 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3339 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3340 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3341 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3342 | amqpvalue_destroy(target_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3343 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3344 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3345 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3346 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3347 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3348 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3349 | int attach_get_unsettled(ATTACH_HANDLE attach, AMQP_VALUE* unsettled_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3350 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3351 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3352 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3353 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3354 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3355 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3356 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3357 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3358 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3359 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3360 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 3361 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3362 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3363 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3364 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3365 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3366 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3367 | if (amqpvalue_get_map(item_value, unsettled_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3368 | { |
AzureIoTClient | 16:22a72cf8e416 | 3369 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3370 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3371 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3372 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3373 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3374 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3375 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3376 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3377 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3378 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3379 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3380 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3381 | int attach_set_unsettled(ATTACH_HANDLE attach, AMQP_VALUE unsettled_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3382 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3383 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3384 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3385 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3386 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3387 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3388 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3389 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3390 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3391 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3392 | AMQP_VALUE unsettled_amqp_value = amqpvalue_clone(unsettled_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3393 | if (unsettled_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3394 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3395 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3396 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3397 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3398 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3399 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 7, unsettled_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3400 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3401 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3402 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3403 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3404 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3405 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3406 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3407 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3408 | amqpvalue_destroy(unsettled_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3409 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3410 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3411 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3412 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3413 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3414 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3415 | int attach_get_incomplete_unsettled(ATTACH_HANDLE attach, bool* incomplete_unsettled_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3416 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3417 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3418 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3419 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3420 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3421 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3422 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3423 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3424 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3425 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3426 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 3427 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3428 | { |
AzureIoTClient | 16:22a72cf8e416 | 3429 | *incomplete_unsettled_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 3430 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3431 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3432 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3433 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3434 | if (amqpvalue_get_boolean(item_value, incomplete_unsettled_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3435 | { |
AzureIoTClient | 16:22a72cf8e416 | 3436 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 3437 | { |
AzureIoTClient | 16:22a72cf8e416 | 3438 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 3439 | } |
AzureIoTClient | 16:22a72cf8e416 | 3440 | else |
AzureIoTClient | 16:22a72cf8e416 | 3441 | { |
AzureIoTClient | 16:22a72cf8e416 | 3442 | *incomplete_unsettled_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 3443 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 3444 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3445 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3446 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3447 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3448 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3449 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3450 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3451 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3452 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3453 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3454 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3455 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3456 | int attach_set_incomplete_unsettled(ATTACH_HANDLE attach, bool incomplete_unsettled_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3457 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3458 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3459 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3460 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3461 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3462 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3463 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3464 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3465 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3466 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3467 | AMQP_VALUE incomplete_unsettled_amqp_value = amqpvalue_create_boolean(incomplete_unsettled_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3468 | if (incomplete_unsettled_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3469 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3470 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3471 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3472 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3473 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3474 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 8, incomplete_unsettled_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3475 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3476 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3477 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3478 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3479 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3480 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3481 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3482 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3483 | amqpvalue_destroy(incomplete_unsettled_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3484 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3485 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3486 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3487 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3488 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3489 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3490 | int attach_get_initial_delivery_count(ATTACH_HANDLE attach, sequence_no* initial_delivery_count_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3491 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3492 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3493 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3494 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3495 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3496 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3497 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3498 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3499 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3500 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3501 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 3502 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3503 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3504 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3505 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3506 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3507 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3508 | if (amqpvalue_get_sequence_no(item_value, initial_delivery_count_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3509 | { |
AzureIoTClient | 16:22a72cf8e416 | 3510 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3511 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3512 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3513 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3514 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3515 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3516 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3517 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3518 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3519 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3520 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3521 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3522 | int attach_set_initial_delivery_count(ATTACH_HANDLE attach, sequence_no initial_delivery_count_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3523 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3524 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3525 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3526 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3527 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3528 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3529 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3530 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3531 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3532 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3533 | AMQP_VALUE initial_delivery_count_amqp_value = amqpvalue_create_sequence_no(initial_delivery_count_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3534 | if (initial_delivery_count_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3535 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3536 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3537 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3538 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3539 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3540 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 9, initial_delivery_count_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3541 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3542 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3543 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3544 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3545 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3546 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3547 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3548 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3549 | amqpvalue_destroy(initial_delivery_count_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3550 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3551 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3552 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3553 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3554 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3555 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3556 | int attach_get_max_message_size(ATTACH_HANDLE attach, uint64_t* max_message_size_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3557 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3558 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3559 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3560 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3561 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3562 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3563 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3564 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3565 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3566 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3567 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 3568 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3569 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3570 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3571 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3572 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3573 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3574 | if (amqpvalue_get_ulong(item_value, max_message_size_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3575 | { |
AzureIoTClient | 16:22a72cf8e416 | 3576 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3577 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3578 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3579 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3580 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3581 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3582 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3583 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3584 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3585 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3586 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3587 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3588 | int attach_set_max_message_size(ATTACH_HANDLE attach, uint64_t max_message_size_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3589 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3590 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3591 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3592 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3593 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3594 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3595 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3596 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3597 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3598 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3599 | AMQP_VALUE max_message_size_amqp_value = amqpvalue_create_ulong(max_message_size_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3600 | if (max_message_size_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3601 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3602 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3603 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3604 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3605 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3606 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 10, max_message_size_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3607 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3608 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3609 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3610 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3611 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3612 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3613 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3614 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3615 | amqpvalue_destroy(max_message_size_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3616 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3617 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3618 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3619 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3620 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3621 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3622 | int attach_get_offered_capabilities(ATTACH_HANDLE attach, AMQP_VALUE* offered_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3623 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3624 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3625 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3626 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3627 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3628 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3629 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3630 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3631 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3632 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3633 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 11); |
Azure.IoT Build | 0:6ae2f7bca550 | 3634 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3635 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3636 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3637 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3638 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3639 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3640 | if (amqpvalue_get_array(item_value, offered_capabilities_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3641 | { |
AzureIoTClient | 16:22a72cf8e416 | 3642 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3643 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3644 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3645 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3646 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3647 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3648 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3649 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3650 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3651 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3652 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3653 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3654 | int attach_set_offered_capabilities(ATTACH_HANDLE attach, AMQP_VALUE offered_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3655 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3656 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3657 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3658 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3659 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3660 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3661 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3662 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3663 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3664 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3665 | AMQP_VALUE offered_capabilities_amqp_value = amqpvalue_clone(offered_capabilities_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3666 | if (offered_capabilities_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3667 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3668 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3669 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3670 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3671 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3672 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 11, offered_capabilities_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3673 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3674 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3675 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3676 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3677 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3678 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3679 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3680 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3681 | amqpvalue_destroy(offered_capabilities_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3682 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3683 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3684 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3685 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3686 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3687 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3688 | int attach_get_desired_capabilities(ATTACH_HANDLE attach, AMQP_VALUE* desired_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3689 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3690 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3691 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3692 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3693 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3694 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3695 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3696 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3697 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3698 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3699 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 12); |
Azure.IoT Build | 0:6ae2f7bca550 | 3700 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3701 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3702 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3703 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3704 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3705 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3706 | if (amqpvalue_get_array(item_value, desired_capabilities_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3707 | { |
AzureIoTClient | 16:22a72cf8e416 | 3708 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3709 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3710 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3711 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3712 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3713 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3714 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3715 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3716 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3717 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3718 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3719 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3720 | int attach_set_desired_capabilities(ATTACH_HANDLE attach, AMQP_VALUE desired_capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3721 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3722 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3723 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3724 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3725 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3726 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3727 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3728 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3729 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3730 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3731 | AMQP_VALUE desired_capabilities_amqp_value = amqpvalue_clone(desired_capabilities_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3732 | if (desired_capabilities_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3733 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3734 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3735 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3736 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3737 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3738 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 12, desired_capabilities_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3739 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3740 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3741 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3742 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3743 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3744 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3745 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3746 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3747 | amqpvalue_destroy(desired_capabilities_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3748 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3749 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3750 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3751 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3752 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3753 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3754 | int attach_get_properties(ATTACH_HANDLE attach, fields* properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3755 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3756 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3757 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3758 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3759 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3760 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3761 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3762 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3763 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3764 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3765 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(attach_instance->composite_value, 13); |
Azure.IoT Build | 0:6ae2f7bca550 | 3766 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3767 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3768 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3769 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3770 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3771 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3772 | if (amqpvalue_get_fields(item_value, properties_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3773 | { |
AzureIoTClient | 16:22a72cf8e416 | 3774 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3775 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3776 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3777 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3778 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3779 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3780 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3781 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3782 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3783 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3784 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3785 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3786 | int attach_set_properties(ATTACH_HANDLE attach, fields properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3787 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3788 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3789 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3790 | if (attach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3791 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3792 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3793 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3794 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3795 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3796 | ATTACH_INSTANCE* attach_instance = (ATTACH_INSTANCE*)attach; |
Azure.IoT Build | 0:6ae2f7bca550 | 3797 | AMQP_VALUE properties_amqp_value = amqpvalue_create_fields(properties_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3798 | if (properties_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3799 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3800 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3801 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3802 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3803 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3804 | if (amqpvalue_set_composite_item(attach_instance->composite_value, 13, properties_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3805 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3806 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3807 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3808 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3809 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3810 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3811 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3812 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3813 | amqpvalue_destroy(properties_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3814 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3815 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3816 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3817 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3818 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3819 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3820 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3821 | /* flow */ |
Azure.IoT Build | 0:6ae2f7bca550 | 3822 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3823 | typedef struct FLOW_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 3824 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3825 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 3826 | } FLOW_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 3827 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3828 | static FLOW_HANDLE flow_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 3829 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3830 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)amqpalloc_malloc(sizeof(FLOW_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 3831 | if (flow_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3832 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3833 | flow_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 3834 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3835 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3836 | return flow_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 3837 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3838 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3839 | FLOW_HANDLE flow_create(uint32_t incoming_window_value, transfer_number next_outgoing_id_value, uint32_t outgoing_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3840 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3841 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)amqpalloc_malloc(sizeof(FLOW_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 3842 | if (flow_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3843 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3844 | flow_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(19); |
Azure.IoT Build | 0:6ae2f7bca550 | 3845 | if (flow_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3846 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3847 | amqpalloc_free(flow_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 3848 | flow_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 3849 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3850 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3851 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3852 | AMQP_VALUE incoming_window_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 3853 | AMQP_VALUE next_outgoing_id_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 3854 | AMQP_VALUE outgoing_window_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 3855 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 3856 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3857 | incoming_window_amqp_value = amqpvalue_create_uint(incoming_window_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3858 | if ((result == 0) && (amqpvalue_set_composite_item(flow_instance->composite_value, 1, incoming_window_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 3859 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3860 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3861 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3862 | next_outgoing_id_amqp_value = amqpvalue_create_transfer_number(next_outgoing_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3863 | if ((result == 0) && (amqpvalue_set_composite_item(flow_instance->composite_value, 2, next_outgoing_id_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 3864 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3865 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3866 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3867 | outgoing_window_amqp_value = amqpvalue_create_uint(outgoing_window_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3868 | if ((result == 0) && (amqpvalue_set_composite_item(flow_instance->composite_value, 3, outgoing_window_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 3869 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3870 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3871 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3872 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3873 | amqpvalue_destroy(incoming_window_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3874 | amqpvalue_destroy(next_outgoing_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3875 | amqpvalue_destroy(outgoing_window_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3876 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3877 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3878 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3879 | return flow_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 3880 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3881 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3882 | FLOW_HANDLE flow_clone(FLOW_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 3883 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3884 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)amqpalloc_malloc(sizeof(FLOW_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 3885 | if (flow_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3886 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3887 | flow_instance->composite_value = amqpvalue_clone(((FLOW_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3888 | if (flow_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3889 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3890 | amqpalloc_free(flow_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 3891 | flow_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 3892 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3893 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3894 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3895 | return flow_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 3896 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3897 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3898 | void flow_destroy(FLOW_HANDLE flow) |
Azure.IoT Build | 0:6ae2f7bca550 | 3899 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3900 | if (flow != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3901 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3902 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 3903 | amqpvalue_destroy(flow_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3904 | amqpalloc_free(flow_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 3905 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3906 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3907 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3908 | AMQP_VALUE amqpvalue_create_flow(FLOW_HANDLE flow) |
Azure.IoT Build | 0:6ae2f7bca550 | 3909 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3910 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3911 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3912 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3913 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3914 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 3915 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3916 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3917 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3918 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 3919 | result = amqpvalue_clone(flow_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3920 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3921 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3922 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3923 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3924 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3925 | bool is_flow_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 3926 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3927 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3928 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3929 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 3930 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 3931 | (descriptor_ulong == 19)) |
Azure.IoT Build | 0:6ae2f7bca550 | 3932 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3933 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 3934 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3935 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3936 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3937 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 3938 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3939 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3940 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3941 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3942 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3943 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3944 | int amqpvalue_get_flow(AMQP_VALUE value, FLOW_HANDLE* flow_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 3945 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3946 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 3947 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 3948 | *flow_handle = flow_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 3949 | if (*flow_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3950 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3951 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3952 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3953 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3954 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3955 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3956 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3957 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3958 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 3959 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3960 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3961 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3962 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3963 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 3964 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3965 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 3966 | /* next-incoming-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 3967 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 3968 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3969 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3970 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 3971 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3972 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3973 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3974 | transfer_number next_incoming_id; |
Azure.IoT Build | 0:6ae2f7bca550 | 3975 | if (amqpvalue_get_transfer_number(item_value, &next_incoming_id) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 3976 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3977 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3978 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3979 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 3980 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3981 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 3982 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3983 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3984 | |
Azure.IoT Build | 0:6ae2f7bca550 | 3985 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 3986 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3987 | /* incoming-window */ |
Azure.IoT Build | 0:6ae2f7bca550 | 3988 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 3989 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 3990 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3991 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3992 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 3993 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 3994 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 3995 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3996 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 3997 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 3998 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 3999 | uint32_t incoming_window; |
Azure.IoT Build | 0:6ae2f7bca550 | 4000 | if (amqpvalue_get_uint(item_value, &incoming_window) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4001 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4002 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4003 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4004 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4005 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4006 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4007 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4008 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4009 | /* next-outgoing-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4010 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 4011 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4012 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4013 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4014 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4015 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4016 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4017 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4018 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4019 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4020 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4021 | transfer_number next_outgoing_id; |
Azure.IoT Build | 0:6ae2f7bca550 | 4022 | if (amqpvalue_get_transfer_number(item_value, &next_outgoing_id) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4023 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4024 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4025 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4026 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4027 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4028 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4029 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4030 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4031 | /* outgoing-window */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4032 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 4033 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4034 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4035 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4036 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4037 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4038 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4039 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4040 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4041 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4042 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4043 | uint32_t outgoing_window; |
Azure.IoT Build | 0:6ae2f7bca550 | 4044 | if (amqpvalue_get_uint(item_value, &outgoing_window) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4045 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4046 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4047 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4048 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4049 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4050 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4051 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4052 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4053 | /* handle */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4054 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 4055 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4056 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4057 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4058 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4059 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4060 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4061 | handle handle; |
Azure.IoT Build | 0:6ae2f7bca550 | 4062 | if (amqpvalue_get_handle(item_value, &handle) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4063 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4064 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4065 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4066 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4067 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4068 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4069 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4070 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4071 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4072 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4073 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4074 | /* delivery-count */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4075 | item_value = amqpvalue_get_list_item(list_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 4076 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4077 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4078 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4079 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4080 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4081 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4082 | sequence_no delivery_count; |
Azure.IoT Build | 0:6ae2f7bca550 | 4083 | if (amqpvalue_get_sequence_no(item_value, &delivery_count) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4084 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4085 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4086 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4087 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4088 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4089 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4090 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4091 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4092 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4093 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4094 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4095 | /* link-credit */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4096 | item_value = amqpvalue_get_list_item(list_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 4097 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4098 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4099 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4100 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4101 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4102 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4103 | uint32_t link_credit; |
Azure.IoT Build | 0:6ae2f7bca550 | 4104 | if (amqpvalue_get_uint(item_value, &link_credit) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4105 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4106 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4107 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4108 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4109 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4110 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4111 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4112 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4113 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4114 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4115 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4116 | /* available */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4117 | item_value = amqpvalue_get_list_item(list_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 4118 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4119 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4120 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4121 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4122 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4123 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4124 | uint32_t available; |
Azure.IoT Build | 0:6ae2f7bca550 | 4125 | if (amqpvalue_get_uint(item_value, &available) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4126 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4127 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4128 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4129 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4130 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4131 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4132 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4133 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4134 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4135 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4136 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4137 | /* drain */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4138 | item_value = amqpvalue_get_list_item(list_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 4139 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4140 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4141 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4142 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4143 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4144 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4145 | bool drain; |
Azure.IoT Build | 0:6ae2f7bca550 | 4146 | if (amqpvalue_get_boolean(item_value, &drain) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4147 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4148 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4149 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4150 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4151 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4152 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4153 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4154 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4155 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4156 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4157 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4158 | /* echo */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4159 | item_value = amqpvalue_get_list_item(list_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 4160 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4161 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4162 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4163 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4164 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4165 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4166 | bool echo; |
Azure.IoT Build | 0:6ae2f7bca550 | 4167 | if (amqpvalue_get_boolean(item_value, &echo) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4168 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4169 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4170 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4171 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4172 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4173 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4174 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4175 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4176 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4177 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4178 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4179 | /* properties */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4180 | item_value = amqpvalue_get_list_item(list_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 4181 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4182 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4183 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4184 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4185 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4186 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4187 | fields properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 4188 | if (amqpvalue_get_fields(item_value, &properties) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4189 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4190 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4191 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4192 | flow_destroy(*flow_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 4193 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4194 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 4195 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4196 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4197 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4198 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4199 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4200 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4201 | flow_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4202 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4203 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4204 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 4205 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4206 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4207 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4208 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4209 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4210 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4211 | int flow_get_next_incoming_id(FLOW_HANDLE flow, transfer_number* next_incoming_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4212 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4213 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4214 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4215 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4216 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4217 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4218 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4219 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4220 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4221 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4222 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 4223 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4224 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4225 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4226 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4227 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4228 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4229 | if (amqpvalue_get_transfer_number(item_value, next_incoming_id_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4230 | { |
AzureIoTClient | 16:22a72cf8e416 | 4231 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4232 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4233 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4234 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4235 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4236 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4237 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4238 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4239 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4240 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4241 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4242 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4243 | int flow_set_next_incoming_id(FLOW_HANDLE flow, transfer_number next_incoming_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4244 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4245 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4246 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4247 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4248 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4249 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4250 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4251 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4252 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4253 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4254 | AMQP_VALUE next_incoming_id_amqp_value = amqpvalue_create_transfer_number(next_incoming_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4255 | if (next_incoming_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4256 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4257 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4258 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4259 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4260 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4261 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 0, next_incoming_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4262 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4263 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4264 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4265 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4266 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4267 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4268 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4269 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4270 | amqpvalue_destroy(next_incoming_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4271 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4272 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4273 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4274 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4275 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4276 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4277 | int flow_get_incoming_window(FLOW_HANDLE flow, uint32_t* incoming_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4278 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4279 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4280 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4281 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4282 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4283 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4284 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4285 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4286 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4287 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4288 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 4289 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4290 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4291 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4292 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4293 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4294 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4295 | if (amqpvalue_get_uint(item_value, incoming_window_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4296 | { |
AzureIoTClient | 16:22a72cf8e416 | 4297 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4298 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4299 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4300 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4301 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4302 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4303 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4304 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4305 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4306 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4307 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4308 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4309 | int flow_set_incoming_window(FLOW_HANDLE flow, uint32_t incoming_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4310 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4311 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4312 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4313 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4314 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4315 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4316 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4317 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4318 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4319 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4320 | AMQP_VALUE incoming_window_amqp_value = amqpvalue_create_uint(incoming_window_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4321 | if (incoming_window_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4322 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4323 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4324 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4325 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4326 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4327 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 1, incoming_window_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4328 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4329 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4330 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4331 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4332 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4333 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4334 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4335 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4336 | amqpvalue_destroy(incoming_window_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4337 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4338 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4339 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4340 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4341 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4342 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4343 | int flow_get_next_outgoing_id(FLOW_HANDLE flow, transfer_number* next_outgoing_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4344 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4345 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4346 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4347 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4348 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4349 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4350 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4351 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4352 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4353 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4354 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 4355 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4356 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4357 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4358 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4359 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4360 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4361 | if (amqpvalue_get_transfer_number(item_value, next_outgoing_id_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4362 | { |
AzureIoTClient | 16:22a72cf8e416 | 4363 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4364 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4365 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4366 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4367 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4368 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4369 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4370 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4371 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4372 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4373 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4374 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4375 | int flow_set_next_outgoing_id(FLOW_HANDLE flow, transfer_number next_outgoing_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4376 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4377 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4378 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4379 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4380 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4381 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4382 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4383 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4384 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4385 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4386 | AMQP_VALUE next_outgoing_id_amqp_value = amqpvalue_create_transfer_number(next_outgoing_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4387 | if (next_outgoing_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4388 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4389 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4390 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4391 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4392 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4393 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 2, next_outgoing_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4394 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4395 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4396 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4397 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4398 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4399 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4400 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4401 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4402 | amqpvalue_destroy(next_outgoing_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4403 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4404 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4405 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4406 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4407 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4408 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4409 | int flow_get_outgoing_window(FLOW_HANDLE flow, uint32_t* outgoing_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4410 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4411 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4412 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4413 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4414 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4415 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4416 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4417 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4418 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4419 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4420 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 4421 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4422 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4423 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4424 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4425 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4426 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4427 | if (amqpvalue_get_uint(item_value, outgoing_window_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4428 | { |
AzureIoTClient | 16:22a72cf8e416 | 4429 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4430 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4431 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4432 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4433 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4434 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4435 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4436 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4437 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4438 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4439 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4440 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4441 | int flow_set_outgoing_window(FLOW_HANDLE flow, uint32_t outgoing_window_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4442 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4443 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4444 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4445 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4446 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4447 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4448 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4449 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4450 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4451 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4452 | AMQP_VALUE outgoing_window_amqp_value = amqpvalue_create_uint(outgoing_window_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4453 | if (outgoing_window_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4454 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4455 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4456 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4457 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4458 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4459 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 3, outgoing_window_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4460 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4461 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4462 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4463 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4464 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4465 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4466 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4467 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4468 | amqpvalue_destroy(outgoing_window_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4469 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4470 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4471 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4472 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4473 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4474 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4475 | int flow_get_handle(FLOW_HANDLE flow, handle* handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4476 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4477 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4478 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4479 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4480 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4481 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4482 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4483 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4484 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4485 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4486 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 4487 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4488 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4489 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4490 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4491 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4492 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4493 | if (amqpvalue_get_handle(item_value, handle_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4494 | { |
AzureIoTClient | 16:22a72cf8e416 | 4495 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4496 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4497 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4498 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4499 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4500 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4501 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4502 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4503 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4504 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4505 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4506 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4507 | int flow_set_handle(FLOW_HANDLE flow, handle handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4508 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4509 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4510 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4511 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4512 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4513 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4514 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4515 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4516 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4517 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4518 | AMQP_VALUE handle_amqp_value = amqpvalue_create_handle(handle_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4519 | if (handle_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4520 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4521 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4522 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4523 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4524 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4525 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 4, handle_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4526 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4527 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4528 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4529 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4530 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4531 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4532 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4533 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4534 | amqpvalue_destroy(handle_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4535 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4536 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4537 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4538 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4539 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4540 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4541 | int flow_get_delivery_count(FLOW_HANDLE flow, sequence_no* delivery_count_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4542 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4543 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4544 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4545 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4546 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4547 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4548 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4549 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4550 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4551 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4552 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 4553 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4554 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4555 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4556 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4557 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4558 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4559 | if (amqpvalue_get_sequence_no(item_value, delivery_count_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4560 | { |
AzureIoTClient | 16:22a72cf8e416 | 4561 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4562 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4563 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4564 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4565 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4566 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4567 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4568 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4569 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4570 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4571 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4572 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4573 | int flow_set_delivery_count(FLOW_HANDLE flow, sequence_no delivery_count_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4574 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4575 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4576 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4577 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4578 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4579 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4580 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4581 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4582 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4583 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4584 | AMQP_VALUE delivery_count_amqp_value = amqpvalue_create_sequence_no(delivery_count_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4585 | if (delivery_count_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4586 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4587 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4588 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4589 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4590 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4591 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 5, delivery_count_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4592 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4593 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4594 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4595 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4596 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4597 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4598 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4599 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4600 | amqpvalue_destroy(delivery_count_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4601 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4602 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4603 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4604 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4605 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4606 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4607 | int flow_get_link_credit(FLOW_HANDLE flow, uint32_t* link_credit_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4608 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4609 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4610 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4611 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4612 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4613 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4614 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4615 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4616 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4617 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4618 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 4619 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4620 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4621 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4622 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4623 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4624 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4625 | if (amqpvalue_get_uint(item_value, link_credit_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4626 | { |
AzureIoTClient | 16:22a72cf8e416 | 4627 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4628 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4629 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4630 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4631 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4632 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4633 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4634 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4635 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4636 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4637 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4638 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4639 | int flow_set_link_credit(FLOW_HANDLE flow, uint32_t link_credit_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4640 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4641 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4642 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4643 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4644 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4645 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4646 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4647 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4648 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4649 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4650 | AMQP_VALUE link_credit_amqp_value = amqpvalue_create_uint(link_credit_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4651 | if (link_credit_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4652 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4653 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4654 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4655 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4656 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4657 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 6, link_credit_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4658 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4659 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4660 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4661 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4662 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4663 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4664 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4665 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4666 | amqpvalue_destroy(link_credit_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4667 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4668 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4669 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4670 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4671 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4672 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4673 | int flow_get_available(FLOW_HANDLE flow, uint32_t* available_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4674 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4675 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4676 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4677 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4678 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4679 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4680 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4681 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4682 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4683 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4684 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 4685 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4686 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4687 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4688 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4689 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4690 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4691 | if (amqpvalue_get_uint(item_value, available_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4692 | { |
AzureIoTClient | 16:22a72cf8e416 | 4693 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4694 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4695 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4696 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4697 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4698 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4699 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4700 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4701 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4702 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4703 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4704 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4705 | int flow_set_available(FLOW_HANDLE flow, uint32_t available_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4706 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4707 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4708 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4709 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4710 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4711 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4712 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4713 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4714 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4715 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4716 | AMQP_VALUE available_amqp_value = amqpvalue_create_uint(available_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4717 | if (available_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4718 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4719 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4720 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4721 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4722 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4723 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 7, available_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4724 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4725 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4726 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4727 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4728 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4729 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4730 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4731 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4732 | amqpvalue_destroy(available_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4733 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4734 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4735 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4736 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4737 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4738 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4739 | int flow_get_drain(FLOW_HANDLE flow, bool* drain_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4740 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4741 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4742 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4743 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4744 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4745 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4746 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4747 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4748 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4749 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4750 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 4751 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4752 | { |
AzureIoTClient | 16:22a72cf8e416 | 4753 | *drain_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 4754 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4755 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4756 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4757 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4758 | if (amqpvalue_get_boolean(item_value, drain_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4759 | { |
AzureIoTClient | 16:22a72cf8e416 | 4760 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 4761 | { |
AzureIoTClient | 16:22a72cf8e416 | 4762 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 4763 | } |
AzureIoTClient | 16:22a72cf8e416 | 4764 | else |
AzureIoTClient | 16:22a72cf8e416 | 4765 | { |
AzureIoTClient | 16:22a72cf8e416 | 4766 | *drain_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 4767 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 4768 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4769 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4770 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4771 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4772 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4773 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4774 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4775 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4776 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4777 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4778 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4779 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4780 | int flow_set_drain(FLOW_HANDLE flow, bool drain_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4781 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4782 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4783 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4784 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4785 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4786 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4787 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4788 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4789 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4790 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4791 | AMQP_VALUE drain_amqp_value = amqpvalue_create_boolean(drain_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4792 | if (drain_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4793 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4794 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4795 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4796 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4797 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4798 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 8, drain_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4799 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4800 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4801 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4802 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4803 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4804 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4805 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4806 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4807 | amqpvalue_destroy(drain_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4808 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4809 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4810 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4811 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4812 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4813 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4814 | int flow_get_echo(FLOW_HANDLE flow, bool* echo_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4815 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4816 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4817 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4818 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4819 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4820 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4821 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4822 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4823 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4824 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4825 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 4826 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4827 | { |
AzureIoTClient | 16:22a72cf8e416 | 4828 | *echo_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 4829 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4830 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4831 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4832 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4833 | if (amqpvalue_get_boolean(item_value, echo_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4834 | { |
AzureIoTClient | 16:22a72cf8e416 | 4835 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 4836 | { |
AzureIoTClient | 16:22a72cf8e416 | 4837 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 4838 | } |
AzureIoTClient | 16:22a72cf8e416 | 4839 | else |
AzureIoTClient | 16:22a72cf8e416 | 4840 | { |
AzureIoTClient | 16:22a72cf8e416 | 4841 | *echo_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 4842 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 4843 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4844 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4845 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4846 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4847 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4848 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4849 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4850 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4851 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4852 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4853 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4854 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4855 | int flow_set_echo(FLOW_HANDLE flow, bool echo_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4856 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4857 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4858 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4859 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4860 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4861 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4862 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4863 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4864 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4865 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4866 | AMQP_VALUE echo_amqp_value = amqpvalue_create_boolean(echo_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4867 | if (echo_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4868 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4869 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4870 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4871 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4872 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4873 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 9, echo_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4874 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4875 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4876 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4877 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4878 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4879 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4880 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4881 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4882 | amqpvalue_destroy(echo_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4883 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4884 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4885 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4886 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4887 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4888 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4889 | int flow_get_properties(FLOW_HANDLE flow, fields* properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4890 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4891 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4892 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4893 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4894 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4895 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4896 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4897 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4898 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4899 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4900 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(flow_instance->composite_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 4901 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4902 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4903 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4904 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4905 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4906 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4907 | if (amqpvalue_get_fields(item_value, properties_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4908 | { |
AzureIoTClient | 16:22a72cf8e416 | 4909 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4910 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4911 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4912 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4913 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4914 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4915 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4916 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4917 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4918 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4919 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4920 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4921 | int flow_set_properties(FLOW_HANDLE flow, fields properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4922 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4923 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4924 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4925 | if (flow == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4926 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4927 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4928 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4929 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4930 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4931 | FLOW_INSTANCE* flow_instance = (FLOW_INSTANCE*)flow; |
Azure.IoT Build | 0:6ae2f7bca550 | 4932 | AMQP_VALUE properties_amqp_value = amqpvalue_create_fields(properties_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4933 | if (properties_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4934 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4935 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4936 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4937 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4938 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4939 | if (amqpvalue_set_composite_item(flow_instance->composite_value, 10, properties_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 4940 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4941 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4942 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4943 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4944 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4945 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4946 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4947 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4948 | amqpvalue_destroy(properties_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4949 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4950 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4951 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4952 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 4953 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4954 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4955 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4956 | /* transfer */ |
Azure.IoT Build | 0:6ae2f7bca550 | 4957 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4958 | typedef struct TRANSFER_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 4959 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4960 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 4961 | } TRANSFER_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 4962 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4963 | static TRANSFER_HANDLE transfer_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 4964 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4965 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)amqpalloc_malloc(sizeof(TRANSFER_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 4966 | if (transfer_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4967 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4968 | transfer_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 4969 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4970 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4971 | return transfer_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 4972 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4973 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4974 | TRANSFER_HANDLE transfer_create(handle handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 4975 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4976 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)amqpalloc_malloc(sizeof(TRANSFER_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 4977 | if (transfer_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4978 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4979 | transfer_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(20); |
Azure.IoT Build | 0:6ae2f7bca550 | 4980 | if (transfer_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 4981 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4982 | amqpalloc_free(transfer_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 4983 | transfer_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 4984 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4985 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 4986 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4987 | AMQP_VALUE handle_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 4988 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 4989 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4990 | handle_amqp_value = amqpvalue_create_handle(handle_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4991 | if ((result == 0) && (amqpvalue_set_composite_item(transfer_instance->composite_value, 0, handle_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 4992 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 4993 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 4994 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4995 | |
Azure.IoT Build | 0:6ae2f7bca550 | 4996 | amqpvalue_destroy(handle_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 4997 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4998 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 4999 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5000 | return transfer_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 5001 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5002 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5003 | TRANSFER_HANDLE transfer_clone(TRANSFER_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5004 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5005 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)amqpalloc_malloc(sizeof(TRANSFER_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 5006 | if (transfer_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5007 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5008 | transfer_instance->composite_value = amqpvalue_clone(((TRANSFER_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5009 | if (transfer_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5010 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5011 | amqpalloc_free(transfer_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 5012 | transfer_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 5013 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5014 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5015 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5016 | return transfer_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 5017 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5018 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5019 | void transfer_destroy(TRANSFER_HANDLE transfer) |
Azure.IoT Build | 0:6ae2f7bca550 | 5020 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5021 | if (transfer != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5022 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5023 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5024 | amqpvalue_destroy(transfer_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5025 | amqpalloc_free(transfer_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 5026 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5027 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5028 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5029 | AMQP_VALUE amqpvalue_create_transfer(TRANSFER_HANDLE transfer) |
Azure.IoT Build | 0:6ae2f7bca550 | 5030 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5031 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5032 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5033 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5034 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5035 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 5036 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5037 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5038 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5039 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5040 | result = amqpvalue_clone(transfer_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5041 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5042 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5043 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5044 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5045 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5046 | bool is_transfer_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 5047 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5048 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5049 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5050 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 5051 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 5052 | (descriptor_ulong == 20)) |
Azure.IoT Build | 0:6ae2f7bca550 | 5053 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5054 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 5055 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5056 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5057 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5058 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 5059 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5060 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5061 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5062 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5063 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5064 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5065 | int amqpvalue_get_transfer(AMQP_VALUE value, TRANSFER_HANDLE* transfer_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 5066 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5067 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5068 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 5069 | *transfer_handle = transfer_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 5070 | if (*transfer_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5071 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5072 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5073 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5074 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5075 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5076 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5077 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5078 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5079 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5080 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5081 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5082 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5083 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5084 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 5085 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5086 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 5087 | /* handle */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5088 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 5089 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5090 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5091 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5092 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5093 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5094 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5095 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5096 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5097 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5098 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5099 | handle handle; |
Azure.IoT Build | 0:6ae2f7bca550 | 5100 | if (amqpvalue_get_handle(item_value, &handle) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5101 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5102 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5103 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5104 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5105 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5106 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5107 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5108 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5109 | /* delivery-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5110 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 5111 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5112 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5113 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5114 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5115 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5116 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5117 | delivery_number delivery_id; |
Azure.IoT Build | 0:6ae2f7bca550 | 5118 | if (amqpvalue_get_delivery_number(item_value, &delivery_id) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5119 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5120 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5121 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5122 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5123 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5124 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5125 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5126 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5127 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5128 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5129 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5130 | /* delivery-tag */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5131 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 5132 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5133 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5134 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5135 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5136 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5137 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5138 | delivery_tag delivery_tag; |
Azure.IoT Build | 0:6ae2f7bca550 | 5139 | if (amqpvalue_get_delivery_tag(item_value, &delivery_tag) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5140 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5141 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5142 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5143 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5144 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5145 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5146 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5147 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5148 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5149 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5150 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5151 | /* message-format */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5152 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 5153 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5154 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5155 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5156 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5157 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5158 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5159 | message_format message_format; |
Azure.IoT Build | 0:6ae2f7bca550 | 5160 | if (amqpvalue_get_message_format(item_value, &message_format) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5161 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5162 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5163 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5164 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5165 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5166 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5167 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5168 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5169 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5170 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5171 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5172 | /* settled */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5173 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 5174 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5175 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5176 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5177 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5178 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5179 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5180 | bool settled; |
Azure.IoT Build | 0:6ae2f7bca550 | 5181 | if (amqpvalue_get_boolean(item_value, &settled) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5182 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5183 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5184 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5185 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5186 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5187 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5188 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5189 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5190 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5191 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5192 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5193 | /* more */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5194 | item_value = amqpvalue_get_list_item(list_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 5195 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5196 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5197 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5198 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5199 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5200 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5201 | bool more; |
Azure.IoT Build | 0:6ae2f7bca550 | 5202 | if (amqpvalue_get_boolean(item_value, &more) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5203 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5204 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5205 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5206 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5207 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5208 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5209 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5210 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5211 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5212 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5213 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5214 | /* rcv-settle-mode */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5215 | item_value = amqpvalue_get_list_item(list_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 5216 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5217 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5218 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5219 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5220 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5221 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5222 | receiver_settle_mode rcv_settle_mode; |
Azure.IoT Build | 0:6ae2f7bca550 | 5223 | if (amqpvalue_get_receiver_settle_mode(item_value, &rcv_settle_mode) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5224 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5225 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5226 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5227 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5228 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5229 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5230 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5231 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5232 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5233 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5234 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5235 | /* state */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5236 | item_value = amqpvalue_get_list_item(list_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 5237 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5238 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5239 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5240 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5241 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5242 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5243 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5244 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5245 | /* resume */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5246 | item_value = amqpvalue_get_list_item(list_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 5247 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5248 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5249 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5250 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5251 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5252 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5253 | bool resume; |
Azure.IoT Build | 0:6ae2f7bca550 | 5254 | if (amqpvalue_get_boolean(item_value, &resume) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5255 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5256 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5257 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5258 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5259 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5260 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5261 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5262 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5263 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5264 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5265 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5266 | /* aborted */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5267 | item_value = amqpvalue_get_list_item(list_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 5268 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5269 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5270 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5271 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5272 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5273 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5274 | bool aborted; |
Azure.IoT Build | 0:6ae2f7bca550 | 5275 | if (amqpvalue_get_boolean(item_value, &aborted) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5276 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5277 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5278 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5279 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5280 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5281 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5282 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5283 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5284 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5285 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5286 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5287 | /* batchable */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5288 | item_value = amqpvalue_get_list_item(list_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 5289 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5290 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5291 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 5292 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5293 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5294 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5295 | bool batchable; |
Azure.IoT Build | 0:6ae2f7bca550 | 5296 | if (amqpvalue_get_boolean(item_value, &batchable) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5297 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5298 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5299 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5300 | transfer_destroy(*transfer_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 5301 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5302 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 5303 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5304 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5305 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5306 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5307 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5308 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5309 | transfer_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5310 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5311 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5312 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 5313 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5314 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5315 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5316 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5317 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5318 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5319 | int transfer_get_handle(TRANSFER_HANDLE transfer, handle* handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5320 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5321 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5322 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5323 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5324 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5325 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5326 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5327 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5328 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5329 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5330 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 5331 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5332 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5333 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5334 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5335 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5336 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5337 | if (amqpvalue_get_handle(item_value, handle_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5338 | { |
AzureIoTClient | 16:22a72cf8e416 | 5339 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5340 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5341 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5342 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5343 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5344 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5345 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5346 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5347 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5348 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5349 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5350 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5351 | int transfer_set_handle(TRANSFER_HANDLE transfer, handle handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5352 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5353 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5354 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5355 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5356 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5357 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5358 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5359 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5360 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5361 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5362 | AMQP_VALUE handle_amqp_value = amqpvalue_create_handle(handle_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5363 | if (handle_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5364 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5365 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5366 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5367 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5368 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5369 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 0, handle_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5370 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5371 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5372 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5373 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5374 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5375 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5376 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5377 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5378 | amqpvalue_destroy(handle_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5379 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5380 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5381 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5382 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5383 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5384 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5385 | int transfer_get_delivery_id(TRANSFER_HANDLE transfer, delivery_number* delivery_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5386 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5387 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5388 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5389 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5390 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5391 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5392 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5393 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5394 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5395 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5396 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 5397 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5398 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5399 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5400 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5401 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5402 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5403 | if (amqpvalue_get_delivery_number(item_value, delivery_id_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5404 | { |
AzureIoTClient | 16:22a72cf8e416 | 5405 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5406 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5407 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5408 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5409 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5410 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5411 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5412 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5413 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5414 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5415 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5416 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5417 | int transfer_set_delivery_id(TRANSFER_HANDLE transfer, delivery_number delivery_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5418 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5419 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5420 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5421 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5422 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5423 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5424 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5425 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5426 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5427 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5428 | AMQP_VALUE delivery_id_amqp_value = amqpvalue_create_delivery_number(delivery_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5429 | if (delivery_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5430 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5431 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5432 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5433 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5434 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5435 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 1, delivery_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5436 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5437 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5438 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5439 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5440 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5441 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5442 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5443 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5444 | amqpvalue_destroy(delivery_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5445 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5446 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5447 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5448 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5449 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5450 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5451 | int transfer_get_delivery_tag(TRANSFER_HANDLE transfer, delivery_tag* delivery_tag_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5452 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5453 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5454 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5455 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5456 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5457 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5458 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5459 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5460 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5461 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5462 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 5463 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5464 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5465 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5466 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5467 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5468 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5469 | if (amqpvalue_get_delivery_tag(item_value, delivery_tag_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5470 | { |
AzureIoTClient | 16:22a72cf8e416 | 5471 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5472 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5473 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5474 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5475 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5476 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5477 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5478 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5479 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5480 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5481 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5482 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5483 | int transfer_set_delivery_tag(TRANSFER_HANDLE transfer, delivery_tag delivery_tag_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5484 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5485 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5486 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5487 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5488 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5489 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5490 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5491 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5492 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5493 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5494 | AMQP_VALUE delivery_tag_amqp_value = amqpvalue_create_delivery_tag(delivery_tag_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5495 | if (delivery_tag_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5496 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5497 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5498 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5499 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5500 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5501 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 2, delivery_tag_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5502 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5503 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5504 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5505 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5506 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5507 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5508 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5509 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5510 | amqpvalue_destroy(delivery_tag_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5511 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5512 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5513 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5514 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5515 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5516 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5517 | int transfer_get_message_format(TRANSFER_HANDLE transfer, message_format* message_format_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5518 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5519 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5520 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5521 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5522 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5523 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5524 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5525 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5526 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5527 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5528 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 5529 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5530 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5531 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5532 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5533 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5534 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5535 | if (amqpvalue_get_message_format(item_value, message_format_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5536 | { |
AzureIoTClient | 16:22a72cf8e416 | 5537 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5538 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5539 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5540 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5541 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5542 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5543 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5544 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5545 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5546 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5547 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5548 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5549 | int transfer_set_message_format(TRANSFER_HANDLE transfer, message_format message_format_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5550 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5551 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5552 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5553 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5554 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5555 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5556 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5557 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5558 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5559 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5560 | AMQP_VALUE message_format_amqp_value = amqpvalue_create_message_format(message_format_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5561 | if (message_format_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5562 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5563 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5564 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5565 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5566 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5567 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 3, message_format_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5568 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5569 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5570 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5571 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5572 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5573 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5574 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5575 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5576 | amqpvalue_destroy(message_format_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5577 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5578 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5579 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5580 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5581 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5582 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5583 | int transfer_get_settled(TRANSFER_HANDLE transfer, bool* settled_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5584 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5585 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5586 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5587 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5588 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5589 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5590 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5591 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5592 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5593 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5594 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 5595 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5596 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5597 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5598 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5599 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5600 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5601 | if (amqpvalue_get_boolean(item_value, settled_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5602 | { |
AzureIoTClient | 16:22a72cf8e416 | 5603 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5604 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5605 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5606 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5607 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5608 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5609 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5610 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5611 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5612 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5613 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5614 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5615 | int transfer_set_settled(TRANSFER_HANDLE transfer, bool settled_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5616 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5617 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5618 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5619 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5620 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5621 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5622 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5623 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5624 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5625 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5626 | AMQP_VALUE settled_amqp_value = amqpvalue_create_boolean(settled_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5627 | if (settled_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5628 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5629 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5630 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5631 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5632 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5633 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 4, settled_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5634 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5635 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5636 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5637 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5638 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5639 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5640 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5641 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5642 | amqpvalue_destroy(settled_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5643 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5644 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5645 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5646 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5647 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5648 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5649 | int transfer_get_more(TRANSFER_HANDLE transfer, bool* more_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5650 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5651 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5652 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5653 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5654 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5655 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5656 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5657 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5658 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5659 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5660 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 5661 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5662 | { |
AzureIoTClient | 16:22a72cf8e416 | 5663 | *more_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 5664 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5665 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5666 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5667 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5668 | if (amqpvalue_get_boolean(item_value, more_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5669 | { |
AzureIoTClient | 16:22a72cf8e416 | 5670 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 5671 | { |
AzureIoTClient | 16:22a72cf8e416 | 5672 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 5673 | } |
AzureIoTClient | 16:22a72cf8e416 | 5674 | else |
AzureIoTClient | 16:22a72cf8e416 | 5675 | { |
AzureIoTClient | 16:22a72cf8e416 | 5676 | *more_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 5677 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 5678 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5679 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5680 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5681 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5682 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5683 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5684 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5685 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5686 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5687 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5688 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5689 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5690 | int transfer_set_more(TRANSFER_HANDLE transfer, bool more_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5691 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5692 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5693 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5694 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5695 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5696 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5697 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5698 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5699 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5700 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5701 | AMQP_VALUE more_amqp_value = amqpvalue_create_boolean(more_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5702 | if (more_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5703 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5704 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5705 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5706 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5707 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5708 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 5, more_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5709 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5710 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5711 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5712 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5713 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5714 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5715 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5716 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5717 | amqpvalue_destroy(more_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5718 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5719 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5720 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5721 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5722 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5723 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5724 | int transfer_get_rcv_settle_mode(TRANSFER_HANDLE transfer, receiver_settle_mode* rcv_settle_mode_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5725 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5726 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5727 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5728 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5729 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5730 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5731 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5732 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5733 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5734 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5735 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 5736 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5737 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5738 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5739 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5740 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5741 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5742 | if (amqpvalue_get_receiver_settle_mode(item_value, rcv_settle_mode_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5743 | { |
AzureIoTClient | 16:22a72cf8e416 | 5744 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5745 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5746 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5747 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5748 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5749 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5750 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5751 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5752 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5753 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5754 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5755 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5756 | int transfer_set_rcv_settle_mode(TRANSFER_HANDLE transfer, receiver_settle_mode rcv_settle_mode_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5757 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5758 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5759 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5760 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5761 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5762 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5763 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5764 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5765 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5766 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5767 | AMQP_VALUE rcv_settle_mode_amqp_value = amqpvalue_create_receiver_settle_mode(rcv_settle_mode_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5768 | if (rcv_settle_mode_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5769 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5770 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5771 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5772 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5773 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5774 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 6, rcv_settle_mode_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5775 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5776 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5777 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5778 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5779 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5780 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5781 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5782 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5783 | amqpvalue_destroy(rcv_settle_mode_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5784 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5785 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5786 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5787 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5788 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5789 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5790 | int transfer_get_state(TRANSFER_HANDLE transfer, AMQP_VALUE* state_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5791 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5792 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5793 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5794 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5795 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5796 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5797 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5798 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5799 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5800 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5801 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 5802 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5803 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5804 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5805 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5806 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5807 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5808 | *state_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 5809 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5810 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5811 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5812 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5813 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5814 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5815 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5816 | int transfer_set_state(TRANSFER_HANDLE transfer, AMQP_VALUE state_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5817 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5818 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5819 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5820 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5821 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5822 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5823 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5824 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5825 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5826 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5827 | AMQP_VALUE state_amqp_value = amqpvalue_clone(state_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5828 | if (state_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5829 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5830 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5831 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5832 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5833 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5834 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 7, state_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5835 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5836 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5837 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5838 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5839 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5840 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5841 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5842 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5843 | amqpvalue_destroy(state_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5844 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5845 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5846 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5847 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5848 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5849 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5850 | int transfer_get_resume(TRANSFER_HANDLE transfer, bool* resume_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5851 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5852 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5853 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5854 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5855 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5856 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5857 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5858 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5859 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5860 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5861 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 5862 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5863 | { |
AzureIoTClient | 16:22a72cf8e416 | 5864 | *resume_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 5865 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5866 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5867 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5868 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5869 | if (amqpvalue_get_boolean(item_value, resume_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5870 | { |
AzureIoTClient | 16:22a72cf8e416 | 5871 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 5872 | { |
AzureIoTClient | 16:22a72cf8e416 | 5873 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 5874 | } |
AzureIoTClient | 16:22a72cf8e416 | 5875 | else |
AzureIoTClient | 16:22a72cf8e416 | 5876 | { |
AzureIoTClient | 16:22a72cf8e416 | 5877 | *resume_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 5878 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 5879 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5880 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5881 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5882 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5883 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5884 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5885 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5886 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5887 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5888 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5889 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5890 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5891 | int transfer_set_resume(TRANSFER_HANDLE transfer, bool resume_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5892 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5893 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5894 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5895 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5896 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5897 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5898 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5899 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5900 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5901 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5902 | AMQP_VALUE resume_amqp_value = amqpvalue_create_boolean(resume_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5903 | if (resume_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5904 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5905 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5906 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5907 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5908 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5909 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 8, resume_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5910 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5911 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5912 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5913 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5914 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5915 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5916 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5917 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5918 | amqpvalue_destroy(resume_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5919 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5920 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5921 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5922 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5923 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5924 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5925 | int transfer_get_aborted(TRANSFER_HANDLE transfer, bool* aborted_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5926 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5927 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5928 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5929 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5930 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5931 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5932 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5933 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5934 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5935 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5936 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 5937 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5938 | { |
AzureIoTClient | 16:22a72cf8e416 | 5939 | *aborted_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 5940 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5941 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5942 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5943 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5944 | if (amqpvalue_get_boolean(item_value, aborted_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5945 | { |
AzureIoTClient | 16:22a72cf8e416 | 5946 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 5947 | { |
AzureIoTClient | 16:22a72cf8e416 | 5948 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 5949 | } |
AzureIoTClient | 16:22a72cf8e416 | 5950 | else |
AzureIoTClient | 16:22a72cf8e416 | 5951 | { |
AzureIoTClient | 16:22a72cf8e416 | 5952 | *aborted_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 5953 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 5954 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5955 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5956 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5957 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5958 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5959 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5960 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5961 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5962 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5963 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5964 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5965 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5966 | int transfer_set_aborted(TRANSFER_HANDLE transfer, bool aborted_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 5967 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5968 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5969 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5970 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5971 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5972 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5973 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5974 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5975 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5976 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 5977 | AMQP_VALUE aborted_amqp_value = amqpvalue_create_boolean(aborted_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5978 | if (aborted_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 5979 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5980 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5981 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5982 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5983 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5984 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 9, aborted_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 5985 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5986 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 5987 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5988 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 5989 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 5990 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 5991 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5992 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5993 | amqpvalue_destroy(aborted_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 5994 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5995 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5996 | |
Azure.IoT Build | 0:6ae2f7bca550 | 5997 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 5998 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 5999 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6000 | int transfer_get_batchable(TRANSFER_HANDLE transfer, bool* batchable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6001 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6002 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6003 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6004 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6005 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6006 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6007 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6008 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6009 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6010 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 6011 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(transfer_instance->composite_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 6012 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6013 | { |
AzureIoTClient | 16:22a72cf8e416 | 6014 | *batchable_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 6015 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6016 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6017 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6018 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6019 | if (amqpvalue_get_boolean(item_value, batchable_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6020 | { |
AzureIoTClient | 16:22a72cf8e416 | 6021 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 6022 | { |
AzureIoTClient | 16:22a72cf8e416 | 6023 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 6024 | } |
AzureIoTClient | 16:22a72cf8e416 | 6025 | else |
AzureIoTClient | 16:22a72cf8e416 | 6026 | { |
AzureIoTClient | 16:22a72cf8e416 | 6027 | *batchable_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 6028 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 6029 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6030 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6031 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6032 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6033 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6034 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6035 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6036 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6037 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6038 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6039 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6040 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6041 | int transfer_set_batchable(TRANSFER_HANDLE transfer, bool batchable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6042 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6043 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6044 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6045 | if (transfer == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6046 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6047 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6048 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6049 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6050 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6051 | TRANSFER_INSTANCE* transfer_instance = (TRANSFER_INSTANCE*)transfer; |
Azure.IoT Build | 0:6ae2f7bca550 | 6052 | AMQP_VALUE batchable_amqp_value = amqpvalue_create_boolean(batchable_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6053 | if (batchable_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6054 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6055 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6056 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6057 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6058 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6059 | if (amqpvalue_set_composite_item(transfer_instance->composite_value, 10, batchable_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6060 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6061 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6062 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6063 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6064 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6065 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6066 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6067 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6068 | amqpvalue_destroy(batchable_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6069 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6070 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6071 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6072 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6073 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6074 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6075 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6076 | /* disposition */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6077 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6078 | typedef struct DISPOSITION_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 6079 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6080 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 6081 | } DISPOSITION_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 6082 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6083 | static DISPOSITION_HANDLE disposition_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 6084 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6085 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)amqpalloc_malloc(sizeof(DISPOSITION_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 6086 | if (disposition_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6087 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6088 | disposition_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 6089 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6090 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6091 | return disposition_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 6092 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6093 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6094 | DISPOSITION_HANDLE disposition_create(role role_value, delivery_number first_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6095 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6096 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)amqpalloc_malloc(sizeof(DISPOSITION_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 6097 | if (disposition_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6098 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6099 | disposition_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(21); |
Azure.IoT Build | 0:6ae2f7bca550 | 6100 | if (disposition_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6101 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6102 | amqpalloc_free(disposition_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 6103 | disposition_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 6104 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6105 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6106 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6107 | AMQP_VALUE role_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 6108 | AMQP_VALUE first_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 6109 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6110 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6111 | role_amqp_value = amqpvalue_create_role(role_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6112 | if ((result == 0) && (amqpvalue_set_composite_item(disposition_instance->composite_value, 0, role_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 6113 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6114 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6115 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6116 | first_amqp_value = amqpvalue_create_delivery_number(first_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6117 | if ((result == 0) && (amqpvalue_set_composite_item(disposition_instance->composite_value, 1, first_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 6118 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6119 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6120 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6121 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6122 | amqpvalue_destroy(role_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6123 | amqpvalue_destroy(first_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6124 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6125 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6126 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6127 | return disposition_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 6128 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6129 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6130 | DISPOSITION_HANDLE disposition_clone(DISPOSITION_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6131 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6132 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)amqpalloc_malloc(sizeof(DISPOSITION_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 6133 | if (disposition_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6134 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6135 | disposition_instance->composite_value = amqpvalue_clone(((DISPOSITION_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6136 | if (disposition_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6137 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6138 | amqpalloc_free(disposition_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 6139 | disposition_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 6140 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6141 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6142 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6143 | return disposition_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 6144 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6145 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6146 | void disposition_destroy(DISPOSITION_HANDLE disposition) |
Azure.IoT Build | 0:6ae2f7bca550 | 6147 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6148 | if (disposition != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6149 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6150 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6151 | amqpvalue_destroy(disposition_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6152 | amqpalloc_free(disposition_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 6153 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6154 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6155 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6156 | AMQP_VALUE amqpvalue_create_disposition(DISPOSITION_HANDLE disposition) |
Azure.IoT Build | 0:6ae2f7bca550 | 6157 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6158 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6159 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6160 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6161 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6162 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 6163 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6164 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6165 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6166 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6167 | result = amqpvalue_clone(disposition_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6168 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6169 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6170 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6171 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6172 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6173 | bool is_disposition_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 6174 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6175 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6176 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6177 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 6178 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 6179 | (descriptor_ulong == 21)) |
Azure.IoT Build | 0:6ae2f7bca550 | 6180 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6181 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 6182 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6183 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6184 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6185 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 6186 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6187 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6188 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6189 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6190 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6191 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6192 | int amqpvalue_get_disposition(AMQP_VALUE value, DISPOSITION_HANDLE* disposition_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 6193 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6194 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6195 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 6196 | *disposition_handle = disposition_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 6197 | if (*disposition_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6198 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6199 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6200 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6201 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6202 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6203 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6204 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6205 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6206 | disposition_destroy(*disposition_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6207 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6208 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6209 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6210 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6211 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 6212 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6213 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 6214 | /* role */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6215 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 6216 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6217 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6218 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6219 | disposition_destroy(*disposition_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6220 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6221 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6222 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6223 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6224 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6225 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6226 | role role; |
Azure.IoT Build | 0:6ae2f7bca550 | 6227 | if (amqpvalue_get_role(item_value, &role) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6228 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6229 | disposition_destroy(*disposition_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6230 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6231 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6232 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6233 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6234 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6235 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6236 | /* first */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6237 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 6238 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6239 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6240 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6241 | disposition_destroy(*disposition_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6242 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6243 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6244 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6245 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6246 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6247 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6248 | delivery_number first; |
Azure.IoT Build | 0:6ae2f7bca550 | 6249 | if (amqpvalue_get_delivery_number(item_value, &first) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6250 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6251 | disposition_destroy(*disposition_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6252 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6253 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6254 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6255 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6256 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6257 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6258 | /* last */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6259 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 6260 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6261 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6262 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6263 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6264 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6265 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6266 | delivery_number last; |
Azure.IoT Build | 0:6ae2f7bca550 | 6267 | if (amqpvalue_get_delivery_number(item_value, &last) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6268 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6269 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6270 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6271 | disposition_destroy(*disposition_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6272 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6273 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6274 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6275 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6276 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6277 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6278 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6279 | /* settled */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6280 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 6281 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6282 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6283 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6284 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6285 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6286 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6287 | bool settled; |
Azure.IoT Build | 0:6ae2f7bca550 | 6288 | if (amqpvalue_get_boolean(item_value, &settled) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6289 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6290 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6291 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6292 | disposition_destroy(*disposition_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6293 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6294 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6295 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6296 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6297 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6298 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6299 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6300 | /* state */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6301 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 6302 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6303 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6304 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6305 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6306 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6307 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6308 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6309 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6310 | /* batchable */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6311 | item_value = amqpvalue_get_list_item(list_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 6312 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6313 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6314 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6315 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6316 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6317 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6318 | bool batchable; |
Azure.IoT Build | 0:6ae2f7bca550 | 6319 | if (amqpvalue_get_boolean(item_value, &batchable) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6320 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6321 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6322 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6323 | disposition_destroy(*disposition_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6324 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6325 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6326 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6327 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6328 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6329 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6330 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6331 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6332 | disposition_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6333 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6334 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6335 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 6336 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6337 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6338 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6339 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6340 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6341 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6342 | int disposition_get_role(DISPOSITION_HANDLE disposition, role* role_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6343 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6344 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6345 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6346 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6347 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6348 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6349 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6350 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6351 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6352 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6353 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(disposition_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 6354 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6355 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6356 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6357 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6358 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6359 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6360 | if (amqpvalue_get_role(item_value, role_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6361 | { |
AzureIoTClient | 16:22a72cf8e416 | 6362 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6363 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6364 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6365 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6366 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6367 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6368 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6369 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6370 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6371 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6372 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6373 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6374 | int disposition_set_role(DISPOSITION_HANDLE disposition, role role_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6375 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6376 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6377 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6378 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6379 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6380 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6381 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6382 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6383 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6384 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6385 | AMQP_VALUE role_amqp_value = amqpvalue_create_role(role_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6386 | if (role_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6387 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6388 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6389 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6390 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6391 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6392 | if (amqpvalue_set_composite_item(disposition_instance->composite_value, 0, role_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6393 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6394 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6395 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6396 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6397 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6398 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6399 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6400 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6401 | amqpvalue_destroy(role_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6402 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6403 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6404 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6405 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6406 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6407 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6408 | int disposition_get_first(DISPOSITION_HANDLE disposition, delivery_number* first_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6409 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6410 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6411 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6412 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6413 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6414 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6415 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6416 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6417 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6418 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6419 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(disposition_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 6420 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6421 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6422 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6423 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6424 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6425 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6426 | if (amqpvalue_get_delivery_number(item_value, first_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6427 | { |
AzureIoTClient | 16:22a72cf8e416 | 6428 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6429 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6430 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6431 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6432 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6433 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6434 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6435 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6436 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6437 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6438 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6439 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6440 | int disposition_set_first(DISPOSITION_HANDLE disposition, delivery_number first_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6441 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6442 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6443 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6444 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6445 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6446 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6447 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6448 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6449 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6450 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6451 | AMQP_VALUE first_amqp_value = amqpvalue_create_delivery_number(first_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6452 | if (first_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6453 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6454 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6455 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6456 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6457 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6458 | if (amqpvalue_set_composite_item(disposition_instance->composite_value, 1, first_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6459 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6460 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6461 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6462 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6463 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6464 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6465 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6466 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6467 | amqpvalue_destroy(first_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6468 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6469 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6470 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6471 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6472 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6473 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6474 | int disposition_get_last(DISPOSITION_HANDLE disposition, delivery_number* last_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6475 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6476 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6477 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6478 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6479 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6480 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6481 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6482 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6483 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6484 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6485 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(disposition_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 6486 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6487 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6488 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6489 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6490 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6491 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6492 | if (amqpvalue_get_delivery_number(item_value, last_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6493 | { |
AzureIoTClient | 16:22a72cf8e416 | 6494 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6495 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6496 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6497 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6498 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6499 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6500 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6501 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6502 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6503 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6504 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6505 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6506 | int disposition_set_last(DISPOSITION_HANDLE disposition, delivery_number last_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6507 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6508 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6509 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6510 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6511 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6512 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6513 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6514 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6515 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6516 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6517 | AMQP_VALUE last_amqp_value = amqpvalue_create_delivery_number(last_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6518 | if (last_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6519 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6520 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6521 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6522 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6523 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6524 | if (amqpvalue_set_composite_item(disposition_instance->composite_value, 2, last_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6525 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6526 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6527 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6528 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6529 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6530 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6531 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6532 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6533 | amqpvalue_destroy(last_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6534 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6535 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6536 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6537 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6538 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6539 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6540 | int disposition_get_settled(DISPOSITION_HANDLE disposition, bool* settled_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6541 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6542 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6543 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6544 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6545 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6546 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6547 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6548 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6549 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6550 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6551 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(disposition_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 6552 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6553 | { |
AzureIoTClient | 16:22a72cf8e416 | 6554 | *settled_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 6555 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6556 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6557 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6558 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6559 | if (amqpvalue_get_boolean(item_value, settled_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6560 | { |
AzureIoTClient | 16:22a72cf8e416 | 6561 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 6562 | { |
AzureIoTClient | 16:22a72cf8e416 | 6563 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 6564 | } |
AzureIoTClient | 16:22a72cf8e416 | 6565 | else |
AzureIoTClient | 16:22a72cf8e416 | 6566 | { |
AzureIoTClient | 16:22a72cf8e416 | 6567 | *settled_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 6568 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 6569 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6570 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6571 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6572 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6573 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6574 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6575 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6576 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6577 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6578 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6579 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6580 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6581 | int disposition_set_settled(DISPOSITION_HANDLE disposition, bool settled_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6582 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6583 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6584 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6585 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6586 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6587 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6588 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6589 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6590 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6591 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6592 | AMQP_VALUE settled_amqp_value = amqpvalue_create_boolean(settled_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6593 | if (settled_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6594 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6595 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6596 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6597 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6598 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6599 | if (amqpvalue_set_composite_item(disposition_instance->composite_value, 3, settled_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6600 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6601 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6602 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6603 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6604 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6605 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6606 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6607 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6608 | amqpvalue_destroy(settled_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6609 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6610 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6611 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6612 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6613 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6614 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6615 | int disposition_get_state(DISPOSITION_HANDLE disposition, AMQP_VALUE* state_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6616 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6617 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6618 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6619 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6620 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6621 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6622 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6623 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6624 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6625 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6626 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(disposition_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 6627 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6628 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6629 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6630 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6631 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6632 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6633 | *state_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 6634 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6635 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6636 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6637 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6638 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6639 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6640 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6641 | int disposition_set_state(DISPOSITION_HANDLE disposition, AMQP_VALUE state_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6642 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6643 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6644 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6645 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6646 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6647 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6648 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6649 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6650 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6651 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6652 | AMQP_VALUE state_amqp_value = amqpvalue_clone(state_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6653 | if (state_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6654 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6655 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6656 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6657 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6658 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6659 | if (amqpvalue_set_composite_item(disposition_instance->composite_value, 4, state_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6660 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6661 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6662 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6663 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6664 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6665 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6666 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6667 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6668 | amqpvalue_destroy(state_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6669 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6670 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6671 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6672 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6673 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6674 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6675 | int disposition_get_batchable(DISPOSITION_HANDLE disposition, bool* batchable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6676 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6677 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6678 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6679 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6680 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6681 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6682 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6683 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6684 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6685 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6686 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(disposition_instance->composite_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 6687 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6688 | { |
AzureIoTClient | 16:22a72cf8e416 | 6689 | *batchable_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 6690 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6691 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6692 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6693 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6694 | if (amqpvalue_get_boolean(item_value, batchable_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6695 | { |
AzureIoTClient | 16:22a72cf8e416 | 6696 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 6697 | { |
AzureIoTClient | 16:22a72cf8e416 | 6698 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 6699 | } |
AzureIoTClient | 16:22a72cf8e416 | 6700 | else |
AzureIoTClient | 16:22a72cf8e416 | 6701 | { |
AzureIoTClient | 16:22a72cf8e416 | 6702 | *batchable_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 6703 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 6704 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6705 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6706 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6707 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6708 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6709 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6710 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6711 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6712 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6713 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6714 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6715 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6716 | int disposition_set_batchable(DISPOSITION_HANDLE disposition, bool batchable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6717 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6718 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6719 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6720 | if (disposition == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6721 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6722 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6723 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6724 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6725 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6726 | DISPOSITION_INSTANCE* disposition_instance = (DISPOSITION_INSTANCE*)disposition; |
Azure.IoT Build | 0:6ae2f7bca550 | 6727 | AMQP_VALUE batchable_amqp_value = amqpvalue_create_boolean(batchable_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6728 | if (batchable_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6729 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6730 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6731 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6732 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6733 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6734 | if (amqpvalue_set_composite_item(disposition_instance->composite_value, 5, batchable_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6735 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6736 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6737 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6738 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6739 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6740 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6741 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6742 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6743 | amqpvalue_destroy(batchable_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6744 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6745 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6746 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6747 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6748 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6749 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6750 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6751 | /* detach */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6752 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6753 | typedef struct DETACH_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 6754 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6755 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 6756 | } DETACH_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 6757 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6758 | static DETACH_HANDLE detach_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 6759 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6760 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)amqpalloc_malloc(sizeof(DETACH_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 6761 | if (detach_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6762 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6763 | detach_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 6764 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6765 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6766 | return detach_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 6767 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6768 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6769 | DETACH_HANDLE detach_create(handle handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6770 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6771 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)amqpalloc_malloc(sizeof(DETACH_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 6772 | if (detach_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6773 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6774 | detach_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(22); |
Azure.IoT Build | 0:6ae2f7bca550 | 6775 | if (detach_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6776 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6777 | amqpalloc_free(detach_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 6778 | detach_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 6779 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6780 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6781 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6782 | AMQP_VALUE handle_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 6783 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6784 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6785 | handle_amqp_value = amqpvalue_create_handle(handle_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6786 | if ((result == 0) && (amqpvalue_set_composite_item(detach_instance->composite_value, 0, handle_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 6787 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6788 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6789 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6790 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6791 | amqpvalue_destroy(handle_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6792 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6793 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6794 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6795 | return detach_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 6796 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6797 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6798 | DETACH_HANDLE detach_clone(DETACH_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6799 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6800 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)amqpalloc_malloc(sizeof(DETACH_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 6801 | if (detach_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6802 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6803 | detach_instance->composite_value = amqpvalue_clone(((DETACH_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6804 | if (detach_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6805 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6806 | amqpalloc_free(detach_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 6807 | detach_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 6808 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6809 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6810 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6811 | return detach_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 6812 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6813 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6814 | void detach_destroy(DETACH_HANDLE detach) |
Azure.IoT Build | 0:6ae2f7bca550 | 6815 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6816 | if (detach != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6817 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6818 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)detach; |
Azure.IoT Build | 0:6ae2f7bca550 | 6819 | amqpvalue_destroy(detach_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6820 | amqpalloc_free(detach_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 6821 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6822 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6823 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6824 | AMQP_VALUE amqpvalue_create_detach(DETACH_HANDLE detach) |
Azure.IoT Build | 0:6ae2f7bca550 | 6825 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6826 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6827 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6828 | if (detach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6829 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6830 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 6831 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6832 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6833 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6834 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)detach; |
Azure.IoT Build | 0:6ae2f7bca550 | 6835 | result = amqpvalue_clone(detach_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6836 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6837 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6838 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6839 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6840 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6841 | bool is_detach_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 6842 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6843 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6844 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6845 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 6846 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 6847 | (descriptor_ulong == 22)) |
Azure.IoT Build | 0:6ae2f7bca550 | 6848 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6849 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 6850 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6851 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6852 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6853 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 6854 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6855 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6856 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6857 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6858 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6859 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6860 | int amqpvalue_get_detach(AMQP_VALUE value, DETACH_HANDLE* detach_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 6861 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6862 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6863 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)detach_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 6864 | *detach_handle = detach_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 6865 | if (*detach_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6866 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6867 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6868 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6869 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6870 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6871 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6872 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6873 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6874 | detach_destroy(*detach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6875 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6876 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6877 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6878 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6879 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 6880 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6881 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 6882 | /* handle */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6883 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 6884 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6885 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6886 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6887 | detach_destroy(*detach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6888 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6889 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6890 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6891 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6892 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6893 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6894 | handle handle; |
Azure.IoT Build | 0:6ae2f7bca550 | 6895 | if (amqpvalue_get_handle(item_value, &handle) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6896 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6897 | detach_destroy(*detach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6898 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6899 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6900 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6901 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6902 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6903 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6904 | /* closed */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6905 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 6906 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6907 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6908 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6909 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6910 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6911 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6912 | bool closed; |
Azure.IoT Build | 0:6ae2f7bca550 | 6913 | if (amqpvalue_get_boolean(item_value, &closed) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6914 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6915 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6916 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6917 | detach_destroy(*detach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6918 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6919 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6920 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6921 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6922 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6923 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6924 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6925 | /* error */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6926 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 6927 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6928 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6929 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 6930 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6931 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6932 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6933 | ERROR_HANDLE error; |
Azure.IoT Build | 0:6ae2f7bca550 | 6934 | if (amqpvalue_get_error(item_value, &error) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6935 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6936 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6937 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6938 | detach_destroy(*detach_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 6939 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6940 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 6941 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6942 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6943 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6944 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6945 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6946 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6947 | detach_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 6948 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6949 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6950 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 6951 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6952 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6953 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6954 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6955 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6956 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6957 | int detach_get_handle(DETACH_HANDLE detach, handle* handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6958 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6959 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6960 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6961 | if (detach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6962 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6963 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6964 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6965 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6966 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6967 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)detach; |
Azure.IoT Build | 0:6ae2f7bca550 | 6968 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(detach_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 6969 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6970 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6971 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6972 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6973 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6974 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6975 | if (amqpvalue_get_handle(item_value, handle_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 6976 | { |
AzureIoTClient | 16:22a72cf8e416 | 6977 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6978 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6979 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6980 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6981 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 6982 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6983 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6984 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6985 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6986 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6987 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6988 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6989 | int detach_set_handle(DETACH_HANDLE detach, handle handle_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 6990 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6991 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 6992 | |
Azure.IoT Build | 0:6ae2f7bca550 | 6993 | if (detach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 6994 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6995 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 6996 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 6997 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 6998 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 6999 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)detach; |
Azure.IoT Build | 0:6ae2f7bca550 | 7000 | AMQP_VALUE handle_amqp_value = amqpvalue_create_handle(handle_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7001 | if (handle_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7002 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7003 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7004 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7005 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7006 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7007 | if (amqpvalue_set_composite_item(detach_instance->composite_value, 0, handle_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7008 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7009 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7010 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7011 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7012 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7013 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7014 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7015 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7016 | amqpvalue_destroy(handle_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7017 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7018 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7019 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7020 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7021 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7022 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7023 | int detach_get_closed(DETACH_HANDLE detach, bool* closed_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7024 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7025 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7026 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7027 | if (detach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7028 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7029 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7030 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7031 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7032 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7033 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)detach; |
Azure.IoT Build | 0:6ae2f7bca550 | 7034 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(detach_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 7035 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7036 | { |
AzureIoTClient | 16:22a72cf8e416 | 7037 | *closed_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 7038 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7039 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7040 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7041 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7042 | if (amqpvalue_get_boolean(item_value, closed_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7043 | { |
AzureIoTClient | 16:22a72cf8e416 | 7044 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 7045 | { |
AzureIoTClient | 16:22a72cf8e416 | 7046 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 7047 | } |
AzureIoTClient | 16:22a72cf8e416 | 7048 | else |
AzureIoTClient | 16:22a72cf8e416 | 7049 | { |
AzureIoTClient | 16:22a72cf8e416 | 7050 | *closed_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 7051 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 7052 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7053 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7054 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7055 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7056 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7057 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7058 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7059 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7060 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7061 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7062 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7063 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7064 | int detach_set_closed(DETACH_HANDLE detach, bool closed_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7065 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7066 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7067 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7068 | if (detach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7069 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7070 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7071 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7072 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7073 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7074 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)detach; |
Azure.IoT Build | 0:6ae2f7bca550 | 7075 | AMQP_VALUE closed_amqp_value = amqpvalue_create_boolean(closed_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7076 | if (closed_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7077 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7078 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7079 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7080 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7081 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7082 | if (amqpvalue_set_composite_item(detach_instance->composite_value, 1, closed_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7083 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7084 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7085 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7086 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7087 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7088 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7089 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7090 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7091 | amqpvalue_destroy(closed_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7092 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7093 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7094 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7095 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7096 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7097 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7098 | int detach_get_error(DETACH_HANDLE detach, ERROR_HANDLE* error_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7099 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7100 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7101 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7102 | if (detach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7103 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7104 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7105 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7106 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7107 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7108 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)detach; |
Azure.IoT Build | 0:6ae2f7bca550 | 7109 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(detach_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 7110 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7111 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7112 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7113 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7114 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7115 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7116 | if (amqpvalue_get_error(item_value, error_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7117 | { |
AzureIoTClient | 16:22a72cf8e416 | 7118 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7119 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7120 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7121 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7122 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7123 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7124 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7125 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7126 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7127 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7128 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7129 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7130 | int detach_set_error(DETACH_HANDLE detach, ERROR_HANDLE error_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7131 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7132 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7133 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7134 | if (detach == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7135 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7136 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7137 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7138 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7139 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7140 | DETACH_INSTANCE* detach_instance = (DETACH_INSTANCE*)detach; |
Azure.IoT Build | 0:6ae2f7bca550 | 7141 | AMQP_VALUE error_amqp_value = amqpvalue_create_error(error_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7142 | if (error_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7143 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7144 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7145 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7146 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7147 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7148 | if (amqpvalue_set_composite_item(detach_instance->composite_value, 2, error_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7149 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7150 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7151 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7152 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7153 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7154 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7155 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7156 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7157 | amqpvalue_destroy(error_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7158 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7159 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7160 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7161 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7162 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7163 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7164 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7165 | /* end */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7166 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7167 | typedef struct END_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 7168 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7169 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7170 | } END_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 7171 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7172 | static END_HANDLE end_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 7173 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7174 | END_INSTANCE* end_instance = (END_INSTANCE*)amqpalloc_malloc(sizeof(END_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7175 | if (end_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7176 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7177 | end_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7178 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7179 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7180 | return end_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7181 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7182 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7183 | END_HANDLE end_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 7184 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7185 | END_INSTANCE* end_instance = (END_INSTANCE*)amqpalloc_malloc(sizeof(END_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7186 | if (end_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7187 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7188 | end_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(23); |
Azure.IoT Build | 0:6ae2f7bca550 | 7189 | if (end_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7190 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7191 | amqpalloc_free(end_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7192 | end_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7193 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7194 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7195 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7196 | return end_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7197 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7198 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7199 | END_HANDLE end_clone(END_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7200 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7201 | END_INSTANCE* end_instance = (END_INSTANCE*)amqpalloc_malloc(sizeof(END_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7202 | if (end_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7203 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7204 | end_instance->composite_value = amqpvalue_clone(((END_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7205 | if (end_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7206 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7207 | amqpalloc_free(end_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7208 | end_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7209 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7210 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7211 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7212 | return end_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7213 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7214 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7215 | void end_destroy(END_HANDLE end) |
Azure.IoT Build | 0:6ae2f7bca550 | 7216 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7217 | if (end != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7218 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7219 | END_INSTANCE* end_instance = (END_INSTANCE*)end; |
Azure.IoT Build | 0:6ae2f7bca550 | 7220 | amqpvalue_destroy(end_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7221 | amqpalloc_free(end_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7222 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7223 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7224 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7225 | AMQP_VALUE amqpvalue_create_end(END_HANDLE end) |
Azure.IoT Build | 0:6ae2f7bca550 | 7226 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7227 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7228 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7229 | if (end == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7230 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7231 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7232 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7233 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7234 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7235 | END_INSTANCE* end_instance = (END_INSTANCE*)end; |
Azure.IoT Build | 0:6ae2f7bca550 | 7236 | result = amqpvalue_clone(end_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7237 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7238 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7239 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7240 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7241 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7242 | bool is_end_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 7243 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7244 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7245 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7246 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 7247 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 7248 | (descriptor_ulong == 23)) |
Azure.IoT Build | 0:6ae2f7bca550 | 7249 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7250 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 7251 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7252 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7253 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7254 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 7255 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7256 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7257 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7258 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7259 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7260 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7261 | int amqpvalue_get_end(AMQP_VALUE value, END_HANDLE* end_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 7262 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7263 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7264 | END_INSTANCE* end_instance = (END_INSTANCE*)end_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 7265 | *end_handle = end_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7266 | if (*end_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7267 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7268 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7269 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7270 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7271 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7272 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7273 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7274 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7275 | end_destroy(*end_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7276 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7277 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7278 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7279 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7280 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 7281 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7282 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7283 | /* error */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7284 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7285 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7286 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7287 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7288 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7289 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7290 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7291 | ERROR_HANDLE error; |
Azure.IoT Build | 0:6ae2f7bca550 | 7292 | if (amqpvalue_get_error(item_value, &error) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7293 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7294 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7295 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7296 | end_destroy(*end_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7297 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7298 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 7299 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7300 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7301 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7302 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7303 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7304 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7305 | end_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7306 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7307 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7308 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7309 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7310 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7311 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7312 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7313 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7314 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7315 | int end_get_error(END_HANDLE end, ERROR_HANDLE* error_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7316 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7317 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7318 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7319 | if (end == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7320 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7321 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7322 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7323 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7324 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7325 | END_INSTANCE* end_instance = (END_INSTANCE*)end; |
Azure.IoT Build | 0:6ae2f7bca550 | 7326 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(end_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7327 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7328 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7329 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7330 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7331 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7332 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7333 | if (amqpvalue_get_error(item_value, error_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7334 | { |
AzureIoTClient | 16:22a72cf8e416 | 7335 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7336 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7337 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7338 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7339 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7340 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7341 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7342 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7343 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7344 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7345 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7346 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7347 | int end_set_error(END_HANDLE end, ERROR_HANDLE error_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7348 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7349 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7350 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7351 | if (end == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7352 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7353 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7354 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7355 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7356 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7357 | END_INSTANCE* end_instance = (END_INSTANCE*)end; |
Azure.IoT Build | 0:6ae2f7bca550 | 7358 | AMQP_VALUE error_amqp_value = amqpvalue_create_error(error_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7359 | if (error_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7360 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7361 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7362 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7363 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7364 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7365 | if (amqpvalue_set_composite_item(end_instance->composite_value, 0, error_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7366 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7367 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7368 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7369 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7370 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7371 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7372 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7373 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7374 | amqpvalue_destroy(error_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7375 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7376 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7377 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7378 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7379 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7380 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7381 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7382 | /* close */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7383 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7384 | typedef struct CLOSE_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 7385 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7386 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7387 | } CLOSE_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 7388 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7389 | static CLOSE_HANDLE close_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 7390 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7391 | CLOSE_INSTANCE* close_instance = (CLOSE_INSTANCE*)amqpalloc_malloc(sizeof(CLOSE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7392 | if (close_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7393 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7394 | close_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7395 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7396 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7397 | return close_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7398 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7399 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7400 | CLOSE_HANDLE close_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 7401 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7402 | CLOSE_INSTANCE* close_instance = (CLOSE_INSTANCE*)amqpalloc_malloc(sizeof(CLOSE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7403 | if (close_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7404 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7405 | close_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(24); |
Azure.IoT Build | 0:6ae2f7bca550 | 7406 | if (close_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7407 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7408 | amqpalloc_free(close_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7409 | close_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7410 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7411 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7412 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7413 | return close_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7414 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7415 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7416 | CLOSE_HANDLE close_clone(CLOSE_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7417 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7418 | CLOSE_INSTANCE* close_instance = (CLOSE_INSTANCE*)amqpalloc_malloc(sizeof(CLOSE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7419 | if (close_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7420 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7421 | close_instance->composite_value = amqpvalue_clone(((CLOSE_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7422 | if (close_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7423 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7424 | amqpalloc_free(close_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7425 | close_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7426 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7427 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7428 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7429 | return close_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7430 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7431 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7432 | void close_destroy(CLOSE_HANDLE close) |
Azure.IoT Build | 0:6ae2f7bca550 | 7433 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7434 | if (close != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7435 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7436 | CLOSE_INSTANCE* close_instance = (CLOSE_INSTANCE*)close; |
Azure.IoT Build | 0:6ae2f7bca550 | 7437 | amqpvalue_destroy(close_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7438 | amqpalloc_free(close_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7439 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7440 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7441 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7442 | AMQP_VALUE amqpvalue_create_close(CLOSE_HANDLE close) |
Azure.IoT Build | 0:6ae2f7bca550 | 7443 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7444 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7445 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7446 | if (close == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7447 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7448 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7449 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7450 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7451 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7452 | CLOSE_INSTANCE* close_instance = (CLOSE_INSTANCE*)close; |
Azure.IoT Build | 0:6ae2f7bca550 | 7453 | result = amqpvalue_clone(close_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7454 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7455 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7456 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7457 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7458 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7459 | bool is_close_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 7460 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7461 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7462 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7463 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 7464 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 7465 | (descriptor_ulong == 24)) |
Azure.IoT Build | 0:6ae2f7bca550 | 7466 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7467 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 7468 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7469 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7470 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7471 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 7472 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7473 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7474 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7475 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7476 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7477 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7478 | int amqpvalue_get_close(AMQP_VALUE value, CLOSE_HANDLE* close_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 7479 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7480 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7481 | CLOSE_INSTANCE* close_instance = (CLOSE_INSTANCE*)close_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 7482 | *close_handle = close_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7483 | if (*close_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7484 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7485 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7486 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7487 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7488 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7489 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7490 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7491 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7492 | close_destroy(*close_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7493 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7494 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7495 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7496 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7497 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 7498 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7499 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7500 | /* error */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7501 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7502 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7503 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7504 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7505 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7506 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7507 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7508 | ERROR_HANDLE error; |
Azure.IoT Build | 0:6ae2f7bca550 | 7509 | if (amqpvalue_get_error(item_value, &error) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7510 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7511 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7512 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7513 | close_destroy(*close_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7514 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7515 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 7516 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7517 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7518 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7519 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7520 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7521 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7522 | close_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7523 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7524 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7525 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7526 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7527 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7528 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7529 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7530 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7531 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7532 | int close_get_error(CLOSE_HANDLE close, ERROR_HANDLE* error_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7533 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7534 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7535 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7536 | if (close == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7537 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7538 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7539 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7540 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7541 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7542 | CLOSE_INSTANCE* close_instance = (CLOSE_INSTANCE*)close; |
Azure.IoT Build | 0:6ae2f7bca550 | 7543 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(close_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7544 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7545 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7546 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7547 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7548 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7549 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7550 | if (amqpvalue_get_error(item_value, error_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7551 | { |
AzureIoTClient | 16:22a72cf8e416 | 7552 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7553 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7554 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7555 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7556 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7557 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7558 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7559 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7560 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7561 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7562 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7563 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7564 | int close_set_error(CLOSE_HANDLE close, ERROR_HANDLE error_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7565 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7566 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7567 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7568 | if (close == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7569 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7570 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7571 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7572 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7573 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7574 | CLOSE_INSTANCE* close_instance = (CLOSE_INSTANCE*)close; |
Azure.IoT Build | 0:6ae2f7bca550 | 7575 | AMQP_VALUE error_amqp_value = amqpvalue_create_error(error_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7576 | if (error_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7577 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7578 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7579 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7580 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7581 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7582 | if (amqpvalue_set_composite_item(close_instance->composite_value, 0, error_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7583 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7584 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7585 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7586 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7587 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7588 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7589 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7590 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7591 | amqpvalue_destroy(error_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7592 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7593 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7594 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7595 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7596 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7597 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7598 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7599 | /* sasl-code */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7600 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7601 | AMQP_VALUE amqpvalue_create_sasl_code(sasl_code value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7602 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7603 | return amqpvalue_create_ubyte(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7604 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7605 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7606 | /* sasl-mechanisms */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7607 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7608 | typedef struct SASL_MECHANISMS_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 7609 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7610 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7611 | } SASL_MECHANISMS_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 7612 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7613 | static SASL_MECHANISMS_HANDLE sasl_mechanisms_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 7614 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7615 | SASL_MECHANISMS_INSTANCE* sasl_mechanisms_instance = (SASL_MECHANISMS_INSTANCE*)amqpalloc_malloc(sizeof(SASL_MECHANISMS_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7616 | if (sasl_mechanisms_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7617 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7618 | sasl_mechanisms_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7619 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7620 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7621 | return sasl_mechanisms_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7622 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7623 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7624 | SASL_MECHANISMS_HANDLE sasl_mechanisms_create(AMQP_VALUE sasl_server_mechanisms_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7625 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7626 | SASL_MECHANISMS_INSTANCE* sasl_mechanisms_instance = (SASL_MECHANISMS_INSTANCE*)amqpalloc_malloc(sizeof(SASL_MECHANISMS_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7627 | if (sasl_mechanisms_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7628 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7629 | sasl_mechanisms_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(64); |
Azure.IoT Build | 0:6ae2f7bca550 | 7630 | if (sasl_mechanisms_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7631 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7632 | amqpalloc_free(sasl_mechanisms_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7633 | sasl_mechanisms_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7634 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7635 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7636 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7637 | AMQP_VALUE sasl_server_mechanisms_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7638 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7639 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7640 | sasl_server_mechanisms_amqp_value = sasl_server_mechanisms_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7641 | if ((result == 0) && (amqpvalue_set_composite_item(sasl_mechanisms_instance->composite_value, 0, sasl_server_mechanisms_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 7642 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7643 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7644 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7645 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7646 | amqpvalue_destroy(sasl_server_mechanisms_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7647 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7648 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7649 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7650 | return sasl_mechanisms_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7651 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7652 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7653 | SASL_MECHANISMS_HANDLE sasl_mechanisms_clone(SASL_MECHANISMS_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7654 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7655 | SASL_MECHANISMS_INSTANCE* sasl_mechanisms_instance = (SASL_MECHANISMS_INSTANCE*)amqpalloc_malloc(sizeof(SASL_MECHANISMS_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7656 | if (sasl_mechanisms_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7657 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7658 | sasl_mechanisms_instance->composite_value = amqpvalue_clone(((SASL_MECHANISMS_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7659 | if (sasl_mechanisms_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7660 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7661 | amqpalloc_free(sasl_mechanisms_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7662 | sasl_mechanisms_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7663 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7664 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7665 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7666 | return sasl_mechanisms_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7667 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7668 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7669 | void sasl_mechanisms_destroy(SASL_MECHANISMS_HANDLE sasl_mechanisms) |
Azure.IoT Build | 0:6ae2f7bca550 | 7670 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7671 | if (sasl_mechanisms != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7672 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7673 | SASL_MECHANISMS_INSTANCE* sasl_mechanisms_instance = (SASL_MECHANISMS_INSTANCE*)sasl_mechanisms; |
Azure.IoT Build | 0:6ae2f7bca550 | 7674 | amqpvalue_destroy(sasl_mechanisms_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7675 | amqpalloc_free(sasl_mechanisms_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7676 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7677 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7678 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7679 | AMQP_VALUE amqpvalue_create_sasl_mechanisms(SASL_MECHANISMS_HANDLE sasl_mechanisms) |
Azure.IoT Build | 0:6ae2f7bca550 | 7680 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7681 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7682 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7683 | if (sasl_mechanisms == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7684 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7685 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7686 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7687 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7688 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7689 | SASL_MECHANISMS_INSTANCE* sasl_mechanisms_instance = (SASL_MECHANISMS_INSTANCE*)sasl_mechanisms; |
Azure.IoT Build | 0:6ae2f7bca550 | 7690 | result = amqpvalue_clone(sasl_mechanisms_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7691 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7692 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7693 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7694 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7695 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7696 | bool is_sasl_mechanisms_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 7697 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7698 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7699 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7700 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 7701 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 7702 | (descriptor_ulong == 64)) |
Azure.IoT Build | 0:6ae2f7bca550 | 7703 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7704 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 7705 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7706 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7707 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7708 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 7709 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7710 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7711 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7712 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7713 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7714 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7715 | int amqpvalue_get_sasl_mechanisms(AMQP_VALUE value, SASL_MECHANISMS_HANDLE* sasl_mechanisms_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 7716 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7717 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7718 | SASL_MECHANISMS_INSTANCE* sasl_mechanisms_instance = (SASL_MECHANISMS_INSTANCE*)sasl_mechanisms_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 7719 | *sasl_mechanisms_handle = sasl_mechanisms_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7720 | if (*sasl_mechanisms_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7721 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7722 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7723 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7724 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7725 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7726 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7727 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7728 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7729 | sasl_mechanisms_destroy(*sasl_mechanisms_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7730 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7731 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7732 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7733 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7734 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 7735 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7736 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7737 | /* sasl-server-mechanisms */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7738 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7739 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7740 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7741 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7742 | sasl_mechanisms_destroy(*sasl_mechanisms_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7743 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7744 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 7745 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7746 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7747 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7748 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7749 | const char* sasl_server_mechanisms; |
Azure.IoT Build | 0:6ae2f7bca550 | 7750 | AMQP_VALUE sasl_server_mechanisms_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 7751 | if ((amqpvalue_get_array(item_value, &sasl_server_mechanisms_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 7752 | (amqpvalue_get_symbol(item_value, &sasl_server_mechanisms) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 7753 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7754 | sasl_mechanisms_destroy(*sasl_mechanisms_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7755 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7756 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 7757 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7758 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7759 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7760 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7761 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7762 | sasl_mechanisms_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7763 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7764 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7765 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7766 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7767 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7768 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7769 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7770 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7771 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7772 | int sasl_mechanisms_get_sasl_server_mechanisms(SASL_MECHANISMS_HANDLE sasl_mechanisms, AMQP_VALUE* sasl_server_mechanisms_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7773 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7774 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7775 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7776 | if (sasl_mechanisms == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7777 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7778 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7779 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7780 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7781 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7782 | SASL_MECHANISMS_INSTANCE* sasl_mechanisms_instance = (SASL_MECHANISMS_INSTANCE*)sasl_mechanisms; |
Azure.IoT Build | 0:6ae2f7bca550 | 7783 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(sasl_mechanisms_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7784 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7785 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7786 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7787 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7788 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7789 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7790 | if (amqpvalue_get_array(item_value, sasl_server_mechanisms_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7791 | { |
AzureIoTClient | 16:22a72cf8e416 | 7792 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7793 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7794 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7795 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7796 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7797 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7798 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7799 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7800 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7801 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7802 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7803 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7804 | int sasl_mechanisms_set_sasl_server_mechanisms(SASL_MECHANISMS_HANDLE sasl_mechanisms, AMQP_VALUE sasl_server_mechanisms_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7805 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7806 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7807 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7808 | if (sasl_mechanisms == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7809 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7810 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7811 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7812 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7813 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7814 | SASL_MECHANISMS_INSTANCE* sasl_mechanisms_instance = (SASL_MECHANISMS_INSTANCE*)sasl_mechanisms; |
Azure.IoT Build | 0:6ae2f7bca550 | 7815 | AMQP_VALUE sasl_server_mechanisms_amqp_value = amqpvalue_clone(sasl_server_mechanisms_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7816 | if (sasl_server_mechanisms_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7817 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7818 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7819 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7820 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7821 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7822 | if (amqpvalue_set_composite_item(sasl_mechanisms_instance->composite_value, 0, sasl_server_mechanisms_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7823 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7824 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7825 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7826 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7827 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7828 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7829 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7830 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7831 | amqpvalue_destroy(sasl_server_mechanisms_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7832 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7833 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7834 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7835 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7836 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7837 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7838 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7839 | /* sasl-init */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7840 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7841 | typedef struct SASL_INIT_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 7842 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7843 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7844 | } SASL_INIT_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 7845 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7846 | static SASL_INIT_HANDLE sasl_init_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 7847 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7848 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)amqpalloc_malloc(sizeof(SASL_INIT_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7849 | if (sasl_init_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7850 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7851 | sasl_init_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7852 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7853 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7854 | return sasl_init_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7855 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7856 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7857 | SASL_INIT_HANDLE sasl_init_create(const char* mechanism_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7858 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7859 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)amqpalloc_malloc(sizeof(SASL_INIT_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7860 | if (sasl_init_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7861 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7862 | sasl_init_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(65); |
Azure.IoT Build | 0:6ae2f7bca550 | 7863 | if (sasl_init_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7864 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7865 | amqpalloc_free(sasl_init_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7866 | sasl_init_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7867 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7868 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7869 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7870 | AMQP_VALUE mechanism_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7871 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 7872 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7873 | mechanism_amqp_value = amqpvalue_create_symbol(mechanism_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7874 | if ((result == 0) && (amqpvalue_set_composite_item(sasl_init_instance->composite_value, 0, mechanism_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 7875 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7876 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7877 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7878 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7879 | amqpvalue_destroy(mechanism_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7880 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7881 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7882 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7883 | return sasl_init_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7884 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7885 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7886 | SASL_INIT_HANDLE sasl_init_clone(SASL_INIT_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 7887 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7888 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)amqpalloc_malloc(sizeof(SASL_INIT_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 7889 | if (sasl_init_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7890 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7891 | sasl_init_instance->composite_value = amqpvalue_clone(((SASL_INIT_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7892 | if (sasl_init_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7893 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7894 | amqpalloc_free(sasl_init_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7895 | sasl_init_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7896 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7897 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7898 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7899 | return sasl_init_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7900 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7901 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7902 | void sasl_init_destroy(SASL_INIT_HANDLE sasl_init) |
Azure.IoT Build | 0:6ae2f7bca550 | 7903 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7904 | if (sasl_init != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7905 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7906 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)sasl_init; |
Azure.IoT Build | 0:6ae2f7bca550 | 7907 | amqpvalue_destroy(sasl_init_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7908 | amqpalloc_free(sasl_init_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 7909 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7910 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7911 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7912 | AMQP_VALUE amqpvalue_create_sasl_init(SASL_INIT_HANDLE sasl_init) |
Azure.IoT Build | 0:6ae2f7bca550 | 7913 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7914 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7915 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7916 | if (sasl_init == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7917 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7918 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 7919 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7920 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7921 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7922 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)sasl_init; |
Azure.IoT Build | 0:6ae2f7bca550 | 7923 | result = amqpvalue_clone(sasl_init_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7924 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7925 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7926 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7927 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7928 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7929 | bool is_sasl_init_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 7930 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7931 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7932 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7933 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 7934 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 7935 | (descriptor_ulong == 65)) |
Azure.IoT Build | 0:6ae2f7bca550 | 7936 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7937 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 7938 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7939 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7940 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7941 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 7942 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7943 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7944 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7945 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7946 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7947 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7948 | int amqpvalue_get_sasl_init(AMQP_VALUE value, SASL_INIT_HANDLE* sasl_init_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 7949 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7950 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 7951 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)sasl_init_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 7952 | *sasl_init_handle = sasl_init_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 7953 | if (*sasl_init_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7954 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7955 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7956 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7957 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7958 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7959 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7960 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7961 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7962 | sasl_init_destroy(*sasl_init_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7963 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7964 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7965 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7966 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7967 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 7968 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7969 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 7970 | /* mechanism */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7971 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 7972 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7973 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7974 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7975 | sasl_init_destroy(*sasl_init_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7976 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7977 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 7978 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7979 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7980 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7981 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7982 | const char* mechanism; |
Azure.IoT Build | 0:6ae2f7bca550 | 7983 | if (amqpvalue_get_symbol(item_value, &mechanism) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 7984 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7985 | sasl_init_destroy(*sasl_init_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 7986 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 7987 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 7988 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7989 | |
Azure.IoT Build | 0:6ae2f7bca550 | 7990 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 7991 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7992 | /* initial-response */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7993 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 7994 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 7995 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 7996 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 7997 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 7998 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 7999 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8000 | amqp_binary initial_response; |
Azure.IoT Build | 0:6ae2f7bca550 | 8001 | if (amqpvalue_get_binary(item_value, &initial_response) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8002 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8003 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8004 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8005 | sasl_init_destroy(*sasl_init_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8006 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8007 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 8008 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8009 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8010 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8011 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8012 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8013 | /* hostname */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8014 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 8015 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8016 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8017 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8018 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8019 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8020 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8021 | const char* hostname; |
Azure.IoT Build | 0:6ae2f7bca550 | 8022 | if (amqpvalue_get_string(item_value, &hostname) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8023 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8024 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8025 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8026 | sasl_init_destroy(*sasl_init_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8027 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8028 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 8029 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8030 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8031 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8032 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8033 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8034 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8035 | sasl_init_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8036 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8037 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8038 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8039 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8040 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8041 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8042 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8043 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8044 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8045 | int sasl_init_get_mechanism(SASL_INIT_HANDLE sasl_init, const char** mechanism_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8046 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8047 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8048 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8049 | if (sasl_init == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8050 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8051 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8052 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8053 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8054 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8055 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)sasl_init; |
Azure.IoT Build | 0:6ae2f7bca550 | 8056 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(sasl_init_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8057 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8058 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8059 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8060 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8061 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8062 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8063 | if (amqpvalue_get_symbol(item_value, mechanism_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8064 | { |
AzureIoTClient | 16:22a72cf8e416 | 8065 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8066 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8067 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8068 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8069 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8070 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8071 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8072 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8073 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8074 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8075 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8076 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8077 | int sasl_init_set_mechanism(SASL_INIT_HANDLE sasl_init, const char* mechanism_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8078 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8079 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8080 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8081 | if (sasl_init == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8082 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8083 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8084 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8085 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8086 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8087 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)sasl_init; |
Azure.IoT Build | 0:6ae2f7bca550 | 8088 | AMQP_VALUE mechanism_amqp_value = amqpvalue_create_symbol(mechanism_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8089 | if (mechanism_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8090 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8091 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8092 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8093 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8094 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8095 | if (amqpvalue_set_composite_item(sasl_init_instance->composite_value, 0, mechanism_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8096 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8097 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8098 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8099 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8100 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8101 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8102 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8103 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8104 | amqpvalue_destroy(mechanism_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8105 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8106 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8107 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8108 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8109 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8110 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8111 | int sasl_init_get_initial_response(SASL_INIT_HANDLE sasl_init, amqp_binary* initial_response_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8112 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8113 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8114 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8115 | if (sasl_init == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8116 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8117 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8118 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8119 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8120 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8121 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)sasl_init; |
Azure.IoT Build | 0:6ae2f7bca550 | 8122 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(sasl_init_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 8123 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8124 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8125 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8126 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8127 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8128 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8129 | if (amqpvalue_get_binary(item_value, initial_response_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8130 | { |
AzureIoTClient | 16:22a72cf8e416 | 8131 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8132 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8133 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8134 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8135 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8136 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8137 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8138 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8139 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8140 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8141 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8142 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8143 | int sasl_init_set_initial_response(SASL_INIT_HANDLE sasl_init, amqp_binary initial_response_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8144 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8145 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8146 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8147 | if (sasl_init == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8148 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8149 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8150 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8151 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8152 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8153 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)sasl_init; |
Azure.IoT Build | 0:6ae2f7bca550 | 8154 | AMQP_VALUE initial_response_amqp_value = amqpvalue_create_binary(initial_response_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8155 | if (initial_response_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8156 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8157 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8158 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8159 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8160 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8161 | if (amqpvalue_set_composite_item(sasl_init_instance->composite_value, 1, initial_response_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8162 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8163 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8164 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8165 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8166 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8167 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8168 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8169 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8170 | amqpvalue_destroy(initial_response_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8171 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8172 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8173 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8174 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8175 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8176 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8177 | int sasl_init_get_hostname(SASL_INIT_HANDLE sasl_init, const char** hostname_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8178 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8179 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8180 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8181 | if (sasl_init == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8182 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8183 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8184 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8185 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8186 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8187 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)sasl_init; |
Azure.IoT Build | 0:6ae2f7bca550 | 8188 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(sasl_init_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 8189 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8190 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8191 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8192 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8193 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8194 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8195 | if (amqpvalue_get_string(item_value, hostname_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8196 | { |
AzureIoTClient | 16:22a72cf8e416 | 8197 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8198 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8199 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8200 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8201 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8202 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8203 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8204 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8205 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8206 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8207 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8208 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8209 | int sasl_init_set_hostname(SASL_INIT_HANDLE sasl_init, const char* hostname_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8210 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8211 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8212 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8213 | if (sasl_init == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8214 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8215 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8216 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8217 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8218 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8219 | SASL_INIT_INSTANCE* sasl_init_instance = (SASL_INIT_INSTANCE*)sasl_init; |
Azure.IoT Build | 0:6ae2f7bca550 | 8220 | AMQP_VALUE hostname_amqp_value = amqpvalue_create_string(hostname_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8221 | if (hostname_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8222 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8223 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8224 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8225 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8226 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8227 | if (amqpvalue_set_composite_item(sasl_init_instance->composite_value, 2, hostname_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8228 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8229 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8230 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8231 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8232 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8233 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8234 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8235 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8236 | amqpvalue_destroy(hostname_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8237 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8238 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8239 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8240 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8241 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8242 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8243 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8244 | /* sasl-challenge */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8245 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8246 | typedef struct SASL_CHALLENGE_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 8247 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8248 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 8249 | } SASL_CHALLENGE_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 8250 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8251 | static SASL_CHALLENGE_HANDLE sasl_challenge_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 8252 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8253 | SASL_CHALLENGE_INSTANCE* sasl_challenge_instance = (SASL_CHALLENGE_INSTANCE*)amqpalloc_malloc(sizeof(SASL_CHALLENGE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 8254 | if (sasl_challenge_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8255 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8256 | sasl_challenge_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8257 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8258 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8259 | return sasl_challenge_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8260 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8261 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8262 | SASL_CHALLENGE_HANDLE sasl_challenge_create(amqp_binary challenge_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8263 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8264 | SASL_CHALLENGE_INSTANCE* sasl_challenge_instance = (SASL_CHALLENGE_INSTANCE*)amqpalloc_malloc(sizeof(SASL_CHALLENGE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 8265 | if (sasl_challenge_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8266 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8267 | sasl_challenge_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(66); |
Azure.IoT Build | 0:6ae2f7bca550 | 8268 | if (sasl_challenge_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8269 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8270 | amqpalloc_free(sasl_challenge_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 8271 | sasl_challenge_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8272 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8273 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8274 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8275 | AMQP_VALUE challenge_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 8276 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8277 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8278 | challenge_amqp_value = amqpvalue_create_binary(challenge_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8279 | if ((result == 0) && (amqpvalue_set_composite_item(sasl_challenge_instance->composite_value, 0, challenge_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 8280 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8281 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8282 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8283 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8284 | amqpvalue_destroy(challenge_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8285 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8286 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8287 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8288 | return sasl_challenge_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8289 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8290 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8291 | SASL_CHALLENGE_HANDLE sasl_challenge_clone(SASL_CHALLENGE_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8292 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8293 | SASL_CHALLENGE_INSTANCE* sasl_challenge_instance = (SASL_CHALLENGE_INSTANCE*)amqpalloc_malloc(sizeof(SASL_CHALLENGE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 8294 | if (sasl_challenge_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8295 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8296 | sasl_challenge_instance->composite_value = amqpvalue_clone(((SASL_CHALLENGE_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8297 | if (sasl_challenge_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8298 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8299 | amqpalloc_free(sasl_challenge_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 8300 | sasl_challenge_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8301 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8302 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8303 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8304 | return sasl_challenge_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8305 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8306 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8307 | void sasl_challenge_destroy(SASL_CHALLENGE_HANDLE sasl_challenge) |
Azure.IoT Build | 0:6ae2f7bca550 | 8308 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8309 | if (sasl_challenge != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8310 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8311 | SASL_CHALLENGE_INSTANCE* sasl_challenge_instance = (SASL_CHALLENGE_INSTANCE*)sasl_challenge; |
Azure.IoT Build | 0:6ae2f7bca550 | 8312 | amqpvalue_destroy(sasl_challenge_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8313 | amqpalloc_free(sasl_challenge_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 8314 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8315 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8316 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8317 | AMQP_VALUE amqpvalue_create_sasl_challenge(SASL_CHALLENGE_HANDLE sasl_challenge) |
Azure.IoT Build | 0:6ae2f7bca550 | 8318 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8319 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8320 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8321 | if (sasl_challenge == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8322 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8323 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8324 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8325 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8326 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8327 | SASL_CHALLENGE_INSTANCE* sasl_challenge_instance = (SASL_CHALLENGE_INSTANCE*)sasl_challenge; |
Azure.IoT Build | 0:6ae2f7bca550 | 8328 | result = amqpvalue_clone(sasl_challenge_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8329 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8330 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8331 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8332 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8333 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8334 | bool is_sasl_challenge_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 8335 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8336 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8337 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8338 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 8339 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 8340 | (descriptor_ulong == 66)) |
Azure.IoT Build | 0:6ae2f7bca550 | 8341 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8342 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 8343 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8344 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8345 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8346 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 8347 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8348 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8349 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8350 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8351 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8352 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8353 | int amqpvalue_get_sasl_challenge(AMQP_VALUE value, SASL_CHALLENGE_HANDLE* sasl_challenge_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 8354 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8355 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8356 | SASL_CHALLENGE_INSTANCE* sasl_challenge_instance = (SASL_CHALLENGE_INSTANCE*)sasl_challenge_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 8357 | *sasl_challenge_handle = sasl_challenge_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8358 | if (*sasl_challenge_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8359 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8360 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8361 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8362 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8363 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8364 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8365 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8366 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8367 | sasl_challenge_destroy(*sasl_challenge_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8368 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8369 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8370 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8371 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8372 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 8373 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8374 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 8375 | /* challenge */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8376 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8377 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8378 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8379 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8380 | sasl_challenge_destroy(*sasl_challenge_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8381 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8382 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 8383 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8384 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8385 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8386 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8387 | amqp_binary challenge; |
Azure.IoT Build | 0:6ae2f7bca550 | 8388 | if (amqpvalue_get_binary(item_value, &challenge) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8389 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8390 | sasl_challenge_destroy(*sasl_challenge_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8391 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8392 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 8393 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8394 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8395 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8396 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8397 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8398 | sasl_challenge_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8399 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8400 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8401 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8402 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8403 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8404 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8405 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8406 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8407 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8408 | int sasl_challenge_get_challenge(SASL_CHALLENGE_HANDLE sasl_challenge, amqp_binary* challenge_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8409 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8410 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8411 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8412 | if (sasl_challenge == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8413 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8414 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8415 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8416 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8417 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8418 | SASL_CHALLENGE_INSTANCE* sasl_challenge_instance = (SASL_CHALLENGE_INSTANCE*)sasl_challenge; |
Azure.IoT Build | 0:6ae2f7bca550 | 8419 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(sasl_challenge_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8420 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8421 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8422 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8423 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8424 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8425 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8426 | if (amqpvalue_get_binary(item_value, challenge_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8427 | { |
AzureIoTClient | 16:22a72cf8e416 | 8428 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8429 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8430 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8431 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8432 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8433 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8434 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8435 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8436 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8437 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8438 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8439 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8440 | int sasl_challenge_set_challenge(SASL_CHALLENGE_HANDLE sasl_challenge, amqp_binary challenge_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8441 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8442 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8443 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8444 | if (sasl_challenge == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8445 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8446 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8447 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8448 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8449 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8450 | SASL_CHALLENGE_INSTANCE* sasl_challenge_instance = (SASL_CHALLENGE_INSTANCE*)sasl_challenge; |
Azure.IoT Build | 0:6ae2f7bca550 | 8451 | AMQP_VALUE challenge_amqp_value = amqpvalue_create_binary(challenge_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8452 | if (challenge_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8453 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8454 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8455 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8456 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8457 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8458 | if (amqpvalue_set_composite_item(sasl_challenge_instance->composite_value, 0, challenge_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8459 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8460 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8461 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8462 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8463 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8464 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8465 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8466 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8467 | amqpvalue_destroy(challenge_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8468 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8469 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8470 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8471 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8472 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8473 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8474 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8475 | /* sasl-response */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8476 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8477 | typedef struct SASL_RESPONSE_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 8478 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8479 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 8480 | } SASL_RESPONSE_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 8481 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8482 | static SASL_RESPONSE_HANDLE sasl_response_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 8483 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8484 | SASL_RESPONSE_INSTANCE* sasl_response_instance = (SASL_RESPONSE_INSTANCE*)amqpalloc_malloc(sizeof(SASL_RESPONSE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 8485 | if (sasl_response_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8486 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8487 | sasl_response_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8488 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8489 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8490 | return sasl_response_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8491 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8492 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8493 | SASL_RESPONSE_HANDLE sasl_response_create(amqp_binary response_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8494 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8495 | SASL_RESPONSE_INSTANCE* sasl_response_instance = (SASL_RESPONSE_INSTANCE*)amqpalloc_malloc(sizeof(SASL_RESPONSE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 8496 | if (sasl_response_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8497 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8498 | sasl_response_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(67); |
Azure.IoT Build | 0:6ae2f7bca550 | 8499 | if (sasl_response_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8500 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8501 | amqpalloc_free(sasl_response_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 8502 | sasl_response_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8503 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8504 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8505 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8506 | AMQP_VALUE response_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 8507 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8508 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8509 | response_amqp_value = amqpvalue_create_binary(response_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8510 | if ((result == 0) && (amqpvalue_set_composite_item(sasl_response_instance->composite_value, 0, response_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 8511 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8512 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8513 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8514 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8515 | amqpvalue_destroy(response_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8516 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8517 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8518 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8519 | return sasl_response_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8520 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8521 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8522 | SASL_RESPONSE_HANDLE sasl_response_clone(SASL_RESPONSE_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8523 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8524 | SASL_RESPONSE_INSTANCE* sasl_response_instance = (SASL_RESPONSE_INSTANCE*)amqpalloc_malloc(sizeof(SASL_RESPONSE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 8525 | if (sasl_response_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8526 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8527 | sasl_response_instance->composite_value = amqpvalue_clone(((SASL_RESPONSE_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8528 | if (sasl_response_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8529 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8530 | amqpalloc_free(sasl_response_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 8531 | sasl_response_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8532 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8533 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8534 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8535 | return sasl_response_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8536 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8537 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8538 | void sasl_response_destroy(SASL_RESPONSE_HANDLE sasl_response) |
Azure.IoT Build | 0:6ae2f7bca550 | 8539 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8540 | if (sasl_response != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8541 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8542 | SASL_RESPONSE_INSTANCE* sasl_response_instance = (SASL_RESPONSE_INSTANCE*)sasl_response; |
Azure.IoT Build | 0:6ae2f7bca550 | 8543 | amqpvalue_destroy(sasl_response_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8544 | amqpalloc_free(sasl_response_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 8545 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8546 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8547 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8548 | AMQP_VALUE amqpvalue_create_sasl_response(SASL_RESPONSE_HANDLE sasl_response) |
Azure.IoT Build | 0:6ae2f7bca550 | 8549 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8550 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8551 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8552 | if (sasl_response == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8553 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8554 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8555 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8556 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8557 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8558 | SASL_RESPONSE_INSTANCE* sasl_response_instance = (SASL_RESPONSE_INSTANCE*)sasl_response; |
Azure.IoT Build | 0:6ae2f7bca550 | 8559 | result = amqpvalue_clone(sasl_response_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8560 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8561 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8562 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8563 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8564 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8565 | bool is_sasl_response_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 8566 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8567 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8568 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8569 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 8570 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 8571 | (descriptor_ulong == 67)) |
Azure.IoT Build | 0:6ae2f7bca550 | 8572 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8573 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 8574 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8575 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8576 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8577 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 8578 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8579 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8580 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8581 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8582 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8583 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8584 | int amqpvalue_get_sasl_response(AMQP_VALUE value, SASL_RESPONSE_HANDLE* sasl_response_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 8585 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8586 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8587 | SASL_RESPONSE_INSTANCE* sasl_response_instance = (SASL_RESPONSE_INSTANCE*)sasl_response_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 8588 | *sasl_response_handle = sasl_response_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8589 | if (*sasl_response_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8590 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8591 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8592 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8593 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8594 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8595 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8596 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8597 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8598 | sasl_response_destroy(*sasl_response_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8599 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8600 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8601 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8602 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8603 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 8604 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8605 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 8606 | /* response */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8607 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8608 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8609 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8610 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8611 | sasl_response_destroy(*sasl_response_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8612 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8613 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 8614 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8615 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8616 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8617 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8618 | amqp_binary response; |
Azure.IoT Build | 0:6ae2f7bca550 | 8619 | if (amqpvalue_get_binary(item_value, &response) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8620 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8621 | sasl_response_destroy(*sasl_response_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8622 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8623 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 8624 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8625 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8626 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8627 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8628 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8629 | sasl_response_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8630 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8631 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8632 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8633 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8634 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8635 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8636 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8637 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8638 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8639 | int sasl_response_get_response(SASL_RESPONSE_HANDLE sasl_response, amqp_binary* response_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8640 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8641 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8642 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8643 | if (sasl_response == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8644 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8645 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8646 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8647 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8648 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8649 | SASL_RESPONSE_INSTANCE* sasl_response_instance = (SASL_RESPONSE_INSTANCE*)sasl_response; |
Azure.IoT Build | 0:6ae2f7bca550 | 8650 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(sasl_response_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8651 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8652 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8653 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8654 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8655 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8656 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8657 | if (amqpvalue_get_binary(item_value, response_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8658 | { |
AzureIoTClient | 16:22a72cf8e416 | 8659 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8660 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8661 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8662 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8663 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8664 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8665 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8666 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8667 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8668 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8669 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8670 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8671 | int sasl_response_set_response(SASL_RESPONSE_HANDLE sasl_response, amqp_binary response_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8672 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8673 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8674 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8675 | if (sasl_response == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8676 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8677 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8678 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8679 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8680 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8681 | SASL_RESPONSE_INSTANCE* sasl_response_instance = (SASL_RESPONSE_INSTANCE*)sasl_response; |
Azure.IoT Build | 0:6ae2f7bca550 | 8682 | AMQP_VALUE response_amqp_value = amqpvalue_create_binary(response_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8683 | if (response_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8684 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8685 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8686 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8687 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8688 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8689 | if (amqpvalue_set_composite_item(sasl_response_instance->composite_value, 0, response_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8690 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8691 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8692 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8693 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8694 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8695 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8696 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8697 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8698 | amqpvalue_destroy(response_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8699 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8700 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8701 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8702 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8703 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8704 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8705 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8706 | /* sasl-outcome */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8707 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8708 | typedef struct SASL_OUTCOME_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 8709 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8710 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 8711 | } SASL_OUTCOME_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 8712 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8713 | static SASL_OUTCOME_HANDLE sasl_outcome_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 8714 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8715 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)amqpalloc_malloc(sizeof(SASL_OUTCOME_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 8716 | if (sasl_outcome_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8717 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8718 | sasl_outcome_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8719 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8720 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8721 | return sasl_outcome_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8722 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8723 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8724 | SASL_OUTCOME_HANDLE sasl_outcome_create(sasl_code code_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8725 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8726 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)amqpalloc_malloc(sizeof(SASL_OUTCOME_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 8727 | if (sasl_outcome_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8728 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8729 | sasl_outcome_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(68); |
Azure.IoT Build | 0:6ae2f7bca550 | 8730 | if (sasl_outcome_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8731 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8732 | amqpalloc_free(sasl_outcome_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 8733 | sasl_outcome_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8734 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8735 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8736 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8737 | AMQP_VALUE code_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 8738 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8739 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8740 | code_amqp_value = amqpvalue_create_sasl_code(code_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8741 | if ((result == 0) && (amqpvalue_set_composite_item(sasl_outcome_instance->composite_value, 0, code_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 8742 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8743 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8744 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8745 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8746 | amqpvalue_destroy(code_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8747 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8748 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8749 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8750 | return sasl_outcome_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8751 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8752 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8753 | SASL_OUTCOME_HANDLE sasl_outcome_clone(SASL_OUTCOME_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8754 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8755 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)amqpalloc_malloc(sizeof(SASL_OUTCOME_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 8756 | if (sasl_outcome_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8757 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8758 | sasl_outcome_instance->composite_value = amqpvalue_clone(((SASL_OUTCOME_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8759 | if (sasl_outcome_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8760 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8761 | amqpalloc_free(sasl_outcome_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 8762 | sasl_outcome_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8763 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8764 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8765 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8766 | return sasl_outcome_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8767 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8768 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8769 | void sasl_outcome_destroy(SASL_OUTCOME_HANDLE sasl_outcome) |
Azure.IoT Build | 0:6ae2f7bca550 | 8770 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8771 | if (sasl_outcome != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8772 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8773 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)sasl_outcome; |
Azure.IoT Build | 0:6ae2f7bca550 | 8774 | amqpvalue_destroy(sasl_outcome_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8775 | amqpalloc_free(sasl_outcome_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 8776 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8777 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8778 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8779 | AMQP_VALUE amqpvalue_create_sasl_outcome(SASL_OUTCOME_HANDLE sasl_outcome) |
Azure.IoT Build | 0:6ae2f7bca550 | 8780 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8781 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8782 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8783 | if (sasl_outcome == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8784 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8785 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 8786 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8787 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8788 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8789 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)sasl_outcome; |
Azure.IoT Build | 0:6ae2f7bca550 | 8790 | result = amqpvalue_clone(sasl_outcome_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8791 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8792 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8793 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8794 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8795 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8796 | bool is_sasl_outcome_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 8797 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8798 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8799 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8800 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 8801 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 8802 | (descriptor_ulong == 68)) |
Azure.IoT Build | 0:6ae2f7bca550 | 8803 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8804 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 8805 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8806 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8807 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8808 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 8809 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8810 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8811 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8812 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8813 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8814 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8815 | int amqpvalue_get_sasl_outcome(AMQP_VALUE value, SASL_OUTCOME_HANDLE* sasl_outcome_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 8816 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8817 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8818 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)sasl_outcome_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 8819 | *sasl_outcome_handle = sasl_outcome_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 8820 | if (*sasl_outcome_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8821 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8822 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8823 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8824 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8825 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8826 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8827 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8828 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8829 | sasl_outcome_destroy(*sasl_outcome_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8830 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8831 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8832 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8833 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8834 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 8835 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8836 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 8837 | /* code */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8838 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8839 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8840 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8841 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8842 | sasl_outcome_destroy(*sasl_outcome_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8843 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8844 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 8845 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8846 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8847 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8848 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8849 | sasl_code code; |
Azure.IoT Build | 0:6ae2f7bca550 | 8850 | if (amqpvalue_get_sasl_code(item_value, &code) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8851 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8852 | sasl_outcome_destroy(*sasl_outcome_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8853 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8854 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 8855 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8856 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8857 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8858 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8859 | /* additional-data */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8860 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 8861 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8862 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8863 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 8864 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8865 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8866 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8867 | amqp_binary additional_data; |
Azure.IoT Build | 0:6ae2f7bca550 | 8868 | if (amqpvalue_get_binary(item_value, &additional_data) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8869 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8870 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8871 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8872 | sasl_outcome_destroy(*sasl_outcome_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 8873 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8874 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 8875 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8876 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8877 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8878 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8879 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8880 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8881 | sasl_outcome_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8882 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8883 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8884 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8885 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8886 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8887 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8888 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8889 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8890 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8891 | int sasl_outcome_get_code(SASL_OUTCOME_HANDLE sasl_outcome, sasl_code* code_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8892 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8893 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8894 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8895 | if (sasl_outcome == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8896 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8897 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8898 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8899 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8900 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8901 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)sasl_outcome; |
Azure.IoT Build | 0:6ae2f7bca550 | 8902 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(sasl_outcome_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 8903 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8904 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8905 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8906 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8907 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8908 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8909 | if (amqpvalue_get_sasl_code(item_value, code_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8910 | { |
AzureIoTClient | 16:22a72cf8e416 | 8911 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8912 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8913 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8914 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8915 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8916 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8917 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8918 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8919 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8920 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8921 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8922 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8923 | int sasl_outcome_set_code(SASL_OUTCOME_HANDLE sasl_outcome, sasl_code code_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8924 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8925 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8926 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8927 | if (sasl_outcome == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8928 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8929 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8930 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8931 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8932 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8933 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)sasl_outcome; |
Azure.IoT Build | 0:6ae2f7bca550 | 8934 | AMQP_VALUE code_amqp_value = amqpvalue_create_sasl_code(code_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8935 | if (code_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8936 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8937 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8938 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8939 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8940 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8941 | if (amqpvalue_set_composite_item(sasl_outcome_instance->composite_value, 0, code_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8942 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8943 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8944 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8945 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8946 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8947 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8948 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8949 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8950 | amqpvalue_destroy(code_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 8951 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8952 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8953 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8954 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8955 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8956 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8957 | int sasl_outcome_get_additional_data(SASL_OUTCOME_HANDLE sasl_outcome, amqp_binary* additional_data_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8958 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8959 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8960 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8961 | if (sasl_outcome == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8962 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8963 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8964 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8965 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8966 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8967 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)sasl_outcome; |
Azure.IoT Build | 0:6ae2f7bca550 | 8968 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(sasl_outcome_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 8969 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8970 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8971 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8972 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8973 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8974 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8975 | if (amqpvalue_get_binary(item_value, additional_data_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 8976 | { |
AzureIoTClient | 16:22a72cf8e416 | 8977 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8978 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8979 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8980 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8981 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 8982 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8983 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8984 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8985 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8986 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8987 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8988 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8989 | int sasl_outcome_set_additional_data(SASL_OUTCOME_HANDLE sasl_outcome, amqp_binary additional_data_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 8990 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8991 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 8992 | |
Azure.IoT Build | 0:6ae2f7bca550 | 8993 | if (sasl_outcome == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 8994 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8995 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 8996 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 8997 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 8998 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 8999 | SASL_OUTCOME_INSTANCE* sasl_outcome_instance = (SASL_OUTCOME_INSTANCE*)sasl_outcome; |
Azure.IoT Build | 0:6ae2f7bca550 | 9000 | AMQP_VALUE additional_data_amqp_value = amqpvalue_create_binary(additional_data_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9001 | if (additional_data_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9002 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9003 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9004 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9005 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9006 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9007 | if (amqpvalue_set_composite_item(sasl_outcome_instance->composite_value, 1, additional_data_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9008 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9009 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9010 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9011 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9012 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9013 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9014 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9015 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9016 | amqpvalue_destroy(additional_data_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9017 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9018 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9019 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9020 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9021 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9022 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9023 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9024 | /* terminus-durability */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9025 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9026 | AMQP_VALUE amqpvalue_create_terminus_durability(terminus_durability value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9027 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9028 | return amqpvalue_create_uint(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9029 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9030 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9031 | /* terminus-expiry-policy */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9032 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9033 | AMQP_VALUE amqpvalue_create_terminus_expiry_policy(terminus_expiry_policy value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9034 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9035 | return amqpvalue_create_symbol(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9036 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9037 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9038 | /* node-properties */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9039 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9040 | AMQP_VALUE amqpvalue_create_node_properties(node_properties value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9041 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9042 | return amqpvalue_create_fields(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9043 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9044 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9045 | /* filter-set */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9046 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9047 | AMQP_VALUE amqpvalue_create_filter_set(AMQP_VALUE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9048 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9049 | return amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9050 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9051 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9052 | /* source */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9053 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9054 | typedef struct SOURCE_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 9055 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9056 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 9057 | } SOURCE_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 9058 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9059 | static SOURCE_HANDLE source_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 9060 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9061 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)amqpalloc_malloc(sizeof(SOURCE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 9062 | if (source_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9063 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9064 | source_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 9065 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9066 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9067 | return source_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 9068 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9069 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9070 | SOURCE_HANDLE source_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 9071 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9072 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)amqpalloc_malloc(sizeof(SOURCE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 9073 | if (source_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9074 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9075 | source_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(40); |
Azure.IoT Build | 0:6ae2f7bca550 | 9076 | if (source_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9077 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9078 | amqpalloc_free(source_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 9079 | source_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 9080 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9081 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9082 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9083 | return source_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 9084 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9085 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9086 | SOURCE_HANDLE source_clone(SOURCE_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9087 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9088 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)amqpalloc_malloc(sizeof(SOURCE_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 9089 | if (source_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9090 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9091 | source_instance->composite_value = amqpvalue_clone(((SOURCE_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9092 | if (source_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9093 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9094 | amqpalloc_free(source_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 9095 | source_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 9096 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9097 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9098 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9099 | return source_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 9100 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9101 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9102 | void source_destroy(SOURCE_HANDLE source) |
Azure.IoT Build | 0:6ae2f7bca550 | 9103 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9104 | if (source != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9105 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9106 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9107 | amqpvalue_destroy(source_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9108 | amqpalloc_free(source_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 9109 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9110 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9111 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9112 | AMQP_VALUE amqpvalue_create_source(SOURCE_HANDLE source) |
Azure.IoT Build | 0:6ae2f7bca550 | 9113 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9114 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9115 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9116 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9117 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9118 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 9119 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9120 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9121 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9122 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9123 | result = amqpvalue_clone(source_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9124 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9125 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9126 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9127 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9128 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9129 | bool is_source_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 9130 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9131 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9132 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9133 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 9134 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 9135 | (descriptor_ulong == 40)) |
Azure.IoT Build | 0:6ae2f7bca550 | 9136 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9137 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 9138 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9139 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9140 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9141 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 9142 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9143 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9144 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9145 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9146 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9147 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9148 | int amqpvalue_get_source(AMQP_VALUE value, SOURCE_HANDLE* source_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 9149 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9150 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9151 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 9152 | *source_handle = source_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 9153 | if (*source_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9154 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9155 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9156 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9157 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9158 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9159 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9160 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9161 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9162 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9163 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9164 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9165 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9166 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9167 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 9168 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9169 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 9170 | /* address */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9171 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 9172 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9173 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9174 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9175 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9176 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9177 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9178 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9179 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9180 | /* durable */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9181 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 9182 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9183 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9184 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9185 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9186 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9187 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9188 | terminus_durability durable; |
Azure.IoT Build | 0:6ae2f7bca550 | 9189 | if (amqpvalue_get_terminus_durability(item_value, &durable) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9190 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9191 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9192 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9193 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9194 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9195 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 9196 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9197 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9198 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9199 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9200 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9201 | /* expiry-policy */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9202 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 9203 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9204 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9205 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9206 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9207 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9208 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9209 | terminus_expiry_policy expiry_policy; |
Azure.IoT Build | 0:6ae2f7bca550 | 9210 | if (amqpvalue_get_terminus_expiry_policy(item_value, &expiry_policy) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9211 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9212 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9213 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9214 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9215 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9216 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 9217 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9218 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9219 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9220 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9221 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9222 | /* timeout */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9223 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 9224 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9225 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9226 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9227 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9228 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9229 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9230 | seconds timeout; |
Azure.IoT Build | 0:6ae2f7bca550 | 9231 | if (amqpvalue_get_seconds(item_value, &timeout) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9232 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9233 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9234 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9235 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9236 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9237 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 9238 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9239 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9240 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9241 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9242 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9243 | /* dynamic */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9244 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 9245 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9246 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9247 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9248 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9249 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9250 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9251 | bool dynamic; |
Azure.IoT Build | 0:6ae2f7bca550 | 9252 | if (amqpvalue_get_boolean(item_value, &dynamic) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9253 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9254 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9255 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9256 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9257 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9258 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 9259 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9260 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9261 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9262 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9263 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9264 | /* dynamic-node-properties */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9265 | item_value = amqpvalue_get_list_item(list_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 9266 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9267 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9268 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9269 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9270 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9271 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9272 | node_properties dynamic_node_properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 9273 | if (amqpvalue_get_node_properties(item_value, &dynamic_node_properties) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9274 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9275 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9276 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9277 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9278 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9279 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 9280 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9281 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9282 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9283 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9284 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9285 | /* distribution-mode */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9286 | item_value = amqpvalue_get_list_item(list_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 9287 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9288 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9289 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9290 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9291 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9292 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9293 | const char* distribution_mode; |
Azure.IoT Build | 0:6ae2f7bca550 | 9294 | if (amqpvalue_get_symbol(item_value, &distribution_mode) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9295 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9296 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9297 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9298 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9299 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9300 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 9301 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9302 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9303 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9304 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9305 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9306 | /* filter */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9307 | item_value = amqpvalue_get_list_item(list_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 9308 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9309 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9310 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9311 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9312 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9313 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9314 | filter_set filter; |
Azure.IoT Build | 0:6ae2f7bca550 | 9315 | if (amqpvalue_get_filter_set(item_value, &filter) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9316 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9317 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9318 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9319 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9320 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9321 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 9322 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9323 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9324 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9325 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9326 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9327 | /* default-outcome */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9328 | item_value = amqpvalue_get_list_item(list_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 9329 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9330 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9331 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9332 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9333 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9334 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9335 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9336 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9337 | /* outcomes */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9338 | item_value = amqpvalue_get_list_item(list_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 9339 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9340 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9341 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9342 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9343 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9344 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9345 | const char* outcomes; |
Azure.IoT Build | 0:6ae2f7bca550 | 9346 | AMQP_VALUE outcomes_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 9347 | if ((amqpvalue_get_array(item_value, &outcomes_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 9348 | (amqpvalue_get_symbol(item_value, &outcomes) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 9349 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9350 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9351 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9352 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9353 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9354 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 9355 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9356 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9357 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9358 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9359 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9360 | /* capabilities */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9361 | item_value = amqpvalue_get_list_item(list_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 9362 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9363 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9364 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 9365 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9366 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9367 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9368 | const char* capabilities; |
Azure.IoT Build | 0:6ae2f7bca550 | 9369 | AMQP_VALUE capabilities_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 9370 | if ((amqpvalue_get_array(item_value, &capabilities_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 9371 | (amqpvalue_get_symbol(item_value, &capabilities) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 9372 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9373 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9374 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9375 | source_destroy(*source_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 9376 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9377 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 9378 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9379 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9380 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9381 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9382 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9383 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9384 | source_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9385 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9386 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9387 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 9388 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9389 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9390 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9391 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9392 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9393 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9394 | int source_get_address(SOURCE_HANDLE source, AMQP_VALUE* address_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9395 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9396 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9397 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9398 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9399 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9400 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9401 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9402 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9403 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9404 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9405 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 9406 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9407 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9408 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9409 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9410 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9411 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9412 | *address_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 9413 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9414 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9415 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9416 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9417 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9418 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9419 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9420 | int source_set_address(SOURCE_HANDLE source, AMQP_VALUE address_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9421 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9422 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9423 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9424 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9425 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9426 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9427 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9428 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9429 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9430 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9431 | AMQP_VALUE address_amqp_value = amqpvalue_clone(address_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9432 | if (address_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9433 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9434 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9435 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9436 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9437 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9438 | if (amqpvalue_set_composite_item(source_instance->composite_value, 0, address_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9439 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9440 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9441 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9442 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9443 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9444 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9445 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9446 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9447 | amqpvalue_destroy(address_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9448 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9449 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9450 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9451 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9452 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9453 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9454 | int source_get_durable(SOURCE_HANDLE source, terminus_durability* durable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9455 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9456 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9457 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9458 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9459 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9460 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9461 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9462 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9463 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9464 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9465 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 9466 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9467 | { |
AzureIoTClient | 16:22a72cf8e416 | 9468 | *durable_value = terminus_durability_none; |
AzureIoTClient | 16:22a72cf8e416 | 9469 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9470 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9471 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9472 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9473 | if (amqpvalue_get_terminus_durability(item_value, durable_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9474 | { |
AzureIoTClient | 16:22a72cf8e416 | 9475 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 9476 | { |
AzureIoTClient | 16:22a72cf8e416 | 9477 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 9478 | } |
AzureIoTClient | 16:22a72cf8e416 | 9479 | else |
AzureIoTClient | 16:22a72cf8e416 | 9480 | { |
AzureIoTClient | 16:22a72cf8e416 | 9481 | *durable_value = terminus_durability_none; |
AzureIoTClient | 16:22a72cf8e416 | 9482 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 9483 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9484 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9485 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9486 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9487 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9488 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9489 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9490 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9491 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9492 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9493 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9494 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9495 | int source_set_durable(SOURCE_HANDLE source, terminus_durability durable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9496 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9497 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9498 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9499 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9500 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9501 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9502 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9503 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9504 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9505 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9506 | AMQP_VALUE durable_amqp_value = amqpvalue_create_terminus_durability(durable_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9507 | if (durable_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9508 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9509 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9510 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9511 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9512 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9513 | if (amqpvalue_set_composite_item(source_instance->composite_value, 1, durable_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9514 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9515 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9516 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9517 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9518 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9519 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9520 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9521 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9522 | amqpvalue_destroy(durable_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9523 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9524 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9525 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9526 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9527 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9528 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9529 | int source_get_expiry_policy(SOURCE_HANDLE source, terminus_expiry_policy* expiry_policy_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9530 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9531 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9532 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9533 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9534 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9535 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9536 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9537 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9538 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9539 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9540 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 9541 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9542 | { |
AzureIoTClient | 16:22a72cf8e416 | 9543 | *expiry_policy_value = terminus_expiry_policy_session_end; |
AzureIoTClient | 16:22a72cf8e416 | 9544 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9545 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9546 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9547 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9548 | if (amqpvalue_get_terminus_expiry_policy(item_value, expiry_policy_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9549 | { |
AzureIoTClient | 16:22a72cf8e416 | 9550 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 9551 | { |
AzureIoTClient | 16:22a72cf8e416 | 9552 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 9553 | } |
AzureIoTClient | 16:22a72cf8e416 | 9554 | else |
AzureIoTClient | 16:22a72cf8e416 | 9555 | { |
AzureIoTClient | 16:22a72cf8e416 | 9556 | *expiry_policy_value = terminus_expiry_policy_session_end; |
AzureIoTClient | 16:22a72cf8e416 | 9557 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 9558 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9559 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9560 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9561 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9562 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9563 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9564 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9565 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9566 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9567 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9568 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9569 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9570 | int source_set_expiry_policy(SOURCE_HANDLE source, terminus_expiry_policy expiry_policy_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9571 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9572 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9573 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9574 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9575 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9576 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9577 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9578 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9579 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9580 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9581 | AMQP_VALUE expiry_policy_amqp_value = amqpvalue_create_terminus_expiry_policy(expiry_policy_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9582 | if (expiry_policy_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9583 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9584 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9585 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9586 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9587 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9588 | if (amqpvalue_set_composite_item(source_instance->composite_value, 2, expiry_policy_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9589 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9590 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9591 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9592 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9593 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9594 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9595 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9596 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9597 | amqpvalue_destroy(expiry_policy_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9598 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9599 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9600 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9601 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9602 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9603 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9604 | int source_get_timeout(SOURCE_HANDLE source, seconds* timeout_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9605 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9606 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9607 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9608 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9609 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9610 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9611 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9612 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9613 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9614 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9615 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 9616 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9617 | { |
AzureIoTClient | 16:22a72cf8e416 | 9618 | *timeout_value = 0; |
AzureIoTClient | 16:22a72cf8e416 | 9619 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9620 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9621 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9622 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9623 | if (amqpvalue_get_seconds(item_value, timeout_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9624 | { |
AzureIoTClient | 16:22a72cf8e416 | 9625 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 9626 | { |
AzureIoTClient | 16:22a72cf8e416 | 9627 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 9628 | } |
AzureIoTClient | 16:22a72cf8e416 | 9629 | else |
AzureIoTClient | 16:22a72cf8e416 | 9630 | { |
AzureIoTClient | 16:22a72cf8e416 | 9631 | *timeout_value = 0; |
AzureIoTClient | 16:22a72cf8e416 | 9632 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 9633 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9634 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9635 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9636 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9637 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9638 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9639 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9640 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9641 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9642 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9643 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9644 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9645 | int source_set_timeout(SOURCE_HANDLE source, seconds timeout_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9646 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9647 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9648 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9649 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9650 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9651 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9652 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9653 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9654 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9655 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9656 | AMQP_VALUE timeout_amqp_value = amqpvalue_create_seconds(timeout_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9657 | if (timeout_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9658 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9659 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9660 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9661 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9662 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9663 | if (amqpvalue_set_composite_item(source_instance->composite_value, 3, timeout_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9664 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9665 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9666 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9667 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9668 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9669 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9670 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9671 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9672 | amqpvalue_destroy(timeout_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9673 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9674 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9675 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9676 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9677 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9678 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9679 | int source_get_dynamic(SOURCE_HANDLE source, bool* dynamic_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9680 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9681 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9682 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9683 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9684 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9685 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9686 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9687 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9688 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9689 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9690 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 9691 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9692 | { |
AzureIoTClient | 16:22a72cf8e416 | 9693 | *dynamic_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 9694 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9695 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9696 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9697 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9698 | if (amqpvalue_get_boolean(item_value, dynamic_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9699 | { |
AzureIoTClient | 16:22a72cf8e416 | 9700 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 9701 | { |
AzureIoTClient | 16:22a72cf8e416 | 9702 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 9703 | } |
AzureIoTClient | 16:22a72cf8e416 | 9704 | else |
AzureIoTClient | 16:22a72cf8e416 | 9705 | { |
AzureIoTClient | 16:22a72cf8e416 | 9706 | *dynamic_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 9707 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 9708 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9709 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9710 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9711 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9712 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9713 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9714 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9715 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9716 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9717 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9718 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9719 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9720 | int source_set_dynamic(SOURCE_HANDLE source, bool dynamic_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9721 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9722 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9723 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9724 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9725 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9726 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9727 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9728 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9729 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9730 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9731 | AMQP_VALUE dynamic_amqp_value = amqpvalue_create_boolean(dynamic_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9732 | if (dynamic_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9733 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9734 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9735 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9736 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9737 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9738 | if (amqpvalue_set_composite_item(source_instance->composite_value, 4, dynamic_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9739 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9740 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9741 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9742 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9743 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9744 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9745 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9746 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9747 | amqpvalue_destroy(dynamic_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9748 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9749 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9750 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9751 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9752 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9753 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9754 | int source_get_dynamic_node_properties(SOURCE_HANDLE source, node_properties* dynamic_node_properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9755 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9756 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9757 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9758 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9759 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9760 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9761 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9762 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9763 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9764 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9765 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 9766 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9767 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9768 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9769 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9770 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9771 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9772 | if (amqpvalue_get_node_properties(item_value, dynamic_node_properties_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9773 | { |
AzureIoTClient | 16:22a72cf8e416 | 9774 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9775 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9776 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9777 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9778 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9779 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9780 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9781 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9782 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9783 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9784 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9785 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9786 | int source_set_dynamic_node_properties(SOURCE_HANDLE source, node_properties dynamic_node_properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9787 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9788 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9789 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9790 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9791 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9792 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9793 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9794 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9795 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9796 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9797 | AMQP_VALUE dynamic_node_properties_amqp_value = amqpvalue_create_node_properties(dynamic_node_properties_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9798 | if (dynamic_node_properties_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9799 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9800 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9801 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9802 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9803 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9804 | if (amqpvalue_set_composite_item(source_instance->composite_value, 5, dynamic_node_properties_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9805 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9806 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9807 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9808 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9809 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9810 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9811 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9812 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9813 | amqpvalue_destroy(dynamic_node_properties_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9814 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9815 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9816 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9817 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9818 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9819 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9820 | int source_get_distribution_mode(SOURCE_HANDLE source, const char** distribution_mode_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9821 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9822 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9823 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9824 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9825 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9826 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9827 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9828 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9829 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9830 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9831 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 9832 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9833 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9834 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9835 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9836 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9837 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9838 | if (amqpvalue_get_symbol(item_value, distribution_mode_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9839 | { |
AzureIoTClient | 16:22a72cf8e416 | 9840 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9841 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9842 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9843 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9844 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9845 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9846 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9847 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9848 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9849 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9850 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9851 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9852 | int source_set_distribution_mode(SOURCE_HANDLE source, const char* distribution_mode_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9853 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9854 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9855 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9856 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9857 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9858 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9859 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9860 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9861 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9862 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9863 | AMQP_VALUE distribution_mode_amqp_value = amqpvalue_create_symbol(distribution_mode_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9864 | if (distribution_mode_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9865 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9866 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9867 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9868 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9869 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9870 | if (amqpvalue_set_composite_item(source_instance->composite_value, 6, distribution_mode_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9871 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9872 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9873 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9874 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9875 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9876 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9877 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9878 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9879 | amqpvalue_destroy(distribution_mode_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9880 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9881 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9882 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9883 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9884 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9885 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9886 | int source_get_filter(SOURCE_HANDLE source, filter_set* filter_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9887 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9888 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9889 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9890 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9891 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9892 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9893 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9894 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9895 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9896 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9897 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 9898 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9899 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9900 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9901 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9902 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9903 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9904 | if (amqpvalue_get_filter_set(item_value, filter_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9905 | { |
AzureIoTClient | 16:22a72cf8e416 | 9906 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9907 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9908 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9909 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9910 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9911 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9912 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9913 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9914 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9915 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9916 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9917 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9918 | int source_set_filter(SOURCE_HANDLE source, filter_set filter_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9919 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9920 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9921 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9922 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9923 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9924 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9925 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9926 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9927 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9928 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9929 | AMQP_VALUE filter_amqp_value = amqpvalue_create_filter_set(filter_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9930 | if (filter_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9931 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9932 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9933 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9934 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9935 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9936 | if (amqpvalue_set_composite_item(source_instance->composite_value, 7, filter_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9937 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9938 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9939 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9940 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9941 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9942 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9943 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9944 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9945 | amqpvalue_destroy(filter_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9946 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9947 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9948 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9949 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9950 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9951 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9952 | int source_get_default_outcome(SOURCE_HANDLE source, AMQP_VALUE* default_outcome_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9953 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9954 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9955 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9956 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9957 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9958 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9959 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9960 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9961 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9962 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9963 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 9964 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9965 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9966 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9967 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9968 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9969 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9970 | *default_outcome_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 9971 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 9972 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9973 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9974 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9975 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9976 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9977 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9978 | int source_set_default_outcome(SOURCE_HANDLE source, AMQP_VALUE default_outcome_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 9979 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9980 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 9981 | |
Azure.IoT Build | 0:6ae2f7bca550 | 9982 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9983 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9984 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9985 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9986 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9987 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9988 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 9989 | AMQP_VALUE default_outcome_amqp_value = amqpvalue_clone(default_outcome_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 9990 | if (default_outcome_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 9991 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9992 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9993 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 9994 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 9995 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9996 | if (amqpvalue_set_composite_item(source_instance->composite_value, 8, default_outcome_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 9997 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 9998 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 9999 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10000 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10001 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10002 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10003 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10004 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10005 | amqpvalue_destroy(default_outcome_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10006 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10007 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10008 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10009 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10010 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10011 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10012 | int source_get_outcomes(SOURCE_HANDLE source, AMQP_VALUE* outcomes_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10013 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10014 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10015 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10016 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10017 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10018 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10019 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10020 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10021 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10022 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 10023 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 10024 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10025 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10026 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10027 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10028 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10029 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10030 | if (amqpvalue_get_array(item_value, outcomes_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10031 | { |
AzureIoTClient | 16:22a72cf8e416 | 10032 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10033 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10034 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10035 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10036 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10037 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10038 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10039 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10040 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10041 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10042 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10043 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10044 | int source_set_outcomes(SOURCE_HANDLE source, AMQP_VALUE outcomes_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10045 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10046 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10047 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10048 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10049 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10050 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10051 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10052 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10053 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10054 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 10055 | AMQP_VALUE outcomes_amqp_value = amqpvalue_clone(outcomes_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10056 | if (outcomes_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10057 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10058 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10059 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10060 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10061 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10062 | if (amqpvalue_set_composite_item(source_instance->composite_value, 9, outcomes_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10063 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10064 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10065 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10066 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10067 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10068 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10069 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10070 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10071 | amqpvalue_destroy(outcomes_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10072 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10073 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10074 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10075 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10076 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10077 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10078 | int source_get_capabilities(SOURCE_HANDLE source, AMQP_VALUE* capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10079 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10080 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10081 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10082 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10083 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10084 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10085 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10086 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10087 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10088 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 10089 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(source_instance->composite_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 10090 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10091 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10092 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10093 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10094 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10095 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10096 | if (amqpvalue_get_array(item_value, capabilities_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10097 | { |
AzureIoTClient | 16:22a72cf8e416 | 10098 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10099 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10100 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10101 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10102 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10103 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10104 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10105 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10106 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10107 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10108 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10109 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10110 | int source_set_capabilities(SOURCE_HANDLE source, AMQP_VALUE capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10111 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10112 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10113 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10114 | if (source == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10115 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10116 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10117 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10118 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10119 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10120 | SOURCE_INSTANCE* source_instance = (SOURCE_INSTANCE*)source; |
Azure.IoT Build | 0:6ae2f7bca550 | 10121 | AMQP_VALUE capabilities_amqp_value = amqpvalue_clone(capabilities_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10122 | if (capabilities_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10123 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10124 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10125 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10126 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10127 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10128 | if (amqpvalue_set_composite_item(source_instance->composite_value, 10, capabilities_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10129 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10130 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10131 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10132 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10133 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10134 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10135 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10136 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10137 | amqpvalue_destroy(capabilities_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10138 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10139 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10140 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10141 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10142 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10143 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10144 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10145 | /* target */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10146 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10147 | typedef struct TARGET_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 10148 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10149 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 10150 | } TARGET_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 10151 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10152 | static TARGET_HANDLE target_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 10153 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10154 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)amqpalloc_malloc(sizeof(TARGET_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 10155 | if (target_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10156 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10157 | target_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 10158 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10159 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10160 | return target_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 10161 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10162 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10163 | TARGET_HANDLE target_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 10164 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10165 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)amqpalloc_malloc(sizeof(TARGET_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 10166 | if (target_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10167 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10168 | target_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(41); |
Azure.IoT Build | 0:6ae2f7bca550 | 10169 | if (target_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10170 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10171 | amqpalloc_free(target_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 10172 | target_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 10173 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10174 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10175 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10176 | return target_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 10177 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10178 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10179 | TARGET_HANDLE target_clone(TARGET_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10180 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10181 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)amqpalloc_malloc(sizeof(TARGET_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 10182 | if (target_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10183 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10184 | target_instance->composite_value = amqpvalue_clone(((TARGET_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10185 | if (target_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10186 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10187 | amqpalloc_free(target_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 10188 | target_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 10189 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10190 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10191 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10192 | return target_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 10193 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10194 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10195 | void target_destroy(TARGET_HANDLE target) |
Azure.IoT Build | 0:6ae2f7bca550 | 10196 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10197 | if (target != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10198 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10199 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10200 | amqpvalue_destroy(target_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10201 | amqpalloc_free(target_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 10202 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10203 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10204 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10205 | AMQP_VALUE amqpvalue_create_target(TARGET_HANDLE target) |
Azure.IoT Build | 0:6ae2f7bca550 | 10206 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10207 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10208 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10209 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10210 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10211 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 10212 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10213 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10214 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10215 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10216 | result = amqpvalue_clone(target_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10217 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10218 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10219 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10220 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10221 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10222 | bool is_target_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 10223 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10224 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10225 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10226 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 10227 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 10228 | (descriptor_ulong == 41)) |
Azure.IoT Build | 0:6ae2f7bca550 | 10229 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10230 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 10231 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10232 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10233 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10234 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 10235 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10236 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10237 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10238 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10239 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10240 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10241 | int amqpvalue_get_target(AMQP_VALUE value, TARGET_HANDLE* target_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 10242 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10243 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10244 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 10245 | *target_handle = target_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 10246 | if (*target_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10247 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10248 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10249 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10250 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10251 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10252 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10253 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10254 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10255 | target_destroy(*target_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 10256 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10257 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10258 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10259 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10260 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 10261 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10262 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 10263 | /* address */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10264 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 10265 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10266 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10267 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10268 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10269 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10270 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10271 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10272 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10273 | /* durable */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10274 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 10275 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10276 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10277 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10278 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10279 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10280 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10281 | terminus_durability durable; |
Azure.IoT Build | 0:6ae2f7bca550 | 10282 | if (amqpvalue_get_terminus_durability(item_value, &durable) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10283 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10284 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10285 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10286 | target_destroy(*target_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 10287 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10288 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 10289 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10290 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10291 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10292 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10293 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10294 | /* expiry-policy */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10295 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 10296 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10297 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10298 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10299 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10300 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10301 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10302 | terminus_expiry_policy expiry_policy; |
Azure.IoT Build | 0:6ae2f7bca550 | 10303 | if (amqpvalue_get_terminus_expiry_policy(item_value, &expiry_policy) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10304 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10305 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10306 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10307 | target_destroy(*target_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 10308 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10309 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 10310 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10311 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10312 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10313 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10314 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10315 | /* timeout */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10316 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 10317 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10318 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10319 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10320 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10321 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10322 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10323 | seconds timeout; |
Azure.IoT Build | 0:6ae2f7bca550 | 10324 | if (amqpvalue_get_seconds(item_value, &timeout) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10325 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10326 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10327 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10328 | target_destroy(*target_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 10329 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10330 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 10331 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10332 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10333 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10334 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10335 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10336 | /* dynamic */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10337 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 10338 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10339 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10340 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10341 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10342 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10343 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10344 | bool dynamic; |
Azure.IoT Build | 0:6ae2f7bca550 | 10345 | if (amqpvalue_get_boolean(item_value, &dynamic) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10346 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10347 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10348 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10349 | target_destroy(*target_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 10350 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10351 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 10352 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10353 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10354 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10355 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10356 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10357 | /* dynamic-node-properties */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10358 | item_value = amqpvalue_get_list_item(list_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 10359 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10360 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10361 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10362 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10363 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10364 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10365 | node_properties dynamic_node_properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 10366 | if (amqpvalue_get_node_properties(item_value, &dynamic_node_properties) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10367 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10368 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10369 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10370 | target_destroy(*target_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 10371 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10372 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 10373 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10374 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10375 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10376 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10377 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10378 | /* capabilities */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10379 | item_value = amqpvalue_get_list_item(list_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 10380 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10381 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10382 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10383 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10384 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10385 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10386 | const char* capabilities; |
Azure.IoT Build | 0:6ae2f7bca550 | 10387 | AMQP_VALUE capabilities_array; |
Azure.IoT Build | 0:6ae2f7bca550 | 10388 | if ((amqpvalue_get_array(item_value, &capabilities_array) != 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 10389 | (amqpvalue_get_symbol(item_value, &capabilities) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 10390 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10391 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10392 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10393 | target_destroy(*target_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 10394 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10395 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 10396 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10397 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10398 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10399 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10400 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10401 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10402 | target_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10403 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10404 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10405 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 10406 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10407 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10408 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10409 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10410 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10411 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10412 | int target_get_address(TARGET_HANDLE target, AMQP_VALUE* address_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10413 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10414 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10415 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10416 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10417 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10418 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10419 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10420 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10421 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10422 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10423 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(target_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 10424 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10425 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10426 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10427 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10428 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10429 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10430 | *address_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 10431 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10432 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10433 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10434 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10435 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10436 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10437 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10438 | int target_set_address(TARGET_HANDLE target, AMQP_VALUE address_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10439 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10440 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10441 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10442 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10443 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10444 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10445 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10446 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10447 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10448 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10449 | AMQP_VALUE address_amqp_value = amqpvalue_clone(address_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10450 | if (address_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10451 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10452 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10453 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10454 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10455 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10456 | if (amqpvalue_set_composite_item(target_instance->composite_value, 0, address_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10457 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10458 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10459 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10460 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10461 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10462 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10463 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10464 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10465 | amqpvalue_destroy(address_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10466 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10467 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10468 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10469 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10470 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10471 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10472 | int target_get_durable(TARGET_HANDLE target, terminus_durability* durable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10473 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10474 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10475 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10476 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10477 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10478 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10479 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10480 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10481 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10482 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10483 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(target_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 10484 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10485 | { |
AzureIoTClient | 16:22a72cf8e416 | 10486 | *durable_value = terminus_durability_none; |
AzureIoTClient | 16:22a72cf8e416 | 10487 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10488 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10489 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10490 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10491 | if (amqpvalue_get_terminus_durability(item_value, durable_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10492 | { |
AzureIoTClient | 16:22a72cf8e416 | 10493 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 10494 | { |
AzureIoTClient | 16:22a72cf8e416 | 10495 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 10496 | } |
AzureIoTClient | 16:22a72cf8e416 | 10497 | else |
AzureIoTClient | 16:22a72cf8e416 | 10498 | { |
AzureIoTClient | 16:22a72cf8e416 | 10499 | *durable_value = terminus_durability_none; |
AzureIoTClient | 16:22a72cf8e416 | 10500 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 10501 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10502 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10503 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10504 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10505 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10506 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10507 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10508 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10509 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10510 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10511 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10512 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10513 | int target_set_durable(TARGET_HANDLE target, terminus_durability durable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10514 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10515 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10516 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10517 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10518 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10519 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10520 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10521 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10522 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10523 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10524 | AMQP_VALUE durable_amqp_value = amqpvalue_create_terminus_durability(durable_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10525 | if (durable_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10526 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10527 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10528 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10529 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10530 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10531 | if (amqpvalue_set_composite_item(target_instance->composite_value, 1, durable_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10532 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10533 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10534 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10535 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10536 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10537 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10538 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10539 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10540 | amqpvalue_destroy(durable_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10541 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10542 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10543 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10544 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10545 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10546 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10547 | int target_get_expiry_policy(TARGET_HANDLE target, terminus_expiry_policy* expiry_policy_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10548 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10549 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10550 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10551 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10552 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10553 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10554 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10555 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10556 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10557 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10558 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(target_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 10559 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10560 | { |
AzureIoTClient | 16:22a72cf8e416 | 10561 | *expiry_policy_value = terminus_expiry_policy_session_end; |
AzureIoTClient | 16:22a72cf8e416 | 10562 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10563 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10564 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10565 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10566 | if (amqpvalue_get_terminus_expiry_policy(item_value, expiry_policy_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10567 | { |
AzureIoTClient | 16:22a72cf8e416 | 10568 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 10569 | { |
AzureIoTClient | 16:22a72cf8e416 | 10570 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 10571 | } |
AzureIoTClient | 16:22a72cf8e416 | 10572 | else |
AzureIoTClient | 16:22a72cf8e416 | 10573 | { |
AzureIoTClient | 16:22a72cf8e416 | 10574 | *expiry_policy_value = terminus_expiry_policy_session_end; |
AzureIoTClient | 16:22a72cf8e416 | 10575 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 10576 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10577 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10578 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10579 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10580 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10581 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10582 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10583 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10584 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10585 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10586 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10587 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10588 | int target_set_expiry_policy(TARGET_HANDLE target, terminus_expiry_policy expiry_policy_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10589 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10590 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10591 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10592 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10593 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10594 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10595 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10596 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10597 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10598 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10599 | AMQP_VALUE expiry_policy_amqp_value = amqpvalue_create_terminus_expiry_policy(expiry_policy_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10600 | if (expiry_policy_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10601 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10602 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10603 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10604 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10605 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10606 | if (amqpvalue_set_composite_item(target_instance->composite_value, 2, expiry_policy_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10607 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10608 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10609 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10610 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10611 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10612 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10613 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10614 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10615 | amqpvalue_destroy(expiry_policy_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10616 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10617 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10618 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10619 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10620 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10621 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10622 | int target_get_timeout(TARGET_HANDLE target, seconds* timeout_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10623 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10624 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10625 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10626 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10627 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10628 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10629 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10630 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10631 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10632 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10633 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(target_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 10634 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10635 | { |
AzureIoTClient | 16:22a72cf8e416 | 10636 | *timeout_value = 0; |
AzureIoTClient | 16:22a72cf8e416 | 10637 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10638 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10639 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10640 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10641 | if (amqpvalue_get_seconds(item_value, timeout_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10642 | { |
AzureIoTClient | 16:22a72cf8e416 | 10643 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 10644 | { |
AzureIoTClient | 16:22a72cf8e416 | 10645 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 10646 | } |
AzureIoTClient | 16:22a72cf8e416 | 10647 | else |
AzureIoTClient | 16:22a72cf8e416 | 10648 | { |
AzureIoTClient | 16:22a72cf8e416 | 10649 | *timeout_value = 0; |
AzureIoTClient | 16:22a72cf8e416 | 10650 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 10651 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10652 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10653 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10654 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10655 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10656 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10657 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10658 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10659 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10660 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10661 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10662 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10663 | int target_set_timeout(TARGET_HANDLE target, seconds timeout_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10664 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10665 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10666 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10667 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10668 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10669 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10670 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10671 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10672 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10673 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10674 | AMQP_VALUE timeout_amqp_value = amqpvalue_create_seconds(timeout_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10675 | if (timeout_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10676 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10677 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10678 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10679 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10680 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10681 | if (amqpvalue_set_composite_item(target_instance->composite_value, 3, timeout_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10682 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10683 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10684 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10685 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10686 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10687 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10688 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10689 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10690 | amqpvalue_destroy(timeout_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10691 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10692 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10693 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10694 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10695 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10696 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10697 | int target_get_dynamic(TARGET_HANDLE target, bool* dynamic_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10698 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10699 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10700 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10701 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10702 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10703 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10704 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10705 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10706 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10707 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10708 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(target_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 10709 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10710 | { |
AzureIoTClient | 16:22a72cf8e416 | 10711 | *dynamic_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 10712 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10713 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10714 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10715 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10716 | if (amqpvalue_get_boolean(item_value, dynamic_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10717 | { |
AzureIoTClient | 16:22a72cf8e416 | 10718 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 10719 | { |
AzureIoTClient | 16:22a72cf8e416 | 10720 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 10721 | } |
AzureIoTClient | 16:22a72cf8e416 | 10722 | else |
AzureIoTClient | 16:22a72cf8e416 | 10723 | { |
AzureIoTClient | 16:22a72cf8e416 | 10724 | *dynamic_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 10725 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 10726 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10727 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10728 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10729 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10730 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10731 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10732 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10733 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10734 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10735 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10736 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10737 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10738 | int target_set_dynamic(TARGET_HANDLE target, bool dynamic_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10739 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10740 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10741 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10742 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10743 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10744 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10745 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10746 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10747 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10748 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10749 | AMQP_VALUE dynamic_amqp_value = amqpvalue_create_boolean(dynamic_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10750 | if (dynamic_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10751 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10752 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10753 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10754 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10755 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10756 | if (amqpvalue_set_composite_item(target_instance->composite_value, 4, dynamic_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10757 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10758 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10759 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10760 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10761 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10762 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10763 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10764 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10765 | amqpvalue_destroy(dynamic_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10766 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10767 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10768 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10769 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10770 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10771 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10772 | int target_get_dynamic_node_properties(TARGET_HANDLE target, node_properties* dynamic_node_properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10773 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10774 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10775 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10776 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10777 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10778 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10779 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10780 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10781 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10782 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10783 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(target_instance->composite_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 10784 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10785 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10786 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10787 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10788 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10789 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10790 | if (amqpvalue_get_node_properties(item_value, dynamic_node_properties_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10791 | { |
AzureIoTClient | 16:22a72cf8e416 | 10792 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10793 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10794 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10795 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10796 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10797 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10798 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10799 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10800 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10801 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10802 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10803 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10804 | int target_set_dynamic_node_properties(TARGET_HANDLE target, node_properties dynamic_node_properties_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10805 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10806 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10807 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10808 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10809 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10810 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10811 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10812 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10813 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10814 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10815 | AMQP_VALUE dynamic_node_properties_amqp_value = amqpvalue_create_node_properties(dynamic_node_properties_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10816 | if (dynamic_node_properties_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10817 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10818 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10819 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10820 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10821 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10822 | if (amqpvalue_set_composite_item(target_instance->composite_value, 5, dynamic_node_properties_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10823 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10824 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10825 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10826 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10827 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10828 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10829 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10830 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10831 | amqpvalue_destroy(dynamic_node_properties_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10832 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10833 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10834 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10835 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10836 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10837 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10838 | int target_get_capabilities(TARGET_HANDLE target, AMQP_VALUE* capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10839 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10840 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10841 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10842 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10843 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10844 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10845 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10846 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10847 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10848 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10849 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(target_instance->composite_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 10850 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10851 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10852 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10853 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10854 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10855 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10856 | if (amqpvalue_get_array(item_value, capabilities_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10857 | { |
AzureIoTClient | 16:22a72cf8e416 | 10858 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10859 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10860 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10861 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10862 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10863 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10864 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10865 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10866 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10867 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10868 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10869 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10870 | int target_set_capabilities(TARGET_HANDLE target, AMQP_VALUE capabilities_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10871 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10872 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10873 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10874 | if (target == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10875 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10876 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10877 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10878 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10879 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10880 | TARGET_INSTANCE* target_instance = (TARGET_INSTANCE*)target; |
Azure.IoT Build | 0:6ae2f7bca550 | 10881 | AMQP_VALUE capabilities_amqp_value = amqpvalue_clone(capabilities_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10882 | if (capabilities_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10883 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10884 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10885 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10886 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10887 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10888 | if (amqpvalue_set_composite_item(target_instance->composite_value, 6, capabilities_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 10889 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10890 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 10891 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10892 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 10893 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10894 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 10895 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10896 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10897 | amqpvalue_destroy(capabilities_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10898 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10899 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10900 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10901 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 10902 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10903 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10904 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10905 | /* annotations */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10906 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10907 | AMQP_VALUE amqpvalue_create_annotations(AMQP_VALUE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10908 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10909 | return amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10910 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10911 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10912 | /* message-id-ulong */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10913 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10914 | AMQP_VALUE amqpvalue_create_message_id_ulong(message_id_ulong value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10915 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10916 | return amqpvalue_create_ulong(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10917 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10918 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10919 | /* message-id-uuid */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10920 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10921 | AMQP_VALUE amqpvalue_create_message_id_uuid(message_id_uuid value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10922 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10923 | return amqpvalue_create_uuid(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10924 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10925 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10926 | /* message-id-binary */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10927 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10928 | AMQP_VALUE amqpvalue_create_message_id_binary(message_id_binary value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10929 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10930 | return amqpvalue_create_binary(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10931 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10932 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10933 | /* message-id-string */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10934 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10935 | AMQP_VALUE amqpvalue_create_message_id_string(message_id_string value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10936 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10937 | return amqpvalue_create_string(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10938 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10939 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10940 | /* address-string */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10941 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10942 | AMQP_VALUE amqpvalue_create_address_string(address_string value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10943 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10944 | return amqpvalue_create_string(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10945 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10946 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10947 | /* header */ |
Azure.IoT Build | 0:6ae2f7bca550 | 10948 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10949 | typedef struct HEADER_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 10950 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10951 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 10952 | } HEADER_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 10953 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10954 | static HEADER_HANDLE header_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 10955 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10956 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)amqpalloc_malloc(sizeof(HEADER_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 10957 | if (header_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10958 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10959 | header_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 10960 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10961 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10962 | return header_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 10963 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10964 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10965 | HEADER_HANDLE header_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 10966 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10967 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)amqpalloc_malloc(sizeof(HEADER_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 10968 | if (header_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10969 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10970 | header_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(112); |
Azure.IoT Build | 0:6ae2f7bca550 | 10971 | if (header_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10972 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10973 | amqpalloc_free(header_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 10974 | header_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 10975 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10976 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10977 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10978 | return header_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 10979 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10980 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10981 | HEADER_HANDLE header_clone(HEADER_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 10982 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10983 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)amqpalloc_malloc(sizeof(HEADER_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 10984 | if (header_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10985 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10986 | header_instance->composite_value = amqpvalue_clone(((HEADER_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 10987 | if (header_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 10988 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10989 | amqpalloc_free(header_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 10990 | header_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 10991 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10992 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10993 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10994 | return header_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 10995 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 10996 | |
Azure.IoT Build | 0:6ae2f7bca550 | 10997 | void header_destroy(HEADER_HANDLE header) |
Azure.IoT Build | 0:6ae2f7bca550 | 10998 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 10999 | if (header != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11000 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11001 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11002 | amqpvalue_destroy(header_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11003 | amqpalloc_free(header_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 11004 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11005 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11006 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11007 | AMQP_VALUE amqpvalue_create_header(HEADER_HANDLE header) |
Azure.IoT Build | 0:6ae2f7bca550 | 11008 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11009 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11010 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11011 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11012 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11013 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11014 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11015 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11016 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11017 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11018 | result = amqpvalue_clone(header_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11019 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11020 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11021 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11022 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11023 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11024 | bool is_header_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 11025 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11026 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11027 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11028 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 11029 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 11030 | (descriptor_ulong == 112)) |
Azure.IoT Build | 0:6ae2f7bca550 | 11031 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11032 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 11033 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11034 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11035 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11036 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 11037 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11038 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11039 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11040 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11041 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11042 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11043 | int amqpvalue_get_header(AMQP_VALUE value, HEADER_HANDLE* header_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 11044 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11045 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11046 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 11047 | *header_handle = header_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 11048 | if (*header_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11049 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11050 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11051 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11052 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11053 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11054 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11055 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11056 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11057 | header_destroy(*header_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 11058 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11059 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11060 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11061 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11062 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 11063 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11064 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 11065 | /* durable */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11066 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 11067 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11068 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11069 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11070 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11071 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11072 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11073 | bool durable; |
Azure.IoT Build | 0:6ae2f7bca550 | 11074 | if (amqpvalue_get_boolean(item_value, &durable) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11075 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11076 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11077 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11078 | header_destroy(*header_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 11079 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11080 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 11081 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11082 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11083 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11084 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11085 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11086 | /* priority */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11087 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 11088 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11089 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11090 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11091 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11092 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11093 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11094 | uint8_t priority; |
Azure.IoT Build | 0:6ae2f7bca550 | 11095 | if (amqpvalue_get_ubyte(item_value, &priority) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11096 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11097 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11098 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11099 | header_destroy(*header_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 11100 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11101 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 11102 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11103 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11104 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11105 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11106 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11107 | /* ttl */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11108 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 11109 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11110 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11111 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11112 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11113 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11114 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11115 | milliseconds ttl; |
Azure.IoT Build | 0:6ae2f7bca550 | 11116 | if (amqpvalue_get_milliseconds(item_value, &ttl) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11117 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11118 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11119 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11120 | header_destroy(*header_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 11121 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11122 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 11123 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11124 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11125 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11126 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11127 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11128 | /* first-acquirer */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11129 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 11130 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11131 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11132 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11133 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11134 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11135 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11136 | bool first_acquirer; |
Azure.IoT Build | 0:6ae2f7bca550 | 11137 | if (amqpvalue_get_boolean(item_value, &first_acquirer) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11138 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11139 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11140 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11141 | header_destroy(*header_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 11142 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11143 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 11144 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11145 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11146 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11147 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11148 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11149 | /* delivery-count */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11150 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 11151 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11152 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11153 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11154 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11155 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11156 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11157 | uint32_t delivery_count; |
Azure.IoT Build | 0:6ae2f7bca550 | 11158 | if (amqpvalue_get_uint(item_value, &delivery_count) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11159 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11160 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11161 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11162 | header_destroy(*header_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 11163 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11164 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 11165 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11166 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11167 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11168 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11169 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11170 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11171 | header_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11172 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11173 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11174 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 11175 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11176 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11177 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11178 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11179 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11180 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11181 | int header_get_durable(HEADER_HANDLE header, bool* durable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11182 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11183 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11184 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11185 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11186 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11187 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11188 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11189 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11190 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11191 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11192 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(header_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 11193 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11194 | { |
AzureIoTClient | 16:22a72cf8e416 | 11195 | *durable_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 11196 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11197 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11198 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11199 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11200 | if (amqpvalue_get_boolean(item_value, durable_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11201 | { |
AzureIoTClient | 16:22a72cf8e416 | 11202 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 11203 | { |
AzureIoTClient | 16:22a72cf8e416 | 11204 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 11205 | } |
AzureIoTClient | 16:22a72cf8e416 | 11206 | else |
AzureIoTClient | 16:22a72cf8e416 | 11207 | { |
AzureIoTClient | 16:22a72cf8e416 | 11208 | *durable_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 11209 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 11210 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11211 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11212 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11213 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11214 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11215 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11216 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11217 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11218 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11219 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11220 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11221 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11222 | int header_set_durable(HEADER_HANDLE header, bool durable_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11223 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11224 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11225 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11226 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11227 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11228 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11229 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11230 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11231 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11232 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11233 | AMQP_VALUE durable_amqp_value = amqpvalue_create_boolean(durable_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11234 | if (durable_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11235 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11236 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11237 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11238 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11239 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11240 | if (amqpvalue_set_composite_item(header_instance->composite_value, 0, durable_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11241 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11242 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11243 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11244 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11245 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11246 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11247 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11248 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11249 | amqpvalue_destroy(durable_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11250 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11251 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11252 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11253 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11254 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11255 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11256 | int header_get_priority(HEADER_HANDLE header, uint8_t* priority_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11257 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11258 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11259 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11260 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11261 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11262 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11263 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11264 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11265 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11266 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11267 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(header_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 11268 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11269 | { |
AzureIoTClient | 16:22a72cf8e416 | 11270 | *priority_value = 4; |
AzureIoTClient | 16:22a72cf8e416 | 11271 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11272 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11273 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11274 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11275 | if (amqpvalue_get_ubyte(item_value, priority_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11276 | { |
AzureIoTClient | 16:22a72cf8e416 | 11277 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 11278 | { |
AzureIoTClient | 16:22a72cf8e416 | 11279 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 11280 | } |
AzureIoTClient | 16:22a72cf8e416 | 11281 | else |
AzureIoTClient | 16:22a72cf8e416 | 11282 | { |
AzureIoTClient | 16:22a72cf8e416 | 11283 | *priority_value = 4; |
AzureIoTClient | 16:22a72cf8e416 | 11284 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 11285 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11286 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11287 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11288 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11289 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11290 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11291 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11292 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11293 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11294 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11295 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11296 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11297 | int header_set_priority(HEADER_HANDLE header, uint8_t priority_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11298 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11299 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11300 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11301 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11302 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11303 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11304 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11305 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11306 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11307 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11308 | AMQP_VALUE priority_amqp_value = amqpvalue_create_ubyte(priority_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11309 | if (priority_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11310 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11311 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11312 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11313 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11314 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11315 | if (amqpvalue_set_composite_item(header_instance->composite_value, 1, priority_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11316 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11317 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11318 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11319 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11320 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11321 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11322 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11323 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11324 | amqpvalue_destroy(priority_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11325 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11326 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11327 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11328 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11329 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11330 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11331 | int header_get_ttl(HEADER_HANDLE header, milliseconds* ttl_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11332 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11333 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11334 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11335 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11336 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11337 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11338 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11339 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11340 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11341 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11342 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(header_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 11343 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11344 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11345 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11346 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11347 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11348 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11349 | if (amqpvalue_get_milliseconds(item_value, ttl_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11350 | { |
AzureIoTClient | 16:22a72cf8e416 | 11351 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11352 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11353 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11354 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11355 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11356 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11357 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11358 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11359 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11360 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11361 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11362 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11363 | int header_set_ttl(HEADER_HANDLE header, milliseconds ttl_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11364 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11365 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11366 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11367 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11368 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11369 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11370 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11371 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11372 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11373 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11374 | AMQP_VALUE ttl_amqp_value = amqpvalue_create_milliseconds(ttl_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11375 | if (ttl_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11376 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11377 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11378 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11379 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11380 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11381 | if (amqpvalue_set_composite_item(header_instance->composite_value, 2, ttl_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11382 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11383 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11384 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11385 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11386 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11387 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11388 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11389 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11390 | amqpvalue_destroy(ttl_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11391 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11392 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11393 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11394 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11395 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11396 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11397 | int header_get_first_acquirer(HEADER_HANDLE header, bool* first_acquirer_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11398 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11399 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11400 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11401 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11402 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11403 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11404 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11405 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11406 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11407 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11408 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(header_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 11409 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11410 | { |
AzureIoTClient | 16:22a72cf8e416 | 11411 | *first_acquirer_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 11412 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11413 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11414 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11415 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11416 | if (amqpvalue_get_boolean(item_value, first_acquirer_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11417 | { |
AzureIoTClient | 16:22a72cf8e416 | 11418 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 11419 | { |
AzureIoTClient | 16:22a72cf8e416 | 11420 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 11421 | } |
AzureIoTClient | 16:22a72cf8e416 | 11422 | else |
AzureIoTClient | 16:22a72cf8e416 | 11423 | { |
AzureIoTClient | 16:22a72cf8e416 | 11424 | *first_acquirer_value = false; |
AzureIoTClient | 16:22a72cf8e416 | 11425 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 11426 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11427 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11428 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11429 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11430 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11431 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11432 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11433 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11434 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11435 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11436 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11437 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11438 | int header_set_first_acquirer(HEADER_HANDLE header, bool first_acquirer_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11439 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11440 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11441 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11442 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11443 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11444 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11445 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11446 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11447 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11448 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11449 | AMQP_VALUE first_acquirer_amqp_value = amqpvalue_create_boolean(first_acquirer_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11450 | if (first_acquirer_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11451 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11452 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11453 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11454 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11455 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11456 | if (amqpvalue_set_composite_item(header_instance->composite_value, 3, first_acquirer_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11457 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11458 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11459 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11460 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11461 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11462 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11463 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11464 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11465 | amqpvalue_destroy(first_acquirer_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11466 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11467 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11468 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11469 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11470 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11471 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11472 | int header_get_delivery_count(HEADER_HANDLE header, uint32_t* delivery_count_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11473 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11474 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11475 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11476 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11477 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11478 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11479 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11480 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11481 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11482 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11483 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(header_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 11484 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11485 | { |
AzureIoTClient | 16:22a72cf8e416 | 11486 | *delivery_count_value = 0; |
AzureIoTClient | 16:22a72cf8e416 | 11487 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11488 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11489 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11490 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11491 | if (amqpvalue_get_uint(item_value, delivery_count_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11492 | { |
AzureIoTClient | 16:22a72cf8e416 | 11493 | if (amqpvalue_get_type(item_value) == AMQP_TYPE_NULL) |
AzureIoTClient | 16:22a72cf8e416 | 11494 | { |
AzureIoTClient | 16:22a72cf8e416 | 11495 | result = __LINE__; |
AzureIoTClient | 16:22a72cf8e416 | 11496 | } |
AzureIoTClient | 16:22a72cf8e416 | 11497 | else |
AzureIoTClient | 16:22a72cf8e416 | 11498 | { |
AzureIoTClient | 16:22a72cf8e416 | 11499 | *delivery_count_value = 0; |
AzureIoTClient | 16:22a72cf8e416 | 11500 | result = 0; |
AzureIoTClient | 16:22a72cf8e416 | 11501 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11502 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11503 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11504 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11505 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11506 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11507 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11508 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11509 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11510 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11511 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11512 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11513 | int header_set_delivery_count(HEADER_HANDLE header, uint32_t delivery_count_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11514 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11515 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11516 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11517 | if (header == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11518 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11519 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11520 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11521 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11522 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11523 | HEADER_INSTANCE* header_instance = (HEADER_INSTANCE*)header; |
Azure.IoT Build | 0:6ae2f7bca550 | 11524 | AMQP_VALUE delivery_count_amqp_value = amqpvalue_create_uint(delivery_count_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11525 | if (delivery_count_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11526 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11527 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11528 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11529 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11530 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11531 | if (amqpvalue_set_composite_item(header_instance->composite_value, 4, delivery_count_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 11532 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11533 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11534 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11535 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11536 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11537 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 11538 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11539 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11540 | amqpvalue_destroy(delivery_count_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11541 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11542 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11543 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11544 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11545 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11546 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11547 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11548 | /* delivery-annotations */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11549 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11550 | AMQP_VALUE amqpvalue_create_delivery_annotations(delivery_annotations value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11551 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11552 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11553 | AMQP_VALUE described_value = amqpvalue_create_annotations(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11554 | if (described_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11555 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11556 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11557 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11558 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11559 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11560 | AMQP_VALUE descriptor = amqpvalue_create_ulong(113); |
Azure.IoT Build | 0:6ae2f7bca550 | 11561 | if (descriptor == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11562 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11563 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11564 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11565 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11566 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11567 | result = amqpvalue_create_described(amqpvalue_clone(descriptor), amqpvalue_clone(described_value)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11568 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11569 | amqpvalue_destroy(descriptor); |
Azure.IoT Build | 0:6ae2f7bca550 | 11570 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11571 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11572 | amqpvalue_destroy(described_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11573 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11574 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11575 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11576 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11577 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11578 | bool is_delivery_annotations_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 11579 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11580 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11581 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11582 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 11583 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 11584 | (descriptor_ulong == 113)) |
Azure.IoT Build | 0:6ae2f7bca550 | 11585 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11586 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 11587 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11588 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11589 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11590 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 11591 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11592 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11593 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11594 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11595 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11596 | /* message-annotations */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11597 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11598 | AMQP_VALUE amqpvalue_create_message_annotations(message_annotations value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11599 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11600 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11601 | AMQP_VALUE described_value = amqpvalue_create_annotations(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11602 | if (described_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11603 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11604 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11605 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11606 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11607 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11608 | AMQP_VALUE descriptor = amqpvalue_create_ulong(114); |
Azure.IoT Build | 0:6ae2f7bca550 | 11609 | if (descriptor == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11610 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11611 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11612 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11613 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11614 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11615 | result = amqpvalue_create_described(amqpvalue_clone(descriptor), amqpvalue_clone(described_value)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11616 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11617 | amqpvalue_destroy(descriptor); |
Azure.IoT Build | 0:6ae2f7bca550 | 11618 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11619 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11620 | amqpvalue_destroy(described_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11621 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11622 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11623 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11624 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11625 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11626 | bool is_message_annotations_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 11627 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11628 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11629 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11630 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 11631 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 11632 | (descriptor_ulong == 114)) |
Azure.IoT Build | 0:6ae2f7bca550 | 11633 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11634 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 11635 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11636 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11637 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11638 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 11639 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11640 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11641 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11642 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11643 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11644 | /* application-properties */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11645 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11646 | AMQP_VALUE amqpvalue_create_application_properties(AMQP_VALUE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11647 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11648 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11649 | AMQP_VALUE described_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11650 | if (described_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11651 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11652 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11653 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11654 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11655 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11656 | AMQP_VALUE descriptor = amqpvalue_create_ulong(116); |
Azure.IoT Build | 0:6ae2f7bca550 | 11657 | if (descriptor == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11658 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11659 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11660 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11661 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11662 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11663 | result = amqpvalue_create_described(amqpvalue_clone(descriptor), amqpvalue_clone(described_value)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11664 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11665 | amqpvalue_destroy(descriptor); |
Azure.IoT Build | 0:6ae2f7bca550 | 11666 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11667 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11668 | amqpvalue_destroy(described_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11669 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11670 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11671 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11672 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11673 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11674 | bool is_application_properties_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 11675 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11676 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11677 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11678 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 11679 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 11680 | (descriptor_ulong == 116)) |
Azure.IoT Build | 0:6ae2f7bca550 | 11681 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11682 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 11683 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11684 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11685 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11686 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 11687 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11688 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11689 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11690 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11691 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11692 | /* data */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11693 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11694 | AMQP_VALUE amqpvalue_create_data(data value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11695 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11696 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11697 | AMQP_VALUE described_value = amqpvalue_create_binary(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11698 | if (described_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11699 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11700 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11701 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11702 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11703 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11704 | AMQP_VALUE descriptor = amqpvalue_create_ulong(117); |
Azure.IoT Build | 0:6ae2f7bca550 | 11705 | if (descriptor == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11706 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11707 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11708 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11709 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11710 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11711 | result = amqpvalue_create_described(amqpvalue_clone(descriptor), amqpvalue_clone(described_value)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11712 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11713 | amqpvalue_destroy(descriptor); |
Azure.IoT Build | 0:6ae2f7bca550 | 11714 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11715 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11716 | amqpvalue_destroy(described_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11717 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11718 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11719 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11720 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11721 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11722 | bool is_data_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 11723 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11724 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11725 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11726 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 11727 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 11728 | (descriptor_ulong == 117)) |
Azure.IoT Build | 0:6ae2f7bca550 | 11729 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11730 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 11731 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11732 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11733 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11734 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 11735 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11736 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11737 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11738 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11739 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11740 | /* amqp-sequence */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11741 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11742 | AMQP_VALUE amqpvalue_create_amqp_sequence(AMQP_VALUE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11743 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11744 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11745 | AMQP_VALUE described_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11746 | if (described_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11747 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11748 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11749 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11750 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11751 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11752 | AMQP_VALUE descriptor = amqpvalue_create_ulong(118); |
Azure.IoT Build | 0:6ae2f7bca550 | 11753 | if (descriptor == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11754 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11755 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11756 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11757 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11758 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11759 | result = amqpvalue_create_described(amqpvalue_clone(descriptor), amqpvalue_clone(described_value)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11760 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11761 | amqpvalue_destroy(descriptor); |
Azure.IoT Build | 0:6ae2f7bca550 | 11762 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11763 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11764 | amqpvalue_destroy(described_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11765 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11766 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11767 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11768 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11769 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11770 | bool is_amqp_sequence_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 11771 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11772 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11773 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11774 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 11775 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 11776 | (descriptor_ulong == 118)) |
Azure.IoT Build | 0:6ae2f7bca550 | 11777 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11778 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 11779 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11780 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11781 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11782 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 11783 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11784 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11785 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11786 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11787 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11788 | /* amqp-value */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11789 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11790 | AMQP_VALUE amqpvalue_create_amqp_value(AMQP_VALUE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11791 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11792 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11793 | AMQP_VALUE described_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11794 | if (described_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11795 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11796 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11797 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11798 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11799 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11800 | AMQP_VALUE descriptor = amqpvalue_create_ulong(119); |
Azure.IoT Build | 0:6ae2f7bca550 | 11801 | if (descriptor == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11802 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11803 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11804 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11805 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11806 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11807 | result = amqpvalue_create_described(amqpvalue_clone(descriptor), amqpvalue_clone(described_value)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11808 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11809 | amqpvalue_destroy(descriptor); |
Azure.IoT Build | 0:6ae2f7bca550 | 11810 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11811 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11812 | amqpvalue_destroy(described_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11813 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11814 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11815 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11816 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11817 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11818 | bool is_amqp_value_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 11819 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11820 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11821 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11822 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 11823 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 11824 | (descriptor_ulong == 119)) |
Azure.IoT Build | 0:6ae2f7bca550 | 11825 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11826 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 11827 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11828 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11829 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11830 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 11831 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11832 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11833 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11834 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11835 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11836 | /* footer */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11837 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11838 | AMQP_VALUE amqpvalue_create_footer(footer value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11839 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11840 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11841 | AMQP_VALUE described_value = amqpvalue_create_annotations(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11842 | if (described_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11843 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11844 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11845 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11846 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11847 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11848 | AMQP_VALUE descriptor = amqpvalue_create_ulong(120); |
Azure.IoT Build | 0:6ae2f7bca550 | 11849 | if (descriptor == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11850 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11851 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11852 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11853 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11854 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11855 | result = amqpvalue_create_described(amqpvalue_clone(descriptor), amqpvalue_clone(described_value)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11856 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11857 | amqpvalue_destroy(descriptor); |
Azure.IoT Build | 0:6ae2f7bca550 | 11858 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11859 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11860 | amqpvalue_destroy(described_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11861 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11862 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11863 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11864 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11865 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11866 | bool is_footer_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 11867 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11868 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11869 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11870 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 11871 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 11872 | (descriptor_ulong == 120)) |
Azure.IoT Build | 0:6ae2f7bca550 | 11873 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11874 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 11875 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11876 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11877 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11878 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 11879 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11880 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11881 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11882 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11883 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11884 | /* properties */ |
Azure.IoT Build | 0:6ae2f7bca550 | 11885 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11886 | typedef struct PROPERTIES_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 11887 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11888 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 11889 | } PROPERTIES_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 11890 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11891 | static PROPERTIES_HANDLE properties_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 11892 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11893 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)amqpalloc_malloc(sizeof(PROPERTIES_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11894 | if (properties_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11895 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11896 | properties_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11897 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11898 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11899 | return properties_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 11900 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11901 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11902 | PROPERTIES_HANDLE properties_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 11903 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11904 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)amqpalloc_malloc(sizeof(PROPERTIES_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11905 | if (properties_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11906 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11907 | properties_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(115); |
Azure.IoT Build | 0:6ae2f7bca550 | 11908 | if (properties_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11909 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11910 | amqpalloc_free(properties_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 11911 | properties_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11912 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11913 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11914 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11915 | return properties_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 11916 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11917 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11918 | PROPERTIES_HANDLE properties_clone(PROPERTIES_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 11919 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11920 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)amqpalloc_malloc(sizeof(PROPERTIES_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 11921 | if (properties_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11922 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11923 | properties_instance->composite_value = amqpvalue_clone(((PROPERTIES_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11924 | if (properties_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11925 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11926 | amqpalloc_free(properties_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 11927 | properties_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11928 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11929 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11930 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11931 | return properties_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 11932 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11933 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11934 | void properties_destroy(PROPERTIES_HANDLE properties) |
Azure.IoT Build | 0:6ae2f7bca550 | 11935 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11936 | if (properties != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11937 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11938 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 11939 | amqpvalue_destroy(properties_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11940 | amqpalloc_free(properties_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 11941 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11942 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11943 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11944 | AMQP_VALUE amqpvalue_create_properties(PROPERTIES_HANDLE properties) |
Azure.IoT Build | 0:6ae2f7bca550 | 11945 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11946 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11947 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11948 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11949 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11950 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 11951 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11952 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11953 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11954 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 11955 | result = amqpvalue_clone(properties_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11956 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11957 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11958 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11959 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11960 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11961 | bool is_properties_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 11962 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11963 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11964 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11965 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 11966 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 11967 | (descriptor_ulong == 115)) |
Azure.IoT Build | 0:6ae2f7bca550 | 11968 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11969 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 11970 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11971 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11972 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11973 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 11974 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11975 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11976 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11977 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11978 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11979 | |
Azure.IoT Build | 0:6ae2f7bca550 | 11980 | int amqpvalue_get_properties(AMQP_VALUE value, PROPERTIES_HANDLE* properties_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 11981 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11982 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 11983 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 11984 | *properties_handle = properties_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 11985 | if (*properties_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11986 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11987 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11988 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11989 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11990 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11991 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 11992 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 11993 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11994 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 11995 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 11996 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 11997 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 11998 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 11999 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 12000 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12001 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 12002 | /* message-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12003 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 12004 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12005 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12006 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12007 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12008 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12009 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12010 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12011 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12012 | /* user-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12013 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 12014 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12015 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12016 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12017 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12018 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12019 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12020 | amqp_binary user_id; |
Azure.IoT Build | 0:6ae2f7bca550 | 12021 | if (amqpvalue_get_binary(item_value, &user_id) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12022 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12023 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12024 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12025 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 12026 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12027 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 12028 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12029 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12030 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12031 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12032 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12033 | /* to */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12034 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 12035 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12036 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12037 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12038 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12039 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12040 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12041 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12042 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12043 | /* subject */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12044 | item_value = amqpvalue_get_list_item(list_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 12045 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12046 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12047 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12048 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12049 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12050 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12051 | const char* subject; |
Azure.IoT Build | 0:6ae2f7bca550 | 12052 | if (amqpvalue_get_string(item_value, &subject) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12053 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12054 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12055 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12056 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 12057 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12058 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 12059 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12060 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12061 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12062 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12063 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12064 | /* reply-to */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12065 | item_value = amqpvalue_get_list_item(list_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 12066 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12067 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12068 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12069 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12070 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12071 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12072 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12073 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12074 | /* correlation-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12075 | item_value = amqpvalue_get_list_item(list_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 12076 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12077 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12078 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12079 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12080 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12081 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12082 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12083 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12084 | /* content-type */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12085 | item_value = amqpvalue_get_list_item(list_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 12086 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12087 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12088 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12089 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12090 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12091 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12092 | const char* content_type; |
Azure.IoT Build | 0:6ae2f7bca550 | 12093 | if (amqpvalue_get_symbol(item_value, &content_type) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12094 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12095 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12096 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12097 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 12098 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12099 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 12100 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12101 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12102 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12103 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12104 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12105 | /* content-encoding */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12106 | item_value = amqpvalue_get_list_item(list_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 12107 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12108 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12109 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12110 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12111 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12112 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12113 | const char* content_encoding; |
Azure.IoT Build | 0:6ae2f7bca550 | 12114 | if (amqpvalue_get_symbol(item_value, &content_encoding) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12115 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12116 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12117 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12118 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 12119 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12120 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 12121 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12122 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12123 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12124 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12125 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12126 | /* absolute-expiry-time */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12127 | item_value = amqpvalue_get_list_item(list_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 12128 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12129 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12130 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12131 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12132 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12133 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12134 | timestamp absolute_expiry_time; |
Azure.IoT Build | 0:6ae2f7bca550 | 12135 | if (amqpvalue_get_timestamp(item_value, &absolute_expiry_time) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12136 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12137 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12138 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12139 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 12140 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12141 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 12142 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12143 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12144 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12145 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12146 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12147 | /* creation-time */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12148 | item_value = amqpvalue_get_list_item(list_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 12149 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12150 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12151 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12152 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12153 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12154 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12155 | timestamp creation_time; |
Azure.IoT Build | 0:6ae2f7bca550 | 12156 | if (amqpvalue_get_timestamp(item_value, &creation_time) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12157 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12158 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12159 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12160 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 12161 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12162 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 12163 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12164 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12165 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12166 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12167 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12168 | /* group-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12169 | item_value = amqpvalue_get_list_item(list_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 12170 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12171 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12172 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12173 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12174 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12175 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12176 | const char* group_id; |
Azure.IoT Build | 0:6ae2f7bca550 | 12177 | if (amqpvalue_get_string(item_value, &group_id) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12178 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12179 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12180 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12181 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 12182 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12183 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 12184 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12185 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12186 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12187 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12188 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12189 | /* group-sequence */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12190 | item_value = amqpvalue_get_list_item(list_value, 11); |
Azure.IoT Build | 0:6ae2f7bca550 | 12191 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12192 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12193 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12194 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12195 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12196 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12197 | sequence_no group_sequence; |
Azure.IoT Build | 0:6ae2f7bca550 | 12198 | if (amqpvalue_get_sequence_no(item_value, &group_sequence) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12199 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12200 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12201 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12202 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 12203 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12204 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 12205 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12206 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12207 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12208 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12209 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12210 | /* reply-to-group-id */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12211 | item_value = amqpvalue_get_list_item(list_value, 12); |
Azure.IoT Build | 0:6ae2f7bca550 | 12212 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12213 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12214 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 12215 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12216 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12217 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12218 | const char* reply_to_group_id; |
Azure.IoT Build | 0:6ae2f7bca550 | 12219 | if (amqpvalue_get_string(item_value, &reply_to_group_id) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12220 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12221 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12222 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12223 | properties_destroy(*properties_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 12224 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12225 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 12226 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12227 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12228 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12229 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12230 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12231 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12232 | properties_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12233 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12234 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12235 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 12236 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12237 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12238 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12239 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12240 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12241 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12242 | int properties_get_message_id(PROPERTIES_HANDLE properties, AMQP_VALUE* message_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12243 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12244 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12245 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12246 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12247 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12248 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12249 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12250 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12251 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12252 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12253 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 12254 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12255 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12256 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12257 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12258 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12259 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12260 | *message_id_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 12261 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12262 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12263 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12264 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12265 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12266 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12267 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12268 | int properties_set_message_id(PROPERTIES_HANDLE properties, AMQP_VALUE message_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12269 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12270 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12271 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12272 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12273 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12274 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12275 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12276 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12277 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12278 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12279 | AMQP_VALUE message_id_amqp_value = amqpvalue_clone(message_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12280 | if (message_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12281 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12282 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12283 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12284 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12285 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12286 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 0, message_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12287 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12288 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12289 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12290 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12291 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12292 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12293 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12294 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12295 | amqpvalue_destroy(message_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12296 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12297 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12298 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12299 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12300 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12301 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12302 | int properties_get_user_id(PROPERTIES_HANDLE properties, amqp_binary* user_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12303 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12304 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12305 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12306 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12307 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12308 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12309 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12310 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12311 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12312 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12313 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 12314 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12315 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12316 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12317 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12318 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12319 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12320 | if (amqpvalue_get_binary(item_value, user_id_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12321 | { |
AzureIoTClient | 16:22a72cf8e416 | 12322 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12323 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12324 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12325 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12326 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12327 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12328 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12329 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12330 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12331 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12332 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12333 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12334 | int properties_set_user_id(PROPERTIES_HANDLE properties, amqp_binary user_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12335 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12336 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12337 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12338 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12339 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12340 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12341 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12342 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12343 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12344 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12345 | AMQP_VALUE user_id_amqp_value = amqpvalue_create_binary(user_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12346 | if (user_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12347 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12348 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12349 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12350 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12351 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12352 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 1, user_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12353 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12354 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12355 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12356 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12357 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12358 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12359 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12360 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12361 | amqpvalue_destroy(user_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12362 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12363 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12364 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12365 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12366 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12367 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12368 | int properties_get_to(PROPERTIES_HANDLE properties, AMQP_VALUE* to_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12369 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12370 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12371 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12372 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12373 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12374 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12375 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12376 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12377 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12378 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12379 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 12380 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12381 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12382 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12383 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12384 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12385 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12386 | *to_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 12387 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12388 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12389 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12390 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12391 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12392 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12393 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12394 | int properties_set_to(PROPERTIES_HANDLE properties, AMQP_VALUE to_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12395 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12396 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12397 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12398 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12399 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12400 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12401 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12402 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12403 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12404 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12405 | AMQP_VALUE to_amqp_value = amqpvalue_clone(to_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12406 | if (to_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12407 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12408 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12409 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12410 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12411 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12412 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 2, to_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12413 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12414 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12415 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12416 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12417 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12418 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12419 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12420 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12421 | amqpvalue_destroy(to_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12422 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12423 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12424 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12425 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12426 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12427 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12428 | int properties_get_subject(PROPERTIES_HANDLE properties, const char** subject_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12429 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12430 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12431 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12432 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12433 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12434 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12435 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12436 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12437 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12438 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12439 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 3); |
Azure.IoT Build | 0:6ae2f7bca550 | 12440 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12441 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12442 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12443 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12444 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12445 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12446 | if (amqpvalue_get_string(item_value, subject_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12447 | { |
AzureIoTClient | 16:22a72cf8e416 | 12448 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12449 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12450 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12451 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12452 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12453 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12454 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12455 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12456 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12457 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12458 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12459 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12460 | int properties_set_subject(PROPERTIES_HANDLE properties, const char* subject_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12461 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12462 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12463 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12464 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12465 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12466 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12467 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12468 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12469 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12470 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12471 | AMQP_VALUE subject_amqp_value = amqpvalue_create_string(subject_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12472 | if (subject_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12473 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12474 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12475 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12476 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12477 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12478 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 3, subject_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12479 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12480 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12481 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12482 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12483 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12484 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12485 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12486 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12487 | amqpvalue_destroy(subject_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12488 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12489 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12490 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12491 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12492 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12493 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12494 | int properties_get_reply_to(PROPERTIES_HANDLE properties, AMQP_VALUE* reply_to_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12495 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12496 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12497 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12498 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12499 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12500 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12501 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12502 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12503 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12504 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12505 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 4); |
Azure.IoT Build | 0:6ae2f7bca550 | 12506 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12507 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12508 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12509 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12510 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12511 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12512 | *reply_to_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 12513 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12514 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12515 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12516 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12517 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12518 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12519 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12520 | int properties_set_reply_to(PROPERTIES_HANDLE properties, AMQP_VALUE reply_to_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12521 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12522 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12523 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12524 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12525 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12526 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12527 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12528 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12529 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12530 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12531 | AMQP_VALUE reply_to_amqp_value = amqpvalue_clone(reply_to_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12532 | if (reply_to_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12533 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12534 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12535 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12536 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12537 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12538 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 4, reply_to_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12539 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12540 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12541 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12542 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12543 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12544 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12545 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12546 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12547 | amqpvalue_destroy(reply_to_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12548 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12549 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12550 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12551 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12552 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12553 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12554 | int properties_get_correlation_id(PROPERTIES_HANDLE properties, AMQP_VALUE* correlation_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12555 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12556 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12557 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12558 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12559 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12560 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12561 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12562 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12563 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12564 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12565 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 5); |
Azure.IoT Build | 0:6ae2f7bca550 | 12566 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12567 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12568 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12569 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12570 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12571 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12572 | *correlation_id_value = item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 12573 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12574 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12575 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12576 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12577 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12578 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12579 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12580 | int properties_set_correlation_id(PROPERTIES_HANDLE properties, AMQP_VALUE correlation_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12581 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12582 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12583 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12584 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12585 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12586 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12587 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12588 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12589 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12590 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12591 | AMQP_VALUE correlation_id_amqp_value = amqpvalue_clone(correlation_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12592 | if (correlation_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12593 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12594 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12595 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12596 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12597 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12598 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 5, correlation_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12599 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12600 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12601 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12602 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12603 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12604 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12605 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12606 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12607 | amqpvalue_destroy(correlation_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12608 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12609 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12610 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12611 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12612 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12613 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12614 | int properties_get_content_type(PROPERTIES_HANDLE properties, const char** content_type_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12615 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12616 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12617 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12618 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12619 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12620 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12621 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12622 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12623 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12624 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12625 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 6); |
Azure.IoT Build | 0:6ae2f7bca550 | 12626 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12627 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12628 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12629 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12630 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12631 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12632 | if (amqpvalue_get_symbol(item_value, content_type_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12633 | { |
AzureIoTClient | 16:22a72cf8e416 | 12634 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12635 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12636 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12637 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12638 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12639 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12640 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12641 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12642 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12643 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12644 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12645 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12646 | int properties_set_content_type(PROPERTIES_HANDLE properties, const char* content_type_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12647 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12648 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12649 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12650 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12651 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12652 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12653 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12654 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12655 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12656 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12657 | AMQP_VALUE content_type_amqp_value = amqpvalue_create_symbol(content_type_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12658 | if (content_type_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12659 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12660 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12661 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12662 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12663 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12664 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 6, content_type_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12665 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12666 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12667 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12668 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12669 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12670 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12671 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12672 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12673 | amqpvalue_destroy(content_type_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12674 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12675 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12676 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12677 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12678 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12679 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12680 | int properties_get_content_encoding(PROPERTIES_HANDLE properties, const char** content_encoding_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12681 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12682 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12683 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12684 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12685 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12686 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12687 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12688 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12689 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12690 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12691 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 7); |
Azure.IoT Build | 0:6ae2f7bca550 | 12692 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12693 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12694 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12695 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12696 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12697 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12698 | if (amqpvalue_get_symbol(item_value, content_encoding_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12699 | { |
AzureIoTClient | 16:22a72cf8e416 | 12700 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12701 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12702 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12703 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12704 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12705 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12706 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12707 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12708 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12709 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12710 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12711 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12712 | int properties_set_content_encoding(PROPERTIES_HANDLE properties, const char* content_encoding_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12713 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12714 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12715 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12716 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12717 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12718 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12719 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12720 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12721 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12722 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12723 | AMQP_VALUE content_encoding_amqp_value = amqpvalue_create_symbol(content_encoding_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12724 | if (content_encoding_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12725 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12726 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12727 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12728 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12729 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12730 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 7, content_encoding_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12731 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12732 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12733 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12734 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12735 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12736 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12737 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12738 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12739 | amqpvalue_destroy(content_encoding_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12740 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12741 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12742 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12743 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12744 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12745 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12746 | int properties_get_absolute_expiry_time(PROPERTIES_HANDLE properties, timestamp* absolute_expiry_time_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12747 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12748 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12749 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12750 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12751 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12752 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12753 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12754 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12755 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12756 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12757 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 8); |
Azure.IoT Build | 0:6ae2f7bca550 | 12758 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12759 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12760 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12761 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12762 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12763 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12764 | if (amqpvalue_get_timestamp(item_value, absolute_expiry_time_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12765 | { |
AzureIoTClient | 16:22a72cf8e416 | 12766 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12767 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12768 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12769 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12770 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12771 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12772 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12773 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12774 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12775 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12776 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12777 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12778 | int properties_set_absolute_expiry_time(PROPERTIES_HANDLE properties, timestamp absolute_expiry_time_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12779 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12780 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12781 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12782 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12783 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12784 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12785 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12786 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12787 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12788 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12789 | AMQP_VALUE absolute_expiry_time_amqp_value = amqpvalue_create_timestamp(absolute_expiry_time_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12790 | if (absolute_expiry_time_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12791 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12792 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12793 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12794 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12795 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12796 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 8, absolute_expiry_time_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12797 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12798 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12799 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12800 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12801 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12802 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12803 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12804 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12805 | amqpvalue_destroy(absolute_expiry_time_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12806 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12807 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12808 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12809 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12810 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12811 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12812 | int properties_get_creation_time(PROPERTIES_HANDLE properties, timestamp* creation_time_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12813 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12814 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12815 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12816 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12817 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12818 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12819 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12820 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12821 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12822 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12823 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 9); |
Azure.IoT Build | 0:6ae2f7bca550 | 12824 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12825 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12826 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12827 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12828 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12829 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12830 | if (amqpvalue_get_timestamp(item_value, creation_time_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12831 | { |
AzureIoTClient | 16:22a72cf8e416 | 12832 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12833 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12834 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12835 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12836 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12837 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12838 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12839 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12840 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12841 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12842 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12843 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12844 | int properties_set_creation_time(PROPERTIES_HANDLE properties, timestamp creation_time_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12845 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12846 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12847 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12848 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12849 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12850 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12851 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12852 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12853 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12854 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12855 | AMQP_VALUE creation_time_amqp_value = amqpvalue_create_timestamp(creation_time_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12856 | if (creation_time_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12857 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12858 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12859 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12860 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12861 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12862 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 9, creation_time_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12863 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12864 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12865 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12866 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12867 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12868 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12869 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12870 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12871 | amqpvalue_destroy(creation_time_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12872 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12873 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12874 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12875 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12876 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12877 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12878 | int properties_get_group_id(PROPERTIES_HANDLE properties, const char** group_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12879 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12880 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12881 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12882 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12883 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12884 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12885 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12886 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12887 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12888 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12889 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 10); |
Azure.IoT Build | 0:6ae2f7bca550 | 12890 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12891 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12892 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12893 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12894 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12895 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12896 | if (amqpvalue_get_string(item_value, group_id_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12897 | { |
AzureIoTClient | 16:22a72cf8e416 | 12898 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12899 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12900 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12901 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12902 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12903 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12904 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12905 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12906 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12907 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12908 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12909 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12910 | int properties_set_group_id(PROPERTIES_HANDLE properties, const char* group_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12911 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12912 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12913 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12914 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12915 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12916 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12917 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12918 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12919 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12920 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12921 | AMQP_VALUE group_id_amqp_value = amqpvalue_create_string(group_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12922 | if (group_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12923 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12924 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12925 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12926 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12927 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12928 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 10, group_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12929 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12930 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12931 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12932 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12933 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12934 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12935 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12936 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12937 | amqpvalue_destroy(group_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12938 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12939 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12940 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12941 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12942 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12943 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12944 | int properties_get_group_sequence(PROPERTIES_HANDLE properties, sequence_no* group_sequence_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12945 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12946 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12947 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12948 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12949 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12950 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12951 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12952 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12953 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12954 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12955 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 11); |
Azure.IoT Build | 0:6ae2f7bca550 | 12956 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12957 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12958 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12959 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12960 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12961 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12962 | if (amqpvalue_get_sequence_no(item_value, group_sequence_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12963 | { |
AzureIoTClient | 16:22a72cf8e416 | 12964 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12965 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12966 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12967 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12968 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 12969 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12970 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12971 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12972 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12973 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12974 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12975 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12976 | int properties_set_group_sequence(PROPERTIES_HANDLE properties, sequence_no group_sequence_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 12977 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12978 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 12979 | |
Azure.IoT Build | 0:6ae2f7bca550 | 12980 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12981 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12982 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12983 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12984 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12985 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12986 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 12987 | AMQP_VALUE group_sequence_amqp_value = amqpvalue_create_sequence_no(group_sequence_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 12988 | if (group_sequence_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 12989 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12990 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12991 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12992 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12993 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12994 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 11, group_sequence_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 12995 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 12996 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 12997 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 12998 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 12999 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13000 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13001 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13002 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13003 | amqpvalue_destroy(group_sequence_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13004 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13005 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13006 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13007 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13008 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13009 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13010 | int properties_get_reply_to_group_id(PROPERTIES_HANDLE properties, const char** reply_to_group_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13011 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13012 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13013 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13014 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13015 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13016 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13017 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13018 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13019 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13020 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 13021 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(properties_instance->composite_value, 12); |
Azure.IoT Build | 0:6ae2f7bca550 | 13022 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13023 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13024 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13025 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13026 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13027 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13028 | if (amqpvalue_get_string(item_value, reply_to_group_id_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13029 | { |
AzureIoTClient | 16:22a72cf8e416 | 13030 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13031 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13032 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13033 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13034 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13035 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13036 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13037 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13038 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13039 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13040 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13041 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13042 | int properties_set_reply_to_group_id(PROPERTIES_HANDLE properties, const char* reply_to_group_id_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13043 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13044 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13045 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13046 | if (properties == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13047 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13048 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13049 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13050 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13051 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13052 | PROPERTIES_INSTANCE* properties_instance = (PROPERTIES_INSTANCE*)properties; |
Azure.IoT Build | 0:6ae2f7bca550 | 13053 | AMQP_VALUE reply_to_group_id_amqp_value = amqpvalue_create_string(reply_to_group_id_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13054 | if (reply_to_group_id_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13055 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13056 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13057 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13058 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13059 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13060 | if (amqpvalue_set_composite_item(properties_instance->composite_value, 12, reply_to_group_id_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13061 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13062 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13063 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13064 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13065 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13066 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13067 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13068 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13069 | amqpvalue_destroy(reply_to_group_id_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13070 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13071 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13072 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13073 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13074 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13075 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13076 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13077 | /* received */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13078 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13079 | typedef struct RECEIVED_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 13080 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13081 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13082 | } RECEIVED_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 13083 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13084 | static RECEIVED_HANDLE received_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 13085 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13086 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)amqpalloc_malloc(sizeof(RECEIVED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13087 | if (received_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13088 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13089 | received_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13090 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13091 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13092 | return received_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13093 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13094 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13095 | RECEIVED_HANDLE received_create(uint32_t section_number_value, uint64_t section_offset_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13096 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13097 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)amqpalloc_malloc(sizeof(RECEIVED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13098 | if (received_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13099 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13100 | received_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(35); |
Azure.IoT Build | 0:6ae2f7bca550 | 13101 | if (received_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13102 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13103 | amqpalloc_free(received_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13104 | received_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13105 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13106 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13107 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13108 | AMQP_VALUE section_number_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13109 | AMQP_VALUE section_offset_amqp_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13110 | int result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13111 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13112 | section_number_amqp_value = amqpvalue_create_uint(section_number_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13113 | if ((result == 0) && (amqpvalue_set_composite_item(received_instance->composite_value, 0, section_number_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 13114 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13115 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13116 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13117 | section_offset_amqp_value = amqpvalue_create_ulong(section_offset_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13118 | if ((result == 0) && (amqpvalue_set_composite_item(received_instance->composite_value, 1, section_offset_amqp_value) != 0)) |
Azure.IoT Build | 0:6ae2f7bca550 | 13119 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13120 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13121 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13122 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13123 | amqpvalue_destroy(section_number_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13124 | amqpvalue_destroy(section_offset_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13125 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13126 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13127 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13128 | return received_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13129 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13130 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13131 | RECEIVED_HANDLE received_clone(RECEIVED_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13132 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13133 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)amqpalloc_malloc(sizeof(RECEIVED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13134 | if (received_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13135 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13136 | received_instance->composite_value = amqpvalue_clone(((RECEIVED_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13137 | if (received_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13138 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13139 | amqpalloc_free(received_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13140 | received_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13141 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13142 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13143 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13144 | return received_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13145 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13146 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13147 | void received_destroy(RECEIVED_HANDLE received) |
Azure.IoT Build | 0:6ae2f7bca550 | 13148 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13149 | if (received != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13150 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13151 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)received; |
Azure.IoT Build | 0:6ae2f7bca550 | 13152 | amqpvalue_destroy(received_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13153 | amqpalloc_free(received_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13154 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13155 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13156 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13157 | AMQP_VALUE amqpvalue_create_received(RECEIVED_HANDLE received) |
Azure.IoT Build | 0:6ae2f7bca550 | 13158 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13159 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13160 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13161 | if (received == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13162 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13163 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13164 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13165 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13166 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13167 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)received; |
Azure.IoT Build | 0:6ae2f7bca550 | 13168 | result = amqpvalue_clone(received_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13169 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13170 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13171 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13172 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13173 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13174 | bool is_received_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 13175 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13176 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13177 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13178 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 13179 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 13180 | (descriptor_ulong == 35)) |
Azure.IoT Build | 0:6ae2f7bca550 | 13181 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13182 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 13183 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13184 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13185 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13186 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 13187 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13188 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13189 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13190 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13191 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13192 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13193 | int amqpvalue_get_received(AMQP_VALUE value, RECEIVED_HANDLE* received_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 13194 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13195 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13196 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)received_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 13197 | *received_handle = received_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13198 | if (*received_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13199 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13200 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13201 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13202 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13203 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13204 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13205 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13206 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13207 | received_destroy(*received_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13208 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13209 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13210 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13211 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13212 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 13213 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13214 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13215 | /* section-number */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13216 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 13217 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13218 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13219 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13220 | received_destroy(*received_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13221 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13222 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 13223 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13224 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13225 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13226 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13227 | uint32_t section_number; |
Azure.IoT Build | 0:6ae2f7bca550 | 13228 | if (amqpvalue_get_uint(item_value, §ion_number) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13229 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13230 | received_destroy(*received_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13231 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13232 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 13233 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13234 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13235 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13236 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13237 | /* section-offset */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13238 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 13239 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13240 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13241 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13242 | received_destroy(*received_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13243 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13244 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 13245 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13246 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13247 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13248 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13249 | uint64_t section_offset; |
Azure.IoT Build | 0:6ae2f7bca550 | 13250 | if (amqpvalue_get_ulong(item_value, §ion_offset) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13251 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13252 | received_destroy(*received_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13253 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13254 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 13255 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13256 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13257 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13258 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13259 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13260 | received_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13261 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13262 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13263 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 13264 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13265 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13266 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13267 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13268 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13269 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13270 | int received_get_section_number(RECEIVED_HANDLE received, uint32_t* section_number_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13271 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13272 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13273 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13274 | if (received == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13275 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13276 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13277 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13278 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13279 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13280 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)received; |
Azure.IoT Build | 0:6ae2f7bca550 | 13281 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(received_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 13282 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13283 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13284 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13285 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13286 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13287 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13288 | if (amqpvalue_get_uint(item_value, section_number_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13289 | { |
AzureIoTClient | 16:22a72cf8e416 | 13290 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13291 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13292 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13293 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13294 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13295 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13296 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13297 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13298 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13299 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13300 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13301 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13302 | int received_set_section_number(RECEIVED_HANDLE received, uint32_t section_number_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13303 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13304 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13305 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13306 | if (received == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13307 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13308 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13309 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13310 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13311 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13312 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)received; |
Azure.IoT Build | 0:6ae2f7bca550 | 13313 | AMQP_VALUE section_number_amqp_value = amqpvalue_create_uint(section_number_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13314 | if (section_number_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13315 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13316 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13317 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13318 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13319 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13320 | if (amqpvalue_set_composite_item(received_instance->composite_value, 0, section_number_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13321 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13322 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13323 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13324 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13325 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13326 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13327 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13328 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13329 | amqpvalue_destroy(section_number_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13330 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13331 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13332 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13333 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13334 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13335 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13336 | int received_get_section_offset(RECEIVED_HANDLE received, uint64_t* section_offset_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13337 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13338 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13339 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13340 | if (received == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13341 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13342 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13343 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13344 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13345 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13346 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)received; |
Azure.IoT Build | 0:6ae2f7bca550 | 13347 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(received_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 13348 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13349 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13350 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13351 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13352 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13353 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13354 | if (amqpvalue_get_ulong(item_value, section_offset_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13355 | { |
AzureIoTClient | 16:22a72cf8e416 | 13356 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13357 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13358 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13359 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13360 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13361 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13362 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13363 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13364 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13365 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13366 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13367 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13368 | int received_set_section_offset(RECEIVED_HANDLE received, uint64_t section_offset_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13369 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13370 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13371 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13372 | if (received == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13373 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13374 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13375 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13376 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13377 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13378 | RECEIVED_INSTANCE* received_instance = (RECEIVED_INSTANCE*)received; |
Azure.IoT Build | 0:6ae2f7bca550 | 13379 | AMQP_VALUE section_offset_amqp_value = amqpvalue_create_ulong(section_offset_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13380 | if (section_offset_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13381 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13382 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13383 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13384 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13385 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13386 | if (amqpvalue_set_composite_item(received_instance->composite_value, 1, section_offset_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13387 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13388 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13389 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13390 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13391 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13392 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13393 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13394 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13395 | amqpvalue_destroy(section_offset_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13396 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13397 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13398 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13399 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13400 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13401 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13402 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13403 | /* accepted */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13404 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13405 | typedef struct ACCEPTED_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 13406 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13407 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13408 | } ACCEPTED_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 13409 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13410 | static ACCEPTED_HANDLE accepted_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 13411 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13412 | ACCEPTED_INSTANCE* accepted_instance = (ACCEPTED_INSTANCE*)amqpalloc_malloc(sizeof(ACCEPTED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13413 | if (accepted_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13414 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13415 | accepted_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13416 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13417 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13418 | return accepted_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13419 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13420 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13421 | ACCEPTED_HANDLE accepted_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 13422 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13423 | ACCEPTED_INSTANCE* accepted_instance = (ACCEPTED_INSTANCE*)amqpalloc_malloc(sizeof(ACCEPTED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13424 | if (accepted_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13425 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13426 | accepted_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(36); |
Azure.IoT Build | 0:6ae2f7bca550 | 13427 | if (accepted_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13428 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13429 | amqpalloc_free(accepted_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13430 | accepted_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13431 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13432 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13433 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13434 | return accepted_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13435 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13436 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13437 | ACCEPTED_HANDLE accepted_clone(ACCEPTED_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13438 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13439 | ACCEPTED_INSTANCE* accepted_instance = (ACCEPTED_INSTANCE*)amqpalloc_malloc(sizeof(ACCEPTED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13440 | if (accepted_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13441 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13442 | accepted_instance->composite_value = amqpvalue_clone(((ACCEPTED_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13443 | if (accepted_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13444 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13445 | amqpalloc_free(accepted_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13446 | accepted_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13447 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13448 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13449 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13450 | return accepted_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13451 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13452 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13453 | void accepted_destroy(ACCEPTED_HANDLE accepted) |
Azure.IoT Build | 0:6ae2f7bca550 | 13454 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13455 | if (accepted != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13456 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13457 | ACCEPTED_INSTANCE* accepted_instance = (ACCEPTED_INSTANCE*)accepted; |
Azure.IoT Build | 0:6ae2f7bca550 | 13458 | amqpvalue_destroy(accepted_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13459 | amqpalloc_free(accepted_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13460 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13461 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13462 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13463 | AMQP_VALUE amqpvalue_create_accepted(ACCEPTED_HANDLE accepted) |
Azure.IoT Build | 0:6ae2f7bca550 | 13464 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13465 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13466 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13467 | if (accepted == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13468 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13469 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13470 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13471 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13472 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13473 | ACCEPTED_INSTANCE* accepted_instance = (ACCEPTED_INSTANCE*)accepted; |
Azure.IoT Build | 0:6ae2f7bca550 | 13474 | result = amqpvalue_clone(accepted_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13475 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13476 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13477 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13478 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13479 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13480 | bool is_accepted_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 13481 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13482 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13483 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13484 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 13485 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 13486 | (descriptor_ulong == 36)) |
Azure.IoT Build | 0:6ae2f7bca550 | 13487 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13488 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 13489 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13490 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13491 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13492 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 13493 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13494 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13495 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13496 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13497 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13498 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13499 | int amqpvalue_get_accepted(AMQP_VALUE value, ACCEPTED_HANDLE* accepted_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 13500 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13501 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13502 | ACCEPTED_INSTANCE* accepted_instance = (ACCEPTED_INSTANCE*)accepted_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 13503 | *accepted_handle = accepted_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13504 | if (*accepted_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13505 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13506 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13507 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13508 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13509 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13510 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13511 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13512 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13513 | accepted_destroy(*accepted_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13514 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13515 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13516 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13517 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13518 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 13519 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13520 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13521 | accepted_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13522 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13523 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13524 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 13525 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13526 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13527 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13528 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13529 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13530 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13531 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13532 | /* rejected */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13533 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13534 | typedef struct REJECTED_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 13535 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13536 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13537 | } REJECTED_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 13538 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13539 | static REJECTED_HANDLE rejected_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 13540 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13541 | REJECTED_INSTANCE* rejected_instance = (REJECTED_INSTANCE*)amqpalloc_malloc(sizeof(REJECTED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13542 | if (rejected_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13543 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13544 | rejected_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13545 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13546 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13547 | return rejected_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13548 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13549 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13550 | REJECTED_HANDLE rejected_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 13551 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13552 | REJECTED_INSTANCE* rejected_instance = (REJECTED_INSTANCE*)amqpalloc_malloc(sizeof(REJECTED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13553 | if (rejected_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13554 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13555 | rejected_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(37); |
Azure.IoT Build | 0:6ae2f7bca550 | 13556 | if (rejected_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13557 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13558 | amqpalloc_free(rejected_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13559 | rejected_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13560 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13561 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13562 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13563 | return rejected_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13564 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13565 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13566 | REJECTED_HANDLE rejected_clone(REJECTED_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13567 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13568 | REJECTED_INSTANCE* rejected_instance = (REJECTED_INSTANCE*)amqpalloc_malloc(sizeof(REJECTED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13569 | if (rejected_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13570 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13571 | rejected_instance->composite_value = amqpvalue_clone(((REJECTED_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13572 | if (rejected_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13573 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13574 | amqpalloc_free(rejected_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13575 | rejected_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13576 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13577 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13578 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13579 | return rejected_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13580 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13581 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13582 | void rejected_destroy(REJECTED_HANDLE rejected) |
Azure.IoT Build | 0:6ae2f7bca550 | 13583 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13584 | if (rejected != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13585 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13586 | REJECTED_INSTANCE* rejected_instance = (REJECTED_INSTANCE*)rejected; |
Azure.IoT Build | 0:6ae2f7bca550 | 13587 | amqpvalue_destroy(rejected_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13588 | amqpalloc_free(rejected_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13589 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13590 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13591 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13592 | AMQP_VALUE amqpvalue_create_rejected(REJECTED_HANDLE rejected) |
Azure.IoT Build | 0:6ae2f7bca550 | 13593 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13594 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13595 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13596 | if (rejected == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13597 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13598 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13599 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13600 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13601 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13602 | REJECTED_INSTANCE* rejected_instance = (REJECTED_INSTANCE*)rejected; |
Azure.IoT Build | 0:6ae2f7bca550 | 13603 | result = amqpvalue_clone(rejected_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13604 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13605 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13606 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13607 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13608 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13609 | bool is_rejected_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 13610 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13611 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13612 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13613 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 13614 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 13615 | (descriptor_ulong == 37)) |
Azure.IoT Build | 0:6ae2f7bca550 | 13616 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13617 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 13618 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13619 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13620 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13621 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 13622 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13623 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13624 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13625 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13626 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13627 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13628 | int amqpvalue_get_rejected(AMQP_VALUE value, REJECTED_HANDLE* rejected_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 13629 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13630 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13631 | REJECTED_INSTANCE* rejected_instance = (REJECTED_INSTANCE*)rejected_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 13632 | *rejected_handle = rejected_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13633 | if (*rejected_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13634 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13635 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13636 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13637 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13638 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13639 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13640 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13641 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13642 | rejected_destroy(*rejected_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13643 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13644 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13645 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13646 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13647 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 13648 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13649 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13650 | /* error */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13651 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 13652 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13653 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13654 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13655 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13656 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13657 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13658 | ERROR_HANDLE error; |
Azure.IoT Build | 0:6ae2f7bca550 | 13659 | if (amqpvalue_get_error(item_value, &error) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13660 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13661 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13662 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13663 | rejected_destroy(*rejected_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13664 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13665 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 13666 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13667 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13668 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13669 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13670 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13671 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13672 | rejected_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13673 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13674 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13675 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 13676 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13677 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13678 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13679 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13680 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13681 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13682 | int rejected_get_error(REJECTED_HANDLE rejected, ERROR_HANDLE* error_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13683 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13684 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13685 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13686 | if (rejected == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13687 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13688 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13689 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13690 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13691 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13692 | REJECTED_INSTANCE* rejected_instance = (REJECTED_INSTANCE*)rejected; |
Azure.IoT Build | 0:6ae2f7bca550 | 13693 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(rejected_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 13694 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13695 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13696 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13697 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13698 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13699 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13700 | if (amqpvalue_get_error(item_value, error_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13701 | { |
AzureIoTClient | 16:22a72cf8e416 | 13702 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13703 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13704 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13705 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13706 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13707 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13708 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13709 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13710 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13711 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13712 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13713 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13714 | int rejected_set_error(REJECTED_HANDLE rejected, ERROR_HANDLE error_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13715 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13716 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13717 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13718 | if (rejected == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13719 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13720 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13721 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13722 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13723 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13724 | REJECTED_INSTANCE* rejected_instance = (REJECTED_INSTANCE*)rejected; |
Azure.IoT Build | 0:6ae2f7bca550 | 13725 | AMQP_VALUE error_amqp_value = amqpvalue_create_error(error_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13726 | if (error_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13727 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13728 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13729 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13730 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13731 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13732 | if (amqpvalue_set_composite_item(rejected_instance->composite_value, 0, error_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 13733 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13734 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13735 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13736 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13737 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13738 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13739 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13740 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13741 | amqpvalue_destroy(error_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13742 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13743 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13744 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13745 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13746 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13747 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13748 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13749 | /* released */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13750 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13751 | typedef struct RELEASED_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 13752 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13753 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13754 | } RELEASED_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 13755 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13756 | static RELEASED_HANDLE released_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 13757 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13758 | RELEASED_INSTANCE* released_instance = (RELEASED_INSTANCE*)amqpalloc_malloc(sizeof(RELEASED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13759 | if (released_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13760 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13761 | released_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13762 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13763 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13764 | return released_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13765 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13766 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13767 | RELEASED_HANDLE released_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 13768 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13769 | RELEASED_INSTANCE* released_instance = (RELEASED_INSTANCE*)amqpalloc_malloc(sizeof(RELEASED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13770 | if (released_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13771 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13772 | released_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(38); |
Azure.IoT Build | 0:6ae2f7bca550 | 13773 | if (released_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13774 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13775 | amqpalloc_free(released_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13776 | released_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13777 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13778 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13779 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13780 | return released_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13781 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13782 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13783 | RELEASED_HANDLE released_clone(RELEASED_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13784 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13785 | RELEASED_INSTANCE* released_instance = (RELEASED_INSTANCE*)amqpalloc_malloc(sizeof(RELEASED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13786 | if (released_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13787 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13788 | released_instance->composite_value = amqpvalue_clone(((RELEASED_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13789 | if (released_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13790 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13791 | amqpalloc_free(released_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13792 | released_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13793 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13794 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13795 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13796 | return released_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13797 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13798 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13799 | void released_destroy(RELEASED_HANDLE released) |
Azure.IoT Build | 0:6ae2f7bca550 | 13800 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13801 | if (released != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13802 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13803 | RELEASED_INSTANCE* released_instance = (RELEASED_INSTANCE*)released; |
Azure.IoT Build | 0:6ae2f7bca550 | 13804 | amqpvalue_destroy(released_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13805 | amqpalloc_free(released_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13806 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13807 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13808 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13809 | AMQP_VALUE amqpvalue_create_released(RELEASED_HANDLE released) |
Azure.IoT Build | 0:6ae2f7bca550 | 13810 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13811 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13812 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13813 | if (released == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13814 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13815 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13816 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13817 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13818 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13819 | RELEASED_INSTANCE* released_instance = (RELEASED_INSTANCE*)released; |
Azure.IoT Build | 0:6ae2f7bca550 | 13820 | result = amqpvalue_clone(released_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13821 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13822 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13823 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13824 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13825 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13826 | bool is_released_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 13827 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13828 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13829 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13830 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 13831 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 13832 | (descriptor_ulong == 38)) |
Azure.IoT Build | 0:6ae2f7bca550 | 13833 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13834 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 13835 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13836 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13837 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13838 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 13839 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13840 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13841 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13842 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13843 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13844 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13845 | int amqpvalue_get_released(AMQP_VALUE value, RELEASED_HANDLE* released_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 13846 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13847 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13848 | RELEASED_INSTANCE* released_instance = (RELEASED_INSTANCE*)released_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 13849 | *released_handle = released_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13850 | if (*released_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13851 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13852 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13853 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13854 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13855 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13856 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13857 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13858 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13859 | released_destroy(*released_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13860 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13861 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13862 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13863 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13864 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 13865 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13866 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13867 | released_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13868 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13869 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 13870 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 13871 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13872 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13873 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13874 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13875 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13876 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13877 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13878 | /* modified */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13879 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13880 | typedef struct MODIFIED_INSTANCE_TAG |
Azure.IoT Build | 0:6ae2f7bca550 | 13881 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13882 | AMQP_VALUE composite_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13883 | } MODIFIED_INSTANCE; |
Azure.IoT Build | 0:6ae2f7bca550 | 13884 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13885 | static MODIFIED_HANDLE modified_create_internal(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 13886 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13887 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)amqpalloc_malloc(sizeof(MODIFIED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13888 | if (modified_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13889 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13890 | modified_instance->composite_value = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13891 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13892 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13893 | return modified_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13894 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13895 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13896 | MODIFIED_HANDLE modified_create(void) |
Azure.IoT Build | 0:6ae2f7bca550 | 13897 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13898 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)amqpalloc_malloc(sizeof(MODIFIED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13899 | if (modified_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13900 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13901 | modified_instance->composite_value = amqpvalue_create_composite_with_ulong_descriptor(39); |
Azure.IoT Build | 0:6ae2f7bca550 | 13902 | if (modified_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13903 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13904 | amqpalloc_free(modified_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13905 | modified_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13906 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13907 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13908 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13909 | return modified_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13910 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13911 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13912 | MODIFIED_HANDLE modified_clone(MODIFIED_HANDLE value) |
Azure.IoT Build | 0:6ae2f7bca550 | 13913 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13914 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)amqpalloc_malloc(sizeof(MODIFIED_INSTANCE)); |
Azure.IoT Build | 0:6ae2f7bca550 | 13915 | if (modified_instance != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13916 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13917 | modified_instance->composite_value = amqpvalue_clone(((MODIFIED_INSTANCE*)value)->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13918 | if (modified_instance->composite_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13919 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13920 | amqpalloc_free(modified_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13921 | modified_instance = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13922 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13923 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13924 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13925 | return modified_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13926 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13927 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13928 | void modified_destroy(MODIFIED_HANDLE modified) |
Azure.IoT Build | 0:6ae2f7bca550 | 13929 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13930 | if (modified != NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13931 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13932 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)modified; |
Azure.IoT Build | 0:6ae2f7bca550 | 13933 | amqpvalue_destroy(modified_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13934 | amqpalloc_free(modified_instance); |
Azure.IoT Build | 0:6ae2f7bca550 | 13935 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13936 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13937 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13938 | AMQP_VALUE amqpvalue_create_modified(MODIFIED_HANDLE modified) |
Azure.IoT Build | 0:6ae2f7bca550 | 13939 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13940 | AMQP_VALUE result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13941 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13942 | if (modified == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13943 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13944 | result = NULL; |
Azure.IoT Build | 0:6ae2f7bca550 | 13945 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13946 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13947 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13948 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)modified; |
Azure.IoT Build | 0:6ae2f7bca550 | 13949 | result = amqpvalue_clone(modified_instance->composite_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13950 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13951 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13952 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13953 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13954 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13955 | bool is_modified_type_by_descriptor(AMQP_VALUE descriptor) |
Azure.IoT Build | 0:6ae2f7bca550 | 13956 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13957 | bool result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13958 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13959 | uint64_t descriptor_ulong; |
Azure.IoT Build | 0:6ae2f7bca550 | 13960 | if ((amqpvalue_get_ulong(descriptor, &descriptor_ulong) == 0) && |
Azure.IoT Build | 0:6ae2f7bca550 | 13961 | (descriptor_ulong == 39)) |
Azure.IoT Build | 0:6ae2f7bca550 | 13962 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13963 | result = true; |
Azure.IoT Build | 0:6ae2f7bca550 | 13964 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13965 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13966 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13967 | result = false; |
Azure.IoT Build | 0:6ae2f7bca550 | 13968 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13969 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13970 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13971 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13972 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13973 | |
Azure.IoT Build | 0:6ae2f7bca550 | 13974 | int amqpvalue_get_modified(AMQP_VALUE value, MODIFIED_HANDLE* modified_handle) |
Azure.IoT Build | 0:6ae2f7bca550 | 13975 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13976 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 13977 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)modified_create_internal(); |
Azure.IoT Build | 0:6ae2f7bca550 | 13978 | *modified_handle = modified_instance; |
Azure.IoT Build | 0:6ae2f7bca550 | 13979 | if (*modified_handle == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13980 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13981 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13982 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13983 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13984 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13985 | AMQP_VALUE list_value = amqpvalue_get_inplace_described_value(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 13986 | if (list_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13987 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13988 | modified_destroy(*modified_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 13989 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 13990 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 13991 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 13992 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13993 | do |
Azure.IoT Build | 0:6ae2f7bca550 | 13994 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 13995 | AMQP_VALUE item_value; |
Azure.IoT Build | 0:6ae2f7bca550 | 13996 | /* delivery-failed */ |
Azure.IoT Build | 0:6ae2f7bca550 | 13997 | item_value = amqpvalue_get_list_item(list_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 13998 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 13999 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14000 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 14001 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14002 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14003 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14004 | bool delivery_failed; |
Azure.IoT Build | 0:6ae2f7bca550 | 14005 | if (amqpvalue_get_boolean(item_value, &delivery_failed) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 14006 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14007 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14008 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14009 | modified_destroy(*modified_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 14010 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14011 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 14012 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14013 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14014 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14015 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14016 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14017 | /* undeliverable-here */ |
Azure.IoT Build | 0:6ae2f7bca550 | 14018 | item_value = amqpvalue_get_list_item(list_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 14019 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14020 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14021 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 14022 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14023 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14024 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14025 | bool undeliverable_here; |
Azure.IoT Build | 0:6ae2f7bca550 | 14026 | if (amqpvalue_get_boolean(item_value, &undeliverable_here) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 14027 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14028 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14029 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14030 | modified_destroy(*modified_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 14031 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14032 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 14033 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14034 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14035 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14036 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14037 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14038 | /* message-annotations */ |
Azure.IoT Build | 0:6ae2f7bca550 | 14039 | item_value = amqpvalue_get_list_item(list_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 14040 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14041 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14042 | /* do nothing */ |
Azure.IoT Build | 0:6ae2f7bca550 | 14043 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14044 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14045 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14046 | fields message_annotations; |
Azure.IoT Build | 0:6ae2f7bca550 | 14047 | if (amqpvalue_get_fields(item_value, &message_annotations) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 14048 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14049 | if (amqpvalue_get_type(item_value) != AMQP_TYPE_NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14050 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14051 | modified_destroy(*modified_handle); |
Azure.IoT Build | 0:6ae2f7bca550 | 14052 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14053 | break; |
Azure.IoT Build | 0:6ae2f7bca550 | 14054 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14055 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14056 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14057 | amqpvalue_destroy(item_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14058 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14059 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14060 | modified_instance->composite_value = amqpvalue_clone(value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14061 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14062 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 14063 | } while (0); |
Azure.IoT Build | 0:6ae2f7bca550 | 14064 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14065 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14066 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14067 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14068 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14069 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14070 | int modified_get_delivery_failed(MODIFIED_HANDLE modified, bool* delivery_failed_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 14071 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14072 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14073 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14074 | if (modified == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14075 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14076 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14077 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14078 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14079 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14080 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)modified; |
Azure.IoT Build | 0:6ae2f7bca550 | 14081 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(modified_instance->composite_value, 0); |
Azure.IoT Build | 0:6ae2f7bca550 | 14082 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14083 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14084 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14085 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14086 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14087 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14088 | if (amqpvalue_get_boolean(item_value, delivery_failed_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 14089 | { |
AzureIoTClient | 16:22a72cf8e416 | 14090 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14091 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14092 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14093 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14094 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 14095 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14096 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14097 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14098 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14099 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14100 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14101 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14102 | int modified_set_delivery_failed(MODIFIED_HANDLE modified, bool delivery_failed_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 14103 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14104 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14105 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14106 | if (modified == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14107 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14108 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14109 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14110 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14111 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14112 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)modified; |
Azure.IoT Build | 0:6ae2f7bca550 | 14113 | AMQP_VALUE delivery_failed_amqp_value = amqpvalue_create_boolean(delivery_failed_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14114 | if (delivery_failed_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14115 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14116 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14117 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14118 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14119 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14120 | if (amqpvalue_set_composite_item(modified_instance->composite_value, 0, delivery_failed_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 14121 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14122 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14123 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14124 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14125 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14126 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 14127 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14128 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14129 | amqpvalue_destroy(delivery_failed_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14130 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14131 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14132 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14133 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14134 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14135 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14136 | int modified_get_undeliverable_here(MODIFIED_HANDLE modified, bool* undeliverable_here_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 14137 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14138 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14139 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14140 | if (modified == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14141 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14142 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14143 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14144 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14145 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14146 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)modified; |
Azure.IoT Build | 0:6ae2f7bca550 | 14147 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(modified_instance->composite_value, 1); |
Azure.IoT Build | 0:6ae2f7bca550 | 14148 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14149 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14150 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14151 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14152 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14153 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14154 | if (amqpvalue_get_boolean(item_value, undeliverable_here_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 14155 | { |
AzureIoTClient | 16:22a72cf8e416 | 14156 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14157 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14158 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14159 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14160 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 14161 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14162 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14163 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14164 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14165 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14166 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14167 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14168 | int modified_set_undeliverable_here(MODIFIED_HANDLE modified, bool undeliverable_here_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 14169 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14170 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14171 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14172 | if (modified == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14173 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14174 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14175 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14176 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14177 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14178 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)modified; |
Azure.IoT Build | 0:6ae2f7bca550 | 14179 | AMQP_VALUE undeliverable_here_amqp_value = amqpvalue_create_boolean(undeliverable_here_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14180 | if (undeliverable_here_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14181 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14182 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14183 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14184 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14185 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14186 | if (amqpvalue_set_composite_item(modified_instance->composite_value, 1, undeliverable_here_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 14187 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14188 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14189 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14190 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14191 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14192 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 14193 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14194 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14195 | amqpvalue_destroy(undeliverable_here_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14196 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14197 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14198 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14199 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14200 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14201 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14202 | int modified_get_message_annotations(MODIFIED_HANDLE modified, fields* message_annotations_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 14203 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14204 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14205 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14206 | if (modified == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14207 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14208 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14209 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14210 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14211 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14212 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)modified; |
Azure.IoT Build | 0:6ae2f7bca550 | 14213 | AMQP_VALUE item_value = amqpvalue_get_composite_item_in_place(modified_instance->composite_value, 2); |
Azure.IoT Build | 0:6ae2f7bca550 | 14214 | if (item_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14215 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14216 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14217 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14218 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14219 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14220 | if (amqpvalue_get_fields(item_value, message_annotations_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 14221 | { |
AzureIoTClient | 16:22a72cf8e416 | 14222 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14223 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14224 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14225 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14226 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 14227 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14228 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14229 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14230 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14231 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14232 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14233 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14234 | int modified_set_message_annotations(MODIFIED_HANDLE modified, fields message_annotations_value) |
Azure.IoT Build | 0:6ae2f7bca550 | 14235 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14236 | int result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14237 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14238 | if (modified == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14239 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14240 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14241 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14242 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14243 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14244 | MODIFIED_INSTANCE* modified_instance = (MODIFIED_INSTANCE*)modified; |
Azure.IoT Build | 0:6ae2f7bca550 | 14245 | AMQP_VALUE message_annotations_amqp_value = amqpvalue_create_fields(message_annotations_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14246 | if (message_annotations_amqp_value == NULL) |
Azure.IoT Build | 0:6ae2f7bca550 | 14247 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14248 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14249 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14250 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14251 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14252 | if (amqpvalue_set_composite_item(modified_instance->composite_value, 2, message_annotations_amqp_value) != 0) |
Azure.IoT Build | 0:6ae2f7bca550 | 14253 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14254 | result = __LINE__; |
Azure.IoT Build | 0:6ae2f7bca550 | 14255 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14256 | else |
Azure.IoT Build | 0:6ae2f7bca550 | 14257 | { |
Azure.IoT Build | 0:6ae2f7bca550 | 14258 | result = 0; |
Azure.IoT Build | 0:6ae2f7bca550 | 14259 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14260 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14261 | amqpvalue_destroy(message_annotations_amqp_value); |
Azure.IoT Build | 0:6ae2f7bca550 | 14262 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14263 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14264 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14265 | return result; |
Azure.IoT Build | 0:6ae2f7bca550 | 14266 | } |
Azure.IoT Build | 0:6ae2f7bca550 | 14267 | |
Azure.IoT Build | 0:6ae2f7bca550 | 14268 |