Ai
4 Star 5 Fork 67

OpenHarmony/kernel_linux_common_modules
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nip_lib.h 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
liangbotong 提交于 2023-05-23 11:12 +08:00 . NewIP code rectification
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
*
* Description: Provide NewIP universal library.
*
* Author: Yang Yanjun <yangyanjun@huawei.com>
*
* Data: 2022-07-18
*/
#ifndef _NIP_LIB_H
#define _NIP_LIB_H
/* AF_NINET by reading/sys/module/newip/parameters/af_ninet file to get the type value */
#define AF_NINET 45
#define DEMO_INPUT_1 2 /* The DEMO program contains one parameter */
#define DEMO_INPUT_2 3
#define DEMO_INPUT_3 4
#define DEMO_INPUT_4 5
/* Change the value based on the actual interface */
#define NIC_NAME "wlan0"
#define NIC_NAME_CHECK "wlan"
#define CMD_ADD "add"
#define CMD_DEL "del"
#define BUFLEN 1024
#define LISTEN_MAX 3
#define PKTCNT 10 /* Number of sent packets */
#define PKTLEN 1024 /* Length of sent packet */
#define SLEEP_US 500000 /* Packet sending interval (ms) */
#define SELECT_TIME 600
#define TCP_SERVER_PORT 5556 /* TCP Server Port */
#define UDP_SERVER_PORT 9090 /* UDP Server Port */
#define TIMEOUT_SEC 2
#define BITS_PER_BYTE 8
#define ARRAY_LEN 255
int nip_get_ifindex(const char *ifname, int *ifindex);
int nip_get_addr(char **args, struct nip_addr *addr);
#endif /* _NIP_LIB_H */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/kernel_linux_common_modules.git
git@gitee.com:openharmony/kernel_linux_common_modules.git
openharmony
kernel_linux_common_modules
kernel_linux_common_modules
master

搜索帮助