2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 06:15:55 +00:00

Intermediate changes to support actual DHCP protocol engine

This commit is contained in:
Ted Lemon
1996-02-21 12:11:09 +00:00
parent d9c6d82c49
commit 97ca16995f
29 changed files with 972 additions and 120 deletions

View File

@@ -189,11 +189,51 @@ int main (argc, argv, envp)
cons_options ((struct packet *)0,
&outgoing, &decl, bufs);
memset (&raw.ciaddr, 0, sizeof raw.ciaddr);
memset (&raw.yiaddr, 0, sizeof raw.ciaddr);
memset (&raw.siaddr, 0, sizeof raw.ciaddr);
memset (&raw.giaddr, 0, sizeof raw.ciaddr);
if (decl.ciaddr) {
if (tree_evaluate (decl.ciaddr) != 4)
warn ("ciaddr is more"
" than one address");
else
memcpy (&raw.ciaddr,
decl.ciaddr -> value,
decl.ciaddr -> len);
} else
memset (&raw.ciaddr, 0, sizeof raw.ciaddr);
if (decl.yiaddr) {
if (tree_evaluate (decl.yiaddr) != 4)
warn ("yiaddr is more"
" than one address");
else
memcpy (&raw.yiaddr,
decl.yiaddr -> value,
decl.yiaddr -> len);
} else
memset (&raw.yiaddr, 0, sizeof raw.yiaddr);
if (decl.siaddr) {
if (tree_evaluate (decl.siaddr) != 4)
warn ("siaddr is more"
" than one address");
else
memcpy (&raw.siaddr,
decl.siaddr -> value,
decl.siaddr -> len);
} else
memset (&raw.siaddr, 0, sizeof raw.siaddr);
if (decl.giaddr) {
if (tree_evaluate (decl.giaddr) != 4)
warn ("giaddr is more"
" than one address");
else
memcpy (&raw.giaddr,
decl.giaddr -> value,
decl.giaddr -> len);
} else
memset (&raw.giaddr, 0, sizeof raw.giaddr);
raw.xid = xid++;
raw.xid = htons (raw.xid);
raw.secs = 0;