1 typedef struct Etherpkt Etherpkt;
2 typedef struct Netaddr Netaddr;
3 typedef struct Netfile Netfile;
4 typedef struct Netif Netif;
23 * Macros to manage Qid's used for multiplexed devices
25 #define NETTYPE(x) (((ulong)x)&0x1f)
26 #define NETID(x) ((((ulong)x))>>5)
27 #define NETQID(i,t) ((((ulong)i)<<5)|(t))
30 * one per multiplexed connection
40 int type; /* multiplexor type */
41 int prom; /* promiscuous mode */
42 int scan; /* base station scanning interval */
43 int bridge; /* bridge mode */
44 int headersonly; /* headers only - no data */
45 uchar maddr[8]; /* bitmask of multicast addresses requested */
46 int nmaddr; /* number of multicast addresses */
48 Queue *in; /* input buffer */
56 Netaddr *next; /* allocation chain */
70 char name[KNAMELEN]; /* for top level directory */
71 int nfile; /* max number of Netfiles */
75 int limit; /* flow control */
76 int alen; /* address length */
77 int mbps; /* megabits per sec */
78 int link; /* link status */
80 uchar bcast[Nmaxaddr];
81 Netaddr *maddr; /* known multicast addresses */
82 int nmaddr; /* number of known multicast addresses */
83 Netaddr *mhash[Nmhash]; /* hash table of multicast addresses */
84 int prom; /* number of promiscuous opens */
85 int scan; /* number of base station scanners */
86 int all; /* number of -1 multiplexors */
92 int crcs; /* input crc errors */
93 int oerrs; /* output errors */
94 int frames; /* framing errors */
95 int overflows; /* packet overflows */
96 int buffs; /* buffering errors */
97 int soverflows; /* software overflow */
99 /* routines for touching the hardware */
101 void (*promiscuous)(void*, int);
102 void (*multicast)(void*, uchar*, int);
103 void (*scanbs)(void*, uint); /* scan for base stations */
106 void netifinit(Netif*, char*, int, ulong);
107 Walkqid* netifwalk(Netif*, Chan*, Chan*, char **, int);
108 Chan* netifopen(Netif*, Chan*, int);
109 void netifclose(Netif*, Chan*);
110 long netifread(Netif*, Chan*, void*, long, ulong);
111 Block* netifbread(Netif*, Chan*, long, ulong);
112 long netifwrite(Netif*, Chan*, void*, long);
113 int netifwstat(Netif*, Chan*, uchar*, int);
114 int netifstat(Netif*, Chan*, uchar*, int);
115 int activemulti(Netif*, uchar*, int);
123 ETHERMINTU = 60, /* minimum transmit size */
124 ETHERMAXTU = 1514, /* maximum transmit size */
125 ETHERHDRSIZE = 14, /* size of an ethernet header */
127 /* ethernet packet types */