29 #define DHCP_OPTION_DATA 36 static int pretty_text(
char **,
char *,
const unsigned char **,
37 const unsigned char *,
int);
38 static int pretty_domain(
char **,
char *,
const unsigned char **,
39 const unsigned char *);
41 unsigned char *
buffer,
unsigned length,
42 unsigned code,
int terminatep,
54 packet -> options_valid = 0;
61 &packet -> raw -> options [4],
62 (packet -> packet_length -
96 (
unsigned char *)packet -> raw ->
file,
97 sizeof packet -> raw ->
file,
104 (
unsigned char *)packet -> raw -> sname,
105 sizeof packet -> raw -> sname,
110 packet -> options_valid = 1;
119 const
unsigned char *
buffer;
123 unsigned len, offset;
126 struct buffer *bp = (
struct buffer *)0;
128 char *reason =
"general failure";
131 log_error (
"no memory for option buffer.");
134 memcpy (bp -> data, buffer, length);
137 (offset + universe->
tag_size) <= length &&
138 (code = universe->
get_tag(buffer + offset)) != universe->
end; ) {
147 reason =
"code tag at end of buffer - missing " 164 log_fatal(
"Improperly configured option space(%s): " 165 "may not have a nonzero length size " 166 "AND a NULL get_length function.",
175 option_code_hash_lookup(&option, universe->
code_hash, &code,
179 if (offset + len > length) {
180 reason =
"option length exceeds option buffer length";
182 log_error(
"parse_option_buffer: malformed option " 183 "%s.%s (code %u): %s.", universe->
name,
184 option ? option->
name :
"<unknown>",
195 (option->
format[0] ==
'e' ||
196 option->
format[0] ==
'E') &&
198 bp->
data + offset, len,
204 memset(&
new, 0,
sizeof new);
214 memcpy(
new.buffer->data, op->
data.
data,
217 memcpy(
new.buffer->data + op->
data.
len,
218 bp->
data + offset, len);
220 new.data =
new.buffer->data;
225 }
else if (op != NULL) {
229 while (op->
next != NULL)
241 nop->data.buffer = NULL;
243 nop->data.data = bp->
data + offset;
250 bp->
data + offset, len,
253 "save_option_buffer failed");
278 s = strchr (eopt -> format,
'E');
280 log_error (
"internal encapsulation format error 1.");
284 t = strchr (++s,
'.');
288 log_error (
"internal encapsulation format error 2.");
291 if (t == s && uname) {
302 s, (
unsigned)(t - s))) {
318 const unsigned char *
buffer,
336 i = (*universe ->
decode) (options, buffer, len, universe);
339 if (eopt -> format [0] !=
'E')
346 const unsigned char *
buffer,
347 unsigned length,
struct universe *u)
349 struct buffer *bp = (
struct buffer *)0;
357 log_error (
"no memory for option buffer.");
360 memcpy (&bp ->
data [3], buffer + 1, length - 1);
389 if (!bp ->
data [0]) {
393 if (buffer [length - 1] == 0) {
401 for (i = 3; i < length && buffer [i] !=
'.'; i++);
412 if (length > 4 + i &&
414 &bp ->
data[6 + i], length - 4 - i,
420 &bp ->
data [5], length - 3,
426 unsigned total_len = 0;
427 unsigned first_len = 0;
433 while (s < &bp ->
data[0] + length + 2) {
436 log_info (
"fancy bits in fqdn option");
443 if (s + len > &bp ->
data [0] + length + 3) {
444 log_info (
"fqdn tag longer than buffer");
448 if (first_len == 0) {
454 total_len += len + 1;
465 first_len = total_len;
470 &bp ->
data[6], first_len,
473 if (total_len > 0 && first_len != total_len) {
475 &bp->
data[6 + first_len],
476 total_len - first_len,
482 &bp ->
data [6], total_len,
522 int overload_avail,
int terminate,
int bootpp,
525 #define PRIORITY_COUNT 300 528 unsigned char buffer[4096], agentopts[1024];
530 unsigned mb_size = 0, mb_max = 0;
531 unsigned option_size = 0, agent_size = 0;
537 int overload_used = 0;
538 int of1 = 0, of2 = 0;
540 memset(&ds, 0,
sizeof ds);
553 client_state, in_options,
554 cfg_options, scope, op,
MDL) != 0)) {
555 if (ds.
len >= sizeof (u_int16_t)) {
557 if(!mms || (i < mms))
589 if (inpacket != NULL &&
601 if (client_state == NULL) {
606 inpacket, lease, client_state,
607 in_options, cfg_options, scope,
608 priority_list, priority_len,
611 mb_size += agent_size;
620 if (mb_size > agent_size)
621 mb_max = mb_size - agent_size;
625 if (overload_avail & 1) {
630 if (overload_avail & 2) {
651 if (prl != NULL && prl->
len > 0) {
655 priority_list[priority_len++] =
664 priority_list[priority_len++] =
674 for (i = 0; i < prl->
len; i++) {
680 priority_list[priority_len++] = prl->
data[i];
692 priority_list[priority_len++] =
DHO_FQDN;
723 priority_list[priority_len++] =
DHO_FQDN;
738 for (pp = hash[i]; pp; pp = pp->cdr) {
744 priority_list[priority_len++] =
759 for (pp = hash[i]; pp; pp = pp->cdr) {
765 priority_list[priority_len++] =
780 priority_list[priority_len++] =
790 priority_list[priority_len++] =
799 option_size =
store_options(&overload_used, buffer, index, mb_max,
800 inpacket, lease, client_state,
801 in_options, cfg_options, scope,
802 priority_list, priority_len,
803 of1, of2, terminate, vuname);
806 if (option_size == 0)
810 index += option_size;
817 if (mb_size - agent_size - index < 3)
822 buffer[index++] = overload_used;
824 if (overload_used & 1)
827 if (overload_used & 2)
833 if (mb_size - index >= agent_size) {
834 memcpy(&buffer[index], agentopts, agent_size);
837 log_error(
"Unable to store relay agent information " 846 memcpy(outpacket->
options, buffer, index);
871 struct lease *dummy_lease,
877 void *void_vsio_state) {
882 memset(&ds, 0,
sizeof(ds));
884 NULL, opt_state, NULL,
890 }
else if (universe->
tag_size == 2) {
894 }
else if (universe->
tag_size == 4) {
913 log_debug(
"No space for option %d in VSIO space %s.",
918 log_error(
"Error evaluating option %d in VSIO space %s.",
944 log_debug(
"No space for option %d", code);
946 unsigned char* tmp = (
unsigned char *)
buf + *
bufpos;
952 memcpy(tmp+4, ds->
data, ds->
len);
987 struct option* encap_opt, uint16_t code) {
993 char* s = (
char*)encap_opt->
format;
995 if ((s == NULL) || (*s !=
'E') || (strlen(s) <= 2)) {
999 t = strchr(++s,
'.');
1000 if ((t == NULL) || (t == s)) {
1004 memset(&ds, 0,
sizeof(ds));
1005 memset(&name, 0,
sizeof(name));
1006 name.
data = (
unsigned char *)s;
1029 struct packet *packet,
1030 const int *required_opts,
1039 int in_required_opts;
1040 int vsio_option_code;
1051 vsio_option_code = 0;
1055 vsio_option_code = o->
code;
1060 if (vsio_option_code == 0) {
1061 log_fatal(
"No VSIO option code found.");
1064 if (required_opts != NULL) {
1065 for (i=0; required_opts[i] != 0; i++) {
1066 if (required_opts[i] == vsio_option_code) {
1071 opt_state, required_opts[i]);
1075 memset(&ds, 0,
sizeof(ds));
1076 for (; oc != NULL ; oc = oc->
next) {
1081 add_option6_data(buf, buflen, &bufpos,
1082 (uint16_t)required_opts[i], &ds);
1095 oro_size = oro->
len / 2;
1097 for (i=0; i<oro_size; i++) {
1098 memcpy(&code, oro->
data+(i*2), 2);
1105 in_required_opts = 0;
1106 if (required_opts != NULL) {
1107 for (j=0; required_opts[j] != 0; j++) {
1108 if (required_opts[j] == code) {
1109 in_required_opts = 1;
1114 if (in_required_opts) {
1121 if (code == vsio_option_code) {
1130 memset(&ds, 0,
sizeof(ds));
1133 for (; oc != NULL ; oc = oc->
next) {
1135 NULL, opt_state, NULL,
1138 add_option6_data(buf, buflen, &bufpos,
1151 struct option *encap_opt = NULL;
1152 unsigned int code_int =
code;
1154 option_code_hash_lookup(&encap_opt,
1157 if (encap_opt != NULL) {
1158 store_encap6(buf, buflen, &bufpos, opt_state,
1159 packet, encap_opt, code);
1189 if (vs.
bufpos > bufpos+8) {
1190 tmp = (
unsigned char *)buf +
1214 unsigned char *
buffer,
unsigned index,
unsigned buflen,
1220 unsigned *priority_list,
int priority_len,
1221 unsigned first_cutoff,
int second_cutoff,
int terminate,
1224 int bufix = 0, six = 0, tix = 0;
1228 int bufend, sbufend;
1239 buffer = &buffer[index];
1242 first_cutoff -= index;
1244 second_cutoff -= index;
1247 bufend = sbufend =
buflen;
1249 if (first_cutoff >= buflen)
1250 log_fatal(
"%s:%d:store_options: Invalid first cutoff.",
MDL);
1251 bufend = first_cutoff;
1253 if (second_cutoff) {
1254 if (second_cutoff >= buflen)
1255 log_fatal(
"%s:%d:store_options: Invalid second cutoff.",
1257 sbufend = second_cutoff;
1259 }
else if (second_cutoff) {
1260 if (second_cutoff >= buflen)
1261 log_fatal(
"%s:%d:store_options: Invalid second cutoff.",
MDL);
1262 bufend = second_cutoff;
1265 memset (&od, 0,
sizeof od);
1270 for (i = 0; i < priority_len; i++) {
1273 for (ix = i + 1; ix < priority_len + tto; ix++) {
1275 priority_list [ix - tto] =
1277 if (priority_list [i] == priority_list [ix]) {
1295 for (ix = i - 1 ; ix >= 0 ; ix--) {
1308 for (i = 0; i < priority_len; i++) {
1312 int optstart, soptstart, toptstart;
1314 int have_encapsulation = 0;
1318 memset (&encapsulation, 0,
sizeof encapsulation);
1319 have_encapsulation = 0;
1325 code = priority_list [i];
1329 if (code >= cfg_options -> site_code_min)
1330 u =
universes [cfg_options -> site_universe];
1339 option_code_hash_lookup(&option, u->
code_hash, &code, 0,
MDL);
1349 if ((option != NULL) &&
1350 (((oc == NULL) && (option->
format[0] ==
'E')) ||
1351 ((oc != NULL) && (option->
format[0] ==
'e')))) {
1356 s = strchr (option->
format,
'E');
1358 t = strchr (++s,
'.');
1360 memset (&name, 0,
sizeof name);
1365 if (vendor_cfg_option) {
1368 vendor_cfg_option -> code);
1376 }
else if (vuname) {
1377 name.
data = (
unsigned char *)s;
1378 name.
len = strlen (s);
1381 name.
data = (
unsigned char *)s;
1388 have_encapsulation =
1390 (&encapsulation, packet, lease, client_state,
1391 in_options, cfg_options, scope, &name));
1406 if (!oc && !have_encapsulation) {
1415 lease, client_state, in_options,
1416 cfg_options, scope, oc,
MDL);
1435 if (have_encapsulation) {
1436 length += encapsulation.
len;
1446 struct buffer *bp = (
struct buffer *)0;
1491 unsigned incr = length;
1493 unsigned char *base;
1497 ((!six && !tix && (i == priority_len - 1) &&
1498 (bufix + 2 + length < bufend)) ||
1499 (bufix + 5 + length < bufend))) {
1503 }
else if (!splitup && first_cutoff &&
1504 (first_cutoff + six + 3 + length < sbufend)) {
1505 base = &buffer[first_cutoff];
1508 }
else if (!splitup && second_cutoff &&
1509 (second_cutoff + tix + 3 + length < buflen)) {
1510 base = &buffer[second_cutoff];
1517 if (bufix + 6 < bufend) {
1518 incr = bufend - bufix - 5;
1522 }
else if (first_cutoff &&
1523 (first_cutoff + six + 4 < sbufend)) {
1524 incr = sbufend - (first_cutoff + six) - 3;
1525 base = &buffer[first_cutoff];
1528 }
else if (second_cutoff &&
1529 (second_cutoff + tix + 4 < buflen)) {
1530 incr = buflen - (second_cutoff + tix) - 3;
1531 base = &buffer[second_cutoff];
1549 base [*pix + 1] = (
unsigned char)incr;
1550 if (tto && incr == length) {
1552 memcpy (base + *pix + 2,
1553 od.
data + ix, (
unsigned)(incr - 1));
1554 base [*pix + 2 + incr - 1] = 0;
1556 memcpy (base + *pix + 2,
1557 od.
data + ix, (
unsigned)incr);
1570 if (first_cutoff && six) {
1571 if ((first_cutoff + six + 1) < sbufend)
1572 memset (&buffer[first_cutoff + six + 1],
DHO_PAD,
1573 sbufend - (first_cutoff + six + 1));
1574 else if (first_cutoff + six >= sbufend)
1575 log_fatal(
"Second buffer overflow in overloaded options.");
1577 buffer[first_cutoff + six] =
DHO_END;
1582 if (second_cutoff && tix) {
1583 if (second_cutoff + tix + 1 < buflen) {
1584 memset (&buffer[second_cutoff + tix + 1],
DHO_PAD,
1585 buflen - (second_cutoff + tix + 1));
1586 }
else if (second_cutoff + tix >= buflen)
1587 log_fatal(
"Third buffer overflow in overloaded options.");
1589 buffer[second_cutoff + tix] =
DHO_END;
1594 if ((six || tix) && (bufix + 3 > bufend))
1595 log_fatal(
"Not enough space for option overload option.");
1611 while (*p !=
'\0') {
1635 log_error(
"format_has_text(%s): 'c' atoms are illegal " 1636 "except after 'D' atoms.", format);
1648 while ((*p !=
'\0') && (*p++ !=
'.'))
1671 const char *p, *name;
1677 while (*p !=
'\0') {
1703 log_fatal(
"Corrupt format: %s", format);
1706 if (espace == NULL) {
1707 log_error(
"Unknown enumeration: %s", format);
1712 min_len += espace->
width;
1713 last_size = espace->
width;
1727 min_len -= last_size;
1748 log_error(
"format_min_length(%s): 'c' atom is illegal " 1749 "except after 'D' atom.", format);
1754 log_error(
"format_min_length(%s): No safe value " 1755 "for unknown format symbols.", format);
1768 const
unsigned char *data;
1773 static char optbuf [32768];
1774 static char *endbuf = &optbuf[
sizeof(optbuf)];
1782 char fmtbuf[32] =
"";
1786 const unsigned char *dp = data;
1789 isc_boolean_t a_array = ISC_FALSE;
1791 unsigned int octets = 0;
1798 memset (enumbuf, 0,
sizeof enumbuf);
1800 if (option->format[0] !=
'R') {
1802 for (l = i = 0; option -> format [i]; i++, l++) {
1803 if (l >=
sizeof(fmtbuf) - 1)
1804 log_fatal(
"Bounds failure on internal buffer at " 1808 log_error (
"%s: Extra codes in format string: %s",
1810 &(option -> format [i]));
1814 fmtbuf [l] = option -> format [i];
1815 switch (option -> format [i]) {
1826 while (option -> format [i] &&
1827 option -> format [i] !=
'.')
1831 for (k = 0; k < len; k++) {
1832 if (!isascii (data [k]) ||
1833 !isprint (data [k]))
1839 if (k == len || (k + 1 == len && data [k] == 0)) {
1854 log_error(
"'c' atom not following D atom in format " 1855 "string: %s", option->format);
1863 if (option->format[i+1] ==
'c')
1877 while (option -> format [i] &&
1878 option -> format [i] !=
'.')
1883 if (enumbuf[l] == NULL) {
1887 hunksize += enumbuf[l]->
width;
1888 hunkinc = enumbuf[l]->
width;
1921 log_error (
"%s: garbage in format string: %s",
1923 &(option -> format [i]));
1929 if (hunksize - opthunk > len) {
1930 log_error (
"%s: expecting at least %d bytes; got %d",
1936 if (numhunk == -1 && hunksize < len)
1943 if (a_array == ISC_TRUE) {
1955 log_error (
"%s: invalid 'a' format: %s",
1956 option->name, option->format);
1960 numhunk = ((len - hunksize) / hunkinc) + 1;
1961 len_used = hunksize + ((numhunk - 1) * hunkinc);
1970 if (hunksize == 0) {
1971 log_error (
"%s: invalid 'A' format: %s",
1972 option->name, option->format);
1976 numhunk = len / hunksize;
1977 len_used = numhunk * hunksize;
1981 if (len_used < len) {
1982 log_error (
"%s: %d extra bytes at end of array\n",
2005 fmtbuf[0]=
'R'; fmtbuf[1]=
'I'; fmtbuf[2]=0;
2006 for (i =0; i < len; i = i + octets + 5) {
2008 log_error (
"wrong subnet mask width in destination descriptor");
2012 octets = ((data[i]+7) / 8);
2015 log_error (
"classless static routes option has wrong size or " 2016 "there's some garbage in format");
2021 for (i = 0; i < numhunk; i++) {
2022 if ((a_array == ISC_TRUE) && (i != 0) && (numelem > 0)) {
2039 for (; j < numelem; j++) {
2040 switch (fmtbuf [j]) {
2043 k = pretty_text(&op, endbuf - 1, &dp,
2044 data + len, emit_quotes);
2052 for( ; dp < (data + len) ; dp += k) {
2054 const unsigned char *nbp, *nend;
2056 nend = &nbuff[
sizeof(nbuff)];
2066 if (op + 2 > endbuf)
2095 pretty_domain(&op, endbuf-1,
2135 switch (enumbuf[j]->
width) {
2151 return "<double impossible condition>";
2157 if (enumbuf [j] ->
values [i].value ==
2162 dp += enumbuf[j]->
width;
2166 sprintf(op,
"%lu", tval);
2171 memcpy(iaddr.
iabuf, dp, 4);
2172 strcpy(op,
piaddr(iaddr));
2178 iaddr.
len = (((dp[0]+7)/8)+1);
2180 log_error (
"wrong subnet mask width in destination descriptor");
2184 memcpy(iaddr.
iabuf, dp, iaddr.
len);
2191 memcpy(iaddr.
iabuf, dp, 16);
2192 strcpy(op,
piaddr(iaddr));
2196 sprintf (op,
"%ld", (
long)
getLong (dp));
2202 sprintf (op,
"%s",
"infinite");
2204 sprintf(op,
"%lu", tval);
2212 sprintf (op,
"%d", (
int)
getShort (dp));
2216 sprintf(op,
"%u", (
unsigned)
getUShort(dp));
2220 sprintf (op,
"%d", *(
const char *)dp++);
2223 sprintf (op,
"%d", *dp++);
2227 sprintf (op,
"%x", *dp++);
2230 strcpy (op, *dp++ ?
"true" :
"false");
2233 strcpy (op,
"true");
2244 if (dp == data + len)
2246 if (j + 1 < numelem && comma !=
':')
2249 if (i + 1 < numhunk) {
2252 if (dp == data + len)
2259 in_options, cfg_options, options, scope, code,
file,
line)
2262 struct packet *packet;
2275 if (!universe -> lookup_func)
2277 oc = ((*universe -> lookup_func) (universe, options, code));
2281 in_options, cfg_options, scope, oc,
2294 in_options, cfg_options, options, scope, code,
file,
line)
2297 struct packet *packet;
2313 if ((options == NULL) || (universe->
lookup_func == NULL))
2317 oc = ((*universe->
lookup_func)(universe, options, code));
2322 memset(&d1, 0,
sizeof(d1));
2324 in_options, cfg_options, scope, oc,
2330 *result = d1.
data[0];
2342 enum statement_op op;
2349 case eval_statement:
2350 case break_statement:
2352 log_error (
"bogus statement type in set_option.");
2355 case default_option_statement:
2357 option -> option -> code);
2363 case supersede_option_statement:
2364 case send_option_statement:
2369 case append_option_statement:
2370 case prepend_option_statement:
2372 option -> option -> code);
2380 log_error (
"Can't allocate const expression.");
2392 if (op == append_option_statement) {
2413 switch (((memcmp(option->
option->
format,
"Dc", 2) == 0) +
2419 log_error (
"Both options must be Dc format");
2445 if (universe -> lookup_func)
2446 return (*universe -> lookup_func) (universe, options, code);
2448 log_error (
"can't look up options in %s space.",
2464 !(options ->
universes [universe -> index]))
2467 hash = options ->
universes [universe -> index];
2470 for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
2481 struct buffer *bp,
unsigned char *
buffer,
unsigned length,
2482 unsigned code,
int terminatep)
2487 status = prepare_option_buffer(universe, bp, buffer, length, code,
2505 struct buffer *bp,
unsigned char *
buffer,
unsigned length,
2506 unsigned code,
int terminatep)
2511 status = prepare_option_buffer(universe, bp, buffer, length, code,
2529 unsigned char *
buffer,
unsigned length,
unsigned code,
2532 struct buffer *lbp = NULL;
2548 if (code > 0xffffffff)
2553 log_fatal(
"Inconsistent universe tag size at %s:%d.",
MDL);
2556 option_code_hash_lookup(&option, universe->
code_hash, &code, 0,
MDL);
2566 char nbuf[
sizeof(
"unknown-4294967295")];
2568 sprintf(nbuf,
"unknown-%u", code);
2577 option->
code = code;
2584 log_error(
"No memory for option code %s.%s.",
2599 log_error (
"no memory for option buffer.");
2604 memcpy (lbp ->
data,
buffer, length + terminatep);
2615 op ->
data.len = length;
2624 op ->
data.terminated = 1;
2626 op ->
data.terminated = 0;
2636 while ((op->
data.
len > min_len) &&
2654 struct packet *dummy_packet,
2655 struct lease *dummy_lease,
2660 struct universe *dummy_universe,
2661 void *void_accumulator) {
2662 int *accumulator = (
int *)void_accumulator;
2669 struct packet *dummy_packet,
2670 struct lease *dummy_lease,
2675 struct universe *dummy_universe,
2719 memset(server_oro, 0,
sizeof(*server_oro));
2721 log_fatal(
"no memory to build server ORO");
2729 server_oro->
len = 0;
2742 server_oro->
len += 2;
2757 (*universe->
save_func)(universe, options, oc, ISC_FALSE);
2759 log_error(
"can't store options in %s space.", universe->
name);
2768 (*universe->
save_func)(universe, options, oc, ISC_TRUE);
2770 log_error(
"can't store options in %s space.", universe->
name);
2793 universe -> name, oc ->
option -> name);
2797 options ->
universes [universe -> index] = (
void *)hash;
2800 for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
2802 (bptr -> car)) ->
option -> code ==
2818 ocloc = &(*ocloc)->
next;
2819 }
while (*ocloc != NULL);
2832 log_error (
"No memory for option_cache reference.");
2835 bptr -> cdr = hash [hashix];
2838 hash [hashix] = bptr;
2842 struct universe *universe;
2846 if (universe -> delete_func)
2847 (*universe -> delete_func) (universe, options, code);
2849 log_error (
"can't delete options from %s space.",
2854 struct universe *universe;
2868 for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
2877 prev -> cdr = bptr -> cdr;
2879 hash [hashix] = bptr -> cdr;
2893 if (!ptr || !*ptr) {
2894 log_error (
"Null pointer in option_cache_dereference: %s(%d)",
2896 #if defined (POINTER_DEBUG) 2918 free_option_caches = *ptr;
2921 if ((*ptr) ->
refcnt < 0) {
2922 log_error (
"%s(%d): negative refcnt!", file, line);
2923 #if defined (DEBUG_RC_HISTORY) 2924 dump_rc_history (*ptr);
2926 #if defined (POINTER_DEBUG) 2939 struct universe *universe;
2956 for (cp = heads [i]; cp; cp =
next) {
2965 dfree (heads, file, line);
2966 state ->
universes [universe -> index] = (
void *)0;
2981 if (src->
len == 0 && option->
format[0] !=
'Z')
2984 memset(&tmp, 0,
sizeof(tmp));
3033 struct universe *subu=NULL;
3037 memset(&tmp, 0,
sizeof(tmp));
3040 in_options, cfg_options, scope, oc,
MDL)) {
3054 end = strchr(++start,
'.');
3059 if (end == NULL || start == end)
3063 start, end - start,
MDL);
3067 "refers to unknown " 3068 "option space '%.*s'.",
3070 (
int)(end - start), start);
3081 client_state, in_options,
3082 cfg_options, scope, subu);
3085 }
while (ISC_FALSE);
3097 in_options, cfg_options, scope,
name)
3099 struct packet *packet;
3107 struct universe *u = NULL;
3113 log_error(
"option_space_encapsulate: option space '%.*s' does " 3114 "not exist, but is configured.",
3120 if (u->
encapsulate(result, packet, lease, client_state,
3121 in_options, cfg_options, scope, u))
3124 log_error(
"encapsulation requested for '%s' with no support.",
3146 search_subencapsulation(
struct data_string *result,
struct packet *packet,
3151 struct universe *universe)
3154 struct universe *subu;
3157 memset(&sub, 0,
sizeof(sub));
3170 subu->
encapsulate(&sub, packet, lease, client_state,
3171 in_options, cfg_options,
3185 in_options, cfg_options, scope, universe)
3187 struct packet *packet;
3188 struct lease *lease;
3189 struct client_state *client_state;
3193 struct universe *universe;
3212 for (p = hash [i]; p; p = p -> cdr) {
3214 client_state, in_options, cfg_options,
3220 if (search_subencapsulation(result, packet, lease, client_state,
3221 in_options, cfg_options, scope, universe))
3228 in_options, cfg_options, scope, universe)
3230 struct packet *packet;
3231 struct lease *lease;
3232 struct client_state *client_state;
3236 struct universe *universe;
3252 for (ocp = head ->
first; ocp; ocp = ocp -> cdr) {
3254 lease, client_state, in_options,
3265 static unsigned char nni [] = { 1, 0 };
3267 memset (&ds, 0,
sizeof ds);
3272 if (!option_code_hash_lookup(&no_nwip->
option,
3275 log_fatal(
"Nwip option hash does not contain " 3280 client_state, in_options,
3281 cfg_options, scope, no_nwip))
3285 memset (&ds, 0,
sizeof ds);
3294 ds.
buffer -> data [0] = 2;
3295 ds.
buffer -> data [1] = 0;
3296 memcpy (&ds.
buffer -> data [2], result -> data, result -> len);
3312 fqdn_encode(
unsigned char *dst,
int dstlen,
const unsigned char *src,
3316 int i, j, len, outlen=0;
3319 for (i = 0, j = 0 ; i < srclen ; i = j) {
3320 while ((j < srclen) && (src[j] !=
'.') && (src[j] !=
'\0'))
3324 if ((outlen + 1 + len) > dstlen)
3334 memcpy(out, src + i, len);
3342 if ((outlen + 1) > dstlen)
3353 in_options, cfg_options, scope, universe)
3355 struct packet *packet;
3356 struct lease *lease;
3357 struct client_state *client_state;
3361 struct universe *universe;
3364 struct data_string results [FQDN_SUBOPTION_COUNT + 1];
3380 memset (results, 0,
sizeof results);
3381 for (ocp = head ->
first; ocp; ocp = ocp -> cdr) {
3383 if (oc ->
option -> code > FQDN_SUBOPTION_COUNT)
3387 packet, lease, client_state,
3388 in_options, cfg_options, scope,
3400 log_error (
"no memory for option buffer.");
3408 memset (&bp ->
data [0], 0, len);
3422 bp -> data [0] |= 2;
3425 bp -> data [0] |= 1;
3435 i = fqdn_encode(&bp->
data[3], len - 3,
3437 results[FQDN_FQDN].
len);
3445 result->terminated = 0;
3449 memcpy (&bp -> data [3], results [
FQDN_FQDN].data,
3452 result -> terminated = 0;
3457 if (results [i].len)
3506 struct client_state *client_state,
3510 struct universe *u,
void *stuff,
3514 struct client_state *,
3518 struct universe *,
void *))
3528 struct packet *packet,
struct lease *lease,
3529 struct client_state *client_state,
3533 struct universe *universe)
3538 unsigned char *
data;
3539 int i, len, rval = 0, count;
3540 struct data_string results[FQDN_SUBOPTION_COUNT + 1];
3549 memset(results, 0,
sizeof(results));
3550 for (ocp = head->
first ; ocp != NULL ; ocp = ocp->
cdr) {
3556 lease, client_state, in_options,
3557 cfg_options, scope, oc,
MDL);
3567 log_error(
"No memory for virtual option buffer.");
3600 count = fqdn_encode(data + 1, len - 1,
3609 result->
len += count;
3628 const unsigned char *
buffer,
unsigned length,
3631 struct buffer *bp = NULL;
3632 unsigned char *first_dot;
3633 int len, hlen, dlen;
3646 log_error(
"No memory for dhcp6.fqdn option buffer.");
3679 log_error(
"Unable to convert dhcp6.fqdn domain name to " 3686 unsigned char *fqdn_start = bp->
data + 3;
3692 first_dot = (
unsigned char *)strchr((
char *)fqdn_start,
'.');
3694 if (first_dot != NULL) {
3695 hlen = first_dot - fqdn_start;
3723 struct client_state *client_state,
3727 struct universe *u,
void *stuff,
3730 struct lease *,
struct client_state *,
3734 struct universe *,
void *))
3737 (*u ->
foreach) (packet, lease, client_state, in_options,
3738 cfg_options, scope, u, stuff, func);
3742 struct client_state *client_state,
3746 struct universe *u,
void *stuff,
3749 struct lease *,
struct client_state *,
3753 struct universe *,
void *),
3759 if (universe ->
foreach)
3760 (*universe ->
foreach) (packet, lease, client_state,
3761 in_options, cfg_options,
3762 scope, universe, stuff, func);
3766 struct client_state *client_state,
3770 struct universe *u,
void *stuff,
3774 struct client_state *,
3778 struct universe *,
void *))
3784 if (cfg_options -> universe_count <= u -> index)
3787 hash = cfg_options ->
universes [u -> index];
3793 for (p = hash [i]; p; p = p -> cdr) {
3795 (*func) (oc, packet, lease, client_state,
3796 in_options, cfg_options, scope, u, stuff);
3812 options ->
universes [universe -> index]);
3816 [universe -> index]),
MDL))
3819 options ->
universes [universe -> index]);
3823 for (tail = &head ->
first; *tail; tail = &((*tail) -> cdr)) {
3826 if (oc->
option->
code == (*ocloc)->option->code) {
3829 ocloc = &(*ocloc)->
next;
3830 }
while (*ocloc != NULL);
3839 *tail =
cons (0, 0);
3842 (&(*tail) -> car), oc,
MDL);
3847 in_options, cfg_options, scope, universe)
3849 struct packet *packet;
3850 struct lease *lease;
3851 struct client_state *client_state;
3855 struct universe *universe;
3864 cfg_options ->
universes [universe -> index]);
3868 for (oc = head ->
first; oc; oc = oc -> cdr) {
3870 lease, client_state, in_options, cfg_options,
3875 if (search_subencapsulation(result, packet, lease, client_state,
3876 in_options, cfg_options, scope, universe))
3883 struct universe *universe;
3893 options ->
universes [universe -> index]);
3897 for (tail = &head ->
first; *tail; tail = &((*tail) -> cdr)) {
3901 tmp = (*tail) -> cdr;
3903 (&(*tail) -> car),
MDL);
3912 struct universe *universe;
3922 options ->
universes [universe -> index]);
3926 for (oc = head ->
first; oc; oc = oc -> cdr) {
3937 struct universe *universe;
3948 struct client_state *client_state,
3952 struct universe *u,
void *stuff,
3956 struct client_state *,
3960 struct universe *,
void *))
3971 for (car = head ->
first; car; car = car -> cdr) {
3973 packet, lease, client_state,
3974 in_options, cfg_options, scope, u, stuff);
3978 void do_packet (interface, packet, len, from_port, from, hfrom)
3982 unsigned int from_port;
3987 struct packet *decoded_packet;
3988 #if defined (DEBUG_MEMORY_LEAKAGE) 3989 unsigned long previous_outstanding = dmalloc_outstanding;
3992 #if defined (TRACING) 3996 decoded_packet = NULL;
3998 log_error(
"do_packet: no memory for incoming packet!");
4001 decoded_packet->
raw = packet;
4005 interface_reference(&decoded_packet->
interface, interface,
MDL);
4006 decoded_packet->
haddr = hfrom;
4010 log_info(
"Discarding packet with bogus hlen.");
4033 memset(&dp, 0,
sizeof dp);
4035 decoded_packet->
options, NULL,
4047 dhcp(decoded_packet);
4049 bootp(decoded_packet);
4055 #if defined (DEBUG_MEMORY_LEAKAGE) 4056 log_info(
"generation %ld: %ld new, %ld outstanding, %ld long-term",
4058 dmalloc_outstanding - previous_outstanding,
4059 dmalloc_outstanding, dmalloc_longterm);
4060 dmalloc_dump_outstanding();
4062 #if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY) 4091 int len,
int from_port,
const struct iaddr *from,
4092 isc_boolean_t was_unicast) {
4093 unsigned char msg_type;
4099 struct packet *decoded_packet;
4100 #if defined (DEBUG_MEMORY_LEAKAGE) 4101 unsigned long previous_outstanding = dmalloc_outstanding;
4106 "short packet from %s port %d, len %d, dropped",
4107 piaddr(*from), from_port, len);
4111 decoded_packet = NULL;
4113 log_error(
"do_packet6: no memory for incoming packet.");
4118 log_error(
"do_packet6: no memory for options.");
4134 interface_reference(&decoded_packet->
interface, interface,
MDL);
4136 decoded_packet->
unicast = was_unicast;
4138 msg_type = packet[0];
4153 relay->
options, len - relaylen,
4206 #if defined (DEBUG_MEMORY_LEAKAGE) 4207 log_info(
"generation %ld: %ld new, %ld outstanding, %ld long-term",
4209 dmalloc_outstanding - previous_outstanding,
4210 dmalloc_outstanding, dmalloc_longterm);
4211 dmalloc_dump_outstanding();
4213 #if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY) 4221 const unsigned char *send)
4228 if (dst == NULL || dend == NULL || src == NULL || send == NULL ||
4229 *dst == NULL || *src == NULL || (*dst >= dend) || (*src > send) ||
4230 ((send - *src) > (dend - *dst)))
4233 for ( ; *src < send ; (*src)++) {
4234 if (!isascii (**src) || !isprint (**src)) {
4236 if ((*src + 1) != send || **src !=
'\0') {
4237 if (*dst + 4 > dend)
4240 sprintf(*dst,
"\\%03o",
4245 }
else if (**src ==
'"' || **src ==
'\'' || **src ==
'$' ||
4246 **src ==
'`' || **src ==
'\\' || **src ==
'|' ||
4248 if (*dst + 2 > dend)
4257 if (*dst + 1 > dend)
4270 pretty_text(
char **dst,
char *dend,
const unsigned char **src,
4271 const unsigned char *send,
int emit_quotes)
4275 if (dst == NULL || dend == NULL || src == NULL || send == NULL ||
4276 *dst == NULL || *src == NULL ||
4277 ((*dst + (emit_quotes ? 2 : 0)) > dend) || (*src > send))
4286 count =
pretty_escape(dst, dend - (emit_quotes ? 1 : 0), src, send);
4291 if (emit_quotes && (*dst < dend)) {
4303 pretty_domain(
char **dst,
char *dend,
const unsigned char **src,
4304 const unsigned char *send)
4306 const unsigned char *tend;
4310 if (dst == NULL || dend == NULL || src == NULL || send == NULL ||
4311 *dst == NULL || *src == NULL ||
4312 ((*dst + 2) > dend) || (*src >= send))
4331 tend = (*src) + tsiz;
4343 if ((status == -1) || ((*dst + 2) > dend))
4348 count += status + 1;
4364 unsigned int option_num,
4366 unsigned int data_len)
4376 &option_num, 0,
MDL)) {
4377 log_error(
"Attempting to add unknown option %d.", option_num);
4383 log_error(
"No memory for option cache adding %s (option %d).",
4384 option->
name, option_num);
4394 log_error(
"No memory for constant data adding %s (option %d).",
4395 option->
name, option_num);
4423 log_debug(
"Dropped DHCPv4 packet with zero-length client-id");
4426 }
else if (oc->
data.
len == 1) {
4433 log_debug(
"Accepted DHCPv4 packet with one-character client-id - " 4434 "a future version of ISC DHCP will reject this");
4444 log_debug(
"Dropped DHCPv4 packet with wrong " 4445 "(len == %d) pxe-client-id", oc->
data.
len);
4454 log_debug(
"Received DHCPv4 packet without client-id" 4455 " option and empty hlen field.");
4496 struct packet *packet;
4497 struct lease *lease;
4498 struct client_state *client_state;
4509 if ((packet == NULL) || (in_options == NULL) || (out_options == NULL))
4513 if (vendor_cfg_option == NULL)
4518 out_options, vendor_cfg_option->
code);
4522 memset(&name, 0,
sizeof(name));
4524 in_options, out_options, scope, oc,
MDL);
4534 if ((oc == NULL) || (oc->
data.
len == 0)) {
4550 (
const char *)name.
data);
struct option_cache * lookup_hashed_option(struct universe *universe, struct option_state *options, unsigned code)
void do_packet6(struct interface_info *, const char *, int, int, const struct iaddr *, isc_boolean_t)
#define rc_register(file, line, reference, addr, refcnt, d, f)
#define DHCP_FIXED_NON_UDP
int parse_encapsulated_suboptions(struct option_state *options, struct option *eopt, const unsigned char *buffer, unsigned len, struct universe *eu, const char *uname)
unsigned char peer_address[16]
int fqdn_option_space_encapsulate(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
void set_option(struct universe *universe, struct option_state *options, struct option_cache *option, enum statement_op op)
#define DHO_DHCP_AGENT_OPTIONS
char sname[DHCP_SNAME_LEN]
struct binding_scope * global_scope
void save_linked_option(struct universe *universe, struct option_state *options, struct option_cache *oc, isc_boolean_t appendp)
void(* save_func)(struct universe *, struct option_state *, struct option_cache *, isc_boolean_t)
struct universe * universe
void save_option(struct universe *universe, struct option_state *options, struct option_cache *oc)
u_int32_t(* get_length)(const unsigned char *)
const char * piaddr(const struct iaddr addr)
int MRns_name_ntop(const u_char *src, char *dst, size_t dstsiz)
#define FQDN_NO_CLIENT_UPDATE
#define DHCP_MIN_OPTION_LEN
#define DHO_PXE_CLIENT_ID
unsigned char dhcpv6_transaction_id[3]
int append_option(struct data_string *dst, struct universe *universe, struct option *option, struct data_string *src)
unsigned char options[FLEXIBLE_ARRAY_MEMBER]
int format_has_text(char *format) const
void delete_linked_option(struct universe *universe, struct option_state *options, int code)
int hashed_option_space_encapsulate(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
int option_cache_dereference(struct option_cache **ptr, const char *file, int line)
int expression_allocate(struct expression **cptr, const char *file, int line)
int store_option(struct data_string *result, struct universe *universe, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct option_cache *oc)
struct enumeration * find_enumeration(const char *name, int length)
int int int log_debug(const char *,...) __attribute__((__format__(__printf__
struct option_cache * free_option_caches
void parse_vendor_option(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *out_options, struct binding_scope **scope)
Parse a vendor option (option 43)
pair new_pair(char *file, int line) const
#define DHO_DHCP_LEASE_TIME
int option_reference(struct option **dest, struct option *src, const char *file, int line)
struct universe dhcp_universe
int fqdn_universe_decode(struct option_state *options, const unsigned char *buffer, unsigned length, struct universe *u)
struct universe * find_option_universe(struct option *eopt, const char *uname)
void data_string_forget(struct data_string *data, const char *file, int line)
struct option_cache * next
void bootp(struct packet *packet)
const char * pretty_print_option(struct option *option, const unsigned char *data, unsigned len, int emit_commas, int emit_quotes)
#define FQDN_SUBOPTION_COUNT
int option_cache_reference(struct option_cache **ptr, struct option_cache *src, const char *file, int line)
void also_save_option(struct universe *universe, struct option_state *options, struct option_cache *oc)
void delete_option(struct universe *universe, struct option_state *options, int code)
int log_error(const char *,...) __attribute__((__format__(__printf__
struct option_cache *(* lookup_func)(struct universe *, struct option_state *, unsigned)
#define DHO_DHCP_REBINDING_TIME
#define DHCPV6_DHCPV4_QUERY
#define DHO_DOMAIN_NAME_SERVERS
int option_space_encapsulate(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct data_string *name)
int fqdn6_universe_decode(struct option_state *options, const unsigned char *buffer, unsigned length, struct universe *u)
const char * pdestdesc(const struct iaddr addr)
struct expression * expression
void build_server_oro(struct data_string *server_oro, struct option_state *options, const char *file, int line)
int(* decode)(struct option_state *, const unsigned char *, unsigned, struct universe *)
#define DHO_ASSOCIATED_IP
struct option_state * options
unsigned char dhcpv6_hop_count
void do_packet(struct interface_info *interface, struct dhcp_packet *packet, unsigned len, unsigned int from_port, struct iaddr from, struct hardware *hfrom)
unsigned char link_address[16]
void expression_dereference(struct expression **eptr, const char *file, int line)
unsigned char dhcpv6_msg_type
void data_string_truncate(struct data_string *dp, int len)
#define DHO_DHCP_SERVER_IDENTIFIER
void log_fatal(const char *,...) __attribute__((__format__(__printf__
#define DHCPV6_RELAY_REPL
int parse_option_buffer(struct option_state *options, const unsigned char *buffer, unsigned length, struct universe *universe)
int buffer_reference(struct buffer **ptr, struct buffer *bp, const char *file, int line)
int option_cache_allocate(struct option_cache **cptr, const char *file, int line)
struct universe vsio_universe
universe_hash_t * universe_hash
int linked_option_state_dereference(struct universe *universe, struct option_state *state, const char *file, int line)
int option_state_allocate(struct option_state **ptr, const char *file, int line)
int evaluate_option_cache(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct option_cache *oc, const char *file, int line)
struct option_cache * lookup_fqdn6_option(struct universe *universe, struct option_state *options, unsigned code)
#define DHCPV6_DHCPV4_RESPONSE
int32_t getShort(const unsigned char *)
int option_chain_head_dereference(struct option_chain_head **ptr, const char *file, int line)
int32_t getLong(const unsigned char *)
#define DHCP_MAX_OPTION_LEN
void delete_hashed_option(struct universe *universe, struct option_state *options, int code)
void(* store_length)(unsigned char *, u_int32_t)
void linked_option_space_foreach(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
int fqdn6_option_space_encapsulate(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
int buffer_allocate(struct buffer **ptr, unsigned len, const char *file, int line)
char * default_option_format
struct interface_info * interface
struct enumeration_value * values
void putULong(unsigned char *, u_int32_t)
void delete_fqdn6_option(struct universe *universe, struct option_state *options, int code)
void save_hashed_option(struct universe *universe, struct option_state *options, struct option_cache *oc, isc_boolean_t appendp)
int linked_option_space_encapsulate(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
int make_concat(struct expression **expr, struct expression *left, struct expression *right)
#define DHCPV6_RELAY_FORW
int pretty_escape(char **dst, char *dend, const unsigned char **src, const unsigned char *send)
int cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, struct lease *lease, struct client_state *client_state, int mms, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, int overload_avail, int terminate, int bootpp, struct data_string *prl, const char *vuname)
int save_option_buffer(struct universe *universe, struct option_state *options, struct buffer *bp, unsigned char *buffer, unsigned length, unsigned code, int terminatep)
u_int32_t getUShort(const unsigned char *)
int hashed_option_state_dereference(struct universe *universe, struct option_state *state, const char *file, int line)
struct option * new_option(char *name, const char *file, int line) const
void dfree(void *, const char *, int)
int add_option(struct option_state *options, unsigned int option_num, void *data, unsigned int data_len)
#define DHO_CLASSLESS_STATIC_ROUTES
int store_options(int *ocount, unsigned char *buffer, unsigned index, unsigned buflen, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, unsigned *priority_list, int priority_len, unsigned first_cutoff, int second_cutoff, int terminate, const char *vuname)
struct option_cache * lookup_option(struct universe *universe, struct option_state *options, unsigned code)
int int log_info(const char *,...) __attribute__((__format__(__printf__
int packet6_len_okay(const char *packet, int len)
void * dmalloc(size_t, const char *, int)
int parse_options(struct packet *packet)
unsigned char dhcp4o6_flags[3]
u_int32_t getULong(const unsigned char *)
#define DHO_SUBNET_SELECTION
int validate_packet(struct packet *packet)
#define DHO_DHCP_MAX_MESSAGE_SIZE
int get_option(struct data_string *result, struct universe *universe, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct option_state *options, struct binding_scope **scope, unsigned code, const char *file, int line)
void fqdn6_option_space_foreach(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
struct universe ** universes
int store_options6(char *buf, int buflen, struct option_state *opt_state, struct packet *packet, const int *required_opts, struct data_string *oro)
int append_option_buffer(struct universe *universe, struct option_state *options, struct buffer *bp, unsigned char *buffer, unsigned length, unsigned code, int terminatep)
u_int32_t getUChar(const unsigned char *)
void suboption_foreach(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *), struct option_cache *oc, const char *vsname)
void option_space_foreach(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
void dhcpv6(struct packet *)
struct universe dhcpv6_universe
int format_min_length(char *format, struct option_cache *oc) const
int make_const_data(struct expression **expr, const unsigned char *data, unsigned len, int terminated, int allocate, const char *file, int line)
void free_pair(pair foo, const char *file, int line)
int packet_dereference(struct packet **ptr, const char *file, int line)
int packet_allocate(struct packet **ptr, const char *file, int line)
int option_chain_head_allocate(struct option_chain_head **ptr, const char *file, int line)
#define FQDN_SERVER_UPDATE
#define dmalloc_reuse(x, y, l, z)
unsigned char transaction_id[3]
int(* encapsulate)(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *)
u_int32_t(* get_tag)(const unsigned char *)
void save_fqdn6_option(struct universe *universe, struct option_state *options, struct option_cache *oc, isc_boolean_t appendp)
int MRns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src, u_char *dst, size_t dstsiz)
void hashed_option_space_foreach(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
struct universe fqdn_universe
void dhcp(struct packet *packet)
int nwip_option_space_encapsulate(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
#define DHO_DHCP_OPTION_OVERLOAD
option_code_hash_t * code_hash
pair cons(caddr_t car, pair cdr)
#define DHO_DHCP_RENEWAL_TIME
struct in6_addr dhcpv6_peer_address
#define DHO_DHCP_CLIENT_IDENTIFIER
void trace_inpacket_stash(struct interface_info *, struct dhcp_packet *, unsigned, unsigned int, struct iaddr, struct hardware *)
void putUShort(unsigned char *, u_int32_t)
struct universe nwip_universe
unsigned char options[FLEXIBLE_ARRAY_MEMBER]
const unsigned char * data
int get_option_int(int *result, struct universe *universe, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct option_state *options, struct binding_scope **scope, unsigned code, const char *file, int line)
#define DHO_DHCP_MESSAGE_TYPE
struct option * vendor_cfg_option
void data_string_copy(struct data_string *dest, const struct data_string *src, const char *file, int line)
void(* store_tag)(unsigned char *, u_int32_t)
struct in6_addr dhcpv6_link_address
unsigned char options[FLEXIBLE_ARRAY_MEMBER]
#define DHCP_OPTIONS_COOKIE
int option_dereference(struct option **dest, const char *file, int line)
#define DHO_VENDOR_ENCAPSULATED_OPTIONS
unsigned char options[DHCP_MAX_OPTION_LEN]
#define DHO_DHCP_REQUESTED_ADDRESS
int buffer_dereference(struct buffer **ptr, const char *file, int line)
struct option_cache * lookup_linked_option(struct universe *universe, struct option_state *options, unsigned code)
#define compute_option_hash(x)