Lines Matching refs:info

129 static int dhcp_configure(const char *ifname, dhcp_info *info)
131 last_good_info = *info;
132 return ifc_configure(ifname, info->ipaddr, info->prefixLength, info->gateway,
133 info->dns1, info->dns2);
151 void dump_dhcp_info(dhcp_info *info)
155 dhcp_type_to_name(info->type), info->type);
156 strcpy(addr, ipaddr(info->ipaddr));
157 strcpy(gway, ipaddr(info->gateway));
158 ALOGD("ip %s gw %s prefixLength %d", addr, gway, info->prefixLength);
159 if (info->dns1) ALOGD("dns1: %s", ipaddr(info->dns1));
160 if (info->dns2) ALOGD("dns2: %s", ipaddr(info->dns2));
162 ipaddr(info->serveraddr), info->lease);
166 int decode_dhcp_msg(dhcp_msg *msg, int len, dhcp_info *info)
172 memset(info, 0, sizeof(dhcp_info));
203 info->prefixLength = ipv4NetmaskToPrefixLength(mask);
207 if (optlen >= 4) memcpy(&info->gateway, x, 4);
210 if (optlen >= 4) memcpy(&info->dns1, x + 0, 4);
211 if (optlen >= 8) memcpy(&info->dns2, x + 4, 4);
215 memcpy(&info->lease, x, 4);
216 info->lease = ntohl(info->lease);
220 if (optlen >= 4) memcpy(&info->serveraddr, x, 4);
223 info->type = *x;
232 info->ipaddr = msg->yiaddr;
393 dhcp_info info;
416 info.type = 0;
431 if ( info.type == DHCPOFFER ) {
433 return dhcp_configure(ifname, &info);
451 size = init_dhcp_request_msg(msg, hwaddr, xid, info.ipaddr, info.serveraddr);
487 decode_dhcp_msg(&reply, r, &info);
499 if (verbose) dump_dhcp_info(&info);
503 if (info.type == DHCPOFFER) {
511 if (info.type == DHCPACK) {
514 return dhcp_configure(ifname, &info);
515 } else if (info.type == DHCPNAK) {
521 dhcp_type_to_name(info.type), state);