suricata中DPDK收发包

DPDK的收包也是增加了runmode-dpdkintel.c和source-dpdkintel.c两个文件

suricata.c中调用关系

main --> RunModeRegisterRunModes() -->  RunModeDpdkIntelRegister()

void RunModeDpdkIntelRegister(void)
{
#ifdef HAVE_DPDKINTEL
    default_mode = "workers";
    RunModeRegisterNewRunMode(RUNMODE_DPDKINTEL, "workers",
            "Workers DpdkIntel mode, each thread does all"
            " tasks from decoding to logging. Acquistion is "
            " done by seperate core per interface",
            RunModeDpdkIntelWorkers);
#endif /* HAVE_DPDKINTEL */
}

注册了RunModeIdsDpdkWorkers函数

main -->ParseInterfacesList
      -->LiveBuildDeviceList
        -->LiveBuildDeviceListCustom
          -->LiveRegisterDeviceName(读取所有DPDK配置的pcie地址接口,放到pre_live_devices链表中)

#ifdef HAVE_DPDKINTEL
    } else if (run_mode == RUNMODE_DPDKINTEL) {
        if (strlen(pcap_dev)) {
                fprintf(stderr, "ERROR: DPDK Intel is not supported for PCAP\n");
                SCReturnInt(TM_ECODE_FAILED);
        } else {
            int ret = LiveBuildDeviceList("dpdkintel.inputs");
            if (ret == 0) {
                fprintf(stderr, "ERROR: No interface found for DPDK Intel\n");
                SCReturnInt(TM_ECODE_FAILED);
            }
        }
#endif /* HAVE_DPDKINTEL */

main -->PostConfLoadedSetup
      -->LiveDeviceFinalize
        -->LiveRegisterDevice(遍历pre_live_devices链表,读取pcie地址到live_devices链表中,后续提供网口pcie相关的函数都是从live_devices链表获取,比如LiveGetDeviceCount)
      -->RegisterAllModules
        --&g

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值