# SRP Server

# SRP Server

This module includes configuration variables for the SRP Server.

## Summary

| ### Macros ||
|---|---|
| `https://openthread.io/reference/config/group/config-srp-server#group__config-srp-server_1ga000d3121e9427f141ed553430d95d6a6 0` | Define to 1 to enable Advertising Proxy for SRP Sever. |
| `https://openthread.io/reference/config/group/config-srp-server#group__config-srp-server_1ga10c441a430479a02e2cbfe6b1eabc659 OT_SRP_SERVER_ADDRESS_MODE_UNICAST` | Specifies the default address mode used by the SRP server. |
| `https://openthread.io/reference/config/group/config-srp-server#group__config-srp-server_1gab5b4271fed98cfda4173a056824f0f24 0` | Define to 1 to enable SRP Server support. |
| `https://openthread.io/reference/config/group/config-srp-server#group__config-srp-server_1gab14c10a333d15e63f54aa0071a0044d8 0` | The Fast Start Mode is designed for scenarios where a device, often a mobile device, needs to act as a provisional SRP server (e.g., functioning as a temporary Border Router). |
| `https://openthread.io/reference/config/group/config-srp-server#group__config-srp-server_1gab0db7e2d3d9ae2eea53b539e5fae49c7 1` | Define to 1 to enable SRP server feature to save its own port in non-volatile settings. |
| `https://openthread.io/reference/config/group/config-srp-server#group__config-srp-server_1gae4030e248d1b5b2452fef557a9955670 ((4 * 250u) + 250u)` | Specifies the timeout value (in milliseconds) for the service update handler. |
| `https://openthread.io/reference/config/group/config-srp-server#group__config-srp-server_1ga1e52667fec4e28bd1dd90455b5b46e1a 53554` | Specifies the max port number in the port range reserved for SRP server. |
| `https://openthread.io/reference/config/group/config-srp-server#group__config-srp-server_1gaa09342ff55c88bc0f16253ca330cc00b 53535` | Specifies the min port number in the port range reserved for SRP server. |

## Macros

### OPENTHREAD_CONFIG_SRP_SERVER_ADVERTISING_PROXY_ENABLE

```
 OPENTHREAD_CONFIG_SRP_SERVER_ADVERTISING_PROXY_ENABLE 0
```
Define to 1 to enable Advertising Proxy for SRP Sever.

### OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDRESS_MODE

```
 OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDRESS_MODE OT_SRP_SERVER_ADDRESS_MODE_UNICAST
```
Specifies the default address mode used by the SRP server.

The address mode specifies how address and port number are determined by the SRP server and how this info is published in the Thread Network Data.

The value of this configuration should be from `otSrpServerAddressMode` enumeration.

### OPENTHREAD_CONFIG_SRP_SERVER_ENABLE

```
 OPENTHREAD_CONFIG_SRP_SERVER_ENABLE 0
```
Define to 1 to enable SRP Server support.

### OPENTHREAD_CONFIG_SRP_SERVER_FAST_START_MODE_ENABLE

```
 OPENTHREAD_CONFIG_SRP_SERVER_FAST_START_MODE_ENABLE 0
```
The Fast Start Mode is designed for scenarios where a device, often a mobile device, needs to act as a provisional SRP server (e.g., functioning as a temporary Border Router).

The SRP server function is enabled only if no other Border Routers (BRs) are already providing the SRP service within the Thread network. A common use case is a mobile device joining a Thread network where it may be the first, or only, BR. Importantly, Fast Start Mode allows the device to quickly start its SRP server functionality upon joining the network, allowing other Thread devices to quickly connect and register their services without the typical delays associated with standard Border Router initialization (and SRP server startup).

The Fast Start Mode can be enabled using `otSrpServerEnableFastStartMode()`. More details about behavior and restrictions are provided in the documentation of this API.

### OPENTHREAD_CONFIG_SRP_SERVER_PORT_SWITCH_ENABLE

```
 OPENTHREAD_CONFIG_SRP_SERVER_PORT_SWITCH_ENABLE 1
```
Define to 1 to enable SRP server feature to save its own port in non-volatile settings.

When enabled, the SRP server will save its port in the non-volatile settings. On a server restart (e.g., due to a device reset) it will restore the port and change to a different one. The info is written to Settings after the first service has been registered due to receiving an SRP Update.

### OPENTHREAD_CONFIG_SRP_SERVER_SERVICE_UPDATE_TIMEOUT

```
 OPENTHREAD_CONFIG_SRP_SERVER_SERVICE_UPDATE_TIMEOUT ((4 * 250u) + 250u)
```
Specifies the timeout value (in milliseconds) for the service update handler.

The default timeout value is the sum of the maximum total mDNS probing delays and a loose IPC timeout of 250ms. It is recommended that this configuration should not use a value smaller than the default value here, if an Advertising Proxy is used to handle the service update events.

### OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MAX

```
 OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MAX 53554
```
Specifies the max port number in the port range reserved for SRP server.

### OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MIN

```
 OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MIN 53535
```
Specifies the min port number in the port range reserved for SRP server.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).