dnsdist::xsk::g_xsk.push_back(socket);
return socket;
});
- luaCtx.registerFunction<std::string(std::shared_ptr<XskSocket>::*)()const>("getMetrics", [](const std::shared_ptr<XskSocket>& xsk) {
- std::string result;
+ luaCtx.registerFunction<std::string(std::shared_ptr<XskSocket>::*)()const>("getMetrics", [](const std::shared_ptr<XskSocket>& xsk) -> std::string {
if (!xsk) {
- return result;
+ return {};
}
return xsk->getMetrics();
});
#include "lock.hh"
#include "misc.hh"
#include "noinitvector.hh"
-#endif /* HAVE_XSK */
class XskPacket;
class XskWorker;
class XskSocket;
-#ifdef HAVE_XSK
using MACAddr = std::array<uint8_t, 6>;
-using XskPacketPtr = std::unique_ptr<XskPacket>;
-
// We use an XskSocket to manage an AF_XDP Socket corresponding to a NIC queue.
// The XDP program running in the kernel redirects the data to the XskSocket in userspace.
// We allocate frames that are placed into the descriptors in the fill queue, allowing the kernel to put incoming packets into the frames and place descriptors into the rx queue.