1 |
/* |
2 |
* sheep_net.h - SheepShaver net server add-on |
3 |
* |
4 |
* SheepShaver (C) 1997-2000 Mar"c Hellwig and Christian Bauer |
5 |
* All rights reserved. |
6 |
*/ |
7 |
|
8 |
#ifndef SHEEP_NET_H |
9 |
#define SHEEP_NET_H |
10 |
|
11 |
// Net buffer dimensions |
12 |
#define READ_PACKET_COUNT 10 |
13 |
#define WRITE_PACKET_COUNT 10 |
14 |
|
15 |
// Net packet |
16 |
struct net_packet { |
17 |
uint32 cmd; // Command |
18 |
uint32 length; // Data length |
19 |
uint32 card; // Network card ID |
20 |
uint32 reserved; |
21 |
uint8 data[1584]; |
22 |
}; |
23 |
|
24 |
// Net buffer (shared area) |
25 |
struct net_buffer { |
26 |
uint8 ether_addr[6]; // Ethernet address |
27 |
uint8 filler1[2]; |
28 |
sem_id read_sem; // Semaphore for read packets |
29 |
uint32 read_ofs; |
30 |
uint32 read_packet_size; |
31 |
uint32 read_packet_count; |
32 |
sem_id write_sem; // Semaphore for write packets |
33 |
uint32 write_ofs; |
34 |
uint32 write_packet_size; |
35 |
uint32 write_packet_count; |
36 |
uint8 filler[24]; |
37 |
net_packet read[READ_PACKET_COUNT]; |
38 |
net_packet write[WRITE_PACKET_COUNT]; |
39 |
}; |
40 |
|
41 |
// Packet commands |
42 |
#define SHEEP_PACKET 0 |
43 |
#define ADD_MULTICAST 1 |
44 |
#define REMOVE_MULTICAST 2 |
45 |
#define ACTIVATE_SHEEP_NET 8 |
46 |
#define DEACTIVATE_SHEEP_NET 9 |
47 |
#define SHUTDOWN_SHEEP_NET 10 |
48 |
|
49 |
#define IN_USE 1 |
50 |
|
51 |
#endif |