Home | History | Annotate | Download | only in rump_dhcpclient

Lines Matching defs:udp

44 #define __FAVOR_BSD /* Nasty glibc hack so we can use BSD semantics for UDP */
45 #include <netinet/udp.h>
371 struct udphdr udp;
405 struct udphdr *udp;
409 udp = &udpp->udp;
413 * ip structure and an invalid ip_len (basically udp length).
414 * We then fill the udp structure and put the checksum
415 * of the whole packet into the udp checksum.
417 * If we don't do the ordering like so then the udp checksum will be
429 udp->uh_sport = htons(DHCP_CLIENT_PORT);
430 udp->uh_dport = htons(DHCP_SERVER_PORT);
431 udp->uh_ulen = htons(sizeof(*udp) + length);
432 ip->ip_len = udp->uh_ulen;
433 udp->uh_sum = checksum(udpp, sizeof(*udpp));
439 ip->ip_len = htons(sizeof(*ip) + sizeof(*udp) + length);
443 return sizeof(*ip) + sizeof(*udp) + length;
447 get_udp_data(const uint8_t **data, const uint8_t *udp)
451 memcpy(&packet, udp, sizeof(packet));
452 *data = udp + offsetof(struct udp_dhcp_packet, dhcp);
455 sizeof(packet.udp);
487 udpsum = packet.udp.uh_sum;
488 packet.udp.uh_sum = 0;
492 packet.ip.ip_len = packet.udp.uh_ulen;