42 #define ETHER_ADDR_OCTETS 6
43 #define PACKET_HDR_LENGTH 14
61 PACKET_NO_ERROR = 0, PACKET_NOMEMORY_ERROR, PACKET_BADBUFFER_ERROR, PACKET_XMIT_ERROR, PACKET_IFLOOKUP_ERROR, PACKET_IFNOTFOUND_ERROR,
62 PACKET_CREATEMUTEX_ERROR, PACKET_GETMUTEX_ERROR, PACKET_RLSMUTEX_ERROR, PACKET_RECVTIMEOUT_ERROR, PACKET_RECVFAILED_ERROR,
packet_error_t
Definition: packet.hpp:60
struct packet_handle * pfhandle_t
Definition: packet.hpp:75
packet_error_t openInterfaceByAddr(pfhandle_t pfhandle, packet_addr_t *addr, int timeout)
Opens the interface by link layer address. Uses libpcap.
void freePacketHandle(pfhandle_t pfhandle)
Close the packet handle.
packet_error_t recvFrame(pfhandle_t pfhandle, packet_addr_t *addr, uint8_t *payload, size_t &length)
Receives a frame.
packet_error_t packetBind(struct packet_handle *handle, uint16_t ethertype)
Set filters for packet handler.
packet_error_t sendFrame(pfhandle_t pfhandle, packet_addr_t *addr, uint16_t ethertype, uint8_t *payload, size_t length)
Sends a frame through an interface using libpcap.
void closeInterface(pfhandle_t pfhandle)
Close the interface.
packet_error_t mallocPacketHandle(pfhandle_t *pfhandle_r)
Allocate memory for the packet handle.
#define ETHER_ADDR_OCTETS
Definition: packet.hpp:42
Definition: packet.hpp:69