summaryrefslogtreecommitdiff
path: root/src/components/connection_handler/include/connection_handler/connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/connection_handler/include/connection_handler/connection.h')
-rw-r--r--src/components/connection_handler/include/connection_handler/connection.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h
index bd5858c4cd..aef1c92f1e 100644
--- a/src/components/connection_handler/include/connection_handler/connection.h
+++ b/src/components/connection_handler/include/connection_handler/connection.h
@@ -76,8 +76,10 @@ struct Service {
Service()
: service_type(protocol_handler::kInvalidServiceType)
, is_protected_(false) {}
+
explicit Service(protocol_handler::ServiceType service_type)
: service_type(service_type), is_protected_(false) {}
+
bool operator==(const protocol_handler::ServiceType service_type) const {
return this->service_type == service_type;
}
@@ -209,6 +211,17 @@ class Connection {
*/
void SetProtectionFlag(const uint8_t session_id,
const protocol_handler::ServiceType& service_type);
+
+ /**
+ * @brief Check if session contains service with specified service type
+ * @param session_id id of session to check
+ * @param service_type type of service to check
+ * @return true if session contains service with specified service type
+ */
+ bool IsSessionServiceExists(
+ const uint8_t session_id,
+ const protocol_handler::ServiceType& service_type);
+
#endif // ENABLE_SECURITY
/**
* @brief Returns map of sessions which have been opened in