Lines Matching refs:bp

121 	struct bootp_hdr *bp = (struct bootp_hdr *)pkt;  in check_reply_packet()  local
128 else if (bp->bp_op != OP_BOOTREPLY) in check_reply_packet()
130 else if (bp->bp_htype != HWT_ETHER) in check_reply_packet()
132 else if (bp->bp_hlen != HWL_ETHER) in check_reply_packet()
134 else if (!bootp_match_id(net_read_u32(&bp->bp_id))) in check_reply_packet()
136 else if (memcmp(bp->bp_chaddr, net_ethaddr, HWL_ETHER) != 0) in check_reply_packet()
147 static void store_net_params(struct bootp_hdr *bp) in store_net_params() argument
152 net_copy_ip(&tmp_ip, &bp->bp_siaddr); in store_net_params()
154 net_copy_ip(&net_server_ip, &bp->bp_siaddr); in store_net_params()
161 (strlen(bp->bp_file) > 0)) { in store_net_params()
162 copy_filename(net_boot_file_name, bp->bp_file, in store_net_params()
175 net_copy_ip(&net_ip, &bp->bp_yiaddr); in store_net_params()
348 struct bootp_hdr *bp; in bootp_handler() local
353 bp = (struct bootp_hdr *)pkt; in bootp_handler()
366 store_net_params(bp); /* Store net parameters from reply */ in bootp_handler()
369 if (net_read_u32((u32 *)&bp->bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC)) in bootp_handler()
370 bootp_process_vendor((uchar *)&bp->bp_vend[4], len); in bootp_handler()
700 struct bootp_hdr *bp; in bootp_request() local
755 bp = (struct bootp_hdr *)pkt; in bootp_request()
756 bp->bp_op = OP_BOOTREQUEST; in bootp_request()
757 bp->bp_htype = HWT_ETHER; in bootp_request()
758 bp->bp_hlen = HWL_ETHER; in bootp_request()
759 bp->bp_hops = 0; in bootp_request()
764 bp->bp_secs = htons(get_timer(bootp_start) / 1000); in bootp_request()
766 net_write_ip(&bp->bp_ciaddr, zero_ip); in bootp_request()
767 net_write_ip(&bp->bp_yiaddr, zero_ip); in bootp_request()
768 net_write_ip(&bp->bp_siaddr, zero_ip); in bootp_request()
769 net_write_ip(&bp->bp_giaddr, zero_ip); in bootp_request()
770 memcpy(bp->bp_chaddr, net_ethaddr, 6); in bootp_request()
771 copy_filename(bp->bp_file, net_boot_file_name, sizeof(bp->bp_file)); in bootp_request()
775 extlen = dhcp_extended((u8 *)bp->bp_vend, DHCP_DISCOVER, zero_ip, in bootp_request()
778 extlen = bootp_extended((u8 *)bp->bp_vend); in bootp_request()
792 net_copy_u32(&bp->bp_id, &bootp_id); in bootp_request()
904 static void dhcp_packet_process_options(struct bootp_hdr *bp) in dhcp_packet_process_options() argument
906 uchar *popt = (uchar *)&bp->bp_vend[4]; in dhcp_packet_process_options()
909 if (net_read_u32((u32 *)&bp->bp_vend[0]) != htonl(BOOTP_VENDOR_MAGIC)) 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()
927 popt = (uchar *)bp->bp_sname; in dhcp_packet_process_options()
928 end = popt + sizeof(bp->bp_sname); in dhcp_packet_process_options()
956 struct bootp_hdr *bp; in dhcp_send_request_packet() local
973 bp = (struct bootp_hdr *)pkt; in dhcp_send_request_packet()
974 bp->bp_op = OP_BOOTREQUEST; in dhcp_send_request_packet()
975 bp->bp_htype = HWT_ETHER; in dhcp_send_request_packet()
976 bp->bp_hlen = HWL_ETHER; in dhcp_send_request_packet()
977 bp->bp_hops = 0; in dhcp_send_request_packet()
978 bp->bp_secs = htons(get_timer(bootp_start) / 1000); in dhcp_send_request_packet()
987 net_write_ip(&bp->bp_giaddr, zero_ip); in dhcp_send_request_packet()
989 memcpy(bp->bp_chaddr, net_ethaddr, 6); in dhcp_send_request_packet()
990 copy_filename(bp->bp_file, net_boot_file_name, sizeof(bp->bp_file)); in dhcp_send_request_packet()
996 net_copy_u32(&bp->bp_id, &bp_offer->bp_id); in dhcp_send_request_packet()
1004 extlen = dhcp_extended((u8 *)bp->bp_vend, DHCP_REQUEST, in dhcp_send_request_packet()
1025 struct bootp_hdr *bp = (struct bootp_hdr *)pkt; in dhcp_handler() local
1037 if (net_read_ip(&bp->bp_yiaddr).s_addr == 0) in dhcp_handler()
1048 debug("DHCP: state=SELECTING bp_file: \"%s\"\n", bp->bp_file); in dhcp_handler()
1050 if (strncmp(bp->bp_file, in dhcp_handler()
1054 dhcp_packet_process_options(bp); in dhcp_handler()
1061 dhcp_send_request_packet(bp); in dhcp_handler()
1071 if (dhcp_message_type((u8 *)bp->bp_vend) == DHCP_ACK) { in dhcp_handler()
1072 dhcp_packet_process_options(bp); in dhcp_handler()
1074 store_net_params(bp); in dhcp_handler()