Lines Matching defs:bpc
324 struct bootpcontext *bpc = context;
359 if (bootp->bp_hlen != bpc->halen) {
361 bpc->halen));
364 if (memcmp(bootp->bp_chaddr, bpc->haddr, bpc->halen)) {
368 bp_chaddr = malloc(3 * bpc->halen, M_TEMP, M_WAITOK);
369 haddr = malloc(3 * bpc->halen, M_TEMP, M_WAITOK);
372 ether_snprintf(bp_chaddr, 3 * bpc->halen,
374 ether_snprintf(haddr, 3 * bpc->halen, bpc->haddr)));
381 if (bootp->bp_xid != bpc->xid) {
383 bpc->xid));
393 bpc->replylen = m->m_pkthdr.len;
394 m_copydata(m, 0, bpc->replylen, (void *)bpc->replybuf);
395 bootp = bpc->replybuf;
417 limit = ((u_char*)bootp) + bpc->replylen;
432 if (*p != bpc->expected_dhcpmsgtype)
434 bpc->dhcp_ok = 1;
437 memcpy(&bpc->dhcp_serverip.s_addr, p,
438 sizeof(bpc->dhcp_serverip.s_addr));
494 struct bootpcontext bpc;
507 bpc.replybuf = NULL;
626 bpc.xid = xid;
627 bpc.haddr = haddr;
628 bpc.halen = halen;
629 bpc.replybuf = malloc(BOOTP_SIZE_MAX, M_DEVBUF, M_WAITOK);
630 if (bpc.replybuf == NULL)
633 bpc.expected_dhcpmsgtype = DHCPOFFER;
634 bpc.dhcp_ok = 0;
638 bootpcheck, NULL, NULL, &bpc, lwp);
643 if (bpc.dhcp_ok) {
649 memcpy(&bootp->bp_vend[index], &bpc.replybuf->bp_yiaddr, 4);
653 memcpy(&bootp->bp_vend[index], &bpc.dhcp_serverip.s_addr, 4);
662 bpc.expected_dhcpmsgtype = DHCPACK;
665 bootpcheck, NULL, NULL, &bpc, lwp);
673 * the buffer at bpc.replybuf.
677 (bpc.dhcp_ok ? "DHCP" : "BOOTP"),
681 inet_ntoa(bpc.replybuf->bp_siaddr));
683 bootp_extract(bpc.replybuf, bpc.replylen, nd, flags);
686 if (bpc.replybuf)
687 free(bpc.replybuf, M_DEVBUF);