1 |
gbeauche |
1.1 |
/*
|
2 |
|
|
* b2ether_hl.h - Win32 ethernet driver high-level interface
|
3 |
|
|
*
|
4 |
gbeauche |
1.2 |
* Basilisk II (C) 1997-2008 Christian Bauer
|
5 |
gbeauche |
1.1 |
*
|
6 |
|
|
* Windows platform specific code copyright (C) Lauri Pesonen
|
7 |
|
|
*
|
8 |
|
|
* This program is free software; you can redistribute it and/or modify
|
9 |
|
|
* it under the terms of the GNU General Public License as published by
|
10 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
11 |
|
|
* (at your option) any later version.
|
12 |
|
|
*
|
13 |
|
|
* This program is distributed in the hope that it will be useful,
|
14 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
|
|
* GNU General Public License for more details.
|
17 |
|
|
*
|
18 |
|
|
* You should have received a copy of the GNU General Public License
|
19 |
|
|
* along with this program; if not, write to the Free Software
|
20 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
21 |
|
|
*/
|
22 |
|
|
|
23 |
|
|
#ifndef _B2_ETHER_HL_
|
24 |
|
|
#define _B2_ETHER_HL_
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
#ifdef __cplusplus
|
28 |
|
|
extern "C" {
|
29 |
|
|
#endif
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
#define ETH_802_3_ADDRESS_LENGTH 6
|
33 |
|
|
#define MAX_LINK_NAME_LENGTH 124
|
34 |
|
|
|
35 |
|
|
typedef struct _ADAPTER {
|
36 |
|
|
HANDLE hFile;
|
37 |
|
|
TCHAR SymbolicLink[MAX_LINK_NAME_LENGTH];
|
38 |
|
|
} ADAPTER, *LPADAPTER;
|
39 |
|
|
|
40 |
|
|
typedef struct _PACKET {
|
41 |
|
|
OVERLAPPED OverLapped;
|
42 |
|
|
PVOID Buffer;
|
43 |
|
|
UINT Length;
|
44 |
|
|
ULONG BytesReceived;
|
45 |
|
|
BOOL bIoComplete;
|
46 |
|
|
BOOL free;
|
47 |
|
|
struct _PACKET *next;
|
48 |
|
|
} PACKET, *LPPACKET;
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
BOOLEAN StartPacketDriver(
|
53 |
|
|
LPTSTR ServiceName
|
54 |
|
|
);
|
55 |
|
|
|
56 |
|
|
LPADAPTER PacketOpenAdapter(
|
57 |
|
|
LPCSTR AdapterName,
|
58 |
|
|
int16 mode
|
59 |
|
|
);
|
60 |
|
|
|
61 |
|
|
VOID PacketCloseAdapter(
|
62 |
|
|
LPADAPTER lpAdapter
|
63 |
|
|
);
|
64 |
|
|
|
65 |
|
|
LPPACKET PacketAllocatePacket(
|
66 |
|
|
LPADAPTER AdapterObject,
|
67 |
|
|
UINT Length
|
68 |
|
|
);
|
69 |
|
|
|
70 |
|
|
VOID PacketFreePacket(
|
71 |
|
|
LPPACKET lpPacket
|
72 |
|
|
);
|
73 |
|
|
|
74 |
|
|
BOOLEAN PacketSendPacket(
|
75 |
|
|
LPADAPTER AdapterObject,
|
76 |
|
|
LPPACKET lpPacket,
|
77 |
|
|
BOOLEAN Sync,
|
78 |
|
|
BOOLEAN RecyclingAllowed
|
79 |
|
|
);
|
80 |
|
|
|
81 |
|
|
BOOLEAN PacketGetAddress(
|
82 |
|
|
LPADAPTER AdapterObject,
|
83 |
|
|
PUCHAR AddressBuffer,
|
84 |
|
|
PUINT Length
|
85 |
|
|
);
|
86 |
|
|
|
87 |
|
|
BOOLEAN PacketReceivePacket(
|
88 |
|
|
LPADAPTER AdapterObject,
|
89 |
|
|
LPPACKET lpPacket,
|
90 |
|
|
BOOLEAN Sync
|
91 |
|
|
);
|
92 |
|
|
|
93 |
|
|
BOOLEAN PacketSetFilter( LPADAPTER AdapterObject, ULONG Filter );
|
94 |
|
|
BOOLEAN PacketGetMAC( LPADAPTER AdapterObject, LPBYTE address, BOOL permanent );
|
95 |
|
|
BOOLEAN PacketAddMulticast( LPADAPTER AdapterObject, LPBYTE address );
|
96 |
|
|
BOOLEAN PacketDelMulticast( LPADAPTER AdapterObject, LPBYTE address );
|
97 |
|
|
|
98 |
|
|
ULONG PacketGetAdapterNames( LPADAPTER lpAdapter, PTSTR pStr, PULONG BufferSize );
|
99 |
|
|
ULONG PacketSelectAdapterByName( LPADAPTER AdapterObject, LPCSTR name );
|
100 |
|
|
|
101 |
|
|
// callbacks
|
102 |
|
|
void recycle_write_packet( LPPACKET Packet );
|
103 |
|
|
|
104 |
|
|
VOID CALLBACK packet_read_completion(
|
105 |
|
|
DWORD dwErrorCode,
|
106 |
|
|
DWORD dwNumberOfBytesTransfered,
|
107 |
|
|
LPOVERLAPPED lpOverlapped
|
108 |
|
|
);
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
#ifdef __cplusplus
|
112 |
|
|
}
|
113 |
|
|
#endif
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
#endif // _B2_ETHER_HL_
|