Lines Matching refs:ip
128 void ip_test1(dev, mtu, ip, gwip, ptest) in ip_test1() argument
131 ip_t *ip;
143 IP_HL_A(ip, sizeof(*ip) >> 2);
144 IP_V_A(ip, IPVERSION);
145 ip->ip_tos = 0;
146 ip->ip_off = 0;
147 ip->ip_ttl = 60;
148 ip->ip_p = IPPROTO_UDP;
149 ip->ip_sum = 0;
150 u = (udphdr_t *)(ip + 1);
155 ip->ip_len = sizeof(*ip) + ntohs(u->uh_ulen);
156 len = ip->ip_len;
166 ip->ip_id = 0;
168 for (i = 0; i < ((sizeof(*ip) + ntohs(u->uh_ulen)) >> 2); i++) {
169 IP_HL_A(ip, i >> 2);
170 (void) send_ip(nfd, 1500, ip, gwip, 1);
182 ip->ip_id = 0;
184 for (; i < ((sizeof(*ip) * 2 + ntohs(u->uh_ulen)) >> 2); i++) {
185 IP_HL_A(ip, i >> 2);
186 (void) send_ip(nfd, 1500, ip, gwip, 1);
198 ip->ip_id = 0;
200 IP_HL_A(ip, sizeof(*ip) >> 2);
202 IP_V_A(ip, i);
203 (void) send_ip(nfd, 1500, ip, gwip, 1);
215 ip->ip_id = 0;
218 IP_V_A(ip, i);
219 (void) send_ip(nfd, 1500, ip, gwip, 1);
231 ip->ip_id = 0;
232 IP_V_A(ip, IPVERSION);
233 i = ip->ip_len + 1;
235 for (; i < (ip->ip_len * 2); i++) {
236 ip->ip_id = htons(id++);
237 ip->ip_sum = 0;
238 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2);
239 (void) send_ether(nfd, (char *)ip, i, gwip);
247 ip->ip_id = htons(id++);
248 ip->ip_len = i;
249 ip->ip_sum = 0;
250 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2);
251 (void) send_ether(nfd, (char *)ip, len, gwip);
263 ip->ip_id = 0;
266 ip->ip_id = htons(id++);
267 ip->ip_len = i;
268 ip->ip_sum = 0;
269 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2);
270 (void) send_ether(nfd, (char *)ip, len, gwip);
276 ip->ip_len = len;
279 ip->ip_id = htons(id++);
280 ip->ip_sum = 0;
281 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2);
282 (void) send_ether(nfd, (char *)ip, i, gwip);
295 ip->ip_id = 0;
296 ip->ip_len = sizeof(*ip);
297 ip->ip_off = htons(IP_MF);
298 (void) send_ip(nfd, mtu, ip, gwip, 1);
303 ip->ip_id = 0;
304 ip->ip_len = sizeof(*ip);
305 ip->ip_off = htons(IP_MF);
306 (void) send_ip(nfd, mtu, ip, gwip, 1);
311 ip->ip_id = 0;
312 ip->ip_len = sizeof(*ip);
313 ip->ip_off = htons(0xa000);
314 (void) send_ip(nfd, mtu, ip, gwip, 1);
319 ip->ip_id = 0;
320 ip->ip_len = sizeof(*ip);
321 ip->ip_off = htons(0x0100);
322 (void) send_ip(nfd, mtu, ip, gwip, 1);
338 ip->ip_p = IPPROTO_ICMP;
339 ip->ip_off = htons(IP_MF);
341 ip->ip_id = htons(id++);
343 ip->ip_len = 768 + 20 + 8;
344 (void) send_ip(nfd, mtu, ip, gwip, 1);
347 ip->ip_len = MIN(768 + 20, mtu - 68);
350 ip->ip_off = htons(IP_MF | (i >> 3));
351 (void) send_ip(nfd, mtu, ip, gwip, 1);
356 ip->ip_len = 896 + 20;
357 ip->ip_off = htons(i >> 3);
358 (void) send_ip(nfd, mtu, ip, gwip, 1);
369 ip->ip_p = IPPROTO_ICMP;
370 ip->ip_off = htons(IP_MF);
372 ip->ip_id = htons(id++);
374 ip->ip_len = 768 + 20 + 8;
376 (void) send_ip(nfd, mtu, ip, gwip, 1);
381 ip->ip_len = MIN(768 + 20, mtu - 68);
384 ip->ip_off = htons(IP_MF | (i >> 3));
386 (void) send_ip(nfd, mtu, ip, gwip, 1);
393 ip->ip_len = 896 + 20;
394 ip->ip_off = htons(i >> 3);
396 (void) send_ip(nfd, mtu, ip, gwip, 1);
409 ip->ip_p = IPPROTO_ICMP;
410 ip->ip_off = htons(IP_MF);
412 ip->ip_id = htons(id++);
414 ip->ip_len = 768 + 20 + 8;
415 (void) send_ip(nfd, mtu, ip, gwip, 1);
418 ip->ip_len = MIN(768 + 20, mtu - 68);
421 ip->ip_off = htons(IP_MF | (i >> 3));
422 (void) send_ip(nfd, mtu, ip, gwip, 1);
427 ip->ip_len = 896 + 20;
428 ip->ip_off = htons(i >> 3);
429 (void) send_ip(nfd, mtu, ip, gwip, 1);
435 ip->ip_len = len;
436 ip->ip_off = 0;
441 ip->ip_id = 0;
442 ip->ip_off = htons(0x8000);
444 (void) send_ip(nfd, mtu, ip, gwip, 1);
449 ip->ip_off = 0;
455 ip->ip_id = 0;
456 ip->ip_ttl = 255;
458 (void) send_ip(nfd, mtu, ip, gwip, 1);
462 ip->ip_ttl = 128;
464 (void) send_ip(nfd, mtu, ip, gwip, 1);
468 ip->ip_ttl = 0;
470 (void) send_ip(nfd, mtu, ip, gwip, 1);
479 void ip_test2(dev, mtu, ip, gwip, ptest) in ip_test2() argument
482 ip_t *ip;
499 IP_HL_A(ip, 6);
500 ip->ip_len = IP_HL(ip) << 2;
501 s = (u_char *)(ip + 1);
512 ip->ip_p = IPPROTO_IP;
514 (void) send_ip(nfd, mtu, ip, gwip, 1);
519 IP_HL_A(ip, 7);
520 ip->ip_len = IP_HL(ip) << 2;
528 (void) send_ip(nfd, mtu, ip, gwip, 1);
535 (void) send_ip(nfd, mtu, ip, gwip, 1);
542 (void) send_ip(nfd, mtu, ip, gwip, 1);
549 (void) send_ip(nfd, mtu, ip, gwip, 1);
556 (void) send_ip(nfd, mtu, ip, gwip, 1);
563 (void) send_ip(nfd, mtu, ip, gwip, 1);
575 void ip_test3(dev, mtu, ip, gwip, ptest) in ip_test3() argument
578 ip_t *ip;
592 IP_HL_A(ip, sizeof(*ip) >> 2);
593 IP_V_A(ip, IPVERSION);
594 ip->ip_tos = 0;
595 ip->ip_off = 0;
596 ip->ip_ttl = 60;
597 ip->ip_p = IPPROTO_ICMP;
598 ip->ip_sum = 0;
599 ip->ip_len = sizeof(*ip) + sizeof(*icp);
600 icp = (struct icmp *)((char *)ip + (IP_HL(ip) << 2));
613 (void) send_icmp(nfd, mtu, ip, gwip);
618 (void) send_icmp(nfd, mtu, ip, gwip);
631 (void) send_icmp(nfd, mtu, ip, gwip);
643 (void) send_icmp(nfd, mtu, ip, gwip);
647 (void) send_icmp(nfd, mtu, ip, gwip);
651 (void) send_icmp(nfd, mtu, ip, gwip);
655 (void) send_icmp(nfd, mtu, ip, gwip);
666 (void) send_icmp(nfd, mtu, ip, gwip);
670 (void) send_icmp(nfd, mtu, ip, gwip);
674 (void) send_icmp(nfd, mtu, ip, gwip);
678 (void) send_icmp(nfd, mtu, ip, gwip);
690 (void) send_icmp(nfd, mtu, ip, gwip);
695 (void) send_icmp(nfd, mtu, ip, gwip);
700 (void) send_icmp(nfd, mtu, ip, gwip);
705 (void) send_icmp(nfd, mtu, ip, gwip);
719 (void) send_icmp(nfd, mtu, ip, gwip);
723 (void) send_icmp(nfd, mtu, ip, gwip);
727 (void) send_icmp(nfd, mtu, ip, gwip);
731 (void) send_icmp(nfd, mtu, ip, gwip);
735 (void) send_icmp(nfd, mtu, ip, gwip);
745 ip->ip_len = sizeof(*ip) + sizeof(*icp) / 2;
749 (void) send_icmp(nfd, mtu, ip, gwip);
754 (void) send_icmp(nfd, mtu, ip, gwip);
759 (void) send_icmp(nfd, mtu, ip, gwip);
764 (void) send_icmp(nfd, mtu, ip, gwip);
776 void ip_test4(dev, mtu, ip, gwip, ptest) in ip_test4() argument
779 ip_t *ip;
792 IP_HL_A(ip, sizeof(*ip) >> 2);
793 IP_V_A(ip, IPVERSION);
794 ip->ip_tos = 0;
795 ip->ip_off = 0;
796 ip->ip_ttl = 60;
797 ip->ip_p = IPPROTO_UDP;
798 ip->ip_sum = 0;
799 u = (udphdr_t *)((char *)ip + (IP_HL(ip) << 2));
813 ip->ip_len = (IP_HL(ip) << 2) + ntohs(u->uh_ulen);
817 (void) send_udp(nfd, 1500, ip, gwip);
830 ip->ip_len = (IP_HL(ip) << 2) + ntohs(u->uh_ulen);
833 ip->ip_len = i;
834 (void) send_udp(nfd, 1500, ip, gwip);
848 ip->ip_len = (IP_HL(ip) << 2) + ntohs(u->uh_ulen);
851 (void) send_udp(nfd, 1500, ip, gwip);
857 (void) send_udp(nfd, 1500, ip, gwip);
863 (void) send_udp(nfd, 1500, ip, gwip);
869 (void) send_udp(nfd, 1500, ip, gwip);
876 (void) send_udp(nfd, 1500, ip, gwip);
889 ip->ip_len = (IP_HL(ip) << 2) + ntohs(u->uh_ulen);
892 (void) send_udp(nfd, 1500, ip, gwip);
898 (void) send_udp(nfd, 1500, ip, gwip);
904 (void) send_udp(nfd, 1500, ip, gwip);
910 (void) send_udp(nfd, 1500, ip, gwip);
916 (void) send_udp(nfd, 1500, ip, gwip);
928 for (i = sizeof(*ip); i <= ntohs(u->uh_ulen); i++) {
929 (void) send_udp(nfd, i, ip, gwip);
941 void ip_test5(dev, mtu, ip, gwip, ptest) in ip_test5() argument
944 ip_t *ip;
956 t = (tcphdr_t *)((char *)ip + (IP_HL(ip) << 2));
968 ip->ip_len = sizeof(ip_t) + sizeof(tcphdr_t);
983 (void) send_tcp(nfd, mtu, ip, gwip);
999 (void) send_tcp(nfd, mtu, ip, gwip);
1005 (void) send_tcp(nfd, mtu, ip, gwip);
1011 (void) send_tcp(nfd, mtu, ip, gwip);
1017 (void) send_tcp(nfd, mtu, ip, gwip);
1023 (void) send_tcp(nfd, mtu, ip, gwip);
1029 (void) send_tcp(nfd, mtu, ip, gwip);
1042 (void) send_tcp(nfd, mtu, ip, gwip);
1048 (void) send_tcp(nfd, mtu, ip, gwip);
1054 (void) send_tcp(nfd, mtu, ip, gwip);
1060 (void) send_tcp(nfd, mtu, ip, gwip);
1066 (void) send_tcp(nfd, mtu, ip, gwip);
1072 (void) send_tcp(nfd, mtu, ip, gwip);
1084 (void) send_tcp(nfd, mtu, ip, gwip);
1090 (void) send_tcp(nfd, mtu, ip, gwip);
1096 (void) send_tcp(nfd, mtu, ip, gwip);
1115 sin.sin_addr.s_addr = ip->ip_dst.s_addr;
1126 inet_ntoa(ip->ip_dst));
1130 bcopy((char *)ip, (char *)&ti, sizeof(*ip));
1152 (void) send_tcp(nfd, mtu, ip, gwip);
1156 ip->ip_len = sizeof(ip_t) + sizeof(tcphdr_t) + 1;
1158 (void) send_tcp(nfd, mtu, ip, gwip);
1161 (void) send_tcp(nfd, mtu, ip, gwip);
1164 (void) send_tcp(nfd, mtu, ip, gwip);
1168 ip->ip_len = sizeof(ip_t) + sizeof(tcphdr_t);
1179 (void) send_tcp(nfd, mtu, ip, gwip);
1185 ip->ip_len = sizeof(ip_t) + sizeof(tcphdr_t);
1204 (void) send_tcp(nfd, mtu, ip, gwip);
1210 (void) send_tcp(nfd, mtu, ip, gwip);
1216 (void) send_tcp(nfd, mtu, ip, gwip);
1222 (void) send_tcp(nfd, mtu, ip, gwip);
1228 (void) send_tcp(nfd, mtu, ip, gwip);
1242 (void) send_tcp(nfd, mtu, ip, gwip);
1248 (void) send_tcp(nfd, mtu, ip, gwip);
1254 (void) send_tcp(nfd, mtu, ip, gwip);
1260 (void) send_tcp(nfd, mtu, ip, gwip);
1266 (void) send_tcp(nfd, mtu, ip, gwip);
1278 ip->ip_src = ip->ip_dst;
1279 (void) send_tcp(nfd, mtu, ip, gwip);
1291 void ip_test6(dev, mtu, ip, gwip, ptest) in ip_test6() argument
1294 ip_t *ip;
1306 IP_V_A(ip, IPVERSION);
1307 ip->ip_tos = 0;
1308 ip->ip_off = 0;
1309 ip->ip_ttl = 60;
1310 ip->ip_p = IPPROTO_UDP;
1311 ip->ip_sum = 0;
1312 u = (udphdr_t *)(ip + 1);
1330 ip->ip_len = sizeof(*ip) + 768 + sizeof(*u);
1331 IP_HL_A(ip, sizeof(*ip) >> 2);
1332 ip->ip_off = htons(IP_MF);
1333 (void) send_ip(nfd, 1500, ip, gwip, 1);
1340 ip->ip_len = sizeof(*ip) + 128 + sizeof(*u);
1341 ip->ip_off = htons(IP_MF);
1342 (void) send_ip(nfd, 1500, ip, gwip, 1);
1348 ip->ip_len = sizeof(*ip) + 768;
1349 ip->ip_off = htons(IP_MF|(j>>3));
1350 (void) send_ip(nfd, 1500, ip, gwip, 1);
1355 ip->ip_len = sizeof(*ip) + 128;
1357 ip->ip_off = htons(IP_MF|(k>>3));
1358 (void) send_ip(nfd, 1500, ip, gwip, 1);
1373 void ip_test7(dev, mtu, ip, gwip, ptest) in ip_test7() argument
1376 ip_t *ip;
1403 bcopy((char *)&ip->ip_dst, (char *)&pip->ip_dst,
1419 bcopy((char *)&ip->ip_dst, (char *)&pip->ip_dst,