struct dhcp_lease *lease = &state->lease;
struct in_addr addr;
struct timeval tv;
-#ifndef MINIMAL
size_t len = 0;
unsigned char *duid = NULL;
uint32_t ul;
-#endif
state->state = STATE_INIT;
state->nakoff = 1;
iface->net.s_addr = lease->net.s_addr;
}
-#ifndef MINIMAL
if (*options->clientid) {
iface->clientid = xmalloc(options->clientid[0] + 1);
memcpy(iface->clientid,
memcpy(iface->clientid + 2, iface->hwaddr, iface->hwlen);
}
}
-#endif
if (state->options & DHCPCD_LINK) {
open_link_socket(iface);
p += 2;
}
-#ifndef MINIMAL
if (iface->clientid) {
*p++ = DHCP_CLIENTID;
memcpy(p, iface->clientid, iface->clientid[0] + 1);
p += options->classid[0] + 1;
}
}
-#endif
if (type == DHCP_DISCOVER || type == DHCP_REQUEST) {
#define PUTADDR(_type, _val) \
type == DHCP_INFORM ||
type == DHCP_REQUEST)
{
-#ifndef MINIMAL
if (options->hostname[0]) {
if (options->fqdn == FQDN_DISABLE) {
*p++ = DHCP_HOSTNAME;
memcpy(p, options->vendor, options->vendor[0] + 1);
p += options->vendor[0] + 1;
}
-#endif
*p++ = DHCP_PARAMETERREQUESTLIST;
n_params = p;
return newlist[i];
}
-#ifndef MINIMAL
#define parse_string(buf, len, arg) parse_string_hwaddr(buf, len, arg, 0)
static ssize_t
parse_string_hwaddr(char *sbuf, ssize_t slen, char *str, int clid)
}
return l;
}
-#endif
static int
parse_option(int opt, char *oarg, struct options *options)
int i;
char *p;
ssize_t s;
-#ifndef MINIMAL
struct in_addr addr;
-#endif
switch(opt) {
case 'b':
strlcpy(options->script, oarg, sizeof(options->script));
break;
case 'h':
-#ifndef MINIMAL
if (oarg)
s = parse_string(options->hostname + 1,
MAXHOSTNAMELEN, oarg);
return -1;
}
options->hostname[0] = (uint8_t)s;
-#endif
break;
case 'i':
-#ifndef MINIMAL
if (oarg)
s = parse_string((char *)options->classid + 1,
CLASSID_MAX_LEN, oarg);
return -1;
}
*options->classid = (uint8_t)s;
-#endif
break;
case 'l':
-#ifndef MINIMAL
if (*oarg == '-') {
logger(LOG_ERR,
"leasetime must be a positive value");
logger(LOG_ERR, "`%s' out of range", oarg);
return -1;
}
-#endif
break;
case 'm':
options->metric = atoint(oarg);
}
break;
case 'u':
-#ifndef MINIMAL
s = USERCLASS_MAX_LEN - options->userclass[0] - 1;
s = parse_string((char *)options->userclass + options->userclass[0] + 2,
s, oarg);
options->userclass[options->userclass[0] + 1] = s;
options->userclass[0] += s + 1;
}
-#endif
break;
case 'v':
-#ifndef MINIMAL
p = strchr(oarg, ',');
if (!p || !p[1]) {
logger(LOG_ERR, "invalid vendor format");
options->vendor[options->vendor[0] + 2] = s;
options->vendor[0] += s + 2;
}
-#endif
break;
case 'A':
options->options &= ~DHCPCD_ARP;
options->options |= DHCPCD_LASTLEASE;
break;
case 'F':
-#ifndef MINIMAL
if (!oarg) {
options->fqdn = FQDN_BOTH;
break;
oarg);
return -1;
}
-#endif
break;
case 'G':
options->options &= ~DHCPCD_GATEWAY;
break;
case 'I':
-#ifndef MINIMAL
/* Strings have a type of 0 */;
options->classid[1] = 0;
if (oarg)
options->options &= ~DHCPCD_DUID;
options->options &= ~DHCPCD_CLIENTID;
}
-#endif
break;
case 'K':
options->options &= ~DHCPCD_LINK;