|
SatCat5
|
Wrapper for PCAP / NPCAP socket library and supporting functions.
PCAP is a cross-platform API for sending and receiving raw Ethernet frames. To use these utilities, install the library for your host operating system:
This file defines a class that converts a PCAP Layer-2 socket to a SatCat5 Writeable/Readable stream, which can be used to send and receive Ethernet frames. It also defines functions for listing and selecting an interface from the list provided by the PCAP API.
Note: Use of these tools may require root/admin privileges.
Definition in file hal_pcap.h.
#include <deque>#include <string>#include <satcat5/ethernet.h>#include <satcat5/io_buffer.h>#include <satcat5/polling.h>Go to the source code of this file.
Classes | |
| class | satcat5::pcap::Socket |
| Adapter for a PCAP Layer-2 socket. More... | |
| struct | satcat5::pcap::Descriptor |
| Structure for holding a device-name and user-readable description. More... | |
Typedefs | |
| typedef std::deque< satcat5::pcap::Descriptor > | satcat5::pcap::DescriptorList |
Functions | |
| satcat5::pcap::DescriptorList | satcat5::pcap::list_all_devices () |
| Fetch a list of Ethernet device descriptors. More... | |
| bool | satcat5::pcap::is_device (const char *ifname) |
Check if a given name is on the list from list_all_devices. | |
| std::string | satcat5::pcap::prompt_for_ifname () |
| Print a list of Ethernet devices, and select by index. More... | |
| spcap::DescriptorList satcat5::pcap::list_all_devices | ( | ) |
Fetch a list of Ethernet device descriptors.
Definition at line 103 of file hal_pcap.cc.
| std::string satcat5::pcap::prompt_for_ifname | ( | ) |
Print a list of Ethernet devices, and select by index.
Returns the "name" field from the selected Descriptor.
Definition at line 131 of file hal_pcap.cc.