• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/src/router/udhcpd/

Lines Matching refs:option

2  * options.c -- DHCP server option packet tools 
49 /* Lengths of the different option types */
63 /* get an option with bounds checking (warning, not aligned). */
75 LOG(LOG_WARNING, "bogus packet, option fields too long.");
80 LOG(LOG_WARNING, "bogus packet, option fields too long.");
91 LOG(LOG_WARNING, "bogus packet, option fields too long.");
118 /* return the position of the 'end' option (no bounds checking) */
131 /* add an option string to the options (an option string contains an option code,
137 /* end position + string length + option code/length + end option */
142 DEBUG(LOG_INFO, "adding option 0x%02x", string[OPT_CODE]);
149 /* add a one to four byte option to a packet */
154 unsigned char option[2 + 4];
169 DEBUG(LOG_ERR, "Could not add option 0x%02x", code);
173 option[OPT_CODE] = code;
174 option[OPT_LEN] = length;
181 memcpy(option + 2, &aligned, length);
182 return add_option_string(optionptr, option);
186 /* find option 'code' in opt_list */
197 /* add an option to the opt_list */
198 void attach_option(struct option_set **opt_list, struct dhcp_option *option, char *buffer, int length)
202 /* add it to an existing option */
203 if ((existing = find_option(*opt_list, option->code))) {
204 DEBUG(LOG_INFO, "Attaching option %s to existing member of list", option->name);
205 if (option->flags & OPTION_LIST) {
211 } /* else, ignore the data, we could put this in a second option in the future */
214 DEBUG(LOG_INFO, "Attaching option %s to list", option->name);
216 /* make a new option */
219 new->data[OPT_CODE] = option->code;
224 while (*curr && (*curr)->data[OPT_CODE] < option->code)