Home | History | Annotate | Download | only in dhcpcd

Lines Matching defs:ip

43 #include <netinet/ip.h>
673 struct ip ip;
707 struct ip *ip;
711 ip = &udpp->ip;
716 * ip structure and an invalid ip_len (basically udp length).
719 * Finally we complete the ip structure and ip checksum.
725 ip
726 ip->ip_src.s_addr = source.s_addr;
728 ip->ip_dst.s_addr = INADDR_BROADCAST;
730 ip->ip_dst.s_addr = dest.s_addr;
735 ip->ip_len = udp->uh_ulen;
738 ip->ip_v = IPVERSION;
739 ip->ip_hl = sizeof(*ip) >> 2;
740 ip->ip_id = arc4random() & UINT16_MAX;
741 ip->ip_ttl = IPDEFTTL;
742 ip->ip_len = htons(sizeof(*ip) + sizeof(*udp) + length);
743 ip->ip_sum = checksum(ip, sizeof(*ip));
746 return sizeof(*ip) + sizeof(*udp) + length;
756 return ntohs(packet.ip.ip_len) -
757 sizeof(packet.ip) -
768 if (data_len < sizeof(packet.ip)) {
776 from->s_addr = packet.ip.ip_src.s_addr;
781 if (checksum(&packet.ip, sizeof(packet.ip)) != 0) {
786 bytes = ntohs(packet.ip.ip_len);
795 packet.ip.ip_hl = 0;
796 packet.ip.ip_v = 0;
797 packet.ip.ip_tos = 0;
798 packet.ip.ip_len = packet.udp.uh_ulen;
799 packet.ip.ip_id = 0;
800 packet.ip.ip_off = 0;
801 packet.ip.ip_ttl = 0;
802 packet.ip.ip_sum = 0;