Deleted Added
sdiff udiff text old ( 308719 ) new ( 328889 )
full compact
1/* $NetBSD: dev_net.c,v 1.23 2008/04/28 20:24:06 martin Exp $ */
2
3/*-
4 * Copyright (c) 1997 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Gordon W. Ross.

--- 16 unchanged lines hidden (view full) ---

25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: stable/11/sys/boot/common/dev_net.c 308719 2016-11-16 07:01:52Z bapt $");
34
35/*-
36 * This module implements a "raw device" interface suitable for
37 * use by the stand-alone I/O library NFS code. This interface
38 * does not support any "block" access, and exists only for the
39 * purpose of initializing the network interface, getting boot
40 * parameters, and performing the NFS mount.
41 *

--- 33 unchanged lines hidden (view full) ---

75static int netdev_sock = -1;
76static int netdev_opens;
77
78static int net_init(void);
79static int net_open(struct open_file *, ...);
80static int net_close(struct open_file *);
81static void net_cleanup(void);
82static int net_strategy();
83static void net_print(int);
84
85static int net_getparams(int sock);
86
87struct devsw netdev = {
88 "net",
89 DEVT_NET,
90 net_init,
91 net_strategy,

--- 228 unchanged lines hidden (view full) ---

320 printf("net_open: server addr: %s\n", inet_ntoa(rootip));
321 printf("net_open: server path: %s\n", rootpath);
322 }
323#endif
324
325 return (0);
326}
327
328static void
329net_print(int verbose)
330{
331 struct netif_driver *drv;
332 int i, d, cnt;
333
334 cnt = 0;
335 for (d = 0; netif_drivers[d]; d++) {
336 drv = netif_drivers[d];
337 for (i = 0; i < drv->netif_nifs; i++) {
338 printf("\t%s%d:", "net", cnt++);
339 if (verbose)
340 printf(" (%s%d)", drv->netif_bname,
341 drv->netif_ifs[i].dif_unit);
342 }
343 }
344 printf("\n");
345}
346
347/*
348 * Strip the server's address off of the rootpath if present and return it in
349 * network byte order, leaving just the pathname part in the global rootpath.
350 */
351uint32_t
352net_parse_rootpath()

--- 22 unchanged lines hidden ---