Home | History | Annotate | Download | only in rump_dhcpclient

Lines Matching defs:packet

48 #  include <netpacket/packet.h>
400 make_udp_packet(uint8_t **packet, const uint8_t *data, size_t length,
412 * We copy the data to our packet and then create a small part of the
415 * of the whole packet into the udp checksum.
442 *packet = (uint8_t *)udpp;
449 struct udp_dhcp_packet packet;
451 memcpy(&packet, udp, sizeof(packet));
453 return ntohs(packet.ip.ip_len) -
454 sizeof(packet.ip) -
455 sizeof(packet.udp);
461 struct udp_dhcp_packet packet;
464 if (data_len < sizeof(packet.ip)) {
470 memcpy(&packet, data, MIN(data_len, sizeof(packet)));
472 from->s_addr = packet.ip.ip_src.s_addr;
473 if (data_len > sizeof(packet)) {
477 if (checksum(&packet.ip, sizeof(packet.ip)) != 0) {
482 bytes = ntohs(packet.ip.ip_len);
487 udpsum = packet.udp.uh_sum;
488 packet.udp.uh_sum = 0;
489 packet.ip.ip_hl = 0;
490 packet.ip.ip_v = 0;
491 packet.ip.ip_tos = 0;
492 packet.ip.ip_len = packet.udp.uh_ulen;
493 packet.ip.ip_id = 0;
494 packet.ip.ip_off = 0;
495 packet.ip.ip_ttl = 0;
496 packet.ip.ip_sum = 0;
497 if (udpsum && checksum(&packet, bytes) != udpsum) {