| 1 |
#ifndef AWS_MQTT_MQTT5_PACKET_STORAGE_H |
| 2 |
#define AWS_MQTT_MQTT5_PACKET_STORAGE_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include <aws/mqtt/mqtt.h> |
| 10 |
|
| 11 |
#include <aws/mqtt/v5/mqtt5_types.h> |
| 12 |
|
| 13 |
AWS_PUSH_SANE_WARNING_LEVEL |
| 14 |
|
| 15 |
struct aws_mqtt5_client_options_storage; |
| 16 |
|
| 17 |
struct aws_mqtt5_user_property_set { |
| 18 |
struct aws_array_list properties; |
| 19 |
}; |
| 20 |
|
| 21 |
struct aws_mqtt5_packet_connect_storage { |
| 22 |
struct aws_allocator *allocator; |
| 23 |
|
| 24 |
struct aws_mqtt5_packet_connect_view storage_view; |
| 25 |
|
| 26 |
struct aws_byte_cursor username; |
| 27 |
|
| 28 |
struct aws_byte_cursor password; |
| 29 |
|
| 30 |
uint32_t session_expiry_interval_seconds; |
| 31 |
|
| 32 |
uint8_t request_response_information; |
| 33 |
|
| 34 |
uint8_t request_problem_information; |
| 35 |
|
| 36 |
uint16_t receive_maximum; |
| 37 |
|
| 38 |
uint16_t topic_alias_maximum; |
| 39 |
|
| 40 |
uint32_t maximum_packet_size_bytes; |
| 41 |
|
| 42 |
struct aws_mqtt5_packet_publish_storage *will; |
| 43 |
|
| 44 |
uint32_t will_delay_interval_seconds; |
| 45 |
|
| 46 |
struct aws_mqtt5_user_property_set user_properties; |
| 47 |
|
| 48 |
struct aws_byte_cursor authentication_method; |
| 49 |
|
| 50 |
struct aws_byte_cursor authentication_data; |
| 51 |
|
| 52 |
struct aws_byte_buf storage; |
| 53 |
}; |
| 54 |
|
| 55 |
struct aws_mqtt5_packet_connack_storage { |
| 56 |
struct aws_allocator *allocator; |
| 57 |
|
| 58 |
struct aws_mqtt5_packet_connack_view storage_view; |
| 59 |
|
| 60 |
uint32_t session_expiry_interval; |
| 61 |
|
| 62 |
uint16_t receive_maximum; |
| 63 |
|
| 64 |
enum aws_mqtt5_qos maximum_qos; |
| 65 |
|
| 66 |
bool retain_available; |
| 67 |
|
| 68 |
uint32_t maximum_packet_size; |
| 69 |
|
| 70 |
struct aws_byte_cursor assigned_client_identifier; |
| 71 |
|
| 72 |
uint16_t topic_alias_maximum; |
| 73 |
|
| 74 |
struct aws_byte_cursor reason_string; |
| 75 |
|
| 76 |
bool wildcard_subscriptions_available; |
| 77 |
|
| 78 |
bool subscription_identifiers_available; |
| 79 |
|
| 80 |
bool shared_subscriptions_available; |
| 81 |
|
| 82 |
uint16_t server_keep_alive; |
| 83 |
|
| 84 |
struct aws_byte_cursor response_information; |
| 85 |
|
| 86 |
struct aws_byte_cursor server_reference; |
| 87 |
|
| 88 |
struct aws_byte_cursor authentication_method; |
| 89 |
|
| 90 |
struct aws_byte_cursor authentication_data; |
| 91 |
|
| 92 |
struct aws_mqtt5_user_property_set user_properties; |
| 93 |
|
| 94 |
struct aws_byte_buf storage; |
| 95 |
}; |
| 96 |
|
| 97 |
struct aws_mqtt5_packet_suback_storage { |
| 98 |
|
| 99 |
struct aws_allocator *allocator; |
| 100 |
|
| 101 |
struct aws_mqtt5_packet_suback_view storage_view; |
| 102 |
|
| 103 |
struct aws_byte_cursor reason_string; |
| 104 |
|
| 105 |
struct aws_mqtt5_user_property_set user_properties; |
| 106 |
|
| 107 |
struct aws_array_list reason_codes; |
| 108 |
|
| 109 |
struct aws_byte_buf storage; |
| 110 |
}; |
| 111 |
|
| 112 |
struct aws_mqtt5_packet_unsuback_storage { |
| 113 |
|
| 114 |
struct aws_allocator *allocator; |
| 115 |
|
| 116 |
struct aws_mqtt5_packet_unsuback_view storage_view; |
| 117 |
|
| 118 |
struct aws_byte_cursor reason_string; |
| 119 |
|
| 120 |
struct aws_mqtt5_user_property_set user_properties; |
| 121 |
|
| 122 |
struct aws_array_list reason_codes; |
| 123 |
|
| 124 |
struct aws_byte_buf storage; |
| 125 |
}; |
| 126 |
|
| 127 |
struct aws_mqtt5_packet_publish_storage { |
| 128 |
struct aws_mqtt5_packet_publish_view storage_view; |
| 129 |
|
| 130 |
enum aws_mqtt5_payload_format_indicator payload_format; |
| 131 |
|
| 132 |
uint32_t message_expiry_interval_seconds; |
| 133 |
|
| 134 |
uint16_t topic_alias; |
| 135 |
|
| 136 |
struct aws_byte_cursor response_topic; |
| 137 |
|
| 138 |
struct aws_byte_cursor correlation_data; |
| 139 |
|
| 140 |
struct aws_byte_cursor content_type; |
| 141 |
|
| 142 |
struct aws_mqtt5_user_property_set user_properties; |
| 143 |
struct aws_array_list subscription_identifiers; |
| 144 |
|
| 145 |
struct aws_byte_buf storage; |
| 146 |
}; |
| 147 |
|
| 148 |
struct aws_mqtt5_packet_puback_storage { |
| 149 |
struct aws_mqtt5_packet_puback_view storage_view; |
| 150 |
|
| 151 |
struct aws_byte_cursor reason_string; |
| 152 |
|
| 153 |
struct aws_mqtt5_user_property_set user_properties; |
| 154 |
|
| 155 |
struct aws_byte_buf storage; |
| 156 |
}; |
| 157 |
|
| 158 |
struct aws_mqtt5_packet_disconnect_storage { |
| 159 |
struct aws_mqtt5_packet_disconnect_view storage_view; |
| 160 |
|
| 161 |
uint32_t session_expiry_interval_seconds; |
| 162 |
|
| 163 |
struct aws_byte_cursor reason_string; |
| 164 |
|
| 165 |
struct aws_mqtt5_user_property_set user_properties; |
| 166 |
|
| 167 |
struct aws_byte_cursor server_reference; |
| 168 |
|
| 169 |
struct aws_byte_buf storage; |
| 170 |
}; |
| 171 |
|
| 172 |
struct aws_mqtt5_packet_subscribe_storage { |
| 173 |
struct aws_mqtt5_packet_subscribe_view storage_view; |
| 174 |
|
| 175 |
uint32_t subscription_identifier; |
| 176 |
|
| 177 |
struct aws_array_list subscriptions; |
| 178 |
|
| 179 |
struct aws_mqtt5_user_property_set user_properties; |
| 180 |
|
| 181 |
struct aws_byte_buf storage; |
| 182 |
}; |
| 183 |
|
| 184 |
struct aws_mqtt5_packet_unsubscribe_storage { |
| 185 |
struct aws_mqtt5_packet_unsubscribe_view storage_view; |
| 186 |
|
| 187 |
struct aws_array_list topic_filters; |
| 188 |
|
| 189 |
struct aws_mqtt5_user_property_set user_properties; |
| 190 |
|
| 191 |
struct aws_byte_buf storage; |
| 192 |
}; |
| 193 |
|
| 194 |
AWS_EXTERN_C_BEGIN |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
AWS_MQTT_API int aws_mqtt5_user_property_set_init_with_storage( |
| 199 |
struct aws_mqtt5_user_property_set *property_set, |
| 200 |
struct aws_allocator *allocator, |
| 201 |
struct aws_byte_buf *storage_buffer, |
| 202 |
size_t property_count, |
| 203 |
const struct aws_mqtt5_user_property *properties); |
| 204 |
|
| 205 |
AWS_MQTT_API void aws_mqtt5_user_property_set_clean_up(struct aws_mqtt5_user_property_set *property_set); |
| 206 |
|
| 207 |
AWS_MQTT_API size_t aws_mqtt5_user_property_set_size(const struct aws_mqtt5_user_property_set *property_set); |
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
AWS_MQTT_API int aws_mqtt5_packet_connect_storage_init( |
| 212 |
struct aws_mqtt5_packet_connect_storage *connect_storage, |
| 213 |
struct aws_allocator *allocator, |
| 214 |
const struct aws_mqtt5_packet_connect_view *connect_options, |
| 215 |
const struct aws_mqtt5_client_options_storage *options_storage); |
| 216 |
|
| 217 |
AWS_MQTT_API int aws_mqtt5_packet_connect_storage_init_from_external_storage( |
| 218 |
struct aws_mqtt5_packet_connect_storage *connect_storage, |
| 219 |
struct aws_allocator *allocator); |
| 220 |
|
| 221 |
AWS_MQTT_API void aws_mqtt5_packet_connect_storage_clean_up(struct aws_mqtt5_packet_connect_storage *connect_storage); |
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
AWS_MQTT_API int aws_mqtt5_packet_connack_storage_init( |
| 226 |
struct aws_mqtt5_packet_connack_storage *connack_storage, |
| 227 |
struct aws_allocator *allocator, |
| 228 |
const struct aws_mqtt5_packet_connack_view *connack_options); |
| 229 |
|
| 230 |
AWS_MQTT_API int aws_mqtt5_packet_connack_storage_init_from_external_storage( |
| 231 |
struct aws_mqtt5_packet_connack_storage *connack_storage, |
| 232 |
struct aws_allocator *allocator); |
| 233 |
|
| 234 |
AWS_MQTT_API void aws_mqtt5_packet_connack_storage_clean_up(struct aws_mqtt5_packet_connack_storage *connack_storage); |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
AWS_MQTT_API int aws_mqtt5_packet_disconnect_storage_init( |
| 239 |
struct aws_mqtt5_packet_disconnect_storage *disconnect_storage, |
| 240 |
struct aws_allocator *allocator, |
| 241 |
const struct aws_mqtt5_packet_disconnect_view *disconnect_options); |
| 242 |
|
| 243 |
AWS_MQTT_API int aws_mqtt5_packet_disconnect_storage_init_from_external_storage( |
| 244 |
struct aws_mqtt5_packet_disconnect_storage *disconnect_storage, |
| 245 |
struct aws_allocator *allocator); |
| 246 |
|
| 247 |
AWS_MQTT_API void aws_mqtt5_packet_disconnect_storage_clean_up( |
| 248 |
struct aws_mqtt5_packet_disconnect_storage *disconnect_storage); |
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
AWS_MQTT_API int aws_mqtt5_packet_publish_storage_init( |
| 253 |
struct aws_mqtt5_packet_publish_storage *publish_storage, |
| 254 |
struct aws_allocator *allocator, |
| 255 |
const struct aws_mqtt5_packet_publish_view *publish_options); |
| 256 |
|
| 257 |
AWS_MQTT_API int aws_mqtt5_packet_publish_storage_init_from_external_storage( |
| 258 |
struct aws_mqtt5_packet_publish_storage *publish_storage, |
| 259 |
struct aws_allocator *allocator); |
| 260 |
|
| 261 |
AWS_MQTT_API void aws_mqtt5_packet_publish_storage_clean_up(struct aws_mqtt5_packet_publish_storage *publish_storage); |
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
AWS_MQTT_API int aws_mqtt5_packet_puback_storage_init( |
| 266 |
struct aws_mqtt5_packet_puback_storage *puback_storage, |
| 267 |
struct aws_allocator *allocator, |
| 268 |
const struct aws_mqtt5_packet_puback_view *puback_view); |
| 269 |
|
| 270 |
AWS_MQTT_API int aws_mqtt5_packet_puback_storage_init_from_external_storage( |
| 271 |
struct aws_mqtt5_packet_puback_storage *puback_storage, |
| 272 |
struct aws_allocator *allocator); |
| 273 |
|
| 274 |
AWS_MQTT_API void aws_mqtt5_packet_puback_storage_clean_up(struct aws_mqtt5_packet_puback_storage *puback_storage); |
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
AWS_MQTT_API int aws_mqtt5_packet_subscribe_storage_init( |
| 279 |
struct aws_mqtt5_packet_subscribe_storage *subscribe_storage, |
| 280 |
struct aws_allocator *allocator, |
| 281 |
const struct aws_mqtt5_packet_subscribe_view *subscribe_options); |
| 282 |
|
| 283 |
AWS_MQTT_API int aws_mqtt5_packet_subscribe_storage_init_from_external_storage( |
| 284 |
struct aws_mqtt5_packet_subscribe_storage *subscribe_storage, |
| 285 |
struct aws_allocator *allocator); |
| 286 |
|
| 287 |
AWS_MQTT_API void aws_mqtt5_packet_subscribe_storage_clean_up( |
| 288 |
struct aws_mqtt5_packet_subscribe_storage *subscribe_storage); |
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
AWS_MQTT_API int aws_mqtt5_packet_suback_storage_init( |
| 293 |
struct aws_mqtt5_packet_suback_storage *suback_storage, |
| 294 |
struct aws_allocator *allocator, |
| 295 |
const struct aws_mqtt5_packet_suback_view *suback_view); |
| 296 |
|
| 297 |
AWS_MQTT_API int aws_mqtt5_packet_suback_storage_init_from_external_storage( |
| 298 |
struct aws_mqtt5_packet_suback_storage *suback_storage, |
| 299 |
struct aws_allocator *allocator); |
| 300 |
|
| 301 |
AWS_MQTT_API void aws_mqtt5_packet_suback_storage_clean_up(struct aws_mqtt5_packet_suback_storage *suback_storage); |
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
AWS_MQTT_API int aws_mqtt5_packet_unsubscribe_storage_init( |
| 306 |
struct aws_mqtt5_packet_unsubscribe_storage *unsubscribe_storage, |
| 307 |
struct aws_allocator *allocator, |
| 308 |
const struct aws_mqtt5_packet_unsubscribe_view *unsubscribe_options); |
| 309 |
|
| 310 |
AWS_MQTT_API int aws_mqtt5_packet_unsubscribe_storage_init_from_external_storage( |
| 311 |
struct aws_mqtt5_packet_unsubscribe_storage *unsubscribe_storage, |
| 312 |
struct aws_allocator *allocator); |
| 313 |
|
| 314 |
AWS_MQTT_API void aws_mqtt5_packet_unsubscribe_storage_clean_up( |
| 315 |
struct aws_mqtt5_packet_unsubscribe_storage *unsubscribe_storage); |
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
AWS_MQTT_API int aws_mqtt5_packet_unsuback_storage_init( |
| 320 |
struct aws_mqtt5_packet_unsuback_storage *unsuback_storage, |
| 321 |
struct aws_allocator *allocator, |
| 322 |
const struct aws_mqtt5_packet_unsuback_view *unsuback_view); |
| 323 |
|
| 324 |
AWS_MQTT_API int aws_mqtt5_packet_unsuback_storage_init_from_external_storage( |
| 325 |
struct aws_mqtt5_packet_unsuback_storage *unsuback_storage, |
| 326 |
struct aws_allocator *allocator); |
| 327 |
|
| 328 |
AWS_MQTT_API void aws_mqtt5_packet_unsuback_storage_clean_up( |
| 329 |
struct aws_mqtt5_packet_unsuback_storage *unsuback_storage); |
| 330 |
|
| 331 |
AWS_EXTERN_C_END |
| 332 |
AWS_POP_SANE_WARNING_LEVEL |
| 333 |
|
| 334 |
#endif |