7#if !defined(ASYNC_MQTT_PACKET_VALIDATE_PROPERTY_HPP)
8#define ASYNC_MQTT_PACKET_VALIDATE_PROPERTY_HPP
11#include <async_mqtt/packet/property_id.hpp>
15enum class property_location {
32constexpr char const* property_location_to_str(property_location v) {
34 case property_location::connect:
return "connect";
35 case property_location::will:
return "will";
36 case property_location::connack:
return "connack";
37 case property_location::publish:
return "publish";
38 case property_location::puback:
return "puback";
39 case property_location::pubrec:
return "pubrec";
40 case property_location::pubrel:
return "pubrel";
41 case property_location::pubcomp:
return "pubcomp";
42 case property_location::subscribe:
return "subscribe";
43 case property_location::suback:
return "suback";
44 case property_location::unsubscribe:
return "unsubscribe";
45 case property_location::unsuback:
return "unsuback";
46 case property_location::disconnect:
return "disconnect";
47 case property_location::auth:
return "auth";
48 default:
return "invalid property location";
52constexpr bool validate_property(property_location loc, property::id
id) {
54 case property_location::connect:
56 case property::id::session_expiry_interval:
57 case property::id::authentication_method:
58 case property::id::authentication_data:
59 case property::id::request_problem_information:
60 case property::id::request_response_information:
61 case property::id::receive_maximum:
62 case property::id::topic_alias_maximum:
63 case property::id::user_property:
64 case property::id::maximum_packet_size:
70 case property_location::will:
72 case property::id::payload_format_indicator:
73 case property::id::message_expiry_interval:
74 case property::id::content_type:
75 case property::id::response_topic:
76 case property::id::correlation_data:
77 case property::id::will_delay_interval:
78 case property::id::user_property:
84 case property_location::connack:
86 case property::id::session_expiry_interval:
87 case property::id::assigned_client_identifier:
88 case property::id::server_keep_alive:
89 case property::id::authentication_method:
90 case property::id::authentication_data:
91 case property::id::response_information:
92 case property::id::server_reference:
93 case property::id::reason_string:
94 case property::id::receive_maximum:
95 case property::id::topic_alias_maximum:
96 case property::id::maximum_qos:
97 case property::id::retain_available:
98 case property::id::user_property:
99 case property::id::maximum_packet_size:
100 case property::id::wildcard_subscription_available:
101 case property::id::subscription_identifier_available:
102 case property::id::shared_subscription_available:
108 case property_location::publish:
110 case property::id::payload_format_indicator:
111 case property::id::message_expiry_interval:
112 case property::id::content_type:
113 case property::id::response_topic:
114 case property::id::correlation_data:
115 case property::id::subscription_identifier:
116 case property::id::topic_alias:
117 case property::id::user_property:
123 case property_location::puback:
125 case property::id::reason_string:
126 case property::id::user_property:
132 case property_location::pubrec:
134 case property::id::reason_string:
135 case property::id::user_property:
141 case property_location::pubrel:
143 case property::id::reason_string:
144 case property::id::user_property:
150 case property_location::pubcomp:
152 case property::id::reason_string:
153 case property::id::user_property:
159 case property_location::subscribe:
161 case property::id::subscription_identifier:
162 case property::id::user_property:
168 case property_location::suback:
170 case property::id::reason_string:
171 case property::id::user_property:
177 case property_location::unsubscribe:
179 case property::id::user_property:
185 case property_location::unsuback:
187 case property::id::reason_string:
188 case property::id::user_property:
194 case property_location::disconnect:
196 case property::id::session_expiry_interval:
197 case property::id::server_reference:
198 case property::id::reason_string:
199 case property::id::user_property:
205 case property_location::auth:
207 case property::id::authentication_method:
208 case property::id::authentication_data:
209 case property::id::reason_string:
210 case property::id::user_property: