11//
2- // ZoneMinder Monitor:: ONVIF Class Implementation
2+ // ZoneMinder ONVIF Class Implementation
33// Copyright (C) 2024 ZoneMinder Inc
44//
55// This program is free software; you can redistribute it and/or
1717// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818//
1919
20+ #include " zm_monitor_onvif.h"
2021#include " zm_monitor.h"
2122
2223#include < cstring>
@@ -48,7 +49,7 @@ std::string SOAP_STRINGS[] = {
4849 " SOAP_FAULT" , // 12
4950};
5051
51- Monitor:: ONVIF::ONVIF (Monitor *parent_) :
52+ ONVIF::ONVIF (Monitor *parent_) :
5253 parent(parent_)
5354 ,alarmed(false )
5455 ,healthy(false )
@@ -67,7 +68,7 @@ Monitor::ONVIF::ONVIF(Monitor *parent_) :
6768#endif
6869}
6970
70- Monitor:: ONVIF::~ONVIF () {
71+ ONVIF::~ONVIF () {
7172#ifdef WITH_GSOAP
7273 if (soap != nullptr ) {
7374 Debug (1 , " ONVIF: Tearing Down" );
@@ -105,7 +106,7 @@ Monitor::ONVIF::~ONVIF() {
105106#endif
106107}
107108
108- void Monitor:: ONVIF::start () {
109+ void ONVIF::start () {
109110#ifdef WITH_GSOAP
110111 tev__PullMessages.Timeout = pull_timeout.c_str ();
111112 tev__PullMessages.MessageLimit = 10 ;
@@ -321,7 +322,7 @@ void Monitor::ONVIF::start() {
321322#endif
322323}
323324
324- void Monitor:: ONVIF::WaitForMessage () {
325+ void ONVIF::WaitForMessage () {
325326#ifdef WITH_GSOAP
326327 set_credentials (soap);
327328
@@ -521,7 +522,7 @@ void Monitor::ONVIF::WaitForMessage() {
521522// pull_timeout=PT20S - Timeout for PullMessages requests
522523// subscription_timeout=PT60S - Timeout for subscription renewal
523524// max_retries=5 - Maximum retry attempts
524- void Monitor:: ONVIF::parse_onvif_options () {
525+ void ONVIF::parse_onvif_options () {
525526 if (parent->onvif_options .empty ()) {
526527 return ;
527528 }
@@ -573,7 +574,7 @@ void Monitor::ONVIF::parse_onvif_options() {
573574
574575// Calculate exponential backoff delay for retries
575576// Returns delay in seconds: min(2^retry_count, ONVIF_RETRY_DELAY_CAP)
576- int Monitor:: ONVIF::get_retry_delay () {
577+ int ONVIF::get_retry_delay () {
577578 // Use safe approach to avoid integer overflow
578579 if (retry_count >= ONVIF_RETRY_EXPONENT_LIMIT) {
579580 return ONVIF_RETRY_DELAY_CAP; // 2^9 = 512, cap at 5 minutes
@@ -586,7 +587,7 @@ int Monitor::ONVIF::get_retry_delay() {
586587}
587588
588589// ONVIF Set Credentials
589- void Monitor:: ONVIF::set_credentials (struct soap *soap) {
590+ void ONVIF::set_credentials (struct soap *soap) {
590591 soap_wsse_delete_Security (soap);
591592 soap_wsse_add_Timestamp (soap, " Time" , 10 );
592593
@@ -605,7 +606,7 @@ void Monitor::ONVIF::set_credentials(struct soap *soap) {
605606}
606607
607608// Helper function to parse event messages with flexible XML structure handling
608- bool Monitor:: ONVIF::parse_event_message (wsnt__NotificationMessageHolderType *msg,
609+ bool ONVIF::parse_event_message (wsnt__NotificationMessageHolderType *msg,
609610 std::string &topic,
610611 std::string &value,
611612 std::string &operation) {
@@ -731,7 +732,7 @@ bool Monitor::ONVIF::parse_event_message(wsnt__NotificationMessageHolderType *ms
731732}
732733
733734// Helper function for hierarchical topic matching with wildcard support
734- bool Monitor:: ONVIF::matches_topic_filter (const std::string &topic, const std::string &filter) {
735+ bool ONVIF::matches_topic_filter (const std::string &topic, const std::string &filter) {
735736 if (filter.empty ()) {
736737 return true ; // Empty filter matches all
737738 }
@@ -823,7 +824,7 @@ int SOAP_ENV__Fault(struct soap *soap, char *faultcode, char *faultstring, char
823824}
824825#endif
825826
826- void Monitor:: ONVIF::SetNoteSet (Event::StringSet ¬eSet) {
827+ void ONVIF::SetNoteSet (Event::StringSet ¬eSet) {
827828 #ifdef WITH_GSOAP
828829 std::unique_lock<std::mutex> lck (alarms_mutex);
829830 if (alarms.empty ()) return ;
0 commit comments