@@ -121,6 +121,26 @@ class ThreadStackManager
121
121
CHIP_ERROR RemoveSrpService (const char * aInstanceName, const char * aName);
122
122
CHIP_ERROR InvalidateAllSrpServices (); // /< Mark all SRP services as invalid
123
123
CHIP_ERROR RemoveInvalidSrpServices (); // /< Remove SRP services marked as invalid
124
+
125
+ /*
126
+ * @brief Utility function to clear all thread SRP host and services established between the SRP server and client.
127
+ * It is expected that a transaction is done between the SRP server and client so the clear request is applied on both ends
128
+ *
129
+ * A generic implementation is provided in `GenericThreadStackManagerImpl_OpenThread` with the SoC OT stack
130
+ */
131
+ CHIP_ERROR ClearAllSrpHostAndServices ();
132
+
133
+ /*
134
+ * @brief Used to synchronize on the SRP server response confirming the clearing of the host and service entries
135
+ * Should be called in ClearAllSrpHostAndServices once the request is sent.
136
+ */
137
+ void WaitOnSrpClearAllComplete ();
138
+
139
+ /*
140
+ * @brief Notify that the SRP server confirmed the clearing of the host and service entries
141
+ * Should be called in the SRP Client set callback in the removal confirmation.
142
+ */
143
+ void NotifySrpClearAllComplete ();
124
144
CHIP_ERROR SetupSrpHost (const char * aHostName);
125
145
CHIP_ERROR ClearSrpHost (const char * aHostName);
126
146
CHIP_ERROR SetSrpDnsCallbacks (DnsAsyncReturnCallback aInitCallback, DnsAsyncReturnCallback aErrorCallback, void * aContext);
@@ -289,6 +309,21 @@ inline CHIP_ERROR ThreadStackManager::RemoveInvalidSrpServices()
289
309
return static_cast <ImplClass *>(this )->_RemoveInvalidSrpServices ();
290
310
}
291
311
312
+ inline CHIP_ERROR ThreadStackManager::ClearAllSrpHostAndServices ()
313
+ {
314
+ return static_cast <ImplClass *>(this )->_ClearAllSrpHostAndServices ();
315
+ }
316
+
317
+ inline void ThreadStackManager::WaitOnSrpClearAllComplete ()
318
+ {
319
+ return static_cast <ImplClass *>(this )->_WaitOnSrpClearAllComplete ();
320
+ }
321
+
322
+ inline void ThreadStackManager::NotifySrpClearAllComplete ()
323
+ {
324
+ return static_cast <ImplClass *>(this )->_NotifySrpClearAllComplete ();
325
+ }
326
+
292
327
inline CHIP_ERROR ThreadStackManager::SetupSrpHost (const char * aHostName)
293
328
{
294
329
return static_cast <ImplClass *>(this )->_SetupSrpHost (aHostName);
0 commit comments