mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-21 00:50:35 +00:00
27 lines
620 B
C++
27 lines
620 B
C++
/*
|
|
* Copyright (C) 2014 Cloudius Systems, Ltd.
|
|
*/
|
|
|
|
#include "net/net.hh"
|
|
#include "core/reactor.hh"
|
|
#include "net/virtio.hh"
|
|
|
|
using namespace net;
|
|
|
|
void dump_arp_packets(l3_protocol& proto) {
|
|
proto.receive([&proto] (packet p, ethernet_address from) {
|
|
std::cout << "seen arp packet\n";
|
|
return make_ready_future<>();
|
|
}, [] (packet& p, size_t off) {return 0;});
|
|
}
|
|
|
|
int main(int ac, char** av) {
|
|
auto vnet = create_virtio_net_device("tap0");
|
|
interface netif(std::move(vnet));
|
|
l3_protocol arp(&netif, eth_protocol_num::arp);
|
|
dump_arp_packets(arp);
|
|
engine.run();
|
|
return 0;
|
|
}
|
|
|