1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00
freebsd/lib/libstand
Luigi Rizzo 7e8cc2bd03 Some libstand/bootp.c extension (written by Danny Braniss, slightly
revised/modified by me) to store dhcp options into kenv variables,
so the information is available to the boot loader and can be used
to customize the boot process.

The change is totally unintrusive, essentially made of a single
function to be called while parsing a dhcp response, and a couple
of tables to classify options.  The values extracted from dhcp
options are stored in the kenv environment in one of these forms:

 + options whose name and type is known are saved as
        dhcp.name = value     (string, or number/ip addresses lists)

 + unknown options are assumed to be strings and saved as
        dhcp.option-NNN = "value"

 + options listed as '__INDIR' and sent on the wire as e.g.
        option unknown-252 "some.name=the actual value"
   are saved as
        some.name = "the actual value"

 + options listed as '__ILIST' and sent on the wire as e.g.
        option unknown-249 "a.b=foo bar; c.d= 123; e.f=done"
   are saved as multiple values
        a.b="foo bar"
        c.d="123"
        e.f="done"

As you can see there is quite a bit of flexibility on what can
be passed to the loader or the kernel.

For the time being the vendor-specific table is mostly disabled,
because there is no standard set of options for FreeBSD, and I don't
know all the pxe-specific vendor options.

Also, applications using libstand may live in memory-constrained
environments, so it makes sense to keep these tables as small as
possible, especially considering that one can generate arbitrary
name=value pairs using site-specific options of type __INDIR or
__ILIST (there are 4 __ILIST and 5 __INDIR in the table, numbered
246..249 and 250..254).

Actually, considering that probably 75% of the standard dhcp options
are totally useless, it might make sense to remove them as well.

Submitted by:	Danny Braniss
MFC after:	4 weeks
2008-12-05 17:13:40 +00:00
..
arm
i386
mips
powerpc
sparc64
__main.c
arp.c
assert.c
bcd.c
bootp.c Some libstand/bootp.c extension (written by Danny Braniss, slightly 2008-12-05 17:13:40 +00:00
bootp.h
bootparam.c
bootparam.h
bswap.c
bzipfs.c
cd9660.c
close.c
closeall.c
dev.c
dosfs.c
dosfs.h
environment.c
ether.c
ext2fs.c
fstat.c
getopt.c
gets.c
globals.c
gzipfs.c
if_ether.h
in_cksum.c
inet_ntoa.c
ioctl.c
iodesc.h
libstand.3
lseek.c
Makefile Let libstand(3) build on ARM. 2008-10-14 09:53:47 +00:00
net.c
net.h
netif.c
netif.h
nfs.c use the correct variable in a debug message. 2008-11-21 09:14:29 +00:00
nfsv2.h
nullfs.c
open.c
pager.c
printf.c Obey signedness flag in %z case. 2008-11-18 00:01:16 +00:00
qdivrem.c
quad.h
random.c
rarp.c
read.c
readdir.c
rpc.c
rpc.h
rpcv2.h
saioctl.h
sbrk.c
splitfs.c
stand.h Eliminate dead declarations in libstand. 2008-11-06 16:30:32 +00:00
stat.c
strcasecmp.c
strdup.c
strerror.c
strtol.c
tftp.c
tftp.h
twiddle.c
udp.c
ufs.c
write.c
zalloc_defs.h
zalloc_malloc.c
zalloc_mem.h
zalloc_protos.h
zalloc.c