> ## Documentation Index
> Fetch the complete documentation index at: https://notevil.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CAPLfunctionDoIPSetLocalIPaddressVersion

# DoIP\_SetLocalIPaddressVersion

[Valid for](../../../Shared/FeatureAvailability.md): CANoe DE

**Note**\
The following DoIP CAPL function is only available with the modeling library **DoIP.dll** and eventually an appropriate implementation of the CAPL Callback Interface. Information about the DoIP DLL and the CAPL Callback Interface you find here:

* [DoIP CAPL Introduction](../CAPLDiagnosticDoIP.md)
* [AN-IND-1-012\_CAPL\_Callback\_Interface.pdf](javascript:startDemoLoader\('AN-IND-1-012_CAPL_Callback_Interface.pdf'\))
* [AN-IND-1-026\_DoIP\_in\_CANoe.pdf](javascript:startDemoLoader\('AN-IND-1-026_DoIP_in_CANoe.pdf'\))

## Function Syntax

```plaintext theme={null}
void DoIP_SetLocalIPaddressVersion(dword addressIPVersion);
```

## Description

When no local IP address is given explicitly, select the local address according to the priority set with this function. For example, this will allow the selection of a specific address type when only the network adapter is configured.

## Parameters

* **addressIPVersion**
  * 0: Use IPv6 address if no IPv4 address is available (default)
  * 4: Use only IPv4 address
  * 6: Use only IPv6 address other: reserved

## Return Values

[Error code](../CAPLfunctionsDiagnosticsErrorCode.md)

## Example

```plaintext theme={null}
// Use the IPv6 address configured for the selected network adapter
char buffer[256];
DiagGetCommParameter( "DoIP.TESTER_Adapter", 0, buffer, elcount( buffer));
DoIP_SetTesterAdapter( buffer);
DoIP_SetLocalIPaddressVersion( 6);
```

[DoIP\_SetLocalIPaddress](CAPLfunctionDoIPSetLocalIPaddress.md) • [DoIP\_SetTesterAdapter](CAPLfunctionDoIPSetTesterAdapter.md) • [DoIP\_SetVehicleAdapter](CAPLfunctionDoIPSetVehicleAdapter.md)
