freebsd-dev/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 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
mips Add the needed _setjmp.S for MIPS. 2008-08-27 17:58:51 +00:00
powerpc
sparc64 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
__main.c
arp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
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 Fix logical bug in the bzip2 reading code, which results in bogus EIO 2007-12-18 01:50:49 +00:00
cd9660.c Implement the full range of ISO9660 number conversion routines in iso.h. 2005-10-18 13:35:08 +00:00
close.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
closeall.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
dev.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
dosfs.c Don't add integers to void pointers. 2004-10-03 15:58:20 +00:00
dosfs.h
environment.c Cast away const qualifier to squash GCC warning. 2007-04-04 03:29:02 +00:00
ether.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ext2fs.c Don't add integers to void pointers. 2004-10-03 15:58:20 +00:00
fstat.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
getopt.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
gets.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
globals.c
gzipfs.c Fix logical bug in the bzip2 reading code, which results in bogus EIO 2007-12-18 01:50:49 +00:00
if_ether.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
in_cksum.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
inet_ntoa.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ioctl.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
iodesc.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
libstand.3 Fix prototypes. 2005-11-24 11:14:06 +00:00
lseek.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
Makefile Let libstand(3) build on ARM. 2008-10-14 09:53:47 +00:00
net.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
net.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
netif.c
netif.h
nfs.c use the correct variable in a debug message. 2008-11-21 09:14:29 +00:00
nfsv2.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
nullfs.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
open.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
pager.c
printf.c Obey signedness flag in %z case. 2008-11-18 00:01:16 +00:00
qdivrem.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
quad.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
random.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rarp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
read.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
readdir.c
rpc.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rpc.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rpcv2.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
saioctl.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
sbrk.c Don't add integers to void pointers. 2004-10-03 15:58:20 +00:00
splitfs.c Remove unused variable. Shorten the path to WARNS=6 compliance. 2005-05-20 12:55:38 +00:00
stand.h Eliminate dead declarations in libstand. 2008-11-06 16:30:32 +00:00
stat.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strcasecmp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strdup.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strerror.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strtol.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
tftp.c - Given that we tell the compiler that struct ip is packed and 32-bit 2007-10-21 17:03:18 +00:00
tftp.h
twiddle.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
udp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ufs.c Eliminate __alpha__ leftover from libstand. 2008-09-04 10:05:44 +00:00
write.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
zalloc_defs.h Just use uintptr_t and intptr_t rather than requiring each arch to provide 2005-05-31 20:01:18 +00:00
zalloc_malloc.c Eliminate __alpha__ leftover from libstand. 2008-09-04 10:05:44 +00:00
zalloc_mem.h
zalloc_protos.h
zalloc.c