> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GPR API

> This file contains GPR APIs.

**Header:** `gpr/api/gpr_api.h`

## Structures

### `gpr_packet_pool_info_v2_t`

**Members**

<ParamField path="heap_index" type="gpr_heap_index_t" />

<ParamField path="is_dynamic" type="uint8_t" />

<ParamField path="reserved" type="uint16_t" />

<ParamField path="num_packets" type="uint32_t" />

<ParamField path="packet_size" type="uint32_t" />

### `gpr_cmd_gpr_packet_pool_info_t`

Contains the packet pool information for \_\_gpr\_cmd\_get\_gpr\_packet\_info().

**Members**

<ParamField path="bytes_per_min_size_packet" type="uint32_t">
  Minimum size (in bytes) of a GPR packet.
</ParamField>

<ParamField path="num_min_size_packets" type="uint32_t">
  Number of packets of the minimum size allocated at initialization.
</ParamField>

<ParamField path="bytes_per_max_size_packet" type="uint32_t">
  Maximum size (in bytes) of a GPR packet.
</ParamField>

<ParamField path="num_max_size_packets" type="uint32_t">
  Number of packets of the maximum size allocated at initialization.
</ParamField>

### `gpr_cmd_alloc_ext_t`

Contains the allocated packet information for \_\_gpr\_cmd\_alloc\_ext().

**Members**

<ParamField path="src_domain_id" type="uint8_t">
  Domain ID of the sender service.
</ParamField>

<ParamField path="src_port" type="uint32_t">
  Registered unique ID of the sender service.
</ParamField>

<ParamField path="dst_domain_id" type="uint8_t">
  Domain ID of the receiver service.
</ParamField>

<ParamField path="dst_port" type="uint32_t">
  Registered unique ID of the receiver service.
</ParamField>

<ParamField path="client_data" type="uint8_t">
  Reserved for use by client.
</ParamField>

<ParamField path="token" type="uint32_t">
  Value attached by the sender to determine when command messages are processed by the receiver after they receive response messages.
</ParamField>

<ParamField path="opcode" type="uint32_t">
  Defines both the action and the payload structure to the receiver.
</ParamField>

<ParamField path="payload_size" type="uint32_t">
  Actual number of bytes required for the payload.
</ParamField>

<ParamField path="ret_packet" type="gpr_packet_t **">
  Double pointer to the formatted packet returned by the function.
</ParamField>

### `gpr_cmd_alloc_ext_v2_t`

Contains the allocated packet information for \_\_gpr\_cmd\_alloc\_ext\_v2().

**Members**

<ParamField path="src_domain_id" type="uint8_t">
  Domain ID of the sender service.
</ParamField>

<ParamField path="src_port" type="uint32_t">
  Registered unique ID of the sender service.
</ParamField>

<ParamField path="dst_domain_id" type="uint8_t">
  Domain ID of the receiver service.
</ParamField>

<ParamField path="dst_port" type="uint32_t">
  Registered unique ID of the receiver service.
</ParamField>

<ParamField path="client_data" type="uint8_t">
  Reserved for use by client.
</ParamField>

<ParamField path="token" type="uint32_t">
  Value attached by the sender to determine when command messages are processed by the receiver after they receive response messages.
</ParamField>

<ParamField path="heap_index" type="gpr_heap_index_t">
  heap index of the packet pool.
</ParamField>

<ParamField path="opcode" type="uint32_t">
  Defines both the action and the payload structure to the receiver.
</ParamField>

<ParamField path="payload_size" type="uint32_t">
  Actual number of bytes required for the payload.
</ParamField>

<ParamField path="ret_packet" type="gpr_packet_t **">
  Double pointer to the formatted packet returned by the function.
</ParamField>

### `gpr_cmd_alloc_send_t`

Contains the allocated packet information for \_\_gpr\_cmd\_alloc\_send().

**Members**

<ParamField path="src_domain_id" type="uint8_t">
  Domain ID of the sender service.
</ParamField>

<ParamField path="src_port" type="uint32_t">
  Registered unique ID of the sender service.
</ParamField>

<ParamField path="dst_domain_id" type="uint8_t">
  Domain ID of the receiver service.
</ParamField>

<ParamField path="dst_port" type="uint32_t">
  Registered unique ID of the receiver service.
</ParamField>

<ParamField path="client_data" type="uint8_t">
  Reserved for use by the client.
</ParamField>

<ParamField path="token" type="uint32_t">
  Value attached by the sender to determine when command messages have been processed by the receiver after having received response messages.
</ParamField>

<ParamField path="opcode" type="uint32_t">
  Operation code defines both the action and the payload structure to the receiver.
</ParamField>

<ParamField path="payload_size" type="uint32_t">
  Actual number of bytes needed for the payload.
</ParamField>

<ParamField path="payload" type="void *">
  Pointer to the payload to send.
</ParamField>

## Type Definitions

### `gpr_heap_index_t`

```cpp theme={null}
typedef uint8_t gpr_heap_index_t
```

### `gpr_callback_fn_t`

Prototype of a packet callback function.

```cpp theme={null}
typedef uint32_t(* gpr_callback_fn_t
```

### `gpr_packet_pool_info_v2_t`

```cpp theme={null}
typedef struct gpr_packet_pool_info_v2_t gpr_packet_pool_info_v2_t
```

### `gpr_cmd_gpr_packet_pool_info_t`

```cpp theme={null}
typedef struct gpr_cmd_gpr_packet_pool_info_t gpr_cmd_gpr_packet_pool_info_t
```

### `gpr_cmd_alloc_ext_v2_t`

```cpp theme={null}
typedef struct gpr_cmd_alloc_ext_v2_t gpr_cmd_alloc_ext_v2_t
```

## Macros

### `GPR_HEAP_INDEX_DEFAULT`

```c theme={null}
#define GPR_HEAP_INDEX_DEFAULT 0
```

### `GPR_HEAP_INDEX_1`

```c theme={null}
#define GPR_HEAP_INDEX_1 1
```
