blob: 180e4596eb51fa3f1852494c9de54cb17809bbea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
typedef struct Block Block;
struct Block
{
Ref;
Block *next;
uchar *rp;
uchar *wp;
uchar *lim;
uchar base[];
};
#define BLEN(s) ((s)->wp - (s)->rp)
Block* allocb(int size);
void freeb(Block*);
Block* copyblock(Block*, int);
typedef struct Ehdr Ehdr;
struct Ehdr
{
uchar d[6];
uchar s[6];
uchar type[2];
};
enum {
Ehdrsz = 6+6+2,
Maxpkt = 2000,
};
enum
{
Cdcunion = 6,
Scether = 6,
Fnether = 15,
};
int debug;
int setmac;
/* to be filled in by *init() */
uchar macaddr[6];
void etheriq(Block*, int wire);
int (*epreceive)(Dev*);
void (*eptransmit)(Dev*, Block*);
|