Clean up deleted files.
This commit is contained in:
parent
2d4295eb29
commit
a56ad85df4
@ -1,5 +0,0 @@
|
||||
CFLAGS = -g -I../../../ -I../../../../include
|
||||
PROG = netboot
|
||||
SRCS = arp.c bootp.c conf.c exec.c in_cksum.c netif.c net.c nfsboot.c rpc.c ut
|
||||
.PATH: ../../common/netboot
|
||||
+
|
@ -1,12 +0,0 @@
|
||||
Necessary:
|
||||
need support for bootparam
|
||||
small printf
|
||||
hooks for bootstrapping
|
||||
multiple ethernets
|
||||
nfs diskless stuff, i.e do we change the thing, and how.
|
||||
|
||||
High Priority:
|
||||
|
||||
Low Priority:
|
||||
remove ether-orientation? FDDI support?
|
||||
|
191
sys/boot/arp.c
191
sys/boot/arp.c
@ -1,191 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Lawrence Berkeley Laboratory and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#) $Header: /cvsroot/src/sys/boot/Attic/arp.c,v 1.1 1993/10/12 06:02:14 glass Exp $ (LBL)
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <net/if.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/if_ether.h>
|
||||
#include <netinet/in_systm.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "netboot.h"
|
||||
#include "bootbootp.h"
|
||||
|
||||
|
||||
/* Cache stuff */
|
||||
#define ARP_NUM 8 /* need at most 3 arp entries */
|
||||
|
||||
static struct arp_list {
|
||||
n_long addr;
|
||||
u_char ea[6];
|
||||
} arp_list[ARP_NUM] = {
|
||||
{ INADDR_BROADCAST, BA }
|
||||
};
|
||||
static int arp_num = 1;
|
||||
|
||||
/* Local forwards */
|
||||
static int arpsend __P((struct iodesc *, void *, int));
|
||||
static int arprecv __P((struct iodesc *, void *, int));
|
||||
|
||||
/* Broadcast an ARP packet, asking who has addr on interface d */
|
||||
u_char *
|
||||
arpwhohas(d, addr)
|
||||
register struct iodesc *d;
|
||||
n_long addr;
|
||||
{
|
||||
register int i;
|
||||
register struct ether_arp *ah;
|
||||
register struct arp_list *al;
|
||||
struct {
|
||||
u_char header[ETHER_SIZE];
|
||||
struct ether_arp warp;
|
||||
} wbuf;
|
||||
union {
|
||||
u_char buffer[RECV_SIZE];
|
||||
struct {
|
||||
u_char header[ETHER_SIZE];
|
||||
struct ether_arp rarp;
|
||||
} ru;
|
||||
} rbuf;
|
||||
|
||||
if (debug)
|
||||
printf("arpwhohas: called\n");
|
||||
/* Try for cached answer first */
|
||||
for (i = 0, al = arp_list; i < arp_num; ++i, ++al)
|
||||
if (addr == al->addr)
|
||||
return (al->ea);
|
||||
|
||||
/* Don't overflow cache */
|
||||
if (arp_num > ARP_NUM - 1)
|
||||
panic("arpwhohas: overflowed arp_list!");
|
||||
|
||||
if (debug)
|
||||
printf("arpwhohas: not cached\n");
|
||||
ah = &wbuf.warp;
|
||||
bzero(ah, sizeof(*ah));
|
||||
|
||||
ah->arp_hrd = htons(ARPHRD_ETHER);
|
||||
ah->arp_pro = htons(ETHERTYPE_IP);
|
||||
ah->arp_hln = sizeof(ah->arp_sha); /* hardware address length */
|
||||
ah->arp_pln = sizeof(ah->arp_spa); /* protocol address length */
|
||||
ah->arp_op = htons(ARPOP_REQUEST);
|
||||
MACPY(d->myea, ah->arp_sha);
|
||||
bcopy(&d->myip, ah->arp_spa, sizeof(ah->arp_spa));
|
||||
bcopy(&addr, ah->arp_tpa, sizeof(ah->arp_tpa));
|
||||
|
||||
/* Store ip address in cache */
|
||||
al->addr = addr;
|
||||
|
||||
(void)sendrecv(d, arpsend, ah, sizeof(*ah), arprecv,
|
||||
((u_char *)&rbuf.ru.rarp) - ETHER_SIZE,
|
||||
ETHER_SIZE + sizeof(rbuf.ru.rarp));
|
||||
|
||||
/* Store ethernet address in cache */
|
||||
MACPY(rbuf.ru.rarp.arp_sha, al->ea);
|
||||
++arp_num;
|
||||
|
||||
return (al->ea);
|
||||
}
|
||||
|
||||
static int
|
||||
arpsend(d, pkt, len)
|
||||
register struct iodesc *d;
|
||||
register void *pkt;
|
||||
register int len;
|
||||
{
|
||||
if (debug)
|
||||
printf("arpsend: called\n");
|
||||
return (sendether(d, pkt, len, bcea, ETHERTYPE_ARP));
|
||||
}
|
||||
|
||||
/* Returns 0 if this is the packet we're waiting for else -1 (and errno == 0) */
|
||||
static int
|
||||
arprecv(d, pkt, len)
|
||||
register struct iodesc *d;
|
||||
register void *pkt;
|
||||
register int len;
|
||||
{
|
||||
register struct ether_header *eh;
|
||||
register struct ether_arp *ah;
|
||||
|
||||
if (debug)
|
||||
printf("arprecv: called\n");
|
||||
if (len < sizeof(*eh) + sizeof(*ah)) {
|
||||
errno = 0;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
eh = (struct ether_header *)pkt;
|
||||
|
||||
/* Must be to us */
|
||||
if (bcmp(d->myea, eh->ether_dhost, 6) != 0 &&
|
||||
bcmp(bcea, eh->ether_dhost, 6) != 0) {
|
||||
errno = 0;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (eh->ether_type != ETHERTYPE_ARP) {
|
||||
errno = 0;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
ah = (struct ether_arp *)(eh + 1);
|
||||
HTONS(ah->arp_hrd);
|
||||
HTONS(ah->arp_pro);
|
||||
HTONS(ah->arp_op);
|
||||
if (ah->arp_hrd != ARPHRD_ETHER || ah->arp_pro != ETHERTYPE_IP ||
|
||||
ah->arp_hln != sizeof(ah->arp_sha) ||
|
||||
ah->arp_pln != sizeof(ah->arp_spa) || ah->arp_op != ARPOP_REPLY) {
|
||||
errno = 0;
|
||||
return (-1);
|
||||
}
|
||||
if (bcmp(&arp_list[arp_num].addr, ah->arp_spa, sizeof(long)) != 0 ||
|
||||
bcmp(&d->myip, ah->arp_tpa, sizeof(d->myip)) != 0) {
|
||||
errno = 0;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Lawrence Berkeley Laboratory and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#) $Header: /cvsroot/src/sys/boot/Attic/bootbootp.h,v 1.1 1993/10/12 06:02:15 glass Exp $ (LBL)
|
||||
*/
|
||||
|
||||
void bootp __P((struct iodesc *));
|
||||
|
@ -1,18 +0,0 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_systm.h>
|
||||
|
||||
#include "netboot.h"
|
||||
#include "config.h"
|
||||
#include "bootbootp.h"
|
||||
#include "bootp.h"
|
||||
#include "netif.h"
|
||||
|
||||
void get_bootinfo(desc)
|
||||
struct iodesc *desc;
|
||||
{
|
||||
bootp(desc);
|
||||
}
|
237
sys/boot/bootp.c
237
sys/boot/bootp.c
@ -1,237 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1992 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Lawrence Berkeley Laboratory and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#) $Header: /cvsroot/src/sys/boot/Attic/bootp.c,v 1.1 1993/10/12 06:02:18 glass Exp $ (LBL)
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_systm.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "netboot.h"
|
||||
#include "config.h"
|
||||
#include "bootbootp.h"
|
||||
#include "bootp.h"
|
||||
|
||||
|
||||
/* Machinery used to insure we don't stop until we have everything we need */
|
||||
#define BOOT_MYIP 0x01
|
||||
#define BOOT_ROOT 0x02
|
||||
#define BOOT_SWAP 0x04
|
||||
#define BOOT_GATEIP 0x08 /* optional */
|
||||
#define BOOT_SMASK 0x10 /* optional */
|
||||
#define BOOT_UCRED 0x20 /* not implemented */
|
||||
|
||||
static int have;
|
||||
static int need = BOOT_MYIP | BOOT_ROOT | BOOT_SWAP;
|
||||
|
||||
/* Local forwards */
|
||||
static int bootpsend __P((struct iodesc *, void *, int));
|
||||
static int bootprecv __P((struct iodesc*, void *, int));
|
||||
|
||||
/* Fetch required bootp infomation */
|
||||
void
|
||||
bootp(d)
|
||||
register struct iodesc *d;
|
||||
{
|
||||
register struct bootp *bp;
|
||||
register void *pkt;
|
||||
struct {
|
||||
u_char header[HEADER_SIZE];
|
||||
struct bootp wbootp;
|
||||
} wbuf;
|
||||
union {
|
||||
u_char buffer[RECV_SIZE];
|
||||
struct {
|
||||
u_char header[HEADER_SIZE];
|
||||
struct bootp xrbootp;
|
||||
}xrbuf;
|
||||
#define rbootp xrbuf.xrbootp
|
||||
} rbuf;
|
||||
|
||||
if (debug)
|
||||
printf("bootp: called\n");
|
||||
have = 0;
|
||||
bp = &wbuf.wbootp;
|
||||
pkt = &rbuf.rbootp;
|
||||
pkt = (((char *) pkt) - HEADER_SIZE);
|
||||
|
||||
bzero(bp, sizeof(*bp));
|
||||
|
||||
bp->bp_op = BOOTREQUEST;
|
||||
bp->bp_htype = 1; /* 10Mb Ethernet (48 bits) */
|
||||
bp->bp_hlen = 6;
|
||||
MACPY(d->myea, bp->bp_chaddr);
|
||||
|
||||
d->myport = IPPORT_BOOTPC;
|
||||
d->destport = IPPORT_BOOTPS;
|
||||
d->destip = INADDR_BROADCAST;
|
||||
|
||||
while ((have & need) != need) {
|
||||
if (debug)
|
||||
printf("bootp: sendrecv\n");
|
||||
(void)sendrecv(d, bootpsend, bp, sizeof(*bp),
|
||||
bootprecv, pkt, RECV_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Transmit a bootp request */
|
||||
static int
|
||||
bootpsend(d, pkt, len)
|
||||
register struct iodesc *d;
|
||||
register void *pkt;
|
||||
register int len;
|
||||
{
|
||||
register struct bootp *bp;
|
||||
|
||||
if (debug)
|
||||
printf("bootpsend: called\n");
|
||||
bp = pkt;
|
||||
bzero(bp->bp_file, sizeof(bp->bp_file));
|
||||
if ((have & BOOT_ROOT) == 0)
|
||||
strcpy((char *)bp->bp_file, "root");
|
||||
else if ((have & BOOT_SWAP) == 0)
|
||||
strcpy((char *)bp->bp_file, "swap");
|
||||
bp->bp_xid = d->xid;
|
||||
bp->bp_secs = (u_long)(getsecs() - bot);
|
||||
if (debug)
|
||||
printf("bootpsend: calling sendudp\n");
|
||||
return (sendudp(d, pkt, len));
|
||||
}
|
||||
|
||||
/* Returns 0 if this is the packet we're waiting for else -1 (and errno == 0) */
|
||||
static int
|
||||
bootprecv(d, pkt, len)
|
||||
register struct iodesc *d;
|
||||
register void *pkt;
|
||||
int len;
|
||||
{
|
||||
register struct bootp *bp;
|
||||
register struct cmu_vend *vp;
|
||||
|
||||
if (debug)
|
||||
printf("bootprecv: called\n");
|
||||
bp = (struct bootp *)checkudp(d, pkt, &len);
|
||||
if (bp == NULL || len < sizeof(*bp)) {
|
||||
errno = 0;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (bp->bp_xid != d->xid) {
|
||||
errno = 0;
|
||||
return (-1);
|
||||
}
|
||||
vp = (struct cmu_vend *)bp->bp_vend;
|
||||
if (bcmp(VM_CMU, vp->v_magic, sizeof(vp->v_magic)) != 0) {
|
||||
printf("bootprecv: not cmu magic\n");
|
||||
vp = NULL;
|
||||
}
|
||||
|
||||
/* Suck out all we can */
|
||||
if (bp->bp_yiaddr.s_addr != 0 && (have & BOOT_MYIP) == 0) {
|
||||
have |= BOOT_MYIP;
|
||||
d->myip = bp->bp_yiaddr.s_addr;
|
||||
if (IN_CLASSA(d->myip))
|
||||
nmask = IN_CLASSA_NET;
|
||||
else if (IN_CLASSB(d->myip))
|
||||
nmask = IN_CLASSB_NET;
|
||||
else
|
||||
nmask = IN_CLASSC_NET;
|
||||
}
|
||||
if (vp && vp->v_smask.s_addr != 0 && (have & BOOT_SMASK) == 0) {
|
||||
have |= BOOT_SMASK;
|
||||
smask = vp->v_smask.s_addr;
|
||||
}
|
||||
if (vp && vp->v_dgate.s_addr != 0 && (have & BOOT_GATEIP) == 0) {
|
||||
have |= BOOT_GATEIP;
|
||||
gateip = vp->v_dgate.s_addr;
|
||||
}
|
||||
if (bp->bp_giaddr.s_addr != 0 && bp->bp_file[0] != '\0') {
|
||||
if ((have & BOOT_ROOT) == 0) {
|
||||
have |= BOOT_ROOT;
|
||||
rootip = bp->bp_giaddr.s_addr;
|
||||
strncpy(rootpath, (char *)bp->bp_file,
|
||||
sizeof(rootpath));
|
||||
rootpath[sizeof(rootpath) - 1] = '\0';
|
||||
|
||||
/* Bump xid so next request will be unique */
|
||||
++d->xid;
|
||||
} else if ((have & BOOT_SWAP) == 0) {
|
||||
have |= BOOT_SWAP;
|
||||
swapip = bp->bp_giaddr.s_addr;
|
||||
strncpy(swappath, (char *)bp->bp_file,
|
||||
sizeof(swappath));
|
||||
swappath[sizeof(swappath) - 1] = '\0';
|
||||
|
||||
/* Bump xid so next request will be unique */
|
||||
++d->xid;
|
||||
}
|
||||
}
|
||||
|
||||
/* Done if we don't know our ip address yet */
|
||||
if ((have & BOOT_MYIP) == 0) {
|
||||
errno = 0;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Check subnet mask against net mask; toss if bogus */
|
||||
if ((have & BOOT_SMASK) != 0 && (nmask & smask) != nmask) {
|
||||
smask = 0;
|
||||
have &= ~BOOT_SMASK;
|
||||
}
|
||||
|
||||
/* Get subnet (or net) mask */
|
||||
mask = nmask;
|
||||
if ((have & BOOT_SMASK) != 0)
|
||||
mask = smask;
|
||||
|
||||
/* We need a gateway if root or swap is on a different net */
|
||||
if ((have & BOOT_ROOT) != 0 && !SAMENET(d->myip, rootip, mask))
|
||||
need |= BOOT_GATEIP;
|
||||
if ((have & BOOT_SWAP) != 0 && !SAMENET(d->myip, swapip, mask))
|
||||
need |= BOOT_GATEIP;
|
||||
|
||||
/* Toss gateway if on a different net */
|
||||
if ((have & BOOT_GATEIP) != 0 && !SAMENET(d->myip, gateip, mask)) {
|
||||
gateip = 0;
|
||||
have &= ~BOOT_GATEIP;
|
||||
}
|
||||
return (0);
|
||||
}
|
103
sys/boot/bootp.h
103
sys/boot/bootp.h
@ -1,103 +0,0 @@
|
||||
/* @(#) $Header: /cvsroot/src/sys/boot/Attic/bootp.h,v 1.1 1993/10/12 06:02:20 glass Exp $ (LBL) */
|
||||
/*
|
||||
* Bootstrap Protocol (BOOTP). RFC951 and RFC1048.
|
||||
*
|
||||
* This file specifies the "implementation-independent" BOOTP protocol
|
||||
* information which is common to both client and server.
|
||||
*
|
||||
* Copyright 1988 by Carnegie Mellon.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this program for any
|
||||
* purpose and without fee is hereby granted, provided that this copyright
|
||||
* and permission notice appear on all copies and supporting documentation,
|
||||
* the name of Carnegie Mellon not be used in advertising or publicity
|
||||
* pertaining to distribution of the program without specific prior
|
||||
* permission, and notice be given in supporting documentation that copying
|
||||
* and distribution is by permission of Carnegie Mellon and Stanford
|
||||
* University. Carnegie Mellon makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
|
||||
struct bootp {
|
||||
unsigned char bp_op; /* packet opcode type */
|
||||
unsigned char bp_htype; /* hardware addr type */
|
||||
unsigned char bp_hlen; /* hardware addr length */
|
||||
unsigned char bp_hops; /* gateway hops */
|
||||
unsigned long bp_xid; /* transaction ID */
|
||||
unsigned short bp_secs; /* seconds since boot began */
|
||||
unsigned short bp_unused;
|
||||
struct in_addr bp_ciaddr; /* client IP address */
|
||||
struct in_addr bp_yiaddr; /* 'your' IP address */
|
||||
struct in_addr bp_siaddr; /* server IP address */
|
||||
struct in_addr bp_giaddr; /* gateway IP address */
|
||||
unsigned char bp_chaddr[16]; /* client hardware address */
|
||||
unsigned char bp_sname[64]; /* server host name */
|
||||
unsigned char bp_file[128]; /* boot file name */
|
||||
unsigned char bp_vend[64]; /* vendor-specific area */
|
||||
};
|
||||
|
||||
/*
|
||||
* UDP port numbers, server and client.
|
||||
*/
|
||||
#define IPPORT_BOOTPS 67
|
||||
#define IPPORT_BOOTPC 68
|
||||
|
||||
#define BOOTREPLY 2
|
||||
#define BOOTREQUEST 1
|
||||
|
||||
|
||||
/*
|
||||
* Vendor magic cookie (v_magic) for CMU
|
||||
*/
|
||||
#define VM_CMU "CMU"
|
||||
|
||||
/*
|
||||
* Vendor magic cookie (v_magic) for RFC1048
|
||||
*/
|
||||
#define VM_RFC1048 { 99, 130, 83, 99 }
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* RFC1048 tag values used to specify what information is being supplied in
|
||||
* the vendor field of the packet.
|
||||
*/
|
||||
|
||||
#define TAG_PAD ((unsigned char) 0)
|
||||
#define TAG_SUBNET_MASK ((unsigned char) 1)
|
||||
#define TAG_TIME_OFFSET ((unsigned char) 2)
|
||||
#define TAG_GATEWAY ((unsigned char) 3)
|
||||
#define TAG_TIME_SERVER ((unsigned char) 4)
|
||||
#define TAG_NAME_SERVER ((unsigned char) 5)
|
||||
#define TAG_DOMAIN_SERVER ((unsigned char) 6)
|
||||
#define TAG_LOG_SERVER ((unsigned char) 7)
|
||||
#define TAG_COOKIE_SERVER ((unsigned char) 8)
|
||||
#define TAG_LPR_SERVER ((unsigned char) 9)
|
||||
#define TAG_IMPRESS_SERVER ((unsigned char) 10)
|
||||
#define TAG_RLP_SERVER ((unsigned char) 11)
|
||||
#define TAG_HOSTNAME ((unsigned char) 12)
|
||||
#define TAG_BOOTSIZE ((unsigned char) 13)
|
||||
#define TAG_END ((unsigned char) 255)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* "vendor" data permitted for CMU bootp clients.
|
||||
*/
|
||||
|
||||
struct cmu_vend {
|
||||
unsigned char v_magic[4]; /* magic number */
|
||||
unsigned long v_flags; /* flags/opcodes, etc. */
|
||||
struct in_addr v_smask; /* Subnet mask */
|
||||
struct in_addr v_dgate; /* Default gateway */
|
||||
struct in_addr v_dns1, v_dns2; /* Domain name servers */
|
||||
struct in_addr v_ins1, v_ins2; /* IEN-116 name servers */
|
||||
struct in_addr v_ts1, v_ts2; /* Time servers */
|
||||
unsigned char v_unused[25]; /* currently unused */
|
||||
};
|
||||
|
||||
|
||||
/* v_flags values */
|
||||
#define VF_SMASK 1 /* Subnet mask field contains valid data */
|
@ -1,7 +0,0 @@
|
||||
# Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp
|
||||
|
||||
SRCS+= imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
|
||||
bcmp.c ffs.c strcat.c strcmp.c strcpy.c strlen.c strncpy.c \
|
||||
scanc.c skpc.c locc.c \
|
||||
ntoh.s \
|
||||
setjmp.s
|
Loading…
Reference in New Issue
Block a user