| 1 |
#ifndef AWS_MQTT_PRIVATE_REQUEST_RESPONSE_SUBSCRIPTION_SET_H |
| 2 |
#define AWS_MQTT_PRIVATE_REQUEST_RESPONSE_SUBSCRIPTION_SET_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include <aws/common/byte_buf.h> |
| 10 |
#include <aws/common/hash_table.h> |
| 11 |
#include <aws/common/linked_list.h> |
| 12 |
#include <aws/mqtt/exports.h> |
| 13 |
|
| 14 |
struct aws_mqtt_rr_incoming_publish_event; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
struct aws_request_response_subscriptions { |
| 21 |
struct aws_allocator *allocator; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
struct aws_hash_table streaming_operation_subscription_lists; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
struct aws_hash_table streaming_operation_wildcards_subscription_lists; |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
struct aws_hash_table request_response_paths; |
| 43 |
}; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
struct aws_rr_operation_list_topic_filter_entry { |
| 49 |
struct aws_allocator *allocator; |
| 50 |
|
| 51 |
struct aws_byte_cursor topic_filter_cursor; |
| 52 |
struct aws_byte_buf topic_filter; |
| 53 |
|
| 54 |
struct aws_linked_list operations; |
| 55 |
}; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
struct aws_rr_response_path_entry { |
| 61 |
struct aws_allocator *allocator; |
| 62 |
|
| 63 |
size_t ref_count; |
| 64 |
|
| 65 |
struct aws_byte_cursor topic_cursor; |
| 66 |
struct aws_byte_buf topic; |
| 67 |
|
| 68 |
struct aws_byte_buf correlation_token_json_path; |
| 69 |
}; |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
typedef void(aws_mqtt_stream_operation_subscription_match_fn)( |
| 75 |
const struct aws_linked_list *operations, |
| 76 |
const struct aws_byte_cursor *topic_filter, |
| 77 |
const struct aws_mqtt_rr_incoming_publish_event *publish_event, |
| 78 |
void *user_data); |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
typedef void(aws_mqtt_request_operation_subscription_match_fn)( |
| 84 |
struct aws_rr_response_path_entry *entry, |
| 85 |
const struct aws_mqtt_rr_incoming_publish_event *publish_event, |
| 86 |
void *user_data); |
| 87 |
|
| 88 |
AWS_EXTERN_C_BEGIN |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
AWS_MQTT_API int aws_mqtt_request_response_client_subscriptions_init( |
| 94 |
struct aws_request_response_subscriptions *subscriptions, |
| 95 |
struct aws_allocator *allocator); |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
AWS_MQTT_API void aws_mqtt_request_response_client_subscriptions_clean_up( |
| 101 |
struct aws_request_response_subscriptions *subscriptions); |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
AWS_MQTT_API struct aws_rr_operation_list_topic_filter_entry * |
| 109 |
aws_mqtt_request_response_client_subscriptions_add_stream_subscription( |
| 110 |
struct aws_request_response_subscriptions *subscriptions, |
| 111 |
const struct aws_byte_cursor *topic_filter); |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
AWS_MQTT_API int aws_mqtt_request_response_client_subscriptions_add_request_subscription( |
| 117 |
struct aws_request_response_subscriptions *subscriptions, |
| 118 |
const struct aws_byte_cursor *topic_filter, |
| 119 |
const struct aws_byte_cursor *correlation_token_json_path); |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
AWS_MQTT_API int aws_mqtt_request_response_client_subscriptions_remove_request_subscription( |
| 125 |
struct aws_request_response_subscriptions *subscriptions, |
| 126 |
const struct aws_byte_cursor *topic_filter); |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
AWS_MQTT_API void aws_mqtt_request_response_client_subscriptions_handle_incoming_publish( |
| 132 |
const struct aws_request_response_subscriptions *subscriptions, |
| 133 |
const struct aws_mqtt_rr_incoming_publish_event *publish_event, |
| 134 |
aws_mqtt_stream_operation_subscription_match_fn *on_stream_operation_subscription_match, |
| 135 |
aws_mqtt_request_operation_subscription_match_fn *on_request_operation_subscription_match, |
| 136 |
void *user_data); |
| 137 |
|
| 138 |
AWS_EXTERN_C_END |
| 139 |
|
| 140 |
#endif |