usrp2::ethernet Class Reference
Read and write ethernet frames.
More...
#include <ethernet.h>
List of all members.
Detailed Description
Read and write ethernet frames.
This provides a low level interface to hardware that communicates via raw (non-IP) ethernet frames.
Constructor & Destructor Documentation
usrp2::ethernet::ethernet |
( |
|
) |
|
usrp2::ethernet::~ethernet |
( |
|
) |
|
Member Function Documentation
attach packet filter to socket to restrict which packets read sees.
- Parameters:
-
bool usrp2::ethernet::close |
( |
|
) |
|
int usrp2::ethernet::fd |
( |
|
) |
const [inline] |
Return file descriptor associated with socket.
const uint8_t* usrp2::ethernet::mac |
( |
|
) |
const [inline] |
return 6 byte string containing our MAC address
bool usrp2::ethernet::open |
( |
std::string |
ifname, |
|
|
int |
protocol | |
|
) |
| | |
- Parameters:
-
| ifname | ethernet interface name, e.g., "eth0" |
| protocol | is the ethertype protocol number in network order. Use 0 to receive all protocols. |
int usrp2::ethernet::read_packet |
( |
void * |
buf, |
|
|
int |
buflen | |
|
) |
| | |
Read packet from interface.
- Parameters:
-
| buf | where to put the packet |
| buflen | maximum length of packet in bytes (should be >= 1528) |
- Returns:
- number of bytes read or -1 if trouble.
Returned packet includes 14-byte ethhdr
int usrp2::ethernet::read_packet_dont_block |
( |
void * |
buf, |
|
|
int |
buflen | |
|
) |
| | |
Read packet from interface, but don't block waiting.
- Parameters:
-
| buf | where to put the packet |
| buflen | maximum length of packet in bytes (should be >= 1528) |
- Returns:
- number of bytes read, -1 if trouble or 0 if nothing available.
Returned packet includes 14-byte ethhdr
int usrp2::ethernet::write_packet |
( |
const void * |
buf, |
|
|
int |
buflen | |
|
) |
| | |
int usrp2::ethernet::write_packetv |
( |
const eth_iovec * |
iov, |
|
|
size_t |
iovlen | |
|
) |
| | |
Member Data Documentation
The documentation for this class was generated from the following file: