Lines Matching refs:popt

814 static void dhcp_process_options(uchar *popt, uchar *end)  in dhcp_process_options()  argument
821 while (popt < end && *popt != 0xff) { in dhcp_process_options()
822 oplen = *(popt + 1); in dhcp_process_options()
823 switch (*popt) { in dhcp_process_options()
828 net_copy_ip(&net_netmask, (popt + 2)); in dhcp_process_options()
833 net_copy_u32((u32 *)to_ptr, (u32 *)(popt + 2)); in dhcp_process_options()
838 net_copy_ip(&net_gateway, (popt + 2)); in dhcp_process_options()
841 net_copy_ip(&net_dns_server, (popt + 2)); in dhcp_process_options()
843 if (*(popt + 1) > 4) in dhcp_process_options()
844 net_copy_ip(&net_dns_server2, (popt + 2 + 4)); in dhcp_process_options()
850 memcpy(&net_hostname, popt + 2, size); in dhcp_process_options()
858 memcpy(&net_root_path, popt + 2, size); in dhcp_process_options()
865 net_copy_ip(&net_ntp_server, (popt + 2)); in dhcp_process_options()
869 net_copy_u32(&dhcp_leasetime, (u32 *)(popt + 2)); in dhcp_process_options()
872 dhcp_option_overload = popt[2]; in dhcp_process_options()
877 net_copy_ip(&dhcp_server_ip, (popt + 2)); in dhcp_process_options()
888 memcpy(&net_boot_file_name, popt + 2, size); in dhcp_process_options()
893 if (dhcp_vendorex_proc(popt)) in dhcp_process_options()
897 " %d\n", *popt); in dhcp_process_options()
900 popt += oplen + 2; /* Process next option */ in dhcp_process_options()
906 uchar *popt = (uchar *)&bp->bp_vend[4]; in dhcp_packet_process_options() local
907 uchar *end = popt + BOOTP_HDR_SIZE; in dhcp_packet_process_options()
918 dhcp_process_options(popt, end); in dhcp_packet_process_options()
921 popt = (uchar *)bp->bp_file; in dhcp_packet_process_options()
922 end = popt + sizeof(bp->bp_file); in dhcp_packet_process_options()
923 dhcp_process_options(popt, end); in dhcp_packet_process_options()
927 popt = (uchar *)bp->bp_sname; in dhcp_packet_process_options()
928 end = popt + sizeof(bp->bp_sname); in dhcp_packet_process_options()
929 dhcp_process_options(popt, end); in dhcp_packet_process_options()
933 static int dhcp_message_type(unsigned char *popt) in dhcp_message_type() argument
935 if (net_read_u32((u32 *)popt) != htonl(BOOTP_VENDOR_MAGIC)) in dhcp_message_type()
938 popt += 4; in dhcp_message_type()
939 while (*popt != 0xff) { in dhcp_message_type()
940 if (*popt == 53) /* DHCP Message Type */ in dhcp_message_type()
941 return *(popt + 2); in dhcp_message_type()
942 if (*popt == 0) { in dhcp_message_type()
944 popt += 1; in dhcp_message_type()
947 popt += *(popt + 1) + 2; in dhcp_message_type()