ebpf - ebpf 遍历多个映射
问题描述
我想创建一个地图数组,以便可以遍历它们。例如,我有下面的三个固定地图。
BPF_TABLE_PINNED("hash", struct mapkey, struct output_f, map1, mapSize, "/sys/fs/bpf/map1");
BPF_TABLE_PINNED("hash", struct mapkey, struct output_f, map2, mapSize, "/sys/fs/bpf/map2");
BPF_TABLE_PINNED("hash", struct mapkey, struct output_f, map3, mapSize, "/sys/fs/bpf/map3");
我如何遍历这三个地图?我尝试制作一个 void 指针数组,但之后我无法直接访问地图,因为它们都是自己的类型。
void* mapArray[] = {&map1, &map2, &map3};
我也尝试过使用 BPF_ARRAY_OF_MAPS,但我不知道如何使用它
解决方案
推荐阅读
- mysql - 尝试使用获取错误代码的查询创建表时遇到问题:1292 Incorrectdate timevalue: '2020-00- 00:00:00'
- docker - Ubuntu 中 DigitlOcean Droplet 上的 BigBlueButton
- json - 按值从数组中提取 Json 属性,并用 jq 转换为新的 json 结构
- c++ - C++中的动态时钟
- docker-for-windows - 配置 Akka.Net Remoting 以便(Windows)docker 容器内的进程可以与本地主机上的进程通信
- swift - 读取并打印从服务器接收到的编码消息,该消息存储在 UnsafeMutablePointer 类型的缓冲区中
- python - 从 ADLS2 转移到计算目标非常慢 Azure 机器学习
- android-fragments - MVVMCross : 创建一个 MvxFragment 使应用程序崩溃
- javascript - iframe 中的 Google 电子表格以 htmlview 模式打开,而不是在较小的屏幕中以编辑模式打开?
- mongodb - 使用多个集合的多个连接条件,使用管道 mongodb