1 /* $NetBSD: netif.h,v 1.4 1995/09/14 23:45:30 pk Exp $ */
3 /* $FreeBSD: src/lib/libstand/netif.h,v 1.1.1.1.6.1 2000/09/10 01:24:16 ps Exp $ */
4 /* $DragonFly: src/lib/libstand/netif.h,v 1.2 2003/06/17 04:26:51 dillon Exp $ */
6 #ifndef __SYS_LIBNETBOOT_NETIF_H
7 #define __SYS_LIBNETBOOT_NETIF_H
10 #define NENTS(x) sizeof(x)/sizeof(x[0])
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
;
27 struct netif_stats
*dif_stats
;
29 /* the following fields are used internally by the netif layer */
44 struct netif_driver
*nif_driver
;
50 extern struct netif_driver
*netif_drivers
[]; /* machdep */
51 extern int n_netif_drivers
;
53 extern int netif_debug
;
55 void netif_init(void);
56 struct netif
*netif_select(void *);
57 int netif_probe(struct netif
*, void *);
58 void netif_attach(struct netif
*, struct iodesc
*, void *);
59 void netif_detach(struct netif
*);
60 ssize_t
netif_get(struct iodesc
*, void *, size_t, time_t);
61 ssize_t
netif_put(struct iodesc
*, void *, size_t);
63 int netif_open(void *);
66 struct iodesc
*socktodesc(int);
68 #endif /* __SYS_LIBNETBOOT_NETIF_H */