mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-04 02:30:53 +00:00
9f8c4d99af
. tfe.cpp renamed to Uthernet1.cpp. . add class NetworkBackend: common to both U1 and U2 cards, and abstracts Windows/Linux backends. . modernise error message if WPCAP.DLL is not installed.
32 lines
662 B
C++
32 lines
662 B
C++
#pragma once
|
|
|
|
#define MAX_TXLENGTH 1518
|
|
#define MIN_TXLENGTH 4
|
|
|
|
#define MAX_RXLENGTH 1518
|
|
#define MIN_RXLENGTH 64
|
|
|
|
class NetworkBackend
|
|
{
|
|
public:
|
|
virtual ~NetworkBackend();
|
|
|
|
// transmit a packet
|
|
virtual void transmit(
|
|
const int txlength, /* Frame length */
|
|
uint8_t *txframe /* Pointer to the frame to be transmitted */
|
|
) = 0;
|
|
|
|
// receive a single packet, return size (>0) or missing (-1)
|
|
virtual int receive(
|
|
const int size, /* Buffer size */
|
|
uint8_t * rxframe /* Pointer to the buffer */
|
|
) = 0;
|
|
|
|
// process pending packets
|
|
virtual void update(const ULONG nExecutedCycles) = 0;
|
|
|
|
// if the backend is usable
|
|
virtual bool isValid() = 0;
|
|
};
|