• Home
  • Raw
  • Download

Lines Matching refs:info

127 static int dhcp_configure(const char *ifname, dhcp_info *info)  in dhcp_configure()  argument
129 last_good_info = *info; in dhcp_configure()
130 return ifc_configure(ifname, info->ipaddr, info->prefixLength, info->gateway, in dhcp_configure()
131 info->dns1, info->dns2); in dhcp_configure()
149 void dump_dhcp_info(dhcp_info *info) in dump_dhcp_info() argument
153 dhcp_type_to_name(info->type), info->type); in dump_dhcp_info()
154 strcpy(addr, ipaddr(info->ipaddr)); in dump_dhcp_info()
155 strcpy(gway, ipaddr(info->gateway)); in dump_dhcp_info()
156 ALOGD("ip %s gw %s prefixLength %d", addr, gway, info->prefixLength); in dump_dhcp_info()
157 if (info->dns1) ALOGD("dns1: %s", ipaddr(info->dns1)); in dump_dhcp_info()
158 if (info->dns2) ALOGD("dns2: %s", ipaddr(info->dns2)); in dump_dhcp_info()
160 ipaddr(info->serveraddr), info->lease); in dump_dhcp_info()
164 int decode_dhcp_msg(dhcp_msg *msg, int len, dhcp_info *info) in decode_dhcp_msg() argument
170 memset(info, 0, sizeof(dhcp_info)); in decode_dhcp_msg()
201 info->prefixLength = ipv4NetmaskToPrefixLength(mask); in decode_dhcp_msg()
205 if (optlen >= 4) memcpy(&info->gateway, x, 4); in decode_dhcp_msg()
208 if (optlen >= 4) memcpy(&info->dns1, x + 0, 4); in decode_dhcp_msg()
209 if (optlen >= 8) memcpy(&info->dns2, x + 4, 4); in decode_dhcp_msg()
213 memcpy(&info->lease, x, 4); in decode_dhcp_msg()
214 info->lease = ntohl(info->lease); in decode_dhcp_msg()
218 if (optlen >= 4) memcpy(&info->serveraddr, x, 4); in decode_dhcp_msg()
221 info->type = *x; in decode_dhcp_msg()
230 info->ipaddr = msg->yiaddr; in decode_dhcp_msg()
393 dhcp_info info; in dhcp_init_ifc() local
416 info.type = 0; in dhcp_init_ifc()
431 if ( info.type == DHCPOFFER ) { in dhcp_init_ifc()
433 return dhcp_configure(ifname, &info); in dhcp_init_ifc()
451 size = init_dhcp_request_msg(msg, hwaddr, xid, info.ipaddr, info.serveraddr); in dhcp_init_ifc()
487 decode_dhcp_msg(&reply, r, &info); in dhcp_init_ifc()
499 if (verbose) dump_dhcp_info(&info); in dhcp_init_ifc()
503 if (info.type == DHCPOFFER) { in dhcp_init_ifc()
511 if (info.type == DHCPACK) { in dhcp_init_ifc()
514 return dhcp_configure(ifname, &info); in dhcp_init_ifc()
515 } else if (info.type == DHCPNAK) { in dhcp_init_ifc()
521 dhcp_type_to_name(info.type), state); in dhcp_init_ifc()