Lines Matching refs:code

59 	int len, code;  in parse_option_buffer()  local
62 code = s[0]; in parse_option_buffer()
65 if (code == DHO_PAD) { in parse_option_buffer()
81 dhcp_options[code].name, len); in parse_option_buffer()
87 dhcp_options[code].name); in parse_option_buffer()
99 if (dhcp_options[code].format[0] == 't') { in parse_option_buffer()
108 if (!options[code].data) { in parse_option_buffer()
111 dhcp_options[code].name); in parse_option_buffer()
118 options[code].len = len; in parse_option_buffer()
119 options[code].data = t; in parse_option_buffer()
126 t = calloc(1, len + options[code].len + 1); in parse_option_buffer()
129 dhcp_options[code].name); in parse_option_buffer()
130 memcpy(t, options[code].data, options[code].len); in parse_option_buffer()
131 memcpy(t + options[code].len, &s[2], len); in parse_option_buffer()
132 options[code].len += len; in parse_option_buffer()
133 t[options[code].len] = 0; in parse_option_buffer()
134 free(options[code].data); in parse_option_buffer()
135 options[code].data = t; in parse_option_buffer()
153 int ix, incr, length, bufix, code, lastopt = -1; in cons_options() local
165 for (code = DHO_SUBNET_MASK; code < DHO_END; code++) { in cons_options()
166 if (!options[code].data || code == DHO_DHCP_MESSAGE_TYPE) in cons_options()
169 length = options[code].len; in cons_options()
179 buf[bufix++] = code; in cons_options()
181 memcpy(buf + bufix, options[code].data + ix, incr); in cons_options()
201 pretty_print_option(unsigned int code, struct option_data *option, in pretty_print_option() argument
215 if (code > 255) in pretty_print_option()
216 error("pretty_print_option: bad code %d", code); in pretty_print_option()
224 for (i = 0; dhcp_options[code].format[i]; i++) { in pretty_print_option()
227 dhcp_options[code].name, in pretty_print_option()
228 &(dhcp_options[code].format[i])); in pretty_print_option()
232 fmtbuf[i] = dhcp_options[code].format[i]; in pretty_print_option()
233 switch (dhcp_options[code].format[i]) { in pretty_print_option()
241 dhcp_options[code].name, in pretty_print_option()
242 dhcp_options[code].format); in pretty_print_option()
285 dhcp_options[code].name, in pretty_print_option()
286 &(dhcp_options[code].format[i])); in pretty_print_option()
294 dhcp_options[code].name, hunksize, len); in pretty_print_option()
300 dhcp_options[code].name, len - hunksize); in pretty_print_option()
308 dhcp_options[code].name, len - numhunk * hunksize); in pretty_print_option()