Lines Matching refs:p

103 	struct dhcp p = {};  in send_dhcp_discover()  local
108 boottime->copy_mem(p.eth_hdr.et_dest, (void *)BROADCAST_MAC, ARP_HLEN); in send_dhcp_discover()
109 boottime->copy_mem(p.eth_hdr.et_src, &net->mode->current_address, in send_dhcp_discover()
111 p.eth_hdr.et_protlen = htons(PROT_IP); in send_dhcp_discover()
115 p.ip_udp.ip_hl_v = 0x45; in send_dhcp_discover()
116 p.ip_udp.ip_len = htons(sizeof(struct dhcp) - in send_dhcp_discover()
118 p.ip_udp.ip_id = htons(++net_ip_id); in send_dhcp_discover()
119 p.ip_udp.ip_off = htons(IP_FLAGS_DFRAG); in send_dhcp_discover()
120 p.ip_udp.ip_ttl = 0xff; /* time to live */ in send_dhcp_discover()
121 p.ip_udp.ip_p = IPPROTO_UDP; in send_dhcp_discover()
122 boottime->set_mem(&p.ip_udp.ip_dst, 4, 0xff); in send_dhcp_discover()
123 p.ip_udp.ip_sum = efi_ip_checksum(&p.ip_udp, IP_HDR_SIZE); in send_dhcp_discover()
128 p.ip_udp.udp_src = htons(68); in send_dhcp_discover()
129 p.ip_udp.udp_dst = htons(67); in send_dhcp_discover()
130 p.ip_udp.udp_len = htons(sizeof(struct dhcp) - in send_dhcp_discover()
136 p.dhcp_hdr.op = BOOTREQUEST; in send_dhcp_discover()
137 p.dhcp_hdr.htype = HWT_ETHER; in send_dhcp_discover()
138 p.dhcp_hdr.hlen = HWL_ETHER; in send_dhcp_discover()
139 p.dhcp_hdr.flags = htons(DHCP_FLAGS_UNICAST); in send_dhcp_discover()
140 boottime->copy_mem(&p.dhcp_hdr.chaddr, in send_dhcp_discover()
145 p.opt[0] = 0x63; /* DHCP magic cookie */ in send_dhcp_discover()
146 p.opt[1] = 0x82; in send_dhcp_discover()
147 p.opt[2] = 0x53; in send_dhcp_discover()
148 p.opt[3] = 0x63; in send_dhcp_discover()
149 p.opt[4] = DHCP_MESSAGE_TYPE; in send_dhcp_discover()
150 p.opt[5] = 0x01; /* length */ in send_dhcp_discover()
151 p.opt[6] = DHCPDISCOVER; in send_dhcp_discover()
152 p.opt[7] = 0x39; /* maximum message size */ in send_dhcp_discover()
153 p.opt[8] = 0x02; /* length */ in send_dhcp_discover()
154 p.opt[9] = 0x02; /* 576 bytes */ in send_dhcp_discover()
155 p.opt[10] = 0x40; in send_dhcp_discover()
156 p.opt[11] = 0xff; /* end of options */ in send_dhcp_discover()
161 ret = net->transmit(net, 0, sizeof(struct dhcp), &p, NULL, NULL, 0); in send_dhcp_discover()
264 struct dhcp p; in execute() member
344 if (buffer.p.eth_hdr.et_protlen != ntohs(PROT_IP) || in execute()
345 buffer.p.ip_udp.ip_hl_v != 0x45 || in execute()
346 buffer.p.ip_udp.ip_p != IPPROTO_UDP || in execute()
347 buffer.p.ip_udp.udp_src != ntohs(67) || in execute()
348 buffer.p.ip_udp.udp_dst != ntohs(68) || in execute()
349 buffer.p.dhcp_hdr.op != BOOTREPLY) in execute()
360 addr = (u8 *)&buffer.p.ip_udp.ip_src; in execute()