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;
60 packet -> options_valid = 0;
67 &packet -> raw -> options [4],
68 (packet -> packet_length -
102 (
unsigned char *)packet -> raw ->
file,
103 sizeof packet -> raw ->
file,
110 (
unsigned char *)packet -> raw -> sname,
111 sizeof packet -> raw -> sname,
116 packet -> options_valid = 1;
125 const unsigned char *
buffer;
129 unsigned len, offset;
134 char *reason =
"general failure";
137 log_error (
"no memory for option buffer.");
140 memcpy (bp -> data,
buffer, length);
143 (offset + universe->
tag_size) <= length &&
153 reason =
"code tag at end of buffer - missing " 170 log_fatal(
"Improperly configured option space(%s): " 171 "may not have a nonzero length size " 172 "AND a NULL get_length function.",
181 option_code_hash_lookup(&option, universe->
code_hash, &code,
185 if (offset + len > length) {
186 reason =
"option length exceeds option buffer length";
188 log_error(
"parse_option_buffer: malformed option " 189 "%s.%s (code %u): %s.", universe->
name,
190 option ? option->
name :
"<unknown>",
201 (option->
format[0] ==
'e' ||
202 option->
format[0] ==
'E') &&
204 bp->
data + offset, len,
210 memset(&
new, 0,
sizeof new);
224 bp->
data + offset, len);
226 new.data =
new.buffer->data;
231 }
else if (op != NULL) {
235 while (op->
next != NULL)
247 nop->data.buffer = NULL;
249 nop->data.data = bp->
data + offset;
256 bp->
data + offset, len,
259 "save_option_buffer failed");
281 struct universe *universe = (
struct universe *)0;
284 s = strchr (eopt -> format,
'E');
286 log_error (
"internal encapsulation format error 1.");
290 t = strchr (++s,
'.');
294 log_error (
"internal encapsulation format error 2.");
297 if (t == s && uname) {
308 s, (
unsigned)(t - s))) {
324 const unsigned char *
buffer,
325 unsigned len,
struct universe *eu,
342 i = (*universe ->
decode) (options, buffer, len, universe);
345 if (eopt -> format [0] !=
'E')
352 const unsigned char *
buffer,
353 unsigned length,
struct universe *u)
355 struct buffer *bp = (
struct buffer *)0;
363 log_error (
"no memory for option buffer.");
366 memcpy (&bp ->
data [3], buffer + 1, length - 1);
395 if (!bp ->
data [0]) {
399 if (buffer [length - 1] == 0) {
407 for (i = 3; i < length && buffer [i] !=
'.'; i++);
418 if (length > 4 + i &&
420 &bp ->
data[6 + i], length - 4 - i,
426 &bp ->
data [5], length - 3,
432 unsigned total_len = 0;
433 unsigned first_len = 0;
439 while (s < &bp ->
data[0] + length + 2) {
442 log_info (
"fancy bits in fqdn option");
449 if (s + len > &bp ->
data [0] + length + 3) {
450 log_info (
"fqdn tag longer than buffer");
454 if (first_len == 0) {
460 total_len += len + 1;
471 first_len = total_len;
476 &bp ->
data[6], first_len,
479 if (total_len > 0 && first_len != total_len) {
481 &bp->
data[6 + first_len],
482 total_len - first_len,
488 &bp ->
data [6], total_len,
528 int overload_avail,
int terminate,
int bootpp,
531 #define PRIORITY_COUNT 300 534 unsigned char buffer[4096], agentopts[1024];
536 unsigned mb_size = 0, mb_max = 0;
537 unsigned option_size = 0, agent_size = 0;
543 int overload_used = 0;
544 int of1 = 0, of2 = 0;
546 memset(&ds, 0,
sizeof ds);
559 client_state, in_options,
560 cfg_options, scope, op,
MDL) != 0)) {
561 if (ds.
len >= sizeof (u_int16_t)) {
563 if(!mms || (i < mms))
595 if (inpacket != NULL &&
607 if (client_state == NULL) {
612 inpacket, lease, client_state,
613 in_options, cfg_options, scope,
614 priority_list, priority_len,
617 mb_size += agent_size;
628 if (overload_avail & 1) {
633 if (overload_avail & 2) {
654 if (prl != NULL && prl->
len > 0) {
658 priority_list[priority_len++] =
668 for (i = 0; i < prl->
len; i++) {
674 priority_list[priority_len++] = prl->
data[i];
686 priority_list[priority_len++] =
DHO_FQDN;
717 priority_list[priority_len++] =
DHO_FQDN;
732 for (pp = hash[i]; pp; pp = pp->cdr) {
738 priority_list[priority_len++] =
753 for (pp = hash[i]; pp; pp = pp->cdr) {
759 priority_list[priority_len++] =
774 priority_list[priority_len++] =
784 priority_list[priority_len++] =
793 option_size =
store_options(&overload_used, buffer, index, mb_max,
794 inpacket, lease, client_state,
795 in_options, cfg_options, scope,
796 priority_list, priority_len,
797 of1, of2, terminate, vuname);
800 if (option_size == 0)
804 index += option_size;
811 if (mb_size - agent_size - index < 3)
816 buffer[index++] = overload_used;
818 if (overload_used & 1)
821 if (overload_used & 2)
827 if (mb_size - index >= agent_size) {
828 memcpy(&buffer[index], agentopts, agent_size);
831 log_error(
"Unable to store relay agent information " 840 memcpy(outpacket->
options, buffer, index);
864 struct packet *packet,
865 struct lease *dummy_lease,
870 struct universe *universe,
871 void *void_vsio_state) {
876 memset(&ds, 0,
sizeof(ds));
878 NULL, opt_state, NULL,
884 }
else if (universe->
tag_size == 2) {
888 }
else if (universe->
tag_size == 4) {
907 log_debug(
"No space for option %d in VSIO space %s.",
912 log_error(
"Error evaluating option %d in VSIO space %s.",
927 struct packet *packet,
928 const int *required_opts,
937 int in_required_opts;
938 int vsio_option_code;
949 vsio_option_code = 0;
953 vsio_option_code = o->
code;
958 if (vsio_option_code == 0) {
962 if (required_opts != NULL) {
963 for (i=0; required_opts[i] != 0; i++) {
964 if (required_opts[i] == vsio_option_code) {
969 opt_state, required_opts[i]);
973 memset(&ds, 0,
sizeof(ds));
974 for (; oc != NULL ; oc = oc->
next) {
981 tmp = (
unsigned char *)buf;
989 memcpy(tmp+4, ds.
data, ds.
len);
991 bufpos += (4 + ds.
len);
1009 oro_size = oro->
len / 2;
1011 for (i=0; i<oro_size; i++) {
1012 memcpy(&code, oro->
data+(i*2), 2);
1019 in_required_opts = 0;
1020 if (required_opts != NULL) {
1021 for (j=0; required_opts[j] != 0; j++) {
1022 if (required_opts[j] == code) {
1023 in_required_opts = 1;
1028 if (in_required_opts) {
1035 if (code == vsio_option_code) {
1043 memset(&ds, 0,
sizeof(ds));
1044 for (; oc != NULL ; oc = oc->
next) {
1048 if ((ds.
len + 4) <= (buflen - bufpos)) {
1049 tmp = (
unsigned char *)buf + bufpos;
1055 memcpy(tmp+4, ds.
data, ds.
len);
1057 bufpos += (4 + ds.
len);
1064 log_error(
"Error evaluating option %d", code);
1093 if (vs.bufpos > bufpos+8) {
1094 tmp = (
unsigned char *)buf +
1099 vs.bufpos-bufpos-4);
1118 unsigned char *
buffer,
unsigned index,
unsigned buflen,
1124 unsigned *priority_list,
int priority_len,
1125 unsigned first_cutoff,
int second_cutoff,
int terminate,
1128 int bufix = 0, six = 0, tix = 0;
1132 int bufend, sbufend;
1143 buffer = &buffer[index];
1146 first_cutoff -= index;
1148 second_cutoff -= index;
1151 bufend = sbufend =
buflen;
1153 if (first_cutoff >= buflen)
1154 log_fatal(
"%s:%d:store_options: Invalid first cutoff.",
MDL);
1155 bufend = first_cutoff;
1157 if (second_cutoff) {
1158 if (second_cutoff >= buflen)
1159 log_fatal(
"%s:%d:store_options: Invalid second cutoff.",
1161 sbufend = second_cutoff;
1163 }
else if (second_cutoff) {
1164 if (second_cutoff >= buflen)
1165 log_fatal(
"%s:%d:store_options: Invalid second cutoff.",
MDL);
1166 bufend = second_cutoff;
1169 memset (&od, 0,
sizeof od);
1174 for (i = 0; i < priority_len - 1; i++) {
1177 for (ix = i + 1; ix < priority_len + tto; ix++) {
1179 priority_list [ix - tto] =
1181 if (priority_list [i] == priority_list [ix]) {
1199 for (ix = i - 1 ; ix >= 0 ; ix--) {
1212 for (i = 0; i < priority_len; i++) {
1216 int optstart, soptstart, toptstart;
1218 int have_encapsulation = 0;
1222 memset (&encapsulation, 0,
sizeof encapsulation);
1223 have_encapsulation = 0;
1229 code = priority_list [i];
1233 if (code >= cfg_options -> site_code_min)
1234 u =
universes [cfg_options -> site_universe];
1243 option_code_hash_lookup(&option, u->
code_hash, &code, 0,
MDL);
1253 if ((option != NULL) &&
1254 (((oc == NULL) && (option->
format[0] ==
'E')) ||
1255 ((oc != NULL) && (option->
format[0] ==
'e')))) {
1260 s = strchr (option->
format,
'E');
1262 t = strchr (++s,
'.');
1264 memset (&name, 0,
sizeof name);
1269 if (vendor_cfg_option) {
1272 vendor_cfg_option -> code);
1280 }
else if (vuname) {
1281 name.
data = (
unsigned char *)s;
1282 name.
len = strlen (s);
1285 name.
data = (
unsigned char *)s;
1292 have_encapsulation =
1294 (&encapsulation, packet, lease, client_state,
1295 in_options, cfg_options, scope, &name));
1310 if (!oc && !have_encapsulation) {
1319 lease, client_state, in_options,
1320 cfg_options, scope, oc,
MDL);
1339 if (have_encapsulation) {
1340 length += encapsulation.
len;
1350 struct buffer *bp = (
struct buffer *)0;
1395 unsigned incr = length;
1397 unsigned char *base;
1401 ((!six && !tix && (i == priority_len - 1) &&
1402 (bufix + 2 + length < bufend)) ||
1403 (bufix + 5 + length < bufend))) {
1407 }
else if (!splitup && first_cutoff &&
1408 (first_cutoff + six + 3 + length < sbufend)) {
1409 base = &buffer[first_cutoff];
1412 }
else if (!splitup && second_cutoff &&
1413 (second_cutoff + tix + 3 + length < buflen)) {
1414 base = &buffer[second_cutoff];
1421 if (bufix + 6 < bufend) {
1422 incr = bufend - bufix - 5;
1426 }
else if (first_cutoff &&
1427 (first_cutoff + six + 4 < sbufend)) {
1428 incr = sbufend - (first_cutoff + six) - 3;
1429 base = &buffer[first_cutoff];
1432 }
else if (second_cutoff &&
1433 (second_cutoff + tix + 4 < buflen)) {
1434 incr = buflen - (second_cutoff + tix) - 3;
1435 base = &buffer[second_cutoff];
1453 base [*pix + 1] = (
unsigned char)incr;
1454 if (tto && incr == length) {
1456 memcpy (base + *pix + 2,
1457 od.
data + ix, (
unsigned)(incr - 1));
1458 base [*pix + 2 + incr - 1] = 0;
1460 memcpy (base + *pix + 2,
1461 od.
data + ix, (
unsigned)incr);
1474 if (first_cutoff && six) {
1475 if ((first_cutoff + six + 1) < sbufend)
1476 memset (&buffer[first_cutoff + six + 1],
DHO_PAD,
1477 sbufend - (first_cutoff + six + 1));
1478 else if (first_cutoff + six >= sbufend)
1479 log_fatal(
"Second buffer overflow in overloaded options.");
1481 buffer[first_cutoff + six] =
DHO_END;
1486 if (second_cutoff && tix) {
1487 if (second_cutoff + tix + 1 < buflen) {
1488 memset (&buffer[second_cutoff + tix + 1],
DHO_PAD,
1489 buflen - (second_cutoff + tix + 1));
1490 }
else if (second_cutoff + tix >= buflen)
1491 log_fatal(
"Third buffer overflow in overloaded options.");
1493 buffer[second_cutoff + tix] =
DHO_END;
1498 if ((six || tix) && (bufix + 3 > bufend))
1499 log_fatal(
"Not enough space for option overload option.");
1515 while (*p !=
'\0') {
1539 log_error(
"format_has_text(%s): 'c' atoms are illegal " 1540 "except after 'D' atoms.", format);
1552 while ((*p !=
'\0') && (*p++ !=
'.'))
1575 const char *p, *name;
1581 while (*p !=
'\0') {
1607 log_fatal(
"Corrupt format: %s", format);
1610 if (espace == NULL) {
1611 log_error(
"Unknown enumeration: %s", format);
1616 min_len += espace->
width;
1617 last_size = espace->
width;
1631 min_len -= last_size;
1652 log_error(
"format_min_length(%s): 'c' atom is illegal " 1653 "except after 'D' atom.", format);
1658 log_error(
"format_min_length(%s): No safe value " 1659 "for unknown format symbols.", format);
1672 const unsigned char *data;
1677 static char optbuf [32768];
1678 static char *endbuf = &optbuf[
sizeof(optbuf)];
1686 char fmtbuf[32] =
"";
1690 const unsigned char *dp = data;
1693 isc_boolean_t a_array = ISC_FALSE;
1695 unsigned int octets = 0;
1702 memset (enumbuf, 0,
sizeof enumbuf);
1704 if (option->
format[0] !=
'R') {
1706 for (l = i = 0; option -> format [i]; i++, l++) {
1707 if (l >=
sizeof(fmtbuf) - 1)
1708 log_fatal(
"Bounds failure on internal buffer at " 1712 log_error (
"%s: Extra codes in format string: %s",
1714 &(option -> format [i]));
1718 fmtbuf [l] = option -> format [i];
1719 switch (option -> format [i]) {
1730 while (option -> format [i] &&
1731 option -> format [i] !=
'.')
1735 for (k = 0; k < len; k++) {
1736 if (!isascii (data [k]) ||
1737 !isprint (data [k]))
1743 if (k == len || (k + 1 == len && data [k] == 0)) {
1758 log_error(
"'c' atom not following D atom in format " 1759 "string: %s", option->
format);
1767 if (option->
format[i+1] ==
'c')
1781 while (option -> format [i] &&
1782 option -> format [i] !=
'.')
1787 if (enumbuf[l] == NULL) {
1791 hunksize += enumbuf[l]->
width;
1792 hunkinc = enumbuf[l]->
width;
1825 log_error (
"%s: garbage in format string: %s",
1827 &(option -> format [i]));
1833 if (hunksize - opthunk > len) {
1834 log_error (
"%s: expecting at least %d bytes; got %d",
1840 if (numhunk == -1 && hunksize < len)
1847 if (a_array == ISC_TRUE) {
1855 numhunk = ((len - hunksize) / hunkinc) + 1;
1856 len_used = hunksize + ((numhunk - 1) * hunkinc);
1862 numhunk = len / hunksize;
1863 len_used = numhunk * hunksize;
1867 if (len_used < len) {
1868 log_error (
"%s: %d extra bytes at end of array\n",
1891 fmtbuf[0]=
'R'; fmtbuf[1]=
'I'; fmtbuf[2]=0;
1892 for (i =0; i < len; i = i + octets + 5) {
1894 log_error (
"wrong subnet mask width in destination descriptor");
1898 octets = ((data[i]+7) / 8);
1901 log_error (
"classless static routes option has wrong size or " 1902 "there's some garbage in format");
1907 for (i = 0; i < numhunk; i++) {
1908 if ((a_array == ISC_TRUE) && (i != 0) && (numelem > 0)) {
1925 for (; j < numelem; j++) {
1926 switch (fmtbuf [j]) {
1929 k = pretty_text(&op, endbuf - 1, &dp,
1930 data + len, emit_quotes);
1938 for( ; dp < (data + len) ; dp += k) {
1940 const unsigned char *nbp, *nend;
1942 nend = &nbuff[
sizeof(nbuff)];
1952 if (op + 2 > endbuf)
1981 pretty_domain(&op, endbuf-1,
2021 switch (enumbuf[j]->
width) {
2037 return "<double impossible condition>";
2043 if (enumbuf [j] ->
values [i].value ==
2048 dp += enumbuf[j]->
width;
2052 sprintf(op,
"%lu", tval);
2057 memcpy(iaddr.
iabuf, dp, 4);
2058 strcpy(op,
piaddr(iaddr));
2064 iaddr.
len = (((dp[0]+7)/8)+1);
2066 log_error (
"wrong subnet mask width in destination descriptor");
2070 memcpy(iaddr.
iabuf, dp, iaddr.
len);
2077 memcpy(iaddr.
iabuf, dp, 16);
2078 strcpy(op,
piaddr(iaddr));
2082 sprintf (op,
"%ld", (
long)
getLong (dp));
2088 sprintf (op,
"%s",
"infinite");
2090 sprintf(op,
"%lu", tval);
2098 sprintf (op,
"%d", (
int)
getShort (dp));
2102 sprintf(op,
"%u", (
unsigned)
getUShort(dp));
2106 sprintf (op,
"%d", *(
const char *)dp++);
2109 sprintf (op,
"%d", *dp++);
2113 sprintf (op,
"%x", *dp++);
2116 strcpy (op, *dp++ ?
"true" :
"false");
2119 strcpy (op,
"true");
2130 if (dp == data + len)
2132 if (j + 1 < numelem && comma !=
':')
2135 if (i + 1 < numhunk) {
2138 if (dp == data + len)
2145 in_options, cfg_options, options, scope, code,
file,
line)
2147 struct universe *universe;
2148 struct packet *packet;
2161 if (!universe -> lookup_func)
2163 oc = ((*universe -> lookup_func) (universe, options, code));
2167 in_options, cfg_options, scope, oc,
2174 struct universe *universe;
2177 enum statement_op op;
2184 case eval_statement:
2185 case break_statement:
2187 log_error (
"bogus statement type in set_option.");
2190 case default_option_statement:
2192 option -> option -> code);
2198 case supersede_option_statement:
2199 case send_option_statement:
2204 case append_option_statement:
2205 case prepend_option_statement:
2207 option -> option -> code);
2215 log_error (
"Can't allocate const expression.");
2227 if (op == append_option_statement) {
2250 struct universe *universe;
2256 if (universe -> lookup_func)
2257 return (*universe -> lookup_func) (universe, options, code);
2259 log_error (
"can't look up options in %s space.",
2265 struct universe *universe;
2275 !(options ->
universes [universe -> index]))
2278 hash = options ->
universes [universe -> index];
2281 for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
2282 if (((
struct option_cache *)(bptr -> car)) -> option -> code ==
2292 struct buffer *bp,
unsigned char *
buffer,
unsigned length,
2293 unsigned code,
int terminatep)
2298 status = prepare_option_buffer(universe, bp, buffer, length, code,
2316 struct buffer *bp,
unsigned char *
buffer,
unsigned length,
2317 unsigned code,
int terminatep)
2322 status = prepare_option_buffer(universe, bp, buffer, length, code,
2339 prepare_option_buffer(
struct universe *universe,
struct buffer *bp,
2340 unsigned char *
buffer,
unsigned length,
unsigned code,
2343 struct buffer *lbp = NULL;
2344 struct option *option = NULL;
2359 if (code > 0xffffffff)
2364 log_fatal(
"Inconsistent universe tag size at %s:%d.",
MDL);
2367 option_code_hash_lookup(&option, universe->
code_hash, &code, 0,
MDL);
2377 char nbuf[
sizeof(
"unknown-4294967295")];
2379 sprintf(nbuf,
"unknown-%u", code);
2388 option->
code = code;
2395 log_error(
"No memory for option code %s.%s.",
2410 log_error (
"no memory for option buffer.");
2415 memcpy (lbp ->
data,
buffer, length + terminatep);
2426 op ->
data.len = length;
2435 op ->
data.terminated = 1;
2437 op ->
data.terminated = 0;
2447 while ((op->
data.
len > min_len) &&
2465 struct packet *dummy_packet,
2466 struct lease *dummy_lease,
2467 struct client_state *dummy_client_state,
2471 struct universe *dummy_universe,
2472 void *void_accumulator) {
2473 int *accumulator = (
int *)void_accumulator;
2480 struct packet *dummy_packet,
2481 struct lease *dummy_lease,
2482 struct client_state *dummy_client_state,
2486 struct universe *dummy_universe,
2530 memset(server_oro, 0,
sizeof(*server_oro));
2532 log_fatal(
"no memory to build server ORO");
2540 server_oro->
len = 0;
2550 tmp = server_oro->buffer->data;
2553 server_oro->len += 2;
2568 (*universe->
save_func)(universe, options, oc, ISC_FALSE);
2570 log_error(
"can't store options in %s space.", universe->
name);
2579 (*universe->
save_func)(universe, options, oc, ISC_TRUE);
2581 log_error(
"can't store options in %s space.", universe->
name);
2604 universe -> name, oc -> option -> name);
2608 options ->
universes [universe -> index] = (
void *)hash;
2611 for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
2613 (bptr -> car)) -> option -> code ==
2614 oc -> option -> code)
2629 ocloc = &(*ocloc)->
next;
2630 }
while (*ocloc != NULL);
2643 log_error (
"No memory for option_cache reference.");
2646 bptr -> cdr = hash [hashix];
2649 hash [hashix] = bptr;
2653 struct universe *universe;
2657 if (universe -> delete_func)
2658 (*universe -> delete_func) (universe, options, code);
2660 log_error (
"can't delete options from %s space.",
2665 struct universe *universe;
2679 for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
2680 if (((
struct option_cache *)(bptr -> car)) -> option -> code
2688 prev -> cdr = bptr -> cdr;
2690 hash [hashix] = bptr -> cdr;
2704 if (!ptr || !*ptr) {
2705 log_error (
"Null pointer in option_cache_dereference: %s(%d)",
2707 #if defined (POINTER_DEBUG) 2729 free_option_caches = *ptr;
2732 if ((*ptr) ->
refcnt < 0) {
2734 #if defined (DEBUG_RC_HISTORY) 2735 dump_rc_history (*ptr);
2737 #if defined (POINTER_DEBUG) 2750 struct universe *universe;
2767 for (cp = heads [i]; cp; cp = next) {
2777 state ->
universes [universe -> index] = (
void *)0;
2792 if (src->
len == 0 && option->
format[0] !=
'Z')
2795 memset(&tmp, 0,
sizeof(tmp));
2838 struct packet *packet,
struct lease *lease,
2839 struct client_state *client_state,
2844 struct universe *subu=NULL;
2848 memset(&tmp, 0,
sizeof(tmp));
2851 in_options, cfg_options, scope, oc,
MDL)) {
2865 end = strchr(++start,
'.');
2870 if (end == NULL || start == end)
2874 start, end - start,
MDL);
2878 "refers to unknown " 2879 "option space '%.*s'.",
2881 (
int)(end - start), start);
2892 client_state, in_options,
2893 cfg_options, scope, subu);
2896 }
while (ISC_FALSE);
2908 in_options, cfg_options, scope,
name)
2910 struct packet *packet;
2911 struct lease *lease;
2912 struct client_state *client_state;
2918 struct universe *u = NULL;
2924 log_error(
"option_space_encapsulate: option space '%.*s' does " 2925 "not exist, but is configured.",
2931 if (u->
encapsulate(result, packet, lease, client_state,
2932 in_options, cfg_options, scope, u))
2935 log_error(
"encapsulation requested for '%s' with no support.",
2957 search_subencapsulation(
struct data_string *result,
struct packet *packet,
2958 struct lease *lease,
struct client_state *client_state,
2962 struct universe *universe)
2965 struct universe *subu;
2968 memset(&sub, 0,
sizeof(sub));
2981 subu->
encapsulate(&sub, packet, lease, client_state,
2982 in_options, cfg_options,
2996 in_options, cfg_options, scope, universe)
2998 struct packet *packet;
2999 struct lease *lease;
3000 struct client_state *client_state;
3004 struct universe *universe;
3023 for (p = hash [i]; p; p = p -> cdr) {
3025 client_state, in_options, cfg_options,
3031 if (search_subencapsulation(result, packet, lease, client_state,
3032 in_options, cfg_options, scope, universe))
3039 in_options, cfg_options, scope, universe)
3041 struct packet *packet;
3042 struct lease *lease;
3043 struct client_state *client_state;
3047 struct universe *universe;
3063 for (ocp = head ->
first; ocp; ocp = ocp -> cdr) {
3065 lease, client_state, in_options,
3076 static unsigned char nni [] = { 1, 0 };
3078 memset (&ds, 0,
sizeof ds);
3083 if (!option_code_hash_lookup(&no_nwip->
option,
3086 log_fatal(
"Nwip option hash does not contain " 3091 client_state, in_options,
3092 cfg_options, scope, no_nwip))
3096 memset (&ds, 0,
sizeof ds);
3105 ds.
buffer -> data [0] = 2;
3106 ds.
buffer -> data [1] = 0;
3107 memcpy (&ds.
buffer -> data [2], result -> data, result -> len);
3123 fqdn_encode(
unsigned char *dst,
int dstlen,
const unsigned char *src,
3127 int i, j, len, outlen=0;
3130 for (i = 0, j = 0 ; i < srclen ; i = j) {
3131 while ((j < srclen) && (src[j] !=
'.') && (src[j] !=
'\0'))
3135 if ((outlen + 1 + len) > dstlen)
3145 memcpy(out, src + i, len);
3153 if ((outlen + 1) > dstlen)
3164 in_options, cfg_options, scope, universe)
3166 struct packet *packet;
3167 struct lease *lease;
3168 struct client_state *client_state;
3172 struct universe *universe;
3175 struct data_string results [FQDN_SUBOPTION_COUNT + 1];
3191 memset (results, 0,
sizeof results);
3192 for (ocp = head ->
first; ocp; ocp = ocp -> cdr) {
3194 if (oc -> option -> code > FQDN_SUBOPTION_COUNT)
3198 packet, lease, client_state,
3199 in_options, cfg_options, scope,
3211 log_error (
"no memory for option buffer.");
3219 memset (&bp ->
data [0], 0, len);
3233 bp -> data [0] |= 2;
3236 bp -> data [0] |= 1;
3246 i = fqdn_encode(&bp->
data[3], len - 3,
3248 results[FQDN_FQDN].
len);
3260 memcpy (&bp -> data [3], results [
FQDN_FQDN].data,
3263 result -> terminated = 0;
3268 if (results [i].len)
3317 struct client_state *client_state,
3321 struct universe *u,
void *stuff,
3325 struct client_state *,
3329 struct universe *,
void *))
3339 struct packet *packet,
struct lease *lease,
3340 struct client_state *client_state,
3344 struct universe *universe)
3349 unsigned char *
data;
3350 int i, len, rval = 0, count;
3351 struct data_string results[FQDN_SUBOPTION_COUNT + 1];
3360 memset(results, 0,
sizeof(results));
3361 for (ocp = head->
first ; ocp != NULL ; ocp = ocp->
cdr) {
3367 lease, client_state, in_options,
3368 cfg_options, scope, oc,
MDL);
3378 log_error(
"No memory for virtual option buffer.");
3411 count = fqdn_encode(data + 1, len - 1,
3420 result->
len += count;
3439 const unsigned char *
buffer,
unsigned length,
3442 struct buffer *bp = NULL;
3443 unsigned char *first_dot;
3444 int len, hlen, dlen;
3457 log_error(
"No memory for dhcp6.fqdn option buffer.");
3490 log_error(
"Unable to convert dhcp6.fqdn domain name to " 3497 unsigned char *fqdn_start = bp->
data + 3;
3503 first_dot = (
unsigned char *)strchr((
char *)fqdn_start,
'.');
3505 if (first_dot != NULL) {
3506 hlen = first_dot - fqdn_start;
3534 struct client_state *client_state,
3538 struct universe *u,
void *stuff,
3541 struct lease *,
struct client_state *,
3545 struct universe *,
void *))
3548 (*u ->
foreach) (packet, lease, client_state, in_options,
3549 cfg_options, scope, u, stuff, func);
3553 struct client_state *client_state,
3557 struct universe *u,
void *stuff,
3560 struct lease *,
struct client_state *,
3564 struct universe *,
void *),
3570 if (universe ->
foreach)
3571 (*universe ->
foreach) (packet, lease, client_state,
3572 in_options, cfg_options,
3573 scope, universe, stuff, func);
3577 struct client_state *client_state,
3581 struct universe *u,
void *stuff,
3585 struct client_state *,
3589 struct universe *,
void *))
3595 if (cfg_options -> universe_count <= u -> index)
3598 hash = cfg_options ->
universes [u -> index];
3604 for (p = hash [i]; p; p = p -> cdr) {
3606 (*func) (oc, packet, lease, client_state,
3607 in_options, cfg_options, scope, u, stuff);
3623 options ->
universes [universe -> index]);
3627 [universe -> index]),
MDL))
3630 options ->
universes [universe -> index]);
3634 for (tail = &head ->
first; *tail; tail = &((*tail) -> cdr)) {
3637 if (oc->
option->
code == (*ocloc)->option->code) {
3640 ocloc = &(*ocloc)->
next;
3641 }
while (*ocloc != NULL);
3650 *tail =
cons (0, 0);
3653 (&(*tail) -> car), oc,
MDL);
3658 in_options, cfg_options, scope, universe)
3660 struct packet *packet;
3661 struct lease *lease;
3662 struct client_state *client_state;
3666 struct universe *universe;
3675 cfg_options ->
universes [universe -> index]);
3679 for (oc = head ->
first; oc; oc = oc -> cdr) {
3681 lease, client_state, in_options, cfg_options,
3686 if (search_subencapsulation(result, packet, lease, client_state,
3687 in_options, cfg_options, scope, universe))
3694 struct universe *universe;
3704 options ->
universes [universe -> index]);
3708 for (tail = &head ->
first; *tail; tail = &((*tail) -> cdr)) {
3710 ((
struct option_cache *)(*tail) -> car) -> option -> code)
3712 tmp = (*tail) -> cdr;
3714 (&(*tail) -> car),
MDL);
3723 struct universe *universe;
3733 options ->
universes [universe -> index]);
3737 for (oc = head ->
first; oc; oc = oc -> cdr) {
3739 ((
struct option_cache *)(oc -> car)) -> option -> code) {
3748 struct universe *universe;
3759 struct client_state *client_state,
3763 struct universe *u,
void *stuff,
3767 struct client_state *,
3771 struct universe *,
void *))
3782 for (car = head ->
first; car; car = car -> cdr) {
3784 packet, lease, client_state,
3785 in_options, cfg_options, scope, u, stuff);
3789 void do_packet (interface, packet, len, from_port, from, hfrom)
3793 unsigned int from_port;
3798 struct packet *decoded_packet;
3799 #if defined (DEBUG_MEMORY_LEAKAGE) 3800 unsigned long previous_outstanding = dmalloc_outstanding;
3803 #if defined (TRACING) 3807 decoded_packet = NULL;
3809 log_error(
"do_packet: no memory for incoming packet!");
3812 decoded_packet->
raw = packet;
3816 interface_reference(&decoded_packet->
interface, interface,
MDL);
3817 decoded_packet->
haddr = hfrom;
3821 log_info(
"Discarding packet with bogus hlen.");
3840 memset(&dp, 0,
sizeof dp);
3842 decoded_packet->
options, NULL,
3854 dhcp(decoded_packet);
3856 bootp(decoded_packet);
3862 #if defined (DEBUG_MEMORY_LEAKAGE) 3863 log_info(
"generation %ld: %ld new, %ld outstanding, %ld long-term",
3865 dmalloc_outstanding - previous_outstanding,
3866 dmalloc_outstanding, dmalloc_longterm);
3867 dmalloc_dump_outstanding();
3869 #if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY) 3898 int len,
int from_port,
const struct iaddr *from,
3899 isc_boolean_t was_unicast) {
3900 unsigned char msg_type;
3903 struct packet *decoded_packet;
3904 #if defined (DEBUG_MEMORY_LEAKAGE) 3905 unsigned long previous_outstanding = dmalloc_outstanding;
3910 "short packet from %s port %d, len %d, dropped",
3911 piaddr(*from), from_port, len);
3915 decoded_packet = NULL;
3917 log_error(
"do_packet6: no memory for incoming packet.");
3922 log_error(
"do_packet6: no memory for options.");
3938 interface_reference(&decoded_packet->
interface, interface,
MDL);
3940 decoded_packet->
unicast = was_unicast;
3942 msg_type = packet[0];
3957 relay->
options, len - relaylen,
3988 #if defined (DEBUG_MEMORY_LEAKAGE) 3989 log_info(
"generation %ld: %ld new, %ld outstanding, %ld long-term",
3991 dmalloc_outstanding - previous_outstanding,
3992 dmalloc_outstanding, dmalloc_longterm);
3993 dmalloc_dump_outstanding();
3995 #if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY) 4003 const unsigned char *send)
4010 if (dst == NULL || dend == NULL || src == NULL || send == NULL ||
4011 *dst == NULL || *src == NULL || (*dst >= dend) || (*src > send) ||
4012 ((send - *src) > (dend - *dst)))
4015 for ( ; *src < send ; (*src)++) {
4016 if (!isascii (**src) || !isprint (**src)) {
4018 if ((*src + 1) != send || **src !=
'\0') {
4019 if (*dst + 4 > dend)
4022 sprintf(*dst,
"\\%03o",
4027 }
else if (**src ==
'"' || **src ==
'\'' || **src ==
'$' ||
4028 **src ==
'`' || **src ==
'\\' || **src ==
'|' ||
4030 if (*dst + 2 > dend)
4039 if (*dst + 1 > dend)
4052 pretty_text(
char **dst,
char *dend,
const unsigned char **src,
4053 const unsigned char *send,
int emit_quotes)
4057 if (dst == NULL || dend == NULL || src == NULL || send == NULL ||
4058 *dst == NULL || *src == NULL ||
4059 ((*dst + (emit_quotes ? 2 : 0)) > dend) || (*src > send))
4068 count =
pretty_escape(dst, dend - (emit_quotes ? 1 : 0), src, send);
4073 if (emit_quotes && (*dst < dend)) {
4085 pretty_domain(
char **dst,
char *dend,
const unsigned char **src,
4086 const unsigned char *send)
4088 const unsigned char *tend;
4092 if (dst == NULL || dend == NULL || src == NULL || send == NULL ||
4093 *dst == NULL || *src == NULL ||
4094 ((*dst + 2) > dend) || (*src >= send))
4113 tend = (*src) + tsiz;
4125 if ((status == -1) || ((*dst + 2) > dend))
4130 count += status + 1;
4146 unsigned int option_num,
4148 unsigned int data_len)
4151 struct option *option;
4158 &option_num, 0,
MDL)) {
4159 log_error(
"Attempting to add unknown option %d.", option_num);
4165 log_error(
"No memory for option cache adding %s (option %d).",
4166 option->
name, option_num);
4176 log_error(
"No memory for constant data adding %s (option %d).",
4177 option->
name, option_num);
4205 log_debug(
"Dropped DHCPv4 packet with zero-length client-id");
4208 }
else if (oc->
data.
len == 1) {
4215 log_debug(
"Accepted DHCPv4 packet with one-character client-id - " 4216 "a future version of ISC DHCP will reject this");
4224 log_debug(
"Received DHCPv4 packet without client-id" 4225 " option and empty hlen field.");
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
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)
void * dmalloc(unsigned, const char *, int)
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
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__
#define DHO_DHCP_REBINDING_TIME
#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)
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)
int parse_options(struct packet *packet)
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 *)
int option_state_dereference(struct option_state **ptr, const char *file, int line)
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
const unsigned char * data
#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)