Use CSTD and remove local CSTD settings which are no longer needed.
[dragonfly.git] / lib / libstand / netif.h
CommitLineData
984263bc
MD
1/* $NetBSD: netif.h,v 1.4 1995/09/14 23:45:30 pk Exp $ */
2
3/* $FreeBSD: src/lib/libstand/netif.h,v 1.1.1.1.6.1 2000/09/10 01:24:16 ps Exp $ */
1de703da 4/* $DragonFly: src/lib/libstand/netif.h,v 1.2 2003/06/17 04:26:51 dillon Exp $ */
984263bc
MD
5
6#ifndef __SYS_LIBNETBOOT_NETIF_H
7#define __SYS_LIBNETBOOT_NETIF_H
8#include "iodesc.h"
9
10#define NENTS(x) sizeof(x)/sizeof(x[0])
11
12struct netif_driver {
13 const char *netif_bname;
14 int (*netif_match)(struct netif *, void *);
15 int (*netif_probe)(struct netif *, void *);
16 void (*netif_init)(struct iodesc *, void *);
17 int (*netif_get)(struct iodesc *, void *, size_t, time_t);
18 int (*netif_put)(struct iodesc *, void *, size_t);
19 void (*netif_end)(struct netif *);
20 struct netif_dif *netif_ifs;
21 int netif_nifs;
22};
23
24struct netif_dif {
25 int dif_unit;
26 int dif_nsel;
27 struct netif_stats *dif_stats;
28 void *dif_private;
29 /* the following fields are used internally by the netif layer */
30 u_long dif_used;
31};
32
33struct netif_stats {
34 int collisions;
35 int collision_error;
36 int missed;
37 int sent;
38 int received;
39 int deferred;
40 int overflow;
41};
42
43struct netif {
44 struct netif_driver *nif_driver;
45 int nif_unit;
46 int nif_sel;
47 void *nif_devdata;
48};
49
50extern struct netif_driver *netif_drivers[]; /* machdep */
51extern int n_netif_drivers;
52
53extern int netif_debug;
54
55void netif_init(void);
56struct netif *netif_select(void *);
57int netif_probe(struct netif *, void *);
58void netif_attach(struct netif *, struct iodesc *, void *);
59void netif_detach(struct netif *);
60ssize_t netif_get(struct iodesc *, void *, size_t, time_t);
61ssize_t netif_put(struct iodesc *, void *, size_t);
62
63int netif_open(void *);
64int netif_close(int);
65
66struct iodesc *socktodesc(int);
67
68#endif /* __SYS_LIBNETBOOT_NETIF_H */