Modules#

otSrpClientHostInfo

otSrpClientService

otSrpClientBuffersServiceEntry

otSrpServerTtlConfig

otSrpServerLeaseConfig

otSrpServerLeaseInfo

otSrpServerResponseCounters

SRP#

This module includes functions that control SRP client behavior.

This module includes functions of the Service Registration Protocol.

This module includes functions for SRP client buffers and service pool.

Functions in this module are only available when feature OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_ENABLE is enabled.

Enumerations#

enum
OT_SRP_CLIENT_ITEM_STATE_TO_ADD
OT_SRP_CLIENT_ITEM_STATE_ADDING
OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH
OT_SRP_CLIENT_ITEM_STATE_REFRESHING
OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE
OT_SRP_CLIENT_ITEM_STATE_REMOVING
OT_SRP_CLIENT_ITEM_STATE_REGISTERED
OT_SRP_CLIENT_ITEM_STATE_REMOVED
}

This enumeration specifies an SRP client item (service or host info) state.

enum
@23 {
OT_SRP_SERVER_SERVICE_FLAG_BASE_TYPE = 1 << 0
OT_SRP_SERVER_SERVICE_FLAG_SUB_TYPE = 1 << 1
OT_SRP_SERVER_SERVICE_FLAG_ACTIVE = 1 << 2
OT_SRP_SERVER_SERVICE_FLAG_DELETED = 1 << 3
}
enum
@24 {
OT_SRP_SERVER_FLAGS_ANY_SERVICE = (OT_SRP_SERVER_SERVICE_FLAG_BASE_TYPE | OT_SRP_SERVER_SERVICE_FLAG_SUB_TYPE | OT_SRP_SERVER_SERVICE_FLAG_ACTIVE | OT_SRP_SERVER_SERVICE_FLAG_DELETED)
OT_SRP_SERVER_FLAGS_BASE_TYPE_SERVICE_ONLY = (OT_SRP_SERVER_SERVICE_FLAG_BASE_TYPE | OT_SRP_SERVER_SERVICE_FLAG_ACTIVE | OT_SRP_SERVER_SERVICE_FLAG_DELETED)
OT_SRP_SERVER_FLAGS_SUB_TYPE_SERVICE_ONLY = (OT_SRP_SERVER_SERVICE_FLAG_SUB_TYPE | OT_SRP_SERVER_SERVICE_FLAG_ACTIVE | OT_SRP_SERVER_SERVICE_FLAG_DELETED)
OT_SRP_SERVER_FLAGS_ANY_TYPE_ACTIVE_SERVICE = (OT_SRP_SERVER_SERVICE_FLAG_BASE_TYPE | OT_SRP_SERVER_SERVICE_FLAG_SUB_TYPE | OT_SRP_SERVER_SERVICE_FLAG_ACTIVE)
OT_SRP_SERVER_FLAGS_ANY_TYPE_DELETED_SERVICE = (OT_SRP_SERVER_SERVICE_FLAG_BASE_TYPE | OT_SRP_SERVER_SERVICE_FLAG_SUB_TYPE | OT_SRP_SERVER_SERVICE_FLAG_ACTIVE)
}
enum
OT_SRP_SERVER_STATE_DISABLED = 0
OT_SRP_SERVER_STATE_RUNNING = 1
OT_SRP_SERVER_STATE_STOPPED = 2
}

This enumeration represents the state of the SRP server.

enum
OT_SRP_SERVER_ADDRESS_MODE_UNICAST = 0
OT_SRP_SERVER_ADDRESS_MODE_ANYCAST = 1
}

This enumeration represents the address mode used by the SRP server.

Typedefs#

typedef struct otSrpClientHostInfo

This structure represents an SRP client host info.

typedef struct otSrpClientService

This structure represents an SRP client service.

typedef void(*
otSrpClientCallback)(otError aError, const otSrpClientHostInfo *aHostInfo, const otSrpClientService *aServices, const otSrpClientService *aRemovedServices, void *aContext)

This function pointer type defines the callback used by SRP client to notify user of changes/events/errors.

typedef void(*
otSrpClientAutoStartCallback)(const otSockAddr *aServerSockAddr, void *aContext)

This function pointer type defines the callback used by SRP client to notify user when it is auto-started or stopped.

This struct represents a SRP client service pool entry.

typedef struct otSrpServerHost

This opaque type represents a SRP service host.

typedef struct otSrpServerService

This opaque type represents a SRP service.

typedef uint32_t

The ID of a SRP service update transaction on the SRP Server.

typedef uint8_t

The service flag type to indicate which services to include or exclude when searching in (or iterating over) the list of SRP services.

This enumeration represents the address mode used by the SRP server.

typedef struct otSrpServerTtlConfig

This structure includes SRP server TTL configurations.

typedef struct otSrpServerLeaseConfig

This structure includes SRP server LEASE and KEY-LEASE configurations.

typedef struct otSrpServerLeaseInfo

This structure includes SRP server lease information of a host/service.

This structure includes the statistics of SRP server responses.

typedef void(*
otSrpServerServiceUpdateHandler)(otSrpServerServiceUpdateId aId, const otSrpServerHost *aHost, uint32_t aTimeout, void *aContext)

This function handles SRP service updates.

Functions#

otSrpClientStart(otInstance *aInstance, const otSockAddr *aServerSockAddr)

This function starts the SRP client operation.

void
otSrpClientStop(otInstance *aInstance)

This function stops the SRP client operation.

bool
otSrpClientIsRunning(otInstance *aInstance)

This function indicates whether the SRP client is running or not.

const otSockAddr *
otSrpClientGetServerAddress(otInstance *aInstance)

This function gets the socket address (IPv6 address and port number) of the SRP server which is being used by SRP client.

void
otSrpClientSetCallback(otInstance *aInstance, otSrpClientCallback aCallback, void *aContext)

This function sets the callback to notify caller of events/changes from SRP client.

void
otSrpClientEnableAutoStartMode(otInstance *aInstance, otSrpClientAutoStartCallback aCallback, void *aContext)

This function enables the auto-start mode.

void
otSrpClientDisableAutoStartMode(otInstance *aInstance)

This function disables the auto-start mode.

bool
otSrpClientIsAutoStartModeEnabled(otInstance *aInstance)

This function indicates the current state of auto-start mode (enabled or disabled).

uint32_t
otSrpClientGetTtl(otInstance *aInstance)

This function gets the TTL value in every record included in SRP update requests.

void
otSrpClientSetTtl(otInstance *aInstance, uint32_t aTtl)

This function sets the TTL value in every record included in SRP update requests.

uint32_t
otSrpClientGetLeaseInterval(otInstance *aInstance)

This function gets the default lease interval used in SRP update requests.

void
otSrpClientSetLeaseInterval(otInstance *aInstance, uint32_t aInterval)

This function sets the default lease interval used in SRP update requests.

uint32_t
otSrpClientGetKeyLeaseInterval(otInstance *aInstance)

This function gets the default key lease interval used in SRP update requests.

void
otSrpClientSetKeyLeaseInterval(otInstance *aInstance, uint32_t aInterval)

This function sets the default key lease interval used in SRP update requests.

otSrpClientGetHostInfo(otInstance *aInstance)

This function gets the host info.

otSrpClientSetHostName(otInstance *aInstance, const char *aName)

This function sets the host name label.

otSrpClientEnableAutoHostAddress(otInstance *aInstance)

This function enables auto host address mode.

otSrpClientSetHostAddresses(otInstance *aInstance, const otIp6Address *aIp6Addresses, uint8_t aNumAddresses)

This function sets/updates the list of host IPv6 address.

otSrpClientAddService(otInstance *aInstance, otSrpClientService *aService)

This function adds a service to be registered with server.

otSrpClientRemoveService(otInstance *aInstance, otSrpClientService *aService)

This function requests a service to be unregistered with server.

otSrpClientClearService(otInstance *aInstance, otSrpClientService *aService)

This function clears a service, immediately removing it from the client service list.

otSrpClientGetServices(otInstance *aInstance)

This function gets the list of services being managed by client.

otSrpClientRemoveHostAndServices(otInstance *aInstance, bool aRemoveKeyLease, bool aSendUnregToServer)

This function starts the remove process of the host info and all services.

void
otSrpClientClearHostAndServices(otInstance *aInstance)

This function clears all host info and all the services.

const char *
otSrpClientGetDomainName(otInstance *aInstance)

This function gets the domain name being used by SRP client.

otSrpClientSetDomainName(otInstance *aInstance, const char *aName)

This function sets the domain name to be used by SRP client.

const char *
otSrpClientItemStateToString(otSrpClientItemState aItemState)

This function converts a otSrpClientItemState to a string.

void
otSrpClientSetServiceKeyRecordEnabled(otInstance *aInstance, bool aEnabled)

This function enables/disables "service key record inclusion" mode.

bool

This method indicates whether the "service key record inclusion" mode is enabled or disabled.

char *
otSrpClientBuffersGetHostNameString(otInstance *aInstance, uint16_t *aSize)

This function gets the string buffer to use for SRP client host name.

otSrpClientBuffersGetHostAddressesArray(otInstance *aInstance, uint8_t *aArrayLength)

This function gets the array of IPv6 address entries to use as SRP client host address list.

otSrpClientBuffersAllocateService(otInstance *aInstance)

This function allocates a new service entry from the pool.

void
otSrpClientBuffersFreeService(otInstance *aInstance, otSrpClientBuffersServiceEntry *aService)

This function frees a previously allocated service entry.

void
otSrpClientBuffersFreeAllServices(otInstance *aInstance)

This function frees all previously allocated service entries.

char *
otSrpClientBuffersGetServiceEntryServiceNameString(otSrpClientBuffersServiceEntry *aEntry, uint16_t *aSize)

This function gets the string buffer for service name from a service entry.

char *
otSrpClientBuffersGetServiceEntryInstanceNameString(otSrpClientBuffersServiceEntry *aEntry, uint16_t *aSize)

This function gets the string buffer for service instance name from a service entry.

uint8_t *
otSrpClientBuffersGetServiceEntryTxtBuffer(otSrpClientBuffersServiceEntry *aEntry, uint16_t *aSize)

This function gets the buffer for TXT record from a service entry.

const char **
otSrpClientBuffersGetSubTypeLabelsArray(otSrpClientBuffersServiceEntry *aEntry, uint16_t *aArrayLength)

This function gets the array for service subtype labels from the service entry.

const char *
otSrpServerGetDomain(otInstance *aInstance)

This function returns the domain authorized to the SRP server.

otSrpServerSetDomain(otInstance *aInstance, const char *aDomain)

This function sets the domain on the SRP server.

otSrpServerGetState(otInstance *aInstance)

This function returns the state of the SRP server.

uint16_t
otSrpServerGetPort(otInstance *aInstance)

This function returns the port the SRP server is listening to.

otSrpServerGetAddressMode(otInstance *aInstance)

This function returns the address mode being used by the SRP server.

otSrpServerSetAddressMode(otInstance *aInstance, otSrpServerAddressMode aMode)

This function sets the address mode to be used by the SRP server.

uint8_t

This function returns the sequence number used with anycast address mode.

otSrpServerSetAnycastModeSequenceNumber(otInstance *aInstance, uint8_t aSequenceNumber)

This function sets the sequence number used with anycast address mode.

void
otSrpServerSetEnabled(otInstance *aInstance, bool aEnabled)

This function enables/disables the SRP server.

void
otSrpServerSetAutoEnableMode(otInstance *aInstance, bool aEnabled)

This function enables/disables the auto-enable mode on SRP server.

bool
otSrpServerIsAutoEnableMode(otInstance *aInstance)

This function indicates whether the auto-enable mode is enabled or disabled.

void
otSrpServerGetTtlConfig(otInstance *aInstance, otSrpServerTtlConfig *aTtlConfig)

This function returns SRP server TTL configuration.

otSrpServerSetTtlConfig(otInstance *aInstance, const otSrpServerTtlConfig *aTtlConfig)

This function sets SRP server TTL configuration.

void
otSrpServerGetLeaseConfig(otInstance *aInstance, otSrpServerLeaseConfig *aLeaseConfig)

This function returns SRP server LEASE and KEY-LEASE configurations.

otSrpServerSetLeaseConfig(otInstance *aInstance, const otSrpServerLeaseConfig *aLeaseConfig)

This function sets SRP server LEASE and KEY-LEASE configurations.

void
otSrpServerSetServiceUpdateHandler(otInstance *aInstance, otSrpServerServiceUpdateHandler aServiceHandler, void *aContext)

This function sets the SRP service updates handler on SRP server.

void
otSrpServerHandleServiceUpdateResult(otInstance *aInstance, otSrpServerServiceUpdateId aId, otError aError)

This function reports the result of processing a SRP update to the SRP server.

otSrpServerGetNextHost(otInstance *aInstance, const otSrpServerHost *aHost)

This function returns the next registered host on the SRP server.

otSrpServerGetResponseCounters(otInstance *aInstance)

This function returns the response counters of the SRP server.

bool
otSrpServerHostIsDeleted(const otSrpServerHost *aHost)

This function tells if the SRP service host has been deleted.

const char *
otSrpServerHostGetFullName(const otSrpServerHost *aHost)

This function returns the full name of the host.

const otIp6Address *
otSrpServerHostGetAddresses(const otSrpServerHost *aHost, uint8_t *aAddressesNum)

This function returns the addresses of given host.

void
otSrpServerHostGetLeaseInfo(const otSrpServerHost *aHost, otSrpServerLeaseInfo *aLeaseInfo)

This function returns the LEASE and KEY-LEASE information of a given host.

otSrpServerHostGetNextService(const otSrpServerHost *aHost, const otSrpServerService *aService)

This function returns the next service (excluding any sub-type services) of given host.

otSrpServerHostFindNextService(const otSrpServerHost *aHost, const otSrpServerService *aPrevService, otSrpServerServiceFlags aFlags, const char *aServiceName, const char *aInstanceName)

This function finds the next matching service on the host.

bool
otSrpServerServiceIsDeleted(const otSrpServerService *aService)

This function indicates whether or not the SRP service has been deleted.

bool
otSrpServerServiceIsSubType(const otSrpServerService *aService)

This function indicates whether or not the SRP service is sub-type.

const char *
otSrpServerServiceGetFullName(const otSrpServerService *aService)

This function returns the full service instance name of the service.

const char *
otSrpServerServiceGetInstanceName(const otSrpServerService *aService)

This function returns the full service instance name of the service.

const char *
otSrpServerServiceGetServiceName(const otSrpServerService *aService)

This function returns the full service name of the service.

otSrpServerServiceGetServiceSubTypeLabel(const otSrpServerService *aService, char *aLabel, uint8_t aMaxSize)

This function gets the sub-type label from service name.

uint16_t
otSrpServerServiceGetPort(const otSrpServerService *aService)

This function returns the port of the service instance.

uint16_t
otSrpServerServiceGetWeight(const otSrpServerService *aService)

This function returns the weight of the service instance.

uint16_t
otSrpServerServiceGetPriority(const otSrpServerService *aService)

This function returns the priority of the service instance.

uint32_t
otSrpServerServiceGetTtl(const otSrpServerService *aService)

This function returns the TTL of the service instance.

const uint8_t *
otSrpServerServiceGetTxtData(const otSrpServerService *aService, uint16_t *aDataLength)

This function returns the TXT record data of the service instance.

otSrpServerServiceGetHost(const otSrpServerService *aService)

This function returns the host which the service instance reside on.

void
otSrpServerServiceGetLeaseInfo(const otSrpServerService *aService, otSrpServerLeaseInfo *aLeaseInfo)