---
title: flexda_custom_init
description: "用户自定义初始化。"
url: https://www.hikunpeng.com/document/detail/zh/flexda/api/dpak_api021.html
sourcePath: /source/zh/flexda/api/dpak_api021.html
indexId: bccb3f5684ae4284056ad64691b245e018af9810335857836fcff5185ea51cb838
---
# flexda_custom_init

#### 接口功能

用户自定义初始化。


#### 接口格式

int flexda_custom_init (struct flexda_custom_api_t *apis)


#### 参数说明

| 参数名 | 参数类型 | 入参/出参 | 说明 |
| --- | --- | --- | --- |
| apis | struct flexda\_custom\_api\_t \* | 入参 | 编程框架提供的libapi。 |
| 函数返回值 | int | 出参 | 若函数执行成功则返回0，若函数执行失败则返回错误码。 |


#### 使用实例

```
flexda_custom_api_t g_api = {0};
int flexda_custom_init(flexda_custom_api_t api)
{
// 源文件中应声明并初始化全局变量 flexda_custom_api_t g_api（变量名应与libapi.h中extern一致，默认为g_api），
// 在该初始化函数中将参数赋值给g_api, 在其他函数中便可以简单调用flexda-ovs提供的libapi接口;
g_api = api;
return 0;
}
```
