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;
132 struct buffer *bp = (
struct buffer *)0;
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 &&
144 (code = universe->
get_tag(buffer + offset)) != universe->
end; ) {
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);
220 memcpy(
new.buffer->data, op->
data.
data,
223 memcpy(
new.buffer->data + op->
data.
len,
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");
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,
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;
626 if (mb_size > agent_size)
627 mb_max = mb_size - agent_size;
631 if (overload_avail & 1) {
636 if (overload_avail & 2) {
657 if (prl != NULL && prl->
len > 0) {
661 priority_list[priority_len++] =
671 for (i = 0; i < prl->
len; i++) {
677 priority_list[priority_len++] = prl->
data[i];
689 priority_list[priority_len++] =
DHO_FQDN;
720 priority_list[priority_len++] =
DHO_FQDN;
735 for (pp = hash[i]; pp; pp = pp->cdr) {
741 priority_list[priority_len++] =
756 for (pp = hash[i]; pp; pp = pp->cdr) {
762 priority_list[priority_len++] =
777 priority_list[priority_len++] =
787 priority_list[priority_len++] =
796 option_size =
store_options(&overload_used, buffer, index, mb_max,
797 inpacket, lease, client_state,
798 in_options, cfg_options, scope,
799 priority_list, priority_len,
800 of1, of2, terminate, vuname);
803 if (option_size == 0)
807 index += option_size;
814 if (mb_size - agent_size - index < 3)
819 buffer[index++] = overload_used;
821 if (overload_used & 1)
824 if (overload_used & 2)
830 if (mb_size - index >= agent_size) {
831 memcpy(&buffer[index], agentopts, agent_size);
834 log_error(
"Unable to store relay agent information "
843 memcpy(outpacket->
options, buffer, index);
868 struct lease *dummy_lease,
874 void *void_vsio_state) {
879 memset(&ds, 0,
sizeof(ds));
881 NULL, opt_state, NULL,
887 }
else if (universe->
tag_size == 2) {
891 }
else if (universe->
tag_size == 4) {
910 log_debug(
"No space for option %d in VSIO space %s.",
915 log_error(
"Error evaluating option %d in VSIO space %s.",
931 const int *required_opts,
940 int in_required_opts;
941 int vsio_option_code;
952 vsio_option_code = 0;
956 vsio_option_code = o->
code;
961 if (vsio_option_code == 0) {
965 if (required_opts != NULL) {
966 for (i=0; required_opts[i] != 0; i++) {
967 if (required_opts[i] == vsio_option_code) {
972 opt_state, required_opts[i]);
976 memset(&ds, 0,
sizeof(ds));
977 for (; oc != NULL ; oc = oc->
next) {
984 tmp = (
unsigned char *)buf;
992 memcpy(tmp+4, ds.
data, ds.
len);
994 bufpos += (4 + ds.
len);
1012 oro_size = oro->
len / 2;
1014 for (i=0; i<oro_size; i++) {
1015 memcpy(&code, oro->
data+(i*2), 2);
1022 in_required_opts = 0;
1023 if (required_opts != NULL) {
1024 for (j=0; required_opts[j] != 0; j++) {
1025 if (required_opts[j] == code) {
1026 in_required_opts = 1;
1031 if (in_required_opts) {
1038 if (code == vsio_option_code) {
1046 memset(&ds, 0,
sizeof(ds));
1047 for (; oc != NULL ; oc = oc->
next) {
1051 if ((ds.
len + 4) <= (buflen - bufpos)) {
1052 tmp = (
unsigned char *)buf + bufpos;
1058 memcpy(tmp+4, ds.
data, ds.
len);
1060 bufpos += (4 + ds.
len);
1067 log_error(
"Error evaluating option %d", code);
1096 if (vs.
bufpos > bufpos+8) {
1097 tmp = (
unsigned char *)buf +
1121 unsigned char *
buffer,
unsigned index,
unsigned buflen,
1127 unsigned *priority_list,
int priority_len,
1128 unsigned first_cutoff,
int second_cutoff,
int terminate,
1131 int bufix = 0, six = 0, tix = 0;
1135 int bufend, sbufend;
1146 buffer = &buffer[index];
1149 first_cutoff -= index;
1151 second_cutoff -= index;
1154 bufend = sbufend = buflen;
1156 if (first_cutoff >= buflen)
1157 log_fatal(
"%s:%d:store_options: Invalid first cutoff.",
MDL);
1158 bufend = first_cutoff;
1160 if (second_cutoff) {
1161 if (second_cutoff >= buflen)
1162 log_fatal(
"%s:%d:store_options: Invalid second cutoff.",
1164 sbufend = second_cutoff;
1166 }
else if (second_cutoff) {
1167 if (second_cutoff >= buflen)
1168 log_fatal(
"%s:%d:store_options: Invalid second cutoff.",
MDL);
1169 bufend = second_cutoff;
1172 memset (&od, 0,
sizeof od);
1177 for (i = 0; i < priority_len; i++) {
1180 for (ix = i + 1; ix < priority_len + tto; ix++) {
1182 priority_list [ix - tto] =
1184 if (priority_list [i] == priority_list [ix]) {
1202 for (ix = i - 1 ; ix >= 0 ; ix--) {
1215 for (i = 0; i < priority_len; i++) {
1219 int optstart, soptstart, toptstart;
1221 int have_encapsulation = 0;
1225 memset (&encapsulation, 0,
sizeof encapsulation);
1226 have_encapsulation = 0;
1232 code = priority_list [i];
1236 if (code >= cfg_options -> site_code_min)
1237 u =
universes [cfg_options -> site_universe];
1246 option_code_hash_lookup(&option, u->
code_hash, &code, 0,
MDL);
1256 if ((option != NULL) &&
1257 (((oc == NULL) && (option->
format[0] ==
'E')) ||
1258 ((oc != NULL) && (option->
format[0] ==
'e')))) {
1263 s = strchr (option->
format,
'E');
1265 t = strchr (++s,
'.');
1267 memset (&name, 0,
sizeof name);
1272 if (vendor_cfg_option) {
1275 vendor_cfg_option -> code);
1283 }
else if (vuname) {
1284 name.
data = (
unsigned char *)s;
1285 name.
len = strlen (s);
1288 name.
data = (
unsigned char *)s;
1295 have_encapsulation =
1297 (&encapsulation, packet, lease, client_state,
1298 in_options, cfg_options, scope, &name));
1313 if (!oc && !have_encapsulation) {
1322 lease, client_state, in_options,
1323 cfg_options, scope, oc,
MDL);
1342 if (have_encapsulation) {
1343 length += encapsulation.
len;
1353 struct buffer *bp = (
struct buffer *)0;
1398 unsigned incr = length;
1400 unsigned char *base;
1404 ((!six && !tix && (i == priority_len - 1) &&
1405 (bufix + 2 + length < bufend)) ||
1406 (bufix + 5 + length < bufend))) {
1410 }
else if (!splitup && first_cutoff &&
1411 (first_cutoff + six + 3 + length < sbufend)) {
1412 base = &buffer[first_cutoff];
1415 }
else if (!splitup && second_cutoff &&
1416 (second_cutoff + tix + 3 + length < buflen)) {
1417 base = &buffer[second_cutoff];
1424 if (bufix + 6 < bufend) {
1425 incr = bufend - bufix - 5;
1429 }
else if (first_cutoff &&
1430 (first_cutoff + six + 4 < sbufend)) {
1431 incr = sbufend - (first_cutoff + six) - 3;
1432 base = &buffer[first_cutoff];
1435 }
else if (second_cutoff &&
1436 (second_cutoff + tix + 4 < buflen)) {
1437 incr = buflen - (second_cutoff + tix) - 3;
1438 base = &buffer[second_cutoff];
1456 base [*pix + 1] = (
unsigned char)incr;
1457 if (tto && incr == length) {
1459 memcpy (base + *pix + 2,
1460 od.
data + ix, (
unsigned)(incr - 1));
1461 base [*pix + 2 + incr - 1] = 0;
1463 memcpy (base + *pix + 2,
1464 od.
data + ix, (
unsigned)incr);
1477 if (first_cutoff && six) {
1478 if ((first_cutoff + six + 1) < sbufend)
1479 memset (&buffer[first_cutoff + six + 1],
DHO_PAD,
1480 sbufend - (first_cutoff + six + 1));
1481 else if (first_cutoff + six >= sbufend)
1482 log_fatal(
"Second buffer overflow in overloaded options.");
1484 buffer[first_cutoff + six] =
DHO_END;
1489 if (second_cutoff && tix) {
1490 if (second_cutoff + tix + 1 < buflen) {
1491 memset (&buffer[second_cutoff + tix + 1],
DHO_PAD,
1492 buflen - (second_cutoff + tix + 1));
1493 }
else if (second_cutoff + tix >= buflen)
1494 log_fatal(
"Third buffer overflow in overloaded options.");
1496 buffer[second_cutoff + tix] =
DHO_END;
1501 if ((six || tix) && (bufix + 3 > bufend))
1502 log_fatal(
"Not enough space for option overload option.");
1518 while (*p !=
'\0') {
1542 log_error(
"format_has_text(%s): 'c' atoms are illegal "
1543 "except after 'D' atoms.", format);
1555 while ((*p !=
'\0') && (*p++ !=
'.'))
1578 const char *p, *name;
1584 while (*p !=
'\0') {
1610 log_fatal(
"Corrupt format: %s", format);
1613 if (espace == NULL) {
1614 log_error(
"Unknown enumeration: %s", format);
1619 min_len += espace->
width;
1620 last_size = espace->
width;
1634 min_len -= last_size;
1655 log_error(
"format_min_length(%s): 'c' atom is illegal "
1656 "except after 'D' atom.", format);
1661 log_error(
"format_min_length(%s): No safe value "
1662 "for unknown format symbols.", format);
1675 const
unsigned char *data;
1680 static char optbuf [32768];
1681 static char *endbuf = &optbuf[
sizeof(optbuf)];
1689 char fmtbuf[32] =
"";
1693 const unsigned char *dp = data;
1696 isc_boolean_t a_array = ISC_FALSE;
1698 unsigned int octets = 0;
1705 memset (enumbuf, 0,
sizeof enumbuf);
1707 if (option->format[0] !=
'R') {
1709 for (l = i = 0; option -> format [i]; i++, l++) {
1710 if (l >=
sizeof(fmtbuf) - 1)
1711 log_fatal(
"Bounds failure on internal buffer at "
1715 log_error (
"%s: Extra codes in format string: %s",
1717 &(option -> format [i]));
1721 fmtbuf [l] = option -> format [i];
1722 switch (option -> format [i]) {
1733 while (option -> format [i] &&
1734 option -> format [i] !=
'.')
1738 for (k = 0; k < len; k++) {
1739 if (!isascii (data [k]) ||
1740 !isprint (data [k]))
1746 if (k == len || (k + 1 == len && data [k] == 0)) {
1761 log_error(
"'c' atom not following D atom in format "
1762 "string: %s", option->format);
1770 if (option->format[i+1] ==
'c')
1784 while (option -> format [i] &&
1785 option -> format [i] !=
'.')
1790 if (enumbuf[l] == NULL) {
1794 hunksize += enumbuf[l]->
width;
1795 hunkinc = enumbuf[l]->
width;
1828 log_error (
"%s: garbage in format string: %s",
1830 &(option -> format [i]));
1836 if (hunksize - opthunk > len) {
1837 log_error (
"%s: expecting at least %d bytes; got %d",
1843 if (numhunk == -1 && hunksize < len)
1850 if (a_array == ISC_TRUE) {
1858 numhunk = ((len - hunksize) / hunkinc) + 1;
1859 len_used = hunksize + ((numhunk - 1) * hunkinc);
1865 numhunk = len / hunksize;
1866 len_used = numhunk * hunksize;
1870 if (len_used < len) {
1871 log_error (
"%s: %d extra bytes at end of array\n",
1894 fmtbuf[0]=
'R'; fmtbuf[1]=
'I'; fmtbuf[2]=0;
1895 for (i =0; i < len; i = i + octets + 5) {
1897 log_error (
"wrong subnet mask width in destination descriptor");
1901 octets = ((data[i]+7) / 8);
1904 log_error (
"classless static routes option has wrong size or "
1905 "there's some garbage in format");
1910 for (i = 0; i < numhunk; i++) {
1911 if ((a_array == ISC_TRUE) && (i != 0) && (numelem > 0)) {
1928 for (; j < numelem; j++) {
1929 switch (fmtbuf [j]) {
1932 k = pretty_text(&op, endbuf - 1, &dp,
1933 data + len, emit_quotes);
1941 for( ; dp < (data + len) ; dp += k) {
1943 const unsigned char *nbp, *nend;
1945 nend = &nbuff[
sizeof(nbuff)];
1955 if (op + 2 > endbuf)
1984 pretty_domain(&op, endbuf-1,
2024 switch (enumbuf[j]->
width) {
2040 return "<double impossible condition>";
2046 if (enumbuf [j] ->
values [i].value ==
2051 dp += enumbuf[j]->
width;
2055 sprintf(op,
"%lu", tval);
2060 memcpy(iaddr.
iabuf, dp, 4);
2061 strcpy(op,
piaddr(iaddr));
2067 iaddr.
len = (((dp[0]+7)/8)+1);
2069 log_error (
"wrong subnet mask width in destination descriptor");
2073 memcpy(iaddr.
iabuf, dp, iaddr.
len);
2080 memcpy(iaddr.
iabuf, dp, 16);
2081 strcpy(op,
piaddr(iaddr));
2085 sprintf (op,
"%ld", (
long)
getLong (dp));
2091 sprintf (op,
"%s",
"infinite");
2093 sprintf(op,
"%lu", tval);
2101 sprintf (op,
"%d", (
int)
getShort (dp));
2105 sprintf(op,
"%u", (
unsigned)
getUShort(dp));
2109 sprintf (op,
"%d", *(
const char *)dp++);
2112 sprintf (op,
"%d", *dp++);
2116 sprintf (op,
"%x", *dp++);
2119 strcpy (op, *dp++ ?
"true" :
"false");
2122 strcpy (op,
"true");
2133 if (dp == data + len)
2135 if (j + 1 < numelem && comma !=
':')
2138 if (i + 1 < numhunk) {
2141 if (dp == data + len)
2148 in_options, cfg_options, options, scope, code,
file,
line)
2164 if (!universe -> lookup_func)
2166 oc = ((*universe -> lookup_func) (universe, options, code));
2170 in_options, cfg_options, scope, oc,
2183 in_options, cfg_options, options, scope, code,
file,
line)
2202 if ((options == NULL) || (universe->
lookup_func == NULL))
2206 oc = ((*universe->
lookup_func)(universe, options, code));
2211 memset(&d1, 0,
sizeof(d1));
2213 in_options, cfg_options, scope, oc,
2219 *result = d1.
data[0];
2231 enum statement_op op;
2238 case eval_statement:
2239 case break_statement:
2241 log_error (
"bogus statement type in set_option.");
2244 case default_option_statement:
2246 option -> option -> code);
2252 case supersede_option_statement:
2253 case send_option_statement:
2258 case append_option_statement:
2259 case prepend_option_statement:
2261 option -> option -> code);
2269 log_error (
"Can't allocate const expression.");
2281 if (op == append_option_statement) {
2310 if (universe -> lookup_func)
2311 return (*universe -> lookup_func) (universe, options, code);
2313 log_error (
"can't look up options in %s space.",
2329 !(options ->
universes [universe -> index]))
2332 hash = options ->
universes [universe -> index];
2335 for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
2346 struct buffer *bp,
unsigned char *
buffer,
unsigned length,
2347 unsigned code,
int terminatep)
2352 status = prepare_option_buffer(universe, bp, buffer, length, code,
2370 struct buffer *bp,
unsigned char *
buffer,
unsigned length,
2371 unsigned code,
int terminatep)
2376 status = prepare_option_buffer(universe, bp, buffer, length, code,
2394 unsigned char *
buffer,
unsigned length,
unsigned code,
2397 struct buffer *lbp = NULL;
2413 if (code > 0xffffffff)
2418 log_fatal(
"Inconsistent universe tag size at %s:%d.",
MDL);
2421 option_code_hash_lookup(&option, universe->
code_hash, &code, 0,
MDL);
2431 char nbuf[
sizeof(
"unknown-4294967295")];
2433 sprintf(nbuf,
"unknown-%u", code);
2442 option->
code = code;
2449 log_error(
"No memory for option code %s.%s.",
2464 log_error (
"no memory for option buffer.");
2469 memcpy (lbp ->
data, buffer, length + terminatep);
2471 buffer = &bp ->
data [0];
2479 op ->
data.data = buffer;
2480 op ->
data.len = length;
2488 buffer [length] = 0;
2489 op ->
data.terminated = 1;
2491 op ->
data.terminated = 0;
2501 while ((op->
data.
len > min_len) &&
2519 struct packet *dummy_packet,
2520 struct lease *dummy_lease,
2525 struct universe *dummy_universe,
2526 void *void_accumulator) {
2527 int *accumulator = (
int *)void_accumulator;
2534 struct packet *dummy_packet,
2535 struct lease *dummy_lease,
2540 struct universe *dummy_universe,
2584 memset(server_oro, 0,
sizeof(*server_oro));
2586 log_fatal(
"no memory to build server ORO");
2594 server_oro->
len = 0;
2607 server_oro->
len += 2;
2622 (*universe->
save_func)(universe, options, oc, ISC_FALSE);
2624 log_error(
"can't store options in %s space.", universe->
name);
2633 (*universe->
save_func)(universe, options, oc, ISC_TRUE);
2635 log_error(
"can't store options in %s space.", universe->
name);
2658 universe -> name, oc -> option -> name);
2662 options ->
universes [universe -> index] = (
void *)hash;
2665 for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
2667 (bptr -> car)) -> option -> code ==
2668 oc -> option -> code)
2683 ocloc = &(*ocloc)->
next;
2684 }
while (*ocloc != NULL);
2697 log_error (
"No memory for option_cache reference.");
2700 bptr -> cdr = hash [hashix];
2703 hash [hashix] = bptr;
2707 struct universe *universe;
2711 if (universe -> delete_func)
2712 (*universe -> delete_func) (universe, options, code);
2714 log_error (
"can't delete options from %s space.",
2719 struct universe *universe;
2733 for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
2734 if (((
struct option_cache *)(bptr -> car)) -> option -> code
2742 prev -> cdr = bptr -> cdr;
2744 hash [hashix] = bptr -> cdr;
2758 if (!ptr || !*ptr) {
2759 log_error (
"Null pointer in option_cache_dereference: %s(%d)",
2761 #if defined (POINTER_DEBUG)
2783 free_option_caches = *ptr;
2786 if ((*ptr) ->
refcnt < 0) {
2787 log_error (
"%s(%d): negative refcnt!", file, line);
2788 #if defined (DEBUG_RC_HISTORY)
2789 dump_rc_history (*ptr);
2791 #if defined (POINTER_DEBUG)
2804 struct universe *universe;
2821 for (cp = heads [i]; cp; cp =
next) {
2830 dfree (heads, file, line);
2831 state ->
universes [universe -> index] = (
void *)0;
2846 if (src->
len == 0 && option->
format[0] !=
'Z')
2849 memset(&tmp, 0,
sizeof(tmp));
2898 struct universe *subu=NULL;
2902 memset(&tmp, 0,
sizeof(tmp));
2905 in_options, cfg_options, scope, oc,
MDL)) {
2919 end = strchr(++start,
'.');
2924 if (end == NULL || start == end)
2928 start, end - start,
MDL);
2932 "refers to unknown "
2933 "option space '%.*s'.",
2935 (
int)(end - start), start);
2946 client_state, in_options,
2947 cfg_options, scope, subu);
2950 }
while (ISC_FALSE);
2962 in_options, cfg_options, scope,
name)
2972 struct universe *u = NULL;
2978 log_error(
"option_space_encapsulate: option space '%.*s' does "
2979 "not exist, but is configured.",
2985 if (u->
encapsulate(result, packet, lease, client_state,
2986 in_options, cfg_options, scope, u))
2989 log_error(
"encapsulation requested for '%s' with no support.",
3016 struct universe *universe)
3019 struct universe *subu;
3022 memset(&sub, 0,
sizeof(sub));
3035 subu->
encapsulate(&sub, packet, lease, client_state,
3036 in_options, cfg_options,
3050 in_options, cfg_options, scope, universe)
3052 struct packet *packet;
3053 struct lease *lease;
3054 struct client_state *client_state;
3058 struct universe *universe;
3077 for (p = hash [i]; p; p = p -> cdr) {
3079 client_state, in_options, cfg_options,
3085 if (search_subencapsulation(result, packet, lease, client_state,
3086 in_options, cfg_options, scope, universe))
3093 in_options, cfg_options, scope, universe)
3095 struct packet *packet;
3096 struct lease *lease;
3097 struct client_state *client_state;
3101 struct universe *universe;
3117 for (ocp = head ->
first; ocp; ocp = ocp -> cdr) {
3119 lease, client_state, in_options,
3130 static unsigned char nni [] = { 1, 0 };
3132 memset (&ds, 0,
sizeof ds);
3137 if (!option_code_hash_lookup(&no_nwip->
option,
3140 log_fatal(
"Nwip option hash does not contain "
3145 client_state, in_options,
3146 cfg_options, scope, no_nwip))
3150 memset (&ds, 0,
sizeof ds);
3159 ds.
buffer -> data [0] = 2;
3160 ds.
buffer -> data [1] = 0;
3161 memcpy (&ds.
buffer -> data [2], result -> data, result -> len);
3177 fqdn_encode(
unsigned char *dst,
int dstlen,
const unsigned char *src,
3181 int i, j, len, outlen=0;
3184 for (i = 0, j = 0 ; i < srclen ; i = j) {
3185 while ((j < srclen) && (src[j] !=
'.') && (src[j] !=
'\0'))
3189 if ((outlen + 1 + len) > dstlen)
3199 memcpy(out, src + i, len);
3207 if ((outlen + 1) > dstlen)
3218 in_options, cfg_options, scope, universe)
3220 struct packet *packet;
3221 struct lease *lease;
3222 struct client_state *client_state;
3226 struct universe *universe;
3229 struct data_string results [FQDN_SUBOPTION_COUNT + 1];
3233 struct buffer *bp = (
struct buffer *)0;
3245 memset (results, 0,
sizeof results);
3246 for (ocp = head ->
first; ocp; ocp = ocp -> cdr) {
3248 if (oc -> option -> code > FQDN_SUBOPTION_COUNT)
3252 packet, lease, client_state,
3253 in_options, cfg_options, scope,
3265 log_error (
"no memory for option buffer.");
3273 memset (&bp ->
data [0], 0, len);
3287 bp -> data [0] |= 2;
3290 bp -> data [0] |= 1;
3300 i = fqdn_encode(&bp->
data[3], len - 3,
3302 results[FQDN_FQDN].
len);
3310 result->terminated = 0;
3314 memcpy (&bp -> data [3], results [
FQDN_FQDN].data,
3317 result -> terminated = 0;
3322 if (results [i].len)
3371 struct client_state *client_state,
3375 struct universe *u,
void *stuff,
3379 struct client_state *,
3383 struct universe *,
void *))
3393 struct packet *packet,
struct lease *lease,
3394 struct client_state *client_state,
3398 struct universe *universe)
3403 unsigned char *
data;
3404 int i, len, rval = 0, count;
3405 struct data_string results[FQDN_SUBOPTION_COUNT + 1];
3414 memset(results, 0,
sizeof(results));
3415 for (ocp = head->
first ; ocp != NULL ; ocp = ocp->
cdr) {
3421 lease, client_state, in_options,
3422 cfg_options, scope, oc,
MDL);
3432 log_error(
"No memory for virtual option buffer.");
3465 count = fqdn_encode(data + 1, len - 1,
3474 result->
len += count;
3493 const unsigned char *buffer,
unsigned length,
3496 struct buffer *bp = NULL;
3497 unsigned char *first_dot;
3498 int len, hlen, dlen;
3511 log_error(
"No memory for dhcp6.fqdn option buffer.");
3544 log_error(
"Unable to convert dhcp6.fqdn domain name to "
3551 unsigned char *fqdn_start = bp->
data + 3;
3557 first_dot = (
unsigned char *)strchr((
char *)fqdn_start,
'.');
3559 if (first_dot != NULL) {
3560 hlen = first_dot - fqdn_start;
3588 struct client_state *client_state,
3592 struct universe *u,
void *stuff,
3595 struct lease *,
struct client_state *,
3599 struct universe *,
void *))
3602 (*u ->
foreach) (packet, lease, client_state, in_options,
3603 cfg_options, scope, u, stuff, func);
3607 struct client_state *client_state,
3611 struct universe *u,
void *stuff,
3614 struct lease *,
struct client_state *,
3618 struct universe *,
void *),
3624 if (universe ->
foreach)
3625 (*universe ->
foreach) (packet, lease, client_state,
3626 in_options, cfg_options,
3627 scope, universe, stuff, func);
3631 struct client_state *client_state,
3635 struct universe *u,
void *stuff,
3639 struct client_state *,
3643 struct universe *,
void *))
3649 if (cfg_options -> universe_count <= u -> index)
3652 hash = cfg_options ->
universes [u -> index];
3658 for (p = hash [i]; p; p = p -> cdr) {
3660 (*func) (oc, packet, lease, client_state,
3661 in_options, cfg_options, scope, u, stuff);
3677 options ->
universes [universe -> index]);
3681 [universe -> index]),
MDL))
3684 options ->
universes [universe -> index]);
3688 for (tail = &head ->
first; *tail; tail = &((*tail) -> cdr)) {
3691 if (oc->
option->
code == (*ocloc)->option->code) {
3694 ocloc = &(*ocloc)->
next;
3695 }
while (*ocloc != NULL);
3704 *tail =
cons (0, 0);
3707 (&(*tail) -> car), oc,
MDL);
3712 in_options, cfg_options, scope, universe)
3714 struct packet *packet;
3715 struct lease *lease;
3716 struct client_state *client_state;
3720 struct universe *universe;
3729 cfg_options ->
universes [universe -> index]);
3733 for (oc = head ->
first; oc; oc = oc -> cdr) {
3735 lease, client_state, in_options, cfg_options,
3740 if (search_subencapsulation(result, packet, lease, client_state,
3741 in_options, cfg_options, scope, universe))
3748 struct universe *universe;
3758 options ->
universes [universe -> index]);
3762 for (tail = &head ->
first; *tail; tail = &((*tail) -> cdr)) {
3764 ((
struct option_cache *)(*tail) -> car) -> option -> code)
3766 tmp = (*tail) -> cdr;
3768 (&(*tail) -> car),
MDL);
3777 struct universe *universe;
3787 options ->
universes [universe -> index]);
3791 for (oc = head ->
first; oc; oc = oc -> cdr) {
3793 ((
struct option_cache *)(oc -> car)) -> option -> code) {
3802 struct universe *universe;
3813 struct client_state *client_state,
3817 struct universe *u,
void *stuff,
3821 struct client_state *,
3825 struct universe *,
void *))
3836 for (car = head ->
first; car; car = car -> cdr) {
3838 packet, lease, client_state,
3839 in_options, cfg_options, scope, u, stuff);
3843 void do_packet (interface, packet, len, from_port, from, hfrom)
3847 unsigned int from_port;
3852 struct packet *decoded_packet;
3853 #if defined (DEBUG_MEMORY_LEAKAGE)
3854 unsigned long previous_outstanding = dmalloc_outstanding;
3857 #if defined (TRACING)
3861 decoded_packet = NULL;
3863 log_error(
"do_packet: no memory for incoming packet!");
3866 decoded_packet->
raw = packet;
3870 interface_reference(&decoded_packet->
interface, interface,
MDL);
3871 decoded_packet->
haddr = hfrom;
3875 log_info(
"Discarding packet with bogus hlen.");
3894 memset(&dp, 0,
sizeof dp);
3896 decoded_packet->
options, NULL,
3908 dhcp(decoded_packet);
3910 bootp(decoded_packet);
3916 #if defined (DEBUG_MEMORY_LEAKAGE)
3917 log_info(
"generation %ld: %ld new, %ld outstanding, %ld long-term",
3919 dmalloc_outstanding - previous_outstanding,
3920 dmalloc_outstanding, dmalloc_longterm);
3921 dmalloc_dump_outstanding();
3923 #if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY)
3952 int len,
int from_port,
const struct iaddr *from,
3953 isc_boolean_t was_unicast) {
3954 unsigned char msg_type;
3957 struct packet *decoded_packet;
3958 #if defined (DEBUG_MEMORY_LEAKAGE)
3959 unsigned long previous_outstanding = dmalloc_outstanding;
3964 "short packet from %s port %d, len %d, dropped",
3965 piaddr(*from), from_port, len);
3969 decoded_packet = NULL;
3971 log_error(
"do_packet6: no memory for incoming packet.");
3976 log_error(
"do_packet6: no memory for options.");
3992 interface_reference(&decoded_packet->
interface, interface,
MDL);
3994 decoded_packet->
unicast = was_unicast;
3996 msg_type = packet[0];
4011 relay->
options, len - relaylen,
4042 #if defined (DEBUG_MEMORY_LEAKAGE)
4043 log_info(
"generation %ld: %ld new, %ld outstanding, %ld long-term",
4045 dmalloc_outstanding - previous_outstanding,
4046 dmalloc_outstanding, dmalloc_longterm);
4047 dmalloc_dump_outstanding();
4049 #if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY)
4057 const unsigned char *send)
4064 if (dst == NULL || dend == NULL || src == NULL || send == NULL ||
4065 *dst == NULL || *src == NULL || (*dst >= dend) || (*src > send) ||
4066 ((send - *src) > (dend - *dst)))
4069 for ( ; *src < send ; (*src)++) {
4070 if (!isascii (**src) || !isprint (**src)) {
4072 if ((*src + 1) != send || **src !=
'\0') {
4073 if (*dst + 4 > dend)
4076 sprintf(*dst,
"\\%03o",
4081 }
else if (**src ==
'"' || **src ==
'\'' || **src ==
'$' ||
4082 **src ==
'`' || **src ==
'\\' || **src ==
'|' ||
4084 if (*dst + 2 > dend)
4093 if (*dst + 1 > dend)
4106 pretty_text(
char **dst,
char *dend,
const unsigned char **src,
4107 const unsigned char *send,
int emit_quotes)
4111 if (dst == NULL || dend == NULL || src == NULL || send == NULL ||
4112 *dst == NULL || *src == NULL ||
4113 ((*dst + (emit_quotes ? 2 : 0)) > dend) || (*src > send))
4122 count =
pretty_escape(dst, dend - (emit_quotes ? 1 : 0), src, send);
4127 if (emit_quotes && (*dst < dend)) {
4139 pretty_domain(
char **dst,
char *dend,
const unsigned char **src,
4140 const unsigned char *send)
4142 const unsigned char *tend;
4146 if (dst == NULL || dend == NULL || src == NULL || send == NULL ||
4147 *dst == NULL || *src == NULL ||
4148 ((*dst + 2) > dend) || (*src >= send))
4167 tend = (*src) + tsiz;
4179 if ((status == -1) || ((*dst + 2) > dend))
4184 count += status + 1;
4200 unsigned int option_num,
4202 unsigned int data_len)
4205 struct option *option;
4212 &option_num, 0,
MDL)) {
4213 log_error(
"Attempting to add unknown option %d.", option_num);
4219 log_error(
"No memory for option cache adding %s (option %d).",
4220 option->
name, option_num);
4230 log_error(
"No memory for constant data adding %s (option %d).",
4231 option->
name, option_num);
4259 log_debug(
"Dropped DHCPv4 packet with zero-length client-id");
4262 }
else if (oc->
data.
len == 1) {
4269 log_debug(
"Accepted DHCPv4 packet with one-character client-id - "
4270 "a future version of ISC DHCP will reject this");
4278 log_debug(
"Received DHCPv4 packet without client-id"
4279 " 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)
int(* decode)(struct option_state *, const unsigned char *, unsigned, struct universe *)
#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(* encapsulate)(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *)
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)
struct universe * universe
void save_option(struct universe *universe, struct option_state *options, struct option_cache *oc)
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 option_cache *(* lookup_func)(struct universe *, struct option_state *, unsigned)
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__
u_int32_t(* get_length)(const unsigned char *)
#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)
#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)
void(* store_length)(unsigned char *, u_int32_t)
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 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 *))
u_int32_t(* get_tag)(const unsigned char *)
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
void(* store_tag)(unsigned char *, u_int32_t)
#define dmalloc_reuse(x, y, l, z)
unsigned char transaction_id[3]
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
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)
struct in6_addr dhcpv6_link_address
void(* save_func)(struct universe *, struct option_state *, struct option_cache *, isc_boolean_t)
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)