Lines Matching refs:ip
172 struct iphdr ip; in sendRawUdp() local
175 ip.version = IPVERSION; in sendRawUdp()
176 ip.ihl = sizeof(ip) >> 2; in sendRawUdp()
177 ip.tos = 0; in sendRawUdp()
178 ip.tot_len = htons(sizeof(ip) + sizeof(udp) + message.size()); in sendRawUdp()
179 ip.id = 0; in sendRawUdp()
180 ip.frag_off = 0; in sendRawUdp()
181 ip.ttl = IPDEFTTL; in sendRawUdp()
182 ip.protocol = IPPROTO_UDP; in sendRawUdp()
183 ip.check = 0; in sendRawUdp()
184 ip.saddr = source; in sendRawUdp()
185 ip.daddr = destination; in sendRawUdp()
186 ip.check = finishChecksum(addChecksum(ip, 0)); in sendRawUdp()
194 udpChecksum = addChecksum(ip.saddr, udpChecksum); in sendRawUdp()
195 udpChecksum = addChecksum(ip.daddr, udpChecksum); in sendRawUdp()
204 iov[0].iov_base = static_cast<void*>(&ip); in sendRawUdp()
205 iov[0].iov_len = sizeof(ip); in sendRawUdp()
270 struct iphdr ip; in receiveRawUdp() local
274 iov[0].iov_base = &ip; in receiveRawUdp()
275 iov[0].iov_len = sizeof(ip); in receiveRawUdp()
285 if (static_cast<size_t>(bytesRead) < sizeof(ip) + sizeof(udp)) { in receiveRawUdp()
290 *isValid = ip.version == IPVERSION && in receiveRawUdp()
291 ip.ihl == (sizeof(ip) >> 2) && in receiveRawUdp()
292 ip.protocol == IPPROTO_UDP && in receiveRawUdp()
295 message->setSize(bytesRead - sizeof(ip) - sizeof(udp)); in receiveRawUdp()