CVS commit: src/usr.sbin/isibootd
Module Name:src Committed By: tsutsui Date: Sat Jan 30 11:34:28 UTC 2021 Modified Files: src/usr.sbin/isibootd: isibootd.c Log Message: Fix "Cannot allocate memory" failure on amd64. BIOCGBLEN ioctl of bpf(4) requires u_int, not size_t. The problem is reported by Kenji Aoyama. Should be pulled up to netbsd-9 and netbsd-8. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/isibootd/isibootd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/isibootd/isibootd.c diff -u src/usr.sbin/isibootd/isibootd.c:1.3 src/usr.sbin/isibootd/isibootd.c:1.4 --- src/usr.sbin/isibootd/isibootd.c:1.3 Mon Apr 2 09:01:30 2012 +++ src/usr.sbin/isibootd/isibootd.c Sat Jan 30 11:34:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: isibootd.c,v 1.3 2012/04/02 09:01:30 nisimura Exp $ */ +/* $NetBSD: isibootd.c,v 1.4 2021/01/30 11:34:28 tsutsui Exp $ */ /* Id: isiboot.c,v 1.2 1999/12/26 14:33:33 nisimura Exp */ /*- @@ -364,7 +364,7 @@ createbpfport(char *ifname, uint8_t **io struct ifreq ifr; int fd; u_int type; - size_t buflen; + u_int buflen; uint8_t dladdr[ETHER_ADDR_LEN], *buf; #ifdef BIOCIMMEDIATE u_int flag;
CVS commit: src/usr.sbin/isibootd
Module Name:src Committed By: nisimura Date: Mon Apr 2 09:01:30 UTC 2012 Modified Files: src/usr.sbin/isibootd: isibootd.c Log Message: Change Ethertype 0x80df symbolic name. According to the real if_ether.h, dated back to 1991, Integrated Solution, Inc. used the following definitions. #define ETHERTYPE_WIPC 0x80DE /* ISI: WIPC protocol */ #define ETHERTYPE_ISIBOOT 0x80DF /* ISI: bootd enet protocol */ #define ETHERTYPE_ISIBOOT_OLD 0x0807 /* ISI: old bootd (NOT OFFICIAL!) */ #define ETHERTYPE_RFS 0x0813 /* ISI: RFS protocol (NOT OFFICIAL!) */ No functionality change is expected. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/isibootd/isibootd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/isibootd/isibootd.c diff -u src/usr.sbin/isibootd/isibootd.c:1.2 src/usr.sbin/isibootd/isibootd.c:1.3 --- src/usr.sbin/isibootd/isibootd.c:1.2 Sun Dec 18 14:45:23 2011 +++ src/usr.sbin/isibootd/isibootd.c Mon Apr 2 09:01:30 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: isibootd.c,v 1.2 2011/12/18 14:45:23 tsutsui Exp $ */ +/* $NetBSD: isibootd.c,v 1.3 2012/04/02 09:01:30 nisimura Exp $ */ /* Id: isiboot.c,v 1.2 1999/12/26 14:33:33 nisimura Exp */ /*- @@ -57,13 +57,13 @@ #define TRACE(l, x) if ((l) = dbg) printf x /* - * TRFS (Integrated Solutions Inc. Transparent Remote File System) frame + * Integrated Solutions Inc. ISIBOOT boot enet protocol. * * Following data format depends on m68k order, and aligned harmful * to RISC processors. */ -#define TRFS_FRAMETYPE 0x80df -#define TRFS_FRAMELEN 1468 +#define ISIBOOT_FRAMETYPE 0x80df +#define ISIBOOT_FRAMELEN 1468 struct frame { uint8_t dst[ETHER_ADDR_LEN]; uint8_t src[ETHER_ADDR_LEN]; @@ -74,7 +74,7 @@ struct frame { uint8_t pad_1; uint8_t pos[4]; uint8_t siz[4]; - uint8_t data[TRFS_FRAMELEN - 28]; + uint8_t data[ISIBOOT_FRAMELEN - 28]; } __packed; struct station { @@ -112,7 +112,7 @@ static char *etheraddr(uint8_t *); static int pickif(char *, uint8_t *); static __dead void usage(void); -#define TRFS_FRAME(buf) ((buf) + ((struct bpf_hdr *)(buf))-bh_hdrlen) +#define ISIBOOT_FRAME(buf) ((buf) + ((struct bpf_hdr *)(buf))-bh_hdrlen) #define PATH_DEFBOOTDIR /tftpboot @@ -185,7 +185,7 @@ main(int argc, char *argv[]) for (;;) { poll(pollfd, 1, INFTIM); read(pollfd.fd, iobuf, iolen); /* returns 1468 */ - fp = (struct frame *)TRFS_FRAME(iobuf); + fp = (struct frame *)ISIBOOT_FRAME(iobuf); /* ignore own TX packets */ if (memcmp(fp-src, station.addr, ETHER_ADDR_LEN) == 0) @@ -269,7 +269,7 @@ main(int argc, char *argv[]) } memcpy(fp-dst, fp-src, ETHER_ADDR_LEN); memcpy(fp-src, station.addr, ETHER_ADDR_LEN); - write(pollfd.fd, fp, TRFS_FRAMELEN); + write(pollfd.fd, fp, ISIBOOT_FRAMELEN); } /* NOTREACHED */ } @@ -348,8 +348,8 @@ etheraddr(uint8_t *e) static struct bpf_insn bpf_insn[] = { { BPF_LD|BPF_H|BPF_ABS, 0, 0, offsetof(struct frame, type) }, - { BPF_JMP|BPF_JEQ|BPF_K, 0, 1, TRFS_FRAMETYPE }, - { BPF_RET|BPF_K, 0, 0, TRFS_FRAMELEN }, + { BPF_JMP|BPF_JEQ|BPF_K, 0, 1, ISIBOOT_FRAMETYPE }, + { BPF_RET|BPF_K, 0, 0, ISIBOOT_FRAMELEN }, { BPF_RET|BPF_K, 0, 0, 0x0 } }; static struct bpf_program bpf_pgm = {
CVS commit: src/usr.sbin/isibootd
Module Name:src Committed By: tsutsui Date: Sun Dec 18 14:45:24 UTC 2011 Modified Files: src/usr.sbin/isibootd: isibootd.c Log Message: Rename FRAME* macro to TRFS_FRAME* for readability and workaround for powerpc builds. Pointed out by phx@. XXX: powerpc/frame.h shouldn't pollute userland namespace anyway. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/isibootd/isibootd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/isibootd/isibootd.c diff -u src/usr.sbin/isibootd/isibootd.c:1.1 src/usr.sbin/isibootd/isibootd.c:1.2 --- src/usr.sbin/isibootd/isibootd.c:1.1 Sat Dec 17 13:24:18 2011 +++ src/usr.sbin/isibootd/isibootd.c Sun Dec 18 14:45:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: isibootd.c,v 1.1 2011/12/17 13:24:18 tsutsui Exp $ */ +/* $NetBSD: isibootd.c,v 1.2 2011/12/18 14:45:23 tsutsui Exp $ */ /* Id: isiboot.c,v 1.2 1999/12/26 14:33:33 nisimura Exp */ /*- @@ -62,8 +62,8 @@ * Following data format depends on m68k order, and aligned harmful * to RISC processors. */ -#define FRAMETYPE 0x80df -#define FRAMELEN 1468 +#define TRFS_FRAMETYPE 0x80df +#define TRFS_FRAMELEN 1468 struct frame { uint8_t dst[ETHER_ADDR_LEN]; uint8_t src[ETHER_ADDR_LEN]; @@ -74,7 +74,7 @@ struct frame { uint8_t pad_1; uint8_t pos[4]; uint8_t siz[4]; - uint8_t data[FRAMELEN - 28]; + uint8_t data[TRFS_FRAMELEN - 28]; } __packed; struct station { @@ -112,7 +112,7 @@ static char *etheraddr(uint8_t *); static int pickif(char *, uint8_t *); static __dead void usage(void); -#define FRAME(buf) ((buf) + ((struct bpf_hdr *)(buf))-bh_hdrlen) +#define TRFS_FRAME(buf) ((buf) + ((struct bpf_hdr *)(buf))-bh_hdrlen) #define PATH_DEFBOOTDIR /tftpboot @@ -185,7 +185,7 @@ main(int argc, char *argv[]) for (;;) { poll(pollfd, 1, INFTIM); read(pollfd.fd, iobuf, iolen); /* returns 1468 */ - fp = (struct frame *)FRAME(iobuf); + fp = (struct frame *)TRFS_FRAME(iobuf); /* ignore own TX packets */ if (memcmp(fp-src, station.addr, ETHER_ADDR_LEN) == 0) @@ -269,7 +269,7 @@ main(int argc, char *argv[]) } memcpy(fp-dst, fp-src, ETHER_ADDR_LEN); memcpy(fp-src, station.addr, ETHER_ADDR_LEN); - write(pollfd.fd, fp, FRAMELEN); + write(pollfd.fd, fp, TRFS_FRAMELEN); } /* NOTREACHED */ } @@ -348,8 +348,8 @@ etheraddr(uint8_t *e) static struct bpf_insn bpf_insn[] = { { BPF_LD|BPF_H|BPF_ABS, 0, 0, offsetof(struct frame, type) }, - { BPF_JMP|BPF_JEQ|BPF_K, 0, 1, FRAMETYPE }, - { BPF_RET|BPF_K, 0, 0, FRAMELEN }, + { BPF_JMP|BPF_JEQ|BPF_K, 0, 1, TRFS_FRAMETYPE }, + { BPF_RET|BPF_K, 0, 0, TRFS_FRAMELEN }, { BPF_RET|BPF_K, 0, 0, 0x0 } }; static struct bpf_program bpf_pgm = {
CVS commit: src/usr.sbin/isibootd
Module Name:src Committed By: tsutsui Date: Sat Dec 17 13:24:18 UTC 2011 Added Files: src/usr.sbin/isibootd: Makefile isibootd.8 isibootd.c Log Message: Add isibootd(8) command, which is a dumb network boot server program for the OMRON LUNA clients, like ndbootd(8) for Sun2 machines. No particular comment on tech-userlevel@: http://mail-index.NetBSD.org/tech-userlevel/2011/12/15/msg005872.html To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/usr.sbin/isibootd/Makefile \ src/usr.sbin/isibootd/isibootd.8 src/usr.sbin/isibootd/isibootd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/usr.sbin/isibootd/Makefile diff -u /dev/null src/usr.sbin/isibootd/Makefile:1.1 --- /dev/null Sat Dec 17 13:24:18 2011 +++ src/usr.sbin/isibootd/Makefile Sat Dec 17 13:24:18 2011 @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.1 2011/12/17 13:24:18 tsutsui Exp $ + +USE_FORT?= yes # network server + +PROG= isibootd +SRCS= isibootd.c +MAN= isibootd.8 + +LDADD+= -lutil +DPADD+= ${LIBUTIL} + +.include bsd.own.mk +.include bsd.prog.mk Index: src/usr.sbin/isibootd/isibootd.8 diff -u /dev/null src/usr.sbin/isibootd/isibootd.8:1.1 --- /dev/null Sat Dec 17 13:24:18 2011 +++ src/usr.sbin/isibootd/isibootd.8 Sat Dec 17 13:24:18 2011 @@ -0,0 +1,101 @@ +.\ $NetBSD: isibootd.8,v 1.1 2011/12/17 13:24:18 tsutsui Exp $ +.\ +.\ Copyright (c) 2011 The NetBSD Foundation, Inc. +.\ All rights reserved. +.\ +.\ 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. +.\ +.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. +.\ +.Dd December 15, 2011 +.Dt ISIBOOTD 8 +.Os +.Sh NAME +.Nm isibootd +.Nd TRFS based network boot server +.Sh SYNOPSIS +.Nm +.Op Fl d Ar tracelevel +.Op Fl i Ar interface +.Op Fl s Ar directory +.Sh DESCRIPTION +The +.Nm +command is a server which supports OMRON LUNA's network boot protocol +based on the Transparent Remote File System (TRFS) protocol. +The TRFS protocol uses special Ethernet type packets and +works within a local network. +.Pp +.Nm +is a simple TRFS server that only supports client reads for booting +and exports files in a specified directory. +.Nm +accepts requests only from clients listed in the +.Pa /etc/ethers +and have valid hostnames. +.Pp +The options are as follows: +.Bl -tag -width Fl +.It Fl d Ar tracelevel +Run +.Nm +in debug mode with specified tracelevel. +The tracelevel can be value 1, 2, or 3, and +greater tracelevel provides more detailed trace output. +The server will not fork in the debug mode. +.It Fl i Ar interface +Specify a network interface to service network boot. +If not specified +.Nm +searches available network interfaces (excluding loopback) +and use the first configured +.Dq up +one. +.It Fl s Ar directory +Specify a directory containing boot files to be served by +.Nm . +If not specified +.Nm +uses +.Pa /tftpboot +by default. +.Sh FILES +.Bl -tag -width Pa -compact +.It Pa /etc/ethers +.It Pa /etc/hosts +.It Pa /tftpboot +.It Pa /var/run/isibootd.pid +.El +.Sh SEE ALSO +.Xr ethers 5 , +.Xr hosts 5 , +.Xr tftpd 8 +.Pp +.Pa http://www.NetBSD.org/ports/luna68k/install.html +.Sh HISTORY +.Nm +is based on +.Pa isiboot +utility which was originally written by +.An Tohru Nishimura +for +.Nx Ns /luna68k +development, and first appeared in +.Nx 6.0 . Index: src/usr.sbin/isibootd/isibootd.c diff -u /dev/null src/usr.sbin/isibootd/isibootd.c:1.1 --- /dev/null Sat Dec 17 13:24:18 2011 +++ src/usr.sbin/isibootd/isibootd.c Sat Dec 17 13:24:18 2011 @@ -0,0 +1,467 @@ +/* $NetBSD: isibootd.c,v 1.1 2011/12/17 13:24:18 tsutsui Exp $ */ +/* Id: isiboot.c,v 1.2 1999/12/26 14:33:33 nisimura Exp */ + +/*- + * Copyright (c) 2000, 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * +
CVS commit: src/usr.sbin/isibootd
Module Name:src Committed By: wiz Date: Sat Dec 17 14:12:44 UTC 2011 Modified Files: src/usr.sbin/isibootd: isibootd.8 Log Message: Remove trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/isibootd/isibootd.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/isibootd/isibootd.8 diff -u src/usr.sbin/isibootd/isibootd.8:1.1 src/usr.sbin/isibootd/isibootd.8:1.2 --- src/usr.sbin/isibootd/isibootd.8:1.1 Sat Dec 17 13:24:18 2011 +++ src/usr.sbin/isibootd/isibootd.8 Sat Dec 17 14:12:44 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: isibootd.8,v 1.1 2011/12/17 13:24:18 tsutsui Exp $ +.\ $NetBSD: isibootd.8,v 1.2 2011/12/17 14:12:44 wiz Exp $ .\ .\ Copyright (c) 2011 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -65,7 +65,7 @@ Specify a network interface to service n If not specified .Nm searches available network interfaces (excluding loopback) -and use the first configured +and use the first configured .Dq up one. .It Fl s Ar directory
CVS commit: src/usr.sbin/isibootd
Module Name:src Committed By: tsutsui Date: Sat Dec 17 14:25:32 UTC 2011 Modified Files: src/usr.sbin/isibootd: isibootd.8 Log Message: Fix Bl/El unmatch. Pointed out by kano@. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/isibootd/isibootd.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/isibootd/isibootd.8 diff -u src/usr.sbin/isibootd/isibootd.8:1.2 src/usr.sbin/isibootd/isibootd.8:1.3 --- src/usr.sbin/isibootd/isibootd.8:1.2 Sat Dec 17 14:12:44 2011 +++ src/usr.sbin/isibootd/isibootd.8 Sat Dec 17 14:25:32 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: isibootd.8,v 1.2 2011/12/17 14:12:44 wiz Exp $ +.\ $NetBSD: isibootd.8,v 1.3 2011/12/17 14:25:32 tsutsui Exp $ .\ .\ Copyright (c) 2011 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -76,6 +76,7 @@ If not specified uses .Pa /tftpboot by default. +.El .Sh FILES .Bl -tag -width Pa -compact .It Pa /etc/ethers