1 Star 0 Fork 0

泰晓科技/qemu-u-boot

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
README.udp 874 Bytes
一键复制 编辑 原始数据 按行查看 历史
Philippe Reynes 提交于 2020-09-18 20:13 +08:00 . net: add a generic udp protocol
Udp framework
The udp framework is build on top of network framework and is designed
to define new protocol or new command based on udp without modifying
the network framework.
The udp framework define a function udp_loop that take as argument
a structure udp_ops (defined in include/net/udp.h) :
struct udp_ops {
int (*prereq)(void *data);
int (*start)(void *data);
void *data;
};
The callback prereq define if all the requirements are
valid before running the network/udp loop.
The callback start define the first step in the network/udp loop,
and it may also be used to configure a timemout and udp handler.
The pointer data is used to store private data that
could be used by both callback.
A simple example to use this framework:
static struct udp_ops udp_ops = {
.prereq = wmp_prereq,
.start = wmp_start,
.data = NULL,
};
...
err = udp_loop(&udp_ops);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tinylab/qemu-u-boot.git
git@gitee.com:tinylab/qemu-u-boot.git
tinylab
qemu-u-boot
qemu-u-boot
master

搜索帮助