freebsd-dev/lib/libstand/globals.c
Baptiste Daroussin a872bf12f8 distinguish NFS versus TFTP boot by rootpath
Don't use DHCP 150 option to decide which protocol use to netboot. When
root-path includes ip address - go thru NFS, if ip address not exists in
root-path - go thru TFTP from server which ip address is in next-server.  But
there is one limitation - only one tftp server in network to provide loader and
everything else.  Does enybody use more than only one?

Submitted by:	kczekirda
Sponsored by:	Oktawave
MFC after:	3 weeks
Relnote:	Yes
Differential Revision:	https://reviews.freebsd.org/D8740
2017-05-06 19:23:58 +00:00

39 lines
1.1 KiB
C

/* $NetBSD: globals.c,v 1.3 1995/09/18 21:19:27 pk Exp $ */
/*
* globals.c:
*
* global variables should be separate, so nothing else
* must be included extraneously.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include "stand.h"
#include "net.h"
u_char bcea[6] = BA; /* broadcast ethernet address */
char rootpath[FNAME_SIZE] = "/"; /* root mount path */
char bootfile[FNAME_SIZE]; /* bootp says to boot this */
char hostname[FNAME_SIZE]; /* our hostname */
int hostnamelen;
char domainname[FNAME_SIZE]; /* our DNS domain */
int domainnamelen;
int netproto = NET_NONE; /* Network prototol */
char ifname[IFNAME_SIZE]; /* name of interface (e.g. "le0") */
struct in_addr myip; /* my ip address */
struct in_addr nameip; /* DNS server ip address */
struct in_addr rootip; /* root ip address */
struct in_addr swapip; /* swap ip address */
struct in_addr gateip; /* gateway ip address */
n_long netmask = 0xffffff00; /* subnet or net mask */
u_int intf_mtu; /* interface mtu from bootp/dhcp */
int errno; /* our old friend */