Home | History | Annotate | Download | only in dhcpcd

Lines Matching refs:udp

43 #define __FAVOR_BSD /* Nasty glibc hack so we can use BSD semantics for UDP */
44 #include <netinet/udp.h>
547 struct udphdr udp;
581 struct udphdr *udp;
585 udp = &udpp->udp;
589 * ip structure and an invalid ip_len (basically udp length).
590 * We then fill the udp structure and put the checksum
591 * of the whole packet into the udp checksum.
593 * If we don't do the ordering like so then the udp checksum will be
605 udp->uh_sport = htons(DHCP_CLIENT_PORT);
606 udp->uh_dport = htons(DHCP_SERVER_PORT);
607 udp->uh_ulen = htons(sizeof(*udp) + length);
608 ip->ip_len = udp->uh_ulen;
609 udp->uh_sum = checksum(udpp, sizeof(*udpp));
615 ip->ip_len = htons (sizeof(*ip) + sizeof(*udp) + length);
623 return sizeof(*ip) + sizeof(*udp) + length;
627 get_udp_data(const uint8_t **data, const uint8_t *udp)
631 memcpy(&packet, udp, sizeof(packet));
632 *data = udp + offsetof(struct udp_dhcp_packet, dhcp);
633 return ntohs(packet.ip.ip_len) - sizeof(packet.ip) - sizeof(packet.udp);
657 udpsum = packet.udp.uh_sum;
658 packet.udp.uh_sum = 0;
662 packet.ip.ip_len = packet.udp.uh_ulen;