Lines Matching refs:uh
65 struct udphdr *uh;
82 uh = (struct udphdr *)pkt - 1;
83 len += sizeof(*uh);
85 uh->uh_sport = d->myport;
86 uh->uh_dport = d->destport;
87 uh->uh_ulen = htons(len);
90 ui->ui_len = uh->uh_ulen;
95 uh->uh_sum = in_cksum(ui, len + sizeof (struct ip));
98 cc = sendip(d, uh, len, IPPROTO_UDP);
103 return (cc - sizeof(*uh));
113 struct udphdr *uh;
121 uh = NULL;
123 n = readip(d, &ptr, (void **)&uh, tleft, IPPROTO_UDP);
124 if (n == -1 || n < sizeof(*uh) || n != ntohs(uh->uh_ulen)) {
129 if (uh->uh_dport != d->myport) {
133 d->myport, ntohs(uh->uh_dport));
140 if (uh->uh_sum) {
145 n = ntohs(uh->uh_ulen) + sizeof(*ip);
148 ip = (struct ip *)uh - 1;
152 ui->ui_len = uh->uh_ulen;
164 if (ntohs(uh->uh_ulen) < sizeof(*uh)) {
168 ntohs(uh->uh_ulen), (int)sizeof(*uh));
174 n = (n > (ntohs(uh->uh_ulen) - sizeof(*uh))) ?
175 ntohs(uh->uh_ulen) - sizeof(*uh) : n;
177 *payload = (void *)((uintptr_t)uh + sizeof(*uh));