# addFlow

Source: [https://docs.qualcomm.com/doc/80-PK177-134/topic/add_flow.html](https://docs.qualcomm.com/doc/80-PK177-134/topic/add_flow.html)

Adds a new filter to the system and applies the provided uplink/downlink levels, PDCP timer, and OOD value.

    addFlow()Copy to clipboard

## Parameters

| Parameters | API type | Data type | Description |
| --- | --- | --- | --- |
| direction | Java | directionEnum | The [direction](https://docs.qualcomm.com/doc/80-PK177-134/topic/direction.html)<br>                                that the filter should be applied on (UPLINK, DOWNLINK, or<br>                                BOTH). |
| direction | Native | dpp\_directionEnum | The [direction](https://docs.qualcomm.com/doc/80-PK177-134/topic/direction.html)<br>                                that the filter should be applied on (UPLINK, DOWNLINK, or<br>                                BOTH). |
| srcIp | Java | String | Source IP address<br><br><br>                                <br>(This is always the address of the mobile device, even when the<br>                                    filter is for DOWNLINK). |
| srcIp | Native | const char \* | Source IP address<br><br><br>                                <br>(This is always the address of the mobile device, even when the<br>                                    filter is for DOWNLINK). |
| srcPort | Java | int | Source port<br><br><br>                                <br>(This is always the port of the mobile device, even when the<br>                                    filter is for DOWNLINK). |
| srcPort | Native | uint16\_t | Source port<br><br><br>                                <br>(This is always the port of the mobile device, even when the<br>                                    filter is for DOWNLINK). |
| dstIp | Java | String | Destination IP address<br><br><br>                                <br>(This is always the address of the external target, even when the<br>                                    filter is for DOWNLINK). |
| dstIp | Native | const char \* | Destination IP address<br><br><br>                                <br>(This is always the address of the external target, even when the<br>                                    filter is for DOWNLINK). |
| dstPort | Java | int | Destination port<br><br><br>                                <br>(This is always the port of the external target, even when the<br>                                    filter is for DOWNLINK). |
| dstPort | Native | uint16\_t | Destination port<br><br><br>                                <br>(This is always the port of the external target, even when the<br>                                    filter is for DOWNLINK). |
| protocol | Java | protocolEnum | [Protocol](https://docs.qualcomm.com/doc/80-PK177-134/topic/dpp_flow_protocol.html). |
| protocol | Native | dpp\_protocolEnum | [Protocol](https://docs.qualcomm.com/doc/80-PK177-134/topic/dpp_flow_protocol.html). |
| appType | Java | appTypeEnum | Classification of the app requesting the addition of<br>                                this flow ([appType](https://docs.qualcomm.com/doc/80-PK177-134/topic/app_type.html)). |
| appType | Native | dpp\_appTypeEnum | Classification of the app requesting the addition of<br>                                this flow ([appType](https://docs.qualcomm.com/doc/80-PK177-134/topic/app_type.html)). |
| inactivityTimer | Java | long | Time that the flow can be inactive before the system<br>                                deletes it. |
| inactivityTimer | Native | uint32\_t | Time that the flow can be inactive before the system<br>                                deletes it. |
| dscp | Java | int | DSCP value (0-255). |
| dscp | Native | uint8\_t | DSCP value (0-255). |
| cb | Java | IflowStatus | Callback providing the flow ID ([iFlowStatus](https://docs.qualcomm.com/doc/80-PK177-134/topic/i_flow_status.html)). |
| cb | Native | dpp\_flowStatus | Callback providing the flow ID ([iFlowStatus](https://docs.qualcomm.com/doc/80-PK177-134/topic/i_flow_status.html)). |
| ret | Native | int8\_t& | On success this is the actual return value from the API.<br><br><br>                                <br><ul class="ul"><br>                                        <li class="li">1: Success</li><br><br>                                        <li class="li">-1: Iqesdk is null</li><br><br>                                        <li class="li">-2: Subsystem error</li><br><br>                                    </ul> |
|  |  |  |  |

## Returns

| Return | API type | Data type | Description |
| --- | --- | --- | --- |
| response | Java | int | <ul class="ul" id="concept.dita_1079e836-63de-48a4-b980-bc9d95d0fe52__ul_ocw_zct_n5b"><br>                                    <li class="li">1: Success</li><br><br>                                    <li class="li">-1: Iqesdk is null</li><br><br>                                    <li class="li">-2: Subsystem error</li><br><br>                                </ul> |
| response | Native | qesdk\_transaction\_status | See [QESDK transaction status for Native APIs](https://docs.qualcomm.com/doc/80-PK177-134/topic/native_qesdk_class.html) for usage details. Use qesdk\_transaction\_status to confirm API call invocation. If successful, use the `ret` value for the actual API return value object. |
|  |  |  |  |

**Parent Topic:** [DPP subsystem APIs](https://docs.qualcomm.com/doc/80-PK177-134/topic/functions.html)

Last Published: Nov 14, 2024

[Previous Topic
registerFlowStatusUpdates](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134/topics/register_flow_status_updates.md) [Next Topic
getFlows](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134/topics/get_flow.md)