Lines Matching +defs:code +defs:string
14 /* name[12] flags code */
72 uint8_t *get_option(struct dhcpMessage *packet, int code)
86 if (optionptr[i + OPT_CODE] == code) {
139 /* add an option string to the options (an option string contains an option code,
141 int add_option_string(uint8_t *optionptr, uint8_t *string)
145 /* end position + string length + option code/length + end option */
146 if (end + string[OPT_LEN] + 2 + 1 >= 308) {
148 string[OPT_CODE]);
151 DEBUG("adding option 0x%02x", string[OPT_CODE]);
152 memcpy(optionptr + end, string, string[OPT_LEN] + 2);
153 optionptr[end + string[OPT_LEN] + 2] = DHCP_END;
154 return string[OPT_LEN] + 2;
159 int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data)
163 for (dh = dhcp_options; dh->code; dh++) {
164 if (dh->code == code) {
167 option[OPT_CODE] = code;
178 bb_error_msg("cannot add option 0x%02x", code);