Lines Matching defs:udp
45 #include <netinet/udp.h>
674 struct udphdr udp;
708 struct udphdr *udp;
712 udp = &udpp->udp;
716 * ip structure and an invalid ip_len (basically udp length).
717 * We then fill the udp structure and put the checksum
718 * of the whole packet into the udp checksum.
720 * If we don't do the ordering like so then the udp checksum will be
732 udp->uh_sport = htons(DHCP_CLIENT_PORT);
733 udp->uh_dport = htons(DHCP_SERVER_PORT);
734 udp->uh_ulen = htons(sizeof(*udp) + length);
735 ip->ip_len = udp->uh_ulen;
736 udp->uh_sum = checksum(udpp, sizeof(*udpp));
742 ip->ip_len = htons(sizeof(*ip) + sizeof(*udp) + length);
746 return sizeof(*ip) + sizeof(*udp) + length;
750 get_udp_data(const uint8_t **data, const uint8_t *udp)
754 memcpy(&packet, udp, sizeof(packet));
755 *data = udp + offsetof(struct udp_dhcp_packet, dhcp);
758 sizeof(packet.udp);
793 udpsum = packet.udp.uh_sum;
794 packet.udp.uh_sum = 0;
798 packet.ip.ip_len = packet.udp.uh_ulen;