pub unsafe extern "C" fn otSrpClientBuffersAllocateService(
    aInstance: *mut otInstance
) -> *mut otSrpClientBuffersServiceEntry
Expand description

Allocates a new service entry from the pool.

The returned service entry instance will be initialized as follows:

  • mService.mName will point to an allocated string buffer which can be retrieved using the function otSrpClientBuffersGetServiceEntryServiceNameString().
  • mService.mInstanceName will point to an allocated string buffer which can be retrieved using the function otSrpClientBuffersGetServiceEntryInstanceNameString().
  • mService.mSubTypeLabels points to an array that is returned from otSrpClientBuffersGetSubTypeLabelsArray().
  • mService.mTxtEntries will point to mTxtEntry.
  • mService.mNumTxtEntries will be set to one.
  • Other mService fields (port, priority, weight) are set to zero.
  • mTxtEntry.mKey is set to NULL (value is treated as already encoded).
  • mTxtEntry.mValue will point to an allocated buffer which can be retrieved using the function otSrpClientBuffersGetServiceEntryTxtBuffer().
  • mTxtEntry.mValueLength is set to zero.
  • All related data/string buffers and arrays are cleared to all zero.

@param[in] aInstance A pointer to the OpenThread instance.

@returns A pointer to the newly allocated service entry or NULL if not more entry available in the pool.